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 |
{ |
{ |
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); |
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); |
207 |
); |
); |
208 |
|
|
209 |
show_all_children(); |
show_all_children(); |
|
|
|
|
resize(460,300); |
|
210 |
} |
} |
211 |
|
|
212 |
ScriptEditor::~ScriptEditor() { |
ScriptEditor::~ScriptEditor() { |