Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/gl/glgui_frame.cc @ 10368

Last change on this file since 10368 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.8 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
17
18#include "glgui_frame.h"
19
20#include "debug.h"
21namespace OrxGui
22{
23  ObjectListDefinition(GLGuiFrame);
24  /**
25   * standard constructor
26  */
27  GLGuiFrame::GLGuiFrame ()
28  {
29    this->init();
30
31  }
32
33
34  /**
35   * standard deconstructor
36  */
37  GLGuiFrame::~GLGuiFrame()
38  {
39  }
40
41  /**
42   * initializes the GUI-element
43   */
44  void GLGuiFrame::init()
45  {
46    this->registerObject(this, GLGuiFrame::_objectList);
47    this->child = NULL;
48  }
49
50  void GLGuiFrame::pack(GLGuiWidget* widget)
51  {
52    if (widget == NULL)
53      return;
54
55    if (this->child == NULL)
56      this->child = widget;
57    else
58    {
59      PRINTF(2)("Frame %s is already filled, not filling with %s\n", this->getCName(), widget->getCName());
60    }
61  }
62
63  void GLGuiFrame::unpack(GLGuiWidget* widget)
64  {
65    if (widget == NULL || widget == this->child)
66      this->child = NULL;
67  }
68
69  void GLGuiFrame::showAll()
70  {
71    if (this->child != NULL)
72    {
73      if (this->child->isA(GLGuiContainer::staticClassID()))
74        static_cast<GLGuiContainer*>(this->child)->showAll();
75      else
76        this->child->show();
77    }
78    this->show();
79  }
80
81  void GLGuiFrame::hideAll()
82  {
83    if (this->child != NULL)
84    {
85      if (this->child->isA(GLGuiContainer::staticClassID()))
86        static_cast<GLGuiContainer*>(this->child)->hideAll();
87      else
88        this->child->hide();
89    }
90    this->hide();
91  }
92
93
94  /**
95   * draws the GLGuiFrame
96   */
97  void GLGuiFrame::draw()
98  {
99  }
100}
Note: See TracBrowser for help on using the repository browser.