summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <syn@sceen.net>2006-05-26 16:17:04 +0000
committerRichard Braun <syn@sceen.net>2006-05-26 16:17:04 +0000
commit52e289674dea377a99c81eeba62bdc7c31c3d066 (patch)
treed4217e8bca3bdf61111ea0cf1b274eb23b94e845
parent385756310dbf3ff10f09bdd5a3c3ba222ff9942f (diff)
Began GUI implementation.
-rw-r--r--Makefile5
-rw-r--r--main_gui.cc5
-rw-r--r--mtxwindow.cc38
-rw-r--r--mtxwindow.h39
4 files changed, 84 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 77169f1..c17f9f6 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,8 @@ CPPFLAGS = -g -Wall $$(pkg-config gtkmm-2.0 --cflags) # -D USE_64BITS_WORDS
LIBS =
HEADERS = mtxinteger.h mtxrational.h mtxmatrix.h mtxexception.h \
mtxdivbyzeroexception.h mtxsingularmatrixexception.h \
- mtxvalue.h mtxsymbol.h mtxlanguage.h mtxexpression.h
+ mtxvalue.h mtxsymbol.h mtxlanguage.h mtxexpression.h \
+ mtxwindow.h
OBJECTS = mtxinteger.o mtxrational.o mtxmatrix.o \
mtxexception.o mtxdivbyzeroexception.o \
mtxsingularmatrixexception.o mtxvalue.o mtxsymbol.o \
@@ -16,7 +17,7 @@ CLI_OBJECTS = main_cli.o $(OBJECTS)
CLI_BINARY = mtx_cli
GUI_LIBS = $$(pkg-config gtkmm-2.0 --libs) $(LIBS)
-GUI_OBJECTS = main_gui.o $(OBJECTS)
+GUI_OBJECTS = main_gui.o mtxwindow.o $(OBJECTS)
GUI_BINARY = mtx_gui
BINARIES = $(CLI_BINARY) $(GUI_BINARY)
diff --git a/main_gui.cc b/main_gui.cc
index 2b8cb71..7017abb 100644
--- a/main_gui.cc
+++ b/main_gui.cc
@@ -21,13 +21,16 @@
#include <stdlib.h>
#include <gtkmm.h>
+#include "mtxwindow.h"
+
using namespace std;
int
main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
- Gtk::Window window;
+ MtxWindow window;
+
Gtk::Main::run(window);
return EXIT_SUCCESS;
}
diff --git a/mtxwindow.cc b/mtxwindow.cc
new file mode 100644
index 0000000..0efd195
--- /dev/null
+++ b/mtxwindow.cc
@@ -0,0 +1,38 @@
+/* $Id$ */
+
+/*
+ * Copyright (C) 2006 Richard Braun
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <iostream>
+
+#include "mtxwindow.h"
+
+MtxWindow::MtxWindow()
+{
+ set_border_width(0);
+ set_size_request(600, 600);
+ scrolled_window.add(text_view);
+ vbox.pack_start(scrolled_window);
+ vbox.pack_start(entry);
+ add(vbox);
+ show_all();
+}
+
+MtxWindow::~MtxWindow()
+{
+}
diff --git a/mtxwindow.h b/mtxwindow.h
new file mode 100644
index 0000000..9399bd5
--- /dev/null
+++ b/mtxwindow.h
@@ -0,0 +1,39 @@
+/* $Id$ */
+
+/*
+ * Copyright (C) 2006 Richard Braun
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _MTXWINDOW_H
+#define _MTXWINDOW_H
+
+#include <gtkmm.h>
+
+class MtxWindow: public Gtk::Window
+{
+ private:
+ Gtk::VBox vbox;
+ Gtk::ScrolledWindow scrolled_window;
+ Gtk::TextView text_view;
+ Gtk::Entry entry;
+
+ public:
+ MtxWindow();
+ virtual ~MtxWindow();
+};
+
+#endif /* _MTXWINDOW_H */