Home |
Class PegCheckBox HMI (Human-Machine Interface) Classes |
Class PegCheckBoxPegCheckBox is a PegButton class that provide a toggle operation. Any number of PegCheckBox objects with a common parent can be selected. class PegCheckBox : public PegButton, public PegTextThing { public: PegCheckBox(PegRect &, const PEGCHAR * Text, PEGUINT wId = 0, PEGUINT Style = AF_ENABLED); PegCheckBox(PEGINT iLeft, PEGINT iTop, const PEGCHAR * Text, PEGUINT wId = 0, PEGUINT wStyle = AF_ENABLED); virtual void Draw(void); virtual PEGINT Message(const PegMessage &Mesg); virtual void SetSelected(BOOL bSelected = TRUE); virtual BOOL IsChecked(void); }; Demo programs PegDemo, Notebook, and Dialog use this class. Style FlagsSignalsPegCheckBox sends the PSF_CHECK_ON and PSF_CHECK_OFF signals. ConstructorsThe first constructor creates a PegBitmapButton with a user-defined size. The second constructor allows the button to automatically size itself relative to the size of the textbox string. Method DrawPegCheckBox overrides the Draw() function to draw the checkbox appearance. Method MessagePegCheckBox catches the PM_LBUTTONDOWN and PM_LBUTTONUP messages. Method SetSelectedToggles the checkbox on or off under program control. Method IsCheckedReturns TRUE if the checkbox is selected ON, else FALSE. ExamplesThe following is an example of PegCheckBox: The following example creates a PegCheckBox. The checkbox will determine its own width based on the string width. Add(new PegCheckBox(20, 20, "I Like PEG"));
|