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 42 of file wxCommandTargets.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 77 of file wxCommandTargets.cpp.

82: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags | wxRESIZE_BORDER)
83{
84 mType = type;
85 mAdditionalButtons = additionalButtons;
86 SetName(XO("Long Message"));
87 // The long message adds lots of short strings onto this one.
88 // So preallocate to make it faster.
89 // Needs 37Kb for all commands.
90 mText.Alloc(40000);
91}
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 93 of file wxCommandTargets.cpp.

93 {
94 pDlg = NULL;
95}
static LongMessageDialog * pDlg

Member Function Documentation

◆ AcceptText()

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

Definition at line 127 of file wxCommandTargets.cpp.

128{
129 if( pDlg == NULL ){
131 wxTheApp->GetTopWindow(), XO( "Long Message" ) );
132 pDlg->Init();
133 pDlg->Show();
134 }
135 pDlg->mText = pDlg->mText + Text;
136}
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 138 of file wxCommandTargets.cpp.

139{
140 if( pDlg ){
141 if( !pDlg->mText.EndsWith( "\n\n" ))
142 {
143 pDlg->mText += "\n\n";
144 pDlg->mTextCtrl->SetValue( pDlg->mText );
145 pDlg->mTextCtrl->ShowPosition( pDlg->mTextCtrl->GetLastPosition() );
146 }
147 }
148}
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 97 of file wxCommandTargets.cpp.

98{
100
101 S.SetBorder(5);
102 S.StartVerticalLay(true);
103 {
104 mTextCtrl = S.AddTextWindow( "" );
105 long buttons = eOkButton;
106 S.AddStandardButtons(buttons|mAdditionalButtons);
107 }
108 S.EndVerticalLay();
109
110 Layout();
111 Fit();
112 SetMinSize(wxSize(600,350));
113 Center();
114 return true;
115}
@ eIsCreating
Definition: ShuttleGui.h:37
@ eOkButton
Definition: ShuttleGui.h:609
#define S(N)
Definition: ToChars.cpp:64
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

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 122 of file wxCommandTargets.cpp.

122 {
123 //Close(true);
124 Destroy();
125}

◆ OnOk()

void LongMessageDialog::OnOk ( wxCommandEvent &  evt)
virtual

Definition at line 117 of file wxCommandTargets.cpp.

117 {
118 //Close(true);
119 Destroy();
120}

◆ wxDECLARE_NO_COPY_CLASS()

LongMessageDialog::wxDECLARE_NO_COPY_CLASS ( LongMessageDialog  )
private

Member Data Documentation

◆ mAdditionalButtons

int LongMessageDialog::mAdditionalButtons
private

Definition at line 65 of file wxCommandTargets.cpp.

◆ mText

wxString LongMessageDialog::mText

Definition at line 61 of file wxCommandTargets.cpp.

Referenced by AcceptText(), and Flush().

◆ mTextCtrl

wxTextCtrl* LongMessageDialog::mTextCtrl

Definition at line 60 of file wxCommandTargets.cpp.

Referenced by Flush().

◆ mType

int LongMessageDialog::mType
private

Definition at line 64 of file wxCommandTargets.cpp.

◆ pDlg

LongMessageDialog * LongMessageDialog::pDlg = NULL
static

Definition at line 62 of file wxCommandTargets.cpp.


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