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 304 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 341 of file CommandTargets.cpp.

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

References wxDialogWrapper::SetName(), and XO().

Here is the call graph for this function:

◆ ~LongMessageDialog()

LongMessageDialog::~LongMessageDialog ( )

Definition at line 357 of file CommandTargets.cpp.

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

Member Function Documentation

◆ AcceptText()

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

Definition at line 392 of file CommandTargets.cpp.

393{
394 if( pDlg == NULL ){
396 wxTheApp->GetTopWindow(), XO( "Long Message" ) );
397 pDlg->Init();
398 pDlg->Show();
399 }
400 pDlg->mText = pDlg->mText + Text;
401}
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 403 of file CommandTargets.cpp.

404{
405 if( pDlg ){
406 if( !pDlg->mText.EndsWith( "\n\n" ))
407 {
408 pDlg->mText += "\n\n";
409 pDlg->mTextCtrl->SetValue( pDlg->mText );
410 pDlg->mTextCtrl->ShowPosition( pDlg->mTextCtrl->GetLastPosition() );
411 }
412 }
413}
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 362 of file CommandTargets.cpp.

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

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 387 of file CommandTargets.cpp.

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

◆ OnOk()

void LongMessageDialog::OnOk ( wxCommandEvent &  evt)
virtual

Definition at line 382 of file CommandTargets.cpp.

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

◆ wxDECLARE_NO_COPY_CLASS()

LongMessageDialog::wxDECLARE_NO_COPY_CLASS ( LongMessageDialog  )
private

Member Data Documentation

◆ mAdditionalButtons

int LongMessageDialog::mAdditionalButtons
private

Definition at line 327 of file CommandTargets.cpp.

◆ mText

wxString LongMessageDialog::mText

Definition at line 323 of file CommandTargets.cpp.

Referenced by AcceptText(), and Flush().

◆ mTextCtrl

wxTextCtrl* LongMessageDialog::mTextCtrl

Definition at line 322 of file CommandTargets.cpp.

Referenced by Flush().

◆ mType

int LongMessageDialog::mType
private

Definition at line 326 of file CommandTargets.cpp.

◆ pDlg

LongMessageDialog * LongMessageDialog::pDlg = NULL
static

Definition at line 324 of file CommandTargets.cpp.


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