Audacity  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MousePrefs Class Referencefinal

A PrefsPanel that presents an interface for user to view the default bindings of mouse buttons to commands. More...

#include <MousePrefs.h>

Inheritance diagram for MousePrefs:
PrefsPanel wxPanelWrapper wxTabTraversalWrapper< wxPanel >

Public Member Functions

 MousePrefs (wxWindow *parent, wxWindowID winid)
 Constructor. More...
 
 ~MousePrefs ()
 
bool Commit () override
 
wxString HelpPageName () override
 
void PopulateOrExchange (ShuttleGui &S) override
 Places controls on the panel and also exchanges data with them. More...
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const wxString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&...args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void Populate ()
 Creates the dialog and its contents. More...
 
void CreateList ()
 Creates the contents of mList. More...
 
void AddItem (wxString const &buttons, wxString const &tool, wxString const &action, wxString const &comment=wxEmptyString)
 Adds an item to mList. More...
 

Private Attributes

wxListCtrl * mList
 

Detailed Description

A PrefsPanel that presents an interface for user to view the default bindings of mouse buttons to commands.

April/2003: These are default bindings and are not yet configurable. They are provided to give information about what the bindings are.

Configuration when available will be mostly used by power users who are unlikely to change the default bindings, but will add bindings (e.g. for cut, play, and their own nyquist filters) using currently unused combinations.

Unlike key-bindings which are parameterless, mouse bindings provide parameters:

If we allow a nyquist filter to be bound to the mouse, instead of being applied to the current selection it would be applied to the start and end points of the drag.

Definition at line 22 of file MousePrefs.h.

Constructor & Destructor Documentation

MousePrefs::MousePrefs ( wxWindow *  parent,
wxWindowID  winid 
)

Constructor.

Definition at line 64 of file MousePrefs.cpp.

References Populate().

65 : PrefsPanel(parent, winid, _("Mouse"))
66 {
67  Populate();
68 }
PrefsPanel(wxWindow *parent, wxWindowID winid, const wxString &title)
Definition: PrefsPanel.h:48
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void Populate()
Creates the dialog and its contents.
Definition: MousePrefs.cpp:75
MousePrefs::~MousePrefs ( )

Definition at line 70 of file MousePrefs.cpp.

71 {
72 }

Member Function Documentation

void MousePrefs::AddItem ( wxString const &  buttons,
wxString const &  tool,
wxString const &  action,
wxString const &  comment = wxEmptyString 
)
private

Adds an item to mList.

Definition at line 176 of file MousePrefs.cpp.

References ActionColumn, ButtonsColumn, CommentColumn, mList, and ToolColumn.

Referenced by CreateList().

178 {
179  int i = mList->GetItemCount();
180  mList->InsertItem(i, wxT(""));
181  mList->SetItem(i, ToolColumn, tool);
182  mList->SetItem(i, ActionColumn, action);
183  mList->SetItem(i, ButtonsColumn, buttons);
184 
185  // Add a space before the text to work around a minor bug in the
186  // list control when showing narrow columns.
187  mList->SetItem(i, CommentColumn, wxT(" ") + comment);
188 }
wxListCtrl * mList
Definition: MousePrefs.h:39
bool MousePrefs::Commit ( )
overridevirtual

Update the preferences stored on disk. Currently does nothing as Mouse Preferences don't change.

Implements PrefsPanel.

Definition at line 193 of file MousePrefs.cpp.

194 {
195 // Not yet required...
196 // ShuttleGui S(this, eIsSavingToPrefs);
197 // PopulateOrExchange(S);
198  return true;
199 }
void MousePrefs::CreateList ( )
private

Creates the contents of mList.

Definition at line 100 of file MousePrefs.cpp.

References _(), ActionColumn, AddItem(), BlankColumn, ButtonsColumn, CommentColumn, CTRL, mList, and ToolColumn.

Referenced by Populate().

