Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

CSBar Class Reference

#include <CSBar.h>

Inheritance diagram for CSBar:

CSGrafikElement CSMessageDispatchable CSMessageListener CSMenuBar

Public Member Functions

virtual std::string getType ()
 CSBar (int type)
virtual ~CSBar ()
void initBar ()
void addElementAt (CSGrafikElement *element, int place)
virtual void layoutSetup ()
int getPosition ()

Static Public Attributes

const char * CLASS = "CSBar"
 static element, name of this class (introsepection)


Protected Member Functions

void layoutSetupBar ()

Constructor & Destructor Documentation

CSBar::CSBar int  type  ) 
 

Create a new CSBar. CSBar are not viewported!
If autoPlacing is enabled the to be added elements are positioned automatically. If bar is of type TYPE_HORIZONTAL, they are added from left to right (centered vertically). If bar is of type TYPE_VERTICAL, they are added from upper to lower (centered horizontally.

Parameters:
type either TYPE_HORIZONTAL or TYPE_VERTICAL
autoPlacing true if components are to be placed automatically (by CSBAR)

Definition at line 19 of file CSBar.cpp.

References initBar(), LOG_ENTER, and LOG_EXIT.

00019                      : CSGrafikElement(0, 0)
00020 {
00021     static char *functionName="CSBar";
00022     LOG_ENTER 
00023     mAutoPlacingType = type;
00024     initBar();
00025     LOG_EXIT
00026 }

Here is the call graph for this function:

CSBar::~CSBar  )  [virtual]
 

Definition at line 28 of file CSBar.cpp.

00029 {
00030     static char *functionName="~CSBar";
00031 }


Member Function Documentation

void CSBar::layoutSetupBar  )  [protected]
 

Definition at line 114 of file CSBar.cpp.

References LOG_ENTER, and LOG_EXIT.

Referenced by layoutSetup(), and CSMenuBar::layoutSetupMenuBar().

00115 {
00116     static char *functionName="layoutSetupBar";
00117     LOG_ENTER 
00118     LOG_EXIT
00119 }

virtual std::string CSBar::getType  )  [inline, virtual]
 

Reimplemented from CSGrafikElement.

Reimplemented in CSMenuBar.

Definition at line 30 of file CSBar.h.

References CLASS.

00030 {return (std::string) CLASS;}

void CSBar::initBar  ) 
 

Definition at line 33 of file CSBar.cpp.

References LOG_ENTER, LOG_EXIT, POSITION_ORDER_LEFT, POSITION_ORDER_TOP, CSGrafikElement::setInset(), CSGrafikElement::setLayoutData(), CSGrafikElement::setLayoutManager(), CSLayoutData::setPackedHorizontal(), CSLayoutData::setPackedVertical(), CSLayoutData::setPosition(), CSLayoutData::setSpacing(), CSLayoutData::setStretchedHorizontal(), CSLayoutData::setStretchedVertical(), and TYPE_HORIZONTAL.

Referenced by CSBar().

00034 {
00035     static char *functionName="initBar";
00036     LOG_ENTER 
00037     if (mAutoPlacingType == TYPE_HORIZONTAL)
00038     {
00039         CSLayoutData layout;
00040         setLayoutManager(new CSLayoutManagerStackHorizontal());
00041         layout.setPosition(POSITION_ORDER_TOP);
00042         layout.setPackedVertical(true);
00043         layout.setStretchedHorizontal(true);
00044         layout.setSpacing(0,2);
00045         setLayoutData(layout);
00046         setInset(CSInset(0,0,1,1));
00047     }
00048     else
00049     {
00050         CSLayoutData layout;
00051         setLayoutManager(new CSLayoutManagerStackVertical());
00052         layout.setPosition(POSITION_ORDER_LEFT);
00053         layout.setPackedHorizontal(true);
00054         layout.setStretchedVertical(true);
00055         layout.setSpacing(2,0);
00056         setLayoutData(layout);
00057         setInset(CSInset(1));
00058     }
00059     LOG_EXIT
00060 }

Here is the call graph for this function:

void CSBar::addElementAt CSGrafikElement element,
int  place
 

the added element will be freed by this instance of Bar first pos is 0

Definition at line 64 of file CSBar.cpp.

References CSGrafikElement::addElement(), CSGrafikElements, CSGrafikElement::getHorizontalElementSpacing(), CSGrafikElement::getVerticalElementSpacing(), LOG_ENTER, LOG_EXIT, POSITION_NORTH, POSITION_WEST, CSGrafikElement::removeElement(), CSGrafikElement::setLayoutData(), CSLayoutData::setSpacing(), and TYPE_HORIZONTAL.

00065 {
00066     static char *functionName="addElementAt";
00067     LOG_ENTER 
00068         
00069     CSGrafikElements elements;
00070 
00071     CSGrafikElements::iterator iter = mElements.begin();
00072     while (iter != mElements.end())
00073     {
00074         CSGrafikElement *element = *iter;
00075         elements.push_back(element);
00076         removeElement(element);
00077         iter = mElements.begin();
00078     }
00079 
00080     iter = elements.begin();
00081     int count=0;
00082     CSLayoutData layoutData;
00083     if (mAutoPlacingType == TYPE_HORIZONTAL)
00084     {
00085         layoutData = CSLayoutData(POSITION_WEST);
00086     }
00087     else
00088     {
00089         layoutData = CSLayoutData(POSITION_NORTH);
00090     }
00091     layoutData.setSpacing(getVerticalElementSpacing(), getHorizontalElementSpacing());
00092 
00093     while (iter != elements.end())
00094     {
00095         CSGrafikElement *oldElement = *iter;
00096         if (count == place)
00097         {
00098             element->setLayoutData(layoutData);
00099             addElement(element);
00100         }
00101         oldElement->setLayoutData(layoutData);
00102         addElement(oldElement); 
00103         count++;
00104         iter++;
00105     }
00106     if (count <= place)
00107     {
00108         element->setLayoutData(layoutData);
00109         addElement(element);
00110     }
00111     LOG_EXIT
00112 }

Here is the call graph for this function:

virtual void CSBar::layoutSetup  )  [inline, virtual]
 

Reimplemented from CSGrafikElement.

Reimplemented in CSMenuBar.

Definition at line 37 of file CSBar.h.

References layoutSetupBar().

00037 {layoutSetupBar();}

Here is the call graph for this function:

int CSBar::getPosition  )  [inline]
 

Definition at line 38 of file CSBar.h.

References CSGrafikElement::getLayoutData(), and CSLayoutData::getPosition().

Referenced by CSMenu::openMenu().

00039         {
00040             return getLayoutData().getPosition();
00041         }

Here is the call graph for this function:


Field Documentation

const char * CSBar::CLASS = "CSBar" [static]
 

static element, name of this class (introsepection)

Reimplemented from CSGrafikElement.

Reimplemented in CSMenuBar.

Definition at line 9 of file CSBar.cpp.

Referenced by CSLAF::getAreaInternal(), CSLAF::getBorderInternal(), and getType().


Generated on Wed Jul 14 00:43:48 2004 for CSLib by doxygen 1.3.6