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

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

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

revision 2900 by schoenebeck, Mon May 2 14:47:34 2016 UTC revision 2901 by schoenebeck, Mon May 2 16:10:56 2016 UTC
# Line 108  ScriptEditor::ScriptEditor() : Line 108  ScriptEditor::ScriptEditor() :
108      m_warningTag->property_background() = "#fffd7c"; // yellow      m_warningTag->property_background() = "#fffd7c"; // yellow
109      m_tagTable->add(m_warningTag);      m_tagTable->add(m_warningTag);
110    
111        // create menu
112        m_actionGroup = Gtk::ActionGroup::create();
113        m_actionGroup->add(Gtk::Action::create("MenuScript", _("_Script")));
114        m_actionGroup->add(Gtk::Action::create("Apply", _("_Apply")),
115                           Gtk::AccelKey("<control>s"),
116                           sigc::mem_fun(*this, &ScriptEditor::onButtonApply));
117        m_actionGroup->add(Gtk::Action::create("Close", _("_Close")),
118                           Gtk::AccelKey("<control>x"),
119                           sigc::mem_fun(*this, &ScriptEditor::onButtonCancel));
120        m_uiManager = Gtk::UIManager::create();
121        m_uiManager->insert_action_group(m_actionGroup);
122        add_accel_group(m_uiManager->get_accel_group());
123        m_uiManager->add_ui_from_string(
124            "<ui>"
125            "  <menubar name='MenuBar'>"
126            "    <menu action='MenuScript'>"
127            "      <menuitem action='Apply'/>"
128            "      <separator/>"
129            "      <menuitem action='Close'/>"
130            "    </menu>"
131            "  </menubar>"
132            "</ui>"
133        );
134    
135      m_textBuffer = Gtk::TextBuffer::create(m_tagTable);      m_textBuffer = Gtk::TextBuffer::create(m_tagTable);
136      m_textView.set_buffer(m_textBuffer);      m_textView.set_buffer(m_textBuffer);
137      {      {
# Line 126  ScriptEditor::ScriptEditor() : Line 150  ScriptEditor::ScriptEditor() :
150      }      }
151      m_scrolledWindow.add(m_textView);      m_scrolledWindow.add(m_textView);
152      m_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);      m_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
153    
154        Gtk::Widget* menuBar = m_uiManager->get_widget("/MenuBar");
155        m_vbox.pack_start(*menuBar, Gtk::PACK_SHRINK);
156      m_vbox.pack_start(m_scrolledWindow);      m_vbox.pack_start(m_scrolledWindow);
157    
158      m_buttonBox.set_layout(Gtk::BUTTONBOX_END);      m_buttonBox.set_layout(Gtk::BUTTONBOX_END);
# Line 134  ScriptEditor::ScriptEditor() : Line 161  ScriptEditor::ScriptEditor() :
161      m_applyButton.set_can_default();      m_applyButton.set_can_default();
162      m_applyButton.set_sensitive(false);      m_applyButton.set_sensitive(false);
163      m_applyButton.grab_focus();      m_applyButton.grab_focus();
164        
165  #if GTKMM_MAJOR_VERSION >= 3  #if GTKMM_MAJOR_VERSION >= 3
166      m_statusImage.set_margin_left(6);      m_statusImage.set_margin_left(6);
167      m_statusImage.set_margin_right(6);      m_statusImage.set_margin_right(6);
# Line 180  ScriptEditor::ScriptEditor() : Line 207  ScriptEditor::ScriptEditor() :
207      );      );
208    
209      show_all_children();      show_all_children();
   
     resize(460,300);  
210  }  }
211    
212  ScriptEditor::~ScriptEditor() {  ScriptEditor::~ScriptEditor() {

Legend:
Removed from v.2900  
changed lines
  Added in v.2901

  ViewVC Help
Powered by ViewVC