[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/editor action_window.cxx,1.1,1.2 acti
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/editor action_window.cxx,1.1,1.2 action_window.hxx,1.1,1.2 editor.cxx,1.7,1.8 editor.hxx,1.2,1.3 editor_event.cxx,1.11,1.12 editor_event.hxx,1.4,1.5 panel.cxx,1.1,1.2 panel.hxx,1.2,1.3 panel_icons.cxx,1.1,1.2 panel_icons.hxx,1.2,1.3 |
Date: |
29 Jun 2002 09:44:58 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/editor
In directory dark:/tmp/cvs-serv3382/src/editor
Modified Files:
action_window.cxx action_window.hxx editor.cxx editor.hxx
editor_event.cxx editor_event.hxx panel.cxx panel.hxx
panel_icons.cxx panel_icons.hxx
Log Message:
some cleanup to the gui code
Index: action_window.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/action_window.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- action_window.cxx 28 Jun 2002 22:21:59 -0000 1.1
+++ action_window.cxx 29 Jun 2002 09:44:56 -0000 1.2
@@ -31,11 +31,11 @@
[ok] [cancel]
**********************/
-ActionWindow::ActionWindow (CL_Component* parent, std::vector<ActionData>*
arg_actions)
- : actions (arg_actions)
+ActionWindow::ActionWindow (CL_Component* arg_parent, std::vector<ActionData>*
arg_actions)
+ : parent (arg_parent), actions (arg_actions)
{
- window = new CL_Window (CL_Rect(200, 30,
- 400, (actions->size() * 30) + 30), "Pingus
Actions", parent);
+ window = new CL_Window (CL_Rect(0, 0,
+ 200, (actions->size() * 20) + 80), "Pingus
Actions", parent);
int y = 30;
for (std::vector<ActionData>::iterator i = actions->begin (); i !=
actions->end (); ++i)
@@ -44,12 +44,49 @@
labels.push_back(new CL_Label (CL_Point(10, y),
action_to_string(i->name), window));
y += 20;
}
+
+ y += 10;
+ ok_button = new CL_Button(CL_Rect (10, y, 90, y + 20), "Ok", window);
+ cancel_button = new CL_Button(CL_Rect (110, y, 190, y + 20), "Cancel",
window);
+
+ ok_button->sig_clicked ().connect (this, &ActionWindow::ok_clicked);
+ cancel_button->sig_clicked ().connect (this, &ActionWindow::cancel_clicked);
+
+ hide ();
}
void
-ActionWindow::on_close ()
+ActionWindow::show ()
+{
+ parent->add_child (window);
+}
+
+void
+ActionWindow::hide ()
+{
+ parent->remove_child (window);
+}
+
+void
+ActionWindow::ok_clicked ()
+{
+ std::cout << "OK Clicked" << std::endl;
+ sync_with_data ();
+ hide ();
+}
+
+void
+ActionWindow::cancel_clicked ()
+{
+ std::cout << "Cancel Clicked" << std::endl;
+ hide ();
+}
+
+void
+ActionWindow::sync_with_data ()
{
// Sync the level data with the data from the window
+ std::cout << "Syncing data" << std::endl;
}
/* EOF */
Index: action_window.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/action_window.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- action_window.hxx 28 Jun 2002 22:21:59 -0000 1.1
+++ action_window.hxx 29 Jun 2002 09:44:56 -0000 1.2
@@ -27,16 +27,25 @@
class ActionWindow
{
private:
+ CL_Component* parent;
std::vector<ActionData>* actions;
CL_Window* window;
std::vector<CL_InputBox*> inputs;
std::vector<CL_Label*> labels;
+ CL_Button* ok_button;
+ CL_Button* cancel_button;
+
public:
ActionWindow (CL_Component* parent, std::vector<ActionData>*);
+ void ok_clicked ();
+ void cancel_clicked ();
+
+ void show ();
+ void hide ();
private:
- void on_close ();
+ void sync_with_data ();
};
#endif
Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- editor.cxx 28 Jun 2002 22:21:59 -0000 1.7
+++ editor.cxx 29 Jun 2002 09:44:56 -0000 1.8
@@ -69,6 +69,15 @@
object_manager = new ObjectManager;
status_line = new StatusLine;
object_selector = new ObjectSelector;
+
+ // FIXME: Should use PingusResource, Memleak
+ CL_ResourceManager* gui_resources = new
CL_ResourceManager("../data/data/gui.scr", false);
+
+ style_manager = new CL_StyleManager_Default (gui_resources);
+ gui = new CL_GUIManager (style_manager);
+
+ action_window = new ActionWindow (gui, object_manager->get_actions ());
+
view = new EditorView (0, 0, CL_Display::get_width (),
CL_Display::get_height (), 0, 0);
event->set_editor(this);
@@ -142,16 +151,6 @@
Display::show_cursor();
register_event_handler();
-
- CL_StyleManager_Default* style_manager;
- CL_GUIManager* gui;
-
- CL_ResourceManager gui_resources("../data/data/gui.scr", false);
-
- style_manager = new CL_StyleManager_Default (&gui_resources);
- gui = new CL_GUIManager (style_manager);
-
- ActionWindow window (gui, object_manager->get_actions ());
while (!quit)
{
Index: editor.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- editor.hxx 24 Jun 2002 22:52:58 -0000 1.2
+++ editor.hxx 29 Jun 2002 09:44:56 -0000 1.3
@@ -33,6 +33,9 @@
class ObjectManager;
class ObjectSelector;
class StatusLine;
+class ActionWindow;
+class CL_StyleManager_Default;
+class CL_GUIManager;
class Editor
{
@@ -64,6 +67,12 @@
StatusLine* status_line;
ObjectSelector* object_selector;
+ // GUI Stuff
+ CL_StyleManager_Default* style_manager;
+ CL_GUIManager* gui;
+
+ ActionWindow* action_window;
+
enum { SELECTOR_TOOL, ZOOM_TOOL } tool;
static Editor* instance_;
Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- editor_event.cxx 26 Jun 2002 09:29:48 -0000 1.11
+++ editor_event.cxx 29 Jun 2002 09:44:56 -0000 1.12
@@ -43,6 +43,7 @@
#include "panel.hxx"
#include "object_selector.hxx"
#include "editor.hxx"
+#include "action_window.hxx"
EditorEvent::EditorEvent()
: is_enabled (0)
@@ -820,6 +821,12 @@
{
(*i)->rotate_270 ();
}
+}
+
+void
+EditorEvent::editor_show_actions_window ()
+{
+ editor->action_window->show ();
}
/* EOF */
Index: editor_event.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- editor_event.hxx 25 Jun 2002 21:31:40 -0000 1.4
+++ editor_event.hxx 29 Jun 2002 09:44:56 -0000 1.5
@@ -75,6 +75,8 @@
void editor_export_object_group_from_selection ();
void editor_import_object_group ();
+ void editor_show_actions_window ();
+
/** Decrease the owner number or another value specific to the
current object */
void editor_increase_count ();
Index: panel.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/panel.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- panel.cxx 12 Jun 2002 19:11:31 -0000 1.1
+++ panel.cxx 29 Jun 2002 09:44:56 -0000 1.2
@@ -127,6 +127,8 @@
buttons.push_back(new PanelIconZoomIn ());
buttons.push_back(new PanelIconZoomOut ());
+ buttons.push_back(new PanelIconSetupActions());
+
buttons.push_back(new PanelIconRun);
buttons.push_back(new PanelIconExit);
Index: panel.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/panel.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- panel.hxx 24 Jun 2002 22:52:58 -0000 1.2
+++ panel.hxx 29 Jun 2002 09:44:56 -0000 1.3
@@ -32,67 +32,41 @@
{
protected:
CL_Font* font;
- ///
CL_Surface sur;
- ///
CL_Surface button;
- ///
CL_Surface button_pressed;
- ///
std::string tooltip;
- ///
unsigned int mouse_over_time;
public:
- ///
static Editor* editor;
- ///
PanelIcon();
- ///
virtual ~PanelIcon();
- ///
+
void start();
- ///
void put_screen(int x, int y);
- ///
virtual void on_click();
-}///
-;
+};
-///
class Panel
{
private:
- ///
bool is_init;
- ///
std::vector<PanelIcon*> buttons;
- ///
std::vector<PanelIcon*>::iterator pressed_button;
- ///
Editor* editor;
- ///
CL_Surface logo;
public:
- ///
Panel();
- ///
~Panel();
- ///
void draw();
- ///
void init();
- ///
void on_click();
- ///
void on_release();
- ///
bool mouse_over(int x, int y);
- ///
void set_editor(Editor* e);
-}///
-;
+};
#endif
Index: panel_icons.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/panel_icons.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- panel_icons.cxx 12 Jun 2002 19:11:31 -0000 1.1
+++ panel_icons.cxx 29 Jun 2002 09:44:56 -0000 1.2
@@ -182,4 +182,16 @@
editor->get_event ()->editor_zoom_out ();
}
+PanelIconSetupActions::PanelIconSetupActions ()
+{
+ tooltip = _("Setup Number of Actions");
+ sur = PingusResource::load_surface("editor/actions", "core");
+}
+
+void
+PanelIconSetupActions::on_click()
+{
+ editor->get_event()->editor_show_actions_window ();
+}
+
/* EOF */
Index: panel_icons.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/panel_icons.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- panel_icons.hxx 24 Jun 2002 22:52:58 -0000 1.2
+++ panel_icons.hxx 29 Jun 2002 09:44:56 -0000 1.3
@@ -22,147 +22,110 @@
#include "panel.hxx"
-///
class PanelIconNew : public PanelIcon
{
public:
- ///
PanelIconNew();
- ///
virtual void on_click();
};
-///
class PanelIconLoad : public PanelIcon
{
public:
- ///
PanelIconLoad();
- ///
virtual void on_click();
};
-///
class PanelIconSave : public PanelIcon
{
public:
- ///
PanelIconSave();
- ///
virtual void on_click();
};
-///
class PanelIconCopy : public PanelIcon
{
public:
- ///
PanelIconCopy();
- ///
virtual void on_click();
-}///
-;
+};
-///
class PanelIconPaste : public PanelIcon
{
public:
- ///
PanelIconPaste();
- ///
virtual void on_click();
-}///
-;
+};
-///
class PanelIconEdit : public PanelIcon
{
public:
- ///
PanelIconEdit();
- ///
virtual void on_click();
-}///
-;
+};
-///
class PanelIconPreferences : public PanelIcon
{
public:
- ///
PanelIconPreferences();
- ///
virtual void on_click();
-}///
-;
+};
-///
class PanelIconDelete : public PanelIcon
{
public:
- ///
PanelIconDelete();
- ///
virtual void on_click();
};
-///
class PanelIconExit : public PanelIcon
{
public:
- ///
PanelIconExit();
- ///
virtual void on_click();
};
-///
class PanelIconRun : public PanelIcon
{
public:
- ///
PanelIconRun();
- ///
virtual void on_click();
};
-///
class PanelIconInsertObject : public PanelIcon
{
public:
- ///
PanelIconInsertObject();
- ///
virtual void on_click();
};
class PanelIconZoomOut : public PanelIcon
{
public:
- ///
PanelIconZoomOut();
- ///
virtual void on_click();
};
class PanelIconZoomIn : public PanelIcon
{
public:
- ///
PanelIconZoomIn();
- ///
virtual void on_click();
};
class PanelIconRegionZoom : public PanelIcon
{
public:
- ///
PanelIconRegionZoom();
- ///
virtual void on_click();
};
+class PanelIconSetupActions : public PanelIcon
+{
+public:
+ PanelIconSetupActions ();
+ virtual void on_click();
+};
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/editor action_window.cxx,1.1,1.2 action_window.hxx,1.1,1.2 editor.cxx,1.7,1.8 editor.hxx,1.2,1.3 editor_event.cxx,1.11,1.12 editor_event.hxx,1.4,1.5 panel.cxx,1.1,1.2 panel.hxx,1.2,1.3 panel_icons.cxx,1.1,1.2 panel_icons.hxx,1.2,1.3,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/data/data core.scr,1.17,1.18 editor.scr,1.9,1.10
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/backgrounds surface_background_data.hxx,1.4,1.5
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/data/data core.scr,1.17,1.18 editor.scr,1.9,1.10
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/backgrounds surface_background_data.hxx,1.4,1.5
- Index(es):