NButtonobjects are push buttons that have the look-and-feel of buttons of the native window manager.
NButtonobject with an enclosing
CView. When the user clicks on a button, it generates a
DoCommand (itsCommand)event. However, this class does not use the command set by
const CRect& theRegion,
const CStringRW theTitle = NULLString,
long theAttributes = 0L);
theEnclosureis a pointer to the subview that will contain the button. theRegion is a coordinate location, local to the enclosure, that is used to place the button.
theTitleis a character string that is used as the title for the button.
theControlAttributestakes a value from a set of XVT Portability Toolkit-provided attributes that you can give to native views. You can
ORtogether the appropriate control flag constants into an attribute value. For a listing of the possible control flags for
theAttributes, refer to the table in the description of
CNativeView's protected constructor
NButton(CSubview* theEnclosure, long theContainerId, long theId);
NButton(const NButton& theButton);
NButton& operator= (const NButton& theButton);
BOOLEAN IButton(const CStringRW theTitle = NULLString,
BOOLEAN isEnabled = TRUE,
long theCommand = NULLcmd,
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);
BOOLEANvalue specifying whether the button is enabled to receive events.
theCommandis the command that is generated when the button icon is pressed. Finally, this initializer takes a visibility state and a glue type.
virtual void DoHit(CONTROL_INFO theControlInfo);
CONTROL_INFO, which is defined by the XVT Portability Toolkit in the XVT Portability Toolkit Guide. The button responds by sending a
virtual void Key(const CKey& theKey);
NButtonhas the key focus when a key is pressed, this method is called automatically. When a return is pressed, the button responds by sending a
DoHit; otherwise, the
theKeyis passed on to its enclosure.
virtual BOOLEAN ClassCanGetKeyFocus(void) const;