機能 #595 » 0001-.patch
| core/mui/gtk_keyconfig.rb | ||
|---|---|---|
|
button = Gtk::Button.new
|
||
|
dialog = Gtk::Dialog.new(title, self.get_ancestor(Gtk::Window), Gtk::Dialog::MODAL,
|
||
|
[ Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK])
|
||
|
radio_keybind = ::Gtk::RadioButton.new('キーバインド')
|
||
|
radio_dclick = ::Gtk::RadioButton.new(radio_keybind, 'ダブルクリック')
|
||
|
radio_keybind.ssc(:clicked){
|
||
|
keycode = ""
|
||
|
buttonlabel.text = label.text = keycode
|
||
|
button.sensitive = true
|
||
|
self.change_hook.call(keycode) if self.change_hook
|
||
|
}
|
||
|
radio_dclick.ssc(:clicked){
|
||
|
keycode = "Double_Click"
|
||
|
buttonlabel.text = label.text = keycode
|
||
|
button.sensitive = false
|
||
|
self.change_hook.call(keycode) if self.change_hook
|
||
|
}
|
||
|
if keycode == "Double_Click"
|
||
|
button.sensitive = false
|
||
|
radio_dclick.active = true
|
||
|
else
|
||
|
button.sensitive = true
|
||
|
radio_keybind.active = true
|
||
|
end
|
||
|
label.text = keycode
|
||
|
box.border_width = 20
|
||
|
button.add(label)
|
||
|
box.pack_start(Gtk::Label.new('下のボタンをクリックして、割り当てたいキーを押してください。'))
|
||
|
box.pack_start(radio_keybind)
|
||
|
box.pack_start(button)
|
||
|
box.pack_start(radio_dclick)
|
||
|
button.signal_connect('key_press_event', &key_set(label))
|
||
|
dialog.vbox.add(box)
|
||
|
dialog.show_all
|
||
| core/plugin/gtk/gtk.rb | ||
|---|---|---|
|
timeline = ::Gtk::TimeLine.new(i_timeline)
|
||
|
@slug_dictionary.add(i_timeline, timeline)
|
||
|
handler = {
|
||
|
button_press_event: lambda { |widget, event|
|
||
|
if event.event_type.name == "GDK_2BUTTON_PRESS" then
|
||
|
Plugin::GUI.keypress("Double_Click", i_timeline)
|
||
|
end
|
||
|
},
|
||
|
key_press_event: timeline_key_press_event(i_timeline),
|
||
|
key_press_event: timeline_key_press_event(i_timeline),
|
||
|
focus_in_event: timeline_focus_in_event(i_timeline),
|
||
|
destroy: lambda{ |this| timeline_hook_events(timeline, handler) } }
|
||
| core/plugin/shortcutkey/shortcutkey_listview.rb | ||
|---|---|---|
|
btn_cancel.ssc(:clicked){ window.destroy }
|
||
|
btn_ok.ssc(:clicked){
|
||
|
error = catch(:validate) {
|
||
|
throw :validate, "キーバインドを選択してください" unless values[COLUMN_KEYBIND]
|
||
|
throw :validate, "キーバインドを選択してください" unless (values[COLUMN_KEYBIND] && values[COLUMN_KEYBIND] != "")
|
||
|
throw :validate, "コマンドを選択してください" unless values[COLUMN_SLUG]
|
||
|
result = values
|
||
|
window.destroy }
|
||