From 09fdd090fabb30bfa91d9192f486876916159b91 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Sep 2018 13:39:28 +0200 Subject: [PATCH] Exchange the font and test panels in the font sample No real changes, but it seems to make more sense to show the font information first and less important text sample below. --- samples/font/font.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 85388eee57..c247b9d2c7 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -76,6 +76,12 @@ public: // event handlers void OnPaint( wxPaintEvent &event ); +protected: + virtual wxSize DoGetBestClientSize() const wxOVERRIDE + { + return wxSize(60*GetCharWidth(), 15*GetCharHeight()); + } + private: wxColour m_colour; wxFont m_font; @@ -443,14 +449,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) wxSplitterWindow *splitter = new wxSplitterWindow(this); - m_textctrl = new wxTextCtrl(splitter, wxID_ANY, - wxT("Paste text here to see how it looks\nlike in the given font"), - wxDefaultPosition, wxDefaultSize, - wxTE_MULTILINE); - m_canvas = new MyCanvas(splitter); - splitter->SplitHorizontally(m_textctrl, m_canvas, 100); + m_textctrl = new wxTextCtrl(splitter, wxID_ANY, + wxT("Paste text here to see how it looks\nlike in the given font"), + wxDefaultPosition, + wxSize(-1, 6*GetCharHeight()), + wxTE_MULTILINE); + + splitter->SplitHorizontally(m_canvas, m_textctrl, m_canvas->GetBestSize().y); #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only)