[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit cfg_data.cc,1.5,1.6
From: |
Kai Sterker <address@hidden> |
Subject: |
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit cfg_data.cc,1.5,1.6 cfg_data.h,1.4,1.5 dlg_cmdline.cc,1.7,1.8 dlg_module.cc,1.15,1.16 dlg_module.h,1.14,1.15 dlg_module_entry.cc,1.5,1.6 dlg_types.h,1.9,1.10 gui_dlgedit.cc,1.14,1.15 gui_dlgedit.h,1.10,1.11 gui_graph.cc,1.11,1.12 gui_resources.cc,1.3,1.4 gui_settings.cc,1.9,1.10 gui_tree.cc,1.3,1.4 gui_tree.h,1.2,1.3 |
Date: |
Mon, 05 May 2003 14:50:32 -0400 |
Update of /cvsroot/adonthell/adonthell/src/tools/dlgedit
In directory subversions:/tmp/cvs-serv4603
Modified Files:
cfg_data.cc cfg_data.h dlg_cmdline.cc dlg_module.cc
dlg_module.h dlg_module_entry.cc dlg_types.h gui_dlgedit.cc
gui_dlgedit.h gui_graph.cc gui_resources.cc gui_settings.cc
gui_tree.cc gui_tree.h
Log Message:
IMPROVED GuiTree functionality (list all open dialogues sorted by project)
Index: cfg_data.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/cfg_data.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** cfg_data.cc 26 Oct 2002 22:19:44 -0000 1.5
--- cfg_data.cc 5 May 2003 18:50:29 -0000 1.6
***************
*** 22,26 ****
--- 22,29 ----
#include <stdio.h>
#include <algorithm>
+ #include <sys/stat.h>
+ #include <dirent.h>
#include "cfg_data.h"
+ #include "dlg_cmdline.h"
/**
***************
*** 47,51 ****
// add entry to list of recently opened files
! void CfgData::addFile (std::string &file)
{
// check whether the file already exists
--- 50,54 ----
// add entry to list of recently opened files
! void CfgData::addFile (const std::string &file)
{
// check whether the file already exists
***************
*** 90,94 ****
// add entry to list of projects
! void CfgData::addProject (std::string &project)
{
std::vector<CfgProject*>::iterator i;
--- 93,97 ----
// add entry to list of projects
! void CfgData::addProject (const std::string &project)
{
std::vector<CfgProject*>::iterator i;
***************
*** 142,145 ****
--- 145,186 ----
p->setBasedir (basedir);
Projects.push_back (p);
+ }
+
+ // return list of projects available in given data directory
+ std::vector<std::string> CfgData::projectsFromDatadir ()
+ {
+ struct dirent * d;
+ struct stat statbuf;
+ DIR *mydir = opendir (DlgCmdline::datadir.c_str());
+ std::string name, filename, path = DlgCmdline::datadir + "/";
+ std::vector<std::string> projects;
+
+ // default project
+ projects.push_back (string ("none"));
+
+ // no such directory
+ if (!mydir) return projects;
+
+ // get all directories inside
+ while ((d = readdir (mydir)) != NULL)
+ {
+ name = d->d_name;
+ filename = path + name;
+
+ // ignore '.' and '..' directories
+ if (name != "." && name != "..")
+ {
+ stat (filename.c_str (), &statbuf);
+
+ // fill vector with valid entries
+ if (S_ISDIR (statbuf.st_mode))
+ projects.push_back (name);
+ }
+ }
+
+ // cleanup
+ closedir (mydir);
+
+ return projects;
}
Index: cfg_data.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/cfg_data.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** cfg_data.h 26 Oct 2002 22:19:44 -0000 1.4
--- cfg_data.h 5 May 2003 18:50:29 -0000 1.5
***************
*** 56,60 ****
* @param file full path/name of the file to add.
*/
! void addFile (std::string & file);
/**
* Get the list of files, sorted alphabetically.
--- 56,60 ----
* @param file full path/name of the file to add.
*/
! void addFile (const std::string & file);
/**
* Get the list of files, sorted alphabetically.
***************
*** 73,78 ****
* @param project name of the project to add.
*/
! void addProject (std::string & project);
!
/**
* Assign a (new) base directory to the given project. If no
--- 73,84 ----
* @param project name of the project to add.
*/
! void addProject (const std::string & project);
! /**
! * Return the names of all projects in the current data directory.
! * This list also includes the default project 'none', so it is
! * non-empty even if the data directory contains no projects yet.
! */
! std::vector<std::string> projectsFromDatadir ();
!
/**
* Assign a (new) base directory to the given project. If no
Index: dlg_cmdline.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_cmdline.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** dlg_cmdline.cc 27 Dec 2002 21:54:20 -0000 1.7
--- dlg_cmdline.cc 5 May 2003 18:50:29 -0000 1.8
***************
*** 32,36 ****
// the default project
! std::string DlgCmdline::project = "";
// index of the first dialgoue source in argv[]
--- 32,36 ----
// the default project
! std::string DlgCmdline::project = "none";
// index of the first dialgoue source in argv[]
Index: dlg_module.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** dlg_module.cc 1 Jan 2003 20:47:18 -0000 1.15
--- dlg_module.cc 5 May 2003 18:50:29 -0000 1.16
***************
*** 38,41 ****
--- 38,47 ----
}
+ // dtor
+ DlgModule::~DlgModule ()
+ {
+ GuiDlgedit::window->tree ()->removeModule (this);
+ }
+
// initialize a newly constructed DlgModule
void DlgModule::init ()
***************
*** 248,251 ****
--- 254,269 ----
}
+ // indicate that this module has been modified by the user
+ void DlgModule::setChanged (bool changed)
+ {
+ if (changed_ != changed)
+ {
+ changed_ = changed;
+
+ // updated view
+ GuiDlgedit::window->setChanged ();
+ }
+ }
+
// draw the module
void DlgModule::draw (GdkPixmap *surface, DlgPoint &offset, GtkWidget *widget)
***************
*** 475,479 ****
// update path and name
path_ = path + "/";
! name_ = name;
// open file
--- 493,501 ----
// update path and name
path_ = path + "/";
! if (name_ != name)
! {
! name_ = name;
! changed_ = true;
! }
// open file
***************
*** 486,490 ****
out << "# Dlgedit File Format 2\n#\n"
<< "# Produced by Adonthell Dlgedit v" << _VERSION_ << "\n"
! << "# (C) 2000/2001/2002 Kai Sterker\n#\n"
<< "# $I" << "d$\n\n"
<< "Note §" << entry_.description () << "§\n\n";
--- 508,512 ----
out << "# Dlgedit File Format 2\n#\n"
<< "# Produced by Adonthell Dlgedit v" << _VERSION_ << "\n"
! << "# (C) 2000/2001/2002/2003 The Adonthell Team & Kai Sterker\n#\n"
<< "# $I" << "d$\n\n"
<< "Note §" << entry_.description () << "§\n\n";
***************
*** 494,498 ****
// Save settings and stuff
! if (entry_.project () != "")
out << "Proj §" << entry_.project () << "§\n";
--- 516,520 ----
// Save settings and stuff
! if (entry_.project () != "none")
out << "Proj §" << entry_.project () << "§\n";
***************
*** 520,526 ****
// mark dialogue as unchanged
! changed_ = false;
! return true;
}
--- 542,548 ----
// mark dialogue as unchanged
! setChanged (false);
! return true;
}
Index: dlg_module.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** dlg_module.h 1 Jan 2003 19:26:10 -0000 1.14
--- dlg_module.h 5 May 2003 18:50:29 -0000 1.15
***************
*** 2,6 ****
$Id$
! Copyright (C) 2002 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 2002/2003 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 46,49 ****
--- 46,54 ----
/**
+ * Delete a subdialogue.
+ */
+ ~DlgModule ();
+
+ /**
* Reset the dialogue to its state after construction. Deletes all
* nodes and clears the DlgModuleEntry.
***************
*** 313,317 ****
* @param c Set to \b true to mark the dialogue as changed.
*/
! void setChanged (bool c = true) { changed_ = c; }
/**
--- 318,322 ----
* @param c Set to \b true to mark the dialogue as changed.
*/
! void setChanged (bool c = true);
/**
Index: dlg_module_entry.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module_entry.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** dlg_module_entry.cc 26 Oct 2002 22:19:44 -0000 1.5
--- dlg_module_entry.cc 5 May 2003 18:50:29 -0000 1.6
***************
*** 36,40 ****
void DlgModuleEntry::init ()
{
! project_ = "";
imports_ = "";
ctor_ = "";
--- 36,40 ----
void DlgModuleEntry::init ()
{
! project_ = "none";
imports_ = "";
ctor_ = "";
***************
*** 69,74 ****
quests.clear ();
! retval &= loadCharacters ();
! retval &= loadQuests ();
}
--- 69,77 ----
quests.clear ();
! if (p != "none")
! {
! retval &= loadCharacters ();
! retval &= loadQuests ();
! }
}
Index: dlg_types.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_types.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** dlg_types.h 10 Jan 2003 20:22:49 -0000 1.9
--- dlg_types.h 5 May 2003 18:50:29 -0000 1.10
***************
*** 73,77 ****
GC_DARK_GREEN = 5,
GC_GREEN = 6,
! GC_BRIGHT_GREEN = 7,
GC_DARK_BLUE = 8,
GC_BLUE = 9,
--- 73,77 ----
GC_DARK_GREEN = 5,
GC_GREEN = 6,
! GC_ORANGE = 7,
GC_DARK_BLUE = 8,
GC_BLUE = 9,
Index: gui_dlgedit.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_dlgedit.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** gui_dlgedit.cc 1 Jan 2003 20:47:18 -0000 1.14
--- gui_dlgedit.cc 5 May 2003 18:50:29 -0000 1.15
***************
*** 341,344 ****
--- 341,346 ----
gtk_window_add_accel_group (GTK_WINDOW (wnd), accel_group);
+ gtk_widget_realize (wnd);
+
// Tree
tree_ = new GuiTree (hpaned);
***************
*** 423,430 ****
// load a new dialogue
! void GuiDlgedit::loadDialogue (std::string file)
{
// make sure that file has an absolute path
! if (file[0] != '/') file = directory_ + std::string ("/") + file;
// test if we have a valid dialogue
--- 425,432 ----
// load a new dialogue
! void GuiDlgedit::loadDialogue (const std::string &f)
{
// make sure that file has an absolute path
! std::string file = (f[0] == '/' ? f : directory_ + std::string ("/") + f);
// test if we have a valid dialogue
***************
*** 466,470 ****
initRecentFiles ();
! message->display (200);
showDialogue (module, true);
}
--- 468,472 ----
initRecentFiles ();
! message->display (200);
showDialogue (module, true);
}
***************
*** 472,476 ****
// load a sub-dialogue
! DlgModule* GuiDlgedit::loadSubdialogue (std::string file)
{
// test if we have a valid dialogue
--- 474,478 ----
// load a sub-dialogue
! DlgModule* GuiDlgedit::loadSubdialogue (const std::string &file)
{
// test if we have a valid dialogue
***************
*** 532,541 ****
// redisplay
graph_->detachModule ();
! tree_->display (module);
graph_->attachModule (module);
}
// save a dialogue
! void GuiDlgedit::saveDialogue (std::string file)
{
DlgModule *module = graph_->dialogue ();
--- 534,543 ----
// redisplay
graph_->detachModule ();
! tree_->updateModule (module);
graph_->attachModule (module);
}
// save a dialogue
! void GuiDlgedit::saveDialogue (const std::string &file)
{
DlgModule *module = graph_->dialogue ();
***************
*** 567,571 ****
// update the dialogue's name in case it has changed
! initTitle ();
initMenu ();
}
--- 569,573 ----
// update the dialogue's name in case it has changed
! tree_->setName (module);
initMenu ();
}
***************
*** 587,593 ****
graph_->detachModule ();
- // clear the module structure
- tree_->clear ();
-
// if another dialogue is open, display that one
if (dialogues_.size () > 0) showDialogue (dialogues_.front ());
--- 589,592 ----
***************
*** 615,619 ****
// the sub-dialogue of 'module' that has been viewed before. In that
// case, 'module' must not be attached, as it is the toplevel dialogue.
! tree_->display (module);
// attach the dialogue to the view
--- 614,618 ----
// the sub-dialogue of 'module' that has been viewed before. In that
// case, 'module' must not be attached, as it is the toplevel dialogue.
! tree_->addModule (module);
// attach the dialogue to the view
***************
*** 671,674 ****
--- 670,674 ----
// otherwise just show it
+ std::string project = module->entry ()->project ();
GuiSettings::dialog->display (module->entry (), module->shortName ());
}
***************
*** 689,693 ****
// preview the translated dialogue
! void GuiDlgedit::previewTranslation (std::string catalogue)
{
DlgModule *module = graph_->dialogue ();
--- 689,693 ----
// preview the translated dialogue
! void GuiDlgedit::previewTranslation (const std::string &catalogue)
{
DlgModule *module = graph_->dialogue ();
***************
*** 799,803 ****
}
! bool GuiDlgedit::checkDialogue (std::string file)
{
// first, open the file
--- 799,818 ----
}
! void GuiDlgedit::setChanged ()
! {
! // update tree
! tree_->setChanged (graph_->dialogue ());
!
! // update title bar
! initTitle ();
! }
!
! void GuiDlgedit::updateProject ()
! {
! // update tree
! tree_->updateProject (graph_->dialogue ());
! }
!
! bool GuiDlgedit::checkDialogue (const std::string &file)
{
// first, open the file
***************
*** 858,864 ****
if (module != NULL)
! title = g_strjoin (NULL, title, " - [",
module->shortName ().c_str (), "]", NULL);
!
gtk_window_set_title (GTK_WINDOW (wnd), title);
}
--- 873,884 ----
if (module != NULL)
! {
! if (module->changed ())
! title = g_strjoin (NULL, title, " - [",
! module->shortName ().c_str (), " (modified)]", NULL);
! else
! title = g_strjoin (NULL, title, " - [",
module->shortName ().c_str (), "]", NULL);
! }
gtk_window_set_title (GTK_WINDOW (wnd), title);
}
Index: gui_dlgedit.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_dlgedit.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** gui_dlgedit.h 2 Nov 2002 18:40:02 -0000 1.10
--- gui_dlgedit.h 5 May 2003 18:50:29 -0000 1.11
***************
*** 2,6 ****
$Id$
! Copyright (C) 2002 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 2002/2003 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 101,105 ****
* @param file Filename (and path) of the dialogue to load.
*/
! void loadDialogue (std::string file);
/**
* Load a sub-dialogue from a file. Sub-dialogues are not
--- 101,105 ----
* @param file Filename (and path) of the dialogue to load.
*/
! void loadDialogue (const std::string &file);
/**
* Load a sub-dialogue from a file. Sub-dialogues are not
***************
*** 109,118 ****
* @return the sub-dialogue, or \b NULL if loading failed.
*/
! DlgModule* loadSubdialogue (std::string file);
/**
* Save a dialogue to file
* @param file Filename (and path) of the dialogue to load.
*/
! void saveDialogue (std::string file);
/**
* Reload dialogue from disk if possible. This discards all
--- 109,118 ----
* @return the sub-dialogue, or \b NULL if loading failed.
*/
! DlgModule* loadSubdialogue (const std::string &file);
/**
* Save a dialogue to file
* @param file Filename (and path) of the dialogue to load.
*/
! void saveDialogue (const std::string &file);
/**
* Reload dialogue from disk if possible. This discards all
***************
*** 139,143 ****
* @return <b>true</b> if the dialogue is valid, <b>false</b> otherwise.
*/
! static bool checkDialogue (std::string file);
/**
* Edit the custom code of the current module.
--- 139,143 ----
* @return <b>true</b> if the dialogue is valid, <b>false</b> otherwise.
*/
! static bool checkDialogue (const std::string &file);
/**
* Edit the custom code of the current module.
***************
*** 153,162 ****
* (.mo) file
*/
! void previewTranslation (std::string catalogue);
/**
* stop translation preview
*/
void exitPreview ();
!
/**
* Get the directory where the last fileselection took place.
--- 153,169 ----
* (.mo) file
*/
! void previewTranslation (const std::string &catalogue);
/**
* stop translation preview
*/
void exitPreview ();
! /**
! * Indicate that the active dialogue has been changed by the user
! */
! void setChanged ();
! /**
! * Indicate that the acive dialogue has been assigned to a new project.
! */
! void updateProject ();
/**
* Get the directory where the last fileselection took place.
Index: gui_graph.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_graph.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** gui_graph.cc 9 Nov 2002 21:47:02 -0000 1.11
--- gui_graph.cc 5 May 2003 18:50:29 -0000 1.12
***************
*** 37,40 ****
--- 37,41 ----
offset = NULL;
surface = NULL;
+ tooltip = NULL;
scrolling = false;
Index: gui_resources.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_resources.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** gui_resources.cc 10 Jan 2003 20:22:49 -0000 1.3
--- gui_resources.cc 5 May 2003 18:50:29 -0000 1.4
***************
*** 60,72 ****
gdk_gc_set_foreground (Color[GC_WHITE], &c);
! // Grey
Color[GC_GREY] = gdk_gc_new (window);
! c.red = 50000;
! c.green = 50000;
! c.blue = 50000;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_GREY], &c);
! // Dark Red
Color[GC_DARK_RED] = gdk_gc_new (window);
c.red = 65535;
--- 60,72 ----
gdk_gc_set_foreground (Color[GC_WHITE], &c);
! // Grey (for NPC node background)
Color[GC_GREY] = gdk_gc_new (window);
! c.red = 55000;
! c.green = 55000;
! c.blue = 55000;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_GREY], &c);
! // Dark Red (for selected nodes)
Color[GC_DARK_RED] = gdk_gc_new (window);
c.red = 65535;
***************
*** 84,96 ****
gdk_gc_set_foreground (Color[GC_RED], &c);
! // Green
Color[GC_GREEN] = gdk_gc_new (window);
! c.red = 39680;
c.green = 65355;
! c.blue = 45900;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_GREEN], &c);
! // Dark Green
Color[GC_DARK_GREEN] = gdk_gc_new (window);
c.red = 0;
--- 84,96 ----
gdk_gc_set_foreground (Color[GC_RED], &c);
! // Green (for narrator node background)
Color[GC_GREEN] = gdk_gc_new (window);
! c.red = 51117;
c.green = 65355;
! c.blue = 48496;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
gdk_gc_set_foreground (Color[GC_GREEN], &c);
! // Dark Green (for narrator nodes)
Color[GC_DARK_GREEN] = gdk_gc_new (window);
c.red = 0;
***************
*** 100,112 ****
gdk_gc_set_foreground (Color[GC_DARK_GREEN], &c);
! // Bright Green
! Color[GC_BRIGHT_GREEN] = gdk_gc_new (window);
! c.red = 0;
! c.green = 47616;
! c.blue = 1536;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_BRIGHT_GREEN], &c);
! // Dark Blue
Color[GC_DARK_BLUE] = gdk_gc_new (window);
c.red = 0;
--- 100,112 ----
gdk_gc_set_foreground (Color[GC_DARK_GREEN], &c);
! // Orange (for highlighting nodes)
! Color[GC_ORANGE] = gdk_gc_new (window);
! c.red = 62258;
! c.green = 43253;
! c.blue = 9175;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
! gdk_gc_set_foreground (Color[GC_ORANGE], &c);
! // Dark Blue (for player nodes)
Color[GC_DARK_BLUE] = gdk_gc_new (window);
c.red = 0;
***************
*** 116,123 ****
gdk_gc_set_foreground (Color[GC_DARK_BLUE], &c);
! // Blue - like the sky
Color[GC_BLUE] = gdk_gc_new (window);
! c.red = 32768;
! c.green = 58112;
c.blue = 65535;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
--- 116,123 ----
gdk_gc_set_foreground (Color[GC_DARK_BLUE], &c);
! // Blue - like the sky (for player node background)
Color[GC_BLUE] = gdk_gc_new (window);
! c.red = 48496;
! c.green = 50461;
c.blue = 65535;
gdk_colormap_alloc_color (colormap, &c, TRUE, TRUE);
***************
*** 151,155 ****
case NODE_SELECTED:
{
! return Color[GC_DARK_RED];
}
--- 151,155 ----
case NODE_SELECTED:
{
! return Color[GC_DARK_RED];
}
***************
*** 157,161 ****
case NODE_HILIGHTED:
{
! return Color[GC_BRIGHT_GREEN];
}
--- 157,161 ----
case NODE_HILIGHTED:
{
! return Color[GC_ORANGE];
}
***************
*** 175,186 ****
{
case PLAYER:
! return Color[GC_BLUE];
case NPC:
! return Color[GC_GREY];
case NARRATOR:
! return Color[GC_GREEN];
// unknown
default:
! return Color[GC_BLACK];
}
--- 175,186 ----
{
case PLAYER:
! return Color[GC_BLUE];
case NPC:
! return Color[GC_GREY];
case NARRATOR:
! return Color[GC_GREEN];
// unknown
default:
! return Color[GC_WHITE];
}
Index: gui_settings.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_settings.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** gui_settings.cc 26 Oct 2002 22:44:51 -0000 1.9
--- gui_settings.cc 5 May 2003 18:50:29 -0000 1.10
***************
*** 2,6 ****
$Id$
! Copyright (C) 2002 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 2002/2003 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 22,29 ****
#include <gtk/gtk.h>
#include <sys/stat.h>
! #include <dirent.h>
! #include <iostream>
#include "cfg_data.h"
- #include "dlg_cmdline.h"
#include "gui_file.h"
#include "gui_dlgedit.h"
--- 22,27 ----
#include <gtk/gtk.h>
#include <sys/stat.h>
! #include <vector>
#include "cfg_data.h"
#include "gui_file.h"
#include "gui_dlgedit.h"
***************
*** 300,305 ****
// display the contents of the module
setProject (entry->project ());
! setDescription (entry->description());
!
}
--- 298,302 ----
// display the contents of the module
setProject (entry->project ());
! setDescription (entry->description());
}
***************
*** 317,322 ****
// project
std::string project = getProject ();
! if (project != "none" && !entry->setProject (project))
! std::cout << "Loading quests/characters failed!\n";
// description
--- 314,325 ----
// project
std::string project = getProject ();
!
! // if project changed, update tree
! if (project != entry->project ())
! {
! if (!entry->setProject (project))
! std::cout << "Loading quests/characters failed!\n";
! GuiDlgedit::window->updateProject ();
! }
// description
***************
*** 366,384 ****
}
! if (label != "")
! {
! // that project is not available yet, so add it
! GtkWidget *menuitem = gtk_menu_item_new_with_label (label.c_str ());
! gtk_object_set_user_data (GTK_OBJECT (menuitem), (void *) strdup
(label.c_str ()));
! gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (on_project_changed), (gpointer) this);
! gtk_widget_show (menuitem);
! gtk_menu_insert (GTK_MENU (m), menuitem, 0);
! gtk_option_menu_set_history (GTK_OPTION_MENU (project), 0);
! // update base directory
! setBasedir (label);
! }
! else setProject ("none");
}
--- 369,383 ----
}
! // that project is not available yet, so add it
! GtkWidget *menuitem = gtk_menu_item_new_with_label (label.c_str ());
! gtk_object_set_user_data (GTK_OBJECT (menuitem), (void *) strdup
(label.c_str ()));
! gtk_signal_connect (GTK_OBJECT (menuitem), "activate", GTK_SIGNAL_FUNC
(on_project_changed), (gpointer) this);
! gtk_widget_show (menuitem);
! gtk_menu_insert (GTK_MENU (m), menuitem, 0);
! gtk_option_menu_set_history (GTK_OPTION_MENU (project), 0);
! // update base directory
! setBasedir (label);
}
***************
*** 430,477 ****
void GuiSettings::populateProjects (GtkWidget *menu)
{
- struct dirent * d;
- struct stat statbuf;
GtkWidget *menuitem;
! DIR * mydir = opendir (DlgCmdline::datadir.c_str());
! std::string name, filename, path = DlgCmdline::datadir + "/";
!
! // project 'none'
! menuitem = gtk_menu_item_new_with_label ("none");
! gtk_object_set_user_data (GTK_OBJECT (menuitem), (void *) "none");
! gtk_signal_connect (GTK_OBJECT (menuitem), "activate", GTK_SIGNAL_FUNC
(on_project_changed), (gpointer) this);
! gtk_widget_show (menuitem);
! gtk_menu_append (GTK_MENU (menu), menuitem);
!
! // no such directory
! if (!mydir) return;
! // get all directories inside
! while ((d = readdir (mydir)) != NULL)
{
! name = d->d_name;
! filename = path + name;
!
! // ignore '.' and '..' directories
! if (name != "." && name != "..")
! {
! stat (filename.c_str (), &statbuf);
!
! // fill list with valid entries
! if (S_ISDIR (statbuf.st_mode))
! {
! menuitem = gtk_menu_item_new_with_label (name.c_str ());
! gtk_object_set_user_data (GTK_OBJECT (menuitem), (void *)
strdup (name.c_str ()));
! gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (on_project_changed), (gpointer) this);
! gtk_widget_show (menuitem);
! gtk_menu_append (GTK_MENU (menu), menuitem);
! }
! }
}
// finally append menu to drop-down list
gtk_option_menu_set_menu (GTK_OPTION_MENU (project), menu);
-
- // cleanup
- closedir (mydir);
}
--- 429,447 ----
void GuiSettings::populateProjects (GtkWidget *menu)
{
GtkWidget *menuitem;
! std::vector<std::string> projects = CfgData::data->projectsFromDatadir ();
! std::vector<std::string>::iterator i;
! for (i = projects.begin (); i != projects.end (); i++)
{
! menuitem = gtk_menu_item_new_with_label ((*i).c_str ());
! gtk_object_set_user_data (GTK_OBJECT (menuitem), (void *) strdup
((*i).c_str ()));
! gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (on_project_changed), (gpointer) this);
! gtk_widget_show (menuitem);
! gtk_menu_append (GTK_MENU (menu), menuitem);
}
// finally append menu to drop-down list
gtk_option_menu_set_menu (GTK_OPTION_MENU (project), menu);
}
Index: gui_tree.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_tree.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** gui_tree.cc 2 Nov 2002 21:35:55 -0000 1.3
--- gui_tree.cc 5 May 2003 18:50:29 -0000 1.4
***************
*** 2,6 ****
$Id$
! Copyright (C) 2002 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 2002/2003 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 21,30 ****
#include <gtk/gtk.h>
#include "gui_tree.h"
#include "gui_dlgedit.h"
! #define INSERT_NODE(parent,text,is_leaf) \
! gtk_ctree_insert_node (GTK_CTREE (tree), parent, NULL, text, 0, \
! NULL, NULL, NULL, NULL, is_leaf, true)
// selection changed
--- 21,160 ----
#include <gtk/gtk.h>
+ #include "cfg_data.h"
#include "gui_tree.h"
#include "gui_dlgedit.h"
! #define INSERT_NODE(parent,sibling,text,idx,is_leaf) \
! gtk_ctree_insert_node (GTK_CTREE (tree), parent, sibling, text, 4, \
! icon[idx], mask[idx], icon[idx], mask[idx], is_leaf, true)
!
! /* Icon for unselected dialogue */
! static char * dlg_xpm[] = {
! "16 16 5 1",
! " c None",
! ". c #646464",
! "+ c #000000",
! "@ c #848484",
! "# c #FFFFFF",
! " ",
! " ",
! " .+++++++++. ",
! " address@hidden@+. ",
! " address@hidden@+. ",
! " +###########+. ",
! " +###########+. ",
! " address@hidden@+. ",
! " address@hidden@+. ",
! " address@hidden@+++++. ",
! " address@hidden ",
! " ++. ",
! " +. ",
! " . ",
! " ",
! " "};
!
! /* Icon for selected dialogue */
! static char * sel_xpm[] = {
! "16 16 5 1",
! " c None",
! ". c #446484",
! "+ c #000020",
! "@ c #6484A4",
! "# c #CFEFEF",
! " ",
! " ",
! " .+++++++++. ",
! " address@hidden@+. ",
! " address@hidden@+. ",
! " +###########+. ",
! " +###########+. ",
! " address@hidden@+. ",
! " address@hidden@+. ",
! " address@hidden@+++++. ",
! " address@hidden ",
! " ++. ",
! " +. ",
! " . ",
! " ",
! " "};
!
! /* Not selected and modified */
! static char * dlg_mod_xpm[] = {
! "16 16 5 1",
! " c None",
! ". c #646464",
! "+ c #000000",
! "@ c #848484",
! "# c #FFFFFF",
! " ",
! " ",
! " .+++++++++. ",
! " address@hidden@+. ",
! " address@hidden@address@hidden@+. ",
! " address@hidden ",
! " address@hidden@#####+. ",
! " address@hidden@address@hidden@address@hidden@+. ",
! " address@hidden@+. ",
! " address@hidden@+++++. ",
! " address@hidden ",
! " ++. ",
! " +. ",
! " . ",
! " ",
! " "};
!
! /* Selected and modified */
! static char * sel_mod_xpm[] = {
! "16 16 5 1",
! " c None",
! ". c #446484",
! "+ c #000020",
! "@ c #6484A4",
! "# c #CFEFEF",
! " ",
! " ",
! " .+++++++++. ",
! " address@hidden@+. ",
! " address@hidden@address@hidden@+. ",
! " address@hidden ",
! " address@hidden@#####+. ",
! " address@hidden@address@hidden@address@hidden@+. ",
! " address@hidden@+. ",
! " address@hidden@+++++. ",
! " address@hidden ",
! " ++. ",
! " +. ",
! " . ",
! " ",
! " "};
!
! /* Project icon */
! static char * project_xpm[] = {
! "16 16 9 1",
! " c None",
! ". c #004F8C",
! "+ c #000000",
! "@ c #EFE8EF",
! "# c #C4D9FF",
! "$ c #93BCFF",
! "% c #619CCC",
! "& c #83A0D3",
! "* c #013E63",
! " ",
! " .....+ ",
! " address@hidden ",
! ".%%%%%%%...... ",
! ".###########$%+ ",
! ".#$$.%.%.%.$&%+ ",
! ".#$.$@@@address@hidden ",
! "address@hidden@address@hidden@*&%+ ",
! ".#$.$###$#&.$%+ ",
! ".#$$.$#*.*.$&%+ ",
! ".#$$$.*&$&$&&%+ ",
! ".#&$&*&$&$&&&%+ ",
! ".%%%%%%%%%%%%%+ ",
! " ++++++++++++++ ",
! " ",
! " "};
// selection changed
***************
*** 80,84 ****
--- 210,225 ----
GTK_SIGNAL_FUNC (on_tree_select_row), this);
+ // create pixmaps and masks
+ GdkWindow *wnd = GuiDlgedit::window->getWindow ()->window;
+ icon[BUBBLE] = gdk_pixmap_create_from_xpm_d (wnd, &mask[BUBBLE], NULL,
dlg_xpm);
+ icon[BUBBLE_SEL] = gdk_pixmap_create_from_xpm_d (wnd,
&mask[BUBBLE_SEL], NULL, sel_xpm);
+ icon[BUBBLE_MOD] = gdk_pixmap_create_from_xpm_d (wnd,
&mask[BUBBLE_MOD], NULL, dlg_mod_xpm);
+ icon[BUBBLE_SEL_MOD] = gdk_pixmap_create_from_xpm_d (wnd,
&mask[BUBBLE_SEL_MOD], NULL, sel_mod_xpm);
+ icon[PROJECT] = gdk_pixmap_create_from_xpm_d (wnd, &mask[PROJECT],
NULL, project_xpm);
+
selected = NULL;
+
+ // add available projects to tree
+ addProjects ();
}
***************
*** 86,102 ****
GuiTree::~GuiTree ()
{
}
! // display the given module
! void GuiTree::display (DlgModule *module)
{
// is module valid?
if (module == NULL) return;
! // clear the tree
! clear ();
! // build the tree
! build (insert ((GtkCTreeNode*) NULL, module));
}
--- 227,347 ----
GuiTree::~GuiTree ()
{
+ clear ();
}
! // add the given module
! void GuiTree::addModule (DlgModule *module)
{
// is module valid?
if (module == NULL) return;
+ if (locate (module) != NULL) return;
+
+ // locate the project node for this module
+ GtkCTreeNode* project = locateProject (module->entry ()->project ());
+
+ // build the sub-tree
+ build (insert (project, NULL, module));
+ gtk_ctree_expand (GTK_CTREE (tree), project);
+ }
! // find a given project
! GtkCTreeNode *GuiTree::locateProject (const std::string &project)
! {
! // get the root node (which must be the "none" project!)
! GtkCTreeNode *node, *root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
! GList *projects = gtk_ctree_find_all_by_row_data (GTK_CTREE (tree), root,
NULL);
! gchar *text;
!
! for (; projects != NULL; projects = projects->next)
! {
! node = (GtkCTreeNode *) projects->data;
! gtk_ctree_get_node_info (GTK_CTREE (tree), node, &text, NULL, NULL,
NULL, NULL, NULL, NULL, NULL);
! if (project == text) return node;
! }
!
! // project not in tree yet -> add it
! text = (char *) project.c_str ();
! node = INSERT_NODE (NULL, NULL, &text, PROJECT, false);
! gtk_ctree_node_set_row_data (GTK_CTREE (tree), node, (gpointer) NULL);
! gtk_ctree_node_set_selectable (GTK_CTREE (tree), node, false);
!
! return node;
! }
! // update the given module
! void GuiTree::updateModule (DlgModule *module)
! {
! if (module == NULL) return;
!
! GtkCTreeNode *node = locate (module);
! if (node == NULL) return;
!
! GtkCTreeNode *parent = GTK_CTREE_ROW (node)->parent;
! GtkCTreeNode *sibling = GTK_CTREE_ROW (node)->sibling;
!
! // update node
! gtk_clist_freeze (GTK_CLIST (tree));
! gtk_ctree_remove_node (GTK_CTREE (tree), node);
! if (node == selected) selected = NULL;
!
! gchar *project;
! gtk_ctree_node_get_text (GTK_CTREE (tree), parent, 0, &project);
!
! // module still belongs to same project -> insert at old position
! if (module->entry ()->project () == project)
! build (insert (parent, sibling, module));
! // otherwise just append to new project
! else
! addModule (module);
!
! gtk_clist_thaw (GTK_CLIST (tree));
! }
!
! // remove the given module
! void GuiTree::removeModule (DlgModule *module)
! {
! if (module == NULL) return;
!
! GtkCTreeNode *node = locate (module);
! if (node == NULL) return;
!
! if (node == selected) selected = NULL;
! gtk_ctree_remove_node (GTK_CTREE (tree), node);
! }
!
! // locate the node corresponding to the given module
! GtkCTreeNode *GuiTree::locate (DlgModule *module)
! {
! GtkCTreeNode *root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
! if (root == NULL) return NULL;
!
! return gtk_ctree_find_by_row_data (GTK_CTREE (tree), root, (gpointer)
module);
! }
!
! // add available projects to tree
! void GuiTree::addProjects ()
! {
! std::vector<std::string> projects = CfgData::data->projectsFromDatadir ();
! std::vector<std::string>::iterator i;
! GtkCTreeNode *node;
! gchar *text;
!
! for (i = projects.begin (); i != projects.end (); i++)
! {
! text = ((char*) (*i).c_str ());
! node = INSERT_NODE (NULL, NULL, &text, PROJECT, false);
! gtk_ctree_node_set_row_data (GTK_CTREE (tree), node, (gpointer) NULL);
! gtk_ctree_node_set_selectable (GTK_CTREE (tree), node, false);
! }
! }
!
! // assign module to a different project
! void GuiTree::updateProject (DlgModule *module)
! {
! GtkCTreeNode *project = locateProject (module->entry ()->project ());
! GtkCTreeNode *node = locate (module);
!
! gtk_ctree_move (GTK_CTREE (tree), node, project, NULL);
! gtk_ctree_expand (GTK_CTREE (tree), project);
}
***************
*** 112,123 ****
if ((*i)->type () == MODULE)
// insert it into the tree and continue with its sub-dialogues
! build (insert (root, (DlgModule *) *i));
}
// insert a module into the tree
! GtkCTreeNode *GuiTree::insert (GtkCTreeNode *parent, DlgModule *module)
{
gchar *text = ((char*) module->name ().c_str ());
! GtkCTreeNode *node = INSERT_NODE (parent, &text, false);
gtk_ctree_node_set_row_data (GTK_CTREE (tree), node, (gpointer) module);
--- 357,370 ----
if ((*i)->type () == MODULE)
// insert it into the tree and continue with its sub-dialogues
! build (insert (root, NULL, (DlgModule *) *i));
}
// insert a module into the tree
! GtkCTreeNode *GuiTree::insert (GtkCTreeNode *parent, GtkCTreeNode *sibling,
DlgModule *module)
{
+ if (parent == NULL) return NULL;
+
gchar *text = ((char*) module->name ().c_str ());
! GtkCTreeNode *node = INSERT_NODE (parent, sibling, &text, BUBBLE, false);
gtk_ctree_node_set_row_data (GTK_CTREE (tree), node, (gpointer) module);
***************
*** 132,143 ****
void GuiTree::insert (DlgModule *parent, DlgModule *module)
{
! GtkCTreeNode *root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
! if (root == NULL) return;
!
! GtkCTreeNode *node = gtk_ctree_find_by_row_data (GTK_CTREE (tree), root,
! (gpointer) parent);
! if (node == NULL) return;
!
! insert (node, module);
}
--- 379,383 ----
void GuiTree::insert (DlgModule *parent, DlgModule *module)
{
! insert (locate (parent), NULL, module);
}
***************
*** 145,150 ****
void GuiTree::select (GtkCTreeNode *node)
{
! if (node == selected) return;
// first of all, deselect old node
if (selected != NULL)
--- 385,392 ----
void GuiTree::select (GtkCTreeNode *node)
{
! DlgModule *module;
+ if (node == selected) return;
+
// first of all, deselect old node
if (selected != NULL)
***************
*** 152,155 ****
--- 394,399 ----
GdkColor black = { 0, 0, 0, 0 };
gtk_ctree_node_set_foreground (GTK_CTREE (tree), selected, &black);
+ module = (DlgModule *) gtk_ctree_node_get_row_data (GTK_CTREE (tree),
selected);
+ setIcon (selected, false, module->changed ());
}
***************
*** 157,162 ****
if (node != NULL)
{
! GdkColor red = { 0, 65535, 0, 0 };
! gtk_ctree_node_set_foreground (GTK_CTREE (tree), node, &red);
}
--- 401,417 ----
if (node != NULL)
{
! GdkColor blue = { 0, 0, 0, 65535 };
! gtk_ctree_node_set_foreground (GTK_CTREE (tree), node, &blue);
! module = (DlgModule *) gtk_ctree_node_get_row_data (GTK_CTREE (tree),
node);
! setIcon (node, true, module->changed ());
!
! // expand parent nodes, so that selected node becomes visible
! GtkCTreeNode *parent = GTK_CTREE_ROW (node)->parent;
!
! while (parent != NULL)
! {
! gtk_ctree_expand (GTK_CTREE (tree), parent);
! parent = GTK_CTREE_ROW (parent)->parent;
! }
}
***************
*** 165,176 ****
}
// select the given module
void GuiTree::select (DlgModule *module)
{
! GtkCTreeNode *root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
!
! if (root == NULL) return;
! select (gtk_ctree_find_by_row_data (GTK_CTREE (tree), root, (gpointer)
module));
}
--- 420,469 ----
}
+ // change icon of node
+ void GuiTree::setIcon (GtkCTreeNode *node, bool select, bool changed)
+ {
+ int index;
+ gchar *text;
+ guint8 spacing;
+ gboolean is_leaf;
+ gboolean expanded;
+
+ gtk_ctree_get_node_info (GTK_CTREE (tree), node, &text, &spacing,
+ NULL, NULL, NULL, NULL, &is_leaf, &expanded);
+
+ if (select) index = changed ? BUBBLE_SEL_MOD : BUBBLE_SEL;
+ else index = changed ? BUBBLE_MOD : BUBBLE;
+
+ gtk_ctree_set_node_info (GTK_CTREE (tree), node, text, spacing,
+ icon[index], mask[index], icon[index], mask[index], is_leaf,
expanded);
+ }
+
// select the given module
void GuiTree::select (DlgModule *module)
{
! select (locate (module));
! }
!
! // set whether a module is modified or not
! void GuiTree::setChanged (DlgModule *module)
! {
! // locate module
! GtkCTreeNode *node = locate (module);
! if (node == NULL) return;
! // set icon
! setIcon (node, node == selected, module->changed ());
! }
!
! // update the name of the given module
! void GuiTree::setName (DlgModule *module)
! {
! // locate module
! GtkCTreeNode *node = locate (module);
! if (node == NULL) return;
!
! // set name
! gchar *text = ((char*) module->name ().c_str ());
! gtk_ctree_node_set_text (GTK_CTREE (tree), node, 0, text);
}
***************
*** 180,185 ****
GtkCTreeNode *root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
! if (root == NULL) return;
! else gtk_ctree_remove_node (GTK_CTREE (tree), root);
// no tree, so nothing selected
--- 473,481 ----
GtkCTreeNode *root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
! while (root != NULL)
! {
! gtk_ctree_remove_node (GTK_CTREE (tree), root);
! root = gtk_ctree_node_nth (GTK_CTREE (tree), 0);
! }
// no tree, so nothing selected
Index: gui_tree.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_tree.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** gui_tree.h 2 Nov 2002 18:40:02 -0000 1.2
--- gui_tree.h 5 May 2003 18:50:29 -0000 1.3
***************
*** 2,6 ****
$Id$
! Copyright (C) 2002 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 2002/2003 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 41,44 ****
--- 41,56 ----
public:
/**
+ * Speaking names for node icons,
+ */
+ enum {
+ BUBBLE = 0,
+ BUBBLE_SEL = 1,
+ BUBBLE_MOD = 2,
+ BUBBLE_SEL_MOD = 3,
+ PROJECT = 4,
+ MAX_ICONS = 5
+ };
+
+ /**
* Constructor. Creates the tree widget and adds it to the
* given pane.
***************
*** 59,63 ****
* @param module A module whose structure should be displayed.
*/
! void display (DlgModule *module);
/**
--- 71,101 ----
* @param module A module whose structure should be displayed.
*/
! void addModule (DlgModule *module);
! /**
! * Refresh the given module. This will remove the module sub-tree
! * and generate it anew. To be called after reverting to saved.
! *
! * @param module The module to refresh.
! */
! void updateModule (DlgModule *module);
! /**
! * Attach the given module to a new project. To be called after
! * changine the project the module belongs to.
! *
! * @param module The module to move to new project.
! */
! void updateProject (DlgModule *module);
! /**
! * Remove a module sub-tree. To be called when a module is closed
! * or a sub-module is deleted.
! *
! * @param The module to remove.
! */
! void removeModule (DlgModule *module);
!
! /**
! * Add available projects to the tree.
! */
! void addProjects ();
/**
***************
*** 67,70 ****
--- 105,119 ----
/**
+ * Update the state (saved/modified) of the module's icon.
+ * @param module Module whose state (and icon) to update
+ */
+ void setChanged (DlgModule *module);
+ /**
+ * Update the name of the given module.
+ * @param module Module whose name should be updated.
+ */
+ void setName (DlgModule *module);
+
+ /**
* Insert a module into the tree, as child of the given parent.
* @param parent The parent of the module to add.
***************
*** 96,106 ****
* Insert a module into the tree, as child of the given parent.
* @param parent The parent of the module to add.
* @param module The module to add.
* @return The node that has been added.
*/
! GtkCTreeNode *insert (GtkCTreeNode *parent, DlgModule *module);
GtkWidget *tree; // The actual GTK+ tree widget
GtkCTreeNode *selected; // The node currently 'selected'
};
--- 145,180 ----
* Insert a module into the tree, as child of the given parent.
* @param parent The parent of the module to add.
+ * @param sibling The sibling after which module should be added.
* @param module The module to add.
* @return The node that has been added.
*/
! GtkCTreeNode *insert (GtkCTreeNode *parent, GtkCTreeNode *sibling,
DlgModule *module);
! /**
! * Set the icon of the given node to the appropriate state.
! * @param node Node whose icon to change.
! * @param select Whether to use the selected or normal icon.
! * @param changed Whether the given node is saved or modified.
! */
! void setIcon (GtkCTreeNode *node, bool select, bool changed);
! /**
! * Find the node associated with the given module.
! * @param module DlgModule whose node to retrieve.
! * @return Node associated with the module, or NULL if it isn't found.
! */
! GtkCTreeNode *locate (DlgModule *module);
! /**
! * Find the node associated with the given project. If no such node
! * exists, it will be created.
! * @param project Name of the project
! * @return Node associated with project
! */
! GtkCTreeNode *locateProject (const std::string &project);
GtkWidget *tree; // The actual GTK+ tree widget
GtkCTreeNode *selected; // The node currently 'selected'
+
+ // Icons to display next to tree nodes
+ GdkPixmap *icon[MAX_ICONS];
+ GdkBitmap *mask[MAX_ICONS];
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: adonthell/src/tools/dlgedit cfg_data.cc,1.5,1.6 cfg_data.h,1.4,1.5 dlg_cmdline.cc,1.7,1.8 dlg_module.cc,1.15,1.16 dlg_module.h,1.14,1.15 dlg_module_entry.cc,1.5,1.6 dlg_types.h,1.9,1.10 gui_dlgedit.cc,1.14,1.15 gui_dlgedit.h,1.10,1.11 gui_graph.cc,1.11,1.12 gui_resources.cc,1.3,1.4 gui_settings.cc,1.9,1.10 gui_tree.cc,1.3,1.4 gui_tree.h,1.2,1.3,
Kai Sterker <address@hidden> <=
- Prev by Date:
[Adonthell-commits] CVS: adonthell/src audio.h,1.28,1.29 character_base.h,1.12,1.13 data_screen.cc,1.24,1.25 dialog_screen.cc,1.10,1.11 input.cc,1.6,1.7 inventory.cc,1.6,1.7 inventory.h,1.10,1.11 item_base.cc,1.8,1.9 item_base.h,1.10,1.11 main.cc,1.59,1.60 prefs.cc,1.33,1.34
- Next by Date:
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit cfg_data.cc,1.6,1.7 dlg_arrow.cc,1.9,1.10 gui_settings.cc,1.10,1.11
- Previous by thread:
[Adonthell-commits] CVS: adonthell/src audio.h,1.28,1.29 character_base.h,1.12,1.13 data_screen.cc,1.24,1.25 dialog_screen.cc,1.10,1.11 input.cc,1.6,1.7 inventory.cc,1.6,1.7 inventory.h,1.10,1.11 item_base.cc,1.8,1.9 item_base.h,1.10,1.11 main.cc,1.59,1.60 prefs.cc,1.33,1.34
- Next by thread:
[Adonthell-commits] CVS: adonthell/src/tools/dlgedit cfg_data.cc,1.6,1.7 dlg_arrow.cc,1.9,1.10 gui_settings.cc,1.10,1.11
- Index(es):