Getting XUL:Scale to show what numeric value is selected - firefox

I'm working with XUL, and below is abasic slider/scale implementation:
<scale value="1" min="1" max="10" increment="1"/>
However I want a numbox next to it which displays the value selected in the slider, and maybe I didn't look hard enough in the XUL tutorial, but I couldn't find a feasible answer.

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<scale value="1" min="1" max="10" increment="1" id="a"/>
<textbox readonly="true" observes="a"/>
</window>

Related

Joomla4 : how to set parameters in an extension?

I have developed a Joomla3 extension and I try to run in in Joomla4.1
In my XML file:
<extension version="3.1" type="plugin" group="content" method="upgrade">
<config>
<fields name="params">
<fieldset name="basic">
<field name="webmasterid" type="text" default="" label="Enter webmasterid"/>
<field name="password" type="password" default="" label="Enter Password"/>
</fieldset>
</fields>
</config>
But I don't see any way from my /administrator/ panel where I can set these 2 params:
webmasterid, password
What is the correct way to have them displayed in /administrator/ panel ?
(the plugin still works correctly, but I have to set these values directly in my plugin code)

How can I make even-width columns?

I am very perplexed with the XUL's 'Box Model' layout.
I want to make a table-like layout of elements.
The layout should consist of one row and three columns.
The columns should have the same width and occupy the whole width of the page.
I will put different elements inside the columns, but the width of the columns should remain the same
and the elements should have their normal sizes, not stretched out.
Say, first column is empty, second contains an image, third contains a button.
How can I achieve that?
I tried boxes and grids, but the columns just seem to assume arbitrary width.
Thank you.
This does not work:
<grid>
<columns flex="1">
<column/>
<column/>
<column/>
</columns>
<rows>
<row>
<spacer flex="1"/>
<image src="MyImage.png"/>
<button id="MyButton" label="MyButton"/>
</row>
</rows>
</grid>
Specify the min and max width of each column and make each cell in the grid an hbox width specific widths and heights. Something like this:
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:h="http://www.w3.org/1999/xhtml">
<grid>
<columns flex="1">
<column maxwidth="100" minwidth="100"/>
<column maxwidth="100" minwidth="100"/>
<column maxwidth="100" minwidth="100"/>
</columns>
<rows>
<row>
<hbox maxwidth="100">
xxxx xxxxxxxx xxxx xxxxx xxxxxxxx xxxxxxxx
</hbox>
<hbox maxwidth="100" minwidth="100" maxheight="10">
<button id="MyButton1" label="MyButton1"/>
</hbox>
<hbox maxwidth="100" minwidth="100" maxheight="30">
<button id="MyButton1" label="MyButton2"/>
</hbox>
<hbox maxwidth="100" minwidth="100" maxheight="40">
<button id="MyButton3" label="MyButton3"/>
</hbox>
</row>
</rows>
</grid>
</window>
In Xul, the width and length attributes are always in pixels. You cannot specify a percentage like you can with css. This means you will have to know your page width in advance and specify widths accordingly if you want the columns to be evenly spaced and extend to the page width.
Here's another way. Use this:
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:h="http://www.w3.org/1999/xhtml">
<grid>
<columns>
<column flex="1"/>
<column flex="1"/>
<column flex="1"/>
</columns>
<rows>
<row>
<button label="MyButton1"/>
<button label="MyButton2"/>
<button label="MyButton3"/>
</row>
</rows>
</grid>
</window>
to create this:
The buttons/columns will adjust as the window size is changed.
I suggest to use in combo with flex="1" on the column elements
<columns equalsize="always">
<column flex="1">
...
a/p documentation
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/equalsize
you can also use equalsize="always" on the rows as well, this is how it is accomplished in the Thunderbird Lightning calendar layout

zk can't access method in included .zul

