Audacity  3.0.3
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 110 of file SplashDialog.cpp.

111  : wxDialogWrapper(parent, -1, XO("Welcome to Audacity!"),
112  wxPoint( -1, 60 ), // default x position, y position 60 pixels from top of screen.
113  wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
114 {
115  SetName();
116  m_pLogo = NULL; //v
117  ShuttleGui S( this, eIsCreating );
118  Populate( S );
119  Fit();
120  this->Centre();
121  int x,y;
122  GetPosition( &x, &y );
123  Move( x, 60 );
124 }

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

Referenced by Show2().

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

◆ ~ SplashDialog()

virtual SplashDialog::~ SplashDialog ( )
virtual

Member Function Documentation

◆ DoHelpWelcome()

void SplashDialog::DoHelpWelcome ( AudacityProject project)
static

Definition at line 105 of file SplashDialog.cpp.

106 {
107  Show2( &GetProjectFrame( project ) );
108 }

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

127 {
128  if ( event.ShiftDown() && event.ControlDown() )
129  wxLaunchDefaultBrowser("https://www.audacityteam.org");
130 }

Referenced by Populate().

Here is the caller graph for this function:

◆ OnDontShow()

void SplashDialog::OnDontShow ( wxCommandEvent &  Evt)
private

Definition at line 195 of file SplashDialog.cpp.

196 {
197  bool bShow = !Evt.IsChecked();
198  gPrefs->Write(wxT("/GUI/ShowSplashScreen"), bShow );
199  gPrefs->Flush();
200 }

References FileConfig::Flush(), and gPrefs.

Here is the call graph for this function:

◆ OnOK()

void SplashDialog::OnOK ( wxCommandEvent &  event)

Definition at line 202 of file SplashDialog.cpp.

203 {
204  Show( false );
205 
206 }

◆ Populate()

void SplashDialog::Populate ( ShuttleGui S)
private

Definition at line 132 of file SplashDialog.cpp.

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

References ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddCheckBox(), ShuttleGuiBase::AddWindow(), ShuttleGui::ConnectRoot(), DontShowID, ShuttleGuiBase::EndVerticalLay(), ShuttleGuiBase::GetParent(), gPrefs, HelpText(), ShuttleGui::Id(), LOGOWITHNAME_HEIGHT, LOGOWITHNAME_WIDTH, m_pLogo, mpHtml, OnChar(), ShuttleGui::Position(), ShuttleGui::Prop(), safenew, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartVerticalLay(), 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 208 of file SplashDialog.cpp.

209 {
210 #ifdef HAS_WHATS_NEW
211  FSHelper helper;
212 #endif // HAS_WHATS_NEW
213 
214  if( pSelf == NULL )
215  {
216  // pParent owns it
217  wxASSERT(pParent);
218  pSelf = safenew SplashDialog( pParent );
219  }
220  pSelf->mpHtml->SetPage(HelpText( wxT("welcome") ));
221  pSelf->Show( true );
222 }

References HelpText(), 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:
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
ShuttleGuiBase::AddCheckBox
wxCheckBox * AddCheckBox(const TranslatableString &Prompt, bool Selected)
Definition: ShuttleGui.cpp:309
SplashDialog::Populate
void Populate(ShuttleGui &S)
Definition: SplashDialog.cpp:132
DontShowID
@ DontShowID
Definition: SplashDialog.cpp:95
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
SplashDialog::m_pLogo
std::unique_ptr< wxBitmap > m_pLogo
Definition: SplashDialog.h:41
SplashDialog::Show2
static void Show2(wxWindow *pParent)
Definition: SplashDialog.cpp:208
XO
#define XO(s)
Definition: Internat.h:31
LOGOWITHNAME_WIDTH
#define LOGOWITHNAME_WIDTH
Definition: AllThemeResources.h:241
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
XXO
#define XXO(s)
Definition: Internat.h:44
SplashDialog::OnChar
void OnChar(wxMouseEvent &event)
Definition: SplashDialog.cpp:126
SplashDialog::pSelf
static SplashDialog * pSelf
Definition: SplashDialog.h:42
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
LinkingHtmlWindow
An HtmlWindow that handles linked clicked - usually the link will go to our own local copy of the man...
Definition: HelpSystem.h:126
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:496
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:299
ShuttleGui::Prop
ShuttleGui & Prop(int iProp)
Definition: ShuttleGui.h:725
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:360
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
ShuttleGui::Position
ShuttleGui & Position(int flags)
Definition: ShuttleGui.h:712
ShuttleGui::ConnectRoot
auto ConnectRoot(wxEventTypeTag< Tag > eventType, void(Handler::*func)(Argument &)) -> typename std::enable_if< std::is_base_of< Argument, Tag >::value, ShuttleGui & >::type
Definition: ShuttleGui.h:699
SplashDialog::mpHtml
HtmlWindow * mpHtml
Definition: SplashDialog.h:40
GetProjectFrame
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 ...
Definition: ProjectWindows.cpp:72
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
SplashDialog::SplashDialog
SplashDialog(wxWindow *parent)
Definition: SplashDialog.cpp:110
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
HelpText
AUDACITY_DLL_API wxString HelpText(const wxString &Key)
safenew
#define safenew
Definition: MemoryX.h:10
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
LOGOWITHNAME_HEIGHT
#define LOGOWITHNAME_HEIGHT
Definition: AllThemeResources.h:244