Clarified the fl_choice ordering in first example with an image and arrows,

as it's not clear in the text how the code order is reversed on-screen.

Also, the whole 'three musketeers' thing with the case values not matching
the numeric button names has always been confusing:

     case 0: .. // One
     case 1: .. // Two (default)
     case 2: .. // Three

Changed that so it's a Zero/One/Two example instead.

     case 0: .. // "Zero"
     case 1: .. // "One" (default)
     case 2: .. // "Two"



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12853 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Greg Ercolano 2018-04-18 18:28:46 +00:00
parent 71d23d5574
commit 8c32c708a9
2 changed files with 8 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -363,19 +363,9 @@ int fl_ask(const char *fmt, ...) {
/** Shows a dialog displaying the printf style \p fmt message,
this dialog features up to 3 customizable choice buttons
which are specified in *right-to-left* order, e.g.
\code
//
// ______________________________________________
// | ___ |
// | | ? | Message text.. |
// | |___| |
// | [Left] [Middle] [Right] |
// |______________________________________________|
//
//
fl_choice("Message text..", "Right", "Middle", "Left");
\endcode
which are specified in order of *right-to-left* in the dialog, e.g.
\image html fl_choice_left_middle_right.png
\image latex fl_choice_left_middle_right.png "fl_choice() button ordering" width=4cm
\note Common dialog boxes are application modal. No more than one common dialog box
can be open at any time. Requests for additional dialog boxes are ignored.
@ -398,11 +388,11 @@ int fl_ask(const char *fmt, ...) {
\image html fl_choice_three.png
\image latex fl_choice_three.png "fl_choice() three choices" width=4cm
\code
switch ( fl_choice("How many musketeers?", "One", "Two", "Three") ) {
case 0: .. // One
case 1: .. // Two (default)
case 2: .. // Three
}
switch ( fl_choice("How many bedrooms?", "Zero", "One", "Two") ) {
case 0: .. // "Zero"
case 1: .. // "One" (default)
case 2: .. // "Two"
}
\endcode
Two choice example: