Search completed in 1.04 seconds.
8 results for "ondialogaccept":
Dialogs and Prompts - Archive of obsolete content
Archive › Add-ons › Code snippets › Dialogs and Prompts
y customizable, see below). simple dialog code the following xul code defines a simple dialog with two buttons, ok and cancel (buttons="accept,cancel" attribute on dialog). <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." title="..." buttons="accept,cancel" ondialogaccept="return onaccept();" ondialogcancel="return oncancel();"> <script src="chrome://..."/> <!-- content --> </dialog> you need to implement onaccept and oncancel functions in your script. if they return anything but false, the dialog will be closed. buttons in <dialog> predefined there are six button types you can use in the buttons attribute of dialog. they are: accept — ok button. can...
...ch of these buttons you can set their label, accesskey and oncommand handler by adding buttonlabel<buttonname>, buttonaccesskey<buttonname> and ondialog<buttonname> attributes to the dialog element. for example, to add an apply button to your dialog, use the following code: <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." buttons="accept,cancel,extra1" ondialogaccept="onaccept();" ondialogextra1="onapply();" buttonlabelextra1="apply" buttonaccesskeyextra1="a"> <!-- content --> </dialog> you can even get the element object for any of predefined buttons with gdialog.getbutton(dlgtype);, where gdialog is the <dialog> element and dlgtype is one of the six button types listed above. explicit if you are not satisfied with the layout of predefined buttons...
... dialog element instead of putting oncommand on the button with dlgtype, because button's oncommand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too. example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" ondialogaccept="alert('ok!');"> <hbox> <label value="hey!"/> <spacer flex="1"/> <vbox> <button dlgtype="accept"/> <button dlgtype="cancel"/> </vbox> </hbox> </dialog> default button since firefox 1.5, there are defaultbutton attributes and properties on the <dialog> element bug 284776. the possible values for the attribute are the names of buttons listed above, and the default is "accept", fo...
...dialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // user clicked ok. process changed arguments; e.g. write them to disk or whatever } else { // user clicked cancel. typically, nothing is done here. ...
Creating Dialogs - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Creating Dialogs
. this mechanism is necessary because different platforms have a specific order in which the buttons appear. example dialog source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" ondialogaccept="return dook();" ondialogcancel="return docancel();"> <script> function dook(){ alert("you pressed ok!"); return true; } function docancel(){ alert("you pressed cancel!"); return true; } </script> <description value="select a button"/> </dialog> you may place any elements that you wish in a dialog. the dialog element has some additional attributes that windows do not have. t...
...nal attributes that windows do not have. the buttons attribute is used to specify which buttons should appear in the dialog. the following values may be used, seperated by commas: accept - an ok button cancel - a cancel button help - a help button disclosure - a disclosure button, which is used for showing more information you can set code to execute when the buttons are pressed using the ondialogaccept, ondialogcancel, ondialoghelp and ondialogdisclosure attributes. if you try the example above, you will find that the dook() function is called when the ok button is pressed and the docancel() function is called when the cancel button is pressed. the two functions dook() and docancel() both return true, which indicates that the dialog should be closed. if the dialog shouldn't be closed, false sh...
... dialog with more features <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" buttonlabelaccept="set favourite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <caption label="select favourite fruit"/> <radio id="orange" label="...
prefwindow - Archive of obsolete content
Archive › Mozilla › XUL › prefwindow
ow() with a null parentwindow. this does not work with prefwindows, breaking the general behavior of the window and in particular the list of prefpanes. prefer the classical window.opendialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". ...
...ed type: string set this to the id of the last selected pane. it will be opened by default the next time the preferences dialog is opened. onbeforeaccept type: script code the code in this attribute is called when the ok button is pressed or the acceptdialog method is called. returning false doesn't currently prevent the dialog from closing, but does prevent saving (bug 474527). ondialogaccept type: script code the code in this attribute is called when the accept button is pressed, or when the acceptdialog method is called. if the handler returns true, the dialog will indeed go away, but if it returns false it will not. ondialogcancel type: script code the code in this attribute is called when the "cancel" button is pressed or when the canceldialog method is called. if the ro...
Dialogs in XULRunner - Archive of obsolete content
Archive › Mozilla › XULRunner › Dialogs in XULRunner
ndows. ...
...ttributes on dialog; see also creating dialogs at mozillazine knowledge base: buttons a comma separated list of buttons to show on dialog (accept, cancel, help, extra1, and extra2). buttonlabelaccept label for the accept button; similar attributes exist for the other button types. buttonaccesskeyaccept access key for the accept button; similar attributes exist for the other button types. ondialogaccept javascript to execute if the accept button is pressed; similar attributes exist for the other button types. xul has a wide range of input controls you can use in a dialog. in the future, i will try to go into more detail on some of the existing and planned xul input controls. not too sure if i’ll use the <dialogheader>, but if i did, the single element would be a big time saver over building...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
Archive › Add-ons › Overlay Extensions › Firefox addons developer guide › Introduction to XUL—How to build a more intuitive UI
ent handlers are not defined, pressing either the accept button or cancel button will simply close that dialog. listing 8 shows a simple dialog example, and figure 5 shows its output. ...
Adding windows and dialogs - Archive of obsolete content
Archive › Add-ons › Overlay Extensions › XUL School › Adding windows and dialogs
gs that are not the same for all systems, so you should avoid making dialogs from scratch or overriding the default dialog css styles. the dialog element handles all of this transparently. all you need to do is define which buttons you'll need and the actions associated with them. <dialog id="xulschoolhello-hello-dialog" title="&xulschoolhello.hellodialog.title;" buttons="accept,cancel" ondialogaccept="return xulschoolchrome.hellodialog.accept();" ondialogcancel="return xulschoolchrome.hellodialog.cancel();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> carefully read the specification of the dialog element. you'll see that you can choose from a wide variety of buttons, associate any action you need to them, override their labels, and even add completely customi...
Attribute (XUL) - Archive of obsolete content
Archive › Mozilla › XUL › Attribute
max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizard...
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
red in different ways for different xul input elements as listed below: 219 onclick xul attributes, xul reference no summary! 220 onclosetab xul attributes, xul reference no summary! 221 oncommand xul attributes, xul reference no summary! 222 oncommandupdate xul attributes, xul reference no summary! 223 ondialogaccept xul attributes, xul reference no summary! 224 ondialogcancel xul attributes, xul reference no summary! 225 ondialogdisclosure xul attributes, xul reference no summary! 226 ondialogextra1 xul attributes, xul reference no summary! 227 ondialogextra2 xul attributes, xul reference no summary! 228 ...