Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SplashDialog Class Referencefinal

The SplashDialog shows help information for Audacity when Audacity starts up. More...

#include <SplashDialog.h>

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

Public Member Functions

 SplashDialog (wxWindow *parent)
 
virtual ~SplashDialog ()
 
void OnOK (wxCommandEvent &event)
 
- 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 DoHelpWelcome (AudacityProject &project)
 
static void Show2 (wxWindow *pParent)
 

Private Member Functions

void OnChar (wxMouseEvent &event)
 
void Populate (ShuttleGui &S)
 
void OnDontShow (wxCommandEvent &Evt)
 

Private Attributes

HtmlWindowmpHtml
 
std::unique_ptr< wxBitmap > m_pLogo
 

Static Private Attributes

static SplashDialogpSelf =NULL
 

Detailed Description

The SplashDialog shows help information for Audacity when Audacity starts up.

It was written for the benefit of NEW users who do not want to read the manual. The text of the dialog is kept short to increase the chance of it being read. The content is designed to reduce the most commonly asked questions about Audacity.

Definition at line 21 of file SplashDialog.h.

Constructor & Destructor Documentation

◆ SplashDialog()

SplashDialog::SplashDialog ( wxWindow *  parent)

Definition at line 174 of file SplashDialog.cpp.

175 : wxDialogWrapper(parent, -1, XO("Welcome to Audacity!"),
176 wxPoint( -1, 60 ), // default x position, y position 60 pixels from top of screen.
177 wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
178{
179 SetName();
180 m_pLogo = NULL; //v
181 ShuttleGui S( this, eIsCreating );
182 Populate( S );
183 Fit();
184 this->Centre();
185 int x,y;
186 GetPosition( &x, &y );
187 Move( x, 60 );
188}
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:37
#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
void Populate(ShuttleGui &S)
std::unique_ptr< wxBitmap > m_pLogo
Definition: SplashDialog.h:41

References eIsCreating, m_pLogo, Populate(), S, and wxDialogWrapper::SetName().

Referenced by Show2().

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

◆ ~SplashDialog()

SplashDialog::~SplashDialog ( )
virtual

Definition at line 252 of file SplashDialog.cpp.

253{
254}

Member Function Documentation

◆ DoHelpWelcome()

void SplashDialog::DoHelpWelcome ( AudacityProject project)
static

Definition at line 169 of file SplashDialog.cpp.

170{
172}
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
const auto project
static void Show2(wxWindow *pParent)

References GetProjectFrame(), and project.

Referenced by AudacityApp::InitPart2().

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

◆ OnChar()

void SplashDialog::OnChar ( wxMouseEvent &  event)
private

Definition at line 190 of file SplashDialog.cpp.

191{
192 if ( event.ShiftDown() && event.ControlDown() )
193 wxLaunchDefaultBrowser("https://www.audacityteam.org");
194}

Referenced by Populate().

Here is the caller graph for this function:

◆ OnDontShow()

void SplashDialog::OnDontShow ( wxCommandEvent &  Evt)
private

Definition at line 256 of file SplashDialog.cpp.

257{
258 bool bShow = !Evt.IsChecked();
259 gPrefs->Write(wxT("/GUI/ShowSplashScreen"), bShow );
260 gPrefs->Flush();
261}
wxT("CloseDown"))
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0

References audacity::BasicSettings::Flush(), gPrefs, audacity::BasicSettings::Write(), and wxT().

Here is the call graph for this function:

◆ OnOK()

void SplashDialog::OnOK ( wxCommandEvent &  event)

Definition at line 263 of file SplashDialog.cpp.

264{
265 Show( false );
266
267}
IMPORT_EXPORT_API ExportResult Show(ExportTask exportTask)

References ExportProgressUI::Show().

Here is the call graph for this function:

◆ Populate()

void SplashDialog::Populate ( ShuttleGui S)
private

Definition at line 196 of file SplashDialog.cpp.

