class csComponent : public csBase Graphics system component: a menu, window etc
You should not call any methods or use any variables after this! When this function returns, the object is already destroyed
Graphics system component: a menu, window etc.This is an abstract base class: all windowing system classes should be subclassed from csComponent. Each component can have a number of child components. Child components are chained together in a ring list; the only case when a NULL can be encountered in this list is when component has no children. When a component has at least one child and you traverse the child list you should take care to avoid looping forever through them.
A csComponent object is a rectangle area of screen which can contain absolutely any content. The object is responsible for filling all pixels within that rectangle, i.e. underlying windows will never touch other window's area (and partially transparent windows like in X Windows are impossible).
Each component has its own logical palette. A logical palette component
is a index into a global table which resides in csApp object. The table
in csApp maps a color (such as cs_Color_White) to a real index into
the physical palette.
It is highly desirable for components to contain in their 1st element
their background color. This is sometimes used (for example by
irregularily-shaped buttons).
You should not call any methods or use any variables after this!
When this function returns, the object is already destroyed
csRect dirty
csRect clip
int* palette
bool originalpalette
int DragStyle
static int dragX
static csRect dragBound
csComponent* clipparent
char* text
int Font
bool Maximized
csRect OrgBound
csComponent* focused
csComponent* top
csComponent* next
csComponent* parent
csVector clipchildren
csApp* app
unsigned int id
csRect bound
csComponent(csComponent *iParent)
virtual ~csComponent()
virtual void Insert(csComponent *comp)
virtual void Delete(csComponent *comp)
void DeleteAll()
void InsertClipChild(csComponent *clipchild)
void DeleteClipChild(csComponent *clipchild)
csComponent* GetClipParent()
bool SetFocused(csComponent *comp)
csComponent* GetFocused()
bool Select()
virtual csComponent* NextChild(csComponent *start = NULL, bool disabled = false)
virtual csComponent* PrevChild(csComponent *start = NULL, bool disabled = false)
virtual csComponent* NextControl(csComponent *start = NULL)
virtual csComponent* PrevControl(csComponent *start = NULL)
virtual csComponent* NextGroup(csComponent *start = NULL)
virtual csComponent* PrevGroup(csComponent *start = NULL)
bool SetZorder(csComponent *comp, csComponent *below)
csComponent* GetTop()
void SetPalette(int *iPalette, int iPaletteSize)
void SetPalette(int iPaletteID)
void SetColor(int Index, int Color)
int GetColor(int Index)
virtual void SetText(char *iText)
virtual void GetText(char *oText, int iTextSize)
virtual char* GetText()
csComponent* ForEach(bool (*func) (csComponent *child, void *param), void *param = NULL, bool Zorder = false)
csComponent* GetChild(int find_id)
void SetApp(csApp *newapp)
virtual bool HandleEvent(csEvent &Event)
virtual bool PreHandleEvent(csEvent &Event)
virtual bool PostHandleEvent(csEvent &Event)
void* SendCommand(int CommandCode, void *Info = NULL)
csComponent* GetDefault()
void Redraw()
virtual void Draw()
virtual void Show(bool focused = false)
virtual void Hide()
virtual bool SetRect(int xmin, int ymin, int xmax, int ymax)
bool SetRect(csRect &rect)
bool SetDragRect(int xmin, int ymin, int xmax, int ymax)
void SetPos(int x, int y)
void SetSize(int w, int h)
void Center(bool iHoriz = true, bool iVert = true)
virtual bool Maximize()
virtual bool Restore()
void Invalidate(csRect &area, bool IncludeChildren = false)
void Invalidate(int xmin, int ymin, int xmax, int ymax, bool IncludeChildren = false)
void Invalidate(bool IncludeChildren = false)
virtual void SetState(int mask, bool enable)
int GetState(int mask)
void SetDragStyle(int iDragStyle)
int GetDragStyle()
void LocalToGlobal(int &x, int &y)
void GlobalToLocal(int &x, int &y)
void Drag(int x, int y, int DragMode)
void SetMouse(csMouseCursorID Cursor)
virtual void Close()
void SetSizingCursor(int dragtype)
bool HandleDragEvent(csEvent &Event, int BorderW, int BorderH)
switch (Event.Type)
{
case csevMouseDown:
case csevMouseMove:
if (HandleDragEvent (Event, BorderWidth, BorderHeight))
return true;
return csComponent::HandleEvent (Event);
...
}
virtual void FixPosition(int &newX, int &newY)
virtual void FixSize(int &newW, int &newH)
virtual void SuggestSize(int &w, int &h)