#include <CUI_Frame.h>
Inheritance diagram for CUI_Frame:
Public Types | |
typedef bool(* | callbackfunc )(int id, int numparam, void *param) |
callback function type | |
enum | animation_t { UI_NONE, UI_FADELINE, UI_FADESIN } |
supported types of animation | |
Public Member Functions | |
CUI_Frame (CUI_UI *ui=NULL, float x=0, float y=0, float x2=1, float y2=1, CUI_Frame *parent=NULL, IUI_Shader *shader=NULL, IUI_Shader *cursor=NULL, CUI_CoordSys *coordsys=NULL) | |
constructor | |
virtual | ~CUI_Frame () |
destructor | |
virtual bool | SetUI (CUI_UI *ui) |
Set the UI that this frame exists in. | |
virtual bool | AddChild (CUI_Frame *frame, bool back=false) |
add a child to this frame | |
virtual bool | DeleteChild (CUI_Frame *frame) |
delete a child from this frame | |
virtual bool | SetParent (CUI_Frame *frame) |
set the parent for this frame | |
virtual CUI_Frame * | GetParent (void) |
get the parent for this frame | |
virtual bool | SetCursor (IUI_Shader *cursor) |
set cursor for this frame | |
virtual bool | SetShader (IUI_Shader *shader) |
set shader for this frame | |
virtual bool | SetCoordSys (CUI_CoordSys *coordsys) |
set coordinate system for this frame | |
virtual CUI_CoordSys * | GetCoordSys (void) |
get coordinate system for this frame | |
virtual bool | SetBorder (IUI_Border *border) |
set the border (frames don't have borders) | |
virtual IUI_Border * | GetBorder (void) |
get the border (frames don't have borders) | |
virtual bool | SetFont (IUI_Font *font) |
set the font (frames don't have fonts) | |
virtual IUI_Font * | GetFont (void) |
get the font (frames don't have fonts) | |
virtual bool | Move (float x, float y, float x2, float y2) |
set the position and size of this frame (in its parent's coordinate system) | |
virtual bool | Move (float x, float y) |
Move the frame, but don't resize it. | |
virtual void | GetRect (v4_f rect) |
get the current position and size | |
virtual bool | Convert (float &x, float &y) |
convert a coordinate into this coordinate system | |
virtual bool | ConvertFromGlobal (float &x, float &y) |
convert a coordinate from global to local coordinates | |
virtual bool | Save (char *filename) |
Save this frame to a new file. | |
virtual bool | Save (FILE *file) |
Save this frame to an already opened file. | |
virtual bool | SetToRange (IUI_Renderer *renderer) |
set view area if coordinate system requires it | |
virtual bool | Render (double dtime, IUI_Renderer *renderer) |
render this frame in the current viewport | |
virtual bool | RenderStart (double dtime, IUI_Renderer *renderer) |
begin rendering | |
virtual bool | RenderBackground (double dtime, IUI_Renderer *renderer) |
render background quad | |
virtual bool | RenderChildren (double dtime, IUI_Renderer *renderer) |
render children - should be the last render call made | |
virtual bool | Animate (double dtime, IUI_Renderer *renderer) |
Do any necessary animation before rendering. | |
virtual CUI_Frame * | TestHit (float x, float y) |
test if the given point is within this frame | |
virtual bool | BringToFront (void) |
move this frame to the front of its parent's list | |
virtual IUI_Shader * | GetShader (void) |
Get the shader for this frame. | |
virtual IUI_Shader * | GetCursor (void) |
Get the most specific cursor for this frame. | |
virtual bool | SetFrameID (unsigned long id) |
set this frame's ID | |
virtual unsigned long | GetFrameID (void) |
get this frame's ID | |
virtual bool | SetFlag (unsigned long flag, bool set) |
generic flag handling | |
virtual bool | GetFlag (unsigned long flag) |
generic flag handling | |
virtual bool | Activate (bool active=true) |
activate/deactivate this frame | |
virtual bool | Enable (bool enable=true) |
enable/disable this frame | |
virtual bool | AddClickableToList (void *voidlist) |
add frames with a certain flag(s) to a list | |
virtual bool | IsClickable () |
is this frame clickable | |
virtual bool | Click (int &id, int &numparam, void **param) |
Call this function when clicked on. | |
virtual bool | IsDraggable () |
is this frame draggable | |
virtual bool | Drag (float x, float y, float dx, float dy, int &id, int &numparam, void **param) |
Update the cursor's position as this is being dragged (in global space). | |
virtual void | DeleteParam (void *param) |
Delete a parameter allocated by this frame. | |
virtual bool | ProcessKey (unsigned long key) |
Process an incoming key. | |
virtual bool | SetFrameCallback (callbackfunc func) |
set callback function | |
virtual bool | CallbackFunc (int id, int numparam, void *param) |
Wrapper to m_callbackFunc to check for NULL and present a simple interface. | |
virtual bool | IsControl () |
is this frame a control? | |
virtual bool | SetText (const char *text) |
Set Text - frames have no text, but needs to be here as virtual. | |
virtual bool | SetToolTipText (char *text) |
Set text to display as a tooltip. | |
virtual bool | SetToolTipFrame (CUI_Frame *frame) |
Set the frame to display as a tooltip. | |
virtual CUI_Frame * | GetToolTipFrame () |
Get a pointer to the frame to use as a tooltip. | |
virtual char * | GetToolTipText () |
Get the tooltip text. | |
virtual bool | ResetCounter (bool count) |
Reset the animation counter. | |
virtual double | GetCounter () |
Get the value of the animation counter. | |
virtual bool | SetAnimation (animation_t anim) |
Set Animation type. | |
virtual animation_t | GetAnimation () |
get the animation counter | |
virtual void | SetOwnedByUI () |
Set this frame as owned by the UI. | |
virtual bool | IsOwnedByUI () |
Is this frame owned by the UI. | |
Protected Attributes | |
CUI_UI * | m_ui |
pointer to the ui that owns this frame | |
unsigned long | m_frameID |
this frame's ID - the app should define this! | |
callbackfunc | m_callbackFunc |
callback function | |
IUI_Shader * | m_cursor |
the cursor for this frame (NULL means the default) | |
IUI_Shader * | m_shader |
the shader for this frame (NULL means the default) | |
CUI_CoordSys * | m_coordsys |
the coordinate system for this frame (NULL means the default) | |
CUI_Frame * | m_parent |
this frame's parent | |
std::list< CUI_Frame * > | m_frames |
list of children. | |
float | m_x |
minimum X for bounding box of this frame | |
float | m_y |
minimum Y for bounding box of this frame | |
float | m_x2 |
maximum X for bounding box of this frame | |
float | m_y2 |
maximum Y for bounding box of this frame | |
unsigned int | m_flags |
generic flags | |
char * | m_toolTipText |
Text to display as a tooltip. | |
CUI_Frame * | m_toolTipFrame |
Frame to display as a tooltip. | |
double | m_counter |
Animation counter (counts in ms). | |
bool | m_count |
Enable/disable animation counter. | |
animation_t | m_animation |
what kind of animation should it be doing? | |
float | m_oldFade |
previous fade value | |
bool | m_ownedByUI |
True if created by the UI - used for memory management. |
Frames are always rectangles, they can not have a complex border.
Frames by themselves can be used as containers for other elements, or as a way to display an image or icon.
Recognized flags:
UI_DISABLED
UI_INACTIVE
|
add a child to this frame
Reimplemented in CUI_ScrollableFrame. |
|
Do any necessary animation before rendering. Can be overloaded in a new class for fancier animation. |
|
Wrapper to m_callbackFunc to check for NULL and present a simple interface.
Reimplemented in CUI_ComboBox, CUI_Console, CUI_ListBox, CUI_Menu, CUI_MessageBox, CUI_RadioGroup, CUI_ScrollableFrame, CUI_ScrollableTextBox, and CUI_TextField. |
|
Call this function when clicked on. Default, doesn't care Reimplemented in CUI_Button, CUI_DraggableFrame, CUI_DraggableViewFrame, CUI_EditableTextBox, CUI_MultipleStateButton, and CUI_SliderBar. |
|
convert a coordinate into this coordinate system
|
|
convert a coordinate from global to local coordinates
|
|
delete a child from this frame
Reimplemented in CUI_Control. |
|
Delete a parameter allocated by this frame. All frames that can return parameters MUST implement this function Reimplemented in CUI_Button, CUI_DraggableFrame, CUI_DraggableViewFrame, CUI_EditableTextBox, CUI_MultipleStateButton, and CUI_SliderBar. |
|
Update the cursor's position as this is being dragged (in global space). Default, doesn't care Reimplemented in CUI_DraggableFrame, CUI_DraggableViewFrame, CUI_EditableTextBox, CUI_ResizeButton, and CUI_SliderBar. |
|
get the current position and size
|
|
Get a pointer to the frame to use as a tooltip. Either comes from this frame's pointer, or this frame inserts its tooltip text into the ui's global tooltip frame. |
|
is this frame a control?
This is necessary for a few things: Reimplemented in CUI_Control. |
|
Move the frame, but don't resize it.
|
|
set the position and size of this frame (in its parent's coordinate system)
|
|
Process an incoming key.
Reimplemented in CUI_ComboBox, CUI_Console, CUI_DraggableViewFrame, CUI_EditableTextBox, CUI_ListBox, CUI_Menu, CUI_MessageBox, CUI_RadioGroup, CUI_ScrollableFrame, CUI_ScrollableTextBox, CUI_SliderBar, and CUI_TextField. |
|
Reset the animation counter.
|
|
set callback function This is the callback function for this particular frame. Depending on what the function returns, the global callback will or will not be called. |
|
Set this frame as owned by the UI. No code outside of the library should call this function. Doing so will definitely cause a crash when the registry is flushed. |
|
set the parent for this frame
|
|
set view area if coordinate system requires it Will tell the renderer to restrict rendering to that area |
|
test if the given point is within this frame
Reimplemented in CUI_Widget. |
|
callback function Designed primarily for internal UI usage. So Controls can handle more functionality without requiring a lot of extra code from the application. |
|
this frame's ID - the app should define this! If this is not set (value is zero), it is assumed that this is a static control and that the app does not care about getting callbacks from it. Therefore, the app should not use 0 as a valid frame ID. |