VCF::Control Class Reference
The base class for all visual components in the Visual Component Framework. More...
#include <vcf/ApplicationKit/Control.h>
Inheritance diagram for VCF::Control:

Public Types | |
| enum | { ANCHOR_DTOP = 0, ANCHOR_DLEFT, ANCHOR_DBOTTOM, ANCHOR_DRIGHT } |
| enum | ControlState { csVisible = 0x00000001, csEnabled = 0x00000002, csUseParentFont = 0x00000004, csDoubleBuffered = 0x00000008, csAutoStartDragDrop = 0x00000010, csTabStop = 0x00000020, csIgnoreForLayout = 0x00000040, csIgnoreForParentScrolling = 0x00000080, csAllowPaintNotification = 0x00000100, csHasMouseCapture = 0x00000200, csUseRenderBuffer = 0x00000400, csAllowMouseFocus = 0x00000800, csAllowFocus = 0x00001000, csKeepsReturnKey = 0x00002000, csKeepsTabKey = 0x00004000, csKeepsArrowKeys = 0x00008000, csDefaultControlState } |
| enum | MinMaxSizeDefaults { mmIgnoreMinWidth = -1, mmIgnoreMinHeight = -1, mmIgnoreMaxWidth = -1, mmIgnoreMaxHeight = -1 } |
| enum | ControlEvents { CONTROL_EVENTS = COMPONENT_EVENTS_LAST + 200, CONTROL_SIZED, CONTROL_POSITIONED, CONTROL_PARENT_CHANGED, CONTROL_MODELCHANGED, FOCUS_GAINED, FOCUS_LOST, HELP_REQUESTED, WHATS_THIS_HELP_REQUESTED, KEYBOARD_DOWN, KEYBOARD_PRESSED, KEYBOARD_UP, KEYBOARD_ACCELERATOR, MOUSE_DOWN, MOUSE_MOVE, MOUSE_UP, MOUSE_CLICK, MOUSE_DBLCLICK, MOUSE_ENTERED, MOUSE_LEAVE, BEFORE_CONTROL_PAINTED, AFTER_CONTROL_PAINTED, BEFORE_POPUP_MENU, CONTROL_EVENTS_LAST } |
Public Member Functions | |
| Control () | |
| virtual | ~Control () |
| virtual void | handleEvent (Event *event) |
| This gets called by the ControlPeer for any windowing system mouse events, as well as for any windowing system keyboard events and for any windowing system events like size changes, position changes, etc. | |
| void | handleEventAndForwardToChildren (Event *event) |
| calls handleEvent on this control, and then calls handleEventToChildren() on any child controls the container of this control may have. | |
| virtual Component * | findComponent (const String &componentName, const bool &recursive=false) |
| finds a particular component as specified by the componentName parameter within the list of owned components. | |
| virtual void | addNewComponent (Component *component) |
| Adds a brand new child component instance to this component. | |
| virtual void | preLoading () |
| Called when loading the component. | |
| virtual void | postLoaded (const bool &visible) |
| Called after the component is done loading. | |
| virtual bool | bindVariable (Component **variablePtr, const String &variableName) |
| Used to bind a variable to a component by attempting to bind the variable passed in to the component in the variablePtr parameter to the component instance with the same name as the variableName parameter. | |
| virtual bool | generatePropertyValue (const String &fullPropertyName, Property *property, VariantData *value, String &strValue) |
| VariantData | getModelKey () |
| void | setModelKey (const VariantData &val) |
| Border * | getBorder () |
| Returns the control's current border object, if any. | |
| void | setBorder (Border *border) |
Sets the border for this control. | |
| virtual Rect | getBounds () |
| returns the bounds in parent coordinates of the Control. | |
| virtual Rect | getClientBounds (const bool &includeBorder=true) |
| Returns the bounds in terms of the control's coordinates. | |
| virtual double | getLeft () |
| Returns the left position in parent coordinates. | |
| virtual double | getRight () |
| Returns the right position in parent coordinates. | |
| virtual double | getWidth () |
| returns the width of the control | |
| virtual double | getTop () |
| returns the top position in parent coordinates | |
| virtual double | getBottom () |
| returns the bottom position in parent coordinates | |
| virtual double | getHeight () |
| returns the height of the control | |
| virtual bool | getVisible () |
| is this control visible to the user. | |
| AlignmentType | getAlignment () |
Returns the control's alignment. | |
| bool | isIgnoredForLayout () |
Returns whether this control must be ignored in the control container's layout implementation. | |
| void | setIgnoredForLayout (const bool &val) |
| void | setBounds (const double &x, const double &y, const double &width, const double &height) |
| sets the bounds of the control. | |
| void | setBounds (Rect *rect, const bool &anchorDeltasNeedUpdating=true) |
| sets the bounds of the control. | |
| void | setAlignment (const AlignmentType &alignment) |
| sets the alignment of the control | |
| virtual void | setLeft (const double &left) |
| sets the left value for the control, immediately updates the controls position. | |
| virtual void | setRight (const double &right) |
| sets the right value of the control. | |
| virtual void | setWidth (const double &width) |
| sets the width of the control. | |
| virtual void | setTop (const double &top) |
| sets the top value of the control. | |
| virtual void | setBottom (const double &bottom) |
| sets the bottom value of the control. | |
| virtual void | setHeight (const double &height) |
| sets the height of the control. | |
| virtual void | setVisible (const bool &visible) |
| determines whether or not the control is visible, and set it visible if it wasn't. | |
| virtual bool | canBeginDragDrop (Point *point) |
| if autoStartDragDrop_ is true then this method checks to see if the Controls dragging is with the windowing system's tolernace for a drag drop operation to start. | |
| void | setAutoStartDragDrop (const bool &canAutoStartDragDrop) |
| sets auto start dragging to true or false | |
| bool | getAutoStartDragDrop () |
| returns whether or not auto dragging is on or off. | |
| virtual bool | beginDragDrop (MouseEvent *event) |
| Override this to provide functionality for handling the start of drag-drop operation This will get called automatically by the framework if it detects that a mouse-move has occured that indicates a drag-drop operation COULD occur. | |
| virtual ControlPeer * | getPeer () |
| returns the control's native peer interface | |
| virtual void | setParent (Control *parent) |
| sets the parent for the control | |
| virtual Control * | getParent () |
| returns the control's current parent | |
| void | removeFromParent (const bool &freeInstance=true) |
| throw( InvalidPeer ); -JEC - FIXME later | |
| bool | isFocused () |
| does this control currently have focus? | |
| Control * | setFocused () |
| Makes this control the currently focused control. | |
| bool | getAllowsFocus () |
| void | setAllowsFocus (const bool &val) |
| bool | getAllowsMouseFocus () |
| void | setAllowsMouseFocus (const bool &val) |
| bool | isEnabled () |
| returns whether the control is enabled or not. | |
| bool | areParentsEnabled () |
| This checks not only to see if the control itself is enabled, but will return false if any parent control is not enabled. | |
| void | setEnabled (const bool &enabled) |
| sets whether the control is enabled or not. | |
| virtual void | paint (GraphicsContext *context)=0 |
| Paints the control. | |
| void | paintBorder (GraphicsContext *context) |
| Paints the border for the control. | |
| virtual void | mouseEnter (MouseEvent *event) |
| Called when the mouse first enters the control's bounds. | |
| virtual void | mouseDown (MouseEvent *event) |
| Called when one (or more) of the mouse buttons are held down. | |
| virtual void | mouseMove (MouseEvent *event) |
| Called when the mouse moves over the control. | |
| virtual void | mouseUp (MouseEvent *event) |
| Called when one (or more) of the mouse buttons are released. | |
| virtual void | mouseClick (MouseEvent *event) |
| Called when one or mouse buttons are held down and immediately released ( a "mouse click" ). | |
| virtual void | mouseDblClick (MouseEvent *event) |
| Called when one or mouse buttons are held down and immediately released ( a "mouse double click" ) twice, within some specific time period, as determined on the windowing system. | |
| virtual void | mouseLeave (MouseEvent *event) |
| Called when the mouse leaves the control's bounds. | |
| virtual void | keyDown (KeyboardEvent *event) |
| called when the user presses the key down | |
| virtual void | keyPressed (KeyboardEvent *event) |
| called when the user simply presses the key and represents a full key cycle having occurred, in other words the key has been pressed down and then released | |
| virtual void | keyUp (KeyboardEvent *event) |
| called when the user releases the key | |
| virtual void | sizeChange (ControlEvent *event) |
| called when the control's bounds change. | |
| virtual void | positionChange (ControlEvent *event) |
| called when the control's coordinates change. | |
| virtual void | parentChange (ControlEvent *event) |
| Called when the parent of the control is changed. | |
| virtual void | gotFocus (FocusEvent *event) |
| Called when the control gains keyboard focus. | |
| virtual void | lostFocus (FocusEvent *event) |
| Called when the control loses keyboard focus. | |
| void | translateToParent (Point *point) |
| translate the point from this controls coordinate system to the parent controls coordinate system | |
| void | translateToLocal (Point *point) |
| translate the point from parent controls coordinate system to this controls coordinate system | |
| void | translateToScreenCoords (Point *pt) |
| Takes the coordinates in pt, which are in the coordinate system of this control, and translates them into the coordinate system of the Screen. | |
| void | translateToScreenCoords (Rect *rect) |
| Takes the coordinates in rect, which are in the coordinate system of this control, and translates them into the coordinate system of the Screen. | |
| void | translateFromScreenCoords (Point *pt) |
| Takes the coordinates in pt, which are in the coordinate system of the Screen, and translates them into the coordinate system of this control. | |
| void | translateFromScreenCoords (Rect *rect) |
| Takes the coordinates in rect, which are in the coordinate system of the Screen, and translates them into the coordinate system of this control. | |
| virtual bool | isLightWeight () |
| identifies the control as a lightweight control. | |
| virtual Control * | getHeavyweightParent () |
| Returns the first parent of the Control that is a heavweight Control, i.e it's isLighweight() method return false. | |
| Color * | getColor () |
| returns the color used to fill the background of this control | |
| void | setColor (Color *color) |
| sets the color to fill this control's background with | |
| virtual void | beforeDestroy (ComponentEvent *event) |
| called just prior to completely destroying the control and it's associated memory. | |
| virtual void | afterCreate (ComponentEvent *event) |
| Special initializations may then happen here. | |
| Font * | getFont () |
| Returns the font associated with this control. | |
| void | setFont (Font *font) |
| sets the font attributes. | |
| bool | useParentFont () |
| returns whether this control will use the font settings of the parent's font. | |
| void | setUseParentFont (const bool &useParentFont) |
| sets whether the control should use it's parent font's settigns or use it's own independent of it's parent's font. | |
| void | repaint (Rect *repaintRect=NULL) |
| repaint the control. | |
| void | repaintNow (Rect *repaintRect=NULL) |
| bool | isDoubleBuffered () |
| is this component double buffered. | |
| void | setDoubleBuffered (const bool &doubleBuffered) |
| sets whether or not this control is double buffered. | |
| bool | isUsingRenderBuffer () |
| Returns true if the Control should take advantage of the GraphicsContexts' render buffer for anti-aliased vector graphics (based on the AGG library). | |
| void | setUsingRenderBuffer (const bool &useRenderBuffer) |
| sets whether or not the control is using the render buffer of it's GraphicsContext. | |
| void | keepMouseEvents () |
| this keeps the mouse events being sent to this control, even if the mouse leaves the physical bounds of the control | |
| void | releaseMouseEvents () |
| releases mouse events - goes back to normal event handling | |
| PopupMenu * | getPopupMenu () |
| returns the Control's PopupMenu, if any. | |
| void | setPopupMenu (PopupMenu *popupMenu) |
| sets the popup menu for this control. | |
| View * | getView () |
| returns the view associated with this control | |
| void | setView (View *view) |
| sets the view to associate with this control | |
| virtual double | getPreferredWidth () |
| returns the preferred width for this control. | |
| virtual double | getPreferredHeight () |
| returns the preferred height for this control. | |
| virtual void | setPreferredWidth (const double &width) |
| set the preferred width. | |
| virtual void | setPreferredHeight (const double &height) |
| set the preferred height. | |
| Size | getMinSize () |
| Returns the minimum size for this control. | |
| void | setMinSize (const Size &val) |
| Sets the minimum size of the control. | |
| double | getMinWidth () |
| Returns the minimum width of the control. | |
| void | setMinWidth (const double &val) |
| Sets the minimum width of the control. | |
| double | getMinHeight () |
| Returns the minimum height of the control. | |
| void | setMinHeight (const double &val) |
| Sets the minimum height of the control. | |
| Size | getMaxSize () |
| Returns the maximum size for this control. | |
| void | setMaxSize (const Size &val) |
| Sets the maximum size of the control. | |
| double | getMaxWidth () |
| void | setMaxWidth (const double &val) |
| double | getMaxHeight () |
| void | setMaxHeight (const double &val) |
| Scrollable * | getScrollable () |
| returns an object implementing the Scrollable interface The default value is NULL, indicating the control does not support scrolling behaviour | |
| virtual void | setScrollable (Scrollable *scrollable) |
| sets the scrollable for the control. | |
| void | adjustViewableBoundsAndOriginForScrollable (GraphicsContext *context, Rect &viewBounds, Point &origin) |
| Call this method to adjust the view bounds (i.e. | |
| String | getWhatThisHelpString () |
| returns a string that is used for context sensitive help for the control. | |
| void | setWhatThisHelpString (const String &whatThisHelpString) |
| sets the string that is used for context sensitive help for the control. | |
| String | getToolTipText () |
| returns a string that is used to display in the tooltip for the control. | |
| void | setToolTipText (const String &tooltip) |
| sets the string that is used to display in the tooltip for the control. | |
| int32 | getCursorID () |
| returns the cursor ID for the control. | |
| void | setCursorID (const int32 &cursorID) |
| sets the cursor ID for the control. | |
| AnchorTypes | getAnchor () |
| returns the anchor mask value for this control. | |
| void | setAnchor (const AnchorTypes &anchor) |
| sets the anchor mask value for the control. | |
| float * | getAnchorDeltas () |
| returns the current delta for each of the anchors. | |
| bool | keepsReturnCharacter () |
| this function determines if the control keeps the key event when the return key is pressed, or if it will relinquish the event for the system to process. | |
| void | setKeepsReturnChar (const bool &val) |
| bool | keepsTabKey () |
| This function determines whether or not the control should have precedence and prevent the the tab key from switching focus to another control. | |
| void | setKeepsTabKey (const bool &val) |
| bool | keepsArrowKeys () |
| This function determines whether or not the control should have precedence and prevent the the arrow keys from switching focus to another control. | |
| void | setKeepsArrowKeys (const bool &val) |
| bool | getTabStop () |
| Indicates whether the control responds to the TAB key to set it's focus when tabbing from control to control. | |
| void | setTabStop (const bool &tabStop) |
| sets the tab stop value of the control. | |
| int32 | getTabOrder () |
| Returns the tab order of the control. | |
| void | setTabOrder (const int32 &tabOrder) |
| AcceleratorKey * | getAccelerator (const VirtualKeyCode &keyCode, const uint32 &modifierMask) |
| Returns the AcceleratorKey instance that is associated with this control and the specified key code and modifier mask. | |
| void | addAcceleratorKey (const VirtualKeyCode &keyCode, const uint32 &modifierMask, EventHandler *eventHandler) |
| Associates a new AcceleratorKey with the Control. | |
| void | addAcceleratorKey (const VirtualKeyCode &keyCode, const uint32 &modifierMask, Action *action) |
| Associates a new AcceleratorKey with the Control. | |
| void | addAcceleratorKey (AcceleratorKey *accelerator) |
| This should generally not be called. | |
| AcceleratorKey * | getAcceleratorKey (const uint32 &index) const |
| void | setAcceleratorKey (const uint32 &index, AcceleratorKey *accelerator) |
| uint32 | getAcceleratorKeyIndexes (std::vector< uint32 > &indexes) |
| virtual void | mnemonicActivate () |
| Pressing the accelerator character will cause the control's mnemonicActivate() method to be fired, which by default sets focus to the control. | |
| Frame * | getParentFrame () |
| This returns a pointer to the top level frame that this control is associated with. | |
| bool | isActive () |
| This returns a value that indicates whether or not hte control is considered to be active. | |
| bool | canAcceptFocus () |
| Can the control accept focus? This method determines if the control can recieve focus. | |
| Container * | getContainer () |
| returns the current container for this control. | |
| void | setContainer (Container *container) |
| sets the current container for a control. | |
| bool | hasChildren () |
| This returns whether or not the control has any child controls associated with it. | |
| bool | isChild () |
| Returns whether or not this control is a child of some other control. | |
| bool | getAllowPaintNotification () |
| Returns whether or not the control will allow paint notification. | |
| void | setAllowPaintNotification (const bool &val) |
| Sets whether or not the control will allow paint notification. | |
| bool | ignoreForParentScrolling () |
| void | setIgnoreForParentScrolling (const bool &val) |
| void | preChildPaint (GraphicsContext *graphicsContext, Control *child, Rect *childClipRect) |
| Called by the container instance of the child's parent control during it's paintChildren() function. | |
| void | postChildPaint (GraphicsContext *graphicsContext, Control *child, Rect *oldClipRect) |
| Called by the container instance of the child's parent control during it's paintChildren() function. | |
| virtual Model * | getViewModel () |
| virtual void | setViewModel (Model *viewModel) |
| sets a new model for the view Once set, the control fires a ControlModelChanged event. | |
| virtual void | modelChanged (Model *oldModel, Model *newModel) |
| Model * | getModel () |
| void | setModel (Model *val) |
| void | internal_beforePaint (GraphicsContext *context) |
| called by the internals of the framework - DO NOT CALL! | |
| void | internal_afterPaint (GraphicsContext *context) |
| called by the internals of the framework - DO NOT CALL! | |
Static Public Member Functions | |
| static Control * | getCapturedMouseControl () |
| returns the current control that has captured the mouse input. | |
| static void | setCapturedMouseControl (Control *control) |
| sets the control that has captured the mouse. | |
| static Control * | getCurrentFocusedControl () |
| returns the currently focused control. | |
| static Control * | getPreviousMouseOverControl () |
| returns the control the mouse was previously over, if any. | |
| static void | setPreviousMouseOverControl (Control *control) |
| static void | buildTabList (Control *control, std::vector< Control * > &tabList) |
Public Attributes | |
| VCF::Delegate | ControlDelegate |
| ControlSized | |
| ControlPositioned | |
| ControlParentChanged | |
| VCF::Delegate | MouseDelegate |
| MouseDoubleClicked | |
| MouseClicked | |
| MouseMove | |
| MouseUp | |
| MouseDown | |
| MouseEnter | |
| MouseLeave | |
| VCF::Delegate | KeyboardDelegate |
| KeyPressed | |
| KeyDown | |
| KeyUp | |
| VCF::Delegate | WhatsThisHelpDelegate |
| ControlHelpRequested | |
| VCF::Delegate | HelpDelegate |
| HelpRequested | |
| VCF::Delegate | FocusDelegate |
| FocusGained | |
| FocusLost | |
| VCF::Delegate | ToolTipDelegate |
| ToolTipRequested | |
| ToolTip | |
| ControlModelChanged | |
| BeforeControlPainted | |
| AfterControlPainted | |
| VCF::Delegate | ControlPopupMenuDelegate |
| BeforePopupMenu | |
Protected Member Functions | |
| void | updateAnchorDeltas () |
| virtual void | getAppNameAndKey (String &appName, String &key) |
| virtual void | destroy () |
| called by the free() method. | |
Protected Attributes | |
| ControlPeer * | peer_ |
| Control * | parent_ |
| AlignmentType | aligment_ |
| uint32 | anchor_ |
| Rect * | bounds_ |
| Rect * | clientBounds_ |
| Border * | border_ |
| Color * | color_ |
| Font * | font_ |
| View * | view_ |
| PopupMenu * | popupMenu_ |
| Scrollable * | scrollable_ |
| String | whatThisHelpString_ |
| String | toolTip_ |
| int32 | cursorID_ |
| Cursor * | cursor_ |
| float | anchorDeltas_ [4] |
| int32 | tabOrder_ |
| Point | clickPt_ |
| Container * | container_ |
| Size | minSize_ |
| Size | maxSize_ |
| uint32 | controlState_ |
| VariantData | modelKey_ |
Static Protected Attributes | |
| static Control * | currentFocusedControl |
| static Control * | previousMouseOverControl |
| static Control * | capturedMouseControl |
Detailed Description
The base class for all visual components in the Visual Component Framework.In addition it implements the View interface. This means that the Control is itself a specialized form of a View, though it may not have have a model, and can hold an external view, separate from itself.
A control receives a wide variety of events from the user such as paint events, mouse events, keyboard events, help events, etc.
Controls can have parents, and can form a hierarchy of parent-child controls. Controls can have children if they have a valid Container instance set.
Controls can also be aligned or anchored, which can aid in laying out the presentation of a UI.
Finally a Control may also be lightweight or heavyweight, which determines how many window system resources the control consumes. A heavyweight control has a native window/widget and takes up resources accordingly. In addition a heavyweight control also has a native graphics context associated with it that also takes up resources. In contrast, a lightweight control shares the underlying native window and graphics context resources with it's parent, and greatly reduces the number of resources the application will consume. This is especially useful when making complex custom controls that have many moving parts like a tree-list control, complete with a header and movable icons, etc.
To aid in the drawing of a control, all controls are double buffered by default to prevent flicker, though this can be turned off and on at will.
- Event Delegates for this class:
- Control::ControlSized
- Control::ControlPositioned
- Control::ControlParentChanged
- Control::MouseDoubleClicked
- Control::MouseClicked
- Control::MouseMove
- Control::MouseUp
- Control::MouseDown
- Control::MouseEnter
- Control::MouseLeave
- Control::KeyPressed
- Control::KeyDown
- Control::KeyUp
- Control::ControlHelpRequested
- Control::HelpRequested
- Control::FocusLost
- Control::FocusGained
- Control::ToolTipRequested
- Control::ToolTip
- Control::ControlModelChanged
- Control::BeforeControlPainted
- Control::AfterControlPainted
Member Enumeration Documentation
|
|
|
|
|
|
|
|
|
|
Constructor & Destructor Documentation
|
|
|
|
|
|
Member Function Documentation
|
|
This should generally not be called. It's for framework usage only at this point. |
|
||||||||||||||||
|
Associates a new AcceleratorKey with the Control. The key code, modifier mask and the action's accelerator event handler all become the attributes of the new AcceleratorKey instance. |
|
||||||||||||||||
|
Associates a new AcceleratorKey with the Control. The key code, modifier mask and event handler all become the attributes of the new AcceleratorKey |
|
|
Adds a brand new child component instance to this component. By default this simply calls addComponent(). Re-implemented in the Control class to also handle adding to the control's container as well. Used by the VFFInputStream class when loading component's up. Reimplemented from VCF::Component. |
|
||||||||||||||||
|
Call this method to adjust the view bounds (i.e. what the GraphicsContext::getViewableBounds() method returns) to take into consideration the presence of scroll bars |
|
|
Special initializations may then happen here.
Reimplemented from VCF::Component. Reimplemented in VCF::Frame, VCF::HTMLBrowserControl, and VCF::OpenGLControl. |
|
|
This checks not only to see if the control itself is enabled, but will return false if any parent control is not enabled. This function traverse all the parent child relationships till the frame window is hit, and checks the enabled status of each control. The first control that is not enabled stops the search and the methods returns false, otherwise it continues till it finds a NULL parent and returns true. |
|
|
called just prior to completely destroying the control and it's associated memory.
Reimplemented from VCF::Component. Reimplemented in VCF::Window. |
|
|
Override this to provide functionality for handling the start of drag-drop operation This will get called automatically by the framework if it detects that a mouse-move has occured that indicates a drag-drop operation COULD occur.
|
|
||||||||||||
|
Used to bind a variable to a component by attempting to bind the variable passed in to the component in the variablePtr parameter to the component instance with the same name as the variableName parameter. This functions looks at all the owned components first, then checks to see if the Container interface is supported, and if so, it checks all the child controls of the container.
Reimplemented from VCF::Component. |
|
||||||||||||
|
|
|
|
Can the control accept focus? This method determines if the control can recieve focus.
|
|
|
if autoStartDragDrop_ is true then this method checks to see if the Controls dragging is with the windowing system's tolernace for a drag drop operation to start. other wise it returns false. If autoStartDragDrop_ is false then it returns false unless some derived class overides the functionality. Reimplemented in VCF::TableControl. |
|
|
called by the free() method. Should be overriden and any clean up code performed here Reimplemented from VCF::UIComponent. Reimplemented in VCF::ComboBoxControl, VCF::Frame, VCF::ListBoxControl, and VCF::Window. |
|
||||||||||||
|
finds a particular component as specified by the componentName parameter within the list of owned components.
Reimplemented from VCF::Component. |
|
||||||||||||||||||||
|
Reimplemented from VCF::Component. Reimplemented in VCF::CheckBoxControl, VCF::ComboBoxControl, VCF::CommandButton, VCF::HeaderControl, VCF::ProgressControl, VCF::PushButton, VCF::RadioButtonControl, VCF::SliderControl, and VCF::TextControl. |
|
||||||||||||
|
Returns the AcceleratorKey instance that is associated with this control and the specified key code and modifier mask. The AcceleratorKey will be activated whenever the corresponding keyboard combination is pressed.
|
|
|
|
|
|
|
|
|
These alignment values are used by the basic container type, the StandardContainer class, which uses these values to determine how to layout the controls. Other layout implementations may choose to ignore these values. For example, the HorizontalLayoutContainer doesn't pay any attention to these value, it just lays out the controls as they are added. |
|
|
Returns whether or not the control will allow paint notification.
|
|
|
|
|
|
|
|
|
returns the anchor mask value for this control. Anchors allow you to customize the sizing behavior of a particular control. Setting the alignment may be done at any time after the control has been instantiated. By anchoring a control you can have finer control over how the control gets resized when it's parent is resized than simply specifying an alignment value. However, changing the anchor value of a control will automatically set the control's alignment to ALIGN_NONE, while changing the control's alignment will automatically set the control's anchor value to ANCHOR_NONE. The two values are mutually exclusive, you can get one or the other, but not both. The following table describes the meanings of the various mask values for the anchor value, which can have either the value of ANCHOR_NONE or any combination of the other four mask types.
|
|
|
returns the current delta for each of the anchors. There will be a delta for the left, the top, the right, and the bottom sides. These deltas are recalculated whenever the controls bounds are set with the anchorDeltasNeedUpdating param set to true. |
|
||||||||||||
|
Reimplemented from VCF::Component. |
|
|
returns whether or not auto dragging is on or off.
|
|
|
Returns the control's current border object, if any.
|
|
|
returns the bottom position in parent coordinates
|
|
|
returns the bounds in parent coordinates of the Control. The Control derived class must call it's Peer's getBounds() method |
|
|
returns the current control that has captured the mouse input. This may return NULL if no control has expressly captured the mouse input through the Control::keepMouseEvents() method. |
|
|
Returns the bounds in terms of the control's coordinates. Thus the top and left will typically be 0.0, 0.0, and the right and bottom of the bounds will typically equal the width and height of the control. Reimplemented in VCF::Dialog, VCF::TabbedPages, and VCF::Window. |
|
|
returns the color used to fill the background of this control
|
|
|
returns the current container for this control. The container determines whether or not the control can contain child controls. By default a control container is NULL, indicating it cannot hold any child controls.
|
|
|
returns the currently focused control.
|
|
|
returns the cursor ID for the control. The cursor id represents an id tag that identifies a Cursor object to be used to for controling the display of the mouse cursor. To access the Cursor object directly call the CursorManager::getCursor() method.
|
|
|
Returns the font associated with this control.
|
|
|
Returns the first parent of the Control that is a heavweight Control, i.e it's isLighweight() method return false.
|
|
|
returns the height of the control
|
|
|
Returns the left position in parent coordinates.
|
|
|
|
|
|
Returns the maximum size for this control. At the moment this is only used for Frames, to control the maximum size a user can resize the Frame to.
|
|
|
|
|
|
Returns the minimum height of the control.
|
|
|
Returns the minimum size for this control. At the moment this is only used for Frames, to control the minimum size a user can resize the Frame to.
|
|
|
Returns the minimum width of the control.
|
|
|
|
|
|
|
|
|
returns the control's current parent
|
|
|
This returns a pointer to the top level frame that this control is associated with.
|
|
|
returns the control's native peer interface
|
|
|
returns the Control's PopupMenu, if any. The popupmenu will be displayed whenever the user right clicks the mouse over the control. |
|
|
returns the preferred height for this control. This is used when determing the height of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size. Reimplemented in VCF::CheckBoxControl, VCF::ComboBoxControl, VCF::CommandButton, VCF::HeaderControl, VCF::Label, VCF::ProgressControl, VCF::PushButton, VCF::RadioButtonControl, VCF::SliderControl, VCF::Splitter, VCF::TextControl, and VCF::Window. |
|
|
returns the preferred width for this control. This is used when determing the width of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size. Reimplemented in VCF::CheckBoxControl, VCF::CommandButton, VCF::HeaderControl, VCF::Label, VCF::ProgressControl, VCF::PushButton, VCF::RadioButtonControl, VCF::SliderControl, VCF::Splitter, and VCF::Window. |
|
|
returns the control the mouse was previously over, if any.
|
|
|
Returns the right position in parent coordinates.
|
|
|
returns an object implementing the Scrollable interface The default value is NULL, indicating the control does not support scrolling behaviour
|
|
|
Returns the tab order of the control. Tab order may be specified independently of the controls child order within it's parent Container.
|
|
|
Indicates whether the control responds to the TAB key to set it's focus when tabbing from control to control.
|
|
|
returns a string that is used to display in the tooltip for the control.
|
|
|
returns the top position in parent coordinates
|
|
|
returns the view associated with this control
|
|
|
Reimplemented from VCF::AbstractView. |
|
|
is this control visible to the user.
|
|
|
returns a string that is used for context sensitive help for the control.
|
|
|
returns the width of the control
|
|
|
Called when the control gains keyboard focus. Override this for your own custom behaviour if you need to. Reimplemented in VCF::MultilineTextControl, and VCF::TextControl. |
|
|
This gets called by the ControlPeer for any windowing system mouse events, as well as for any windowing system keyboard events and for any windowing system events like size changes, position changes, etc. Once inside the event the Control determines the type, and behaves accordingly, as well as notifying any appropriate listeners. Reimplemented from VCF::UIComponent. Reimplemented in VCF::HeaderControl, VCF::ListBoxControl, VCF::ListControl, VCF::ListViewControl, VCF::TabbedPages, VCF::TableControl, VCF::TextControl, VCF::Toolbar, VCF::TreeControl, VCF::TreeListControl, and VCF::Window. |
|
|
calls handleEvent on this control, and then calls handleEventToChildren() on any child controls the container of this control may have.
|
|
|
This returns whether or not the control has any child controls associated with it.
|
|
|
|
|
|
called by the internals of the framework - DO NOT CALL!
|
|
|
called by the internals of the framework - DO NOT CALL!
|
|
|
This returns a value that indicates whether or not hte control is considered to be active. A control is considered active if it belongs to, i.e. is a child eitehr directly or indirectly, (or is) the active frame. This is determined by checking if the control's getParentFrame() equals the Frame::getActiveFrame().
Reimplemented in VCF::Frame. |
|
|
Returns whether or not this control is a child of some other control. Equivalent to checking the return value of getParent() for a non-null value.
|
|
|
is this component double buffered.
|
|
|
returns whether the control is enabled or not. A control that is enabled can receive mouse events. A control that is not enabled will not respond to either mouse events or keyboard events. |
|
|
does this control currently have focus?
|
|
|
Unlike the alignment values returned by getAlignment(), which are optional for the container to use, this must be honored. Failure to do so may result in dire intergalatic consequences, or worse, result in a shortage of SUVs. |
|
|
identifies the control as a lightweight control. Lightweight control's do not take up windowing system resources, instead, they rely on all events and paint notification be sent to them via their parents. The default return for this is false, so only those controls specifically actign as light weight Controls need to return true Reimplemented in VCF::CustomControl. |
|
|
Returns true if the Control should take advantage of the GraphicsContexts' render buffer for anti-aliased vector graphics (based on the AGG library).
|
|
|
this keeps the mouse events being sent to this control, even if the mouse leaves the physical bounds of the control
|
|
|
This function determines whether or not the control should have precedence and prevent the the arrow keys from switching focus to another control. Typically this will return false, with the exception of keyboard entry controls like the TextControl. To prevent the tab key from causing a the framework to switch to another control, override this and return true.
Reimplemented in VCF::ComboBoxControl. |
|
|
this function determines if the control keeps the key event when the return key is pressed, or if it will relinquish the event for the system to process. Most controls will return false with the exception of keyboard entry controls. If the control does keep the event, then any default buttons will NOT receive their enter key event until they receive focus.
|
|
|
This function determines whether or not the control should have precedence and prevent the the tab key from switching focus to another control. Typically this will return false, with the exception of keyboard entry controls like the TextControl. To prevent the tab key from causing a the framework to switch to another control, override this and return true.
|
|
|
called when the user presses the key down
Reimplemented in VCF::Dialog, VCF::ListBoxControl, VCF::PushButton, VCF::SliderControl, VCF::TableControl, and VCF::TreeListControl. |
|
|
called when the user simply presses the key and represents a full key cycle having occurred, in other words the key has been pressed down and then released
Reimplemented in VCF::ComboBoxControl, and VCF::ListBoxControl. |
|
|
called when the user releases the key
Reimplemented in VCF::ListBoxControl, VCF::PushButton, and VCF::SliderControl. |
|
|
Called when the control loses keyboard focus. Override this for your own custom behaviour if you need to. |
|
|
Pressing the accelerator character will cause the control's mnemonicActivate() method to be fired, which by default sets focus to the control.
Reimplemented in VCF::CommandButton, and VCF::Label. |
|
||||||||||||
|
Reimplemented in VCF::HeaderControl, VCF::ListControl, VCF::TabbedPages, VCF::TableControl, and VCF::TreeControl. |
|
|
Called when one or mouse buttons are held down and immediately released ( a "mouse click" ). override this to provide specific behaviours when a mouse click occurs Reimplemented in VCF::ListBoxControl, VCF::PushButton, and VCF::TableControl. |
|
|
Called when one or mouse buttons are held down and immediately released ( a "mouse double click" ) twice, within some specific time period, as determined on the windowing system. override this to provide specific behaviours when a mouse double click occurs Reimplemented in VCF::ListBoxControl, and VCF::Splitter. |
|
|
Called when one (or more) of the mouse buttons are held down. override this to provide specific behaviours when the mouse buttons are held down Reimplemented in VCF::ComboBoxControl, VCF::HeaderControl, VCF::ListBoxControl, VCF::PopupWindow, VCF::PushButton, VCF::SliderControl, VCF::Splitter, VCF::TabbedPages, VCF::TableControl, VCF::ToggledButton, VCF::ToolbarDock, and VCF::TreeListControl. |
|
|
Called when the mouse first enters the control's bounds. override this to provide specific behaviours when the control is first entered, like highlighting the control Reimplemented in VCF::ComboBoxControl, and VCF::PushButton. |
|
|
Called when the mouse leaves the control's bounds. override this to provide specific behaviours when the control is left, like highlighting the control Reimplemented in VCF::ComboBoxControl, and VCF::PushButton. |
|
|
Called when the mouse moves over the control. override this to provide specific behaviours when the mouse moves over the control. Reimplemented in VCF::ComboBoxControl, VCF::HeaderControl, VCF::ListBoxControl, VCF::PushButton, VCF::SliderControl, VCF::Splitter, VCF::TabbedPages, VCF::TableControl, VCF::ToggledButton, and VCF::ToolbarDock. |
|
|
Called when one (or more) of the mouse buttons are released. override this to provide specific behaviours when the mouse buttons are released. Reimplemented in VCF::ComboBoxControl, VCF::HeaderControl, VCF::ListBoxControl, VCF::PushButton, VCF::SliderControl, VCF::Splitter, VCF::TabbedPages, VCF::TableControl, VCF::ToggledButton, and VCF::ToolbarDock. |
|
|
Paints the control. Called by the underlying windowing system whenever the control needs to be painted. Note that in some cases the GraphicsContext passed in to this method may not be the same pointer as the GraphicsContext that the control holds itself. During the paint() method you should only use the context value for all your drawing and not the one returned in getContext(). The value returned by getContext() should be used for drawing that takes place outside of the paint() method. If the control allows paint notification, then the framework will fire an event to the BeforeControlPainted delegate prior to calling the control's paint() method. After the paint() method has returned, if the control allows paint notification, the framework will fire an event to the AfterControlPainted delegate. This allows outside observers to take part in the paint cycle, but beware that this does come at a bit of a cost, so use this feature sparingly. Note: This should NEVER be called by programmers using the VCF, it will be called for you during the course of your applications native event loop, and is only here for providing custom drawing routines for controls. In other words: you implement it, you never call it yourself.
Implemented in VCF::CheckBoxControl, VCF::ComboBoxControl, VCF::CommandButton, VCF::ControlContainer, VCF::CustomControl, VCF::Dialog, VCF::DropDownControl, VCF::Frame, VCF::HeaderControl, VCF::ImageControl, VCF::Label, VCF::ListBoxControl, VCF::ListViewControl, VCF::Panel, VCF::PopupWindow, VCF::ProgressControl, VCF::PushButton, VCF::RadioButtonControl, VCF::SliderControl, VCF::Splitter, VCF::StatusBar, VCF::TabbedPages, VCF::TabbedPages::ScrollButton, VCF::TabSheet, VCF::TableControl, VCF::TextControl, VCF::Toolbar, VCF::ToolbarDock, VCF::TransparentWindow, VCF::TreeControl, VCF::Window, VCF::HTMLBrowserControl, and VCF::OpenGLControl. |
|
|
Paints the border for the control. This is called by the framework during the painting of the control. Do not count on this being called at the same time as the paint() method, as the order in which this is called is dependant on the underlying windowing system. For example, on Win32 systems this call may be made by the framework outside of the WM_PAINT message handling, while on Mac OS X this will be called in the same event handler that dispatches the control's paint() method. |
|
|
Called when the parent of the control is changed. Override this for your own custom behaviour if you need to. |
|
|
called when the control's coordinates change. Override this for your own custom behaviour if you need to. |
|
||||||||||||||||
|
Called by the container instance of the child's parent control during it's paintChildren() function. Called after the child control's paint() and paintBorder() functions. |
|
|
Called after the component is done loading. Control's will re-implement this and set their visible state to whatever the value of the visible parameter is. Reimplemented from VCF::Component. |
|
||||||||||||||||
|
Called by the container instance of the child's parent control during it's paintChildren() function. The implementation should do whatever is neccessary to seup up the child control's cliprect. A pre-calculated cliprect is passed in that was generated by the paintChildren() function. This function is called prior the child control's paint() or paintBorder() functions. |
|
|
Called when loading the component. Control's will re-implement this and set their visible state to false. Reimplemented from VCF::Component. |
|
|
releases mouse events - goes back to normal event handling
|
|
|
throw( InvalidPeer ); -JEC - FIXME later
|
|
|
repaint the control. This post a message to the windowing systems message queue.
|
|
|
|
|
||||||||||||
|
|
|
|
sets the alignment of the control
Reimplemented in VCF::Splitter. |
|
|
Sets whether or not the control will allow paint notification.
|
|
|
|
|
|
|
|
|
sets the anchor mask value for the control. See getAnchor() for a complete description of the various values and what they mean for the control's alignment.
|
|
|
sets auto start dragging to true or false
|
|
|
The control will check the border's owner value, and if it's NULL then it will set itself as the component owner of the border. |
|
|
sets the bottom value of the control. This value is in the coordinates of the parent control. |
|
||||||||||||
|
sets the bounds of the control. The values in the rect parameter must be in the corrdinate system of the parent control
|
|
||||||||||||||||||||
|
sets the bounds of the control. You can pass in left, top, width and height as the new position for the control.
|
|
|
sets the control that has captured the mouse. Used internally only. DO NOT call, this is for internal framework use only. |
|
|
sets the color to fill this control's background with
|
|
|
sets the current container for a control. Setting a control's container, will enable (or disable, if the container value passed in is NULL) the control's ability to handle child controls
|
|
|
sets the cursor ID for the control. This will change the cursor appearance whenever the mouse is over the control. |
|
|
sets whether or not this control is double buffered. A control that is double buffered will automatically use a memory graphics context to draw on, and then blit the contents of this on the actual graphics context for the control. Doing this results in completely flicker free drawing of your controls, but is slighty slower. Without double buffering, the painting of the control takes place directly on the control's graphics context, and can result in flicker, but is slighlty faster. Controls have this set to true by default, with the exception of the OpenGL control, which lets the underlying OpenGL graphics engine take care of the double buffering for it.
|
|
|
sets whether the control is enabled or not.
Reimplemented in VCF::ComboBoxControl. |
|
|
Makes this control the currently focused control. A control with focus will receive keyboard events.
|
|
|
sets the font attributes. Note the internal font is not reassigned, but rather the data is copied over from the font instance passed in to the method. The caller completely owns the font instance that is passed in, and is responsible for cleaning up it's memory.
|
|
|
sets the height of the control. If the control implements the Container interface, then any child controls will be resized via the Container::resizeChildren() automatically. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sets the left value for the control, immediately updates the controls position.
|
|
|
|
|
|
Sets the maximum size of the control.
|
|
|
|
|
|
Sets the minimum height of the control.
|
|
|
Sets the minimum size of the control.
|
|
|
Sets the minimum width of the control.
|
|
|
|
|
|
|
|
|
sets the parent for the control
|
|
|
sets the popup menu for this control.
|
|
|
set the preferred height. This is used when determing the height of the control when it is first created. |
|
|
set the preferred width. This is used when determing the height of the control when it is first created. |
|
|
|
|
|
sets the right value of the control. This value is in the coordinates of the parent control. |
|
|
sets the scrollable for the control. Control's with a scrollable object will be able to provide scroll bars when neccessary. Reimplemented in VCF::ListBoxControl. |
|
|
|
|
|
sets the tab stop value of the control. The default value is true.
|
|
|
sets the string that is used to display in the tooltip for the control.
|
|
|
sets the top value of the control. This value is in the coordinates of the parent control. |
|
|
sets whether the control should use it's parent font's settigns or use it's own independent of it's parent's font.
|
|
|
sets whether or not the control is using the render buffer of it's GraphicsContext. Using the render buffer allows the control to take advantage of the GraphicsContext's advanced anti-aliasing vector graphics. This will create snapshot image that is retained and used to draw into. When the drawing is done (i.e. paint() returns), the image contents are copied back to the actual GraphicsContext. If the control is resized the image is resized as well |
|
|
sets the view to associate with this control
|
|
|
sets a new model for the view Once set, the control fires a ControlModelChanged event.
Reimplemented from VCF::AbstractView. Reimplemented in VCF::ComboBoxControl. |
|
|
determines whether or not the control is visible, and set it visible if it wasn't.
|
|
|
sets the string that is used for context sensitive help for the control.
|
|
|
sets the width of the control. If the control implements the Container interface, then any child controls will be resized via the Container::resizeChildren() automatically. |
|
|
called when the control's bounds change. Override this for your own custom behaviour if you need to. |
|
|
Takes the coordinates in rect, which are in the coordinate system of the Screen, and translates them into the coordinate system of this control.
|
|
|
Takes the coordinates in pt, which are in the coordinate system of the Screen, and translates them into the coordinate system of this control.
|
|
|
translate the point from parent controls coordinate system to this controls coordinate system
|
|
|
translate the point from this controls coordinate system to the parent controls coordinate system
|
|
|
Takes the coordinates in rect, which are in the coordinate system of this control, and translates them into the coordinate system of the Screen.
|
|
|
Takes the coordinates in pt, which are in the coordinate system of this control, and translates them into the coordinate system of the Screen.
|
|
|
|
|
|
returns whether this control will use the font settings of the parent's font.
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented in VCF::HeaderControl, VCF::ListViewControl, and VCF::TreeListControl. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/ApplicationKit/Control.h
