From 8ae4f08661d7b324d5cd7aa16ab1a7b2810d94f2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 11 Aug 2004 18:11:30 +0000 Subject: [PATCH] Set minsize and implement DoGetBestSize git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/stc/stc.h | 1 + contrib/src/stc/stc.cpp | 10 ++++++++++ contrib/src/stc/stc.cpp.in | 10 ++++++++++ contrib/src/stc/stc.h.in | 1 + include/wx/stc/stc.h | 1 + src/stc/stc.cpp | 10 ++++++++++ src/stc/stc.cpp.in | 10 ++++++++++ src/stc/stc.h.in | 1 + 8 files changed, 44 insertions(+) diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index 12bb66c3b5..32b6b7bf34 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -2730,6 +2730,7 @@ private: void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); + virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events void NotifyChange(); diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index f96e8ffadc..8ab07a92ab 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -168,6 +168,8 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Put Scintilla into unicode (UTF-8) mode SetCodePage(wxSTC_CP_UTF8); #endif + + SetBestFittingSize(size); } @@ -2757,6 +2759,14 @@ void wxStyledTextCtrl::OnIdle(wxIdleEvent& evt) { } +wxSize wxStyledTextCtrl::DoGetBestSize() const +{ + // What would be the best size for a wxSTC? + // Just give a reasonable minimum until something else can be figured out. + return wxSize(200,100); +} + + //---------------------------------------------------------------------- // Turn notifications from Scintilla into events diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 11f590c9a4..6e626e3bef 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -168,6 +168,8 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Put Scintilla into unicode (UTF-8) mode SetCodePage(wxSTC_CP_UTF8); #endif + + SetBestFittingSize(size); } @@ -566,6 +568,14 @@ void wxStyledTextCtrl::OnIdle(wxIdleEvent& evt) { } +wxSize wxStyledTextCtrl::DoGetBestSize() const +{ + // What would be the best size for a wxSTC? + // Just give a reasonable minimum until something else can be figured out. + return wxSize(200,100); +} + + //---------------------------------------------------------------------- // Turn notifications from Scintilla into events diff --git a/contrib/src/stc/stc.h.in b/contrib/src/stc/stc.h.in index 2592301f63..91148d3575 100644 --- a/contrib/src/stc/stc.h.in +++ b/contrib/src/stc/stc.h.in @@ -246,6 +246,7 @@ private: void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); + virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events void NotifyChange(); diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 12bb66c3b5..32b6b7bf34 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -2730,6 +2730,7 @@ private: void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); + virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events void NotifyChange(); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index f96e8ffadc..8ab07a92ab 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -168,6 +168,8 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Put Scintilla into unicode (UTF-8) mode SetCodePage(wxSTC_CP_UTF8); #endif + + SetBestFittingSize(size); } @@ -2757,6 +2759,14 @@ void wxStyledTextCtrl::OnIdle(wxIdleEvent& evt) { } +wxSize wxStyledTextCtrl::DoGetBestSize() const +{ + // What would be the best size for a wxSTC? + // Just give a reasonable minimum until something else can be figured out. + return wxSize(200,100); +} + + //---------------------------------------------------------------------- // Turn notifications from Scintilla into events diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 11f590c9a4..6e626e3bef 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -168,6 +168,8 @@ void wxStyledTextCtrl::Create(wxWindow *parent, // Put Scintilla into unicode (UTF-8) mode SetCodePage(wxSTC_CP_UTF8); #endif + + SetBestFittingSize(size); } @@ -566,6 +568,14 @@ void wxStyledTextCtrl::OnIdle(wxIdleEvent& evt) { } +wxSize wxStyledTextCtrl::DoGetBestSize() const +{ + // What would be the best size for a wxSTC? + // Just give a reasonable minimum until something else can be figured out. + return wxSize(200,100); +} + + //---------------------------------------------------------------------- // Turn notifications from Scintilla into events diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 2592301f63..91148d3575 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -246,6 +246,7 @@ private: void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); + virtual wxSize DoGetBestSize() const; // Turn notifications from Scintilla into events void NotifyChange(); -- 2.45.2