X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92afa2b150803da84a4bc7dfa4e580dbbff15c9a..e1082c9fa8763696ea87c75b1435db9d3a2e1d7c:/src/generic/tipdlg.cpp diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index 72f4675b25..c13b869e2b 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -40,10 +40,12 @@ #include "wx/settings.h" #include "wx/textctrl.h" #include "wx/statbmp.h" + #include "wx/stattext.h" #include "wx/sizer.h" #endif // WX_PRECOMP #include "wx/statline.h" +#include "wx/artprov.h" #include "wx/tipdlg.h" @@ -83,7 +85,7 @@ public: // Empty implementation for now to keep the linker happy wxString wxRegTipProvider::GetTip() { - return ""; + return wxEmptyString; } #endif // __WIN32__ @@ -165,55 +167,61 @@ wxTipDialog::wxTipDialog(wxWindow *parent, m_tipProvider = tipProvider; // 1) create all controls in tab order - + wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close")); - + m_checkbox = new wxCheckBox(this, -1, _("&Show tips at startup")); m_checkbox->SetValue(showAtStartup); - - wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next")); - wxTextCtrl *text = new wxTextCtrl(this, -1, _("Did you know..."), - wxDefaultPosition, wxDefaultSize, - wxTE_READONLY | wxNO_BORDER); + wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip")); + + wxStaticText *text = new wxStaticText(this, -1, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) ); +#if defined(__WXMSW__) + text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD)); +#else text->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxBOLD)); - text->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE)); +#endif +// +// text->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - m_text = new wxTextCtrl(this, -1, _T(""), + m_text = new wxTextCtrl(this, -1, wxT(""), wxDefaultPosition, wxSize(200, 160), - wxTE_MULTILINE | wxTE_READONLY | wxSUNKEN_BORDER); - m_text->SetFont(wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)); - -#if defined(__WXMSW__) || defined(__WXPM__) - wxIcon icon("wxICON_TIP"); + wxTE_MULTILINE | + wxTE_READONLY | + wxTE_RICH | // a hack to get rid of vert scrollbar + wxSUNKEN_BORDER); +#if defined(__WXMSW__) + m_text->SetFont(wxFont(12, wxROMAN, wxNORMAL, wxNORMAL)); #else - #include "wx/generic/tip.xpm" - wxIcon icon(tipIcon); + m_text->SetFont(wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)); #endif + + wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG); wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon); // 2) put them in boxes wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL ); icon_text->Add( bmp, 0, wxCENTER ); - icon_text->Add( text, 1, wxCENTER | wxLEFT, 10 ); + icon_text->Add( text, 1, wxCENTER | wxLEFT, 20 ); topsizer->Add( icon_text, 0, wxEXPAND | wxALL, 10 ); - + topsizer->Add( m_text, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 ); wxBoxSizer *bottom = new wxBoxSizer( wxHORIZONTAL ); bottom->Add( m_checkbox, 0, wxCENTER ); + bottom->Add( 10,10,1 ); bottom->Add( btnNext, 0, wxCENTER | wxLEFT, 10 ); bottom->Add( btnClose, 0, wxCENTER | wxLEFT, 10 ); - topsizer->Add( bottom, 0, wxALIGN_RIGHT | wxALL, 10 ); + topsizer->Add( bottom, 0, wxEXPAND | wxALL, 10 ); SetTipText(); - + SetAutoLayout(TRUE); SetSizer( topsizer ); - + topsizer->SetSizeHints( this ); topsizer->Fit( this );