adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src/tools/dlgedit gui_tree.cc,NONE,1.


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src/tools/dlgedit gui_tree.cc,NONE,1.1 gui_tree.h,NONE,1.1 Makefile.am,1.49,1.50 dlg_module.cc,1.9,1.10 dlg_module.h,1.9,1.10 gui_dlgedit.cc,1.9,1.10 gui_dlgedit.h,1.8,1.9 gui_graph.cc,1.7,1.8 gui_graph.h,1.7,1.8 gui_list.h,1.2,1.3
Date: Fri, 01 Nov 2002 18:20:23 -0500

Update of /cvsroot/adonthell/adonthell/src/tools/dlgedit
In directory subversions:/tmp/cvs-serv28106

Modified Files:
        Makefile.am dlg_module.cc dlg_module.h gui_dlgedit.cc 
        gui_dlgedit.h gui_graph.cc gui_graph.h gui_list.h 
Added Files:
        gui_tree.cc gui_tree.h 
Log Message:
ADDED tree widget to display dialogue structure (sub-dialogues)
ADDED 'descending' into sub-dialogues


***** Error reading new file: [Errno 2] No such file or directory: 'gui_tree.cc'
***** Error reading new file: [Errno 2] No such file or directory: 'gui_tree.h'
Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/Makefile.am,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** Makefile.am 17 Oct 2002 20:42:59 -0000      1.49
--- Makefile.am 1 Nov 2002 23:20:20 -0000       1.50
***************
*** 40,43 ****
--- 40,44 ----
      gui_settings.cc \
      gui_tooltip.cc \
+     gui_tree.cc \
      kb_traverse.cc \
      lex.loadcfg.cc \
***************
*** 76,79 ****
--- 77,81 ----
      gui_settings.h \
      gui_tooltip.h \
+     gui_tree.h \
      kb_traverse.h
  

Index: dlg_module.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** dlg_module.cc       26 Oct 2002 22:19:44 -0000      1.9
--- dlg_module.cc       1 Nov 2002 23:20:20 -0000       1.10
***************
*** 45,48 ****
--- 45,49 ----
      selected_ = NULL;
      highlighted_ = NULL;
+     parent_ = NULL;
      changed_ = false;
  }

