summaryrefslogtreecommitdiff
path: root/include/widgets.h
diff options
context:
space:
mode:
authorpixel <pixel>2006-10-28 16:50:46 +0000
committerpixel <pixel>2006-10-28 16:50:46 +0000
commit45e08ccde95c84932557701235558e72cdc95f1b (patch)
tree0c318c6f589002a8d486c107519b4cf4fd4be1cb /include/widgets.h
parenta13cd83fb51c2e744b8b80dc26696190ec9bff6d (diff)
Fixing caps in class names.
Diffstat (limited to 'include/widgets.h')
-rw-r--r--include/widgets.h142
1 files changed, 73 insertions, 69 deletions
diff --git a/include/widgets.h b/include/widgets.h
index eb51051..f808981 100644
--- a/include/widgets.h
+++ b/include/widgets.h
@@ -17,13 +17,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: widgets.h,v 1.16 2006-02-02 11:01:13 pixel Exp $ */
+/* $Id: widgets.h,v 1.17 2006-10-28 16:50:46 pixel Exp $ */
#ifndef __WIDGETS_H__
#define __WIDGETS_H__
#include <Exceptions.h>
-#include <shape.h>
+#include <Shape.h>
#include <base.h>
#include <engine.h>
@@ -47,9 +47,9 @@ namespace mogltk {
E_MOUSE_OUT_CLICK,
E_MOUSE_DBL_CLICK,
};
- class widget : public Base {
+ class Widget : public Base {
public:
- virtual ~widget() throw (GeneralException);
+ virtual ~Widget() throw (GeneralException);
virtual void move(int x, int y);
virtual void resize(int sx, int sy);
int GetX();
@@ -61,15 +61,15 @@ namespace mogltk {
int GetAX2();
int GetAY2();
virtual mogltk::rect GetDrawRect();
- widget * Father();
- widget * Child();
- widget * Next();
- widget * Prev();
- widget * InnerPanel();
- virtual widget * find_widget(int x, int y);
+ Widget * Father();
+ Widget * Child();
+ Widget * Next();
+ Widget * Prev();
+ Widget * InnerPanel();
+ virtual Widget * find_widget(int x, int y);
void fulldraw();
- shape * Shaper();
- void mainloop();
+ Shape * Shaper();
+ void mainloop() throw (GeneralException);
void m_event(int x, int y, event_t event);
bool inside(int x, int y);
bool GetVisible();
@@ -82,13 +82,13 @@ namespace mogltk {
void set_viewport();
void delete_me();
protected:
- widget(widget * father, int x, int y, int sx, int sy, int type, String name, shape *);
+ Widget(Widget * father, int x, int y, int sx, int sy, int type, String name, Shape *);
virtual void draw();
virtual bool process_event(int x, int y, event_t event);
virtual void resize_notify();
- virtual widget * create_panel();
- void set_exclusive(widget *);
- void unset_exclusive(widget *);
+ virtual Widget * create_panel();
+ void set_exclusive(Widget *);
+ void unset_exclusive(Widget *);
void add_out_move();
void remove_out_move();
void add_out_click();
@@ -98,23 +98,23 @@ namespace mogltk {
String caption;
private:
int x, y, sx, sy, ax, ay, ax2, ay2;
- widget * father, * next, * prev, * child, * last, * root, * panel;
- static widget * focused;
+ Widget * father, * next, * prev, * child, * last, * root, * panel;
+ static Widget * focused;
int type;
String name;
- shape * sh;
- widget * exclusive;
+ Shape * sh;
+ Widget * exclusive;
bool visible;
bool enabled;
class timed_event {
public:
- timed_event(widget * _w, Uint32 _t) : w(_w), t(_t) { }
- widget * w;
+ timed_event(Widget * _w, Uint32 _t) : w(_w), t(_t) { }
+ Widget * w;
Uint32 t;
};
static std::vector<timed_event> timed_events;
- static std::vector<widget *> add_list;
- static std::vector<widget *> del_list;
+ static std::vector<Widget *> add_list;
+ static std::vector<Widget *> del_list;
static bool in_delete_loop;
void computeabs();
@@ -126,54 +126,58 @@ namespace mogltk {
void linkme();
};
- namespace widgets {
+ namespace Widgets {
/*!
- The drawer is mostly used inside the Root widget, to implement the
+ The drawer is mostly used inside the Root Widget, to implement the
function to draw the background.
*/
class drawer : public Base {
public:
- virtual void draw(widget *) = 0;
+ virtual void draw(Widget *) = 0;
};
/*!
- The action class defines "what happens" when you activate a widget,
+ The action class defines "what happens" when you activate a Widget,
mostly used in buttons and co.
*/
class action : public Base {
public:
- virtual void do_action(widget *) = 0;
+ virtual void do_action(Widget *) = 0;
};
/*!
- The Root widget is the father of all the widgets. It'll define the
- background, as well as the whole tree of the visible widgets onscreen.
+ The Root Widget is the father of all the Widgets. It'll define the
+ background, as well as the whole tree of the visible Widgets onscreen.
*/
- class Root : public widget {
+ class Root : public Widget {
public:
- Root(shape *, drawer * = 0);
+ Root(Shape *, drawer * = 0, drawer * = 0);
void setdrawer(drawer *);
+ void setbgdrawer(drawer *);
+ virtual void drawbg();
protected:
virtual void draw();
+ private:
drawer * dr;
+ drawer * bg;
};
/*!
- The Panel widget is not visible. Its only usage is to hold several
- other widgets at a relative position.
+ The Panel Widget is not visible. Its only usage is to hold several
+ other Widgets at a relative position.
*/
- class Panel : public widget {
+ class Panel : public Widget {
public:
- Panel(shape *, widget * father, int x, int y, int w, int h);
+ Panel(Shape *, Widget * father, int x, int y, int w, int h);
};
/*!
- The Button widget will draw a very simple button onscreen, and
+ The Button Widget will draw a very simple button onscreen, and
react to all the necessary mouse events.
*/
- class Button : public widget {
+ class Button : public Widget {
public:
- Button(action *, shape *, widget * father, int x, int y, int w, int h, const String & caption);
+ Button(action *, Shape *, Widget * father, int x, int y, int w, int h, const String & caption);
virtual ~Button() throw (GeneralException);
void simulate_press();
action * cascade_action();
@@ -187,25 +191,25 @@ namespace mogltk {
};
/*!
- The Label widget is only a pure inactive chunk of text.
+ The Label Widget is only a pure inactive chunk of text.
*/
- class Label : public widget {
+ class Label : public Widget {
public:
- Label(shape *, widget * father, int x, int y, int w, int h, const String & caption, const ColorP & color = BLACK, mogltk::font * = mogltk::SystemFont);
+ Label(Shape *, Widget * father, int x, int y, int w, int h, const String & caption, const ColorP & color = BLACK, mogltk::Font * = mogltk::SystemFont);
virtual ~Label() throw (GeneralException) {}
protected:
virtual void draw();
private:
ColorP color;
- mogltk::font * label_font;
+ mogltk::Font * label_font;
};
/*!
The SmartBox is a simple window with a title line.
*/
- class SmartBox : public widget {
+ class SmartBox : public Widget {
public:
- SmartBox(shape *, widget * father, int x, int y, int w, int h, const String & caption);
+ SmartBox(Shape *, Widget * father, int x, int y, int w, int h, const String & caption);
virtual rect GetDrawRect();
protected:
virtual void draw();
@@ -219,7 +223,7 @@ namespace mogltk {
*/
class SmartBoxClose : public SmartBox {
public:
- SmartBoxClose(shape *, widget * father, int x, int y, int w, int h, const String & caption);
+ SmartBoxClose(Shape *, Widget * father, int x, int y, int w, int h, const String & caption);
};
/*!
@@ -228,31 +232,31 @@ namespace mogltk {
*/
class MsgBox : public SmartBox {
public:
- MsgBox(action *, shape *, widget * father, const String & caption, const String & text, mogltk::font * = mogltk::SystemFont);
+ MsgBox(action *, Shape *, Widget * father, const String & caption, const String & text, mogltk::Font * = mogltk::SystemFont);
virtual ~MsgBox() throw (GeneralException);
private:
- mogltk::font * msgbox_font;
+ mogltk::Font * msgbox_font;
};
/*!
- The Frame widget will act as a visible panel. It'll hold widgets
+ The Frame Widget will act as a visible panel. It'll hold Widgets
within a visible frame or fence.
*/
- class Frame : public widget {
+ class Frame : public Widget {
public:
- Frame(shape *, widget * father, int x, int y, int w, int h);
+ Frame(Shape *, Widget * father, int x, int y, int w, int h);
virtual rect GetDrawRect();
protected:
virtual void draw();
};
/*!
- The ContextMenu is a quite heavy widget which will display a kind of
+ The ContextMenu is a quite heavy Widget which will display a kind of
popup menu, holding several buttons or submenus in nodes.
*/
- class ContextMenu : public widget {
+ class ContextMenu : public Widget {
public:
- ContextMenu(shape *, widget * father, int x, int y);
+ ContextMenu(Shape *, Widget * father, int x, int y);
virtual ~ContextMenu() throw (GeneralException);
void addnode(const String &, action *);
void addline();
@@ -298,12 +302,12 @@ namespace mogltk {
};
/*!
- The Menu widget will be display ontop of the father widget, and its
+ The Menu Widget will be display ontop of the father Widget, and its
submenus are simply sont ContextMenus.
*/
- class Menu : public widget {
+ class Menu : public Widget {
public:
- Menu(shape *, widget * father);
+ Menu(Shape *, Widget * father);
virtual ~Menu() throw (GeneralException) {}
void addnode(const String &, action *);
void addsub(const String &, ContextMenu * sub);
@@ -339,11 +343,11 @@ namespace mogltk {
};
/*!
- The InputText widget is used to do a simple input box on the screen.
+ The InputText Widget is used to do a simple input box on the screen.
*/
- class InputText : public widget {
+ class InputText : public Widget {
public:
- InputText(action *, shape *, widget * father, int x, int y);
+ InputText(action *, Shape *, Widget * father, int x, int y);
virtual ~InputText() throw (GeneralException);
virtual void draw();
const String & GetText() const;
@@ -374,30 +378,30 @@ namespace mogltk {
*/
class InputDialog : public SmartBox {
public:
- InputDialog(action *, shape *, widget * father, const String & caption, const String & text, mogltk::font * = mogltk::SystemFont);
+ InputDialog(action *, Shape *, Widget * father, const String & caption, const String & text, mogltk::Font * = mogltk::SystemFont);
virtual ~InputDialog() throw (GeneralException);
String GetText();
private:
InputText * it;
- mogltk::font * InputDialog_font;
+ mogltk::Font * InputDialog_font;
};
/*!
- The ActionAndDelete provides a mechanism for a widget to run an action then self-destruct.
+ The ActionAndDelete provides a mechanism for a Widget to run an action then self-destruct.
Used for example by the MsgBox and InputDialog.
*/
- class ActionAndDelete : public mogltk::widgets::action {
+ class ActionAndDelete : public mogltk::Widgets::action {
public:
- ActionAndDelete(mogltk::widget * _parent, mogltk::widgets::action * _a) : parent(_parent), a(_a) { }
- virtual void do_action(mogltk::widget *) {
+ ActionAndDelete(mogltk::Widget * _parent, mogltk::Widgets::action * _a) : parent(_parent), a(_a) { }
+ virtual void do_action(mogltk::Widget *) {
if (a)
a->do_action(parent);
parent->delete_me();
delete this;
}
private:
- mogltk::widget * parent;
- mogltk::widgets::action * a;
+ mogltk::Widget * parent;
+ mogltk::Widgets::action * a;
};
};
};