Audacity  2.2.2
AButton.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  AButton.cpp
6 
7  Dominic Mazzoni
8 
9 *******************************************************************//*******************************************************************/
23 
24 #include "../Audacity.h"
25 
26 #include "AButton.h"
27 #include "../AColor.h"
28 
29 #include <wx/app.h>
30 #include <wx/dcclient.h>
31 #include <wx/dcmemory.h>
32 #include <wx/dcbuffer.h>
33 #include <wx/eventfilter.h>
34 #include <wx/image.h>
35 #include <wx/timer.h>
36 
37 //This is needed for tooltips
38 #include "../Project.h"
39 #include <wx/tooltip.h>
40 
41 BEGIN_EVENT_TABLE(AButton, wxWindow)
42  EVT_MOUSE_EVENTS(AButton::OnMouseEvent)
43  EVT_MOUSE_CAPTURE_LOST(AButton::OnCaptureLost)
44  EVT_KEY_DOWN(AButton::OnKeyDown)
45  EVT_SET_FOCUS(AButton::OnSetFocus)
46  EVT_KILL_FOCUS(AButton::OnKillFocus)
47  EVT_PAINT(AButton::OnPaint)
48  EVT_SIZE(AButton::OnSize)
49  EVT_ERASE_BACKGROUND(AButton::OnErase)
51 
52 // LL: An alternative to this might be to just use the wxEVT_KILL_FOCUS
53 // or wxEVT_ACTIVATE events.
54 class AButton::Listener final
55  : public wxEventFilter
56 {
57 public:
58  Listener (AButton *button);
59  ~Listener();
60 
61  int FilterEvent(wxEvent &event) override;
62 
63  void OnEvent();
64 
65 private:
67 };
68 
70 : mButton(button)
71 {
72  wxEvtHandler::AddFilter(this);
73 }
74 
76 {
77  wxEvtHandler::RemoveFilter(this);
78 }
79 
81 {
82  if (!mButton->IsDown())
83  {
84  int idx = 0;
85  // Ignore the event, consult key states. One modifier key might
86  // have gone up but another remained down.
87  // Note that CMD (or CTRL) takes precedence over Shift if both are down
88  // and alternates are defined for both
89  // see also AButton::OnMouseEvent()
90  if (wxGetKeyState(WXK_CONTROL) && mButton->HasAlternateImages(2))
91  idx = 2;
92  else if (wxGetKeyState(WXK_SHIFT) && mButton->HasAlternateImages(1))
93  idx = 1;
94 
95  // Turn e.g. the "Play" button into a "Loop" button
96  // or "Cut Preview" button
97  mButton->SetAlternateIdx(idx);
98  }
99 }
100 
102 {
103  if (event.GetEventType() == wxEVT_KEY_DOWN ||
104  event.GetEventType() == wxEVT_KEY_UP)
105  OnEvent();
106  else if (event.GetEventType() == wxEVT_SET_FOCUS)
107  // A modal dialog might have eaten the modifier key-up with its own
108  // filter before we saw it; this is adequate to fix the button image
109  // when the dialog disappears.
110  OnEvent();
111  return Event_Skip;
112 }
113 
114 AButton::AButton(wxWindow * parent,
115  wxWindowID id,
116  const wxPoint & pos,
117  const wxSize & size,
118  wxImage up,
119  wxImage over,
120  wxImage down,
121  wxImage overDown,
122  wxImage dis,
123  bool toggle):
124  wxWindow()
125 {
126  Init(parent, id, pos, size,
127  ImageRoll(up), ImageRoll(over),
128  ImageRoll(down), ImageRoll(overDown), ImageRoll(dis),
129  toggle);
130 }
131 
132 AButton::AButton(wxWindow * parent,
133  wxWindowID id,
134  const wxPoint & pos,
135  const wxSize & size,
136  ImageRoll up,
137  ImageRoll over,
138  ImageRoll down,
139  ImageRoll overDown,
140  ImageRoll dis,
141  bool toggle):
142  wxWindow()
143 {
144  Init(parent, id, pos, size,
145  up, over, down, overDown, dis,
146  toggle);
147 }
148 
150 {
151  if(HasCapture())
152  ReleaseMouse();
153 }
154 
155 void AButton::Init(wxWindow * parent,
156  wxWindowID id,
157  const wxPoint & pos,
158  const wxSize & size,
159  ImageRoll up,
160  ImageRoll over,
161  ImageRoll down,
162  ImageRoll overDown,
163  ImageRoll dis,
164  bool toggle)
165 {
166  // Bug in wxWidgets 2.8.12: by default pressing Enter on an AButton is interpreted as
167  // a navigation event - move to next control. As a workaround, the style wxWANTS_CHARS
168  // results in all characters being available in the OnKeyDown function below. Note
169  // that OnKeyDown now has to handle navigation.
170  Create(parent, id, pos, size, wxWANTS_CHARS);
171 
172  mWasShiftDown = false;
173  mWasControlDown = false;
174  mButtonIsDown = false;
175  mIsClicking = false;
176  mEnabled = true;
177  mCursorIsInWindow = false;
178  mToggle = toggle;
180 
181  mImages.resize(1);
182  mImages[0].mArr[0] = up;
183  mImages[0].mArr[1] = over;
184  mImages[0].mArr[2] = down;
185  mImages[0].mArr[3] = overDown;
186  mImages[0].mArr[4] = dis;
187 
188  mAlternateIdx = 0;
189 
190  mFocusRect = GetClientRect().Deflate( 3, 3 );
191  mForceFocusRect = false;
192 
193  SetSizeHints(mImages[0].mArr[0].GetMinSize(),
194  mImages[0].mArr[0].GetMaxSize());
195 
196 #if wxUSE_ACCESSIBILITY
197  SetName( wxT("") );
198  SetAccessible(safenew AButtonAx(this));
199 #endif
200 }
201 
203 {
205 }
206 
207 // This compensates for a but in wxWidgets 3.0.2 for mac:
208 // Couldn't set focus from keyboard when AcceptsFocus returns false;
209 // this bypasses that limitation
211 {
212  auto temp = TemporarilyAllowFocus();
213  SetFocus();
214 }
215 
216 void AButton::SetAlternateImages(unsigned idx,
217  wxImage up,
218  wxImage over,
219  wxImage down,
220  wxImage overDown,
221  wxImage dis)
222 {
223  if (1 + idx > mImages.size())
224  mImages.resize(1 + idx);
225  mImages[idx].mArr[0] = ImageRoll(up);
226  mImages[idx].mArr[1] = ImageRoll(over);
227  mImages[idx].mArr[2] = ImageRoll(down);
228  mImages[idx].mArr[3] = ImageRoll(overDown);
229  mImages[idx].mArr[4] = ImageRoll(dis);
230 }
231 
232 void AButton::SetAlternateImages(unsigned idx,
233  ImageRoll up,
234  ImageRoll over,
235  ImageRoll down,
236  ImageRoll overDown,
237  ImageRoll dis)
238 {
239  if (1 + idx > mImages.size())
240  mImages.resize(1 + idx);
241  mImages[idx].mArr[0] = up;
242  mImages[idx].mArr[1] = over;
243  mImages[idx].mArr[2] = down;
244  mImages[idx].mArr[3] = overDown;
245  mImages[idx].mArr[4] = dis;
246 }
247 
248 void AButton::SetAlternateIdx(unsigned idx)
249 {
250  // If alternate-image-state is already correct then
251  // nothing to do (saves repainting button).
252  if( mAlternateIdx == idx )
253  return;
254  mAlternateIdx = idx;
255  Refresh(false);
256 }
257 
259 {
260  if(!mListener)
261  mListener = std::make_unique<Listener>(this);
262 }
263 
264 void AButton::SetFocusRect(wxRect & r)
265 {
266  mFocusRect = r;
267  mForceFocusRect = true;
268 }
269 
271 {
272  AButtonState state;
273 
274  if (!mEnabled && (!mToggle || !mButtonIsDown))
275  return AButtonDis;
276 
277  if (mCursorIsInWindow) {
278  if (mToggle) {
279  if (mIsClicking) {
280  state = mButtonIsDown ? AButtonUp : AButtonDown;
283  }
284  }
285  else {
289  }
290  }
291  }
292  else {
293  if (mIsClicking) {
295  }
296  else {
298  }
299  }
300  }
301  else {
302  //if (mToggle) {
303  state = mButtonIsDown ? AButtonDown : AButtonUp;
304  //}
305  //else {
306  //state = mButtonIsDown ? AButtonDown : AButtonUp;
307  //}
308  }
309 
310  return state;
311 }
312 
313 void AButton::OnPaint(wxPaintEvent & WXUNUSED(event))
314 {
315  wxBufferedPaintDC dc(this);
316 
317  AButtonState buttonState = GetState();
318 
319  mImages[mAlternateIdx].mArr[buttonState].Draw(dc, GetClientRect());
320 
321  if( this == wxWindow::FindFocus() )
322  {
324  }
325 }
326 
327 void AButton::OnErase(wxEraseEvent & WXUNUSED(event))
328 {
329  // Ignore it to prevent flashing
330 }
331 
332 void AButton::OnSize(wxSizeEvent & WXUNUSED(event))
333 {
334  if (!mForceFocusRect)
335  {
336  mFocusRect = GetClientRect().Deflate( 3, 3 );
337  }
338  Refresh(false);
339 }
340 
341 bool AButton::s_AcceptsFocus{ false };
342 
343 bool AButton::HasAlternateImages(unsigned idx)
344 {
345  if (mImages.size() <= idx)
346  return false;
347 
348  const ImageArr &images = mImages[idx];
349  const ImageRoll (&arr)[5] = images.mArr;
350  return (arr[0].Ok() &&
351  arr[1].Ok() &&
352  arr[2].Ok() &&
353  arr[3].Ok() &&
354  arr[4].Ok());
355 }
356 
357 void AButton::OnMouseEvent(wxMouseEvent & event)
358 {
359  wxSize clientSize = GetClientSize();
360  AButtonState prevState = GetState();
361 
362  if (event.Entering()) {
363  // Bug 1201: On Mac, unsetting and re-setting the tooltip may be needed
364  // to make it pop up when we want it.
365  auto text = GetToolTipText();
366  UnsetToolTip();
367  SetToolTip(text);
368  mCursorIsInWindow = true;
369  }
370  else if (event.Leaving())
371  mCursorIsInWindow = false;
372  else
374  (event.m_x >= 0 && event.m_y >= 0 &&
375  event.m_x < clientSize.x && event.m_y < clientSize.y);
376 
377  if (mEnabled && event.IsButton()) {
378  if (event.ButtonIsDown(wxMOUSE_BTN_ANY)) {
379  mIsClicking = true;
380  if (event.ButtonDClick())
381  mIsDoubleClicked = true;
382  if( !HasCapture() )
383  CaptureMouse();
384  }
385  else if (mIsClicking) {
386  mIsClicking = false;
387 
388  if (HasCapture())
389  ReleaseMouse();
390 
391  if (mCursorIsInWindow && (mToggle || !mButtonIsDown)) {
392  if (mToggle)
394  else
395  mButtonIsDown = true;
396 
397  mWasShiftDown = event.ShiftDown();
398  mWasControlDown = event.ControlDown();
399 
400  Click();
401  }
402  }
403  }
404 
405  // Only redraw and change tooltips if the state has changed.
406  AButtonState newState = GetState();
407 
408  if (newState != prevState) {
409  Refresh(false);
410 
411  if (mCursorIsInWindow)
412  UpdateStatus();
413  else {
415  }
416  }
417  else
418  event.Skip();
419 }
420 
422 {
423  if (mCursorIsInWindow) {
424 #if wxUSE_TOOLTIPS // Not available in wxX11
425  // Display the tooltip in the status bar
426  wxToolTip * pTip = this->GetToolTip();
427  if( pTip ) {
428  wxString tipText = pTip->GetTip();
429  if (!mEnabled)
430  tipText += _(" (disabled)");
432  }
433 #endif
434  }
435 }
436 
437 void AButton::OnCaptureLost(wxMouseCaptureLostEvent & WXUNUSED(event))
438 {
439  wxMouseEvent e(wxEVT_LEFT_UP);
440  e.m_x = -1;
441  e.m_y = -1;
442  OnMouseEvent(e);
443 }
444 
445 // Note that OnKeyDown has to handle navigation because wxWANTS_CHARS
446 // flag was set - see above.
447 void AButton::OnKeyDown(wxKeyEvent & event)
448 {
449  switch( event.GetKeyCode() )
450  {
451  case WXK_RIGHT:
452  Navigate(wxNavigationKeyEvent::IsForward);
453  break;
454  case WXK_LEFT:
455  Navigate(wxNavigationKeyEvent::IsBackward);
456  break;
457  case WXK_TAB:
458  Navigate(event.ShiftDown()
459  ? wxNavigationKeyEvent::IsBackward
460  : wxNavigationKeyEvent::IsForward);
461  break;
462  case WXK_RETURN:
463  case WXK_NUMPAD_ENTER:
464  if( !mEnabled )
465  break;
466  mWasShiftDown = event.ShiftDown();
467  mWasControlDown = event.ControlDown();
468  Click();
469  break;
470  default:
471  event.Skip();
472  }
473 }
474 
475 void AButton::OnSetFocus(wxFocusEvent & WXUNUSED(event))
476 {
477  Refresh( false );
478 }
479 
480 void AButton::OnKillFocus(wxFocusEvent & WXUNUSED(event))
481 {
482  Refresh( false );
483 }
484 
486 {
487  return mWasShiftDown;
488 }
489 
491 {
492  return mWasControlDown;
493 }
494 
496 {
497  wxWindow::Enable(true);
498  mEnabled = true;
499  Refresh(false);
500 }
501 
503 {
504  // Bug 1565: Tooltips not showing on disabled buttons.
505  // The fix is to NOT tell windows that the button is disabled.
506  // The button's appearance will still change to show it is disabled
507  // since we control that rather than windows.
508 #ifndef __WXMSW__
509  wxWindow::Enable(false);
510 #endif
511  mEnabled = false;
512  if (GetCapture()==this)
513  ReleaseMouse();
514  Refresh(false);
515 }
516 
518 {
519  if (!mButtonIsDown) {
520  mButtonIsDown = true;
521  this->Refresh(false);
522  }
523 }
524 
526 {
527  if (mButtonIsDown) {
528  mButtonIsDown = false;
529 
530  this->Refresh(false);
531  }
532 
533  if (GetCapture()==this)
534  ReleaseMouse();
535 }
536 
538 {
539  wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
540  event.SetEventObject(this);
541  // Be sure to use SafelyProcessEvent so that exceptions do not propagate
542  // out of DoDefaultAction
543  GetEventHandler()->SafelyProcessEvent(event);
544 }
545 
546 void AButton::SetShift(bool shift)
547 {
548  mWasShiftDown = shift;
549 }
550 
551 void AButton::SetControl(bool control)
552 {
553  mWasControlDown = control;
554 }
555 
557  s_AcceptsFocus = true;
558  return TempAllowFocus{ &s_AcceptsFocus };
559 }
560 
561 #if wxUSE_ACCESSIBILITY
562 
563 AButtonAx::AButtonAx( wxWindow *window ):
564  WindowAccessible( window )
565 {
566 }
567 
568 AButtonAx::~AButtonAx()
569 {
570 }
571 
572 // Performs the default action. childId is 0 (the action for this object)
573 // or > 0 (the action for a child).
574 // Return wxACC_NOT_SUPPORTED if there is no default action for this
575 // window (e.g. an edit control).
576 wxAccStatus AButtonAx::DoDefaultAction(int WXUNUSED(childId))
577 {
578  AButton *ab = wxDynamicCast( GetWindow(), AButton );
579 
580  if(ab && ab->IsEnabled()) {
581  ab->mWasShiftDown = false;
582  ab->mWasControlDown = false;
583  ab->Click();
584  }
585 
586  return wxACC_OK;
587 }
588 
589 // Retrieves the address of an IDispatch interface for the specified child.
590 // All objects must support this property.
591 wxAccStatus AButtonAx::GetChild( int childId, wxAccessible** child )
592 {
593  if( childId == wxACC_SELF )
594  {
595  *child = this;
596  }
597  else
598  {
599  *child = NULL;
600  }
601 
602  return wxACC_OK;
603 }
604 
605 // Gets the number of children.
606 wxAccStatus AButtonAx::GetChildCount(int* childCount)
607 {
608  *childCount = 0;
609 
610  return wxACC_OK;
611 }
612 
613 // Gets the default action for this object (0) or > 0 (the action for
614 // a child). Return wxACC_OK even if there is no action. actionName
615 // is the action, or the empty string if there is no action. The
616 // retrieved string describes the action that is performed on an
617 // object, not what the object does as a result. For example, a
618 // toolbar button that prints a document has a default action of
619 // "Press" rather than "Prints the current document."
620 wxAccStatus AButtonAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionName)
621 {
622  *actionName = _( "Press" );
623 
624  return wxACC_OK;
625 }
626 
627 // Returns the description for this object or a child.
628 wxAccStatus AButtonAx::GetDescription( int WXUNUSED(childId), wxString *description )
629 {
630  description->Clear();
631 
632  return wxACC_OK;
633 }
634 
635 // Gets the window with the keyboard focus.
636 // If childId is 0 and child is NULL, no object in
637 // this subhierarchy has the focus.
638 // If this object has the focus, child should be 'this'.
639 wxAccStatus AButtonAx::GetFocus(int* childId, wxAccessible** child)
640 {
641  *childId = 0;
642  *child = this;
643 
644  return wxACC_OK;
645 }
646 
647 // Returns help text for this object or a child, similar to tooltip text.
648 wxAccStatus AButtonAx::GetHelpText( int WXUNUSED(childId), wxString *helpText )
649 {
650 #if wxUSE_TOOLTIPS // Not available in wxX11
651  AButton *ab = wxDynamicCast( GetWindow(), AButton );
652 
653  wxToolTip *pTip = ab->GetToolTip();
654  if( pTip )
655  {
656  *helpText = pTip->GetTip();
657  }
658 
659  return wxACC_OK;
660 #else
661  helpText->Clear();
662 
663  return wxACC_NOT_SUPPORTED;
664 #endif
665 }
666 
667 // Returns the keyboard shortcut for this object or child.
668 // Return e.g. ALT+K
669 wxAccStatus AButtonAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut )
670 {
671  shortcut->Clear();
672 
673  return wxACC_OK;
674 }
675 
676 // Returns the rectangle for this object (id = 0) or a child element (id > 0).
677 // rect is in screen coordinates.
678 wxAccStatus AButtonAx::GetLocation( wxRect& rect, int WXUNUSED(elementId) )
679 {
680  AButton *ab = wxDynamicCast( GetWindow(), AButton );
681 
682  rect = ab->GetRect();
683  rect.SetPosition( ab->GetParent()->ClientToScreen( rect.GetPosition() ) );
684 
685  return wxACC_OK;
686 }
687 
688 // Gets the name of the specified object.
689 wxAccStatus AButtonAx::GetName(int WXUNUSED(childId), wxString* name)
690 {
691  AButton *ab = wxDynamicCast( GetWindow(), AButton );
692 
693  *name = ab->GetName();
694  if( name->IsEmpty() )
695  {
696  *name = ab->GetLabel();
697  }
698 
699  if( name->IsEmpty() )
700  {
701  *name = _("Button");
702  }
703 
704  return wxACC_OK;
705 }
706 
707 // Returns a role constant.
708 wxAccStatus AButtonAx::GetRole(int WXUNUSED(childId), wxAccRole* role)
709 {
710  *role = wxROLE_SYSTEM_PUSHBUTTON;
711 
712  return wxACC_OK;
713 }
714 
715 // Gets a variant representing the selected children
716 // of this object.
717 // Acceptable values:
718 // - a null variant (IsNull() returns TRUE)
719 // - a list variant (GetType() == wxT("list"))
720 // - an integer representing the selected child element,
721 // or 0 if this object is selected (GetType() == wxT("long"))
722 // - a "void*" pointer to a wxAccessible child object
723 wxAccStatus AButtonAx::GetSelections( wxVariant * WXUNUSED(selections) )
724 {
725  return wxACC_NOT_IMPLEMENTED;
726 }
727 
728 // Returns a state constant.
729 wxAccStatus AButtonAx::GetState(int WXUNUSED(childId), long* state)
730 {
731  AButton *ab = wxDynamicCast( GetWindow(), AButton );
732 
733  switch( ab->GetState() )
734  {
736  *state = wxACC_STATE_SYSTEM_PRESSED | wxACC_STATE_SYSTEM_FOCUSABLE;
737  break;
738 
740  *state = wxACC_STATE_SYSTEM_HOTTRACKED | wxACC_STATE_SYSTEM_FOCUSABLE;
741  break;
742 
744  *state = wxACC_STATE_SYSTEM_HOTTRACKED | wxACC_STATE_SYSTEM_PRESSED |
745  wxACC_STATE_SYSTEM_FOCUSABLE;
746  break;
747 
748  case AButton::AButtonDis:
749  *state = wxACC_STATE_SYSTEM_UNAVAILABLE;
750  break;
751 
752  default:
753  *state = wxACC_STATE_SYSTEM_FOCUSABLE;
754  break;
755  }
756 
757  *state |= ( ab == wxWindow::FindFocus() ? wxACC_STATE_SYSTEM_FOCUSED : 0 );
758 
759  return wxACC_OK;
760 }
761 
762 // Returns a localized string representing the value for the object
763 // or child.
764 wxAccStatus AButtonAx::GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue))
765 {
766  return wxACC_NOT_SUPPORTED;
767 }
768 
769 #endif
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:248
std::unique_ptr< bool, Resetter > TempAllowFocus
Definition: AButton.h:153
bool mWasShiftDown
Definition: AButton.h:181
bool mIsDoubleClicked
Definition: AButton.h:189
void OnKillFocus(wxFocusEvent &event)
Definition: AButton.cpp:480
void SetAlternateImages(unsigned idx, ImageRoll up, ImageRoll over, ImageRoll down, ImageRoll overDown, ImageRoll dis)
Definition: AButton.cpp:232
void PopUp()
Definition: AButton.cpp:525
void OnMouseEvent(wxMouseEvent &event)
Definition: AButton.cpp:357
void SetShift(bool shift)
Definition: AButton.cpp:546
bool WasShiftDown()
Definition: AButton.cpp:485
void SetFocusRect(wxRect &r)
Definition: AButton.cpp:264
friend class AButtonAx
Definition: AButton.h:29
AButtonState
Definition: AButton.h:138
void FollowModifierKeys()
Definition: AButton.cpp:258
AButton * mButton
Definition: AButton.cpp:66
void OnSize(wxSizeEvent &event)
Definition: AButton.cpp:332
bool mToggle
Definition: AButton.h:174
static void DrawFocus(wxDC &dc, wxRect &r)
Definition: AColor.cpp:171
bool IsEnabled() const
Definition: AButton.h:95
#define safenew
Definition: Audacity.h:230
bool mCursorIsInWindow
Definition: AButton.h:184
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
std::vector< ImageArr > mImages
Definition: AButton.h:192
wxRect mFocusRect
Definition: AButton.h:194
bool mIsClicking
Definition: AButton.h:186
bool mButtonIsDown
Definition: AButton.h:185
ImageRoll mArr[5]
Definition: AButton.h:191
unsigned mAlternateIdx
Definition: AButton.h:173
void SetFocusFromKbd() override
Definition: AButton.cpp:210
void SetControl(bool control)
Definition: AButton.cpp:551
std::unique_ptr< Listener > mListener
Definition: AButton.h:197
virtual ~AButton()
Definition: AButton.cpp:149
bool mUseDisabledAsDownHiliteImage
Definition: AButton.h:188
void OnPaint(wxPaintEvent &event)
Definition: AButton.cpp:313
bool WasControlDown()
Definition: AButton.cpp:490
static bool s_AcceptsFocus
Definition: AButton.h:151
void OnErase(wxEraseEvent &event)
Definition: AButton.cpp:327
void TP_DisplayStatusMessage(const wxString &msg) override
Definition: Project.cpp:5404
void Disable()
Definition: AButton.cpp:502
_("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 OnCaptureLost(wxMouseCaptureLostEvent &event)
Definition: AButton.cpp:437
void Init(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, ImageRoll up, ImageRoll over, ImageRoll down, ImageRoll overDown, ImageRoll dis, bool toggle)
Definition: AButton.cpp:155
const wxChar * name
Definition: Distortion.cpp:94
void Enable()
Definition: AButton.cpp:495
Listener(AButton *button)
Definition: AButton.cpp:69
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:309
void OnSetFocus(wxFocusEvent &event)
Definition: AButton.cpp:475
void UseDisabledAsDownHiliteImage(bool flag)
Definition: AButton.cpp:202
int FilterEvent(wxEvent &event) override
Definition: AButton.cpp:101
AButtonState GetState()
Definition: AButton.cpp:270
bool mWasControlDown
Definition: AButton.h:182
AButton(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, ImageRoll up, ImageRoll over, ImageRoll down, ImageRoll overDown, ImageRoll dis, bool toggle)
Definition: AButton.cpp:132
void OnKeyDown(wxKeyEvent &event)
Definition: AButton.cpp:447
bool mEnabled
Definition: AButton.h:187
void PushDown()
Definition: AButton.cpp:517
END_EVENT_TABLE()
bool mForceFocusRect
Definition: AButton.h:195
void Click()
Definition: AButton.cpp:537
bool HasAlternateImages(unsigned idx)
Definition: AButton.cpp:343
static TempAllowFocus TemporarilyAllowFocus()
Definition: AButton.cpp:556
An ImageRoll is an image that can be expanded to an arbitrary size; it is made up of both fixed piece...
Definition: ImageRoll.h:29
A wxButton with mouse-over behaviour.
Definition: AButton.h:28
void UpdateStatus()
Definition: AButton.cpp:421