Index: dlg_module.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/dlg_module.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** dlg_module.h        26 Oct 2002 22:19:44 -0000      1.9
--- dlg_module.h        1 Nov 2002 23:20:20 -0000       1.10
***************
*** 227,230 ****
--- 227,244 ----
      
      /**
+      * Retrieve the parent dialogue of this module. If the module is
+      * a sub-dialogue, this will point to the dialogue that contains
+      * the module. If it is the top-level dialogue, the parent will be
+      * NULL.
+      * @return parent of this dialogue, or \b NULL if it's a top-level 
dialogue 
+      */
+     DlgModule *parent ()                { return parent_; }
+     /**
+      * Set the parent of this dialogue.
+      * @param parent The module containing this sub-dialogue
+      */
+     void setParent (DlgModule *parent)  { parent_ = parent; }
+     
+     /**
       * Get a pointer to the module entry
       * @return the DlgModuleEntry of this module
***************
*** 245,248 ****
--- 259,263 ----
      DlgNode *selected_;         // the node currently selected
      DlgNode *highlighted_;      // the node currently under the cursor
+     DlgModule *parent_;         // parent of sub-dialogue
      
      DlgPoint offset_;           // The current offset in the graph view

Index: gui_dlgedit.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_dlgedit.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** gui_dlgedit.cc      26 Oct 2002 22:19:44 -0000      1.9
--- gui_dlgedit.cc      1 Nov 2002 23:20:20 -0000       1.10
***************
*** 88,92 ****
      GtkWidget *submenu;
      GtkWidget *menuitem;
!     GtkWidget *paned;
      GdkPixmap *icon;
      GdkBitmap *mask;
--- 88,92 ----
      GtkWidget *submenu;
      GtkWidget *menuitem;
!     GtkWidget *hpaned, *vpaned;
      GdkPixmap *icon;
      GdkBitmap *mask;
***************
*** 309,326 ****
      gtk_widget_show (menu);
  
!     paned = gtk_vpaned_new ();
!     gtk_box_pack_start (GTK_BOX (vbox), paned, TRUE, TRUE, 2);
!     gtk_paned_set_handle_size (GTK_PANED (paned), 5);
!     gtk_paned_set_gutter_size (GTK_PANED (paned), 7);
!     gtk_widget_show (paned);
! 
      // Accelerators
      gtk_window_add_accel_group (GTK_WINDOW (wnd), accel_group);
  
      // Drawing Area
!     graph_ = new GuiGraph (paned);
      
      // List
!     list_ = new GuiList (paned);
      
      // Status bars
--- 309,335 ----
      gtk_widget_show (menu);
  
!     vpaned = gtk_vpaned_new ();
!     gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE, 2);
!     gtk_paned_set_handle_size (GTK_PANED (vpaned), 5);
!     gtk_paned_set_gutter_size (GTK_PANED (vpaned), 7);
!     gtk_widget_show (vpaned);
! 
!     hpaned = gtk_hpaned_new ();
!     gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
!     gtk_paned_set_handle_size (GTK_PANED (hpaned), 5);
!     gtk_paned_set_gutter_size (GTK_PANED (hpaned), 7);
!     gtk_widget_show (hpaned);
!     
      // Accelerators
      gtk_window_add_accel_group (GTK_WINDOW (wnd), accel_group);
  
+     // Tree
+     tree_ = new GuiTree (hpaned);
+     
      // Drawing Area
!     graph_ = new GuiGraph (hpaned);
      
      // List
!     list_ = new GuiList (vpaned);
      
      // Status bars
***************
*** 508,511 ****
--- 517,521 ----
      // redisplay
      graph_->detachModule ();
+     tree_->display (module);
      graph_->attachModule (module);
  }
***************
*** 561,564 ****
--- 571,577 ----
      graph_->detachModule ();
      
+     // clear the module structure
+     tree_->clear ();
+ 
      // if another dialogue is open, display that one
      if (dialogues_.size () > 0) showDialogue (dialogues_.front ());
***************
*** 581,584 ****
--- 594,600 ----
      // remove the current module from the view
      graph_->detachModule ();
+     
+     // update the tree view
+     tree_->display (module);
      
      // attach the dialogue to the view

Index: gui_dlgedit.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_dlgedit.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** gui_dlgedit.h       26 Oct 2002 22:19:44 -0000      1.8
--- gui_dlgedit.h       1 Nov 2002 23:20:20 -0000       1.9
***************
*** 26,29 ****
--- 26,30 ----
  #include "gui_graph.h"
  #include "gui_list.h"
+ #include "gui_tree.h"
  
  /**
***************
*** 63,71 ****
      GuiGraph *graph ()      { return graph_; }
      /**
!      * Retriecve the instant preview widget.
       * @return the widget containing the text of the selected DlgNode and
       *         that of it's parents and children.  
       */
      GuiList *list ()        { return list_; }
      
      /**
--- 64,77 ----
      GuiGraph *graph ()      { return graph_; }
      /**
!      * Retrieve the instant preview widget.
       * @return the widget containing the text of the selected DlgNode and
       *         that of it's parents and children.  
       */
      GuiList *list ()        { return list_; }
