Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
LongMessageDialog Class Reference

LongMessageDialog is a dialog with a Text Window in it to capture the more lengthy output from some commands. More...

Inheritance diagram for LongMessageDialog:
[legend]
Collaboration diagram for LongMessageDialog:
[legend]

Public Member Functions

 LongMessageDialog (wxWindow *parent, const TranslatableString &title, int type=0, int flags=wxDEFAULT_DIALOG_STYLE, int additionalButtons=0)
 
 ~LongMessageDialog ()
 
bool Init ()
 
virtual void OnOk (wxCommandEvent &evt)
 
virtual void OnCancel (wxCommandEvent &evt)
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static void AcceptText (const wxString &Text)
 
static void Flush ()
 

Public Attributes

wxTextCtrl * mTextCtrl
 
wxString mText
 

Static Public Attributes

static LongMessageDialogpDlg = NULL
 

Private Member Functions

 wxDECLARE_NO_COPY_CLASS (LongMessageDialog)
 

Private Attributes

int mType
 
int mAdditionalButtons
 

Detailed Description

LongMessageDialog is a dialog with a Text Window in it to capture the more lengthy output from some commands.

Definition at line 305 of file CommandTargets.cpp.

Constructor & Destructor Documentation

◆ LongMessageDialog()

LongMessageDialog::LongMessageDialog ( wxWindow *  parent,
const TranslatableString title,
int  type = 0,
int  flags = wxDEFAULT_DIALOG_STYLE,
int  additionalButtons = 0 
)

Definition at line 342 of file CommandTargets.cpp.

347: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags | wxRESIZE_BORDER)
348{
349 mType = type;
350 mAdditionalButtons = additionalButtons;
351 SetName(XO("Long Message"));
352 // The long message adds lots of short strings onto this one.
353 // So preallocate to make it faster.
354 // Needs 37Kb for all commands.
355 mText.Alloc(40000);
356}
#define XO(s)
Definition: Internat.h:31
static const auto title

References wxDialogWrapper::SetName(), and XO.

Here is the call graph for this function:

◆ ~LongMessageDialog()

LongMessageDialog::~LongMessageDialog ( )

Definition at line 358 of file CommandTargets.cpp.

358 {
359 pDlg = NULL;
360}
static LongMessageDialog * pDlg

Member Function Documentation

◆ AcceptText()

void LongMessageDialog::AcceptText ( const wxString &  Text)
static

Definition at line 393 of file CommandTargets.cpp.

394{
395 if( pDlg == NULL ){
397 wxTheApp->GetTopWindow(), XO( "Long Message" ) );
398 pDlg->Init();
399 pDlg->Show();
400 }
401 pDlg->mText = pDlg->mText + Text;
402}
LongMessageDialog(wxWindow *parent, const TranslatableString &title, int type=0, int flags=wxDEFAULT_DIALOG_STYLE, int additionalButtons=0)

References Init(), mText, and XO.

Referenced by MessageDialogTarget::Update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Flush()

void LongMessageDialog::Flush ( )
static

Definition at line 404 of file CommandTargets.cpp.

405{
406 if( pDlg ){
407 if( !pDlg->mText.EndsWith( "\n\n" ))
408 {
409 pDlg->mText += "\n\n";
410 pDlg->mTextCtrl->SetValue( pDlg->mText );
411 pDlg->mTextCtrl->ShowPosition( pDlg->mTextCtrl->GetLastPosition() );
412 }
413 }
414}
wxTextCtrl * mTextCtrl

References mText, and mTextCtrl.

Referenced by MessageDialogTarget::Flush().

Here is the caller graph for this function:

◆ Init()

bool LongMessageDialog::Init ( )

Definition at line 363 of file CommandTargets.cpp.

364{
365 ShuttleGui S(this, eIsCreating);
366
367 S.SetBorder(5);
368 S.StartVerticalLay(true);
369 {
370 mTextCtrl = S.AddTextWindow( "" );
371 long buttons = eOkButton;
372 S.AddStandardButtons(buttons|mAdditionalButtons);
373 }
374 S.EndVerticalLay();
375
376 Layout();
377 Fit();
378 SetMinSize(wxSize(600,350));
379 Center();
380 return true;
381}
@ eIsCreating
Definition: ShuttleGui.h:39
@ eOkButton
Definition: ShuttleGui.h:597
#define S(N)
Definition: ToChars.cpp:64
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628

References eIsCreating, eOkButton, and S.

Referenced by AcceptText().

Here is the caller graph for this function:

◆ OnCancel()

void LongMessageDialog::OnCancel ( wxCommandEvent &  evt)
virtual

Definition at line 388 of file CommandTargets.cpp.

388 {
389 //Close(true);
390 Destroy();
391}

◆ OnOk()

void LongMessageDialog::OnOk ( wxCommandEvent &  evt)
virtual

Definition at line 383 of file CommandTargets.cpp.

383 {
384 //Close(true);
385 Destroy();
386}

◆ wxDECLARE_NO_COPY_CLASS()

LongMessageDialog::wxDECLARE_NO_COPY_CLASS ( LongMessageDialog  )
private

Member Data Documentation

◆ mAdditionalButtons

int LongMessageDialog::mAdditionalButtons
private

Definition at line 328 of file CommandTargets.cpp.

◆ mText

wxString LongMessageDialog::mText

Definition at line 324 of file CommandTargets.cpp.

Referenced by AcceptText(), and Flush().

◆ mTextCtrl

wxTextCtrl* LongMessageDialog::mTextCtrl

Definition at line 323 of file CommandTargets.cpp.

Referenced by Flush().

◆ mType

int LongMessageDialog::mType
private

Definition at line 327 of file CommandTargets.cpp.

◆ pDlg

LongMessageDialog * LongMessageDialog::pDlg = NULL
static

Definition at line 325 of file CommandTargets.cpp.


The documentation for this class was generated from the following file: