- Added XRC handler for wxSearchCtrl (Sander Berents)
- Read image resolution from TIFF, JPEG and BMP images (Maycon Aparecido Gasoto)
- Added wxSYS_DCLICK_TIME system metric constant
+- Added wxApp::Get/SetAppDisplayName() (Brian A. Vanderburg II)
wxGTK:
// accessors for various simply fields
// -----------------------------------
- // name of the program, if not used defaults wxApp::GetAppName()
+ // name of the program, if not used defaults to wxApp::GetAppDisplayName()
void SetName(const wxString& name) { m_name = name; }
wxString GetName() const
- { return m_name.empty() ? wxTheApp->GetAppName() : m_name; }
+ { return m_name.empty() ? wxTheApp->GetAppDisplayName() : m_name; }
// version of the program, in free format (but without "version" word)
void SetVersion(const wxString& version) { m_version = version; }
}
void SetAppName(const wxString& name) { m_appName = name; }
+ // set/get the application display name: the display name is the name
+ // shown to the user in titles, reports, etc while the app name is
+ // used for paths, config, and other places the user doesn't see
+ //
+ // so the app name could be myapp while display name could be "My App"
+ wxString GetAppDisplayName() const
+ {
+ return m_appDisplayName.empty() ? GetAppName() : m_appDisplayName;
+ }
+ void SetAppDisplayName(const wxString& name) { m_appDisplayName = name; }
+
// set/get the app class name
wxString GetClassName() const { return m_className; }
void SetClassName(const wxString& name) { m_className = name; }
wxEventLoopBase *CreateMainLoop();
// application info (must be set from the user code)
- wxString m_vendorName, // vendor name (ACME Inc)
- m_appName, // app name
- m_className; // class name
+ wxString m_vendorName, // vendor name (e.g. "ACME Inc")
+ m_appName, // app name ("myapp")
+ m_appDisplayName, // app display name ("My Application")
+ m_className; // class name
// the class defining the application behaviour, NULL initially and created
// by GetTraits() when first needed
virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; }
// set use of best visual flag (see below)
- void SetUseBestVisual( bool flag, bool forceTrueColour = false )
+ void SetUseBestVisual( bool flag, bool forceTrueColour = false )
{ m_useBestVisual = flag; m_forceTrueColour = forceTrueColour; }
bool GetUseBestVisual() const { return m_useBestVisual; }
canvas->view = (wxView *) NULL;
canvas = (MyCanvas *) NULL;
- wxString s(wxTheApp->GetAppName());
+ wxString s(wxTheApp->GetAppDisplayName());
if (frame)
frame->SetTitle(s);
canvas->view = (wxView *) NULL;
canvas = (MyCanvas *) NULL;
- wxString s(wxTheApp->GetAppName());
+ wxString s(wxTheApp->GetAppDisplayName());
if (frame)
frame->SetTitle(s);
wxString wxDebugReport::GetReportName() const
{
if(wxTheApp)
- return wxTheApp->GetAppName();
+ return wxTheApp->GetAppDisplayName();
return _T("wx");
}
wxString title = GetUserReadableName();
wxString msgTitle;
- if (!wxTheApp->GetAppName().empty())
- msgTitle = wxTheApp->GetAppName();
+ if (!wxTheApp->GetAppDisplayName().empty())
+ msgTitle = wxTheApp->GetAppDisplayName();
else
msgTitle = wxString(_("Warning"));
bool wxDocument::DoSaveDocument(const wxString& file)
{
wxString msgTitle;
- if (!wxTheApp->GetAppName().empty())
- msgTitle = wxTheApp->GetAppName();
+ if (!wxTheApp->GetAppDisplayName().empty())
+ msgTitle = wxTheApp->GetAppDisplayName();
else
msgTitle = wxString(_("File error"));
// If docName is empty, a document is not currently active.
wxString wxDocManager::MakeFrameTitle(wxDocument* doc)
{
- wxString appName = wxTheApp->GetAppName();
+ wxString appName = wxTheApp->GetAppDisplayName();
wxString title;
if (!doc)
title = appName;
if (!wxFileExists(pathTmp))
{
wxString msgTitle;
- if (!wxTheApp->GetAppName().empty())
- msgTitle = wxTheApp->GetAppName();
+ if (!wxTheApp->GetAppDisplayName().empty())
+ msgTitle = wxTheApp->GetAppDisplayName();
else
msgTitle = wxString(_("File error"));
// the dialog title
wxString title(m_titleDialog);
if ( !title )
- title << wxTheApp->GetAppName() << _(": unknown charset");
+ title << wxTheApp->GetAppDisplayName() << _(": unknown charset");
// the message
wxString msg;
{
wxString title(m_titleDialog);
if ( !title )
- title << wxTheApp->GetAppName() << _(": unknown encoding");
+ title << wxTheApp->GetAppDisplayName() << _(": unknown encoding");
// built the message
wxString encDesc = GetEncodingDescription(encoding),
wxString title;
if ( wxTheApp )
- title.Printf(_("%s message"), wxTheApp->GetAppName().c_str());
+ title.Printf(_("%s message"), wxTheApp->GetAppDisplayName().c_str());
::wxMessageBox(out, title);
}
repeatCount = wxLog::DoLogNumberOfRepeats();
}
- wxString appName = wxTheApp->GetAppName();
- if ( !appName.empty() )
- appName[0u] = (wxChar)wxToupper(appName[0u]);
+ wxString appName = wxTheApp->GetAppDisplayName();
long style;
wxString titleFormat;
Display* xdisplay = wxGlobalDisplay();
Widget xwidget = (Widget)wxTheApp->GetTopLevelRealizedWidget();
Window xwindow = XtWindow( xwidget );
- wxXmString label( wxTheApp->GetAppName() );
+ wxXmString label( wxTheApp->GetAppDisplayName() );
Time timestamp = XtLastTimestampProcessed( xdisplay );
long itemId;
wxString name = wxString::Format
(
_T("%s_%s_%lu.dmp"),
- wxTheApp ? (const wxChar*)wxTheApp->GetAppName().c_str()
+ wxTheApp ? (const wxChar*)wxTheApp->GetAppDisplayName().c_str()
: _T("wxwindows"),
wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str(),
::GetCurrentProcessId()
{
wxString name;
if ( wxTheApp )
- name = wxTheApp->GetAppName();
+ name = wxTheApp->GetAppDisplayName();
if ( name.empty() )
name = L"wxWidgets Application";