When I try the below code (as is suggested here by Ryan Wu for question):
<?page title="Auto Generated index.zul"?>
<window title="Hello World 2!!" border="none" width="600px">
<include id="inc" src="/zk/wind.zul" mode="instant" />
<button label="do it" onClick="inc$wind.doModal()" />
</window>
After pressing the button I am getting this error:
inc$wind.doModal();'' : Attempt to resolve method: doModal() on undefined variable or class name
The file wind.zul looks as
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="wind" title="new page title" border="normal" visible="false" width="300px">
New Content Here!
</window>
</zk>
Can someone let me know what is wrong? Thanks...
According to http://books.zkoss.org/wiki/ZK%20Developer%27s%20Reference/UI%20Composing/ID%20Space
I need:
1. use 'Path'
2. add some ID for main window (f.i. id="w0")
and write in index.zul something similar ( file wind.zul not changed)
<?page title="Auto Generated index.zul"?>
<window id="w0" title="Hello World 2!!" border="none" width="600px">
<include id="inc" src="/zk/wind.zul" mode="instant" />
<button label="do it" onClick='Path.getComponent("/w0/inc/wind").doModal()' />
</window>
Thanks for me own :))

Joomla: what is wrong with my plugins XML - config-section is not shown?

I am trying to upgrade an old mambot. It's possible that there are still bugs in the code, but even the config-screen does not show up, only the basic pi-parameters are there, none of mine. What am I missing?
<?xml version="1.0" encoding="iso-8859-1" ?>
<extension type="plugin" group="content" version="1.6" method="upgrade">
<name>mb_append</name>
<creationDate>June 08, 2013</creationDate>
<version>1.1</version>
<author>Michael Baas</author>
<authorName>Michael Baas</authorName>
<authorEmail>michael#mbaas.de</authorEmail>
<authorUrl>mbaas.de</authorUrl>
<description>
<![CDATA[
<p>Very simple bot to append constant <i>(configureable)</i> text (i.e. <br>-tags!) to the
article and the output. 'Output' includes the "ReadMore..."-Link (but not the
navigation). (However, if you absolutely
need this, let me know and I may implement it, but it's a bit tricky, so I would only
do this if somebody can convince me he needs it ;)</p>
<p>In case you want to insert multiple texts between the output of other plugins etc., you can
create further instances of this plugin by simply renaming the PHP and XML in the
installation-ZIP AND by adjusting the names in the XML and then just install your
'new' mambot! :)</p>
<p><b>Links</b> <i>(automatically open in new window)</i>:
<ul>
<li>Michael's Homepage
</ul>
]]>
</description>
<copyright>(c) 2013 Michael Baas</copyright>
<license>GPL</license>
<files>
<filename plugin="mb_append">mb_append.php</filename>
</files>
<config>
<fields name="config">
<fieldset name="basic">
<field name="txt_app" type="text" default="" label="Append 2 article" description="The text you want to append to the article" size="40" />
<field name="txt" type="text" default="" label="Append 2 output" description="The text you want to append to the output" size="40"/>
<field name="look4txt" type="radio" value="1" label="Check if txt already there?" description="Check if the specified text has already been added to the text and do not add again if this option is activated.">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
<field name="excat" type="text" default="" label="Categories to EXCLUDE" description="Comma-separated list of IDs" size="40"/>
<field name="exid" type="text" default="" label="Article-IDs to EXCLUDE" description="Comma-separated list of IDs OR a 'less-than'-sign (arrow-left) followed by ONE number to exclude all IDs smaller than thew number you specified!" size="40" />
</fieldset>
</fields>
</config>
</extension>
Change the <fields name="config"> to <fields name="params">. This might work then.

Netbeans separted TopComponent in editor mode ignores minimum size

In my Netbeans 7.11 application I have an additional separated topcomponent in an editor mode that does not respect the minimum size that I specified using the GUI-builder.
The option for "Respect Minimum Size When Resizing Windows" in the Window System tab of the branding is checked.
My .wsmode file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mode PUBLIC
"-//NetBeans//DTD Mode Properties 2.0//EN"
"http://www.netbeans.org/dtds/mode-properties2_0.dtd">
<mode version="2.0">
<name unique="myTopComponent" />
<kind type="view" />
<state type="separated" />
<constraints>
<path orientation="horizontal" number="0" weight="1" />
<path orientation="vertical" number="0" weight="1" />
</constraints>
<bounds x="150" y="150" width="1200" height="670" />
<frame state="0"/>
<empty-behavior permanent="true" />
</mode>
What am I doing wrong or what am I missing?

Resources