101 {
102  //An empty first column is a workaround - under Win98 the first column
103  //can't be right aligned.
104  mList->InsertColumn(BlankColumn, wxT(""), wxLIST_FORMAT_LEFT);
105  mList->InsertColumn(ToolColumn, _("Tool"), wxLIST_FORMAT_RIGHT);
106  mList->InsertColumn(ActionColumn, _("Command Action"), wxLIST_FORMAT_RIGHT);
107  mList->InsertColumn(ButtonsColumn, _("Buttons"), wxLIST_FORMAT_LEFT);
108  mList->InsertColumn(CommentColumn, _("Comments"), wxLIST_FORMAT_LEFT);
109 
110  AddItem(_("Left-Click"), _("Select"), _("Set Selection Point"));
111  AddItem(_("Left-Drag"), _("Select"), _("Set Selection Range"));
112  AddItem(_("Shift-Left-Click"), _("Select"), _("Extend Selection Range"));
113  AddItem(_("Left-Double-Click"), _("Select"), _("Select Clip or Entire Track"));
114 #ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
115  AddItem(_("Wheel-Rotate"), _("Select"), _("Change scrub speed"));
116 #endif
117 
118 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
119  // JKC: Prompt is disabled for now. It's a toggle rather than a drag modifier.
120  // more like Snap-to than anything else.
121  // Spectral selection
122  // AddItem(_("ESC"), _("Select"), _("Toggle center snapping in spectrogram"));
123 #endif
124 
125  AddItem(_("Left-Click"), _("Zoom"), _("Zoom in on Point"));
126  AddItem(_("Left-Drag"), _("Zoom"), _("Zoom in on a Range"), _("same as right-drag"));
127  AddItem(_("Right-Click"), _("Zoom"), _("Zoom out one step"));
128  AddItem(_("Right-Drag"), _("Zoom"), _("Zoom in on a Range"), _("same as left-drag"));
129  AddItem(_("Shift-Drag"), _("Zoom"), _("Zoom out on a Range"));
130  AddItem(_("Middle-Click"), _("Zoom"), _("Zoom default"));
131 
132  AddItem(_("Left-Drag"), _("Time-Shift"),_("Move clip left/right or between tracks"));
133  AddItem(_("Shift-Left-Drag"), _("Time-Shift"),_("Move all clips in track left/right"));
134  AddItem(CTRL + _("-Left-Drag"),_("Time-Shift"),_("Move clip up/down between tracks"));
135 
136  AddItem(_("Left-Drag"),
137  /* i18n-hint: The envelope is a curve that controls the audio loudness.*/
138  _("Envelope"),
139  _("Change Amplification Envelope"));
140 
141  AddItem(_("Left-Click"), _("Pencil"), _("Change Sample"));
142  AddItem(_("Alt-Left-Click"), _("Pencil"), _("Smooth at Sample"));
143  AddItem(_("Left-Drag"), _("Pencil"), _("Change Several Samples"));
144  AddItem(CTRL + _("-Left-Drag"),_("Pencil"), _("Change ONE Sample only"));
145 
146  AddItem(_("Left-Click"), _("Multi"), _("Set Selection Point"), _("same as select tool"));
147  AddItem(_("Left-Drag"), _("Multi"), _("Set Selection Range"), _("same as select tool"));
148  AddItem(_("Right-Click"), _("Multi"), _("Zoom out one step"), _("same as zoom tool"));
149  AddItem(_("Right-Drag"), _("Multi"), _("Zoom in on a Range"), _("same as zoom tool"));
150 
151 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
152  // JKC: Prompt is disabled for now. It's a toggle rather than a drag modifier.
153  // more like Snap-to than anything else.
154  // Spectral selection
155  // AddItem(_("ESC"), _("Select"), _("Toggle center snapping in spectrogram"), _("same as select tool"));
156 #endif
157 
158  AddItem(_("Wheel-Rotate"), _("Any"), _("Scroll tracks up or down"));
159  AddItem(_("Shift-Wheel-Rotate"), _("Any"), _("Scroll waveform"));
160  AddItem(CTRL + _("-Wheel-Rotate"), _("Any"), _("Zoom waveform in or out"));
161  AddItem(CTRL + _("-Shift-Wheel-Rotate"), _("Any"), _("Vertical Scale Waveform (dB) range"));
162 
163  mList->SetColumnWidth(BlankColumn, 0);
164  mList->SetColumnWidth(ToolColumn, wxLIST_AUTOSIZE);
165  mList->SetColumnWidth(ActionColumn, wxLIST_AUTOSIZE);
166  mList->SetColumnWidth(ButtonsColumn, wxLIST_AUTOSIZE);
167 
168  // Not sure if this extra column is a good idea or not.
169  // Anyway, 5 pixels wide is wide enough that some people who are curious will drag it
170  // wider to see what's there (the comments show that the duplication of functions
171  // is for a reason, and not just random).
172  mList->SetColumnWidth(CommentColumn, 5);
173 }
#define CTRL
Definition: MousePrefs.cpp:60
void AddItem(wxString const &buttons, wxString const &tool, wxString const &action, wxString const &comment=wxEmptyString)
Adds an item to mList.
Definition: MousePrefs.cpp:176
wxListCtrl * mList
Definition: MousePrefs.h:39
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxString MousePrefs::HelpPageName ( )
overridevirtual

Reimplemented from PrefsPanel.

Definition at line 201 of file MousePrefs.cpp.

202 {
203  return "Mouse_Preferences";
204 }
void MousePrefs::Populate ( )
private

Creates the dialog and its contents.

Definition at line 75 of file MousePrefs.cpp.

References CreateList(), eIsCreatingFromPrefs, and PopulateOrExchange().

Referenced by MousePrefs().

76 {
77  //------------------------- Main section --------------------
78  // Now construct the GUI itself.
79  // Use 'eIsCreatingFromPrefs' so that the GUI is
80  // initialised with values from gPrefs.
83  // ----------------------- End of main section --------------
84  CreateList();
85 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void PopulateOrExchange(ShuttleGui &S) override
Places controls on the panel and also exchanges data with them.
Definition: MousePrefs.cpp:88
void CreateList()
Creates the contents of mList.
Definition: MousePrefs.cpp:100
void MousePrefs::PopulateOrExchange ( ShuttleGui S)
override

Places controls on the panel and also exchanges data with them.

Definition at line 88 of file MousePrefs.cpp.

References _(), ShuttleGuiBase::AddListControlReportMode(), ShuttleGuiBase::EndStatic(), mList, ShuttleGuiBase::SetBorder(), and ShuttleGuiBase::StartStatic().

Referenced by Populate().

89 {
90  S.SetBorder(2);
91 
92  S.StartStatic(_("Mouse Bindings (default values, not configurable)"), 1);
93  {
95  }
96  S.EndStatic();
97 }
wxListCtrl * AddListControlReportMode()
Definition: ShuttleGui.cpp:689
wxListCtrl * mList
Definition: MousePrefs.h:39
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:763
void SetBorder(int Border)
Definition: ShuttleGui.h:286

Member Data Documentation

wxListCtrl* MousePrefs::mList
private

Definition at line 39 of file MousePrefs.h.

Referenced by AddItem(), CreateList(), and PopulateOrExchange().


The documentation for this class was generated from the following files: