Hello Guest it is March 28, 2024, 12:13:08 PM

Author Topic: Common Wizard Controls Function Cheet Sheet with working example!  (Read 6145 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Greetings!

BTW: The below is in the attached Zip file, and is formatted better, to post it here destroyes the formatting, so look
at the PDF in the Zip file, this post will just give you the idea..

         This is a wxLua Controls: example/tutorial/Cheat-Sheet as a Wizard.
It has the commonly used controls that you would normally use in a Wizard for most stuff. The control object functions are done as functions. The functions take certain parameters for the various versions of the control types, they make.
        The “ControlCodeTest.mcs” Wizard launches a multi-control window that interacts
with each other. This Wizard goes into your “Mach4Hobby\Wizards” folder (just like the “BoltHoleCircle.mcs”).
   Further this wizard uses some “Pics” (resources)  for some of its controls, so the folder called:  “ControlsExample” will need to be copy/pasted to the Wizards folder also!!

So the Wizard Script lives in: “Mach4Hobby\Wizards\ ControlCodeTest.mcs”
And the Resource folder lives in: “Mach4Hobby\Wizards ControlsExample”    
(the Resource folder has two Pics in it, one is a .bmp, the other is a .jpg)

NOTE: The functions do not have the “Add” methods built into them, that is so if you want to attach the objects to other types of sizers or frames/panels you can. The Example shows this.

The Example Functions in the Wizard are:

MakeBitMap(ImagePath,   --"Image Path" to the picture and its "name.extension"
                ImageType)   --type of picture, "BMP" = BitMap, "JPG" = J-Peg,
                                        --"PNG" = PNG, "ICO" = Icon, "XPM" = xpm resource
                --if not used: param = "nil"(default is BMP)   

MultiButton(   FrameOrPanel ,--frame or panel handle
                               Buttontype,    --"STD" = standard btn, "PIC" = Bit Map Btn, "TOG" = Toggle btn
                                    BtnLabel,    --The label in the btns up state, standard and toggle btns, if not used:
                                                             --param = "nil"
                               Color,       --The color of the Up-state of a btn, if not used:
                                                             --param = "nil" (default grey)                  
                               BitMap,    --The Pic you want displayed on a bitmap btn, if not used:
                                                             --param = "nil"                  
                               BUTTON_ID)    --Btn ID number, if not used: param = "nil"

TextBox(   FrameOrPanel,      --frame or panel handle
                             StringInTextBox,   --"default string" for the text box, if not used: param = "nil"
                             TextBoxParams,   --"RO" = Read Only,
                                                     --"WSL" = Write Single Line(default if nil),
                                                     --"WML" = Write Multi-Line,
                                                    --"WDO" = Write Digits Only, if not used: param = "nil"
                             BoxWidth,      --Width in pixels, 200 is default, if not used: param = "nil"
                           BoxHeight,      --Height in pixels, -1 (growable in ht.), is default, if not used:  
                                                                        --param = "nil"
                           TEXTBOX_ID)   --Text box ID number, if not used: param = "nil"


SelectControl(  FrameOrPanel,       --frame or panel handle
                               ChoiceListTbl,      --The table that has the choices list, if not used:
                                                                                    --param = "nil"
                                Style,            --"SIM"=Simple drop down, "DRP"=Drop Down,
                                                                             --"RDO"=Read Only
                                SELECTCONTROL_ID)   --Text box ID number, if not used: param = "nil"

CheckBox(   FrameOrPanel,      --frame or panel handle
                           StaticNameCB,   --"string name" for the check box, if not used: param = "nil"
                           CHECKBOX_ID)   --Check box ID number, if not used: param = "nil"

RadioBox(   FrameOrPanel,      --frame or panel handle
                           RbBoxName_string,    --string label of the radio static box, if not used: param = "nil"
                           RBboxTbl,      --The table that contains the names of the buttons
                           MajorDIM,       --Major Dimension (num) for layout orientation, if not used:
                                                                        --param = "nil"  
                           GridType,      --"ROW" = Major dim is rows, "COL" = Major dim is cols,
                                                     --if not defined must have "nil" as place holder
                           RB_BOX_ID)             --Radio Button Box ID number, if not used: param = "nil"

RadioButton(   FrameOrPanel,        --frame or panel handle
                               RBname_string,      --string label of the radio button
                               boolGrp,         --Put this and following radio btn in mutually exclusive
                                                                          --group(default) for "nil" or true.
                               RADIOBUTTON_ID) --Radio Button ID number, if not used: param = "nil"

SetUpGrid(
FrameOrPanel,      --frame or panel handle
                        NumRows,           --Number or Rows in the Grid, default 8, if not used: param = "nil"
                        NumCols,           --Number of Columns in the Grid, default 8, if not used: param = "nil"
                        RowSize,              --Row ht. in pixels, default 20, if not used: param = "nil"
                        ColSize,              --Column wt. in pixels, default 20, if not used: param = "nil"
                        HtRowLabels,       --RowLabel ht. in pixels, default 20, if not used: param = "nil"
                        WtColLabels,       --ColumnLabel wt. in pixels, default 120, if not used: param = "nil"
                        TblRowLabels,      --Table with Row "Label" strings, default '0-3', if not used: param = "nil"
                        TblColLabels,      --Table with Row "Label" strings, default '0-15', if not used: param = "nil"
                        GRID_ID)      --The object ID, if not used: param = "nil"

NOTE2: The Wizard script also shows how to do Bitmap DC’s, and capture mouse events, and launch other windows.

Enjoy, Scott “Poppa Bear” Shafer, S S Systems, LLC
« Last Edit: October 03, 2014, 04:36:38 PM by poppabear »
fun times