16#include "../../RefreshCode.h"
19#include "../../ProjectWindows.h"
20#include "../../TrackArtist.h"
22#include "../../TrackPanelDrawingContext.h"
23#include "../../TrackPanelMouseEvent.h"
24#include "../../TrackUtilities.h"
25#include <wx/textdlg.h>
26#include "../../commands/AudacityCommand.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);
60 if (results.empty()) {
63 results.push_back(result);
121 auto &track = pData->track;
123 up ?
tracks.CanMoveUp(track) :
tracks.CanMoveDown(track));
139 GetKeyFromName(
wxT(
"TrackMoveUp")).GET() ),
149 GetKeyFromName(
wxT(
"TrackMoveDown")).GET() ),
155 XXO(
"Move Track to &Top").
Join(
159 GetKeyFromName(
wxT(
"TrackMoveTop")).GET() ),
165 XXO(
"Move Track to &Bottom").
Join(
169 GetKeyFromName(
wxT(
"TrackMoveBottom")).GET() ),
203{
XO(
"Set Track Name") };
209 S.StartMultiColumn(2, wxALIGN_CENTER);
220 const wxString oldName = track.GetName();
225 bool bResult =
Command.PromptUser(*proj);
228 wxString newName =
Command.mName;
229 track.SetName(newName);
233 XO(
"Renamed '%s' to '%s'").
Format( oldName, newName ),
244 switch (event.GetId()) {
265 const wxRect &rect, wxWindow *pParent,
const wxPoint *,
285 pMenu->Popup( *pParent,
286 { buttonRect.x + 1, buttonRect.y + buttonRect.height + 1 } );
293void TrackInfo::DrawBordersWithin
294 ( wxDC* dc,
const wxRect & rect,
const Track &track )
const
300 GetTitleBarRect( rect, buttonRect );
302 (*dc, rect.x, buttonRect.y + buttonRect.height,
303 rect.width - 1, buttonRect.y + buttonRect.height);
307 (*dc, buttonRect.x, buttonRect.y,
308 buttonRect.x, buttonRect.y + buttonRect.height - 1);
310 GetMuteSoloRect( rect, buttonRect,
false,
true, &track );
312 bool bHasMuteSolo =
dynamic_cast<const PlayableTrack*
>( &track ) != NULL;
317 (*dc, rect.x, buttonRect.y,
318 rect.width - 1, buttonRect.y);
324 (*dc, buttonRect.x + buttonRect.width, buttonRect.y,
325 buttonRect.x + buttonRect.width, buttonRect.y + buttonRect.height - 1);
329 (*dc, rect.x, buttonRect.y + buttonRect.height,
330 rect.width - 1, buttonRect.y + buttonRect.height);
337 (*dc, minimizeRect.x - 1, minimizeRect.y,
338 minimizeRect.x - 1, minimizeRect.y + minimizeRect.height - 1);
340 (*dc, minimizeRect.x, minimizeRect.y - 1,
341 minimizeRect.x + minimizeRect.width - 1, minimizeRect.y - 1);
347 const wxRect &rect_,
unsigned iPass )
351 auto dc = &context.
dc;
354 dc->DrawRectangle( rect_ );
378 const wxRect&,
unsigned iPass)
std::shared_ptr< UIHandle > UIHandlePtr
AppendItem("Name", OnSetNameID, XXO("Re&name Track..."), POPUP_MENU_FN(OnSetName))
static const auto enableIfCanMove
std::vector< TrackInfo::TCPLine > TCPLines
XXO("&Cut/Copy/Paste Toolbar")
ResultType Join(const ContainerType< ResultType, Rest... > &container, const SeparatorType &separator)
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)
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< TrackSelectHandle > mSelectHandle
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
std::weak_ptr< MenuButtonHandle > mMenuHandle
const TCPLines & GetTCPLines() const override
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 UIHandlePtr HitAnywhere(std::weak_ptr< TrackSelectHandle > &holder, const std::shared_ptr< Track > &pTrack)
AUDACITY_DLL_API void DrawItems(TrackPanelDrawingContext &context, const wxRect &rect, const Track &track)
AUDACITY_DLL_API void GetTrackMenuButtonRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API void GetMinimizeRect(const wxRect &rect, wxRect &dest)
AUDACITY_DLL_API const TCPLines & StaticTCPLines()
AUDACITY_DLL_API bool HideTopItem(const wxRect &rect, const wxRect &subRect, int allowance=0)
Namespace containing an enum 'what to do on a refresh?'.
AUDACITY_DLL_API void DoMoveTrack(AudacityProject &project, Track &target, MoveChoice choice)
Move a track up, down, to top or to bottom.
AuthorizationHandler handler