Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AdornedRulerPanel::CommonRulerHandle Class Reference
Inheritance diagram for AdornedRulerPanel::CommonRulerHandle:
[legend]
Collaboration diagram for AdornedRulerPanel::CommonRulerHandle:
[legend]

Public Member Functions

 CommonRulerHandle (AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice)
 
bool Clicked () const
 
- Public Member Functions inherited from UIHandle
virtual ~UIHandle ()=0
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool HasEscape () const
 
virtual bool Escape (AudacityProject *pProject)
 
virtual HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0
 
virtual bool StopsOnKeystroke ()
 
virtual void OnProjectChange (AudacityProject *pProject)
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 

Static Public Member Functions

static UIHandle::Result NeedChangeHighlight (const CommonRulerHandle &oldState, const CommonRulerHandle &newState)
 
- Static Public Member Functions inherited from UIHandle
static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 

Protected Types

enum  Button { Button::None, Button::Left, Button::Right }
 

Protected Member Functions

bool HandlesRightClick () override
 Whether the handle has any special right-button handling. More...
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *) override
 
Result Drag (const TrackPanelMouseEvent &, AudacityProject *) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *, wxWindow *) override
 
Result Cancel (AudacityProject *) override
 
void Enter (bool, AudacityProject *) override
 

Protected Attributes

wxWeakRef< AdornedRulerPanelmParent
 
wxCoord mX
 
MenuChoice mChoice
 
Button mClicked { Button::None }
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Additional Inherited Members

- Public Types inherited from UIHandle
using Result = unsigned
 
using Cell = TrackPanelCell
 

Detailed Description

Definition at line 115 of file AdornedRulerPanel.cpp.

Member Enumeration Documentation

◆ Button

Enumerator
None 
Left 
Right 

Definition at line 179 of file AdornedRulerPanel.cpp.

179 { None, Left, Right };

Constructor & Destructor Documentation

◆ CommonRulerHandle()

AdornedRulerPanel::CommonRulerHandle::CommonRulerHandle ( AdornedRulerPanel pParent,
wxCoord  xx,
MenuChoice  menuChoice 
)
inlineexplicit

Definition at line 119 of file AdornedRulerPanel.cpp.

121  : mParent(pParent)
122  , mX( xx )
123  , mChoice( menuChoice )
124  {}

Member Function Documentation

◆ Cancel()

Result AdornedRulerPanel::CommonRulerHandle::Cancel ( AudacityProject )
inlineoverrideprotectedvirtual

Implements UIHandle.

Reimplemented in AdornedRulerPanel::ScrubbingHandle.

Definition at line 163 of file AdornedRulerPanel.cpp.

164  {
166  }

References RefreshCode::DrawOverlays.

Referenced by AdornedRulerPanel::ScrubbingHandle::Cancel().

Here is the caller graph for this function:

◆ Click()

Result AdornedRulerPanel::CommonRulerHandle::Click ( const TrackPanelMouseEvent event,
AudacityProject  
)
inlineoverrideprotectedvirtual

Implements UIHandle.

Reimplemented in AdornedRulerPanel::ScrubbingHandle.

Definition at line 139 of file AdornedRulerPanel.cpp.

141  {
142  mClicked = event.event.LeftIsDown() ? Button::Left : Button::Right;
144  }

References RefreshCode::DrawOverlays, Left, mClicked, and Right.

Referenced by AdornedRulerPanel::ScrubbingHandle::Click().

Here is the caller graph for this function:

◆ Clicked()

bool AdornedRulerPanel::CommonRulerHandle::Clicked ( ) const
inline

Definition at line 126 of file AdornedRulerPanel.cpp.

126 { return mClicked != Button::None; }

References mClicked, and None.

◆ Drag()

Result AdornedRulerPanel::CommonRulerHandle::Drag ( const TrackPanelMouseEvent ,
AudacityProject  
)
inlineoverrideprotectedvirtual

Implements UIHandle.

Reimplemented in AdornedRulerPanel::ScrubbingHandle.

Definition at line 146 of file AdornedRulerPanel.cpp.

