comparison view/Pane.cpp @ 282:4edaff85875d

* Add mouse actions to key and mouse reference dialog * Use QDialogButtonBox in all dialogs, for proper button ordering across platforms (requires Qt 4.2) * Fix #1733610 program does not exit if preferences dialog visible on close
author Chris Cannam
date Thu, 05 Jul 2007 11:07:01 +0000
parents 3c402c6052f6
children 86a112b5b319
comparison
equal deleted inserted replaced
281:ac58acbd7482 282:4edaff85875d
36 #include <QPushButton> 36 #include <QPushButton>
37 #include "widgets/Thumbwheel.h" 37 #include "widgets/Thumbwheel.h"
38 #include "widgets/Panner.h" 38 #include "widgets/Panner.h"
39 #include "widgets/RangeInputDialog.h" 39 #include "widgets/RangeInputDialog.h"
40 #include "widgets/NotifyingPushButton.h" 40 #include "widgets/NotifyingPushButton.h"
41
42 #include "widgets/KeyReference.h" //!!! should probably split KeyReference into a data class in base and another that shows the widget
41 43
42 using std::cerr; 44 using std::cerr;
43 using std::endl; 45 using std::endl;
44 46
45 QCursor *Pane::m_measureCursor1 = 0; 47 QCursor *Pane::m_measureCursor1 = 0;
999 Pane::setTopLayerDisplayExtents(float dmin, float dmax) 1001 Pane::setTopLayerDisplayExtents(float dmin, float dmax)
1000 { 1002 {
1001 Layer *layer = getTopLayer(); 1003 Layer *layer = getTopLayer();
1002 if (!layer) return false; 1004 if (!layer) return false;
1003 return layer->setDisplayExtents(dmin, dmax); 1005 return layer->setDisplayExtents(dmin, dmax);
1006 }
1007
1008 void
1009 Pane::registerShortcuts(KeyReference &kr)
1010 {
1011 kr.setCategory(tr("Zoom"));
1012 kr.registerAlternativeShortcut(tr("Zoom In"), tr("Wheel Up"));
1013 kr.registerAlternativeShortcut(tr("Zoom Out"), tr("Wheel Down"));
1014
1015 kr.setCategory(tr("General Pane Mouse Actions"));
1016
1017 kr.registerShortcut(tr("Zoom"), tr("Wheel"),
1018 tr("Zoom in or out in time axis"));
1019 kr.registerShortcut(tr("Ctrl+Wheel"), tr("Scroll"),
1020 tr("Scroll rapidly left or right in time axis"));
1021 kr.registerShortcut(tr("Zoom Vertically"), tr("Shift+Wheel"),
1022 tr("Zoom in or out in the vertical axis"));
1023 kr.registerShortcut(tr("Scroll Vertically"), tr("Alt+Wheel"),
1024 tr("Scroll up or down in the vertical axis"));
1025 kr.registerShortcut(tr("Navigate"), tr("Middle"),
1026 tr("Click middle button and drag to navigate with any tool"));
1027 kr.registerShortcut(tr("Relocate"), tr("Double-Click Middle"),
1028 tr("Double-click middle button to relocate with any tool"));
1029 kr.registerShortcut(tr("Menu"), tr("Right"),
1030 tr("Show pane context menu"));
1031
1032 kr.setCategory(tr("Navigate Tool Mouse Actions"));
1033
1034 kr.registerShortcut(tr("Navigate"), tr("Left"),
1035 tr("Click left button and drag to move around"));
1036 kr.registerShortcut(tr("Zoom to Area"), tr("Shift+Left"),
1037 tr("Shift-click left button and drag to zoom to a rectangular area"));
1038 kr.registerShortcut(tr("Relocate"), tr("Double-Click Left"),
1039 tr("Double-click left button to jump to clicked location"));
1040 kr.registerShortcut(tr("Edit"), tr("Double-Click Left"),
1041 tr("Double-click left button on an item to edit it"));
1042
1043 kr.setCategory(tr("Select Tool Mouse Actions"));
1044 kr.registerShortcut(tr("Select"), tr("Left"),
1045 tr("Click left button and drag to select region; drag region edge to resize"));
1046 kr.registerShortcut(tr("Multi Select"), tr("Ctrl+Left"),
1047 tr("Ctrl-click left button and drag to select an additional region"));
1048
1049 kr.setCategory(tr("Edit Tool Mouse Actions"));
1050 kr.registerShortcut(tr("Move"), tr("Left"),
1051 tr("Click left button on an item or selected region and drag to move"));
1052 kr.registerShortcut(tr("Edit"), tr("Double-Click Left"),
1053 tr("Double-click left button on an item to edit it"));
1054
1055 kr.setCategory(tr("Draw Tool Mouse Actions"));
1056 kr.registerShortcut(tr("Draw"), tr("Left"),
1057 tr("Click left button and drag to create new item"));
1058
1059 kr.setCategory(tr("Measure Tool Mouse Actions"));
1060 kr.registerShortcut(tr("Measure Area"), tr("Left"),
1061 tr("Click left button and drag to measure a rectangular area"));
1062 kr.registerShortcut(tr("Measure Item"), tr("Double-Click Left"),
1063 tr("Click left button and drag to measure extents of an item or shape"));
1004 } 1064 }
1005 1065
1006 void 1066 void
1007 Pane::mousePressEvent(QMouseEvent *e) 1067 Pane::mousePressEvent(QMouseEvent *e)
1008 { 1068 {