X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2aab96f58d53e83313cc1d619dde1c00f6ccaa80..0afeb753e0a6a3fdba290bf3612bb2f012d44d95:/src/osx/cocoa/preferences.mm diff --git a/src/osx/cocoa/preferences.mm b/src/osx/cocoa/preferences.mm index 389e75092d..14a971d7e5 100644 --- a/src/osx/cocoa/preferences.mm +++ b/src/osx/cocoa/preferences.mm @@ -54,8 +54,8 @@ wxBitmap wxStockPreferencesPage::GetLargeIcon() const class wxCocoaPrefsWindow : public wxFrame { public: - wxCocoaPrefsWindow() - : wxFrame(NULL, wxID_ANY, _("Preferences"), + wxCocoaPrefsWindow(const wxString& title) + : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX | wxMINIMIZE_BOX)), m_toolbarRealized(false), @@ -67,7 +67,7 @@ public: m_toolbar->OSXSetSelectableTools(true); SetToolBar(m_toolbar); - m_toolbar->Bind(wxEVT_COMMAND_TOOL_CLICKED, + m_toolbar->Bind(wxEVT_TOOL, &wxCocoaPrefsWindow::OnPageChanged, this); Bind(wxEVT_CLOSE_WINDOW, &wxCocoaPrefsWindow::OnClose, this); } @@ -129,6 +129,7 @@ private: { info->win = info->page->CreateWindow(this); info->win->Hide(); + info->win->Fit(); // fill the page with data using wxEVT_INIT_DIALOG/TransferDataToWindow: info->win->InitDialog(); } @@ -191,7 +192,8 @@ private: class wxCocoaPreferencesEditorImpl : public wxPreferencesEditorImpl { public: - wxCocoaPreferencesEditorImpl() : m_win(NULL) + wxCocoaPreferencesEditorImpl(const wxString& title) + : m_win(NULL), m_title(title) { } @@ -232,17 +234,25 @@ private: wxCocoaPrefsWindow* GetWin() { if ( !m_win ) - m_win = new wxCocoaPrefsWindow(); + { + if ( m_title.empty() ) + m_title = _("Preferences"); + + m_win = new wxCocoaPrefsWindow(m_title); + } + return m_win; } wxWeakRef m_win; + + wxString m_title; }; /*static*/ -wxPreferencesEditorImpl* wxPreferencesEditorImpl::Create() +wxPreferencesEditorImpl* wxPreferencesEditorImpl::Create(const wxString& title) { - return new wxCocoaPreferencesEditorImpl(); + return new wxCocoaPreferencesEditorImpl(title); } #endif // wxHAS_PREF_EDITOR_NATIVE