# HG changeset patch # User ladanyi # Date 1161798602 0 # Node ID 8339178ae43d8255ee05e175436adc712b43d3a3 # Parent fc1e478697d35ee4747765a62239357fe5f5aff8 Added two new classes. diff -r fc1e478697d3 -r 8339178ae43d Makefile.am --- a/Makefile.am Wed Oct 25 13:21:24 2006 +0000 +++ b/Makefile.am Wed Oct 25 17:50:02 2006 +0000 @@ -46,7 +46,11 @@ design_win.h \ design_win.cc \ dijkstrabox.h \ - dijkstrabox.cc + dijkstrabox.cc \ + file_chooser_extra_widget.h \ + file_chooser_extra_widget.cc \ + map_window.h \ + map_window.cc glemon_CXXFLAGS = $(GTK_CFLAGS) $(LEMON_CFLAGS) # glemon_LDFLAGS = $(GTK_LIBS) $(LEMON_LIBS) diff -r fc1e478697d3 -r 8339178ae43d file_chooser_extra_widget.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file_chooser_extra_widget.cc Wed Oct 25 17:50:02 2006 +0000 @@ -0,0 +1,46 @@ +#include "file_chooser_extra_widget.h" +#include "mapstorage.h" + +FileChooserExtraWidget::FileChooserExtraWidget(MapStorage* ms) : + Gtk::Expander("_Options", true), + lblGUIData("Save GUI specific data to:"), + rbGUISection("_GUI section", true), + rbConfFile("s_eparate .conf file", true) +{ + std::cout << "FileChooserExtraWidget()" << std::endl; + + Gtk::RadioButtonGroup group = rbGUISection.get_group(); + rbConfFile.set_group(group); + + /* + switch (pMapStorage->getGUIDataSaveLocation()) + { + case GUI_SECTION: + break; + case CONF_FILE: + break; + } + */ + + add(box); + box.pack_start(lblGUIData, Gtk::PACK_SHRINK); + box.pack_start(rbGUISection, Gtk::PACK_SHRINK); + box.pack_start(rbConfFile, Gtk::PACK_SHRINK); + + rbConfFile.signal_group_changed().connect( + sigc::mem_fun(*this, &FileChooserExtraWidget::onRbToggled)); + rbGUISection.signal_group_changed().connect( + sigc::mem_fun(*this, &FileChooserExtraWidget::onRbToggled)); + + show_all_children(); +} + +void FileChooserExtraWidget::onRbToggled() +{ + std::cout << "onRbToggled()" << std::endl; +} + +FileChooserExtraWidget::~FileChooserExtraWidget() +{ + std::cout << "~FileChooserExtraWidget()" << std::endl; +} diff -r fc1e478697d3 -r 8339178ae43d file_chooser_extra_widget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file_chooser_extra_widget.h Wed Oct 25 17:50:02 2006 +0000 @@ -0,0 +1,25 @@ +#ifndef FILE_CHOOSER_EXTRA_WIDGET +#define FILE_CHOOSER_EXTRA_WIDGET + +#include +#include +#include +#include + +class MapStorage; + +class FileChooserExtraWidget : public Gtk::Expander +{ + private: + Gtk::VBox box; + Gtk::Label lblGUIData; + Gtk::RadioButton rbGUISection; + Gtk::RadioButton rbConfFile; + MapStorage* pMapStorage; + void onRbToggled(); + public: + FileChooserExtraWidget(MapStorage* ms); + ~FileChooserExtraWidget(); +}; + +#endif diff -r fc1e478697d3 -r 8339178ae43d map_window.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/map_window.cc Wed Oct 25 17:50:02 2006 +0000 @@ -0,0 +1,24 @@ +#include "map_window.h" + +MapWindow::MapWindow() +{ + refMapStore = Gtk::ListStore::create(mapColumns); + //refMapStore->signal_row_changed().connect(sigc::mem_fun(*this, &Phy sicalProperties::onChannelChanged)); + twMap.set_model(refMapStore); + twMap.append_column_editable("Name", mapColumns.colName); + //twMap.append_column_editable("Value type", mapColumns.colValue); + //twMap.append_column_editable("Map type", mapColumns.colType); + + swMap.set_size_request(-1, 300); + swMap.add(twMap); + swMap.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + + swMap.add(twMap); + add(swMap); + + show_all_children(); +} + +MapWindow::~MapWindow() +{ +} diff -r fc1e478697d3 -r 8339178ae43d map_window.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/map_window.h Wed Oct 25 17:50:02 2006 +0000 @@ -0,0 +1,34 @@ +#ifndef MAP_WINDOW +#define MAP_WINDOW + +#include +#include +#include +#include +#include "mapstorage.h" + +class MapWindow : public Gtk::Window +{ + struct MapModelColumns : public Gtk::TreeModel::ColumnRecord + { + MapModelColumns() + { + add(colName); + add(colValue); + add(colType); + } + Gtk::TreeModelColumn colName; + Gtk::TreeModelColumn colValue; + Gtk::TreeModelColumn colType; + }; + private: + MapModelColumns mapColumns; + Glib::RefPtr refMapStore; + Gtk::TreeView twMap; + Gtk::ScrolledWindow swMap; + public: + MapWindow(); + ~MapWindow(); +}; + +#endif diff -r fc1e478697d3 -r 8339178ae43d mapstorage.h --- a/mapstorage.h Wed Oct 25 13:21:24 2006 +0000 +++ b/mapstorage.h Wed Oct 25 17:50:02 2006 +0000 @@ -23,6 +23,8 @@ class MapStorage { public: + enum value {DOUBLE, STRING}; + enum type {NORMAL, GUI}; ///The graph for which the datas are stored. Graph graph; diff -r fc1e478697d3 -r 8339178ae43d nbtab.cc --- a/nbtab.cc Wed Oct 25 13:21:24 2006 +0000 +++ b/nbtab.cc Wed Oct 25 17:50:02 2006 +0000 @@ -1,4 +1,5 @@ #include +#include "file_chooser_extra_widget.h" NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false) { @@ -117,6 +118,8 @@ Gtk::FileChooserDialog fcdialog("Save File", Gtk::FILE_CHOOSER_ACTION_SAVE); fcdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); fcdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); + FileChooserExtraWidget w(&mapstorage); + fcdialog.set_extra_widget(w); if (fcdialog.run() == Gtk::RESPONSE_ACCEPT) { Glib::ustring filename = fcdialog.get_filename();