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 102 of file SplashDialog.cpp.

103 : wxDialogWrapper(parent, -1, XO("Welcome to Audacity!"),
104 wxPoint( -1, 60 ), // default x position, y position 60 pixels from top of screen.
105 wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
106{
107 SetName();
108 m_pLogo = NULL; //v
109 ShuttleGui S( this, eIsCreating );
110 Populate( S );
111 Fit();
112 this->Centre();
113 int x,y;
114 GetPosition( &x, &y );
115 Move( x, 60 );
116}
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:39
#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
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 182 of file SplashDialog.cpp.

183{
184}

Member Function Documentation

◆ DoHelpWelcome()

void SplashDialog::DoHelpWelcome ( AudacityProject project)
static

Definition at line 97 of file SplashDialog.cpp.

98{
99 Show2( &GetProjectFrame( project ) );
100}
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 ...
static void Show2(wxWindow *pParent)

References GetProjectFrame().

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 118 of file SplashDialog.cpp.

119{
120 if ( event.ShiftDown() && event.ControlDown() )
121 wxLaunchDefaultBrowser("https://www.audacityteam.org");
122}

Referenced by Populate().

Here is the caller graph for this function:

◆ OnDontShow()

void SplashDialog::OnDontShow ( wxCommandEvent &  Evt)
private

Definition at line 186 of file SplashDialog.cpp.

187{
188 bool bShow = !Evt.IsChecked();
189 gPrefs->Write(wxT("/GUI/ShowSplashScreen"), bShow );
190 gPrefs->Flush();
191}
wxT("CloseDown"))
FileConfig * gPrefs
Definition: Prefs.cpp:70
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143

References FileConfig::Flush(), gPrefs, and wxT().

Here is the call graph for this function:

◆ OnOK()

void SplashDialog::OnOK ( wxCommandEvent &  event)

Definition at line 193 of file SplashDialog.cpp.

194{
195 Show( false );
196
197}

◆ Populate()

void SplashDialog::Populate ( ShuttleGui S)
private

Definition at line 124 of file SplashDialog.cpp.

125{
126 bool bShow;
127 gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &bShow, true );
128 S.StartVerticalLay(1);
129
130 //v For now, change to AudacityLogoWithName via old-fashioned ways, not Theme.
131 m_pLogo = std::make_unique<wxBitmap>((const char **) AudacityLogoWithName_xpm); //v
132
133
134 // JKC: Resize to 50% of size. Later we may use a smaller xpm as
135 // our source, but this allows us to tweak the size - if we want to.
136 // It also makes it easier to revert to full size if we decide to.
137 const float fScale=0.5f;// smaller size.
138 wxImage RescaledImage( m_pLogo->ConvertToImage() );
139 wxColour MainColour(
140 RescaledImage.GetRed(1,1),
141 RescaledImage.GetGreen(1,1),
142 RescaledImage.GetBlue(1,1));
143 this->SetBackgroundColour(MainColour);
144
145 // wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
146 RescaledImage.Rescale( (int)(LOGOWITHNAME_WIDTH * fScale), (int)(LOGOWITHNAME_HEIGHT *fScale) );
147 wxBitmap RescaledBitmap( RescaledImage );
148 wxStaticBitmap *const icon =
149 safenew wxStaticBitmap(S.GetParent(), -1,
150 //*m_pLogo, //v theTheme.Bitmap(bmpAudacityLogoWithName),
151 RescaledBitmap,
152 wxDefaultPosition,
153 wxSize((int)(LOGOWITHNAME_WIDTH*fScale), (int)(LOGOWITHNAME_HEIGHT*fScale)));
154
155 S.Prop(0)
156#if (0)
157 .ConnectRoot( wxEVT_LEFT_DOWN, &SplashDialog::OnChar)
158#endif
159 .AddWindow( icon );
160
161 mpHtml = safenew LinkingHtmlWindow(S.GetParent(), -1,
162 wxDefaultPosition, wxSize(506, HTMLWindowHeight),
163 wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER );
164 mpHtml->SetPage(HelpText( wxT("welcome") ));
165 S.Prop(1)
166 .Position( wxEXPAND )
167 .AddWindow( mpHtml );
168 S.Prop(0).StartMultiColumn(2, wxEXPAND);
169 S.SetStretchyCol( 1 );// Column 1 is stretchy...
170 {
171 S.SetBorder( 5 );
172 S.Id( DontShowID).AddCheckBox( XXO("Don't show this again at start up"), !bShow );
173 S.SetBorder( 5 );
174
175 S.Id(wxID_OK)
176 .Prop(0)
177 .AddButton(XXO("OK"), wxALIGN_RIGHT| wxALL, true);
178 }
179 S.EndVerticalLay();
180}
wxImage(22, 22)
#define LOGOWITHNAME_WIDTH
#define LOGOWITHNAME_HEIGHT
XXO("&Cut/Copy/Paste Toolbar")
wxString HelpText(const wxString &Key)
Definition: HelpText.cpp:329
#define safenew
Definition: MemoryX.h:10
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

References DontShowID, gPrefs, HelpText(), HTMLWindowHeight, LOGOWITHNAME_HEIGHT, LOGOWITHNAME_WIDTH, m_pLogo, mpHtml, OnChar(), 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 199 of file SplashDialog.cpp.

200{
201#ifdef HAS_WHATS_NEW
202 FSHelper helper;
203#endif // HAS_WHATS_NEW
204
205 if( pSelf == NULL )
206 {
207 // pParent owns it
208 wxASSERT(pParent);
209 pSelf = safenew SplashDialog( pParent );
210 }
211 pSelf->mpHtml->SetPage(HelpText( wxT("welcome") ));
212 pSelf->Show( true );
213}
SplashDialog(wxWindow *parent)
static SplashDialog * pSelf
Definition: SplashDialog.h:42

References HelpText(), mpHtml, pSelf, safenew, SplashDialog(), and wxT().

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: