DrawCaml
Public Member Functions | Public Attributes | List of all members
SContainer Class Reference

#include <container.h>

Inheritance diagram for SContainer:
Inheritance graph
[legend]
Collaboration diagram for SContainer:
Collaboration graph
[legend]

Public Member Functions

 SContainer (SLayout lay, int width=1, int height=1)
 
void updateWin (SWindow *win)
 
virtual void draw (SWindow *win, int drawX, int drawY)
 
virtual void setSize (int sizeX, int sizeY)
 
void removeElem (SElement *elt)
 
void addElem (SElement *elt, int posX=-1, int posY=-1)
 
void setBgColor (string bgColor)
 

Public Attributes

SLayout mLayout
 
vector< SElement * > mElements
 
string mBgColorStr = "white"
 
XColor mBgColor
 
- Public Attributes inherited from SElement
int mPosX
 
int mPosY
 
int mSizeX = 0
 
int mSizeY = 0
 
SWindowmWin
 

Detailed Description

Class used to manage other elements. Code for Drawcaml.dcontainer

Member Function Documentation

◆ addElem()

void SContainer::addElem ( SElement elt,
int  posX = -1,
int  posY = -1 
)

Add an element from the container. (Be careful to call draw after to see the changes)

◆ draw()

void SContainer::draw ( SWindow win,
int  drawX,
int  drawY 
)
virtual

Draw recursively the elements of the container, by calling the draw method of any SElement in mElements.

Reimplemented from SElement.

◆ removeElem()

void SContainer::removeElem ( SElement elt)

Remove an element from the container. (Be careful to call draw after to see the changes)

◆ setBgColor()

void SContainer::setBgColor ( string  bgColor)

Set the background color of the container.

◆ setSize()

void SContainer::setSize ( int  sizeX,
int  sizeY 
)
virtual

Set the size of the container

Reimplemented from SElement.

◆ updateWin()

void SContainer::updateWin ( SWindow win)

Re-generate the color according to the GC of the window.

Member Data Documentation

◆ mElements

vector<SElement*> SContainer::mElements

Elements managed by the container

◆ mLayout

SLayout SContainer::mLayout

Layout of the container


The documentation for this class was generated from the following files: