mapselector.h
changeset 201 879e47e5b731
parent 194 6b2b718420eb
equal deleted inserted replaced
8:37e16985c8dd 9:caf05ee4fa32
    20 #define MAPSELECTOR_H
    20 #define MAPSELECTOR_H
    21 
    21 
    22 #include <all_include.h>
    22 #include <all_include.h>
    23 #include <libgnomecanvasmm.h>
    23 #include <libgnomecanvasmm.h>
    24 #include <libgnomecanvasmm/polygon.h>
    24 #include <libgnomecanvasmm/polygon.h>
       
    25 #include "map_value.h"
    25 
    26 
    26 ///A widget by which node and edgemaps can be selected, deselected and created.
    27 ///A widget by which node and edgemaps can be selected, deselected and created.
    27 
    28 
    28 ///During the usage of \ref glemon we have to select
    29 ///During the usage of \ref glemon we have to select
    29 ///maps several times. We also need some aid-function
    30 ///maps several times. We also need some aid-function
    78 
    79 
    79   ///New button.
    80   ///New button.
    80 
    81 
    81   ///By pressing it
    82   ///By pressing it
    82   ///\ref NewMapWin wilol pop-up
    83   ///\ref NewMapWin wilol pop-up
    83   Gtk::Button * newbut;
    84   Gtk::Button newbut;
    84 
    85 
    85   ///Reset button.
    86   ///Reset button.
    86 
    87 
    87   ///If pressed \ref cbt will
    88   ///If pressed \ref cbt will
    88   ///set to 'Default' option.
    89   ///set to 'Default' option.
    89   ///
    90   ///
    90   ///It is visible only if \ref def is true.
    91   ///It is visible only if \ref def is true.
    91   Gtk::Button * defbut;
    92   Gtk::Button defbut;
    92 
       
    93   ///Container in which GUI elements are packed.
       
    94   Gtk::HBox hbox;
       
    95 
    93 
    96   ///Shows purpose of \ref MapSelector piece.
    94   ///Shows purpose of \ref MapSelector piece.
    97   Gtk::Label * label;
    95   Gtk::Label label;
       
    96 
       
    97   /// Which types of maps (integer, string, ...) to display.
       
    98   MapType map_type;
    98 
    99 
    99  public:
   100  public:
   100 
   101 
   101   ///Constructor of \ref MapSelector
   102   ///Constructor of \ref MapSelector
   102 
   103 
   103   ///Creates the layout and binds signal to the correct place.
   104   ///Creates the layout and binds signal to the correct place.
   104   ///\param optionlist list of names to place in \ref cbt
   105   ///\param mapstorage Pointer to the \ref MapStorage to get the map list from.
   105   ///\param act preselected option
   106   ///\param act preselected option
   106   ///\param purpose text of label indicating purpose of \ref MapStorage
   107   ///\param purpose text of label indicating purpose of \ref MapStorage
   107   ///\param itisedge do \ref MapSelector contains edgemap names or nodemapnames.
   108   ///\param itisedge do \ref MapSelector contains edgemap names or nodemapnames.
   108   ///\param def do we need 'Default' option. See \ref def.
   109   ///\param def do we need 'Default' option. See \ref def.
   109   MapSelector(std::vector<std::string> optionlist, std::string act, std::string purpose, bool itisedge, bool def=true);
   110   ///\param type Specifies which types of maps to display.
       
   111   MapSelector(std::vector<std::string> n_ml,
       
   112       std::vector<std::string> s_ml, std::string act, std::string labeltext,
       
   113       bool edge, bool d = true, MapType type = ALL);
   110 
   114 
   111   ///Returns signal emitted if the user has changed the selection. (\ref signal_cbt)
   115   ///Returns signal emitted if the user has changed the selection. (\ref signal_cbt)
   112   sigc::signal<void, std::string> signal_cbt_ch();
   116   sigc::signal<void, std::string> signal_cbt_ch();
   113 
   117 
   114   ///Returns signal emitted if the user has pressed New button (\ref newbut) (\ref signal_newmapwin)
   118   ///Returns signal emitted if the user has pressed New button (\ref newbut) (\ref signal_newmapwin)
   117   ///Maintain \ref cbt.
   121   ///Maintain \ref cbt.
   118 
   122 
   119   ///Fills in \ref cbt with names, taking
   123   ///Fills in \ref cbt with names, taking
   120   ///into account that the previously selected option
   124   ///into account that the previously selected option
   121   ///has to be set back after the operation.
   125   ///has to be set back after the operation.
   122   void update_list( std::vector<std::string> );
   126   void update_list(std::vector<std::string> n_ml,
       
   127       std::vector<std::string> s_ml);
   123 
   128 
   124   ///Handles changement in \ref cbt.
   129   ///Handles changement in \ref cbt.
   125 
   130 
   126   ///In default case it emits a signal with the selected option.
   131   ///In default case it emits a signal with the selected option.
   127   ///But if 'Default' option is selected, it resets the \ref MapSelector
   132   ///But if 'Default' option is selected, it resets the \ref MapSelector
   166   ///If \ref set_new_map is true, the
   171   ///If \ref set_new_map is true, the
   167   ///\ref MapSelector has requested the opened \ref NewMapWin,
   172   ///\ref MapSelector has requested the opened \ref NewMapWin,
   168   ///from that the option to append is coming. In this case
   173   ///from that the option to append is coming. In this case
   169   ///this function  will set \ref cbt to the new option.
   174   ///this function  will set \ref cbt to the new option.
   170   ///\param new_option new option to append
   175   ///\param new_option new option to append
   171   void append_text(Glib::ustring new_option);
   176   void append_text(Glib::ustring new_option, MapValue::Type);
   172 };
   177 };
   173 #endif //MAPSELECTOR_H
   178 #endif //MAPSELECTOR_H