197{
198 bool bShow;
199 gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &bShow, true );
200 S.StartVerticalLay(1);
201
202 //v For now, change to AudacityLogoWithName via old-fashioned ways, not Theme.
203 m_pLogo = std::make_unique<wxBitmap>((const char **) AudacityLogoWithName_xpm); //v
204
205
206 //Setup to scale the logo larger and smaller as necessary
207 const float fScale=1.0f;
208 wxImage RescaledImage( m_pLogo->ConvertToImage() );
209 wxColour MainColour(
210 RescaledImage.GetRed(1,1),
211 RescaledImage.GetGreen(1,1),
212 RescaledImage.GetBlue(1,1));
213 this->SetBackgroundColour(MainColour);
214
215 // wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
216 RescaledImage.Rescale( (int)(LOGOWITHNAME_WIDTH * fScale), (int)(LOGOWITHNAME_HEIGHT *fScale) );
217 wxBitmap RescaledBitmap( RescaledImage );
218 wxStaticBitmap *const icon =
219 safenew wxStaticBitmap(S.GetParent(), -1,
220 //*m_pLogo, //v theTheme.Bitmap(bmpAudacityLogoWithName),
221 RescaledBitmap,
222 wxDefaultPosition,
223 wxSize((int)(LOGOWITHNAME_WIDTH*fScale), (int)(LOGOWITHNAME_HEIGHT*fScale)));
224
225 S.Prop(0)
226#if (0)
227 .ConnectRoot( wxEVT_LEFT_DOWN, &SplashDialog::OnChar)
228#endif
229 .AddWindow( icon );
230
231 mpHtml = safenew LinkingHtmlWindow(S.GetParent(), -1,
232 wxDefaultPosition, wxSize(506, HTMLWindowHeight),
233 wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER );
234 mpHtml->SetPage(HelpText( wxT("welcome") ));
235 S.Prop(1)
236 .Position( wxEXPAND )
237 .AddWindow( mpHtml );
238 S.Prop(0).StartMultiColumn(2, wxEXPAND);
239 S.SetStretchyCol( 1 );// Column 1 is stretchy...
240 {
241 S.SetBorder( 5 );
242 S.Id( DontShowID).AddCheckBox( XXO("Don't show this again at start up"), !bShow );
243 S.SetBorder( 5 );
244
245 S.Id(wxID_OK)
246 .Prop(0)
247 .AddButton(XXO("OK"), wxALIGN_RIGHT| wxALL, true);
248 }
249 S.EndVerticalLay();
250}
wxImage(22, 22)
#define LOGOWITHNAME_WIDTH
#define LOGOWITHNAME_HEIGHT
XXO("&Cut/Copy/Paste Toolbar")
wxString HelpText(const wxString &Key)
Definition: HelpText.cpp:238
#define safenew
Definition: MemoryX.h:9
constexpr int HTMLWindowHeight
@ DontShowID
An HtmlWindow that handles linked clicked - usually the link will go to our own local copy of the man...
Definition: HelpSystem.h:126
void OnChar(wxMouseEvent &event)
HtmlWindow * mpHtml
Definition: SplashDialog.h:40
virtual bool Read(const wxString &key, bool *value) const =0

References DontShowID, gPrefs, HelpText(), HTMLWindowHeight, LOGOWITHNAME_HEIGHT, LOGOWITHNAME_WIDTH, m_pLogo, mpHtml, OnChar(), audacity::BasicSettings::Read(), S, safenew, wxImage(), wxT(), and XXO().

Referenced by SplashDialog().

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

◆ Show2()

void SplashDialog::Show2 ( wxWindow *  pParent)
static

Definition at line 269 of file SplashDialog.cpp.

270{
271#ifdef HAS_WHATS_NEW
272 FSHelper helper;
273#endif // HAS_WHATS_NEW
274
275 if( pSelf == NULL )
276 {
277 // pParent owns it
278 wxASSERT(pParent);
279 pSelf = safenew SplashDialog( pParent );
280 }
281 pSelf->mpHtml->SetPage(MakeWhatsNewText());
282 pSelf->Show( true );
283}
SplashDialog(wxWindow *parent)
static SplashDialog * pSelf
Definition: SplashDialog.h:42

References anonymous_namespace{SplashDialog.cpp}::MakeWhatsNewText(), mpHtml, pSelf, safenew, and SplashDialog().

Here is the call graph for this function:

Member Data Documentation

◆ m_pLogo

std::unique_ptr<wxBitmap> SplashDialog::m_pLogo
private

Definition at line 41 of file SplashDialog.h.

Referenced by Populate(), and SplashDialog().

◆ mpHtml

HtmlWindow* SplashDialog::mpHtml
private

Definition at line 40 of file SplashDialog.h.

Referenced by Populate(), and Show2().

◆ pSelf

SplashDialog * SplashDialog::pSelf =NULL
staticprivate

Definition at line 42 of file SplashDialog.h.

Referenced by Show2().


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