Extended Examples

Below are some examples of AcuDialog with some menus on it. You can produce your desired dialog with a similar code.

The first example has no tab on the dialog:
import acuQt
from acuDialog import AcuDialog
mnuInt = AcuDialog.MenuInt( name = 'Number of processors',
                           default = 5,
                           tooltip = 'number of processors',
                           whatsthis = 'number of processors',
                           helpURL = 'number_of_processors.htm',
                           cond = 'val>=1 and val<=10',
                           settings = 'data numbers/proc' )
mnuReal = AcuDialog.MenuReal( name = 'Length ( real )',
                               default = 6.9,
                               tooltip = 'real menu units',
                               whatsthis = 'real menu units',
                               helpURL = 'real_menu_units.htm',
                               cond = 'val>=1.0',
                               unitCat = 'length',
                               unitsDefault= 'mm',
                               retUnits = True,
                               show = 'values[0] <= 3',
                               settings = 'data numbers/len' )
mnuBool = AcuDialog.MenuBool( name = 'Turn On',
                              tooltip = 'turn on',
                              whatsthis = 'turn the option on',
                              helpURL = 'turn_on.htm',
                              default = True,
                              show = 'values[1] != 2',
                              settings = 'control/bool' )
acuQt.initSettings( 'acuDialog' )
dlg = AcuDialog( modal = True,
                 title = "Launch Solver",
                 text = "Please set the parameters "
                 "for launching the solver "
                 "and press OK",
                 tabFlag = False,
                 menus = (mnuInt,mnuReal,mnuBool),
                 assistant = True,
                 helpBaseURL = 'Launch_Solver.htm' )
The second example has three tabs named General, Features and Active. Each tab has two menus:
def clrFileListSetting( args, values ):
print "clear",values
mnuRecFilesNum = AcuDialog.MenuInt( name = 'Number of Recent Files',
                                    tooltip = 'Number of Recent Files',
                                    whatsthis = 'Number of Recent Files',
                                    helpURL = 'Num_Recent_Files.htm',
                                    default = 8,
                                    cond = 'val > 0',
                                    settings = 'test/recFilesNum' )
mnuClrRecFiles = AcuDialog.MenuFunc( name = 'Clear Recent Files',
                                     tooltip = 'Clear Recent Files',
                                     whatsthis = 'Clear Recent Files',
                                     helpURL = 'Clear_Recent_Files.htm',
                                     func = clrFileListSetting,
                                     keyText = 'Clear',
                                     args = None )
mnuFtrDspUnt = AcuDialog.MenuBool( name = 'Display Units',
                                   tooltip = 'Display Units',
                                   whatsthis = 'Display Units',
                                   helpURL = 'Display_Units.htm',
                                   default = True,
                                   settings = 'test/displayUnit' )
mnuUntBtnsSize = AcuDialog.MenuSlider( name = 'Unit Buttons Width',
                                       tooltip = 'Unit Buttons Width',
                                       whatsthis = 'Unit Buttons Width',
                                       helpURL = 'Unit_Buttons_Width.htm',
                                       default = 40,
                                       minValue = 40,
                                       maxValue = 60,
                                       step = 2,
                                       settings = 'test/unitBtnSize' )
mnuActiveSurOut = AcuDialog.MenuBool( name = 'Default Surface Output',
                                      tooltip = 'Default surface output',
                                      whatsthis = 'Set the default value '
                                      'of surface output',
                                      helpURL = 'Pref_Active.htm',
                                      default = True,
                                    settings = 'test/activeSurOut' )
mnuComputeAero = AcuDialog.MenuBool( name = 'Computational',
                                     tooltip = 'Computational',
                                     whatsthis = 'Computational',
                                     helpURL = 'Computational.htm',
                                     default = True,
                                     settings = 'test/computAero' )
menus = ( 'General', ( mnuRecFilesNum, mnuClrRecFiles ),
         'Features', ( mnuFtrDspUnt, mnuUntBtnsSize ),
         'Active', ( mnuActiveSurOut,mnuComputeAero ),
   )
dlg = AcuDialog( modal = "semi",
               title = "Test Dialog Box",
               tabFlag = True,
               menus = menus,
               assistant = True,
               helpBaseURL= 'Test.htm' )
Note: You can write a function at the end of the menu's definition to apply the menu values to the entire project.