예제 #1
0
void CheckMousePosition()
{
    mouse = wxGetMouseState();
    int x=mouse.GetX();
    int y=mouse.GetY();

    if ( XYOverFeed(x,y,live_feeds[2]) ) {}  else
    if ( XYOverFeed(x,y,live_feeds[3]) ) {}
}
예제 #2
0
UIHandlePtr EnvelopeHandle::WaveTrackHitTest
(std::weak_ptr<EnvelopeHandle> &holder,
 const wxMouseState &state, const wxRect &rect,
 const AudacityProject *pProject, const std::shared_ptr<WaveTrack> &wt)
{
   /// method that tells us if the mouse event landed on an
   /// envelope boundary.
   Envelope *const envelope = wt->GetEnvelopeAtX(state.GetX());

   if (!envelope)
      return {};

   const int displayType = wt->GetDisplay();
   // Not an envelope hit, unless we're using a type of wavetrack display
   // suitable for envelopes operations, ie one of the Wave displays.
   if (displayType != WaveTrack::Waveform)
      return {};  // No envelope, not a hit, so return.

   // Get envelope point, range 0.0 to 1.0
   const bool dB = !wt->GetWaveformSettings().isLinear();

   float zoomMin, zoomMax;
   wt->GetDisplayBounds(&zoomMin, &zoomMax);

   const float dBRange = wt->GetWaveformSettings().dBRange;

   return EnvelopeHandle::HitEnvelope
       (holder, state, rect, pProject, envelope, zoomMin, zoomMax, dB, dBRange, false);
}
예제 #3
0
INLINE
void  wxeReturn::add(wxMouseState val) {
    addAtom("wxMouseState");
    // TODO not int?
    addUint(val.GetX());
    addUint(val.GetY());
    addBool(val.LeftDown());
    addBool(val.MiddleDown());
    addBool(val.RightDown());
    addBool(val.ControlDown());
    addBool(val.ShiftDown());
    addBool(val.AltDown());
    addBool(val.MetaDown());
    addBool(val.CmdDown());
    addTupleCount(11);     
}
예제 #4
0
HitTestPreview WaveTrackVZoomHandle::HitPreview(const wxMouseState &state)
{
   static auto zoomInCursor =
      ::MakeCursor(wxCURSOR_MAGNIFIER, ZoomInCursorXpm, 19, 15);
   static auto zoomOutCursor =
      ::MakeCursor(wxCURSOR_MAGNIFIER, ZoomOutCursorXpm, 19, 15);
   static  wxCursor arrowCursor{ wxCURSOR_ARROW };
   bool bVZoom;
   gPrefs->Read(wxT("/GUI/VerticalZooming"), &bVZoom, false);
   bVZoom &= !state.RightIsDown();
   const auto message = bVZoom ? 
      _("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.") :
      _("Right-click for menu.");

   return {
      message,
      bVZoom ? (state.ShiftDown() ? &*zoomOutCursor : &*zoomInCursor) : &arrowCursor
      // , message
   };
}