4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "awindowgui.h"
24 #include "bcsignals.h"
26 #include "cplayback.h"
28 #include "cwindowgui.h"
29 #include "editpanel.h"
31 #include "edlsession.h"
35 #include "localsession.h"
36 #include "mainclock.h"
39 #include "meterpanel.h"
41 #include "mwindowgui.h"
42 #include "playbackengine.h"
45 #include "trackcanvas.h"
46 #include "transportque.h"
48 #include "manualgoto.h"
52 EditPanel::EditPanel(MWindow *mwindow,
53 BC_WindowBase *subwindow,
60 int use_splice, // Extra buttons
75 this->window_id = window_id;
76 this->editing_mode = editing_mode;
77 this->use_editing_mode = use_editing_mode;
78 this->use_keyframe = use_keyframe;
79 this->use_splice = use_splice;
80 this->use_overwrite = use_overwrite;
81 this->use_copy = use_copy;
82 this->use_paste = use_paste;
83 this->use_undo = use_undo;
84 this->mwindow = mwindow;
85 this->subwindow = subwindow;
86 this->use_fit = use_fit;
87 this->use_labels = use_labels;
88 this->use_locklabels = use_locklabels;
89 this->use_toclip = use_toclip;
90 this->use_meters = use_meters;
91 this->use_cut = use_cut;
92 this->use_commercial = use_commercial;
93 this->use_goto = use_goto;
94 this->use_clk2play = use_clk2play;
106 this->commercial = 0;
109 this->labelbutton = 0;
116 this->meter_panel = 0;
121 this->span_keyframe = 0;
123 this->click2play = 0;
127 EditPanel::~EditPanel()
131 void EditPanel::set_meters(MeterPanel *meter_panel)
133 this->meter_panel = meter_panel;
137 void EditPanel::update()
139 int new_editing_mode = mwindow->edl->session->editing_mode;
140 if( arrow ) arrow->update(new_editing_mode == EDITING_ARROW);
141 if( ibeam ) ibeam->update(new_editing_mode == EDITING_IBEAM);
142 if( keyframe ) keyframe->update(mwindow->edl->session->auto_keyframes);
143 if( span_keyframe ) span_keyframe->update(mwindow->edl->session->span_keyframes);
144 if( locklabels ) locklabels->set_value(mwindow->edl->session->labels_follow_edits);
146 int value = !is_vwindow() ?
147 mwindow->edl->session->cwindow_click2play :
148 mwindow->edl->session->vwindow_click2play ;
149 click2play->set_value(value);
153 meters->update(mwindow->edl->session->cwindow_meter);
154 mwindow->cwindow->gui->update_meters();
157 meters->update(mwindow->edl->session->vwindow_meter);
163 int EditPanel::calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons)
166 int button_w = mwindow->theme->get_image_set("ibeam")[0]->get_w();
168 result += button_w + mwindow->theme->toggle_margin;
171 result += button_w * total_buttons;
175 int EditPanel::calculate_h(MWindow *mwindow)
177 return mwindow->theme->get_image_set("ibeam")[0]->get_h();
180 void EditPanel::create_buttons()
184 if( use_editing_mode ) {
185 arrow = new ArrowButton(mwindow, this, x1, y1);
186 subwindow->add_subwindow(arrow);
187 x1 += arrow->get_w();
188 ibeam = new IBeamButton(mwindow, this, x1, y1);
189 subwindow->add_subwindow(ibeam);
190 x1 += ibeam->get_w();
191 x1 += mwindow->theme->toggle_margin;
195 keyframe = new KeyFrameButton(mwindow, this, x1, y1);
196 subwindow->add_subwindow(keyframe);
197 x1 += keyframe->get_w();
198 span_keyframe = new SpanKeyFrameButton(mwindow, this, x1, y1);
199 subwindow->add_subwindow(span_keyframe);
200 x1 += span_keyframe->get_w();
203 if( use_locklabels ) {
204 locklabels = new LockLabelsButton(mwindow, this, x1, y1);
205 subwindow->add_subwindow(locklabels);
206 x1 += locklabels->get_w();
209 if( use_keyframe || use_locklabels )
210 x1 += mwindow->theme->toggle_margin;
213 inpoint = new EditInPoint(mwindow, this, x1, y1);
214 subwindow->add_subwindow(inpoint);
215 x1 += inpoint->get_w();
216 outpoint = new EditOutPoint(mwindow, this, x1, y1);
217 subwindow->add_subwindow(outpoint);
218 x1 += outpoint->get_w();
221 splice = new EditSplice(mwindow, this, x1, y1);
222 subwindow->add_subwindow(splice);
223 x1 += splice->get_w();
226 if( use_overwrite ) {
227 overwrite = new EditOverwrite(mwindow, this, x1, y1);
228 subwindow->add_subwindow(overwrite);
229 x1 += overwrite->get_w();
233 clip = new EditToClip(mwindow, this, x1, y1);
234 subwindow->add_subwindow(clip);
239 cut = new EditCut(mwindow, this, x1, y1);
240 subwindow->add_subwindow(cut);
245 copy = new EditCopy(mwindow, this, x1, y1);
246 subwindow->add_subwindow(copy);
251 paste = new EditPaste(mwindow, this, x1, y1);
252 subwindow->add_subwindow(paste);
253 x1 += paste->get_w();
258 meters = new MeterShow(mwindow, meter_panel, x1, y1);
259 subwindow->add_subwindow(meters);
260 x1 += meters->get_w();
263 printf("EditPanel::create_objects: meter_panel == 0\n");
267 labelbutton = new EditLabelbutton(mwindow, this, x1, y1);
268 subwindow->add_subwindow(labelbutton);
269 x1 += labelbutton->get_w();
270 prevlabel = new EditPrevLabel(mwindow, this, x1, y1);
271 subwindow->add_subwindow(prevlabel);
272 x1 += prevlabel->get_w();
273 nextlabel = new EditNextLabel(mwindow, this, x1, y1);
274 subwindow->add_subwindow(nextlabel);
275 x1 += nextlabel->get_w();
278 // all windows except VWindow since it's only implemented in MWindow.
280 prevedit = new EditPrevEdit(mwindow, this, x1, y1);
281 subwindow->add_subwindow(prevedit);
282 x1 += prevedit->get_w();
283 nextedit = new EditNextEdit(mwindow, this, x1, y1);
284 subwindow->add_subwindow(nextedit);
285 x1 += nextedit->get_w();
289 fit = new EditFit(mwindow, this, x1, y1);
290 subwindow->add_subwindow(fit);
292 fit_autos = new EditFitAutos(mwindow, this, x1, y1);
293 subwindow->add_subwindow(fit_autos);
294 x1 += fit_autos->get_w();
298 undo = new EditUndo(mwindow, this, x1, y1);
299 subwindow->add_subwindow(undo);
301 redo = new EditRedo(mwindow, this, x1, y1);
302 subwindow->add_subwindow(redo);
307 mangoto = new EditManualGoto(mwindow, this, x1, y1);
308 subwindow->add_subwindow(mangoto);
309 x1 += mangoto->get_w();
313 click2play = new EditClick2Play(mwindow, this, x1, y1+5);
314 subwindow->add_subwindow(click2play);
315 x1 += click2play->get_w();
318 if( use_commercial ) {
319 commercial = new EditCommercial(mwindow, this, x1, y1);
320 subwindow->add_subwindow(commercial);
321 x1 += commercial->get_w();
325 void EditPanel::reposition_buttons(int x, int y)
331 if( use_editing_mode ) {
332 arrow->reposition_window(x1, y1);
333 x1 += arrow->get_w();
334 ibeam->reposition_window(x1, y1);
335 x1 += ibeam->get_w();
336 x1 += mwindow->theme->toggle_margin;
340 keyframe->reposition_window(x1, y1);
341 x1 += keyframe->get_w();
342 span_keyframe->reposition_window(x1, y1);
343 x1 += span_keyframe->get_w();
346 if( use_locklabels ) {
347 locklabels->reposition_window(x1,y1);
348 x1 += locklabels->get_w();
351 if( use_keyframe || use_locklabels )
352 x1 += mwindow->theme->toggle_margin;
354 inpoint->reposition_window(x1, y1);
355 x1 += inpoint->get_w();
356 outpoint->reposition_window(x1, y1);
357 x1 += outpoint->get_w();
359 splice->reposition_window(x1, y1);
360 x1 += splice->get_w();
362 if( use_overwrite ) {
363 overwrite->reposition_window(x1, y1);
364 x1 += overwrite->get_w();
367 clip->reposition_window(x1, y1);
371 cut->reposition_window(x1, y1);
375 copy->reposition_window(x1, y1);
379 paste->reposition_window(x1, y1);
380 x1 += paste->get_w();
384 meters->reposition_window(x1, y1);
385 x1 += meters->get_w();
389 labelbutton->reposition_window(x1, y1);
390 x1 += labelbutton->get_w();
391 prevlabel->reposition_window(x1, y1);
392 x1 += prevlabel->get_w();
393 nextlabel->reposition_window(x1, y1);
394 x1 += nextlabel->get_w();
398 prevedit->reposition_window(x1, y1);
399 x1 += prevedit->get_w();
403 nextedit->reposition_window(x1, y1);
404 x1 += nextedit->get_w();
408 fit->reposition_window(x1, y1);
410 fit_autos->reposition_window(x1, y1);
411 x1 += fit_autos->get_w();
415 undo->reposition_window(x1, y1);
417 redo->reposition_window(x1, y1);
422 mangoto->reposition_window(x1, y1);
423 x1 += mangoto->get_w();
426 click2play->reposition_window(x1, y1+5);
427 x1 += click2play->get_w();
431 void EditPanel::create_objects()
436 int EditPanel::get_w()
442 EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
443 : BC_Button(x, y, mwindow->theme->get_image_set("labelbutton"))
445 this->mwindow = mwindow;
447 set_tooltip(_("Toggle label at current position ( l )"));
450 EditLabelbutton::~EditLabelbutton()
453 int EditLabelbutton::keypress_event()
455 if( get_keypress() == 'l' && !alt_down() )
456 return handle_event();
459 int EditLabelbutton::handle_event()
461 panel->panel_toggle_label();
466 EditNextLabel::EditNextLabel(MWindow *mwindow,
467 EditPanel *panel, int x, int y)
468 : BC_Button(x, y, mwindow->theme->get_image_set("nextlabel"))
470 this->mwindow = mwindow;
472 set_tooltip(_("Next label ( ctrl -> )"));
474 EditNextLabel::~EditNextLabel()
477 int EditNextLabel::keypress_event()
480 int key = get_keypress();
481 if( (key == RIGHT || key == '.') && !alt_down() ) {
482 panel->panel_next_label(0);
485 if( key == '>' && alt_down() ) {
486 panel->panel_next_label(1);
492 int EditNextLabel::handle_event()
494 int cut = ctrl_down() && alt_down();
495 panel->panel_next_label(cut);
500 EditPrevLabel::EditPrevLabel(MWindow *mwindow,
501 EditPanel *panel, int x, int y)
502 : BC_Button(x, y, mwindow->theme->get_image_set("prevlabel"))
504 this->mwindow = mwindow;
506 set_tooltip(_("Previous label ( ctrl <- )"));
508 EditPrevLabel::~EditPrevLabel()
511 int EditPrevLabel::keypress_event()
514 int key = get_keypress();
515 if( (key == LEFT || key == ',') && !alt_down() ) {
516 panel->panel_prev_label(0);
519 if( key == '<' && alt_down() ) {
520 panel->panel_prev_label(1);
526 int EditPrevLabel::handle_event()
528 int cut = ctrl_down() && alt_down();
529 panel->panel_prev_label(cut);
534 EditPrevEdit::EditPrevEdit(MWindow *mwindow,
535 EditPanel *panel, int x, int y)
536 : BC_Button(x, y, mwindow->theme->get_image_set("prevedit"))
538 this->mwindow = mwindow;
540 set_tooltip(_("Previous edit (alt <- )"));
542 EditPrevEdit::~EditPrevEdit()
545 int EditPrevEdit::keypress_event()
548 int key = get_keypress();
549 if( (key == LEFT || key == ',') && !ctrl_down() ) {
550 panel->panel_prev_edit(0);
553 if( key == ',' && ctrl_down() ) {
554 panel->panel_prev_edit(1);
560 int EditPrevEdit::handle_event()
562 int cut = ctrl_down() && alt_down();
563 panel->panel_prev_edit(cut);
568 EditNextEdit::EditNextEdit(MWindow *mwindow,
569 EditPanel *panel, int x, int y)
570 : BC_Button(x, y, mwindow->theme->get_image_set("nextedit"))
572 this->mwindow = mwindow;
574 set_tooltip(_("Next edit ( alt -> )"));
576 EditNextEdit::~EditNextEdit()
579 int EditNextEdit::keypress_event()
582 int key = get_keypress();
583 if( (key == RIGHT || key == '.') && !ctrl_down() ) {
584 panel->panel_next_edit(0);
587 if( key == '.' && ctrl_down() ) {
588 panel->panel_next_edit(1);
594 int EditNextEdit::handle_event()
596 int cut = ctrl_down() && alt_down();
597 panel->panel_next_edit(cut);
602 EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
603 : BC_Button(x, y, mwindow->theme->get_image_set("copy"))
605 this->mwindow = mwindow;
607 set_tooltip(_("Copy ( c )"));
609 EditCopy::~EditCopy()
613 int EditCopy::keypress_event()
615 if( alt_down() ) return 0;
616 if( (get_keypress() == 'c' && !ctrl_down()) ||
617 (panel->is_vwindow() && get_keypress() == 'C') ) {
618 return handle_event();
622 int EditCopy::handle_event()
624 panel->panel_copy_selection();
628 //overwrite_selection
629 EditOverwrite::EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y)
630 : BC_Button(x, y, mwindow->theme->overwrite_data)
632 this->mwindow = mwindow;
634 set_tooltip(_("Overwrite ( b )"));
636 EditOverwrite::~EditOverwrite()
639 int EditOverwrite::handle_event()
641 panel->panel_overwrite_selection();
644 int EditOverwrite::keypress_event()
646 if( alt_down() ) return 0;
647 if( get_keypress() == 'b' ||
648 (panel->is_vwindow() && get_keypress() == 'B') ) {
657 EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
658 : BC_Button(x, y, mwindow->theme->get_image_set("inbutton"))
660 this->mwindow = mwindow;
662 set_tooltip(_("In point ( [ or < )"));
664 EditInPoint::~EditInPoint()
667 int EditInPoint::handle_event()
669 panel->panel_set_inpoint();
672 int EditInPoint::keypress_event()
674 int key = get_keypress();
677 panel->panel_unset_inoutpoint();
681 else if( !alt_down() ) {
682 if( key == '[' || key == '<' ) {
683 panel->panel_set_inpoint();
692 EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
693 : BC_Button(x, y, mwindow->theme->get_image_set("outbutton"))
695 this->mwindow = mwindow;
697 set_tooltip(_("Out point ( ] or > )"));
699 EditOutPoint::~EditOutPoint()
702 int EditOutPoint::handle_event()
704 panel->panel_set_outpoint();
707 int EditOutPoint::keypress_event()
709 int key = get_keypress();
712 panel->panel_unset_inoutpoint();
716 else if( !alt_down() ) {
717 if( key == ']' || key == '>' ) {
718 panel->panel_set_outpoint();
726 EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
727 : BC_Button(x, y, mwindow->theme->splice_data)
729 this->mwindow = mwindow;
731 set_tooltip(_("Splice ( v )"));
733 EditSplice::~EditSplice()
736 int EditSplice::handle_event()
738 panel->panel_splice_selection();
741 int EditSplice::keypress_event()
743 if( alt_down() ) return 0;
744 if( (get_keypress() == 'v' && !ctrl_down()) ||
745 (panel->is_vwindow() && get_keypress() == 'V') ) {
753 EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
754 : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
756 this->mwindow = mwindow;
758 set_tooltip(_("To clip ( i )"));
760 EditToClip::~EditToClip()
763 int EditToClip::handle_event()
765 panel->panel_to_clip();
769 int EditToClip::keypress_event()
771 if( alt_down() ) return 0;
772 if( get_keypress() == 'i' ||
773 (panel->is_vwindow() && get_keypress() == 'I') ) {
781 EditCut::EditCut(MWindow *mwindow, EditPanel *panel, int x, int y)
782 : BC_Button(x, y, mwindow->theme->get_image_set("cut"))
784 this->mwindow = mwindow;
786 set_tooltip(_("Split | Cut ( x )"));
791 int EditCut::keypress_event()
793 if( ctrl_down() || shift_down() || alt_down() )
795 if( get_keypress() == 'x' )
796 return handle_event();
800 int EditCut::handle_event()
807 EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
808 : BC_Button(x, y, mwindow->theme->get_image_set("paste"))
810 this->mwindow = mwindow;
812 set_tooltip(_("Paste ( v )"));
814 EditPaste::~EditPaste()
818 int EditPaste::keypress_event()
820 if( get_keypress() == 'v' && !ctrl_down() )
821 return handle_event();
824 int EditPaste::handle_event()
826 panel->panel_paste();
831 EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
832 : BC_Button(x, y, mwindow->theme->get_image_set("fit"))
834 this->mwindow = mwindow;
836 set_tooltip(_("Fit selection to display ( f )"));
841 int EditFit::keypress_event()
843 if( !alt_down() && get_keypress() == 'f' ) {
849 int EditFit::handle_event()
851 panel->panel_fit_selection();
856 EditFitAutos::EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y)
857 : BC_Button(x, y, mwindow->theme->get_image_set("fitautos"))
859 this->mwindow = mwindow;
861 set_tooltip(_("Fit all autos to display ( Alt + f )"));
863 EditFitAutos::~EditFitAutos()
866 int EditFitAutos::keypress_event()
868 if( get_keypress() == 'f' && alt_down() ) {
869 panel->panel_fit_autos(!ctrl_down() ? 1 : 0);
874 int EditFitAutos::handle_event()
876 panel->panel_fit_autos(1);
881 ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
883 mwindow->theme->get_image_set("arrow"),
884 mwindow->edl->session->editing_mode == EDITING_ARROW,
887 this->mwindow = mwindow;
889 set_tooltip(_("Drag and drop editing mode"));
892 int ArrowButton::handle_event()
895 panel->ibeam->update(0);
896 panel->panel_set_editing_mode(EDITING_ARROW);
897 // Nothing after this
901 IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
903 mwindow->theme->get_image_set("ibeam"),
904 mwindow->edl->session->editing_mode == EDITING_IBEAM,
907 this->mwindow = mwindow;
909 set_tooltip(_("Cut and paste editing mode"));
912 int IBeamButton::handle_event()
915 panel->arrow->update(0);
916 panel->panel_set_editing_mode(EDITING_IBEAM);
917 // Nothing after this
922 KeyFrameButton::KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y)
924 mwindow->theme->get_image_set("autokeyframe"),
925 mwindow->edl->session->auto_keyframes,
928 this->mwindow = mwindow;
930 set_tooltip(_("Generate keyframes while tweeking (j)"));
933 int KeyFrameButton::handle_event()
935 panel->panel_set_auto_keyframes(get_value());
939 int KeyFrameButton::keypress_event()
941 int key = get_keypress();
942 if( key == 'j' && !ctrl_down() && !shift_down() && !alt_down() ) {
943 int value = get_value() ? 0 : 1;
945 panel->panel_set_auto_keyframes(value);
952 SpanKeyFrameButton::SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y)
954 mwindow->theme->get_image_set("spankeyframe"),
955 mwindow->edl->session->span_keyframes,
958 this->mwindow = mwindow;
960 set_tooltip(_("Allow keyframe spanning"));
963 int SpanKeyFrameButton::handle_event()
965 panel->panel_set_span_keyframes(get_value());
969 //set_labels_follow_edits
970 LockLabelsButton::LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y)
972 mwindow->theme->get_image_set("locklabels"),
973 mwindow->edl->session->labels_follow_edits,
976 this->mwindow = mwindow;
978 set_tooltip(_("Lock labels from moving with edits"));
981 int LockLabelsButton::handle_event()
983 panel->panel_set_labels_follow_edits(get_value());
989 EditManualGoto::EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y)
990 : BC_Button(x, y, mwindow->theme->get_image_set("goto"))
992 this->mwindow = mwindow;
994 mangoto = new ManualGoto(mwindow, panel);
995 set_tooltip(_("Manual goto ( g )"));
997 EditManualGoto::~EditManualGoto()
1001 int EditManualGoto::handle_event()
1007 int EditManualGoto::keypress_event()
1009 if( get_keypress() == 'g' ) {
1017 EditClick2Play::EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y)
1018 : BC_Toggle(x, y, mwindow->theme->get_image_set("playpatch_data"),
1019 !panel->is_vwindow() ?
1020 mwindow->edl->session->cwindow_click2play :
1021 mwindow->edl->session->vwindow_click2play)
1023 this->mwindow = mwindow;
1024 this->panel = panel;
1025 set_tooltip(_("Click to play (p)"));
1027 int EditClick2Play::handle_event()
1029 int value = get_value();
1030 panel->set_click_to_play(value);
1033 int EditClick2Play::keypress_event()
1035 int key = get_keypress();
1036 if( key == 'p' && !ctrl_down() && !shift_down() && !alt_down() ) {
1037 int value = get_value() ? 0 : 1;
1039 panel->set_click_to_play(value);
1046 EditCommercial::EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y)
1047 : BC_Button(x, y, mwindow->theme->get_image_set("commercial"))
1049 this->mwindow = mwindow;
1050 this->panel = panel;
1051 set_tooltip(_("Commercial ( shift A )"));
1053 EditCommercial::~EditCommercial()
1056 int EditCommercial::keypress_event()
1058 if( ctrl_down() || !shift_down() || alt_down() )
1060 if( get_keypress() == 'A' )
1061 return handle_event();
1065 int EditCommercial::handle_event()
1067 int have_mwindow_lock = mwindow->gui->get_window_lock();
1068 if( have_mwindow_lock )
1069 mwindow->gui->unlock_window();
1070 mwindow->commit_commercial();
1071 if( !mwindow->put_commercial() ) {
1072 mwindow->gui->lock_window("EditCommercial::handle_event 1");
1074 if( !have_mwindow_lock )
1075 mwindow->gui->unlock_window();
1076 mwindow->activate_commercial();
1079 mwindow->undo_commercial();
1080 if( have_mwindow_lock )
1081 mwindow->gui->lock_window("EditCommercial::handle_event 2");
1086 EditUndo::EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y)
1087 : BC_Button(x, y, mwindow->theme->get_image_set("undo"))
1089 this->mwindow = mwindow;
1090 this->panel = panel;
1091 set_tooltip(_("Undo ( z )"));
1093 EditUndo::~EditUndo()
1096 int EditUndo::keypress_event()
1098 if( ctrl_down() || shift_down() || alt_down() )
1100 if( get_keypress() == 'z' )
1101 return handle_event();
1104 int EditUndo::handle_event()
1106 mwindow->undo_entry(panel->subwindow);
1110 EditRedo::EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y)
1111 : BC_Button(x, y, mwindow->theme->get_image_set("redo"))
1113 this->mwindow = mwindow;
1114 this->panel = panel;
1115 set_tooltip(_("Redo ( shift Z )"));
1117 EditRedo::~EditRedo()
1120 int EditRedo::keypress_event()
1122 if( ctrl_down() || !shift_down() || alt_down() )
1124 if( get_keypress() == 'Z' )
1125 return handle_event();
1128 int EditRedo::handle_event()
1130 mwindow->redo_entry(panel->subwindow);