/[svn]/gigedit/trunk/src/gigedit/regionchooser.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/regionchooser.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2773 by schoenebeck, Fri Jun 12 17:57:52 2015 UTC revision 2845 by persson, Sun Sep 20 10:18:22 2015 UTC
# Line 24  Line 24 
24  #include <cairomm/context.h>  #include <cairomm/context.h>
25  #include <gdkmm/general.h>  #include <gdkmm/general.h>
26  #include <gdkmm/cursor.h>  #include <gdkmm/cursor.h>
 #include <gtkmm/stock.h>  
27  #include <gtkmm/spinbutton.h>  #include <gtkmm/spinbutton.h>
28  #include <gtkmm/dialog.h>  #include <gtkmm/dialog.h>
29    
# Line 55  gig::Region* SortedRegions::first() { Line 54  gig::Region* SortedRegions::first() {
54  }  }
55    
56  gig::Region* SortedRegions::next() {  gig::Region* SortedRegions::next() {
57      region_iterator++;      ++region_iterator;
58      return region_iterator == regions.end() ? 0 : *region_iterator;      return region_iterator == regions.end() ? 0 : *region_iterator;
59  }  }
60    
# Line 104  RegionChooser::RegionChooser() : Line 103  RegionChooser::RegionChooser() :
103      for (int i = 0 ; i < 128 ; i++) key_pressed[i] = false;      for (int i = 0 ; i < 128 ; i++) key_pressed[i] = false;
104    
105      actionGroup = Gtk::ActionGroup::create();      actionGroup = Gtk::ActionGroup::create();
106      actionGroup->add(Gtk::Action::create("Properties",      actionGroup->add(Gtk::Action::create("Properties", _("_Properties")),
                                          Gtk::Stock::PROPERTIES),  
107                       sigc::mem_fun(*this,                       sigc::mem_fun(*this,
108                                     &RegionChooser::show_region_properties));                                     &RegionChooser::show_region_properties));
109      actionGroup->add(Gtk::Action::create("Remove", Gtk::Stock::REMOVE),      actionGroup->add(Gtk::Action::create("Remove", _("_Remove")),
110                       sigc::mem_fun(*this, &RegionChooser::delete_region));                       sigc::mem_fun(*this, &RegionChooser::delete_region));
111      actionGroup->add(Gtk::Action::create("Add", Gtk::Stock::ADD),      actionGroup->add(Gtk::Action::create("Add", _("_Add")),
112                       sigc::mem_fun(*this, &RegionChooser::add_region));                       sigc::mem_fun(*this, &RegionChooser::add_region));
113      actionGroup->add(Gtk::Action::create("Dimensions", _("Dimensions...")),      actionGroup->add(Gtk::Action::create("Dimensions", _("Dimensions...")),
114                       sigc::mem_fun(*this, &RegionChooser::manage_dimensions));                       sigc::mem_fun(*this, &RegionChooser::manage_dimensions));
# Line 344  void RegionChooser::draw_regions(const C Line 342  void RegionChooser::draw_regions(const C
342          layout->set_spacing(10);          layout->set_spacing(10);
343          Gdk::Cairo::set_source_rgba(cr, red);                  Gdk::Cairo::set_source_rgba(cr, red);        
344          // get the text dimensions          // get the text dimensions
         Pango::Rectangle rect = layout->get_logical_extents();  
345          int text_width, text_height;          int text_width, text_height;
346          layout->get_pixel_size(text_width, text_height);          layout->get_pixel_size(text_width, text_height);
347          cr->move_to(0, (REGION_BLOCK_HEIGHT - text_height) / 2);          cr->move_to(0, (REGION_BLOCK_HEIGHT - text_height) / 2);
# Line 899  void RegionChooser::show_region_properti Line 896  void RegionChooser::show_region_properti
896      dialog.get_vbox()->pack_start(spinBox);      dialog.get_vbox()->pack_start(spinBox);
897      spinBox.show();      spinBox.show();
898      // add OK and CANCEL buttons to the dialog      // add OK and CANCEL buttons to the dialog
899      dialog.add_button(Gtk::Stock::OK, 0);      dialog.add_button(_("_OK"), 0);
900      dialog.add_button(Gtk::Stock::CANCEL, 1);      dialog.add_button(_("_Cancel"), 1);
901      dialog.show_all_children();      dialog.show_all_children();
902      if (!dialog.run()) { // OK selected ...      if (!dialog.run()) { // OK selected ...
903          region->KeyGroup =          region->KeyGroup =

Legend:
Removed from v.2773  
changed lines
  Added in v.2845

  ViewVC Help
Powered by ViewVC