#include <container.h>
This is the Container class, which is actually a base class for all other widgets. Althought this one does not render itself, it actually contains most of reusable code for the widgets to inherit. An example of these inherited functionalities are children management, children rendering, proper clipping, mouse coordinate transformation, et al.
Definition at line 47 of file container.h.
Public Member Functions | |
virtual void | AddObject (glictContainer *object) |
Adds an object as a child. | |
bool | CastEvent (glictEvents evt, void *wparam, long lparam) |
Casts an event omitting the returnvalue. (deprecated, I'm lazy and don't want to rewrite code so I abuse namespace). | |
virtual bool | CastEvent (glictEvents evt, void *wparam, long lparam, void *returnvalue) |
Casts an event to the class, so it can process it. Example is mouseclick or mousedown. | |
void | CPaint () |
Renders all children. | |
bool | DefaultCastEvent (glictEvents evt, void *wparam, long lparam, void *returnvalue) |
Casts an event into default event processor, omitting the widget's code. | |
void | DelayedRemove () |
Runs delayed removal of objects. | |
const char * | EvtTypeDescriptor (glictEvents evt) |
Returns string with generated event. | |
virtual void | FixContainerOffsets () |
Fixes container offsets. Should be used only internally. | |
void | Focus (glictContainer *callerchild) |
Sets the focus to the current object. | |
std::string | GetCaption () |
Retrieves the caption of the control, if supported. | |
virtual void * | GetCustomData () |
Allows the application programmer to retrieve previously stored custom data assigned to this object. | |
bool | GetEnabled () |
Retrieves enabledness. | |
virtual bool | GetFocusable () |
Allows to retrieve whether or not a widget can be focused. | |
float | GetHeight () |
Returns object's height. | |
glictContainer * | GetParent () |
void | GetPos (glictPos *pos) |
Gets object's position and writes it into predefined type. Useful when exchanging data between library's functions. | |
void | GetPos (float *x, float *y) |
Gets object's position and writes it into integers x and y. | |
void | GetSize (glictSize *size) |
Gets object's size (height and width) and writes it into predefined type. | |
virtual glictPos * | GetVirtualPos () |
bool | GetVisible () |
Retrieves visibility. | |
float | GetWidth () |
Returns object's width. | |
float | GetX () |
Returns object position's x coordinate. | |
float | GetY () |
Returns object position's y coordinate. | |
glictContainer (long guid) | |
Constructor for the class, specifying guid. (Guid is unused at the moment). | |
glictContainer () | |
Constructor for the class. | |
virtual void | Paint () |
Renders the element. Should contain call to CPaint(). | |
virtual void | RecursiveBoundaryFix () |
Fixes boundaries recursively up to the root of the tree (desktop, probably). Also used to make scrollbars appear in case of virtual size, where appropriate. Should be used only internally. FIXME: Make private/protected. | |
void | RememberTransformations () |
When calling parent's paint, call it's 'remember transformations' too, so clicking detection is done properly. if clicking unused, or no transformations done, then not important. | |
virtual void | RemoveObject (glictContainer *object) |
Removes an object that's a child. | |
void | ReportDebug () |
Reports debug information to stdout. | |
void | ResetTransformations () |
Resets transformations to default transf matrix (identity matrix). | |
void | SetCaption (const std::string caption) |
Sets the caption of the control, if supported. | |
virtual void | SetCustomData (void *param) |
Allows the application programmer to store custom data assigned to this object. | |
void | SetEnabled (bool enabled) |
Sets enabledness. | |
virtual void | SetFocusable (bool b) |
Allows to set whether or not a widget can be focused. | |
void | SetFont (std::string name, unsigned int size=10) |
Sets the name of the font to be used for rendering of any caption that the widget may be attempting to paint. Also sets the size, which may be disregarded by the font engine. | |
virtual void | SetHeight (float h) |
Sets object's height. | |
void | SetNext (glictContainer *) |
void | SetOnClick (void(*OnClickFunction)(glictPos *relmousepos, glictContainer *callerclass)) |
Sets a function to execute upon click. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN. | |
void | SetOnMouseDown (void(*FunctionPtr)(glictPos *relmousepos, glictContainer *callerclass)) |
Sets a function to execute upon mouse pressed down over this object. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN. | |
void | SetOnMouseUp (void(*FunctionPtr)(glictPos *relmousepos, glictContainer *callerclass)) |
Sets a function to execute upon mouse pressed down over this object. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN. | |
void | SetOnPaint (void(*OnPaintFunction)(glictRect *real, glictRect *clipped, glictContainer *callerclass)) |
Sets a function to execute whenever drawing. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN. | |
void | SetPos (glictPos pos) |
Sets object's position using predefined type. Useful when exchanging data between library's functions. | |
void | SetPos (float x, float y) |
Sets object's position using classical access using two integers. | |
void | SetPrevious (glictContainer *) |
void | SetScissor () |
This one adjusts the clipping window through which something can be seen, and which is set by SetClip. | |
virtual void | SetVirtualSize (float w, float h) |
void | SetVisible (bool visibility) |
Sets visibility. | |
virtual void | SetWidth (float w) |
Sets object's width. | |
void | TransformScreenCoords (glictPos *pos) |
Transforms screen coordinates into plane coordinates. | |
virtual void | VirtualScrollBottom () |
virtual | ~glictContainer () |
Destructor for the class. | |
Public Attributes | |
float | bottom |
Current boundaries of the widget, calculated from height, width, x and y. FIXME: Make private. | |
float | clipbottom |
Current clipping boundaries of the widget. Somewhat depends on the parent's clipping. FIXME: Make private. | |
float | clipleft |
float | clipright |
float | cliptop |
float | containeroffsetx |
float | containeroffsety |
Offsets of container object positions. | |
float | height |
float | left |
char | objtype [50] |
Short descriptive string containing name of the object. (Each class actually rewrites this one upon intialization in constructor.). | |
float | right |
float | top |
float | width |
Current height and width of the widget. FIXME: Make private/protected. | |
float | x |
float | y |
Current position of the widget. FIXME: Make private/protected. | |
Protected Attributes | |
std::string | caption |
Caption written on the control, if control supports it. | |
void * | customdata |
std::vector < glictContainer * > | delayedremove |
bool | focusable |
std::string | fontname |
unsigned int | fontsize |
unsigned int | guid |
Unique identifier; unused so far. | |
float | ModelviewMatrix [16] |
Modelview matrix, as remembered last time RememberTransformations() was called. | |
glictContainer * | next |
std::vector < glictContainer * > | objects |
Contains all the children objects. | |
void(* | OnClick )(glictPos *relmousepos, glictContainer *callerclass) |
Pointer to function specified as OnClick function. | |
void(* | OnMouseDown )(glictPos *relmousepos, glictContainer *callerclass) |
Pointer to function specified as OnMouseDown function. | |
void(* | OnMouseUp )(glictPos *relmousepos, glictContainer *callerclass) |
Pointer to function specified as OnMouseUp function. | |
void(* | OnPaint )(glictRect *real, glictRect *clipped, glictContainer *callerclass) |
Pointer to function specified as OnPaint function. | |
glictContainer * | parent |
Pointer to class' parents. | |
glictContainer * | previous |
glictPos | virtualpos |
glictSize | virtualsize |
Private Member Functions | |
void | SetClip (float left, float top, float right, float bottom) |
Internal function. Sets the clipping boundaries of the widget. | |
void | SetRect (float left, float top, float right, float bottom) |
Internal function. Sets the boundaries of the widget. | |
Private Attributes | |
bool | enabled |
bool | visible |
Friends | |
void | _glictMessageBox_Closer (glictPos *relmousepos, glictContainer *caller) |
glictContainer::glictContainer | ( | ) |
Constructor for the class.
It fills up the class with default infos.
Definition at line 53 of file container.cpp.
References containeroffsetx, containeroffsety, focusable, fontname, fontsize, guid, height, next, OnClick, OnMouseDown, OnMouseUp, OnPaint, parent, previous, ResetTransformations(), SetCaption(), SetClip(), SetEnabled(), SetRect(), SetVisible(), virtualpos, virtualsize, width, glictPos::x, x, glictPos::y, and y.
glictContainer::~glictContainer | ( | ) | [virtual] |
Destructor for the class.
Only used to determine if this is the currently focused item; if so, then it sets currently focused item to NULL.
Definition at line 104 of file container.cpp.
References glictGlobalsClass::topFocused.
void glictContainer::AddObject | ( | glictContainer * | obj | ) | [virtual] |
Adds an object as a child.
obj | Pointer to object to add as a child. Simply inserts the passed object pointer into a vector/list of objects, also giving the child object a "this" as a parent, so the child knows who gave birth to it. Also tells it to ResetTransformations, which'd be incorrect at display, but lets us get rid of it at init time. (Oh, dear, no more biology...) |
Reimplemented in glictList.
Definition at line 129 of file container.cpp.
References objects, parent, RecursiveBoundaryFix(), and ResetTransformations().
Referenced by glictList::AddObject(), glictMessageBox::glictMessageBox(), and glictPanel::glictPanel().
bool glictContainer::CastEvent | ( | glictEvents | evt, | |
void * | wparam, | |||
long | lparam | |||
) |
Casts an event omitting the returnvalue. (deprecated, I'm lazy and don't want to rewrite code so I abuse namespace).
evt | Event that occured | |
*wparam | Any kind of value that needs to be passed on to the function. (For example if a structure needs to be passed.) | |
lparam | Numeric value that needed to be passed for event processing. |
Definition at line 787 of file container.cpp.
References CastEvent().
bool glictContainer::CastEvent | ( | glictEvents | evt, | |
void * | wparam, | |||
long | lparam, | |||
void * | returnvalue | |||
) | [virtual] |
Casts an event to the class, so it can process it. Example is mouseclick or mousedown.
evt | Event that occured | |
*wparam | Any kind of value that needs to be passed on to the function. (For example if a structure needs to be passed.) | |
lparam | Numeric value that needed to be passed for event processing. | |
*returnvalue | Return value, if any, will be stored here. If NULL, no return value shall be stored. |
The thing is, this CastEvent function first tries to tell its children that the event happened, and upon being told by each of them that they didn't do anything with the event, goes on with processing it itself.
Container class does not do anything except pushing events on to DefaultCastEvent.
Reimplemented in glictButton, glictPanel, glictScrollbar, glictTextbox, and glictWindow.
Definition at line 820 of file container.cpp.
References DefaultCastEvent(), GetEnabled(), GetVisible(), and GLICT_MOUSECLICK.
Referenced by CastEvent(), and DefaultCastEvent().
void glictContainer::CPaint | ( | ) |
Renders all children.
CPaint() is used to render "all the small things". All children are properly rendered here, with calls to SetScissor() and then to Paint(), and although the call to SetScissor() might be unnecessary it's always good to do things twice if you're not certain. After that Paint() of each object is called.
So, we have a loop that goes through the objects vector/list, then calls for each object the SetScissor() and then Paint().
Prior to rendering, however, the delayedremove vector is checked out and all objects requested are removed.
This f. is used within Paint(); actually there should be no reason for this function to be used except internally when writing a widget. You may be more interested in the Paint() method.
Definition at line 520 of file container.cpp.
References glictGlobalsClass::clippingMode, containeroffsetx, containeroffsety, DelayedRemove(), glictGlobalsClass::drawPartialOut, GetHeight(), GetWidth(), GLICT_SCISSORTEST, GLICT_STENCILTEST, objects, glictGlobalsClass::Translatef(), virtualpos, glictPos::x, and glictPos::y.
Referenced by glictWindow::Paint(), glictTextbox::Paint(), glictScrollbar::Paint(), glictProgressBar::Paint(), glictPanel::Paint(), Paint(), and glictButton::Paint().
bool glictContainer::DefaultCastEvent | ( | glictEvents | evt, | |
void * | wparam, | |||
long | lparam, | |||
void * | returnvalue | |||
) |
Casts an event into default event processor, omitting the widget's code.
evt | Event that occured | |
*wparam | Any kind of value that needs to be passed on to the function. (For example if a structure needs to be passed.) | |
lparam | Numeric value that needed to be passed for event processing. | |
*returnvalue | Return value, if any, will be stored here. If NULL, no return value shall be stored. |
There is very little practical use for this function apart from internal use when making a widget. You may be more interested in classical CastEvent().
For external use you should only use CastEvent().
For more information on how the event system works, see the CastEvent() as well. You'll also read of parameters there, as well as return value.
Definition at line 619 of file container.cpp.
References CastEvent(), clipbottom, clipright, containeroffsetx, containeroffsety, Focus(), focusable, GLICT_KEYDOWN, GLICT_KEYPRESS, GLICT_KEYUP, GLICT_MOUSECLICK, GLICT_MOUSEDOWN, GLICT_MOUSEUP, glictGlobalsClass::lastMousePos, left, objects, objtype, OnClick, OnMouseDown, OnMouseUp, top, glictGlobalsClass::topFocused, virtualpos, glictPos::x, x, y, and glictPos::y.
Referenced by glictWindow::CastEvent(), glictTextbox::CastEvent(), glictScrollbar::CastEvent(), glictPanel::CastEvent(), CastEvent(), and glictButton::CastEvent().
void glictContainer::DelayedRemove | ( | ) |
Runs delayed removal of objects.
Executes the delayedremoval.
Definition at line 165 of file container.cpp.
References delayedremove, and objects.
Referenced by CPaint().
const char * glictContainer::EvtTypeDescriptor | ( | glictEvents | evt | ) |
Returns string with generated event.
This function goes all the way up to the root of the tree and fixes the boundaries from up there, making sure clipping occurs properly.
This function should be used only internally. Describes event being passed as the parameter and returns its name as a string. For debugging purposes.
Definition at line 1188 of file container.cpp.
References GLICT_MOUSECLICK, GLICT_MOUSEDOWN, and GLICT_MOUSEUP.
void glictContainer::FixContainerOffsets | ( | ) | [virtual] |
Fixes container offsets. Should be used only internally.
In case user sets a new skin, we need to fix container offsets. Each widget should redefine it and use appropriate skin element's properties.
This function should be used only internally.
Reimplemented in glictWindow.
Definition at line 1218 of file container.cpp.
Referenced by SetPos().
void glictContainer::Focus | ( | glictContainer * | callerchild | ) |
Sets the focus to the current object.
callerchild | This object's child that asks this object to focus. |
In applications, you should mostly use NULL argument.
Definition at line 1107 of file container.cpp.
References Focus(), focusable, objects, parent, and glictGlobalsClass::topFocused.
Referenced by glictWindow::CastEvent(), glictTextbox::CastEvent(), glictScrollbar::CastEvent(), glictButton::CastEvent(), DefaultCastEvent(), Focus(), and glictMessageBox::glictMessageBox().
std::string glictContainer::GetCaption | ( | ) |
Retrieves the caption of the control, if supported.
Definition at line 1086 of file container.cpp.
References caption.
void * glictContainer::GetCustomData | ( | ) | [virtual] |
Allows the application programmer to retrieve previously stored custom data assigned to this object.
Definition at line 1234 of file container.cpp.
References customdata.
bool glictContainer::GetEnabled | ( | ) |
Retrieves enabledness.
Definition at line 1171 of file container.cpp.
References enabled.
Referenced by glictWindow::CastEvent(), glictTextbox::CastEvent(), glictPanel::CastEvent(), CastEvent(), and glictButton::CastEvent().
float glictContainer::GetHeight | ( | ) |
Returns object's height.
Definition at line 326 of file container.cpp.
References height.
Referenced by CPaint().
glictContainer * glictContainer::GetParent | ( | ) |
Obtains the current object's parent, as stored in parent variable.
Definition at line 1093 of file container.cpp.
References parent.
void glictContainer::GetPos | ( | glictPos * | pos | ) |
Gets object's position and writes it into predefined type. Useful when exchanging data between library's functions.
*pos | Pointer to struct where coordinates should be saved. |
Definition at line 292 of file container.cpp.
References x, glictPos::x, y, and glictPos::y.
void glictContainer::GetPos | ( | float * | x, | |
float * | y | |||
) |
Gets object's position and writes it into integers x and y.
*x | Pointer where X coordinate should be saved. | |
*y | Pointer where Y coordinate should be saved. |
Definition at line 280 of file container.cpp.
void glictContainer::GetSize | ( | glictSize * | size | ) |
Gets object's size (height and width) and writes it into predefined type.
*size | Pointer to which the size of object should be saved. |
Definition at line 305 of file container.cpp.
References glictPos::h, height, glictPos::w, and width.
bool glictContainer::GetVisible | ( | ) |
Retrieves visibility.
Definition at line 1149 of file container.cpp.
References visible.
Referenced by glictWindow::CastEvent(), glictTextbox::CastEvent(), glictScrollbar::CastEvent(), glictPanel::CastEvent(), CastEvent(), glictButton::CastEvent(), glictWindow::Paint(), glictTextbox::Paint(), glictScrollbar::Paint(), glictPanel::Paint(), glictMessageBox::Paint(), Paint(), and glictButton::Paint().
float glictContainer::GetWidth | ( | ) |
Returns object's width.
Definition at line 316 of file container.cpp.
References width.
Referenced by CPaint().
void glictContainer::Paint | ( | ) | [virtual] |
Renders the element. Should contain call to CPaint().
(This description applies for the glictContainer::Paint(). If you are reading it for some other class, then its documentation is not written yet for this function.)
In glictContainer class, Paint does nothing except calling SetScissor() and CPaint(). This is because as a widget the container class does not render anything; it serves as a point of divergence for other classes. Other widgets should define their own procedure with these two calls as a minimum.
When writing a widget, put SetScissor() on the beginning of this function, and CPaint() on the end.
Reimplemented in glictButton, glictMessageBox, glictPanel, glictProgressBar, glictScrollbar, glictTextbox, and glictWindow.
Definition at line 493 of file container.cpp.
References CPaint(), GetVisible(), and SetScissor().
void glictContainer::RecursiveBoundaryFix | ( | ) | [virtual] |
Fixes boundaries recursively up to the root of the tree (desktop, probably). Also used to make scrollbars appear in case of virtual size, where appropriate. Should be used only internally. FIXME: Make private/protected.
This function goes all the way up to the root of the tree and fixes the boundaries from up there, making sure clipping occurs properly.
This function should be used only internally.
Definition at line 1205 of file container.cpp.
References parent, RecursiveBoundaryFix(), SetPos(), x, and y.
Referenced by AddObject(), RecursiveBoundaryFix(), SetHeight(), and SetWidth().
void glictContainer::RememberTransformations | ( | ) |
When calling parent's paint, call it's 'remember transformations' too, so clicking detection is done properly. if clicking unused, or no transformations done, then not important.
Function collects the OpenGL's modelview matrix, and remembers whatever state it currently is in. It is later used in TransformScreenCoords(). It is not necessary to call this function unless you wish to perform a transformation on user interface, for example rotation. If you do not do this kind of thing, you do not need to call this function.
This also makes all children remember their transformation.
Definition at line 873 of file container.cpp.
References ModelviewMatrix, and objects.
void glictContainer::RemoveObject | ( | glictContainer * | object | ) | [virtual] |
Removes an object that's a child.
obj | Pointer to object to remove. |
Reimplemented in glictList.
Definition at line 148 of file container.cpp.
References delayedremove.
Referenced by glictList::RemoveObject(), and glictMessageBox::~glictMessageBox().
void glictContainer::ReportDebug | ( | ) |
Reports debug information to stdout.
Debugging function that reports some info about the current object, such as its name, height, width, position et al.
Definition at line 896 of file container.cpp.
References bottom, clipbottom, clipleft, clipright, cliptop, guid, height, left, objects, objtype, right, top, width, x, and y.
void glictContainer::ResetTransformations | ( | ) |
Resets transformations to default transf matrix (identity matrix).
Sets coordinate transformations to identity matrix.
Definition at line 113 of file container.cpp.
References ModelviewMatrix.
Referenced by AddObject(), and glictContainer().
void glictContainer::SetCaption | ( | const std::string | caption | ) |
Sets the caption of the control, if supported.
caption | Caption that's to be set |
Definition at line 1077 of file container.cpp.
Referenced by glictTextbox::CastEvent(), glictContainer(), glictMessageBox::glictMessageBox(), glictWindow::glictWindow(), glictTextbox::Paint(), and glictMessageBox::SetMessage().
void glictContainer::SetClip | ( | float | left, | |
float | top, | |||
float | right, | |||
float | bottom | |||
) | [private] |
Internal function. Sets the clipping boundaries of the widget.
left | Left clipping boundary of the object. | |
top | Top clipping boundary of the object. | |
right | Right clipping boundary of the object. | |
bottom | Bottom clipping boundary of the object. |
These functions can be overridden, always use SetPos(), SetWidth(), SetHeight() and other related functions!
SetPos(float x, float y), SetPos(glictPos pos), SetWidth(float w), SetHeight(float h)
Definition at line 383 of file container.cpp.
References clipbottom, clipleft, clipright, and cliptop.
Referenced by glictContainer(), and SetRect().
void glictContainer::SetCustomData | ( | void * | param | ) | [virtual] |
Allows the application programmer to store custom data assigned to this object.
Definition at line 1227 of file container.cpp.
References customdata.
void glictContainer::SetEnabled | ( | bool | enabled | ) |
Sets enabledness.
enabled | Object's "enabledness" |
Reimplemented in glictMessageBox.
Definition at line 1159 of file container.cpp.
Referenced by glictContainer(), and glictMessageBox::SetEnabled().
void glictContainer::SetFont | ( | std::string | name, | |
unsigned int | size = 10 | |||
) |
Sets the name of the font to be used for rendering of any caption that the widget may be attempting to paint. Also sets the size, which may be disregarded by the font engine.
name | Font name | |
size | Font size |
Definition at line 1269 of file container.cpp.
void glictContainer::SetHeight | ( | float | h | ) | [virtual] |
Sets object's height.
h | Height to which the object should be set. |
Definition at line 190 of file container.cpp.
References height, and RecursiveBoundaryFix().
Referenced by glictMessageBox::glictMessageBox(), glictScrollbar::glictScrollbar(), glictTextbox::glictTextbox(), glictWindow::glictWindow(), glictPanel::Paint(), glictList::RemoveObject(), and glictMessageBox::SetHeight().
void glictContainer::SetNext | ( | glictContainer * | n | ) |
n | 'next' widget |
Definition at line 1288 of file container.cpp.
References next.
void glictContainer::SetOnClick | ( | void(*)(glictPos *relmousepos, glictContainer *callerclass) | f | ) |
Sets a function to execute upon click. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN.
Sets an OnClick function that would a, for example, button use.
Definition at line 836 of file container.cpp.
References OnClick.
Referenced by glictMessageBox::glictMessageBox().
void glictContainer::SetOnMouseDown | ( | void(*)(glictPos *relmousepos, glictContainer *callerclass) | f | ) |
Sets a function to execute upon mouse pressed down over this object. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN.
Sets an OnMouseDown function.
Definition at line 843 of file container.cpp.
References OnMouseDown.
void glictContainer::SetOnMouseUp | ( | void(*)(glictPos *relmousepos, glictContainer *callerclass) | f | ) |
Sets a function to execute upon mouse pressed down over this object. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN.
Sets an OnMouseUp function.
Definition at line 849 of file container.cpp.
References OnMouseUp.
void glictContainer::SetOnPaint | ( | void(*)(glictRect *real, glictRect *clipped, glictContainer *callerclass) | f | ) |
Sets a function to execute whenever drawing. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN.
Sets an OnPaint function that would a, for example, button use.
Definition at line 858 of file container.cpp.
References OnPaint.
void glictContainer::SetPos | ( | glictPos | pos | ) |
Sets object's position using predefined type. Useful when exchanging data between library's functions.
pos | Position specified in a struct, relative to parent. |
Definition at line 265 of file container.cpp.
References SetPos(), glictPos::x, and glictPos::y.
void glictContainer::SetPos | ( | float | x, | |
float | y | |||
) |
Sets object's position using classical access using two integers.
x | X coordinate of the object, relative to parent | |
y | Y coordinate of the object, relative to parent |
Definition at line 215 of file container.cpp.
References containeroffsetx, containeroffsety, FixContainerOffsets(), glictPos::h, height, left, objects, parent, SetRect(), top, virtualpos, glictPos::w, width, glictPos::x, and glictPos::y.
Referenced by glictWindow::CastEvent(), glictPanel::CastEvent(), glictMessageBox::glictMessageBox(), glictScrollbar::glictScrollbar(), glictWindow::glictWindow(), glictPanel::Paint(), RecursiveBoundaryFix(), glictMessageBox::SetHeight(), SetPos(), and glictMessageBox::SetWidth().
void glictContainer::SetPrevious | ( | glictContainer * | p | ) |
p | 'previous' widget |
Definition at line 1279 of file container.cpp.
References previous.
void glictContainer::SetRect | ( | float | left, | |
float | top, | |||
float | right, | |||
float | bottom | |||
) | [private] |
Internal function. Sets the boundaries of the widget.
left | Left boundary of the object. | |
top | Top boundary of the object. | |
right | Right boundary of the object. | |
bottom | Bottom boundary of the object. |
These functions can be overridden, always use SetPos(), SetWidth(), SetHeight() and other related functions!
SetPos(float x, float y), SetPos(glictPos pos), SetWidth(float w), SetHeight(float h)
Definition at line 348 of file container.cpp.
References clipbottom, clipleft, clipright, cliptop, max, min, parent, and SetClip().
Referenced by glictContainer(), and SetPos().
void glictContainer::SetScissor | ( | ) |
This one adjusts the clipping window through which something can be seen, and which is set by SetClip.
Sets up scissoring of the current object. Should be called withing Paint() function. If necessary, it can be manually called by program that uses the library, however in most cases it should not be necessary.
Note: although named SetScissor, GLICT can be set to use either scissor or stencil testing. This is so that special transformations can be painlessly used on entire GUI, which was one of goals in making the library. Default mode is scissor test for performance, scissoring/clipping can be turned off in glictGlobals's member clippingTest, or can be set to scissor testing.
It is up to main program to enable or disable appropriate stencil/scissor test.
If using scissor test, then you MUST update the glictGlobals.h, although that is always recommended. glictGlobals.h must contain current viewport height.
Definition at line 427 of file container.cpp.
References glictGlobalsClass::clippingMode, GLICT_SCISSORTEST, GLICT_STENCILTEST, glictGlobalsClass::h, ModelviewMatrix, and glictGlobalsClass::PaintRect().
Referenced by glictWindow::Paint(), glictScrollbar::Paint(), glictProgressBar::Paint(), Paint(), and glictButton::Paint().
void glictContainer::SetVirtualSize | ( | float | w, | |
float | h | |||
) | [virtual] |
w | Virtual width | |
h | Virtual height |
If virtual width and height are set to smaller than real width and height, they are simply ignored.
Reimplemented in glictPanel.
Definition at line 1251 of file container.cpp.
References glictPos::h, virtualsize, and glictPos::w.
Referenced by glictPanel::SetVirtualSize().
void glictContainer::SetVisible | ( | bool | vsbl | ) |
Sets visibility.
vsbl | New value for visibility |
Definition at line 1139 of file container.cpp.
References visible.
Referenced by glictContainer(), glictPanel::glictPanel(), glictPanel::Paint(), and glictMessageBox::SetEnabled().
void glictContainer::SetWidth | ( | float | w | ) | [virtual] |
Sets object's width.
w | Width to which the object should be set. |
Reimplemented in glictList.
Definition at line 202 of file container.cpp.
References RecursiveBoundaryFix(), and width.
Referenced by glictMessageBox::glictMessageBox(), glictScrollbar::glictScrollbar(), glictTextbox::glictTextbox(), glictWindow::glictWindow(), glictPanel::Paint(), glictMessageBox::SetWidth(), and glictList::SetWidth().
void glictContainer::TransformScreenCoords | ( | glictPos * | pos | ) |
Transforms screen coordinates into plane coordinates.
*pos | Coordinates to transform. Result gets placed here as well. |
This only takes modelview matrix into account, while we should take projection matrix into account as well.
Definition at line 931 of file container.cpp.
References ModelviewMatrix, glictPos::x, and glictPos::y.
void glictContainer::VirtualScrollBottom | ( | ) | [virtual] |
Scrolls to the virtual area's bottom. Container has it EMPTY because it does not directly support virtual area.
Reimplemented in glictPanel.
Definition at line 1259 of file container.cpp.
void _glictMessageBox_Closer | ( | glictPos * | relmousepos, | |
glictContainer * | caller | |||
) | [friend] |
Reimplemented in glictMessageBox.
Definition at line 22 of file messagebox.cpp.