+     /**
+      * Retrieve the module structure view.
+      * @return the widget displaying the dialogue and its sub-modules.
+      */
+     GuiTree *tree ()        { return tree_; }
      
      /**
***************
*** 215,218 ****
--- 221,225 ----
      mode_type mode_;                // the program mode
      GuiList *list_;                 // instant preview widget
+     GuiTree *tree_;                 // dialogue structure view
      GuiGraph *graph_;               // dialogue view
      GuiMessages *message;           // statusbar for displaying help/error 
texts

Index: gui_graph.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_graph.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** gui_graph.cc        24 Oct 2002 20:12:56 -0000      1.7
--- gui_graph.cc        1 Nov 2002 23:20:20 -0000       1.8
***************
*** 42,46 ****
      graph = gtk_drawing_area_new ();
      gtk_drawing_area_size (GTK_DRAWING_AREA (graph), 200, 450);
!     gtk_paned_add1 (GTK_PANED (paned), graph);
      gtk_widget_show (graph);
      gtk_widget_grab_focus (graph);
--- 42,46 ----
      graph = gtk_drawing_area_new ();
      gtk_drawing_area_size (GTK_DRAWING_AREA (graph), 200, 450);
!     gtk_paned_add2 (GTK_PANED (paned), graph);
      gtk_widget_show (graph);
      gtk_widget_grab_focus (graph);
***************
*** 71,75 ****
      // if a node is selected, update the instant preview
      GuiDlgedit::window->list ()->display (module->selected ());
!         
      // update the program state
      GuiDlgedit::window->setMode (module->mode ());
--- 71,78 ----
      // if a node is selected, update the instant preview
      GuiDlgedit::window->list ()->display (module->selected ());
!     
!     // update the module structure
!     GuiDlgedit::window->tree ()->select (module);
! 
      // update the program state
      GuiDlgedit::window->setMode (module->mode ());
***************
*** 89,93 ****
      // clear the instant preview
      GuiDlgedit::window->list ()->clear ();
! 
      // update the program state
      GuiDlgedit::window->setMode (IDLE);
--- 92,96 ----
      // clear the instant preview
      GuiDlgedit::window->list ()->clear ();
!     
      // update the program state
      GuiDlgedit::window->setMode (IDLE);
***************
*** 101,104 ****
--- 104,114 ----
  }
  
+ // display a different module
+ void GuiGraph::switchModule (DlgModule *m)
+ {
+     detachModule ();
+     attachModule (m);
+ }
+ 
  // create a new circle
  bool GuiGraph::newCircle (DlgPoint &point, node_type type)
***************
*** 202,209 ****
      if (fs.run ())
      {
!         DlgModule *subdlg = GuiDlgedit::window ->loadSubdialogue 
(fs.getSelection());
  
          if (subdlg == NULL) return false;
  
          // draw the sub-dialogue
          subdlg->initShape (point);
--- 212,222 ----
      if (fs.run ())
      {
!         DlgModule *subdlg = GuiDlgedit::window->loadSubdialogue 
(fs.getSelection());
  
          if (subdlg == NULL) return false;
  
+         // set parent of the sub-dialogue
+         subdlg->setParent (module);
+         
          // draw the sub-dialogue
          subdlg->initShape (point);
***************
*** 214,217 ****
--- 227,233 ----
          module->addNode (subdlg);
                
+         // update the module tree
+         GuiDlgedit::window->tree ()->insert (module, subdlg);
+         
          return true;
      }
***************
*** 292,298 ****
      // no node at that position
      if (node == NULL) return false;
!     else module->traverse ()->select (node);
      
!     return selectNode (node);
  }
  
--- 308,327 ----
      // no node at that position
      if (node == NULL) return false;
! 
!     // if we have a sub-dialogue, descent
!     if (node->type () == MODULE)
!     {
!         switchModule ((DlgModule *) node);
!         return true;
!     }
! 
!     // otherwise select the node
!     if (selectNode (node))
!     {
!         module->traverse ()->select (node);
!         return true;
!     }
      
!     return false;
  }
  
***************
*** 796,798 ****
--- 825,840 ----
      offset->move (scroll_offset);
      draw ();
+ }
+ 
+ // get the toplevel dialogue module
+ DlgModule *GuiGraph::dialogue ()
+ {
+     // if there is no module assigned to the view, there is nothing to do
+     if (module == NULL) return NULL;
+ 
+     DlgModule *toplevel = module;
+     
+     while (toplevel->parent () != NULL) toplevel = toplevel->parent ();
+     
+     return toplevel;
  }

Index: gui_graph.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_graph.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** gui_graph.h 24 Oct 2002 20:12:56 -0000      1.7
--- gui_graph.h 1 Nov 2002 23:20:20 -0000       1.8
***************
*** 42,48 ****
--- 42,55 ----
       */
      GuiGraph (GtkWidget* paned);
+     /**
+      * Standard desctructor.
+      */
      ~GuiGraph ();
      
      /**
+      * @name Changing the view
+      */
+     //@{
+     /**
       * Attach a dialogue module to the view for drawing.
       * @param m the DlgModule to display and edit.
***************
*** 54,57 ****
--- 61,71 ----
       */ 
      void detachModule ();
+     /**
+      * Switch view to the given module. Just a convenience method. Calling
+      * detachModule () followed by attachModule (m) will do the same.
+      * @param m The module to display.
+      */
+     void switchModule (DlgModule *m);
+     //@}
      
      /**
***************
*** 255,259 ****
       * @return the DlgModule currently attached to the view 
       */
!     DlgModule *dialogue ()      { return module; }
      /**
       * Get the state of the attached module.
--- 269,279 ----
       * @return the DlgModule currently attached to the view 
       */
!     DlgModule *getAttached ()   { return module; }
!     /**
!      * Get the (toplevel) dialogue the attached module
!      * belongs to.
!      * @return The toplevel dialogue.
!      */
!     DlgModule *dialogue ();
      /**
       * Get the state of the attached module.

Index: gui_list.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/tools/dlgedit/gui_list.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** gui_list.h  7 Apr 2002 09:51:28 -0000       1.2
--- gui_list.h  1 Nov 2002 23:20:20 -0000       1.3
***************
*** 41,44 ****
--- 41,47 ----
       */
      GuiList (GtkWidget* paned);
+     /**
+      * Standard desctructor.
+      */
      ~GuiList ();
      





reply via email to

[Prev in Thread] Current Thread [Next in Thread]