148  {
150  }

References RefreshCode::DrawOverlays.

Referenced by AdornedRulerPanel::ScrubbingHandle::Drag().

Here is the caller graph for this function:

◆ Enter()

void AdornedRulerPanel::CommonRulerHandle::Enter ( bool  ,
AudacityProject  
)
inlineoverrideprotectedvirtual

Reimplemented from UIHandle.

Definition at line 168 of file AdornedRulerPanel.cpp.

169  {
171  }

References RefreshCode::DrawOverlays, and UIHandle::mChangeHighlight.

◆ HandlesRightClick()

bool AdornedRulerPanel::CommonRulerHandle::HandlesRightClick ( )
inlineoverrideprotectedvirtual

Whether the handle has any special right-button handling.

If not, then Click() will not be called for right click. Default is always false

Reimplemented from UIHandle.

Definition at line 137 of file AdornedRulerPanel.cpp.

137 { return true; }

◆ NeedChangeHighlight()

static UIHandle::Result AdornedRulerPanel::CommonRulerHandle::NeedChangeHighlight ( const CommonRulerHandle oldState,
const CommonRulerHandle newState 
)
inlinestatic

Definition at line 128 of file AdornedRulerPanel.cpp.

130  {
131  if (oldState.mX != newState.mX)
133  return 0;
134  }

References RefreshCode::DrawOverlays, and mX.

◆ Release()

Result AdornedRulerPanel::CommonRulerHandle::Release ( const TrackPanelMouseEvent event,
AudacityProject ,
wxWindow *   
)
inlineoverrideprotectedvirtual

Implements UIHandle.

Reimplemented in AdornedRulerPanel::ScrubbingHandle.

Definition at line 152 of file AdornedRulerPanel.cpp.

155  {
156  if ( mParent && mClicked == Button::Right ) {
157  const auto pos = event.event.GetPosition();
158  mParent->ShowContextMenu( mChoice, &pos );
159  }
161  }

References RefreshCode::DrawOverlays, mChoice, mClicked, mParent, and Right.

Referenced by AdornedRulerPanel::ScrubbingHandle::Release().

Here is the caller graph for this function:

Member Data Documentation

◆ mChoice

MenuChoice AdornedRulerPanel::CommonRulerHandle::mChoice
protected

Definition at line 177 of file AdornedRulerPanel.cpp.

Referenced by Release().

◆ mClicked

Button AdornedRulerPanel::CommonRulerHandle::mClicked { Button::None }
protected

◆ mParent

wxWeakRef<AdornedRulerPanel> AdornedRulerPanel::CommonRulerHandle::mParent
protected

Definition at line 173 of file AdornedRulerPanel.cpp.

Referenced by AdornedRulerPanel::ScrubbingHandle::Click(), and Release().

◆ mX

wxCoord AdornedRulerPanel::CommonRulerHandle::mX
protected

Definition at line 175 of file AdornedRulerPanel.cpp.

Referenced by NeedChangeHighlight().


The documentation for this class was generated from the following file:
RefreshCode::DrawOverlays
@ DrawOverlays
Definition: RefreshCode.h:32
AdornedRulerPanel::CommonRulerHandle::mChoice
MenuChoice mChoice
Definition: AdornedRulerPanel.cpp:177
AdornedRulerPanel::CommonRulerHandle::mParent
wxWeakRef< AdornedRulerPanel > mParent
Definition: AdornedRulerPanel.cpp:173
TrackKind::None
@ None
no class
AdornedRulerPanel::CommonRulerHandle::Button::None
@ None
AdornedRulerPanel::CommonRulerHandle::Button::Left
@ Left
UIHandle::mChangeHighlight
Result mChangeHighlight
Definition: UIHandle.h:139
AdornedRulerPanel::CommonRulerHandle::mX
wxCoord mX
Definition: AdornedRulerPanel.cpp:175
AdornedRulerPanel::CommonRulerHandle::Button::Right
@ Right
AdornedRulerPanel::CommonRulerHandle::mClicked
Button mClicked
Definition: AdornedRulerPanel.cpp:180