r22278 by gpittman -

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 25 20:31:59 UTC 2017


Author: gpittman
Date: Mon Dec 25 20:31:59 2017
New Revision: 22278

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22278
Log:
fixing some misinformation about return values for dialog buttons

Modified:
    trunk/Scribus/doc/en/menu.xml
    trunk/Scribus/doc/en/scripterapi-constants.html
    trunk/Scribus/doc/en/scripterapi-dialogs.html

Modified: trunk/Scribus/doc/en/menu.xml
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22278&path=/trunk/Scribus/doc/en/menu.xml
==============================================================================
--- trunk/Scribus/doc/en/menu.xml	(original)
+++ trunk/Scribus/doc/en/menu.xml	Mon Dec 25 20:31:59 2017
@@ -137,7 +137,7 @@
 			<submenuitem text="PDF Export" file="scripterapi-PDFfile.html"/>
 			<submenuitem text="Printing" file="scripterapi-Printer.html"/>
 			<submenuitem text="Image Export" file="scripterapi-ImageExport.html"/>
-			<submenuitem text="Pre-defined Constants" file="scripterapi-constants.html"/>
+			<submenuitem text="Predefined Constants" file="scripterapi-constants.html"/>
 			<submenuitem text="Scripter Extensions" file="scripter-extensions.html"/>
 			<submenuitem text="Scripter Extensions API" file="scripterapi-extensions.html"/>
 		</submenuitem>

Modified: trunk/Scribus/doc/en/scripterapi-constants.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22278&path=/trunk/Scribus/doc/en/scripterapi-constants.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-constants.html	(original)
+++ trunk/Scribus/doc/en/scripterapi-constants.html	Mon Dec 25 20:31:59 2017
@@ -18,11 +18,13 @@
 <pre>
 if scribus.scribus_version_info[:3] < (1,2,2):
     messageBox("Scribus - Python script",
-        "This script requires Scribus 1.2.2 or newer. "+\
-        "You're running %s." % scribus.scribus_version,
-        ICON_CRITICAL)
+        "This script requires Scribus 1.2.2 or newer. "+"You're running %s." % scribus.scribus_version, scribus.ICON_CRITICAL)
     sys.exit()
 </pre>
+<p><em>Note that if you are using this style of import statement:</em></p>
+<pre>import scribus</pre>
+<p>you will need to add a prefix to these predefined constants, for example, <strong>scribus.ICON_CRITICAL</strong>.</p>
+
 
 <h4>Unit Enumeration Constants: </h4>
 <dl>
@@ -183,16 +185,22 @@
 </dl>
 
 <h4>Dialog Buttons</h4>
-<dl>
-    <dt>BUTTON_ABORT</dt>
-    <dt>BUTTON_CANCEL</dt>
-    <dt>BUTTON_IGNORE</dt>
-    <dt>BUTTON_NO</dt>
-    <dt>BUTTON_NONE</dt>
-    <dt>BUTTON_OK</dt>
-    <dt>BUTTON_RETRY</dt>
-    <dt>BUTTON_YES</dt>
-</dl>
+<p>
+<table>
+<tr><td><strong>Button Type</strong></td><td><strong>Return Value</strong></td></tr>
+<tr>    <td>BUTTON_ABORT</td><td>262144</td></tr>
+<tr>    <td>BUTTON_CANCEL</td><td>4194304</td></tr>
+    <tr><td>BUTTON_IGNORE</td><td>1048576</td></tr>
+    <tr><td>BUTTON_NO</td><td>65536</td></tr>
+    <tr><td>BUTTON_NONE</td><td>N/A</td></tr>
+    <tr><td>BUTTON_OK</td><td>1024</td></tr>
+    <tr><td>BUTTON_RETRY</td><td>524288</td></tr>
+    <tr><td>BUTTON_YES</td><td>16384</td></tr>
+</table></p>
+
+<p>There is also a hierarchy of buttons in terms of how they appear in the dialogs, with this ordering, left to right:</p>
+<p>BUTTON_YES, BUTTON_NO, BUTTON_OK, BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT, BUTTON_CANCEL</p>
+<p>For example, even if you assign CANCEL to button1, RETRY to button2, and YES to button3, they will appear YES, RETRY, and CANCEL left to right in the dialog.</p>
 
 <h4>Dialog Icons</h4>
 <dl>

Modified: trunk/Scribus/doc/en/scripterapi-dialogs.html
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22278&path=/trunk/Scribus/doc/en/scripterapi-dialogs.html
==============================================================================
--- trunk/Scribus/doc/en/scripterapi-dialogs.html	(original)
+++ trunk/Scribus/doc/en/scripterapi-dialogs.html	Mon Dec 25 20:31:59 2017
@@ -36,7 +36,7 @@
 icon=ICON_NONE, button1=BUTTON_OK|BUTTONOPT_DEFAULT,
 button2=BUTTON_NONE, button3=BUTTON_NONE) -> integer</code>
 <p>Displays a message box with the title "caption", the message "message", and an icon "icon" and up to 3 buttons. By default no icon is used and a single button, OK, is displayed. Only the caption and message arguments are required, though setting an icon and appropriate button(s) is strongly recommended. The message text may contain simple HTML-like markup.</p>
-<p>Returns the number of the button the user pressed. Button numbers start at 1.</p>
+<p>Returns the integer value of the assigned button. For example, regardless of whether BUTTON_OK is assigned to button1, button2, or button3, it will return 16384. Check <a href="scripterapi-constants.html">Pre-defined Constants</a> for further information.</p>
 <p>For the icon and the button parameters there are predefined constants available with the same names as in the Qt Documentation. These are the BUTTON_* and ICON_* constants defined in the module. There are also two extra constants that can be binary-ORed with button constants:</p>
 <ul>
 <li>BUTTONOPT_DEFAULT Pressing enter presses this button.</li>




More information about the scribus-commit mailing list