replaced run-time tests for wxRICHTEXT_USE_TOOLBOOK with compile-time ones to avoid warnings about condition being always true/false

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-30 13:19:43 +00:00
parent a6a68df85b
commit d0cf495347

View File

@@ -335,9 +335,7 @@ int wxRichTextFormattingDialogFactory::GetPageIdCount() const
/// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create /// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create
bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog* dialog) bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog* dialog)
{ {
bool useToolBook = wxRICHTEXT_USE_TOOLBOOK; #if wxRICHTEXT_USE_TOOLBOOK
if (useToolBook)
{
int sheetStyle = wxPROPSHEET_SHRINKTOFIT; int sheetStyle = wxPROPSHEET_SHRINKTOFIT;
#ifdef __WXMAC__ #ifdef __WXMAC__
sheetStyle |= wxPROPSHEET_BUTTONTOOLBOOK; sheetStyle |= wxPROPSHEET_BUTTONTOOLBOOK;
@@ -348,7 +346,7 @@ bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog
dialog->SetSheetStyle(sheetStyle); dialog->SetSheetStyle(sheetStyle);
dialog->SetSheetInnerBorder(0); dialog->SetSheetInnerBorder(0);
dialog->SetSheetOuterBorder(0); dialog->SetSheetOuterBorder(0);
} #endif // wxRICHTEXT_USE_TOOLBOOK
return true; return true;
} }
@@ -356,17 +354,16 @@ bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog
/// Create the main dialog buttons /// Create the main dialog buttons
bool wxRichTextFormattingDialogFactory::CreateButtons(wxRichTextFormattingDialog* dialog) bool wxRichTextFormattingDialogFactory::CreateButtons(wxRichTextFormattingDialog* dialog)
{ {
bool useToolBook = wxRICHTEXT_USE_TOOLBOOK;
// If using a toolbook, also follow Mac style and don't create buttons
int flags = wxOK|wxCANCEL; int flags = wxOK|wxCANCEL;
#ifndef __WXWINCE__ #ifndef __WXWINCE__
if (dialog->GetWindowStyleFlag() & wxRICHTEXT_FORMAT_HELP_BUTTON) if (dialog->GetWindowStyleFlag() & wxRICHTEXT_FORMAT_HELP_BUTTON)
flags |= wxHELP; flags |= wxHELP;
#endif #endif
if (!useToolBook) // If using a toolbook, also follow Mac style and don't create buttons
#if !wxRICHTEXT_USE_TOOLBOOK
dialog->CreateButtons(flags); dialog->CreateButtons(flags);
#endif
return true; return true;
} }