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

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

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

revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC revision 3409 by schoenebeck, Tue Jan 23 16:30:56 2018 UTC
# Line 28  Line 28 
28  # include <gtkmm/table.h>  # include <gtkmm/table.h>
29  #endif  #endif
30    
31    #include "Settings.h"
32    
33  VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) :  VelocityCurve::VelocityCurve(double (gig::DimensionRegion::*getter)(uint8_t)) :
34      getter(getter), dimreg(0) {      getter(getter), dimreg(0) {
35      set_size_request(80, 80);      set_size_request(80, 80);
# Line 187  EGStateOptions::EGStateOptions() : HBox( Line 189  EGStateOptions::EGStateOptions() : HBox(
189      ));      ));
190  }  }
191    
192    void EGStateOptions::on_show_tooltips_changed() {
193        const bool b = Settings::singleton()->showTooltips;
194    
195        checkBoxAttack.set_has_tooltip(b);
196        checkBoxAttackHold.set_has_tooltip(b);
197        checkBoxDecay1.set_has_tooltip(b);
198        checkBoxDecay2.set_has_tooltip(b);
199        checkBoxRelease.set_has_tooltip(b);
200    }
201    
202    
203  DimRegionEdit::DimRegionEdit() :  DimRegionEdit::DimRegionEdit() :
204      velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation),      velocity_curve(&gig::DimensionRegion::GetVelocityAttenuation),
# Line 279  DimRegionEdit::DimRegionEdit() : Line 291  DimRegionEdit::DimRegionEdit() :
291      eGain(_("Gain"), -96, 0, 2, -655360),      eGain(_("Gain"), -96, 0, 2, -655360),
292      eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360),      eGainPlus6(_("Gain +6dB"), eGain, 6 * -655360),
293      eSampleLoopEnabled(_("Enabled")),      eSampleLoopEnabled(_("Enabled")),
294      eSampleLoopStart(_("Loop start positon")),      eSampleLoopStart(_("Loop start position")),
295      eSampleLoopLength(_("Loop size")),      eSampleLoopLength(_("Loop size")),
296      eSampleLoopType(_("Loop type")),      eSampleLoopType(_("Loop type")),
297      eSampleLoopInfinite(_("Infinite loop")),      eSampleLoopInfinite(_("Infinite loop")),
# Line 451  DimRegionEdit::DimRegionEdit() : Line 463  DimRegionEdit::DimRegionEdit() :
463          table[i]->set_col_spacings(7);          table[i]->set_col_spacings(7);
464  #endif  #endif
465    
466    // on Gtk 3 there is absolutely no margin by default
467    #if GTKMM_MAJOR_VERSION >= 3
468    # if GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION < 12
469            table[i]->set_margin_left(12);
470            table[i]->set_margin_right(12);
471    # else
472            table[i]->set_margin_start(12);
473            table[i]->set_margin_end(12);
474    # endif
475    #endif
476      }      }
477    
478      // set tooltips      // set tooltips
# Line 635  DimRegionEdit::DimRegionEdit() : Line 657  DimRegionEdit::DimRegionEdit() :
657    
658      Gtk::Frame* frame = new Gtk::Frame;      Gtk::Frame* frame = new Gtk::Frame;
659      frame->add(crossfade_curve);      frame->add(crossfade_curve);
660        // on Gtk 3 there is no margin at all by default
661    #if GTKMM_MAJOR_VERSION >= 3
662        frame->set_margin_top(12);
663        frame->set_margin_bottom(12);
664    #endif
665  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
666      table[pageno]->attach(*frame, 1, rowno, 2);      table[pageno]->attach(*frame, 1, rowno, 2);
667  #else  #else
# Line 714  DimRegionEdit::DimRegionEdit() : Line 741  DimRegionEdit::DimRegionEdit() :
741    
742      frame = new Gtk::Frame;      frame = new Gtk::Frame;
743      frame->add(cutoff_curve);      frame->add(cutoff_curve);
744        // on Gtk 3 there is no margin at all by default
745    #if GTKMM_MAJOR_VERSION >= 3
746        frame->set_margin_top(12);
747        frame->set_margin_bottom(12);
748    #endif
749  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
750      table[pageno]->attach(*frame, 1, rowno, 2);      table[pageno]->attach(*frame, 1, rowno, 2);
751  #else  #else
# Line 820  DimRegionEdit::DimRegionEdit() : Line 852  DimRegionEdit::DimRegionEdit() :
852    
853      frame = new Gtk::Frame;      frame = new Gtk::Frame;
854      frame->add(velocity_curve);      frame->add(velocity_curve);
855        // on Gtk 3 there is no margin at all by default
856    #if GTKMM_MAJOR_VERSION >= 3
857        frame->set_margin_top(12);
858        frame->set_margin_bottom(12);
859    #endif
860  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
861      table[pageno]->attach(*frame, 1, rowno, 2);      table[pageno]->attach(*frame, 1, rowno, 2);
862  #else  #else
# Line 840  DimRegionEdit::DimRegionEdit() : Line 877  DimRegionEdit::DimRegionEdit() :
877          sigc::mem_fun(release_curve, &VelocityCurve::queue_draw));          sigc::mem_fun(release_curve, &VelocityCurve::queue_draw));
878      frame = new Gtk::Frame;      frame = new Gtk::Frame;
879      frame->add(release_curve);      frame->add(release_curve);
880        // on Gtk 3 there is no margin at all by default
881    #if GTKMM_MAJOR_VERSION >= 3
882        frame->set_margin_top(12);
883        frame->set_margin_bottom(12);
884    #endif
885  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
886      table[pageno]->attach(*frame, 1, rowno, 2);      table[pageno]->attach(*frame, 1, rowno, 2);
887  #else  #else
# Line 930  DimRegionEdit::DimRegionEdit() : Line 972  DimRegionEdit::DimRegionEdit() :
972      append_page(*table[4], _("Filter (2)"));      append_page(*table[4], _("Filter (2)"));
973      append_page(*table[5], _("Pitch"));      append_page(*table[5], _("Pitch"));
974      append_page(*table[6], _("Misc"));      append_page(*table[6], _("Misc"));
975    
976        Settings::singleton()->showTooltips.get_proxy().signal_changed().connect(
977            sigc::mem_fun(*this, &DimRegionEdit::on_show_tooltips_changed)
978        );
979    
980        on_show_tooltips_changed();
981  }  }
982    
983  DimRegionEdit::~DimRegionEdit()  DimRegionEdit::~DimRegionEdit()
# Line 1021  Gtk::Label* DimRegionEdit::addHeader(con Line 1069  Gtk::Label* DimRegionEdit::addHeader(con
1069  #else  #else
1070      label->set_halign(Gtk::Align::START);      label->set_halign(Gtk::Align::START);
1071  #endif  #endif
1072        // on GTKMM 3 there is absolutely no margin by default
1073    #if GTKMM_MAJOR_VERSION >= 3
1074        label->set_margin_top(18);
1075        label->set_margin_bottom(13);
1076    #endif
1077  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID
1078      table[pageno]->attach(*label, 0, rowno, 3);      table[pageno]->attach(*label, 0, rowno, 3);
1079  #else  #else
# Line 1032  Gtk::Label* DimRegionEdit::addHeader(con Line 1085  Gtk::Label* DimRegionEdit::addHeader(con
1085      return label;      return label;
1086  }  }
1087    
1088    void DimRegionEdit::on_show_tooltips_changed() {
1089        const bool b = Settings::singleton()->showTooltips;
1090    
1091        buttonSelectSample.set_has_tooltip(b);
1092        buttonNullSampleReference->set_has_tooltip(b);
1093        wSample->set_has_tooltip(b);
1094    
1095        eEG1StateOptions.on_show_tooltips_changed();
1096        eEG2StateOptions.on_show_tooltips_changed();
1097    
1098        set_has_tooltip(b);
1099    }
1100    
1101  void DimRegionEdit::nextPage()  void DimRegionEdit::nextPage()
1102  {  {
1103      if (firstRowInBlock < rowno - 1)      if (firstRowInBlock < rowno - 1)

Legend:
Removed from v.3364  
changed lines
  Added in v.3409

  ViewVC Help
Powered by ViewVC