virtual void SetRootWindow(EW_Window *window)
virtual EW_Window *GetRootWindow(void)
Set/Get the window to which this widget belongs.
Setting the root window in generally only done internally.
These functions override the virtuals of EW_Node.
virtual void SetParentWidget(EW_Widget *a_widget)
virtual EW_Widget *GetParentWidget(void)
Set/Get the direct parent of this widget.
If the widget is a direct child of a window, the parent widget will be NULL.
Setting the parent widget in generally only done internally.
These functions override the virtuals of EW_Node.
void SetName(char *string)
EW_String *GetNameString(void)
Set/Get the internal text identifier for the widget.
This used for debugging routines such as EW_Window::Dump()
Specific widget classes should set a default name.
Application writers can change the names to any arbitrary string.
One useful convention is to set this name to the appplication's variable
that represents the widget.
void SetEventMask(EW_Event *set)
EW_Event *GetEventMask(void)
Set/Get the event mask. An event is not masked out if
event->Intersects(set) returns TRUE.
EW_Event *GetDefaultEventMask(void)
EW_Event *GetFullEventMask(void)
Get a preset event mask. For example, SetEventMask(GetDefaultEventMask())
will use a default event mask.
Under EW, the default event mask is the same as the full event mask: allow everything.
Note that the derived WDS_Widget alters this default to a subset of all events.
EW_Event *GetLocalEventMask(void)
When first gotten this function will allocate space for the mask and
return a pointer to it.
On following calls, it will just return the same pointer.
This is a convenient way to set a custom mask without worrying about
allocation and deallocation.
void SetDormant(long set)
long GetDormant(void)
Set/Get the dormancy mode.
A non-zero value skips the widget's Operate() function during
a normal event descension.
Other widgets may use this value to treat the widget differently.
void SetInversion(long set)
long GetInversion(void)
Set/Get the inversion mode.
This causes child widget positions to be relative to the upper left corner instead of the lower left corner.
void SetDescendMode(long set)
long GetDescendMode(void)
Set/Get the descension mode.
This determines whether the event descends through each child widget
down the widget hierarchy.
Currently acceptable OR'able values are as follows.
Enumeration values are given for clarity; they are subject to change.
| EW_DESCEND_NULL 0 |
If no values set, descension cannot occur.
|
| EW_DESCEND_IN_CHILD_WIDGET 1 |
Descend if the event occurred inside the child widgets geometric bounds.
|
| EW_DESCEND_OUT_WINDOW 2 |
Descend if the event occurred outside the widget's root window.
|
| EW_DESCEND_IN_WINDOW 4 |
Descend if the event occurred inside the widget's root window.
|
void SetTrueOrigin(long x,long y)
void GetTrueOrigin(long *x,long *y)
void SetTrueGeometry(long x,long y,long w,long h)
void GetTrueGeometry(long *x,long *y,long *w,long *h)
Set/Get the origin/geometry of the widget, from the lower left corner
x,y and, optionally, of size w,h.
As opposed to the inherited EW_Node::GetOrigin(),
this true origin gives the position relative to the window,
not the parent node.
Note that setting the origin in this manner does not lock
the position.
The origin is merely translated into the parent widget's
relative coordinates.
So if the parent moves, the child may move too.
void GetParentTrueGeometry(long *x,long *y,long *w,long *h)
Get this widget's parent's geometry relative to the lower left corner
of the window.
void SetGreyOut(long set)
long GetGreyOut(void)
Set/Get the grey-out mode.
A non-zero causes a mesh of background-colored points to cover
the widget after it is drawn.
void SetInvisible(long set)
long GetInvisible(void)
Set/Get the invisibility mode.
A non-zero value skips the widget's Draw() function during a refresh.
Other widgets may use this value to treat the widget differently.
void SetRetainLimits(long set)
long GetRetainLimits(void)
Set/Get a flag to retain resize limits.
If set to zero, this widget clear the min, max, and pref sizes
during its Resize() phase.
void SetClipping(long set)
long GetClipping(void)
Set/Get the clipping mode.
A non-zero value activates clipping for the widget.
Currently acceptable values are as follows.
Enumeration values are given for clarity; they are subject to change.
| EW_CLIPPING_OFF 0 |
No additional clipping at the widget.
|
| EW_CLIPPING_CHILDREN 1 |
This widget's children are clipped to this widget's clipping region.
|
| EW_CLIPPING_ALL 2 |
This widget and its children are clipped to this widget's clipping region.
|
void SetClipRegion(long x,long y,long w,long h)
void GetClipRegion(long *x,long *y,long *w,long *h)
Set/Get the region of clipping for the widget relative to
the lower left corner of the window.
A non-positive dimension will default clipping to the edges of the widget.
This clipping is only effective if activated with SetClipping().
void SetClippable(long set)
long GetClippable(void)
Set/Get a flag indicating if the widget is affected by the parent's clipping region.
This cannot render the widget immune to the more ancestral clipping effects or
redraw limits on window exposures, only the clipping effects of the direct parent.
If the direct parent is fully clipped, the unclippable child may still be drawable,
but if a higher ancestor is fully clipped, that child will never get the opportunity.
long IsClipped(void)
Returns EW_CLIPPED_FULL if the widget is completely outside
the region being drawn.
Returns EW_CLIPPED_NOT otherwise.
A partial clipping of the widget,
previously indicated by EW_CLIPPED_PARTIAL,
now returns just EW_CLIPPED_NOT.
void SetTranslation(long x,long y)
void GetTranslation(long *x,long *y)
Set/Get the translation of this widget's children.
All translatable children are offset by this vector.
void SetTranslatable(long set)
long GetTranslatable(void)
Set/Get whether this widget is translatable by its parent.
A non-zero value indicates that this widget is translatable.
void SetBounds(long dir,long set)
void SetBounds(long set)
long GetBounds(long dir)
Set/Get the bounding flag in the direction dir,
either EW_HORIZONTAL or EW_VERTICAL.
In the version without the dir argument, both directions are set.
Currently acceptable values for set are as follows.
Enumeration values are given for clarity; they are subject to change.
| EW_BOUNDS_NONE 0x00 |
No special bounding rules.
|
| EW_BOUNDS_USE_MAX 0x01 |
During a resize, use the maximum size instead of the preferred size.
|
| EW_BOUNDS_FILL_PARENT 0x02 |
Automatically resize to fill the parent widget.
In some cases, this can have the same effect as EW_BOUNDS_USE_MAX.
This usually only can have a desirable effect when this widget
is the single child of a borderless parent, such as a scope.
|
| EW_BOUNDS_IGNORE_PARENT 0x02 |
Disable max and pref size checks associated with
the EW_Resize received from the parent
during a CheckSize() (generally during a Resize()).
The min size is still effective.
The checks versus the widget's own min, max, and pref size are unaffected.
|
void Redraw(EW_Redraw *redraw)
Potentially redraw this widget and its children, recursively.
Given the proper circumstances, such as the dirtiness flag,
the virtual function Draw() may be called.
This routine also takes care of the clipping functionality.
Redraw() is generally only called internally.
virtual void ClearBackground(void)
void ClearBackground(long colorindex)
Fill the bounds of the widget with the current background color,
EW_COLOR_BACKGROUND or explicitly stated colorindex.
long CheckSize(EW_Resize *resize)
Change the size of the widget based on the given resize
and the widget's own minimum, maximum, and prefered sizes.
virtual long Operate(EW_Event *event)
virtual long PostOperate(EW_Event *event)
In a standard descension,
Operate() member is called before the widget's children.
The widget can use this opportunity to act on the
event before its children.
By default, PostOperate() is called after the widget's children.
At this point, the event
may have been used (partially or completely) by the children.
All widgets should always check the usage value before ever acting on an event.
Return values ignored, reserved, and should currently be set to 0.
virtual long Descend(EW_Event *event)
This is the actual decension function for the widget.
By default, it calls the widget's Operate(),
the child widget list's Descend(),
and then the widget's PostOperate().
It is usually not replaced.
Return value ignored, reserved, and should currently be set to 0.
long PreResize(EW_Resize *resize)
virtual long Resize(EW_Resize *resize)
PreResize() is called by the default GetWidgetList()->Resize()
when the system believes that widgets may need to change their size.
PreResize() makes some adjustments based on bounding rules and
calls the widget's Resize() function.
The default Resize() calls CheckSize(resize),
and GetWidgetList()->Resize(resize).
If GetWidgetList()->Resize() is not used,
the widget must be sure to call the PreResize()
member of each of its children.
Return value ignored, reserved, and should currently be set to 0.
virtual void Draw(EW_Redraw *redraw)
virtual void PostDraw(EW_Redraw *redraw)
These members are called when the widget needs to be redrawn.
These functions should contain the graphics commands to draw the widget.
Draw() is called before the widget's children are drawn and
PostDraw() is called after all the children are drawn.
If the drawing is not inherently limited to the bounds of the widget,
clipping should be used.
However, unneccesary clipping can cause extra overhead.
virtual void DumpString(void)
Print a header string the precede a list of printouts from DumpInfo().
virtual void DumpInfo(long level)
Recursively print out a line of information about the widget.
The argument level specifies the depth in the widget hierarchy.
long GetCompound(void)
void SetCompound(long set) protected
Set/Get a flag specifying that a widget has children that need not be
printed in an abbreviated dump.
The setting of the flag is generally done in the widget's constructor.