mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 17:14:07 +01:00
Move drawing code for background of track control panel
This commit is contained in:
@@ -12,10 +12,13 @@ Paul Licameli split from TrackControls.cpp
|
||||
|
||||
#include "TrackButtonHandles.h"
|
||||
#include "TrackSelectHandle.h"
|
||||
#include "../../AColor.h"
|
||||
#include "../../RefreshCode.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../ProjectHistory.h"
|
||||
#include "../../TrackArtist.h"
|
||||
#include "../../TrackInfo.h"
|
||||
#include "../../TrackPanelDrawingContext.h"
|
||||
#include "../../TrackPanelMouseEvent.h"
|
||||
#include "../../TrackUtilities.h"
|
||||
#include <wx/textdlg.h>
|
||||
@@ -25,6 +28,7 @@ Paul Licameli split from TrackControls.cpp
|
||||
#include "../../Track.h"
|
||||
#include "../../widgets/PopupMenuTable.h"
|
||||
|
||||
#include <wx/dc.h>
|
||||
#include <wx/frame.h>
|
||||
|
||||
std::vector<UIHandlePtr> CommonTrackControls::HitTest
|
||||
@@ -265,3 +269,45 @@ unsigned CommonTrackControls::DoContextMenu
|
||||
|
||||
return data.result;
|
||||
}
|
||||
|
||||
void CommonTrackControls::Draw(
|
||||
TrackPanelDrawingContext &context,
|
||||
const wxRect &rect, unsigned iPass )
|
||||
{
|
||||
if ( iPass == TrackArtist::PassMargins ) {
|
||||
// fill in label
|
||||
auto dc = &context.dc;
|
||||
const auto pTrack = FindTrack();
|
||||
AColor::MediumTrackInfo( dc, pTrack && pTrack->GetSelected() );
|
||||
dc->DrawRectangle( rect );
|
||||
}
|
||||
|
||||
// Some old cut-and-paste legacy from TrackPanel.cpp here:
|
||||
#undef USE_BEVELS
|
||||
#ifdef USE_BEVELS
|
||||
// This branch is not now used
|
||||
// PRL: todo: banish magic numbers.
|
||||
// PRL: vrul was the x coordinate of left edge of the vertical ruler.
|
||||
// PRL: bHasMuteSolo was true iff the track was WaveTrack.
|
||||
if( bHasMuteSolo )
|
||||
{
|
||||
int ylast = rect.height-20;
|
||||
int ybutton = wxMin(32,ylast-17);
|
||||
int ybuttonEnd = 67;
|
||||
|
||||
fill=wxRect( rect.x+1, rect.y+17, vrul-6, ybutton);
|
||||
AColor::BevelTrackInfo( *dc, true, fill );
|
||||
|
||||
if( ybuttonEnd < ylast ){
|
||||
fill=wxRect( rect.x+1, rect.y+ybuttonEnd, fill.width, ylast - ybuttonEnd);
|
||||
AColor::BevelTrackInfo( *dc, true, fill );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fill=wxRect( rect.x+1, rect.y+17, vrul-6, rect.height-37);
|
||||
AColor::BevelTrackInfo( *dc, true, fill );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -56,6 +56,11 @@ protected:
|
||||
(const wxRect &rect, wxWindow *pParent, wxPoint *pPosition) override;
|
||||
virtual PopupMenuTable *GetMenuExtension(Track *pTrack) = 0;
|
||||
|
||||
// TrackPanelDrawable implementation
|
||||
void Draw(
|
||||
TrackPanelDrawingContext &context,
|
||||
const wxRect &rect, unsigned iPass ) override;
|
||||
|
||||
std::weak_ptr<CloseButtonHandle> mCloseHandle;
|
||||
std::weak_ptr<MenuButtonHandle> mMenuHandle;
|
||||
std::weak_ptr<MinimizeButtonHandle> mMinimizeHandle;
|
||||
|
||||
Reference in New Issue
Block a user