28#include <wx/checkbox.h>
32#include <wx/statusbr.h>
33#include <wx/textctrl.h>
55#define ScreenCaptureFrameTitle XO("Screen Capture Frame")
77 void OnGetURL(wxCommandEvent & event);
78 void OnClose(wxCommandEvent & event );
91 void OnOneSec(wxCommandEvent & event);
92 void OnTenSec(wxCommandEvent & event);
93 void OnOneMin(wxCommandEvent & event);
115 std::unique_ptr<ScreenFrameTimer>
mTimer;
122 DECLARE_EVENT_TABLE()
137 auto parent = wxTheApp->GetTopWindow();
158 evt.reset(event.Clone());
172 evt->SetEventObject(NULL);
178 std::unique_ptr<wxEvent>
evt;
262 wxASSERT(mStatus != NULL);
264 std::make_unique<CommandOutputTargets>(std::make_unique<NullProgressTarget>(),
265 std::make_shared<StatusBarTarget>(*mStatus),
266 std::make_shared<MessageBoxTarget>());
267 return std::make_unique<ScreenshotCommand>();
273 wxDefaultPosition, wxDefaultSize,
275#if !defined(__WXMSW__)
277 #if !defined(__WXMAC__)
278 wxFRAME_TOOL_WINDOW |
287 wxSYSTEM_MENU|wxCAPTION|wxCLOSE_BOX)
326 wxPanel *p =
S.StartPanel();
331 S.StartStatic(
XO(
"Choose location to save files"));
333 S.StartMultiColumn(3, wxEXPAND);
339 XXO(
"Save images to:"),
340 gPrefs->
Read(
wxT(
"/ScreenshotPath"), wxFileName::GetHomeDir()),
349 S.StartStatic(
XO(
"Capture entire window or screen"));
351 S.StartHorizontalLay();
368 S.EndHorizontalLay();
370 S.StartHorizontalLay();
376 S.EndHorizontalLay();
378 S.StartHorizontalLay();
382 S.EndHorizontalLay();
384 S.StartHorizontalLay();
387 XXO(
"Wait 5 seconds and capture frontmost window/dialog"),
390 S.EndHorizontalLay();
394 S.StartStatic(
XO(
"Capture part of a project window"));
396 S.StartHorizontalLay();
403 S.EndHorizontalLay();
409 S.StartHorizontalLay();
410 std::vector<ToolBar *> bars;
412 bars.emplace_back(pBar);
419 sort(bars.begin(), bars.end(), comp);
420 for_each(bars.begin(), bars.end(), [&](
ToolBar *pBar){
421 S.Id(id).AddButton(pBar->GetLabel());
423 &ScreenshotBigDialog::OnCaptureSomething, this, id);
428 S.EndHorizontalLay();
429 S.StartHorizontalLay();
433 S.EndHorizontalLay();
436 S.StartHorizontalLay();
444 S.EndHorizontalLay();
448 S.StartStatic(
XO(
"Scale"));
450 S.StartHorizontalLay();
458 S.EndHorizontalLay();
460 S.StartHorizontalLay();
466 S.EndHorizontalLay();
474 GetSizer()->Fit(
this);
475 SetMinSize(GetSize());
484 GetSize(&width, &height);
485 int displayWidth, displayHeight;
486 wxDisplaySize(&displayWidth, &displayHeight);
489 Move(displayWidth - width - 16, top + 16);
508 e.IsCommandEvent() &&
512 e.GetEventObject() != NULL) {
513 mTimer = std::make_unique<ScreenFrameTimer>(
this, e);
514 mTimer->Start(5000,
true);
519 if (e.IsCommandEvent() && e.GetEventObject() == NULL) {
520 e.SetEventObject(
this);
524 return wxFrame::ProcessEvent(e);
556 bool needupdate =
false;
572 wxWindow *w = wxWindow::FindWindowById(i,
this);
586 XO(
"Choose a location to save screenshot images"),
590 if (!dlog.GetPath().empty()) {
591 wxFileName tmpDirPath;
592 tmpDirPath.AssignDir(dlog.GetPath());
593 wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
608 mBlue->SetValue(
false);
616 window.Maximize(
false);
617 window.SetSize(16, 16 + top, w, h);
650 auto w =
static_cast<wxDialogWrapper *
>(wxFindWindowByLabel(
XO(
"Long Message").Translation()));
652 auto endmodal = [w](wxCommandEvent &evt)
656 w->Bind(wxEVT_BUTTON, endmodal);
665 int i =
event.GetId();
701 static const int codes[] = {
732 window.GetClientSize(&width, &height);
733 viewInfo.SetZoom((0.75 * width) / seconds);
774 auto channels = t->Channels();
775 auto nChannels = channels.size();
776 auto height = nChannels == 1 ? 2 * h : h;
777 for (
auto pChannel : channels)
787 for (
auto pChannel : t->Channels()) {
789 view.SetExpandedHeight(view.GetMinimizedHeight());
836 {
wxT(
"Tools/Other"), { OrderingHint::After,
wxT(
"ConfigReset") } }
wxEVT_COMMAND_BUTTON_CLICKED
const ReservedCommandFlag & AudioIONotBusyFlag()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XXO("&Cut/Copy/Paste Toolbar")
#define RTL_WORKAROUND(pWnd)
EVT_COMMAND_RANGE(ID_Slider, ID_Slider+99, wxEVT_COMMAND_SLIDER_UPDATED, NyquistEffect::OnSlider) EVT_COMMAND_RANGE(ID_Text
audacity::BasicSettings * gPrefs
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 ...
accessors for certain important windows associated with each project
ScreenshotBigDialogPtr mFrame
#define ScreenCaptureFrameTitle
static void OpenScreenshotTools(AudacityProject &project)
@ IdToggleBackgroundWhite
@ IdCaptureWindowContents
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static ChannelView & Get(Channel &channel)
void SetExpandedHeight(int height)
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
AudacityProject & project
void RegisterLastTool(const CommandContext &context)
static CommandManager & Get(AudacityProject &project)
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Base class for containing data common to all commands of a given type. Also acts as a factory.
A listener notified of changes in preferences.
Generates classes whose instances register items at construction.
ScreenshotBigDialog * screenFrame
std::unique_ptr< wxEvent > evt
ScreenFrameTimer(ScreenshotBigDialog *frame, wxEvent &event)
virtual ~ScreenFrameTimer()
ScreenshotBigDialog provides an alternative Gui for ScreenshotCommand. It adds a timer that allows a ...
void OnGetURL(wxCommandEvent &event)
virtual ~ScreenshotBigDialog()
bool ProcessEvent(wxEvent &event) override
void OnMainWindowSmall(wxCommandEvent &event)
void OnOneSec(wxCommandEvent &event)
void OnMedTracks(wxCommandEvent &event)
void OnToggleBackgroundWhite(wxCommandEvent &event)
AudacityProject & mProject
void OnClose(wxCommandEvent &event)
void TimeZoom(double seconds)
const CommandContext mContext
void OnTallTracks(wxCommandEvent &event)
void UpdatePrefs() override
void OnUIUpdate(wxUpdateUIEvent &event)
void OnTenSec(wxCommandEvent &event)
void OnCaptureSomething(wxCommandEvent &event)
void OnShortTracks(wxCommandEvent &event)
void SizeMainWindow(int w, int h)
ScreenshotBigDialog(wxWindow *parent, wxWindowID id, AudacityProject &project)
std::unique_ptr< ScreenshotCommand > mCommand
void OnOneMin(wxCommandEvent &event)
void OnToggleBackgroundBlue(wxCommandEvent &event)
std::unique_ptr< ScreenshotCommand > CreateCommand()
void PopulateOrExchange(ShuttleGui &S)
void OnMainWindowLarge(wxCommandEvent &event)
wxTextCtrl * mDirectoryTextBox
std::unique_ptr< ScreenFrameTimer > mTimer
void OnFiveMin(wxCommandEvent &event)
void OnCloseWindow(wxCloseEvent &event)
void DoCapture(int captureMode)
wxCheckBox * mDelayCheckBox
void OnOneHour(wxCommandEvent &event)
void OnDirChoose(wxCommandEvent &event)
Implements a command for capturing various areas of the screen or project window. It's one big if-els...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
static TrackList & Get(AudacityProject &project)
wxString Translation() const
static ViewInfo & Get(AudacityProject &project)
static Viewport & Get(AudacityProject &project)
A Track that contains audio waveform data.
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0
virtual bool Read(const wxString &key, bool *value) const =0
ExportResult Show(ExportTask exportTask)
void OnScreenshot(const CommandContext &context)