COIN-OR::LEMON - Graph Library

Changeset 1889:edcb68a93a95 in lemon-0.x

01/11/06 16:06:17 (15 years ago)
Hegyi Péter

Documentation of MainWin?.

2 edited


  • gui/

    r1884 r1889  
    326 void MainWin::onCloseTab()
    327 {
    328 }
    330326void MainWin::newFile()
    433429    {
    434430    }
    435   //awp->update_maplist(tabs[i]->mapstorage.getNodeMapList(),tabs[i]->mapstorage.getEdgeMapList());
    436431  awp->update_maplist(&(tabs[i]->mapstorage));
  • gui/main_win.h

    r1884 r1889  
    1515///This class is the main window of GUI.
    16 ///It has menus, but the main part of it is the canvas.
     17///It has menus, and a notebook. Notebook has different pages,
     18///the so called tabs (\ref NoteBookTab). Each \ref NoteBookTab contains a canvas on which graphs can be drawn.
     19///To manage creation and close of tabs and tabswitching is the task of MainWin.
    1720class MainWin : public Gtk::Window
    19   ///Container
     22  ///Container in which the menus and the notebook is.
    2023  Gtk::VBox vbox;
     25  ///The notebook that has tabs (\ref NoteBookTab) with different graphs.
    2226  Gtk::Notebook notebook;
     28  ///The tool selected to manipulate graph.
     30  ///It has to be stored, because in case of tabswitching
     31  ///the correct tool has to be set for the actual graph.
    2432  int active_tool;
     34  ///The number of active tab in the notebook.
    2635  int active_tab;
     37  ///Vector of existing tabs in the notebook.
    2738  std::vector<NoteBookTab *> tabs;
     40  ///Vector of the name of tabs.
     42  ///All \ref NoteBookTab has a name that is stored here. The index of the name
     43  ///is the same as the index of the \ref NoteBookTab in \ref tabs.
    2844  std::vector<std::string> tabnames;
     46  ///Counter of occurence of the same file names.
     48  ///If a file is opened more than once we have to score
     49  ///the occurences to let the titles on tabs different.
     50  ///If more than one occurence is present, from the second
     51  ///one near the filename the number of the occurence appear.
    3052  std::map<std::string, int> strinst;
     54  ///Set of opened \ref AlgoWin s.
     56  ///More than one \refAlgoWin can be opened. We have to
     57  ///communicate with them in case of new \ref NoteBookTab creation,
     58  ///\ref NoteBookTab close, or map change. Therefore we have to score
     59  ///their occurences.
    3260  std::set< AlgoWin* > aws;
    36   ///Constructor of the \ref NoteBookTab. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
    37   ///\param title is the title of the window
     64  ///Constructor of the \ref MainWin.
     66  ///It creates the menus, the toolbar and the notebook in which
     67  ///\ref NoteBookTab s take place. \ref NoteBookTab s are the
     68  ///holder of the canvases on which the graphs are drawn.
    3869  MainWin();
     71  ///Sets title of tabs.
     73  ///It alse registrates it in \ref tabnames. If more than one
     74  ///occurence is in the notebook of the same file it has to
     75  ///extend tabname with the number of occurence.
    4076  void set_tabtitle(std::string);
    4682  Glib::RefPtr<Gtk::UIManager> uim;
     84  ///Creates a new \ref NoteBookTab and opens the given file.
     86  ///It is called only with command line parameters at stratup.
    4887  void readFile(const std::string &);
    66105  //Toolbar
     107  ///Callback for 'zoomIn' action.
     109  ///It calls the appropriate function in
     110  ///\ref GraphDisplayerCanvas
    67111  virtual void zoomIn();
     112  ///Callback for 'zoomOut' action.
     114  ///It calls the appropriate function in
     115  ///\ref GraphDisplayerCanvas
    68116  virtual void zoomOut();
     117  ///Callback for 'zoomFit' action.
     119  ///It calls the appropriate function in
     120  ///\ref GraphDisplayerCanvas
    69121  virtual void zoomFit();
     122  ///Callback for 'zoom100' action.
     124  ///It calls the appropriate function in
     125  ///\ref GraphDisplayerCanvas
    70126  virtual void zoom100();
     128  ///Callback for Show Maps menupoint.
     130  ///It calls the appropriate function in
     131  ///\ref NoteBookTab
    72132  virtual void createMapWin();
    74   virtual void createAlgoWin(int);
    75   virtual void deRegisterAlgoWin(AlgoWin *);
     134  ///Pops up an Algorithm window.
     136  ///It not only creates but registrates the newly created \ref AlgoWin.
     137  ///It is necessary, because in case of changement between tabs or maps
     138  ///we have to communicate with it. Signals are also have to be connected
     139  ///to it, because \ref AlgoWin emits signals if it needs anything (maplist, deregistration).
     140  ///\param algo type of the algorithm to run.
     141  virtual void createAlgoWin(int algo);
     143  ///Deregisters AlgoWin
     145  ///This is the function connected to the closing signal of \ref AlgoWin.
     146  ///It only deletes the sender \ref AlgoWin from \ref aws. This function
     147  ///is called only by the closing \ref AlgoWin itself.
     148  ///\param aw the \ref AlgoWin to delete.
     149  virtual void deRegisterAlgoWin(AlgoWin * aw);
     151  ///Updates list of tabs in all of the \ref AlgoWin
     153  ///When \ref NoteBookTab inserted somewhere or closed one tablist in all \ref AlgoWin
     154  ///have to be updated. That is why we score all the opened \ref AlgoWin.
     155  ///During update \ref tabnames will be passed to each \ref AlgoWin.
    76156  virtual void updateAlgoWinTabs();
    77   virtual void updateAlgoWinMaps(AlgoWin *, std::string);
    79   virtual void changeEditorialTool(int);
    81   virtual void createNewMapWinAfterSignal(NoteBookTab *, bool);
    82   virtual void createNewMapWinTabString(std::string, bool);
     158  ///Refresh list of maps in the AlgoWin that requested it.
     160  ///In an \ref AlgoWin there is a ComboBoxText, in which
     161  ///a \ref NoteBookTab can be chosen that contains the graph and the maps,
     162  ///on which we would like to run algorithms. If we change the
     163  ///tab the available maps also have to be updated, because
     164  ///in the different tabs different maps are available. Therefore
     165  ///on tab change the \ref AlgoWin emits a signal that contains itself
     166  ///so that the appropriate maps can be sent to it. For the sake of simplicity
     167  ///the program answers this call with the mapstorage of the newly selected tab.
     168  ///\param aw the caller \ref AlgoWin
     169  ///\param tabname the newly selected tab in the \ref AlgoWin
     170  virtual void updateAlgoWinMaps(AlgoWin * aw, std::string tabname);
     172  ///Registrates the new graph-editor tool in hand.
     174  ///The editor-tool in hand is global, it is the same for all tab
     175  ///at the same time. Therefore the active tool has to be scored here (\ref active_tool).
     176  ///This function is the callback function of the editor-tool buttons. It sets \ref active_tool
     177  ///to the correct value.
     178  ///\param tool the newly selected graph-editor tool (See all_include.h)
     179  virtual void changeEditorialTool(int tool);
     181  ///Pops up a \ref NewMapWin dialog after requested by a \ref MapWin
     183  ///Each tab can pop-up a \ref MapWin. In \ref MapWin new tab can be created.
     184  ///In this case \ref NoteBookTab emits a signal. This function is connected to that signal.
     185  ///It sends the caller \ref NoteBookTab and whether an edgemap or a nodemap should be created.
     186  ///Caller \ref NoteBookTab is necessary for the window to be able to place the new map in its
     187  ///correct place.
     188  ///\param nbt the caller tab
     189  ///\param itisedge true if edgemap has to be created, false if nodemap
     190  virtual void createNewMapWinAfterSignal(NoteBookTab * nbt, bool itisedge);
     192  ///Pops up a \ref NewMapWin dialog after requested by an \ref AlgoWin
     194  ///\ref AlgoWin can also can request a \ref NewMapWin to pop-up.
     195  ///It emits a signal in this case. This function is bound to that signal.
     196  ///The signal contains the name of \ref NoteBookTab in which the new map has to be
     197  ///placed and whether the new map is an edgemap or a nodemap.
     198  ///\ref tabname the tab in which the new map has to be placed
     199  ///\ref itisedge true if the new map will be edge map, false if it will be nodemap
     200  virtual void createNewMapWinTabString(std::string tabname, bool itisedge);
     202  ///Pops up a \ref NewMapWin dialog if button on \ref MainWin has been pressed.
     204  ///In this case a general \ref NewMapWin will be popped up. This means that
     205  ///both edge and nodemap can be created by it. The new map will be placed in
     206  ///\MapStorage of the actual selected \ref NoteBookTab.
    83207  virtual void createNewMapWin();
    86210  ///Callback for 'FileNewTab' action.
    87211  virtual void newTab();
     213  ///Callback for 'FileCloseTab' action.
     215  ///It closes the actual \ref NoteBookTab and registrates this event:
     216  ///data is shifted to the correct places in vectors.
    88217  virtual void closeTab();
     219  ///Tabswitching handler
     221  ///Sets the variables that have to store the actual state, and it
     222  ///updates the title of window to the actually selected \ref NoteBookTab.
    89223  virtual void onChangeTab(GtkNotebookPage*, guint);
    90   virtual void onCloseTab();
Note: See TracChangeset for help on using the changeset viewer.