Ctrl
class Ctrl : public Data , public Pte<Ctrl>
(Derivation from Pte<Ctrl> allows Ctrl to be pointed to by Ptr<Ctrl>
This the base class of GUI widgets hierarchy (that is why U++ widgets are also named "Ctrls").
enum PlacementConstants
Constants used in logical coordinates.
|
TOP |
Equal to LEFT (better name for vertical coordinate). |
|
BOTTOM |
Equal to RIGHT (better name for vertical coordinate) |
|
MINSIZE |
Value is determined using GetMinSize. |
|
MAXSIZE |
Value is determined using GetMaxSize. |
|
STDSIZE |
Value is determined using Get |
class Ctrl::Logc
This nested class serves as either vertical or horizontal part of logical position.
Logc(int al, int a, int b)
Constructor.
|
al |
Alignment type. Determines what other parameters mean. |
Logc()
Default constructor. Sets Logc to the empty state.
static int LSGN(dword d)
|
Return value |
True when equal. |
bool operator!=(Logc q) const
|
Return value |
True when not equal. |
int GetAlign() const
|
Return value |
Alignment type. |
int GetA() const
|
Return value |
First value. |
int GetB() const
|
Return value |
Second value. |
void SetAlign(int align)
Sets alignment type.
void SetA(int a)
Sets first value.
void SetB(int b)
Sets second value.
bool IsEmpty() const
|
Return value |
True if Logc is empty. |
struct LogPos
This nested class combines two Logc value into complete logical position.
LogPos(Logc x, Logc y)
Constructor.
LogPos()
Default constructor. Sets both Logc empty.
bool operator==(LogPos b) const
|
b |
LogPos to compare with. |
|
Return value |
True when equal. |
bool operator!=(LogPos b) const
|
b |
LogPos to compare with. |
|
Return value |
True when equal. |
Logc x
Horizontal Logc.
Logc y
Vertical Logc.
enum StateReason
Arguments of State virtual method.
|
FOCUS |
Ctrl got/lost focus. |
|
ACTIVATE |
Ctrl was activated. |
|
DEACTIVATE |
Ctrl was deactivated. |
|
SHOW |
Ctrl visibility changed. |
|
ENABLE |
Ctrl was enabled/disable. |
|
EDITABLE |
Ctrl editable status changed. |
|
OPEN |
Ctrl was open (its top-level Ctrl was open on screen). |
|
CLOSE |
Ctrl was closed (its top-level Ctrl was closed). |
enum MouseEvents
Constants that make up event argument of MouseEvent and FrameMouseEvent virtual methods. Value is combination of button and action bit fields.
Field masks
|
BUTTON |
Mask for button field. |
|
ACTION |
Mask for action field. |
Actions
|
MOUSEENTER |
Mouse entered Ctrl. |
|
MOUSEMOVE |
Mouse moved over Ctrl. |
|
MOUSELEAVE |
Mouse left Ctrl. |
|
CURSORIMAGE |
Cursor image has to be determined (method should respond with image). |
|
MOUSEWHEEL |
Mouse wheel rotated. |
|
DOWN |
Mouse button was pressed. |
|
UP |
Mouse button was released. |
|
DOUBLE |
Mouse button was double-clicked. |
|
REPEAT |
When mouse button is pressed for a while, U++ imitates keyboard autorepeat sending this message. |
Buttons
|
LEFT |
Left button. (This constant is not defined in MouseEvents, instead LEFT from Placements Constants is used). |
|
RIGHT |
Left button. (This constant is not defined in MouseEvents, instead LEFT from Placements Constants is used). |
Combinations
|
LEFTDOWN |
Left button pressed. |
|
LEFTDOUBLE |
Left button double pressed. |
|
LEFTREPEAT |
Left button autorepeat. |
|
LEFTUP |
Left button released. |
|
RIGHTDOWN |
Right button pressed. |
|
RIGHTDOUBLE |
Right button double pressed. |
|
RIGHTREPEAT |
Right button autorepeat. |
|
RIGHTUP |
Right button released. |
enum { NOBACKPAINT, FULLBACKPAINT, TRANSPARENTBACKPAINT, EXCLUDEPAINT }
These constants are parameters of BackPaint method. They determine back-plane drawing style.
|
NOBACKPAINT |
No backpaint is used. |
|
FULLBACKPAINT |
Whole area of Ctrl is backpainted. |
|
TRANSPARENTBACKPAINT |
Only transparent child Ctrls are backpainted. |
|
EXCLUDEPAINT |
Ctrl is not painted. This is special case for specific system related situations (like OLE control painted by regular Windows routine). |
typedef bool (*MouseHook)(Ctrl *ctrl, bool inframe, int event, Point p, int zdelta, dword keyflags)
Type for hooking mouse events across all Ctrls.
typedef bool (*KeyHook)(Ctrl *ctrl, dword key, int count)
Type for hooking keyboard events across all Ctrls.
typedef bool (*StateHook)(Ctrl *ctrl, int reason)
Type for hooking state changes across all Ctrls.
static Logc PosLeft(int pos, int size)
Creates left (or top) aligned logical coordinate (Logc).
|
pos |
Distance between left margin and left margin of parent's view. |
|
Return value |
Logical coordinate. |
static Logc PosRight(int pos, int size)
Creates right (or bottom) aligned logical coordinate (Logc).
|
pos |
Distance between right margin and right margin of parent's view. |
|
Return value |
Logical coordinate. |
static Logc PosTop(int pos, int size)
Equal to PosLeft(pos, size).
|
pos |
Distance between top margin and top margin of parent's view. |
|
Return value |
Logical coordinate. |
static Logc PosBottom(int pos, int size)
Equal to PosRight(pos, size).
|
pos |
Distance between bottom margin and bottom margin of parent's view. |
|
Return value |
Logical coordinate. |
static Logc PosSize(int lpos, int rpos)
Creates logical coordinate where distances between margins and parent's view margins are fixed and size of Ctrl is variable (depends of parent's view size).
|
lpos |
Distance between left/top margin and left/top margin of parent's view. |
|
rpos |
Distance between right/bottom margin and right/bottom margin of parent's view. |
|
Return value |
Logical coordinate. |
static Logc PosCenter(int size, int offset)
Creates centered logical coordinate, where Ctrl is placed in specified distance from center of parent's view.
|
offset |
Offset from center. |
|
Return value |
Logical coordinate. |
static Logc PosCenter(int size)
Equal to PosCenter(size, 0).
|
Return value |
Logical coordinate. |
static Vector <Ctrl *> GetTopCtrls()
Returns all opened top-level Ctrls of process. Top-level Ctrls are those without parent (GetParent() == NULL) - TopWindow Ctrls and pop-up Ctrls.
|
Return value |
Vector of all top Ctrls. |
static Vector<Ctrl *> GetTopWindows()
Returns all opened TopWindows (that is, instances of TopWindow class or classes derived from TopWindow) of process. The difference between GetTopWindows and GetTopCtrls is that GetTopCtrls returns pop-ups too.
|
Return value |
Vector of all TopWindows. |
static void CloseTopCtrls()
Closes all top-level Ctrls.
static void InstallMouseHook(MouseHook hook)
Installs mouse hook - a routine that receives all mouse input of application before it gets processed by Ctrls. You can install more mouse hooks. Mouse hook routine should return true to indicate the end of processing (and event propagation).
|
hook |
Pointer to hook routine. |
static void DeinstallMouseHook(MouseHook hook)
Uninstalls previously installed mouse hook.
|
hook |
Pointer to hook routine. |
static void InstallKeyHook(KeyHook hook)
Installs keyboard hook - a routine that receives all keyboard input of application before it gets processed by Ctrls. You can install more than one keyboard hooks. Keyboard hook routine should return true to indicate the end of processing (and event propagation).
|
hook |
Pointer to hook routine. |
static void DeinstallKeyHook(KeyHook hook)
Uninstalls previously installed keyboard hook.
|
hook |
Pointer to hook routine. |
static void InstallStateHook(StateHook hook)
Installs state hook - a routine that receives all state changes of any Ctrls.
|
hook |
Pointer to hook routine. |
static void DeinstallStateHook(StateHook hook)
Deinstalls previously installed state hook.
|
hook |
Pointer to hook routine. |
virtual void Paint(Draw& draw)
This method is called when Ctrl's view area is about to be repainted.
|
draw |
Target of draw operations. |
virtual void CancelMode()
This method is called by U++ core in situations when internal state of Ctrl that represents ongoing user action is about to be cleared to default. Typical example of such action is state of Button that is pushed by mouse click - if the pushed state is internally recorded in Button, it should by cleared by this method. Examples of situations when this method is called by framework is removing Ctrl from its parent or releasing mouse capture.
virtual void Activate()
This method is called when Ctrl is top-level and is activated - it or some of its child Ctrls receives keyboard focus (activation usually has other signs as bringing window foreground or changing its caption).
virtual void Deactivate()
This method is called when Ctrl is top-level and is deactivated - focus has gone outside of Ctrl and its child Ctrls.
virtual Image FrameMouseEvent(int event, Point p, int zdelta, dword keyflags)
This method is called when mouse event happens in frame area of Ctrl not containing any child Ctrls. Default implementation does nothing and returns Image::Arrow().
|
p |
Position of mouse cursor in frame coordinates. |
|
zdelta |
Mouse wheel rotation delta (if event is MOUSEWHEEL). |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
|
Return value |
If event is MOUSEIMAGE, method should return Image to be displayed as mouse cursor. |
virtual Image MouseEvent(int event, Point p, int zdelta, dword keyflags)
This method is called when mouse event happens in view area of Ctrl not containing any child Ctrls. Default implementation calls specific mouse event methods based on event parameter.
|
p |
Position of mouse cursor in view coordinates. |
|
zdelta |
Mouse wheel rotation delta (if event is MOUSEWHEEL). |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
|
Return value |
If event is MOUSEIMAGE, method should return Image to be displayed as mouse cursor. |
virtual void MouseEnter(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse cursor enters the view area of Ctrl.
|
p |
Point of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void MouseMove(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse cursor hovers above view area of Ctrl.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void LeftDown(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse left button is pressed.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void LeftDouble(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse left button is double-clicked.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void LeftTriple(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse left button is triple-clicked.
virtual void LeftDrag(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when user moves the mouse while holding left button by more than GUI_DragDistance pixels. p is the starting point of drag, not the current mouse position.
virtual void LeftHold(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when user holds the mouse left button down for a while.
virtual void LeftRepeat(Point p, dword keyflags)
This method is repeatedly called by default implementation of MouseEvent when mouse left button is pressed for some time, imitating keyboard autorepeat behaviour.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void LeftUp(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse left button is released.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void RightDown(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse right button is pressed.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void RightDouble(Point p, dword keyflags)
This method is repeatedly called by default implementation of MouseEvent when mouse right button is pressed for some time, imitating keyboard autorepeat behaviour.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void RightTriple(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse right button is triple-clicked.
virtual void RightDrag(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when user moves the mouse while holding right button by more than GUI_DragDistance pixels. p is the starting point of drag, not the current mouse position.
virtual void RightHold(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when user holds the mouse right button down for a while.
virtual void RightRepeat(Point p, dword keyflags)
This method is repeatedly called by default implementation of MouseEvent when mouse right button is pressed for some time, imitating keyboard autorepeat behaviour.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void RightUp(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when mouse left button is released.
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void MouseWheel(Point p, int zdelta, dword keyflags)
This method is called by default implementation of MouseEvent when mouse wheel is rotated.
|
p |
Position of mouse cursor in view coordinates. |
|
zdelta |
Amount of rotation. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
virtual void MouseLeave()
This method is called by default implementation of MouseEvent when mouse cursor leaves view area of Ctrl.
virtual Image CursorImage(Point p, dword keyflags)
This method is called by default implementation of MouseEvent when the shape of mouse cursor is to be determined..
|
p |
Position of mouse cursor in view coordinates. |
|
keyflags |
Combination of key flags for Shift, Ctrl and Alt keys. |
|
Return value |
Image of new cursor. Default implementation returns Image::Arrow(). |
virtual bool Key(dword key, int count)
This method provides keyboard input. When keyboard event occurs and some of U++ application Ctrls has input focus, its Key method is called. If Key method returns true, processing of key event is finished. If it returns false, U++ calls Key method of parent Ctrl and it repeats until either true is returned or Ctrl has no parent. If such top-level Ctrl is reached, U++ calls its HotKey method. Default implementation is void and returns false.
|
key |
Key identifier. If it is less than 65536, it indicates character code, otherwise it is key-code. Key-code is combination of basic key codes and further flags indicating state of shift keys and push/release events. |
|
count |
Accumulated autorepeat count. |
|
Return value |
Method should return true if further propagation is not desirable (in most cases this indicates that Ctrl accepted the key). |
virtual bool HotKey(dword key)
This method is called when no Ctrl accepts key event using Key method. Default implementation calls HotKey method child Ctrls. If some child Ctrl returns true, method returns true, otherwise it returns false.
|
Return value |
Method should return true to stop further distribution of key event via HotKey methods. |
virtual void GotFocus()
This method is called when Ctrl receives input focus. Default implementation is void.
virtual void LostFocus()
This method is called when Ctrl loses input focus. Default implementation is void.
virtual void ChildMouseEvent(Ctrl *child, int event, Point p, int zdelta, dword keyflags)
This method is invoked before the mouse event is routed to the child. Parameters of the event are the same as those in MouseEvent method. Default implementation calls the parent's ChildMouseEvent method.
virtual void ChildGotFocus()
This method is invoked when any of child Ctrls receives input focus.
virtual void ChildLostFocus()
This method is invoked when any of child Ctrls loses input focus.
virtual dword GetAccessKeys() const
Ctrl should use this method to signal presence of access keys. Access keys are keyboard keys that can be used to access or activate dialog functions when pressed together with Alt key. They can be defined by application designer (usually using & or \b in labels), or they are automatically synthesized using AssignAccessKeys method. If Ctrl (of one of Ctrls in its child tree) has some access keys and those keys are letters (in range 'A' - 'Z'), they should be returned as bit value using AccessKeyBit function. Other access keys should be indicated by bit 0 (that means, by binary or of 1 to result). Default implementation returns 0.
|
Return value |
Bit set of access keys. |
virtual void AssignAccessKeys(dword used)
This method gives a Ctrl chance to synthesize its letter access keys.
|
used |
Set of letter access keys that are already used and should not be chosen by Ctrl as its access keys. |
virtual void ChildAdded(Ctrl *child)
This method is invoked when child is added to Ctrl.
|
child |
Pointer to child added. |
virtual void ChildRemoved(Ctrl *child)
This method is invoked when child is removed from Ctrl.
|
child |
Pointer to child removed. |
virtual void ParentChange()
This method is called when Ctrl is added or removed from parent.
virtual void State(int reason)
This method is used to notify Ctrls about special state-change events that are not covered by virtual methods. Method is called for entire child tree of Ctrl whose state has changed.
|
reason |
Code of event. Standard reasons are enumerated by StateReason enum. |
virtual void Layout()
This method is invoked when layout of Ctrl has to be refreshed. This is usually either before window is displayed or when the Ctrl is resized.
virtual Size GetMinSize() const
This method should return minimal size of Ctrl.
|
Return value |
Minimal size. |
virtual Size GetStdSize() const
This method should return maximal size of Ctrl.
|
Return value |
Maximal size. |
virtual bool IsShowEnabled() const
This method indicates whether Ctrl should be painted as enabled. Default implementation returns IsEnabled() && (!parent || parent->IsShowEnabled()), however TopWindow overloads this function so that owner of modal dialogs while being disabled during modal dialog lifetime are displayed with enabled Ctrls.
|
Return value |
true if Ctrl should be painted as enabled. |
virtual int OverPaint() const
This method can returns non-zero number that represents paint extension margin of view area - Ctrl can paint inside this margin despite that fact that it does not belong to view. This is useful to represent some specific skinning effect (like glare around the button). Default implementation returns zero.
virtual Rect GetOpaqueRect()
Returns the rectangle of view area that is opaque (is completely filled when painting the widget). The default implementation returns the whole view area if Transparent flag is set, empty rectangle otherwise. Paint routine uses this information to optimize.
virtual Rect GetVoidRect()
Returns the rectangle of view area that is fully transparent (nothing is painted in that rectangle). Paint routine uses this information to optimize.
virtual Vector<Rect> GetTransparentFrameRects()
For transparent Ctrl returns set of frame areas that should be painted as transparent.
|
Return value |
Vector of transparent frame areas. |
virtual Vector<Rect> GetOpaqueFrameRects()
For transparent Ctrl returns set of frame areas that should be painted as opaque (means that painting Ctrls "under" is not needed.).
|
Return value |
Vector of opaque frame areas. |
virtual Vector<Rect> GetTransparentViewRects()
For transparent Ctrl is transparent, returns set of view areas that should be painted as transparent.
|
Return value |
Vector of transparent view areas. |
virtual Vector<Rect> GetOpaqueViewRects()
For transparent Ctrl returns set of view areas that should be painted as opaque.
|
Return value |
Vector of opaque view areas. |
virtual void Close()
Closes top-level Ctrl. If Ctrl is not top-level, has no effect. If it is and is open in host GUI (either as pop-up or as TopWindow), it should close it. Default implementation closes. TopWindow overrides this method to break modal loop instead of closing if modal loop is performed for it.
virtual bool IsOcxChild()
Used for Ocx control implementation.
virtual void SetData(const Value & data)
Sets the new value to the object. Default implementation is void.
virtual Value GetData() const
Gets current value of the object. Default implementation returns Value() - void value.
|
Return value |
Value of object. |
virtual void SetModify()
Sets modification flag.
virtual void ClearModify()
Clears modification flag. Default implementation is empty.
virtual bool IsModified() const
Queries modification flag. Default implementation returns false.
|
Return value |
Modification flag. |
virtual bool Accept()
This virtual method is called when value of Ctrl is about to be accepted. Default implementation calls Accept for all child Ctrls and returns false if any of child Ctrls returns false, true otherwise.
Typical use is when user pressed OK button. If any Ctrl of dialog returns false, OK is canceled.
Typical implementation of this method should test whether current state of Ctrl (its edited value) matches requirements. If it does, it should finish editing, accept edited value and return true. Otherwise it should return false,
|
Return value |
Ctrl should return true if it successfully finished editing, false otherwise. |
virtual void Reject()
This virtual method is called when Ctrl should abort editing, discarding edited value. Default implementation calls Reject for all child Ctrls.
virtual void Serialize(Stream & s)
Serialization method. Should serialize the value of Ctrl in a way that is suitable for dialog backup and optional restore (e.g. when user presses Cancel button).
void AddChild(Ctrl *child)
Adds a child Ctrl as last one.
|
child |
Pointer to child Ctrl at the end of child list. Note that U++ never takes ownership of Ctrls - never calls delete for child. That allows using non-heap based Ctrls. |
void AddChild(Ctrl *child, Ctrl *insafter)
Inserts child Ctrl after another Ctrl that is already child.
|
child |
Pointer to child Ctrl. |
|
insafter |
Ctrl that will be before inserted Ctrl. |
void AddChildBefore(Ctrl *child, Ctrl *insbefore)
Inserts child Ctrl before another Ctrl that is already child.
|
child |
Pointer to child Ctrl. |
|
insbefore |
Ctrl that will be after inserted Ctrl. |
void RemoveChild(Ctrl *child)
Removes Ctrl from child list. Ctrl is never deleted.
|
child |
Child to be removed. |
Ctrl *GetParent() const
Returns parent of Ctrl or NULL if Ctrl is topmost.
|
Return value |
Pointer to parent Ctrl. |
Ctrl *GetLastChild() const
Returns last child.
|
Return value |
Pointer to last child or NULL if Ctrl has no children. |
Ctrl *GetFirstChild() const
Returns first child.
|
Return value |
Pointer to first child or NULL if Ctrl has no children. |
Ctrl *GetPrev() const
Returns child that is before this Ctrl in child list or NULL if Ctrl is first or not in list.
|
Return value |
Pointer to previous child or NULL. |
Ctrl *GetNext() const
Returns next child that is after this Ctrl in child list or NULL if Ctrl is last or not in list.
|
Return value |
Pointer to next child or NULL. |
bool IsChild() const
|
Return value |
True if Ctrl has parent. |
Ctrl *ChildFromPoint(Point& pt) const
Checks whether opened top-level Ctrl is foreground.
|
Return value |
True if Ctrl is foreground. |
void SetForeground()
Asks platform to put top-level Ctrl to foreground.
const Ctrl *GetTopCtrl() const
Gets the top-level Ctrl, that is Ctrl that has this Ctrl in child tree and has no parent.
|
Return value |
Pointer to top-level Ctrl. Can return this. |
Ctrl *GetTopCtrl()
Gets the top-level Ctrl, that is Ctrl that has this Ctrl in child tree and has no parent.
|
Return value |
Pointer to top-level Ctrl. Can return this. |
const Ctrl *GetOwner() const
Returns owner of top-level Ctrl. Example of owned window is dialog launched from main application window. Owner is another top-level Ctrl.
|
Return value |
Pointer to owner top-level Ctrl or NULL is window is not owned. |
Ctrl *GetOwner()
Returns owner of top-level Ctrl.
|
Return value |
Pointer to owner top-level Ctrl or NULL is window is not owned. |
const Ctrl *GetTopCtrlOwner() const
Equivalent to GetTopCtrl()->GetOwner() call.
|
Return value |
Pointer to owner of top-level Ctrl. |
Ctrl *GetTopCtrlOwner()
Equivalent to GetTopCtrl()->GetOwner() call.
|
Return value |
Pointer to owner of top-level Ctrl. |
Ctrl *GetOwnerCtrl()
const Ctrl *GetOwnerCtrl() const
Returns the owner Ctrl. Unlike GetOwner, it returns actual widget that was used as "owner" parameter in Open or PopUp calls.
const TopWindow *GetTopWindow() const
TopWindow that contains this Ctrl.
|
Return value |
Pointer to TopWindow. |
TopWindow *GetTopWindow()
TopWindow that contains this Ctrl.
|
Return value |
Pointer to TopWindow. |
const TopWindow *GetMainWindow() const
Returns main window (one with no owner) that directly or indirectly owns this Ctrl.
|
Return value |
Pointer to main window. |
TopWindow *GetMainWindow()
Returns main window (one with no owner) that directly or indirectly owns this Ctrl.
|
Return value |
Pointer to main window. |
Ctrl& SetFrame(int i, CtrlFrame& frm)
Sets Frame at given position. If there is no such position yet, required number of NullFrame frames is added. Only reference to frame is stored, that means that frame must exists during the time it is used in Ctrl. Also, some frames can also be used for multiple Ctrls.
|
i |
Position. First frame with i == 0 is outermost. |
|
Return value |
Returns *this to allow chaining of method calls. |
Ctrl& SetFrame(CtrlFrame& frm)
Sets frame at position 0.
Ctrl& AddFrame(CtrlFrame& frm)
Adds frame at inner-most position.
const CtrlFrame& GetFrame(int i = 0) const
Returns reference to frame at given position.
|
Return value |
Reference to frame. |
CtrlFrame& GetFrame(int i = 0)
Returns reference to frame at given position.
|
Return value |
Reference to frame. |
void RemoveFrame(int i)
Removes frame at given position.
void RemoveFrame(CtrlFrame& frm)
Removes first frame equal to frm. Equality means here that pointers to both frames are the same (it is same instance).
void InsertFrame(int i, CtrlFrame& frm)
Inserts frame at given position.
int FindFrame(CtrlFrame& frm)
Finds first frame equal to frm. Equality means here that pointers to both frames are the same (it is same instance).
|
Return value |
Index of frame or negative value if frame is not found. |
int GetFrameCount() const
Returns count of frames in Ctrl.
|
Return value |
Count of frames. |
void ClearFrames()
Removes all frames from Ctrl. Frame at position 0 then added and set to NullFrame.
bool IsOpen() const
Checks whether top-level Ctrl of this Ctrl is open.
|
Return value |
true if open. |
void Shutdown()
Sets internal flag indicating that Ctrl is being destructed. This is rarely used to solve some destruction order problems.
bool IsShutdown() const
Checks whether internal shutdown flag is set.
|
Return value |
True if in shutdown mode. |
Ctrl& SetPos(LogPos p, bool inframe)
Sets logical position of Ctrl. If Ctrl is top-level, logical position must be of left-top type.
|
inframe |
If true, Ctrl is placed into frame area instead of view area |
Ctrl& SetPos(LogPos p)
Sets logical position of Ctrl in view area.
Ctrl& SetPos(Logc x, Logc y)
Sets logical position by individual coordinates (in view area).
|
x |
Horizontal logical position. |
|
y |
Vertical logical postion. |
Ctrl& SetPosX(Logc x)
Sets horizontal logical position only (in view area).
|
x |
Horizontal logical position. |
Ctrl& SetPosY(Logc y)
Sets vertical logical position only (in view area).
|
y |
Vertical logical position. |
void SetRect(const Rect& r)
Sets left-top logical position (in view area).
|
r |
Rectangle determines left-top position. |
void SetRect(int x, int y, int cx, int cy)
Sets left-top logical position (in view area).
|
x |
Distance between parent rectangle left-edge and Ctrl. |
|
y |
Distance between parent rectangle top-edge and Ctrl. |
void SetRectX(int x, int cx)
Sets left horizontal logical position (in view area).
|
x |
Distance between parent rectangle left-edge and Ctrl. |
void SetRectY(int y, int cy)
Sets top vertical logical position (in view area).
|
y |
Distance between parent rectangle top-edge and Ctrl. |
Ctrl& SetFramePos(LogPos p)
Sets logical position of Ctrl in frame area.
Ctrl& SetFramePos(Logc x, Logc y)
Sets logical position by individual coordinates (in frame area).
|
x |
Horizontal logical position. |
|
y |
Vertical logical postion. |
Ctrl& SetFramePosX(Logc x)
Sets horizontal logical position only (in frame area).
|
x |
Horizontal logical position. |
Ctrl& SetFramePosY(Logc y)
Sets vertical logical position only (in frame area).
|
y |
Vertical logical position. |
void SetFrameRect(const Rect& r)
Sets left-top logical position (in frame area).
|
r |
Rectangle determines left-top position. |
void SetFrameRect(int x, int y, int cx, int cy)
Sets left-top logical position (in frame area).
|
x |
Distance between parent rectangle left-edge and Ctrl. |
|
y |
Distance between parent rectangle top-edge and Ctrl. |
void SetFrameRectX(int x, int cx)
Sets left horizontal logical position (in frame area).
|
x |
Distance between parent rectangle left-edge and Ctrl. |
void SetFrameRectY(int y, int cy)
Sets top vertical logical position (in frame area).
|
y |
Distance between parent rectangle top-edge and Ctrl. |
bool InFrame() const
|
Return value |
true when Ctrl has position in frame area. |
bool InView() const
|
Return value |
true when Ctrl has position in view area. |
LogPos GetPos() const
|
Return value |
Logical position of Ctrl |
void RefreshLayout()
Recomputes layout for Ctrl. This includes calling FrameLayout for all frames and calling Layout virtual method.
void RefreshParentLayout()
If Ctrl has parent, calls parent->RefreshLayout().
Ctrl& LeftPos(int a, int size = STDSIZE)
Sets left horizontal position (in view area).
|
a |
Distance from left border of parent. |
|
Return value |
*this for method chaining. |
Ctrl& RightPos(int a, int size = STDSIZE)
Sets right horizontal position (in view area).
|
a |
Distance from the right border of parent. |
|
Return value |
*this for method chaining. |
Ctrl& TopPos(int a, int size = STDSIZE)
Sets top vertical position (in view area).
|
a |
Distance from the top border of parent. |
|
Return value |
*this for method chaining. |
Ctrl& BottomPos(int a, int |