Home |
Class PegBitmapButton HMI (Human-Machine Interface) Classes |
Class PegBitmapButtonPegBitmapButton is a PegButton class that displays a PegBitmap centered in the button client area. class PegBitmapButton : public PegButton { public: PegBitmapButton(PegRect &, PegBitmap * bm, PEGUINT wId = 0, PEGUINT wStyle = AF_ENABLED); PegBitmapButton(PEGINT iLeft, PEGINT iTop, PegBitmap * bm, PEGUINT wId = 0, PEGUINT wStyle = AF_ENABLED); virtual void Draw(void); virtual void SetBitmap(PegBitmap * nbm); }; Demo program PegDemo uses this class. Style FlagsFF_NONE, FF_THIN, FF_THICK, FF_RAISED, FF_RECESSED, BF_REPEAT, BF_DOWNACTION. SignalsPegBitmapButton sends the PSF_CLICKED signal when selected. ConstructorsThe first constructor creates a PegBitmapButton with a user-defined size. The second constructor allows the button to automatically size itself relative to the bitmap size. In each case, the PegBitmap associated with the button will be display in the center of the button client area. Method DrawPegBitmapButton overrides the Draw() function to draw the associated bitmap. Method SetBitmapAssigns the bitmap associated with the button. Examples:The following are examples of PegBitmapButton: The following example creates a PegBitmapButton. The button will display the PegBitmap 'OnMap' in the button client area. The button automatically determines the correct size based on the bitmap size. extern PegBitmap gbOnMapBitmap; Add(new PegBitmapButton(20, 20, &gbOnMapBitmap));
|