mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 00:49:33 +02:00
Temporary hack lets us defer encapsulation of track control panel drawing...
... while we can work on encapsulating the click-drag actions.
This commit is contained in:
parent
43968c4ac9
commit
f89cbefc7b
@ -5823,6 +5823,9 @@ void TrackPanel::DrawZooming(wxDC * dc, const wxRect & clip)
|
||||
dc->DrawRectangle(rect);
|
||||
}
|
||||
|
||||
// Make this #include go away!
|
||||
#include "tracks/ui/TrackControls.h"
|
||||
|
||||
void TrackInfo::DrawItems
|
||||
( wxDC *dc, const wxRect &rect, const Track &track,
|
||||
int mouseCapture, bool captured )
|
||||
@ -6219,9 +6222,16 @@ void TrackPanel::DrawOutside(Track * t, wxDC * dc, const wxRect & rec)
|
||||
rect.y += kTopMargin;
|
||||
rect.height -= (kBottomMargin + kTopMargin);
|
||||
|
||||
bool captured = (t == mCapturedTrack);
|
||||
// Need to know which button, if any, to draw as pressed.
|
||||
const MouseCaptureEnum mouseCapture =
|
||||
mMouseCapture ? mMouseCapture
|
||||
// This public global variable is a hack for now, which should go away
|
||||
// when TrackPanelCell gets a virtual function into which we move this
|
||||
// drawing code.
|
||||
: MouseCaptureEnum(TrackControls::gCaptureState);
|
||||
const bool captured = (t == mCapturedTrack || t == mpClickedTrack);
|
||||
|
||||
TrackInfo::DrawItems( dc, rect, *t, mMouseCapture, captured );
|
||||
TrackInfo::DrawItems( dc, rect, *t, mouseCapture, captured );
|
||||
|
||||
//mTrackInfo.DrawBordersWithin( dc, rect, *t );
|
||||
}
|
||||
|
@ -793,6 +793,8 @@ protected:
|
||||
bool mAutoScrolling;
|
||||
|
||||
public:
|
||||
// Old enumeration of click-and-drag states, which will shrink and disappear
|
||||
// as UIHandle subclasses take over the repsonsibilities.
|
||||
enum MouseCaptureEnum
|
||||
{
|
||||
IsUncaptured=0, // This is the normal state for the mouse
|
||||
|
@ -12,6 +12,8 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "TrackControls.h"
|
||||
#include "../../HitTestResult.h"
|
||||
|
||||
int TrackControls::gCaptureState;
|
||||
|
||||
TrackControls::~TrackControls()
|
||||
{
|
||||
}
|
||||
|
@ -24,6 +24,9 @@ public:
|
||||
|
||||
Track *GetTrack() const { return mpTrack; }
|
||||
|
||||
// Make this hack go away! See TrackPanel::DrawOutside
|
||||
static int gCaptureState;
|
||||
|
||||
protected:
|
||||
// An override is supplied for derived classes to call through but it is
|
||||
// still marked pure virtual
|
||||
|
Loading…
x
Reference in New Issue
Block a user