Move LabelWrapper, TextSizerWrapper classes out of function body to accommodate some older compilers.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -177,28 +177,10 @@ void wxTextWrapper::Wrap(wxWindow *win, const wxString& text, int widthMax)
|
||||
}
|
||||
}
|
||||
|
||||
wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
|
||||
{
|
||||
// I admit that this is complete bogus, but it makes
|
||||
// message boxes work for pda screens temporarily..
|
||||
int widthMax = -1;
|
||||
const bool is_pda = wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA;
|
||||
if (is_pda)
|
||||
{
|
||||
widthMax = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) - 25;
|
||||
}
|
||||
|
||||
// '&' is used as accel mnemonic prefix in the wxWidgets controls but in
|
||||
// the static messages created by CreateTextSizer() (used by wxMessageBox,
|
||||
// for example), we don't want this special meaning, so we need to quote it
|
||||
wxString text(message);
|
||||
text.Replace(_T("&"), _T("&&"));
|
||||
|
||||
|
||||
class TextSizerWrapper : public wxTextWrapper
|
||||
class wxTextSizerWrapper : public wxTextWrapper
|
||||
{
|
||||
public:
|
||||
TextSizerWrapper(wxWindow *win)
|
||||
wxTextSizerWrapper(wxWindow *win)
|
||||
{
|
||||
m_win = win;
|
||||
m_hLine = 0;
|
||||
@@ -233,20 +215,29 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
|
||||
int m_hLine;
|
||||
};
|
||||
|
||||
TextSizerWrapper wrapper(this);
|
||||
wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
|
||||
{
|
||||
// I admit that this is complete bogus, but it makes
|
||||
// message boxes work for pda screens temporarily..
|
||||
int widthMax = -1;
|
||||
const bool is_pda = wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA;
|
||||
if (is_pda)
|
||||
{
|
||||
widthMax = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) - 25;
|
||||
}
|
||||
|
||||
// '&' is used as accel mnemonic prefix in the wxWidgets controls but in
|
||||
// the static messages created by CreateTextSizer() (used by wxMessageBox,
|
||||
// for example), we don't want this special meaning, so we need to quote it
|
||||
wxString text(message);
|
||||
text.Replace(_T("&"), _T("&&"));
|
||||
|
||||
wxTextSizerWrapper wrapper(this);
|
||||
|
||||
return wrapper.CreateSizer(text, widthMax);
|
||||
}
|
||||
|
||||
void
|
||||
#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
|
||||
wxStaticText
|
||||
#else
|
||||
wxStaticTextBase
|
||||
#endif
|
||||
::Wrap(int width)
|
||||
{
|
||||
class LabelWrapper : public wxTextWrapper
|
||||
class wxLabelWrapper : public wxTextWrapper
|
||||
{
|
||||
public:
|
||||
void WrapLabel(wxWindow *text, int widthMax)
|
||||
@@ -271,7 +262,15 @@ wxStaticTextBase
|
||||
wxString m_text;
|
||||
};
|
||||
|
||||
LabelWrapper wrapper;
|
||||
void
|
||||
#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
|
||||
wxStaticText
|
||||
#else
|
||||
wxStaticTextBase
|
||||
#endif
|
||||
::Wrap(int width)
|
||||
{
|
||||
wxLabelWrapper wrapper;
|
||||
wrapper.WrapLabel(this, width);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user