summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2004-07-17 10:08:16 +0000
committerpixel <pixel>2004-07-17 10:08:16 +0000
commitd2109565408c6be469642b5aafc2f2efe71a632f (patch)
treeda7d8be56755bbfbf77240b340a9add48448598a
parent14271a8d758c086e0762e7ad0d649dabc8848191 (diff)
Starting up Dalos
-rw-r--r--include/widgets.h4
-rw-r--r--lib/glbase.cc5
-rw-r--r--lib/widgets.cc13
3 files changed, 14 insertions, 8 deletions
diff --git a/include/widgets.h b/include/widgets.h
index 2eec009..7a919f4 100644
--- a/include/widgets.h
+++ b/include/widgets.h
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: widgets.h,v 1.5 2004-07-16 15:04:52 pixel Exp $ */
+/* $Id: widgets.h,v 1.6 2004-07-17 10:08:16 pixel Exp $ */
#ifndef __WIDGETS_H__
#define __WIDGETS_H__
@@ -230,6 +230,7 @@ namespace mogltk {
void addsub(const String &, ContextMenu * sub);
ContextMenu * createsub(const String &);
virtual void SetEnabled(int i, bool);
+ void SetCaption(int i, const String &);
protected:
virtual void resize_notify();
virtual void draw();
@@ -238,6 +239,7 @@ namespace mogltk {
public:
node(const String & caption, ContextMenu * sub, action * a, int x);
String GetCaption();
+ void SetCaption(const String &);
ContextMenu * GetSub();
action * GetAction();
int GetX();
diff --git a/lib/glbase.cc b/lib/glbase.cc
index a404f8e..cbb1927 100644
--- a/lib/glbase.cc
+++ b/lib/glbase.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: glbase.cc,v 1.19 2004-07-15 14:21:31 pixel Exp $ */
+/* $Id: glbase.cc,v 1.20 2004-07-17 10:08:16 pixel Exp $ */
#include <stdio.h>
#include <SDL.h>
@@ -71,9 +71,6 @@ mogltk::glbase::glbase(int w, int h, int flags) throw (GeneralException) : moglt
printm(M_INFO, String("Version : ") + (char *) glGetString(GL_VERSION) + "\n");
printm(M_INFO, String("Extensions: ") + (char *) glGetString(GL_EXTENSIONS) + "\n");
- Output e("ext.txt");
- e.write(glGetString(GL_EXTENSIONS), strlen((char *) glGetString(GL_EXTENSIONS)));
-
glViewport(0, 0, surface->w, surface->h);
glCullFace(GL_BACK);
diff --git a/lib/widgets.cc b/lib/widgets.cc
index 3298385..9d62bd9 100644
--- a/lib/widgets.cc
+++ b/lib/widgets.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: widgets.cc,v 1.7 2004-07-16 15:04:53 pixel Exp $ */
+/* $Id: widgets.cc,v 1.8 2004-07-17 10:08:16 pixel Exp $ */
#include <SDL.h>
#include <vector>
@@ -900,11 +900,10 @@ bool mogltk::widgets::ContextMenu::process_event(int xe, int ye, mogltk::event_t
action * a;
int n;
- selected = -1;
-
switch (event) {
case E_MOUSE_MOVE:
sticky = false;
+ selected = -1;
for (i = nodes.begin(), n = 0; i != nodes.end(); i++, n++) {
if (!i->GetLine()) {
int ax, ax2, ay, ay2;
@@ -985,6 +984,10 @@ String mogltk::widgets::Menu::node::GetCaption() {
return caption;
}
+void mogltk::widgets::Menu::node::SetCaption(const String & s) {
+ caption = s;
+}
+
mogltk::widgets::ContextMenu * mogltk::widgets::Menu::node::GetSub() {
return sub;
}
@@ -1037,6 +1040,10 @@ void mogltk::widgets::Menu::SetEnabled(int i, bool e) {
nodes[i].SetEnabled(e);
}
+void mogltk::widgets::Menu::SetCaption(int i, const String & s) {
+ nodes[i].SetCaption(s);
+}
+
void mogltk::widgets::Menu::draw(void) {
std::vector<node>::iterator i;
int n;