Audacity  3.0.3
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 }

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 }

Member Function Documentation

◆ AcceptText()

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

Definition at line 393 of file CommandTargets.cpp.

394 {
395  if( pDlg == NULL ){
396  pDlg = new LongMessageDialog(
397  wxTheApp->GetTopWindow(), XO( "Long Message" ) );
398  pDlg->Init();
399  pDlg->Show();
400  }
401  pDlg->mText = pDlg->mText + Text;
402 }

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 }

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 }

References ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddTextWindow(), eIsCreating, ShuttleGuiBase::EndVerticalLay(), eOkButton, ShuttleGuiBase::SetBorder(), and ShuttleGuiBase::StartVerticalLay().

Referenced by AcceptText().

Here is the call graph for this function:
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:
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
LongMessageDialog::mText
wxString mText
Definition: CommandTargets.cpp:324
XO
#define XO(s)
Definition: Internat.h:31
LongMessageDialog::mAdditionalButtons
int mAdditionalButtons
Definition: CommandTargets.cpp:328
LongMessageDialog::mType
int mType
Definition: CommandTargets.cpp:327
LongMessageDialog::pDlg
static LongMessageDialog * pDlg
Definition: CommandTargets.cpp:325
LongMessageDialog::mTextCtrl
wxTextCtrl * mTextCtrl
Definition: CommandTargets.cpp:323
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
eOkButton
@ eOkButton
Definition: ShuttleGui.h:600
LongMessageDialog::LongMessageDialog
LongMessageDialog(wxWindow *parent, const TranslatableString &title, int type=0, int flags=wxDEFAULT_DIALOG_STYLE, int additionalButtons=0)
Definition: CommandTargets.cpp:342
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
LongMessageDialog::Init
bool Init()
Definition: CommandTargets.cpp:363
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631