gui/mapselector.cc
changeset 2021 11455e986b95
parent 1884 9c061834b33b
equal deleted inserted replaced
4:2b28c503fb57 5:7584d5f0b5b4
    24   
    24   
    25   label=new Gtk::Label(labeltext);
    25   label=new Gtk::Label(labeltext);
    26 
    26 
    27   label->set_width_chars(longest_property_string_length);
    27   label->set_width_chars(longest_property_string_length);
    28 
    28 
    29   defbut=new Gtk::Button();
    29   defbut=NULL;
    30   defbut->set_label("Reset");
    30   if(def)
    31 
    31     {
    32   defbut->signal_pressed().connect
    32       defbut=new Gtk::Button();
    33     (
    33       defbut->set_label("Reset");
    34      sigc::mem_fun(*this, &MapSelector::reset)
    34       
    35      );
    35       defbut->signal_pressed().connect
       
    36 	(
       
    37 	 sigc::mem_fun(*this, &MapSelector::reset)
       
    38 	 );
       
    39     }
    36 
    40 
    37   newbut=new Gtk::Button(Gtk::Stock::NEW);
    41   newbut=new Gtk::Button(Gtk::Stock::NEW);
    38 
    42 
    39   newbut->signal_pressed().connect
    43   newbut->signal_pressed().connect
    40     (
    44     (
    43 
    47 
    44   add(*label);
    48   add(*label);
    45 
    49 
    46   add(cbt);
    50   add(cbt);
    47 
    51 
    48   add(*defbut);
    52   if(def)
       
    53     {
       
    54       add(*defbut);
       
    55     }
       
    56 
    49   add(*newbut);
    57   add(*newbut);
    50 }
    58 }
    51 
    59 
    52 void MapSelector::new_but_pressed()
    60 void MapSelector::new_but_pressed()
    53 {
    61 {
    74     }
    82     }
    75 }
    83 }
    76 
    84 
    77 void MapSelector::comboChanged()
    85 void MapSelector::comboChanged()
    78 {
    86 {
    79   if(cbt.get_active_row_number()!=0)
    87   if(cbt.get_active_row_number()!=0 || !def)
    80     {
    88     {
    81       default_state=false;
    89       default_state=false;
    82       Glib::ustring mapname = cbt.get_active_text();
    90       Glib::ustring mapname = cbt.get_active_text();
    83       if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
    91       if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
    84 	{
    92 	{