#include <CSGrafikElement.h>
Inheritance diagram for CSGrafikElement:
The GUI elements are event driven (as almost all GUI's are). The events are dispatched from the desktop. The desktop itself gets "hardware" events (in this case SDL events) from outside (simple method calls).
Within this set of classes the events are generated at runtime from the CSGame class, which "polls" SDL every "game round".
Events are send to listeners. One can simply add a listener with the "addlistener" method.
C++ does not per default have (java has that!) the ability to call a super() method. (a method that is overloaded by a child method)
With event passing and wanting a default behaviour for all classes, a strategy (convention) was used within the gui classes, that allows us to call the parents overloaded methods from the child.
The default method to wait for events is:
reactOnMessage(...)That method is virtual and therefor overloadable. Each Gui-element overloads this method.
BUT:
Each element also implements a method (non virtual, protected or public)
reactOnMessage"ElementName"(...)The "reactOnMessage()" allway! only calls the element based method. Therefor each child can also call (all) the parent methods!
e.g. CSButton implements following methods:
void reactOnMessageDragButton(CSMessage *message); virtual void reactOnMessage(CSMessage *message);the bodies might look like:
void CSButton::reactOnMessage(CSMessage *message) { reactOnMessageButton(message); }
void CSButton::reactOnMessageButton(CSMessage *message) { static char *functionName="reactOnMessage"; if (message->mIsHandled) { reactOnMessageGrafikElement(message); return; } ... handle events reactOnMessageGrafikElement(message); }Thus the parent methods are allways called, and can still handle events not handled by the subclass. (This can even be used further - see e.g. MenuItems...)
This class implements the basic methods all gui classes need. Child classes must overload the paint(destination) method to display themselves.
All GrafikElements can be added to another GrafikElement. (But not everything makes sense - like adding a desktop to a window...) The strukture should be like:
Screen-> Desktop->Window->Elements (like Label, Button, Textfiled)
Definition at line 167 of file CSGrafikElement.h.
Public Member Functions | |
virtual std::string | getType () |
CSGrafikElement (int height, int width) | |
~CSGrafikElement (void) | |
CSGrafikElement * | getUppermostAncestor () |
CSWindow * | getParentWindow () |
CSDesktop * | getDesktop (void) |
get the next parent, that is a CSDesktop (or null) | |
CSGrafikElement * | getParent (void) |
virtual void | paint (SDL_Surface *destination, SDL_Rect *parentViewport) |
void | setPosition (int x, int y) |
set X, Y coordinates in relation to parent (useaable Area) | |
bool | isFrontElement () |
void | toFront (CSGrafikElement *element) |
void | setGUIType (std::string type) |
std::string | getGUIType () |
int | getX () |
X coordinates in relation to parent. | |
int | getY () |
Y coordinates in relation to parent. | |
bool | isIn (int x, int y, SDL_Rect *parentViewport) |
coordinates of screen | |
void | reactOnMessageGrafikElement (CSMessage *message) |
virtual void | reactOnMessage (CSMessage *message) |
to be overloaded | |
virtual bool | isTransparent (int x, int y, SDL_Rect *parentViewport) |
to be overloaded (default false) | |
virtual void | putString (SDL_Surface *destination, SDL_Rect *parentViewport, int x1, int y1, const std::string &string) |
coordinates relativ to this element | |
virtual void | putString (SDL_Surface *destination, SDL_Rect *parentViewport, int x1, int y1, int color, const std::string &string) |
coordinates relativ to this element | |
void | line (SDL_Surface *destination, SDL_Rect *parentViewport, int x1, int y1, int x2, int y2, Uint32 color) |
coordinates relativ to this element | |
void | setActionId (int id) |
virtual void | lafChanged (int id) |
each element is registered to CSLAF, if LAF changes, this method is called (default does nothing!) | |
bool | isChild (CSGrafikElement *element) |
is element a child of myself? | |
virtual void | cursorDefault () |
virtual void | cursorSizing () |
virtual CSMouseCursor * | getCursor () |
void | setCurrentLAFId (int id) |
int | getCurrentLAFId (void) |
virtual void | setTooltipText (const std::string &s) |
virtual std::string | getTooltipText () |
virtual void | layoutSetup () |
virtual bool | getActive () |
virtual void | setActive (bool b) |
virtual void | setEnabled (bool b) |
virtual bool | getEnabled () |
virtual void | setActivated (bool b) |
virtual bool | getActivated () |
virtual bool | getModal () |
virtual void | setModal (bool m) |
virtual bool | getVisible () |
virtual void | setVisible (bool v) |
virtual void | setFocusable (bool b) |
virtual bool | getFocusable () |
bool | getFocused () |
void | setFocused (bool b) |
only to be used from CSDesktop! | |
virtual SDL_Rect | getViewportArea () |
int | getHeight () |
height of component | |
int | getWidth () |
width of component | |
void | setHeight (int h) |
set height of component | |
void | setWidth (int w) |
set width of component | |
virtual CSFont * | getFont () |
returns the given gui font (see CSLAF) | |
virtual void | setFont (CSFont *font) |
virtual void | setInset (const CSInset &inset) |
virtual CSInset | getInset () |
virtual void | setBorder (CSBorder *border, bool deleteOldBorder=false) |
virtual CSBorder * | getBorder () |
virtual void | setArea (CSArea *area, bool deleteOldArea=false) |
virtual CSArea * | getArea () |
int | getBackgroundColor () |
void | setBackgroundColor (int backgroundColor) |
int | getTextColor () |
void | setTextColor (int textColor) |
void | setStyle (int style) |
int | getHorizontalElementSpacing () |
void | setHorizontalElementSpacing (int horizontalElementSpacing) |
int | getVerticalElementSpacing () |
void | setVerticalElementSpacing (int verticalElementSpacing) |
void | setBorderState (int state) |
CSLayoutManager * | getLayoutManager () |
void | setLayoutManager (CSLayoutManager *manager) |
CSLayoutData | getLayoutData () |
pointer is faster, but more dangerous | |
void | setLayoutData (const CSLayoutData &layoutData) |
void | addMainElement (CSGrafikElement *element, int position) |
void | addMainElement (CSGrafikElement *element, int x, int y) |
void | addMainElement (CSGrafikElement *element) |
void | addElement (CSGrafikElement *element, int position) |
void | addElement (CSGrafikElement *element, int x, int y) |
void | addFrontElement (CSGrafikElement *element, int x, int y) |
void | addFrontElementCenter (CSGrafikElement *element) |
void | addElement (CSGrafikElement *element) |
int | getMinWidth () |
if not set defaults to 5 pixel | |
void | setMinWidth (int w) |
int | getMinHeight () |
if not set defaults to 5 pixel | |
void | setMinHeight (int h) |
void | removeFrontElement (CSGrafikElement *element) |
CSGrafikElement * | removeElement (CSGrafikElement *element) |
removed element is NOT freed! | |
void | setViewportOffset (int x, int y) |
void | getViewportOffset (int &x, int &y) |
void | getViewportOffsetParent (int &x, int &y) |
void | removeAllElements () |
void | layoutChanged (bool sizing=false) |
Static Public Attributes | |
const char * | CLASS = "CSGrafikElement" |
static element, name of this class (introsepection) | |
Protected Member Functions | |
CSInset * | getInsetInternal () |
CSLayoutData * | getLayoutDataInternal () |
pointer is faster, but more dangerous | |
void | deleteElements () |
virtual int | getViewportWidth () |
Width that elements, that are added to this component can use. | |
virtual int | getViewportHeight () |
Height that elements, that are added to this component can use. | |
virtual int | getViewportX () |
Coordinates in relation to this element, 0,0 is left upper corner. | |
virtual int | getViewportY () |
SDL_Rect | getElementArea () |
virtual void | setParent (CSGrafikElement *parent) |
Set the parent element of this. | |
void | init (int height, int width) |
void | translateToDesktop (int &x, int &y) |
Translates the given element coordinates to Desktop coordinates. | |
virtual void | paintArea (SDL_Surface *destination, SDL_Rect *parentArea) |
Builds the viewport sizes from mHeight and mWidth (and sets the rectangles). | |
void | paintBorder (SDL_Surface *destination, SDL_Rect *parentArea) |
void | paintAreaStandard (SDL_Surface *destination, SDL_Rect *parentArea) |
void | paintChildren (SDL_Surface *destination, SDL_Rect *parentViewport) |
CSGrafikElement * | removeMainElement (CSGrafikElement *element) |
removed element is NOT freed! | |
CSLayoutManager * | getMainLayoutManager () |
void | setMainLayoutManager (CSLayoutManager *manager) |
virtual void | rebuildElement () |
void | doLayout () |
void | setMainElement (CSGrafikElement *element) |
Protected Attributes | |
bool | mVisible |
is this element visible? | |
CSInset | mInset |
the currently set CSInset | |
int | mBorderState |
bool | mHeightSet |
was height of component set from outside | |
bool | mWidthSet |
was width of component set from outside | |
int | mHeight |
"physical" Dimension of component (as is seen by parent) | |
int | mWidth |
"physical" Dimension of component (as is seen by parent) | |
int | mMinWidth |
without border, without spacing | |
int | mMinHeight |
without border, without spacing | |
int | mActionId |
the action id (if there is one) of an element (e.g Button) | |
CSGrafikElements | mElements |
all child elements are stored here | |
CSGrafikElement * | mParent |
the direct parent (if any) is stored here | |
std::string | mTooltipText |
GuiMessage | MESSAGE_FOCUS_GAINED |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_FOCUS_LOST |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_KEY_PRESSED |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_KEY_RELEASED |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_MOUSE_PRESSED |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_MOUSE_RELEASED |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_MOUSE_MOTION |
Message that can be sent from CS Graphic element (CSDesktop). | |
GuiMessage | MESSAGE_MOUSE_MOTION_LOST |
Message that can be sent from CS Graphic element (CSDesktop). |
|
Definition at line 15 of file CSGrafikElement.cpp. References CSLAF::addElement(), CSMessageDispatchable::addMessageListener(), CSLAF::getCurrentLAF(), GUI_MESSAGE, init(), LOG_ENTER, LOG_EXIT, and mTooltipText.
00016 { 00017 static char *functionName="CSGrafikElement"; 00018 LOG_ENTER 00019 CSLAF *laf = CSLAF::getCurrentLAF(); // make sure laf is loaded/initialized at least once 00020 CSLAF::addElement(this); 00021 init(height, width); 00022 addMessageListener(this, GUI_MESSAGE); 00023 mTooltipText = ""; 00024 LOG_EXIT 00025 } |
Here is the call graph for this function:
|
Destructor, destroys also all child elements (recursivly) and layoutmanager Definition at line 30 of file CSGrafikElement.cpp. References getParent(), LOG_ENTER, LOG_EXIT, mElements, CSLAF::removeElement(), removeMainElement(), and CSMessageDispatchable::removeMessageListener().
00031 { 00032 static char *functionName="~CSGrafikElement"; 00033 LOG_ENTER 00034 removeMessageListener(this); 00035 CSGrafikElement *parent = getParent(); 00036 if (parent) 00037 { 00038 parent->removeMainElement(this); 00039 } 00040 00041 // Main element must be reomved first, since the "normal" remove element 00042 // is mapped to the mainElement (if available) 00043 // a "normal" delete removes itself from the parent 00044 // if that remove is done on a parent with a mainElement, the element tries 00045 // to remove itself from the mainElement instead of the parent... 00046 if (mMainElement != this) 00047 { 00048 CSGrafikElements::iterator iter = mElements.begin(); 00049 while (iter != mElements.end()) 00050 { 00051 CSGrafikElement *element = *iter; 00052 if (element == mMainElement) 00053 { 00054 mElements.erase(iter); 00055 delete (element); 00056 break; 00057 } 00058 iter++; 00059 } 00060 mMainElement = this; 00061 } 00062 00063 CSGrafikElements::iterator iter = mElements.begin(); 00064 while (iter != mElements.end()) 00065 { 00066 CSGrafikElement *element = *iter; 00067 mElements.erase(iter); 00068 delete (element); 00069 iter = mElements.begin(); 00070 } 00071 if (mBorder) 00072 { 00073 delete mBorder; 00074 mBorder = 0; 00075 } 00076 if (mArea) 00077 { 00078 delete mArea; 00079 mArea = 0; 00080 } 00081 if (mLayoutManager != 0) 00082 { 00083 delete mLayoutManager; 00084 mLayoutManager = 0; 00085 } 00086 CSLAF::removeElement(this); 00087 00088 LOG_EXIT 00089 } |
Here is the call graph for this function:
|
Definition at line 225 of file CSGrafikElement.h. References mInset. Referenced by CSLayoutManager::buildArea(), CSLayoutManager::getInsetHeight(), and CSLayoutManager::getInsetWidth().
00225 {return &mInset;} |
|
pointer is faster, but more dangerous
Definition at line 226 of file CSGrafikElement.h. Referenced by addFrontElement(), addFrontElementCenter(), addMainElement(), CSLayoutManager::buildArea(), CSDragButton::CSDragButton(), CSMenu::CSMenu(), CSLayoutManager::getLayoutData(), and setPosition(). |
|
Definition at line 1115 of file CSGrafikElement.cpp. References mElements.
01116 { 01117 if (mMainElement != this) 01118 { 01119 CSGrafikElements::iterator iter = mElements.begin(); 01120 while (iter != mElements.end()) 01121 { 01122 CSGrafikElement *element = *iter; 01123 if (element == mMainElement) 01124 { 01125 mElements.erase(iter); 01126 delete (element); 01127 break; 01128 } 01129 iter++; 01130 } 01131 mMainElement = this; 01132 } 01133 01134 CSGrafikElements::iterator iter = mElements.begin(); 01135 while (iter != mElements.end()) 01136 { 01137 CSGrafikElement *element = *iter; 01138 mElements.erase(iter); 01139 delete (element); 01140 iter = mElements.begin(); 01141 } 01142 01143 } |
|
Width that elements, that are added to this component can use.
Definition at line 229 of file CSGrafikElement.h. Referenced by CSLayoutManager::getParentWidth(), CSLayoutManager::getViewportWidth(), CSHTMLPanel::layoutSetupHTMLPanel(), and CSTextarea::paint(). |
|
Height that elements, that are added to this component can use.
Definition at line 230 of file CSGrafikElement.h. Referenced by CSLayoutManager::getParentHeight(), CSLayoutManager::getViewportHeight(), and CSTextarea::paint(). |
|
Coordinates in relation to this element, 0,0 is left upper corner.
Definition at line 231 of file CSGrafikElement.h. Referenced by CSTextarea::paint(), CSHTMLPanel::reactOnMessageHTMLPanel(), and translateToDesktop(). |
|
Definition at line 232 of file CSGrafikElement.h. Referenced by CSTextarea::paint(), CSHTMLPanel::reactOnMessageHTMLPanel(), and translateToDesktop(). |
|
Definition at line 260 of file CSGrafikElement.h. Referenced by CSListbox::paint(), CSLabel::paint(), CSPictureIcon::paint(), CSCheckBox::paint(), paintAreaStandard(), and paintBorder().
00260 {return mElementArea;}
|
|
Set the parent element of this.
Definition at line 341 of file CSGrafikElement.cpp. References LOG_ENTER, LOG_EXIT, and mParent. Referenced by addMainElement().
|
|
Here is the call graph for this function:
|
Translates the given element coordinates to Desktop coordinates.
Definition at line 572 of file CSGrafikElement.cpp. References getParent(), getType(), getViewportOffset(), getViewportX(), getViewportY(), getX(), and getY(). Referenced by CSMenu::openMenu().
00573 { 00574 static char *functionName="translateToDesktop"; 00575 CSGrafikElement *parent = this; 00576 int offsetX = 0; 00577 int offsetY = 0; 00578 getViewportOffset(offsetX, offsetY); 00579 x = x - offsetX; 00580 y = y - offsetY; 00581 while (parent != 0) 00582 { 00583 std::string type = parent->getType(); 00584 if (type.compare(CSDesktop::CLASS) == 0) 00585 { 00586 break; 00587 } 00588 x = x + parent->getX(); 00589 y = y + parent->getY(); 00590 x = x + parent->getParent()->getViewportX(); 00591 y = y + parent->getParent()->getViewportY(); 00592 00593 parent->getViewportOffset(offsetX, offsetY); 00594 x = x - offsetX; 00595 y = y - offsetY; 00596 00597 parent = parent->getParent(); 00598 } 00599 } |
Here is the call graph for this function:
|
Builds the viewport sizes from mHeight and mWidth (and sets the rectangles).
Definition at line 270 of file CSGrafikElement.h. References paintAreaStandard(). Referenced by paintChildren().
00271 { 00272 paintAreaStandard(destination, parentArea); 00273 } |
Here is the call graph for this function:
|
Definition at line 235 of file CSGrafikElement.cpp. References getBorder(), getElementArea(), and CSBorder::paint(). Referenced by paintChildren().
00236 { 00237 SDL_Rect area = getElementArea(); 00238 area.x += parentArea->x; 00239 area.y += parentArea->y; 00240 CSBorder *border = getBorder(); 00241 if (border) 00242 { 00243 border->paint(destination, &area); 00244 } 00245 } |
Here is the call graph for this function:
|
Definition at line 247 of file CSGrafikElement.cpp. References COLOR, getArea(), getBackgroundColor(), getElementArea(), CSArea::paint(), and CSArea::setColor(). Referenced by paintArea().
00248 { 00249 SDL_Rect elementArea = getElementArea(); 00250 elementArea.x += parentArea->x; 00251 elementArea.y += parentArea->y; 00252 CSArea *area = getArea(); 00253 if (area) 00254 { 00255 area->setColor(COLOR(destination, getBackgroundColor())); 00256 area->paint(destination, &elementArea); 00257 } 00258 } |
Here is the call graph for this function:
|
Definition at line 262 of file CSGrafikElement.cpp. References SDLMain::adjustClipping(), getDesktop(), getModal(), getViewportOffset(), getVisible(), mElements, paint(), paintArea(), paintBorder(), and CSDesktop::runModalDesktop(). Referenced by CSWindow::paint(), CSScrollbar::paint(), CSListbox::paint(), CSHTMLPanel::paint(), CSDesktop::paint(), and CSCombobox::paint().
00263 { 00264 static char *functionName="paintChildren"; 00265 CSGrafikElement *modalDetected = 0; 00266 SDL_Rect saveRect; 00267 00268 SDL_GetClipRect(destination, &saveRect); 00269 SDL_Rect thisViewportArea; 00270 SDL_Rect thisViewportAreaCopy; 00271 00272 thisViewportArea.x = parentViewport->x + mViewportX + mX; 00273 thisViewportArea.y = parentViewport->y + mViewportY + mY; 00274 thisViewportArea.h = mViewportHeight; 00275 thisViewportArea.w = mViewportWidth; 00276 thisViewportAreaCopy = thisViewportArea; 00277 00278 int offsetX = 0; 00279 int offsetY = 0; 00280 getViewportOffset(offsetX, offsetY); 00281 00282 thisViewportArea.x -= offsetX; 00283 thisViewportArea.y -= offsetY; 00284 00285 00286 SDLMain::adjustClipping(thisViewportAreaCopy, saveRect); 00287 SDL_SetClipRect(destination, &thisViewportAreaCopy); 00288 00289 CSGrafikElements::iterator iter = mElements.begin(); 00290 while (iter != mElements.end()) 00291 { 00292 CSGrafikElement *element = (*iter); 00293 if (element->getVisible()) 00294 { 00295 if (!element->getModal()) 00296 { 00297 element->paintArea(destination, &thisViewportArea); 00298 element->paint(destination, &thisViewportArea); 00299 element->paintBorder(destination, &thisViewportArea); 00300 } 00301 else 00302 { 00303 modalDetected = *iter; 00304 } 00305 } 00306 iter++; 00307 } 00308 00309 SDL_SetClipRect(destination, &saveRect); 00310 00311 if (modalDetected) 00312 { 00313 if (getDesktop()) 00314 { 00315 getDesktop()->runModalDesktop(modalDetected, destination); 00316 } 00317 } 00318 00319 } |
Here is the call graph for this function:
|
removed element is NOT freed!
Definition at line 830 of file CSGrafikElement.cpp. References CSDesktop::correctElementHandling(), getDesktop(), GUI_MESSAGE, layoutChanged(), LOG_ENTER, LOG_EXIT, mElements, and CSMessageDispatchable::removeMessageListener(). Referenced by addMainElement(), removeElement(), removeFrontElement(), and ~CSGrafikElement().
00831 { 00832 static char *functionName="removeMainElement"; 00833 LOG_ENTER 00834 CSGrafikElement *removedElement = 0; 00835 CSGrafikElements::iterator iter = mElements.begin(); 00836 while (iter != mElements.end()) 00837 { 00838 CSGrafikElement *test = *iter; 00839 if (test == element) 00840 { 00841 removedElement = test; 00842 mElements.erase(iter); 00843 removeMessageListener(test, GUI_MESSAGE); 00844 00845 if (getDesktop()) 00846 { 00847 getDesktop()->correctElementHandling(test); 00848 } 00849 00850 test->setParent(0); 00851 test->mFrontElement = false; 00852 break; 00853 } 00854 iter++; 00855 } 00856 layoutChanged(); 00857 LOG_EXIT 00858 return removedElement; 00859 } |
Here is the call graph for this function:
|
Definition at line 278 of file CSGrafikElement.h.
00279 {
00280 return mLayoutManager;
00281 }
|
|
Definition at line 283 of file CSGrafikElement.h. References CSLayoutManager::setHostingElement(). Referenced by CSDesktop::CSDesktop(), and CSWindow::initWindow().
00284 { 00285 if (mLayoutManager != 0) 00286 { 00287 delete mLayoutManager; 00288 mLayoutManager = 0; 00289 } 00290 mLayoutManager = manager; 00291 if (mLayoutManager != 0) 00292 { 00293 mLayoutManager->setHostingElement(this); 00294 } 00295 } |
Here is the call graph for this function:
|
Reimplemented in CSCombobox, CSHTMLPanel, CSListbox, CSMessageBox, CSScrollbar, and CSWindow. Definition at line 297 of file CSGrafikElement.h. Referenced by lafChanged().
00297 {} // if a component is made up of elements dependend of LAF, than this method is called
|
|
Definition at line 1076 of file CSGrafikElement.cpp. References getVisible(), CSLayoutManager::layout(), layoutSetup(), and mElements. Referenced by CSDesktop::paint().
01077 { 01078 static int i = 0; 01079 do { 01080 CSGrafikElements::iterator iter = mElements.begin(); 01081 while (iter != mElements.end()) 01082 { 01083 CSGrafikElement *element = (*iter); 01084 if (element->getVisible()) 01085 { 01086 element->doLayout(); 01087 } 01088 iter++; 01089 } 01090 01091 if (mLayoutChanged) 01092 { 01093 mLayoutChanged = false; 01094 layoutSetup(); 01095 mLayoutManager->layout(); 01096 i++; 01097 } 01098 01099 } while (mLayoutChanged); 01100 } |
Here is the call graph for this function:
|
Definition at line 301 of file CSGrafikElement.h. Referenced by CSDesktop::CSDesktop(), and CSWindow::initWindow().
00301 {mMainElement = element;} |
|
Reimplemented from CSMessageDispatchable. Reimplemented in CSBar, CSButton, CSDragButton, CSCheckBox, CSCombobox, CSDesktop, CSHTMLPanel, CSIcon, CSPictureIcon, CSTextIcon, CSLabel, CSListbox, CSMenu, CSMenuBar, CSMenuItem, CSMessageBox, CSPanel, CSScrollbar, CSTextarea, CSTextfield, and CSWindow. Definition at line 305 of file CSGrafikElement.h. Referenced by getDesktop(), CSMenu::getMenuBar(), getParentWindow(), CSDesktop::paint(), and translateToDesktop().
00305 {return (std::string) CLASS;} |
|
Definition at line 988 of file CSGrafikElement.cpp. References getParent().
00989 { 00990 static char *functionName="getUppermostAncestor"; 00991 CSGrafikElement *parent = this; 00992 CSGrafikElement *lastParent = this; 00993 while (parent != 0) 00994 { 00995 lastParent = parent; 00996 parent = parent->getParent(); 00997 } 00998 return lastParent; 00999 } |
Here is the call graph for this function:
|
Definition at line 539 of file CSGrafikElement.cpp. References getParent(), and getType(). Referenced by CSHTMLPanel::layoutSetupHTMLPanel(), and CSHTMLPanel::setPage().
00540 { 00541 static char *functionName="getParentWindow"; 00542 CSGrafikElement *parent = this; 00543 while (parent != 0) 00544 { 00545 std::string type = parent->getType(); 00546 if (type.compare(CSWindow::CLASS) == 0) 00547 { 00548 return (CSWindow *) parent; 00549 } 00550 parent = parent->getParent(); 00551 } 00552 00553 return 0; 00554 } |
Here is the call graph for this function:
|
get the next parent, that is a CSDesktop (or null)
Definition at line 556 of file CSGrafikElement.cpp. References getParent(), and getType(). Referenced by addFrontElement(), addFrontElementCenter(), CSMenu::closeMenu(), CSMenu::openMenu(), paintChildren(), CSCombobox::reactOnMessageCombobox(), CSMenuItem::reactOnMessageMenuItem(), CSTextarea::reactOnMessageTextarea(), CSTextfield::reactOnMessageTextField(), removeFrontElement(), and removeMainElement().
00557 { 00558 static char *functionName="getDesktop"; 00559 CSGrafikElement *parent = this; 00560 while (parent != 0) 00561 { 00562 std::string type = parent->getType(); 00563 if (type.compare(CSDesktop::CLASS) == 0) 00564 { 00565 return (CSDesktop *) parent; 00566 } 00567 parent = parent->getParent(); 00568 } 00569 return 0; 00570 } |
Here is the call graph for this function:
|
Definition at line 312 of file CSGrafikElement.h. Referenced by addMainElement(), getBackgroundColor(), getDesktop(), CSMenu::getMenuBar(), CSLayoutManager::getParent(), CSLayoutManager::getParentHeight(), CSLayoutManager::getParentWidth(), getParentWindow(), getTextColor(), getUppermostAncestor(), isChild(), CSScrollbar::paint(), CSWindow::reactOnMessageWindow(), CSDesktop::setFocusedComponent(), translateToDesktop(), and ~CSGrafikElement().
00312 {return mParent;} |
|
Reimplemented in CSCheckBox, CSCombobox, CSDesktop, CSHTMLPanel, CSIcon, CSPictureIcon, CSTextIcon, CSLabel, CSListbox, CSScrollbar, CSTextarea, CSTextfield, and CSWindow. Definition at line 313 of file CSGrafikElement.h. Referenced by paintChildren().
00314 { 00315 paintChildren(destination, parentViewport); 00316 } |
|
set X, Y coordinates in relation to parent (useaable Area)
Definition at line 167 of file CSGrafikElement.cpp. References getLayoutDataInternal(), getLayoutManager(), CSLayoutManager::getType(), layoutChanged(), mParent, CSLayoutData::setX(), and CSLayoutData::setY(). Referenced by CSScrollbar::paint(), and CSWindow::reactOnMessageWindow().
00168 { 00169 static char *functionName="setPosition"; 00170 if ((mX != x) || (mY != y)) 00171 { 00172 if (mParent) 00173 { 00174 // no position information to be set to non xy 00175 if (mParent->getLayoutManager()->getType().compare(CSLayoutManagerXY.CLASS) != 0) 00176 { 00177 return; 00178 } 00179 } 00180 00181 mX = x; 00182 mY = y; 00183 getLayoutDataInternal()->setX(mX); 00184 getLayoutDataInternal()->setY(mY); 00185 layoutChanged(); 00186 } 00187 } |
Here is the call graph for this function:
|
Definition at line 318 of file CSGrafikElement.h.
00318 {return mFrontElement;}
|
|
Definition at line 321 of file CSGrafikElement.cpp. References mElements. Referenced by CSWindow::reactOnMessageWindow().
00322 { 00323 CSGrafikElements::iterator iter = mElements.begin(); 00324 bool elementFound = false; 00325 while (iter != mElements.end()) 00326 { 00327 if ((*iter) == element) 00328 { 00329 mElements.erase(iter); 00330 elementFound = true; 00331 break; 00332 } 00333 iter++; 00334 } 00335 if (elementFound == true) 00336 { 00337 mElements.push_back(element); 00338 } 00339 } |
|
Definition at line 320 of file CSGrafikElement.h. Referenced by CSMenu::addMenuItem(), CSMenu::CSMenu(), CSMessageBox::CSMessageBox(), and CSWindow::rebuildElementWindow().
00320 {mType = type;} |
|
Definition at line 321 of file CSGrafikElement.h. Referenced by getArea(), getBackgroundColor(), getBorder(), getFont(), getHorizontalElementSpacing(), getTextColor(), getVerticalElementSpacing(), and init().
00321 {if (mType.size() == 0) return getType(); return mType;} |
|
X coordinates in relation to parent.
Definition at line 322 of file CSGrafikElement.h. Referenced by CSWindow::paint(), CSTextarea::paint(), CSListbox::paint(), CSTextIcon::paint(), CSCombobox::paint(), CSTextfield::putString(), CSCombobox::putString(), CSScrollbar::reactOnMessageScrollbar(), CSWindow::reactOnMessageWindow(), CSMessageBox::rebuildElement(), and translateToDesktop(). |
|
Y coordinates in relation to parent.
Definition at line 323 of file CSGrafikElement.h. Referenced by CSMenu::openMenu(), CSTextarea::paint(), CSListbox::paint(), CSTextIcon::paint(), CSCombobox::paint(), CSTextfield::putString(), CSCombobox::putString(), CSScrollbar::reactOnMessageScrollbar(), CSWindow::reactOnMessageWindow(), and translateToDesktop(). |
|
coordinates of screen
Definition at line 378 of file CSGrafikElement.cpp. References getVisible(), isTransparent(), mHeight, and mWidth.
00379 { 00380 static char *functionName="isIn"; 00381 if (!getVisible()) 00382 { 00383 return false; 00384 } 00385 int startX, startY; 00386 int endX, endY; 00387 00388 00389 00390 00391 if (parentElementArea) 00392 { 00393 startX = parentElementArea->x+mX; 00394 startY = parentElementArea->y+mY; 00395 endY = mHeight + parentElementArea->y+mY; 00396 endX = mWidth + parentElementArea->x+mX; 00397 } 00398 else 00399 { 00400 startX = mX; 00401 startY = mY; 00402 endY = mHeight + mY; 00403 endX = mWidth + mX; 00404 } 00405 00406 00407 if ((x>=startX) && (x<endX) && (y>=startY) && (y<endY)) 00408 { 00409 bool b = !isTransparent(x, y, parentElementArea); 00410 return b; 00411 } 00412 00413 return false; 00414 } |
Here is the call graph for this function:
|
|
to be overloaded
Implements CSMessageListener. Reimplemented in CSButton, CSDragButton, CSCheckBox, CSCombobox, CSHTMLPanel, CSListbox, CSMenu, CSMenuItem, CSScrollbar, CSTextarea, CSTextfield, and CSWindow. Definition at line 328 of file CSGrafikElement.h. |
|
to be overloaded (default false)
Reimplemented in CSWindow. Definition at line 329 of file CSGrafikElement.h. Referenced by isIn(). |
|
coordinates relativ to this element no clipping Reimplemented in CSCombobox, CSTextarea, and CSTextfield. Definition at line 362 of file CSGrafikElement.cpp. References getFont(), and CSFont::putString(). Referenced by CSListbox::paint(), CSLabel::paint(), and CSTextIcon::paint().
|
Here is the call graph for this function:
|
coordinates relativ to this element no clipping Definition at line 371 of file CSGrafikElement.cpp. References getFont(), and CSFont::putString().
|
Here is the call graph for this function:
|
coordinates relativ to this element no clipping Definition at line 352 of file CSGrafikElement.cpp. References SDLMain::line(). Referenced by CSTextarea::paint(), and CSCheckBox::paint().
00353 { 00354 static char *functionName="line"; 00355 // colors are alpha colors!!! 00356 SDLMain::line(destination, parentViewport->x + x1, parentViewport->y + y1, parentViewport->x + x2, parentViewport->y + y2, (color<<8)+255); 00357 } |
Here is the call graph for this function:
|
Definition at line 334 of file CSGrafikElement.h. Referenced by CSScrollbar::rebuildElement(), CSCombobox::rebuildElement(), and CSWindow::rebuildElementWindow().
00334 {mActionId=id;}; |
|
each element is registered to CSLAF, if LAF changes, this method is called (default does nothing!) a bottom up laf change, inner most elements allways first, so outer lying elements get right sizing information from their children! Definition at line 618 of file CSGrafikElement.cpp. References layoutChanged(), mElements, and rebuildElement(). Referenced by CSLAF::lafChanged().
00619 { 00620 if (mCurrentLAFId != id) 00621 { 00622 CSGrafikElements::iterator iter = mElements.begin(); 00623 while (iter != mElements.end()) 00624 { 00625 (*iter)->lafChanged(id); 00626 iter++; 00627 } 00628 rebuildElement(); 00629 layoutChanged(); 00630 mCurrentLAFId = id; 00631 } 00632 } |
Here is the call graph for this function:
|
is element a child of myself?
Definition at line 602 of file CSGrafikElement.cpp. References getParent(). Referenced by CSButton::reactOnMessageButton(), CSMenu::reactOnMessageMenu(), CSMenuItem::reactOnMessageMenuItem(), and CSWindow::reactOnMessageWindow().
00603 { 00604 static char *functionName="isChild"; 00605 while (element != 0) 00606 { 00607 if (element == this) 00608 { 00609 return true; 00610 } 00611 element = element->getParent(); 00612 } 00613 return false; 00614 } |
Here is the call graph for this function:
|
Definition at line 489 of file CSGrafikElement.cpp. References MOUSE_CURSOR_TYPE_DEFAULT. Referenced by init(), and CSWindow::reactOnMessageWindow().
00490 { 00491 mCursorType = MOUSE_CURSOR_TYPE_DEFAULT; 00492 } |
|
Definition at line 484 of file CSGrafikElement.cpp. References MOUSE_CURSOR_TYPE_SIZING. Referenced by CSWindow::reactOnMessageWindow().
00485 { 00486 mCursorType = MOUSE_CURSOR_TYPE_SIZING; 00487 } |
|
Definition at line 494 of file CSGrafikElement.cpp. References CSLAF::getCurrentLAF(), CSLAF::getMouseCursor(), LAF_MOUSE_CURSOR_DEFAULT, LAF_MOUSE_CURSOR_SIZING_DOWN_RIGHT, and MOUSE_CURSOR_TYPE_SIZING. Referenced by CSDesktop::paint().
00495 { 00496 CSLAF *laf = CSLAF::getCurrentLAF(); // make sure laf is loaded/initialized at least once 00497 if (mCursorType == MOUSE_CURSOR_TYPE_SIZING) 00498 { 00499 return laf->getMouseCursor(LAF_MOUSE_CURSOR_SIZING_DOWN_RIGHT); 00500 } 00501 00502 return laf->getMouseCursor(LAF_MOUSE_CURSOR_DEFAULT); 00503 } |
Here is the call graph for this function:
|
Definition at line 341 of file CSGrafikElement.h. Referenced by CSLAF::addElement(), and CSLAF::lafChanged().
00341 {mCurrentLAFId = id;}
|
|
Definition at line 342 of file CSGrafikElement.h. Referenced by CSLAF::lafChanged().
00342 {return mCurrentLAFId;}
|
|
Definition at line 343 of file CSGrafikElement.h. Referenced by CSWindow::rebuildElementWindow().
00343 {mTooltipText = s;} |
|
Definition at line 344 of file CSGrafikElement.h.
00344 {return mTooltipText;} |
|
Reimplemented in CSBar, CSButton, CSCheckBox, CSCombobox, CSDesktop, CSHTMLPanel, CSPictureIcon, CSTextIcon, CSLabel, CSListbox, CSMenu, CSMenuBar, CSMenuItem, CSMessageBox, CSScrollbar, CSTextarea, CSTextfield, and CSWindow. Definition at line 346 of file CSGrafikElement.h. Referenced by doLayout(), and init().
00346 {} |
|
Definition at line 347 of file CSGrafikElement.h.
00347 {return mActive;}
|
|
Definition at line 348 of file CSGrafikElement.h.
00348 {mActive = b;} |
|
Definition at line 349 of file CSGrafikElement.h. Referenced by CSTextIcon::paint(), CSPictureIcon::paint(), CSCombobox::reactOnMessageCombobox(), CSTextarea::reactOnMessageTextarea(), and CSTextfield::reactOnMessageTextField().
00349 {mEnabled = b;} |
|
Definition at line 350 of file CSGrafikElement.h. Referenced by getBackgroundColor(), getTextColor(), CSCombobox::paint(), and CSCombobox::reactOnMessageCombobox().
00350 {return mEnabled;}
|
|
Definition at line 351 of file CSGrafikElement.h.
00351 {mActivated = b;} |
|
Definition at line 352 of file CSGrafikElement.h.
00352 {return mActivated;}
|
|
Definition at line 353 of file CSGrafikElement.h. Referenced by paintChildren().
00353 {return mModal;}
|
|
Definition at line 354 of file CSGrafikElement.h. Referenced by CSMessageBox::CSMessageBox().
00354 {mModal = m;} |
|
|
Definition at line 1102 of file CSGrafikElement.cpp. References layoutChanged(), mParent, and mVisible. Referenced by CSMenu::CSMenu(), CSWindow::initWindow(), CSListbox::layoutSetupListbox(), CSDesktop::paint(), CSWindow::reactOnMessageWindow(), CSCombobox::rebuildElement(), CSWindow::rebuildElementWindow(), CSWindow::setClosable(), and CSHTMLPanel::setPage().
01103 { 01104 if (v != mVisible) 01105 { 01106 mVisible = v; 01107 layoutChanged(true); 01108 if (mParent) 01109 { 01110 mParent->layoutChanged(); 01111 } 01112 } 01113 } |
Here is the call graph for this function:
|
Definition at line 470 of file CSGrafikElement.cpp. References mElements. Referenced by CSMenu::CSMenu(), CSMenuItem::CSMenuItem(), CSScrollbar::rebuildElement(), CSListbox::rebuildElement(), and CSCombobox::rebuildElement().
00471 { 00472 static char *functionName="setFocusable"; 00473 mFocusable = b; 00474 00475 CSGrafikElements::iterator iter = mElements.begin(); 00476 while (iter != mElements.end()) 00477 { 00478 CSGrafikElement *test = *iter; 00479 test->setFocusable(b); 00480 iter++; 00481 } 00482 } |
|
Definition at line 358 of file CSGrafikElement.h. Referenced by CSScrollbar::rebuildElement(), CSListbox::rebuildElement(), and CSDesktop::setFocusedComponent().
00358 {return mFocusable;}
|
|
Definition at line 359 of file CSGrafikElement.h. Referenced by CSTextfield::paint(), CSTextarea::paint(), and CSCombobox::paint().
00359 {return mFocused;}
|
|
only to be used from CSDesktop!
Definition at line 360 of file CSGrafikElement.h. Referenced by CSDesktop::setFocusedComponent(). |
|
Definition at line 361 of file CSGrafikElement.h. Referenced by CSListbox::paint(), and CSCombobox::paint().
00361 {return mViewportArea;}
|
|
|
|
set height of component
Definition at line 189 of file CSGrafikElement.cpp. References layoutChanged(), LOG_ENTER, LOG_EXIT, mHeight, mHeightSet, and mMinHeight. Referenced by CSScrollbar::paint(), and CSWindow::reactOnMessageWindow().
00190 { 00191 static char *functionName="setHeight"; 00192 LOG_ENTER 00193 if (h == -1) 00194 { 00195 mHeightSet = false; 00196 } 00197 else 00198 { 00199 if (h < mMinHeight) 00200 { 00201 h = mMinHeight; 00202 } 00203 if (mHeight != h) 00204 { 00205 mHeightSet = true; 00206 mHeight = h; 00207 layoutChanged(true); 00208 } 00209 } 00210 LOG_EXIT 00211 } |
Here is the call graph for this function:
|
set width of component
Definition at line 213 of file CSGrafikElement.cpp. References layoutChanged(), LOG_ENTER, LOG_EXIT, mMinWidth, mWidth, and mWidthSet. Referenced by CSTextfield::CSTextfield(), CSScrollbar::paint(), and CSWindow::reactOnMessageWindow().
00214 { 00215 static char *functionName="setWidth"; 00216 LOG_ENTER 00217 if (w == -1) 00218 { 00219 mWidthSet = false; 00220 } 00221 else 00222 { 00223 if (w < mMinWidth) 00224 w = mMinWidth; 00225 if (mWidth != w) 00226 { 00227 mWidthSet = true; 00228 mWidth = w; 00229 layoutChanged(true); 00230 } 00231 } 00232 LOG_EXIT 00233 } |
Here is the call graph for this function:
|
returns the given gui font (see CSLAF) returns the given gui font (see CSLAF) Definition at line 636 of file CSGrafikElement.cpp. References CSLAF::getCurrentLAF(), CSLAF::getFont(), and getGUIType(). Referenced by CSTextIcon::initIcon(), CSCombobox::layoutSetupCombobox(), CSHTMLPanel::layoutSetupHTMLPanel(), CSLabel::layoutSetupLabel(), CSListbox::layoutSetupListbox(), CSTextfield::layoutSetupTextfield(), CSTextIcon::layoutSetupTextIcon(), CSTextfield::paint(), CSTextarea::paint(), CSListbox::paint(), CSDesktop::paint(), CSCombobox::paint(), CSTextfield::putString(), CSTextarea::putString(), putString(), CSCombobox::putString(), CSCombobox::reactOnMessageCombobox(), CSTextfield::reactOnMessageTextField(), and CSListbox::setGrafikCursor().
00637 { 00638 if (mFont) 00639 { 00640 return mFont; 00641 } 00642 return CSLAF::getCurrentLAF()->getFont(getGUIType()); 00643 } |
Here is the call graph for this function:
|
Font is not deleted here, since it is loaded by a LOADER::INSTANCE! (which keeps track of the instances!) Definition at line 371 of file CSGrafikElement.h. Referenced by HTMLElement::buildDisplay().
00372 { 00373 if (mFont != font) 00374 { 00375 mFont = font; 00376 layoutChanged(); 00377 } 00378 } |
|
Definition at line 380 of file CSGrafikElement.h. Referenced by CSBar::initBar(), and CSScrollbar::rebuildElement().
00380 {mInset = inset;} |
|
Definition at line 381 of file CSGrafikElement.h. Referenced by CSListbox::layoutSetupListbox(), CSMessageBox::layoutSetupMessageBox(), CSTextarea::layoutSetupTextarea(), CSTextfield::layoutSetupTextfield(), CSTextfield::paint(), CSCombobox::paint(), and CSTextfield::reactOnMessageTextField().
00381 {return mInset;} |
|
in destructor this class deletes the currently set border! if set (and kept) from outside this should be taken into account if outside wants to delete the border itself setBorder(0) should be called to prevent deleting here! Definition at line 679 of file CSGrafikElement.cpp. References layoutChanged().
00680 { 00681 if (deleteOldBorder) 00682 { 00683 if (mBorder) 00684 { 00685 delete mBorder; 00686 mBorder = 0; 00687 } 00688 } 00689 mBorder = border; 00690 layoutChanged(); 00691 } |
Here is the call graph for this function:
|
Definition at line 693 of file CSGrafikElement.cpp. References CSLAF::getBorder(), CSLAF::getCurrentLAF(), getGUIType(), and mBorderState. Referenced by CSLayoutManager::buildArea(), CSLayoutManager::getBorderHeight(), CSLayoutManager::getBorderWidth(), init(), CSCheckBox::layoutSetupCheckBox(), CSCombobox::layoutSetupCombobox(), CSListbox::layoutSetupListbox(), CSMessageBox::layoutSetupMessageBox(), CSTextarea::layoutSetupTextarea(), CSTextfield::layoutSetupTextfield(), CSTextfield::paint(), CSCombobox::paint(), CSCheckBox::paint(), paintBorder(), CSCombobox::reactOnMessageCombobox(), CSTextfield::reactOnMessageTextField(), and CSListbox::setGrafikCursor().
00694 { 00695 if (!mBorder) 00696 { 00697 return CSLAF::getCurrentLAF()->getBorder(getGUIType(), mBorderState); 00698 } 00699 return mBorder; 00700 } |
Here is the call graph for this function:
|
in destructor this class deletes the currently set area! if set (and kept) from outside this should be taken into account if outside wants to delete the border itself setArea(0) should be called to prevent deleting here! Definition at line 652 of file CSGrafikElement.cpp. Referenced by CSWindow::CSWindow().
00653 { 00654 if (deleteOldArea) 00655 { 00656 if (mArea) 00657 { 00658 delete mArea; 00659 mArea = 0; 00660 } 00661 } 00662 mArea = area; 00663 } |
|
Definition at line 665 of file CSGrafikElement.cpp. References CSLAF::getArea(), CSLAF::getCurrentLAF(), and getGUIType(). Referenced by paintAreaStandard().
00666 { 00667 if (!mArea) 00668 { 00669 return CSLAF::getCurrentLAF()->getArea(getGUIType()); 00670 } 00671 return mArea; 00672 } |
Here is the call graph for this function:
|
Definition at line 702 of file CSGrafikElement.cpp. References CSLAF::getBackgroundColorDisabled(), CSLAF::getBackgroundColorEnabled(), CSLAF::getCurrentLAF(), getEnabled(), getGUIType(), and getParent(). Referenced by CSHTMLPanel::layoutSetupHTMLPanel(), and paintAreaStandard().
00703 { 00704 if (mBackGroundColorSet == true) 00705 { 00706 return mBackgroundColor; 00707 } 00708 if (getEnabled()) 00709 { 00710 int color = -1; 00711 CSGrafikElement * element = this; 00712 while ((color == -1) && (element != 0)) 00713 { 00714 color = CSLAF::getCurrentLAF()->getBackgroundColorEnabled(element->getGUIType()); 00715 if (color != -1) 00716 { 00717 return color; 00718 } 00719 element = element->getParent(); 00720 } 00721 return 255*256*256+255; // Magenta! 00722 } 00723 int color = -1; 00724 CSGrafikElement * element = this; 00725 while ((color == -1) && (element != 0)) 00726 { 00727 color = CSLAF::getCurrentLAF()->getBackgroundColorDisabled(element->getGUIType()); 00728 if (color != -1) 00729 { 00730 return color; 00731 } 00732 element = element->getParent(); 00733 } 00734 return 255*256*256+255; // Magenta! 00735 } |
Here is the call graph for this function:
|
Definition at line 737 of file CSGrafikElement.cpp. Referenced by CSHTMLPanel::layoutSetupHTMLPanel().
00738 {
00739 mBackGroundColorSet = true;
00740 mBackgroundColor = backgroundColor;
00741 }
|
|
Definition at line 743 of file CSGrafikElement.cpp. References CSLAF::getCurrentLAF(), getEnabled(), getGUIType(), getParent(), CSLAF::getTextColorDisabled(), and CSLAF::getTextColorEnabled(). Referenced by CSLabel::paint(), CSTextIcon::paint(), CSTextfield::putString(), CSTextarea::putString(), and CSCombobox::putString().
00744 { 00745 if (mTextColorSet == true) 00746 { 00747 return mTextColor; 00748 } 00749 if (getEnabled()) 00750 { 00751 int color = -1; 00752 CSGrafikElement * element = this; 00753 while ((color == -1) && (element != 0)) 00754 { 00755 color = CSLAF::getCurrentLAF()->getTextColorEnabled(element->getGUIType()); 00756 if (color != -1) 00757 { 00758 return color; 00759 } 00760 element = element->getParent(); 00761 } 00762 return 255*256*256+255; // Magenta! 00763 } 00764 int color = -1; 00765 CSGrafikElement * element = this; 00766 while ((color == -1) && (element != 0)) 00767 { 00768 color = CSLAF::getCurrentLAF()->getTextColorDisabled(element->getGUIType()); 00769 if (color != -1) 00770 { 00771 return color; 00772 } 00773 element = element->getParent(); 00774 } 00775 return 255*256*256+255; // Magenta! 00776 } |
Here is the call graph for this function:
|
Definition at line 778 of file CSGrafikElement.cpp. Referenced by HTMLElement::buildDisplay().
00779 {
00780 mTextColorSet = true;
00781 mTextColor = textColor;
00782 }
|
|
Definition at line 392 of file CSGrafikElement.h. Referenced by HTMLElement::buildDisplay().
00392 {mStyle = style;} |
|
Definition at line 800 of file CSGrafikElement.cpp. References CSLAF::getCurrentLAF(), getGUIType(), and CSLAF::getHorizontalElementSpacing(). Referenced by CSBar::addElementAt(), addMainElement(), CSTextarea::paint(), and CSLabel::paint().
00801 { 00802 if (mHorizontalElementSpacingSet == true) 00803 { 00804 return mHorizontalElementSpacing; 00805 } 00806 return CSLAF::getCurrentLAF()->getHorizontalElementSpacing(getGUIType()); 00807 } |
Here is the call graph for this function:
|
Definition at line 809 of file CSGrafikElement.cpp. References layoutChanged().
00810 { 00811 mHorizontalElementSpacingSet = true; 00812 mHorizontalElementSpacing = horizontalElementSpacing; 00813 layoutChanged(); 00814 } |
Here is the call graph for this function:
|
Definition at line 784 of file CSGrafikElement.cpp. References CSLAF::getCurrentLAF(), getGUIType(), and CSLAF::getVerticalElementSpacing(). Referenced by CSBar::addElementAt(), addMainElement(), CSListbox::layoutSetupListbox(), CSTextarea::paint(), CSListbox::paint(), CSLabel::paint(), and CSListbox::setGrafikCursor().
00785 { 00786 if (mVerticalElementSpacingSet == true) 00787 { 00788 return mVerticalElementSpacing; 00789 } 00790 return CSLAF::getCurrentLAF()->getVerticalElementSpacing(getGUIType()); 00791 } |
Here is the call graph for this function:
|
Definition at line 793 of file CSGrafikElement.cpp. References layoutChanged().
00794 { 00795 mVerticalElementSpacingSet = true; 00796 mVerticalElementSpacing = verticalElementSpacing; 00797 layoutChanged(); 00798 } |
Here is the call graph for this function:
|
Definition at line 397 of file CSGrafikElement.h. Referenced by CSWindow::rebuildElementWindow().
00397 {mBorderState = state;} |
|
Definition at line 399 of file CSGrafikElement.h. Referenced by CSLayoutManagerBorder::getMinimumHeight(), CSLayoutManagerStackVertical::getMinimumHeight(), CSLayoutManagerXY::getMinimumHeight(), CSLayoutManagerStackHorizontal::getMinimumHeight(), CSLayoutManagerBorder::getMinimumWidth(), CSLayoutManagerStackVertical::getMinimumWidth(), CSLayoutManagerXY::getMinimumWidth(), CSLayoutManagerStackHorizontal::getMinimumWidth(), layoutChanged(), CSLayoutManagerStackVertical::layoutElements(), CSLayoutManagerStackHorizontal::layoutElements(), CSLayoutManagerBorder::layoutElements(), CSLayoutManagerXY::layoutElements(), CSWindow::layoutSetupWindow(), CSMenu::openMenu(), CSLayoutManager::pack(), and setPosition().
00400 { 00401 if (mMainElement == this) 00402 { 00403 return getMainLayoutManager(); 00404 } 00405 else 00406 { 00407 return mMainElement->getLayoutManager(); 00408 } 00409 } |
|
Definition at line 410 of file CSGrafikElement.h. Referenced by CSCheckBox::CSCheckBox(), CSDesktop::CSDesktop(), CSMenu::CSMenu(), CSScrollbar::CSScrollbar(), init(), CSBar::initBar(), CSListbox::initListbox(), and CSWindow::initWindow().
00411 { 00412 if (mMainElement == this) 00413 { 00414 setMainLayoutManager(manager); 00415 } 00416 else 00417 { 00418 mMainElement->setLayoutManager(manager); 00419 } 00420 } |
|
pointer is faster, but more dangerous
Definition at line 421 of file CSGrafikElement.h. Referenced by CSMenu::CSMenu(), CSLayoutManagerXY::getMinimumHeight(), CSLayoutManagerXY::getMinimumWidth(), CSBar::getPosition(), CSScrollbar::rebuildElement(), and CSCombobox::rebuildElement(). |
|
< set X, Y coordinates in relation to parent (useaable Area) Definition at line 422 of file CSGrafikElement.h. Referenced by CSBar::addElementAt(), addMainElement(), CSMenu::addMenuItem(), CSDesktop::CSDesktop(), CSMenu::CSMenu(), CSScrollbar::CSScrollbar(), CSBar::initBar(), CSWindow::initWindow(), CSScrollbar::rebuildElement(), CSCombobox::rebuildElement(), and CSWindow::rebuildElementWindow().
00423 { 00424 mLayoutData = layoutData; 00425 setPosition(mLayoutData.getX(), mLayoutData.getY()); ///< set X, Y coordinates in relation to parent (useaable Area) 00426 mLayoutManager->buildArea(this); 00427 00428 00429 layoutChanged(); 00430 } |
|
each and every CSLayoutManager is freed by the CSGraphicElement, which receives it. Freed either in th edestructor, or by setting a new CSLayoutManager! Definition at line 941 of file CSGrafikElement.cpp. References getHorizontalElementSpacing(), getLayoutDataInternal(), getParent(), CSLayoutData::getSpacingSet(), getVerticalElementSpacing(), layoutChanged(), LOG_ENTER, LOG_EXIT, mElements, removeMainElement(), setLayoutData(), setParent(), CSLayoutData::setPosition(), and CSLayoutData::setSpacing(). Referenced by addElement(), addFrontElement(), addFrontElementCenter(), CSDesktop::CSDesktop(), and CSWindow::initWindow().
00942 { 00943 static char *functionName="addElement"; 00944 LOG_ENTER 00945 // there can only be one parent! (not tested - the old one is simply removed!) 00946 if (element->getParent()) 00947 { 00948 element->getParent()->removeMainElement(element); 00949 } 00950 element->setParent(this); 00951 mElements.push_back(element); 00952 CSLayoutData *layoutData = element->getLayoutDataInternal(); 00953 if (!layoutData->getSpacingSet()) 00954 { 00955 layoutData->setSpacing(getVerticalElementSpacing(), getHorizontalElementSpacing()); 00956 } 00957 layoutData->setPosition(position); 00958 element->setLayoutData(*layoutData); 00959 element->layoutChanged(); 00960 LOG_EXIT 00961 } |
Here is the call graph for this function:
|
element will be freed by this Definition at line 965 of file CSGrafikElement.cpp. References getHorizontalElementSpacing(), getLayoutDataInternal(), getParent(), CSLayoutData::getSpacingSet(), getVerticalElementSpacing(), layoutChanged(), LOG_ENTER, LOG_EXIT, mElements, removeMainElement(), setLayoutData(), setParent(), CSLayoutData::setSpacing(), CSLayoutData::setX(), and CSLayoutData::setY().
00966 { 00967 static char *functionName="addElement"; 00968 LOG_ENTER 00969 // there can only be one parent! (not tested - the old one is simply removed!) 00970 if (element->getParent()) 00971 { 00972 element->getParent()->removeMainElement(element); 00973 } 00974 element->setParent(this); 00975 mElements.push_back(element); 00976 CSLayoutData *layoutData = element->getLayoutDataInternal(); 00977 if (!layoutData->getSpacingSet()) 00978 { 00979 layoutData->setSpacing(getVerticalElementSpacing(), getHorizontalElementSpacing()); 00980 } 00981 layoutData->setX(x); 00982 layoutData->setY(y); 00983 element->setLayoutData(*layoutData); 00984 element->layoutChanged(); 00985 LOG_EXIT 00986 } |
Here is the call graph for this function:
|
element will be freed by this Definition at line 918 of file CSGrafikElement.cpp. References getHorizontalElementSpacing(), getLayoutDataInternal(), getParent(), CSLayoutData::getSpacingSet(), getVerticalElementSpacing(), layoutChanged(), LOG_ENTER, LOG_EXIT, mElements, removeMainElement(), setLayoutData(), setParent(), and CSLayoutData::setSpacing().
00919 { 00920 static char *functionName="addElement"; 00921 LOG_ENTER 00922 // there can only be one parent! (not tested - the old one is simply removed!) 00923 if (element->getParent()) 00924 { 00925 element->getParent()->removeMainElement(element); 00926 } 00927 element->setParent(this); 00928 mElements.push_back(element); 00929 CSLayoutData *layoutData = element->getLayoutDataInternal(); 00930 if (!layoutData->getSpacingSet()) 00931 { 00932 layoutData->setSpacing(getVerticalElementSpacing(), getHorizontalElementSpacing()); 00933 } 00934 element->setLayoutData(*layoutData); 00935 element->layoutChanged(); 00936 LOG_EXIT 00937 } |
Here is the call graph for this function:
|
Here is the call graph for this function:
|
element will be freed by this Definition at line 863 of file CSGrafikElement.cpp. References addElement(), addMainElement(), LOG_ENTER, and LOG_EXIT.
00864 { 00865 static char *functionName="addElement"; 00866 LOG_ENTER 00867 00868 // there can only be one parent! (not tested - the old one is simply removed!) 00869 if (mMainElement == this) 00870 { 00871 addMainElement(element, x, y); 00872 } 00873 else 00874 { 00875 mMainElement->addElement(element, x, y); 00876 } 00877 LOG_EXIT 00878 } |
Here is the call graph for this function:
|
Definition at line 1004 of file CSGrafikElement.cpp. References addMainElement(), getDesktop(), getLayoutDataInternal(), mFrontElement, CSLayoutData::setX(), and CSLayoutData::setY(). Referenced by CSMenu::openMenu().
01005 { 01006 CSDesktop *desktop = getDesktop(); 01007 if (desktop == 0) 01008 { 01009 return; 01010 } 01011 element->mFrontElement = true; 01012 getLayoutDataInternal()->setX(x); 01013 getLayoutDataInternal()->setY(y); 01014 desktop->addMainElement(element, x, y); 01015 } |
Here is the call graph for this function:
|
Definition at line 1017 of file CSGrafikElement.cpp. References addMainElement(), getDesktop(), getHeight(), getLayoutDataInternal(), getWidth(), mFrontElement, CSLayoutData::setX(), and CSLayoutData::setY(). Referenced by CSHTMLPanel::setPage().
01018 { 01019 CSDesktop *desktop = getDesktop(); 01020 if (desktop == 0) 01021 { 01022 return; 01023 } 01024 element->mFrontElement = true; 01025 getLayoutDataInternal()->setX(desktop->getWidth()/2 - element->getWidth()/2); 01026 getLayoutDataInternal()->setY(desktop->getHeight()/2 - element->getHeight()/2); 01027 desktop->addMainElement(element, desktop->getWidth()/2 - element->getWidth()/2, desktop->getHeight()/2 - element->getHeight()/2); 01028 } |
Here is the call graph for this function:
|
Definition at line 899 of file CSGrafikElement.cpp. References addElement(), addMainElement(), LOG_ENTER, and LOG_EXIT.
00900 { 00901 static char *functionName="addElement"; 00902 LOG_ENTER 00903 00904 // there can only be one parent! (not tested - the old one is simply removed!) 00905 if (mMainElement == this) 00906 { 00907 addMainElement(element); 00908 } 00909 else 00910 { 00911 mMainElement->addElement(element); 00912 } 00913 LOG_EXIT 00914 } |
Here is the call graph for this function:
|
if not set defaults to 5 pixel
Definition at line 442 of file CSGrafikElement.h. Referenced by CSLayoutManager::getMinWidth(), and CSButton::layoutSetupButton(). |
|
Definition at line 443 of file CSGrafikElement.h.
00443 {mMinWidth = w;} |
|
if not set defaults to 5 pixel
Definition at line 444 of file CSGrafikElement.h. Referenced by CSLayoutManager::getMinHeight(), and CSButton::layoutSetupButton(). |
|
Definition at line 445 of file CSGrafikElement.h.
00445 {mMinHeight = h;} |
|
Definition at line 1030 of file CSGrafikElement.cpp. References getDesktop(), mFrontElement, and removeMainElement(). Referenced by CSMenu::closeMenu(), and CSHTMLPanel::setPage().
01031 { 01032 CSDesktop *desktop = getDesktop(); 01033 if (desktop == 0) 01034 { 01035 return; 01036 } 01037 element->mFrontElement = false; 01038 desktop->removeMainElement(element); 01039 } |
Here is the call graph for this function:
|
removed element is NOT freed!
Definition at line 817 of file CSGrafikElement.cpp. References layoutChanged(), and removeMainElement(). Referenced by CSBar::addElementAt(), CSScrollbar::rebuildElement(), CSMessageBox::rebuildElement(), CSListbox::rebuildElement(), CSCombobox::rebuildElement(), CSWindow::rebuildElementWindow(), CSMenu::removeMenuItem(), and CSListbox::~CSListbox().
00818 { 00819 static char *functionName="removeElement"; 00820 if (mMainElement == this) 00821 { 00822 return removeMainElement(element); 00823 } 00824 CSGrafikElement *returnee = mMainElement->removeElement(element); 00825 layoutChanged(); 00826 return returnee; 00827 } |
Here is the call graph for this function:
|
Definition at line 449 of file CSGrafikElement.h. Referenced by CSWindow::layoutSetupWindow(), CSWindow::reactOnMessageWindow(), CSWindow::setHorizontalDisplayStart(), and CSWindow::setVerticalDisplayStart().
00450 { 00451 mViewportOffsetX = x; 00452 mViewportOffsetY = y; 00453 } |
|
Definition at line 455 of file CSGrafikElement.h. Referenced by paintChildren(), and translateToDesktop().
00456 { 00457 x = 0; 00458 y = 0; 00459 if (mParent) 00460 { 00461 // mParent->getViewportOffset(x, y); 00462 } 00463 x += mViewportOffsetX; 00464 y += mViewportOffsetY; 00465 } |
|
Definition at line 466 of file CSGrafikElement.h.
00467 { 00468 x = 0; 00469 y = 0; 00470 if (mParent) 00471 { 00472 mParent->getViewportOffsetParent(x, y); 00473 } 00474 x += mViewportOffsetX; 00475 y += mViewportOffsetY; 00476 } |
|
Definition at line 478 of file CSGrafikElement.h. Referenced by CSWindow::rebuildElementWindow().
00479 { 00480 if (mMainElement == this) 00481 { 00482 removeMainAllElements(); 00483 } 00484 else 00485 { 00486 mMainElement->removeAllElements(); 00487 } 00488 } |
|
layoutChanged() changes only the "inside" of the current component children's layout changes etc. but the size or position of the current element ist not changed! Definition at line 1041 of file CSGrafikElement.cpp. References getLayoutManager(), CSLayoutManager::getPropagateSizeChangesOnly(), CSLayoutManager::getType(), mLayoutChanged, and mParent. Referenced by CSWindow::addLeftIcon(), addMainElement(), CSTextIcon::buildIcon(), CSPictureIcon::buildIcon(), lafChanged(), removeElement(), removeMainElement(), setBorder(), setHeight(), setHorizontalElementSpacing(), CSListbox::setItems(), CSListbox::setItemsShown(), CSLayoutManager::setLayout(), CSHTMLPanel::setPage(), setPosition(), CSLabel::setText(), CSTextIcon::setText(), CSWindow::setTitle(), setVerticalElementSpacing(), setVisible(), and setWidth().
01042 { 01043 if ((!getLayoutManager()->getPropagateSizeChangesOnly()) || (sizing)) 01044 { 01045 mLayoutChanged = true; 01046 } 01047 // if I myself am sizing, parent MUST be layout, since 01048 // I do not layout myself, my parent does 01049 // if parent size ist changed -> grand parent must layout... 01050 if (sizing) 01051 { 01052 if (mParent != 0) 01053 { 01054 if (mParent->getLayoutManager()->getType().compare(CSLayoutManagerXY.CLASS) == 0) 01055 { 01056 mParent->mLayoutChanged = true; 01057 } 01058 else 01059 { 01060 mParent->layoutChanged(true); 01061 } 01062 } 01063 } 01064 else 01065 { 01066 if (mParent != 0) 01067 { 01068 if (!mParent->getLayoutManager()->getPropagateSizeChangesOnly()) 01069 { 01070 mParent->mLayoutChanged = true; 01071 } 01072 } 01073 } 01074 } |
Here is the call graph for this function:
|
is this element visible?
Definition at line 223 of file CSGrafikElement.h. Referenced by init(), and setVisible(). |
|
the currently set CSInset
Definition at line 224 of file CSGrafikElement.h. Referenced by getInsetInternal(), and init(). |
|
Definition at line 235 of file CSGrafikElement.h. Referenced by getBorder(), and init(). |
|
was height of component set from outside
Definition at line 236 of file CSGrafikElement.h. Referenced by init(), setHeight(), and CSLayoutManager::setLayout(). |
|
was width of component set from outside
Definition at line 237 of file CSGrafikElement.h. Referenced by init(), CSLayoutManager::setLayout(), and setWidth(). |
|
"physical" Dimension of component (as is seen by parent)
Definition at line 238 of file CSGrafikElement.h. Referenced by CSLayoutManager::buildArea(), init(), isIn(), CSLayoutManager::pack(), setHeight(), and CSLayoutManager::setLayout(). |
|
"physical" Dimension of component (as is seen by parent)
Definition at line 239 of file CSGrafikElement.h. Referenced by CSLayoutManager::buildArea(), init(), isIn(), CSLayoutManager::pack(), CSLayoutManager::setLayout(), and setWidth(). |
|
without border, without spacing
Definition at line 240 of file CSGrafikElement.h. Referenced by init(), CSLayoutManager::setLayout(), and setWidth(). |
|
without border, without spacing
Definition at line 241 of file CSGrafikElement.h. Referenced by init(), setHeight(), and CSLayoutManager::setLayout(). |
|
the action id (if there is one) of an element (e.g Button)
Definition at line 243 of file CSGrafikElement.h. Referenced by init(). |
|
all child elements are stored here
Definition at line 246 of file CSGrafikElement.h. Referenced by addMainElement(), deleteElements(), doLayout(), lafChanged(), paintChildren(), removeMainElement(), setFocusable(), toFront(), and ~CSGrafikElement(). |
|
the direct parent (if any) is stored here
Definition at line 247 of file CSGrafikElement.h. Referenced by init(), layoutChanged(), setParent(), setPosition(), and setVisible(). |
|
Definition at line 249 of file CSGrafikElement.h. Referenced by CSGrafikElement(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 251 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 252 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 253 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 254 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 255 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 256 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 257 of file CSGrafikElement.h. Referenced by init(). |
|
Message that can be sent from CS Graphic element (CSDesktop).
Definition at line 258 of file CSGrafikElement.h. Referenced by init(). |
|
static element, name of this class (introsepection)
Reimplemented from CSMessageDispatchable. Reimplemented in CSBar, CSButton, CSDragButton, CSCheckBox, CSCombobox, CSDesktop, CSHTMLPanel, CSIcon, CSPictureIcon, CSTextIcon, CSLabel, CSListbox, CSMenu, CSMenuBar, CSMenuItem, CSMessageBox, CSPanel, CSScrollbar, CSTextarea, CSTextfield, and CSWindow. Definition at line 13 of file CSGrafikElement_old.cpp. |