16#include "../../RefreshCode.h"
19#include "../../ProjectWindows.h"
20#include "../../TrackArtist.h"
21#include "../../TrackInfo.h"
22#include "../../TrackPanelDrawingContext.h"
23#include "../../TrackPanelMouseEvent.h"
24#include "../../TrackUtilities.h"
25#include <wx/textdlg.h>
26#include "../../commands/AudacityCommand.h"
27#include "../../commands/CommandManager.h"
30#include "../../widgets/PopupMenuTable.h"
41 const wxMouseState &state = st.
state;
42 const wxRect &rect = st.
rect;
44 std::vector<UIHandlePtr> results;
46 auto sThis = shared_from_this();
50 results.push_back(result);
54 results.push_back(result);
58 results.push_back(result);
62 results.push_back(result);
64 if (results.empty()) {
67 results.push_back(result);
125 Track *
const pTrack = pData->pTrack;
127 up ? tracks.CanMoveUp(pTrack) : tracks.CanMoveDown(pTrack) );
140 XXO(
"Move Track &Up").Join(
144 GetKeyFromName(
wxT(
"TrackMoveUp")).GET() ),
150 XXO(
"Move Track &Down").Join(
154 GetKeyFromName(
wxT(
"TrackMoveDown")).GET() ),
160 XXO(
"Move Track to &Top").Join(
164 GetKeyFromName(
wxT(
"TrackMoveTop")).GET() ),
170 XXO(
"Move Track to &Bottom").Join(
174 GetKeyFromName(
wxT(
"TrackMoveBottom")).GET() ),
208{
XO(
"Set Track Name") };
214 S.StartMultiColumn(2, wxALIGN_CENTER);
227 const wxString oldName = pTrack->
GetName();
235 wxString newName =
Command.mName;
237 channel->SetName(newName);
241 XO(
"Renamed '%s' to '%s'").
Format( oldName, newName ),
253 switch (event.GetId()) {
274 const wxRect &rect, wxWindow *pParent,
const wxPoint *,
294 pMenu->Popup( *pParent,
295 { buttonRect.x + 1, buttonRect.y + buttonRect.height + 1 } );
302void TrackInfo::DrawBordersWithin
303 ( wxDC* dc,
const wxRect & rect,
const Track &track )
const
311 (*dc, rect.x, buttonRect.y + buttonRect.height,
312 rect.width - 1, buttonRect.y + buttonRect.height);
316 (*dc, buttonRect.x, buttonRect.y,
317 buttonRect.x, buttonRect.y + buttonRect.height - 1);
319 GetMuteSoloRect( rect, buttonRect,
false,
true, &track );
321 bool bHasMuteSolo =
dynamic_cast<const PlayableTrack*
>( &track ) != NULL;
326 (*dc, rect.x, buttonRect.y,
327 rect.width - 1, buttonRect.y);
333 (*dc, buttonRect.x + buttonRect.width, buttonRect.y,
334 buttonRect.x + buttonRect.width, buttonRect.y + buttonRect.height - 1);
338 (*dc, rect.x, buttonRect.y + buttonRect.height,
339 rect.width - 1, buttonRect.y + buttonRect.height);
346 (*dc, minimizeRect.x - 1, minimizeRect.y,
347 minimizeRect.x - 1, minimizeRect.y + minimizeRect.height - 1);
349 (*dc, minimizeRect.x, minimizeRect.y - 1,
350 minimizeRect.x + minimizeRect.width - 1, minimizeRect.y - 1);
356 const wxRect &rect_,
unsigned iPass )
360 auto dc = &context.
dc;
363 dc->DrawRectangle( rect_ );
371 wxRect rect{ rect_.x, rect_.y, rect_.width - 1, rect_.height };
398 int ylast = rect.height-20;
399 int ybutton = wxMin(32,ylast-17);
402 fill=wxRect( rect.x+1, rect.y+17, vrul-6, ybutton);
405 if( ybuttonEnd < ylast ){
406 fill=wxRect( rect.x+1, rect.y+ybuttonEnd, fill.width, ylast - ybuttonEnd);
412 fill=wxRect( rect.x+1, rect.y+17, vrul-6, rect.height-37);
421 const wxRect &rect,
const wxRect &,
unsigned iPass )
425 return { rect.x, rect.y, rect.width + 1, rect.height };
std::shared_ptr< UIHandle > UIHandlePtr
AppendItem("Name", OnSetNameID, XXO("&Name..."), POPUP_MENU_FN(OnSetName))
static const auto enableIfCanMove
XXO("&Cut/Copy/Paste Toolbar")
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
declares abstract base class Track, TrackList, and iterators over TrackList
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void MediumTrackInfo(wxDC *dc, bool selected)
static void Dark(wxDC *dc, bool selected, bool highlight=false)
static void BevelTrackInfo(wxDC &dc, bool up, const wxRect &r, bool highlight=false)
Base class for command in Audacity.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static CommandManager & Get(AudacityProject &project)
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
std::weak_ptr< SelectButtonHandle > mSelectButtonHandle
std::weak_ptr< TrackSelectHandle > mSelectHandle
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
std::weak_ptr< MenuButtonHandle > mMenuHandle
virtual std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override=0
unsigned DoContextMenu(const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override
std::weak_ptr< CloseButtonHandle > mCloseHandle
std::weak_ptr< MinimizeButtonHandle > mMinimizeHandle
virtual PopupMenuTable * GetMenuExtension(Track *pTrack)=0
std::shared_ptr< Track > FindTrack()
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
AudioTrack subclass that can also be audibly replayed by the program.
A listener notified of changes in preferences.
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
static const ComponentInterfaceSymbol Symbol
ComponentInterfaceSymbol GetSymbol() const override
void PopulateOrExchange(ShuttleGui &S) override
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Abstract base class for an object holding data associated with points on a time axis.
static TrackList & Get(AudacityProject &project)
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
static UIHandlePtr HitAnywhere(std::weak_ptr< TrackSelectHandle > &holder, const std::shared_ptr< Track > &pTrack)
Namespace containing an enum 'what to do on a refresh?'.
AUDACITY_DLL_API bool HideTopItem(const wxRect &rect, const wxRect &subRect, int allowance=0)
AUDACITY_DLL_API void GetTitleBarRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetMinimizeRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void DrawItems(TrackPanelDrawingContext &context, const wxRect &rect, const Track &track)
void DoMoveTrack(AudacityProject &project, Track *target, MoveChoice choice)
Move a track up, down, to top or to bottom.
AuthorizationHandler handler