mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
New ShowInfoDialog() function for text message plus OK button. Resizability more obvious now, and cursor at position 0.
This commit is contained in:
parent
a2ad4dae36
commit
f4e81220b3
@ -44,6 +44,7 @@ simplifies construction of menu items.
|
|||||||
#include <wx/progdlg.h>
|
#include <wx/progdlg.h>
|
||||||
#include <wx/scrolbar.h>
|
#include <wx/scrolbar.h>
|
||||||
#include <wx/ffile.h>
|
#include <wx/ffile.h>
|
||||||
|
#include <wx/statusbr.h>
|
||||||
|
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
#include "effects/EffectManager.h"
|
#include "effects/EffectManager.h"
|
||||||
@ -5421,28 +5422,11 @@ void AudacityProject::OnScreenshot()
|
|||||||
void AudacityProject::OnAudioDeviceInfo()
|
void AudacityProject::OnAudioDeviceInfo()
|
||||||
{
|
{
|
||||||
wxString info = gAudioIO->GetDeviceInfo();
|
wxString info = gAudioIO->GetDeviceInfo();
|
||||||
wxTextCtrl *tc;
|
ShowInfoDialog( this,
|
||||||
|
_("Audio Device Info"),
|
||||||
wxDialog dlg(this, wxID_ANY,
|
wxT(""),
|
||||||
wxString(wxT("Audio Device Info")),
|
info,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
350,450);
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
|
|
||||||
|
|
||||||
ShuttleGui S(&dlg, eIsCreating);
|
|
||||||
|
|
||||||
S.StartHorizontalLay(wxEXPAND, true);
|
|
||||||
{
|
|
||||||
S.SetStyle( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 |
|
|
||||||
wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL );
|
|
||||||
tc = S.AddTextWindow(wxT(""));
|
|
||||||
tc->WriteText(info);
|
|
||||||
}
|
|
||||||
S.EndHorizontalLay();
|
|
||||||
|
|
||||||
S.AddStandardButtons(eOkButton);
|
|
||||||
|
|
||||||
dlg.Center();
|
|
||||||
dlg.ShowModal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::OnSeparator()
|
void AudacityProject::OnSeparator()
|
||||||
|
@ -521,6 +521,9 @@ wxTextCtrl * ShuttleGuiBase::AddTextWindow(const wxString &Value)
|
|||||||
mpWind = pTextCtrl = new wxTextCtrl(mpParent, miId, Value,
|
mpWind = pTextCtrl = new wxTextCtrl(mpParent, miId, Value,
|
||||||
wxDefaultPosition, wxDefaultSize, Style( wxTE_MULTILINE ));
|
wxDefaultPosition, wxDefaultSize, Style( wxTE_MULTILINE ));
|
||||||
UpdateSizers();
|
UpdateSizers();
|
||||||
|
// Start off at start of window...
|
||||||
|
pTextCtrl->SetInsertionPoint( 0 );
|
||||||
|
pTextCtrl->ShowPosition( 0 );
|
||||||
return pTextCtrl;
|
return pTextCtrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1278,12 +1278,8 @@ NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id,
|
|||||||
item = new wxStaticText(this, -1, prompt);
|
item = new wxStaticText(this, -1, prompt);
|
||||||
mainSizer->Add(item, 0, wxALIGN_LEFT | wxLEFT | wxTOP | wxRIGHT, 10);
|
mainSizer->Add(item, 0, wxALIGN_LEFT | wxLEFT | wxTOP | wxRIGHT, 10);
|
||||||
|
|
||||||
// TODO: Convert this to using ShuttleGui.
|
// TODO use ShowInfoDialog() instead.
|
||||||
// using S.AddTextWindow();
|
// Beware this dialog MUST work with screen readers.
|
||||||
// TODO: Consider using:
|
|
||||||
// wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 |
|
|
||||||
// wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL
|
|
||||||
// Haven't made this change as this dialog MUST work with screen readers.
|
|
||||||
item = new wxTextCtrl(this, -1, message,
|
item = new wxTextCtrl(this, -1, message,
|
||||||
wxDefaultPosition, wxSize(400, 200),
|
wxDefaultPosition, wxSize(400, 200),
|
||||||
wxTE_MULTILINE | wxTE_READONLY);
|
wxTE_MULTILINE | wxTE_READONLY);
|
||||||
|
@ -418,6 +418,7 @@ int ExportCL::Export(AudacityProject *project,
|
|||||||
|
|
||||||
// Display output on error or if the user wants to see it
|
// Display output on error or if the user wants to see it
|
||||||
if (p->GetStatus() != 0 || show) {
|
if (p->GetStatus() != 0 || show) {
|
||||||
|
// TODO use ShowInfoDialog() instead.
|
||||||
wxDialog dlg(NULL,
|
wxDialog dlg(NULL,
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
wxString(_("Command Output")),
|
wxString(_("Command Output")),
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include "../Project.h"
|
#include "../Project.h"
|
||||||
#include "../Prefs.h"
|
#include "../Prefs.h"
|
||||||
#include "../Tags.h"
|
#include "../Tags.h"
|
||||||
|
#include "../widgets/ErrorDialog.h"
|
||||||
|
|
||||||
|
|
||||||
/* define our dynamic array of export settings */
|
/* define our dynamic array of export settings */
|
||||||
@ -534,30 +535,17 @@ void ExportMultiple::OnExport(wxCommandEvent& event)
|
|||||||
)
|
)
|
||||||
), mExported.GetCount());
|
), mExported.GetCount());
|
||||||
|
|
||||||
// This results dialog is a child of this dialog.
|
wxString FileList;
|
||||||
SuccessDialog dlg(this,
|
for (size_t i = 0; i < mExported.GetCount(); i++) {
|
||||||
wxID_ANY,
|
FileList += mExported[i];
|
||||||
wxString(_("Export Multiple")) );
|
FileList += '\n';
|
||||||
ShuttleGui S(&dlg, eIsCreating);
|
|
||||||
|
|
||||||
S.StartVerticalLay();
|
|
||||||
{
|
|
||||||
S.AddTitle(msg);
|
|
||||||
wxString FileList;
|
|
||||||
for (size_t i = 0; i < mExported.GetCount(); i++) {
|
|
||||||
FileList += mExported[i];
|
|
||||||
FileList += '\n';
|
|
||||||
}
|
|
||||||
S.SetStyle( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 |
|
|
||||||
wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL );
|
|
||||||
S.AddTextWindow( FileList );
|
|
||||||
S.AddStandardButtons(eOkButton);
|
|
||||||
}
|
}
|
||||||
S.EndVerticalLay();
|
// This results dialog is a child of this dialog.
|
||||||
dlg.SetMinSize( wxSize(125,200) );
|
ShowInfoDialog( this,
|
||||||
dlg.SetSize( wxSize(450,400) );
|
_("Export Multiple"),
|
||||||
dlg.Center();
|
msg,
|
||||||
dlg.ShowModal();
|
FileList,
|
||||||
|
450,400);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok == eProgressSuccess || ok == eProgressStopped) {
|
if (ok == eProgressSuccess || ok == eProgressStopped) {
|
||||||
|
@ -247,6 +247,49 @@ void ShowErrorDialog(wxWindow *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Mostly we use this so that we have the code for resizability
|
||||||
|
/// in one place. Other considerations like screen readers are also
|
||||||
|
/// handled by having the code in one place.
|
||||||
|
void ShowInfoDialog( wxWindow *parent,
|
||||||
|
const wxString &dlogTitle,
|
||||||
|
const wxString &shortMsg,
|
||||||
|
const wxString &message,
|
||||||
|
const int xSize, const int ySize)
|
||||||
|
{
|
||||||
|
wxDialog dlog(parent, wxID_ANY,
|
||||||
|
dlogTitle,
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX /*| wxDEFAULT_FRAME_STYLE */);
|
||||||
|
|
||||||
|
ShuttleGui S(&dlog, eIsCreating);
|
||||||
|
|
||||||
|
S.StartVerticalLay(1);
|
||||||
|
{
|
||||||
|
S.AddTitle( shortMsg);
|
||||||
|
S.SetStyle( wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH | wxTE_RICH2 |
|
||||||
|
wxTE_AUTO_URL | wxTE_NOHIDESEL | wxHSCROLL );
|
||||||
|
S.AddTextWindow(message);
|
||||||
|
}
|
||||||
|
S.SetBorder( 0 );
|
||||||
|
S.StartHorizontalLay(wxALIGN_RIGHT|wxALIGN_BOTTOM, 0);
|
||||||
|
S.AddStandardButtons(eOkButton);
|
||||||
|
|
||||||
|
// Next three lines add a tiny dragger.
|
||||||
|
wxStatusBar * pBar = new wxStatusBar( &dlog );
|
||||||
|
pBar->SetSize( 18, 38);
|
||||||
|
S.AddWindow( pBar, wxALIGN_BOTTOM|wxALIGN_RIGHT );
|
||||||
|
|
||||||
|
S.EndHorizontalLay();
|
||||||
|
S.EndVerticalLay();
|
||||||
|
|
||||||
|
// Smallest size is half default size. Seems reasonable.
|
||||||
|
dlog.SetMinSize( wxSize(xSize/2, ySize/2) );
|
||||||
|
dlog.SetSize( wxSize(xSize, ySize) );
|
||||||
|
dlog.Center();
|
||||||
|
dlog.ShowModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ShowHelpDialog(wxWindow *parent,
|
void ShowHelpDialog(wxWindow *parent,
|
||||||
const wxString &localFileName,
|
const wxString &localFileName,
|
||||||
const wxString &remoteURL)
|
const wxString &remoteURL)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
ErrorDialog.h
|
ErrorDialog.h
|
||||||
|
|
||||||
Jimmy Johnson
|
Jimmy Johnson
|
||||||
|
James Crook
|
||||||
|
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -21,6 +22,13 @@ void ShowErrorDialog(wxWindow *parent,
|
|||||||
const wxString &message,
|
const wxString &message,
|
||||||
const wxString &helpURL);
|
const wxString &helpURL);
|
||||||
|
|
||||||
|
/// Displays cutable information in a text ctrl, with an OK button.
|
||||||
|
void ShowInfoDialog( wxWindow *parent,
|
||||||
|
const wxString &dlogTitle,
|
||||||
|
const wxString &shortMsg,
|
||||||
|
const wxString &message,
|
||||||
|
const int xSize, const int ySize);
|
||||||
|
|
||||||
/// Displays a new window with wxHTML help.
|
/// Displays a new window with wxHTML help.
|
||||||
void ShowHtmlText( wxWindow * pParent,
|
void ShowHtmlText( wxWindow * pParent,
|
||||||
const wxString &Title,
|
const wxString &Title,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user