Source cleaning: TRUE/true, FALSE/false, whitespaces, tabs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-09 17:42:36 +00:00
parent 11908acc89
commit c9d59ee7e0
12 changed files with 133 additions and 133 deletions

View File

@@ -26,16 +26,16 @@
#if __VISUALC__ > 1100 #if __VISUALC__ > 1100
#pragma warning(push, 1) #pragma warning(push, 1)
#else // VC 5 #else // VC 5
// 'expression' : signed/unsigned mismatch // 'expression' : signed/unsigned mismatch
#pragma warning(disable:4018) #pragma warning(disable:4018)
// 'conversion' : conversion from 'type1' to 'type2', // 'conversion' : conversion from 'type1' to 'type2',
// possible loss of data // possible loss of data
#pragma warning(disable:4244) #pragma warning(disable:4244)
// C++ language change: to explicitly specialize class template // C++ language change: to explicitly specialize class template
// 'identifier' use the following syntax // 'identifier' use the following syntax
#pragma warning(disable:4663) #pragma warning(disable:4663)
#endif #endif
// these warning have to be disabled and not just temporarily disabled // these warning have to be disabled and not just temporarily disabled

View File

@@ -94,7 +94,7 @@
#else #else
#define __WX_BO_STL ",wx containers" #define __WX_BO_STL ",wx containers"
#endif #endif
// This macro is passed as argument to wxConsoleApp::CheckBuildOptions() // This macro is passed as argument to wxConsoleApp::CheckBuildOptions()
#define WX_BUILD_OPTIONS_SIGNATURE \ #define WX_BUILD_OPTIONS_SIGNATURE \
__WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \ __WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \

View File

@@ -52,10 +52,10 @@ bool wxBitmapBase::RemoveHandler(const wxString& name)
if ( handler ) if ( handler )
{ {
sm_handlers.DeleteObject(handler); sm_handlers.DeleteObject(handler);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name) wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name)
@@ -116,7 +116,7 @@ class wxBitmapBaseModule: public wxModule
DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule) DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule)
public: public:
wxBitmapBaseModule() {} wxBitmapBaseModule() {}
bool OnInit() { wxBitmap::InitStandardHandlers(); return TRUE; }; bool OnInit() { wxBitmap::InitStandardHandlers(); return true; };
void OnExit() { wxBitmap::CleanUpHandlers(); }; void OnExit() { wxBitmap::CleanUpHandlers(); };
}; };

View File

@@ -152,7 +152,7 @@ wxBookCtrl::InsertPage(size_t nPage,
m_pages.Insert(page, nPage); m_pages.Insert(page, nPage);
InvalidateBestSize(); InvalidateBestSize();
return true; return true;
} }

View File

@@ -50,12 +50,12 @@ wxChoiceBase::~wxChoiceBase()
bool wxChoiceBase::SetStringSelection(const wxString& s) bool wxChoiceBase::SetStringSelection(const wxString& s)
{ {
int sel = FindString(s); int sel = FindString(s);
wxCHECK_MSG( sel != -1, FALSE, wxCHECK_MSG( sel != -1, false,
wxT("invalid string in wxChoice::SetStringSelection") ); wxT("invalid string in wxChoice::SetStringSelection") );
Select(sel); Select(sel);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -86,7 +86,7 @@ struct wxCmdLineOption
GetLongOptionName(lng).Len() == lng.Len(), GetLongOptionName(lng).Len() == lng.Len(),
wxT("Long option contains invalid characters") wxT("Long option contains invalid characters")
); );
kind = k; kind = k;

View File

@@ -91,23 +91,23 @@ bool wxCommandProcessor::UndoCommand(wxCommand& cmd)
// Pass a command to the processor. The processor calls Do(); // Pass a command to the processor. The processor calls Do();
// if successful, is appended to the command history unless // if successful, is appended to the command history unless
// storeIt is FALSE. // storeIt is false.
bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt) bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt)
{ {
wxCHECK_MSG( command, FALSE, _T("no command in wxCommandProcessor::Submit") ); wxCHECK_MSG( command, false, _T("no command in wxCommandProcessor::Submit") );
if ( !DoCommand(*command) ) if ( !DoCommand(*command) )
{ {
// the user code expects the command to be deleted anyhow // the user code expects the command to be deleted anyhow
delete command; delete command;
return FALSE; return false;
} }
if ( storeIt ) if ( storeIt )
Store(command); Store(command);
return TRUE; return true;
} }
void wxCommandProcessor::Store(wxCommand *command) void wxCommandProcessor::Store(wxCommand *command)
@@ -152,11 +152,11 @@ bool wxCommandProcessor::Undo()
{ {
m_currentCommand = m_currentCommand->GetPrevious(); m_currentCommand = m_currentCommand->GetPrevious();
SetMenuStrings(); SetMenuStrings();
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
bool wxCommandProcessor::Redo() bool wxCommandProcessor::Redo()
@@ -193,10 +193,10 @@ bool wxCommandProcessor::Redo()
{ {
m_currentCommand = redoNode; m_currentCommand = redoNode;
SetMenuStrings(); SetMenuStrings();
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
bool wxCommandProcessor::CanUndo() const bool wxCommandProcessor::CanUndo() const
@@ -209,15 +209,15 @@ bool wxCommandProcessor::CanUndo() const
bool wxCommandProcessor::CanRedo() const bool wxCommandProcessor::CanRedo() const
{ {
if (m_currentCommand && !m_currentCommand->GetNext()) if (m_currentCommand && !m_currentCommand->GetNext())
return FALSE; return false;
if (m_currentCommand && m_currentCommand->GetNext()) if (m_currentCommand && m_currentCommand->GetNext())
return TRUE; return true;
if (!m_currentCommand && (m_commands.GetCount() > 0)) if (!m_currentCommand && (m_commands.GetCount() > 0))
return TRUE; return true;
return FALSE; return false;
} }
void wxCommandProcessor::Initialize() void wxCommandProcessor::Initialize()
@@ -233,7 +233,7 @@ void wxCommandProcessor::SetMenuStrings()
{ {
wxString undoLabel = GetUndoMenuLabel(); wxString undoLabel = GetUndoMenuLabel();
wxString redoLabel = GetRedoMenuLabel(); wxString redoLabel = GetRedoMenuLabel();
m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel); m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel);
m_commandEditMenu->Enable(wxID_UNDO, CanUndo()); m_commandEditMenu->Enable(wxID_UNDO, CanUndo());
@@ -262,7 +262,7 @@ wxString wxCommandProcessor::GetUndoMenuLabel() const
{ {
buf = _("&Undo") + m_undoAccelerator; buf = _("&Undo") + m_undoAccelerator;
} }
return buf; return buf;
} }

View File

@@ -137,9 +137,9 @@ wxFontData::wxFontData()
// Intialize colour to black. // Intialize colour to black.
m_fontColour = wxNullColour; m_fontColour = wxNullColour;
m_showHelp = FALSE; m_showHelp = false;
m_allowSymbols = TRUE; m_allowSymbols = true;
m_enableEffects = TRUE; m_enableEffects = true;
m_minSize = 0; m_minSize = 0;
m_maxSize = 0; m_maxSize = 0;
@@ -173,11 +173,11 @@ wxPrintData::wxPrintData()
#endif #endif
m_printOrientation = wxPORTRAIT; m_printOrientation = wxPORTRAIT;
m_printNoCopies = 1; m_printNoCopies = 1;
m_printCollate = FALSE; m_printCollate = false;
// New, 24/3/99 // New, 24/3/99
m_printerName = wxT(""); m_printerName = wxT("");
m_colour = TRUE; m_colour = true;
m_duplexMode = wxDUPLEX_SIMPLEX; m_duplexMode = wxDUPLEX_SIMPLEX;
m_printQuality = wxPRINT_QUALITY_HIGH; m_printQuality = wxPRINT_QUALITY_HIGH;
m_paperId = wxPAPER_A4; m_paperId = wxPAPER_A4;
@@ -513,9 +513,9 @@ void wxPrintData::ConvertFromNative()
if (devMode->dmFields & DM_COLLATE) if (devMode->dmFields & DM_COLLATE)
{ {
if (devMode->dmCollate == DMCOLLATE_TRUE) if (devMode->dmCollate == DMCOLLATE_TRUE)
m_printCollate = TRUE; m_printCollate = true;
else else
m_printCollate = FALSE; m_printCollate = false;
} }
//// Number of copies //// Number of copies
@@ -537,12 +537,12 @@ void wxPrintData::ConvertFromNative()
if (devMode->dmFields & DM_COLOR) if (devMode->dmFields & DM_COLOR)
{ {
if (devMode->dmColor == DMCOLOR_COLOR) if (devMode->dmColor == DMCOLOR_COLOR)
m_colour = TRUE; m_colour = true;
else else
m_colour = FALSE; m_colour = false;
} }
else else
m_colour = TRUE; m_colour = true;
//// Paper size //// Paper size
@@ -732,7 +732,7 @@ bool wxPrintData::Ok() const
((wxPrintData*)this)->ConvertToNative(); ((wxPrintData*)this)->ConvertToNative();
return (m_devMode != NULL) ; return (m_devMode != NULL) ;
#else #else
return TRUE; return true;
#endif #endif
} }
@@ -750,15 +750,15 @@ wxPrintDialogData::wxPrintDialogData()
m_printMinPage = 0; m_printMinPage = 0;
m_printMaxPage = 0; m_printMaxPage = 0;
m_printNoCopies = 1; m_printNoCopies = 1;
m_printAllPages = FALSE; m_printAllPages = false;
m_printCollate = FALSE; m_printCollate = false;
m_printToFile = FALSE; m_printToFile = false;
m_printSelection = FALSE; m_printSelection = false;
m_printEnableSelection = FALSE; m_printEnableSelection = false;
m_printEnablePageNumbers = TRUE; m_printEnablePageNumbers = true;
m_printEnablePrintToFile = TRUE; m_printEnablePrintToFile = true;
m_printEnableHelp = FALSE; m_printEnableHelp = false;
m_printSetupDialog = FALSE; m_printSetupDialog = false;
} }
wxPrintDialogData::wxPrintDialogData(const wxPrintDialogData& dialogData) wxPrintDialogData::wxPrintDialogData(const wxPrintDialogData& dialogData)
@@ -780,15 +780,15 @@ wxPrintDialogData::wxPrintDialogData(const wxPrintData& printData)
m_printMinPage = 1; m_printMinPage = 1;
m_printMaxPage = 9999; m_printMaxPage = 9999;
m_printNoCopies = 1; m_printNoCopies = 1;
m_printAllPages = FALSE; m_printAllPages = false;
m_printCollate = FALSE; m_printCollate = false;
m_printToFile = FALSE; m_printToFile = false;
m_printSelection = FALSE; m_printSelection = false;
m_printEnableSelection = FALSE; m_printEnableSelection = false;
m_printEnablePageNumbers = TRUE; m_printEnablePageNumbers = true;
m_printEnablePrintToFile = TRUE; m_printEnablePrintToFile = true;
m_printEnableHelp = FALSE; m_printEnableHelp = false;
m_printSetupDialog = FALSE; m_printSetupDialog = false;
m_printData = printData; m_printData = printData;
} }
@@ -1044,13 +1044,13 @@ wxPageSetupDialogData::wxPageSetupDialogData()
m_marginBottomRight = wxPoint(0, 0); m_marginBottomRight = wxPoint(0, 0);
// Flags // Flags
m_defaultMinMargins = FALSE; m_defaultMinMargins = false;
m_enableMargins = TRUE; m_enableMargins = true;
m_enableOrientation = TRUE; m_enableOrientation = true;
m_enablePaper = TRUE; m_enablePaper = true;
m_enablePrinter = TRUE; m_enablePrinter = true;
m_enableHelp = FALSE; m_enableHelp = false;
m_getDefaultInfo = FALSE; m_getDefaultInfo = false;
} }
wxPageSetupDialogData::wxPageSetupDialogData(const wxPageSetupDialogData& dialogData) wxPageSetupDialogData::wxPageSetupDialogData(const wxPageSetupDialogData& dialogData)
@@ -1074,13 +1074,13 @@ wxPageSetupDialogData::wxPageSetupDialogData(const wxPrintData& printData)
m_marginBottomRight = wxPoint(0, 0); m_marginBottomRight = wxPoint(0, 0);
// Flags // Flags
m_defaultMinMargins = FALSE; m_defaultMinMargins = false;
m_enableMargins = TRUE; m_enableMargins = true;
m_enableOrientation = TRUE; m_enableOrientation = true;
m_enablePaper = TRUE; m_enablePaper = true;
m_enablePrinter = TRUE; m_enablePrinter = true;
m_enableHelp = FALSE; m_enableHelp = false;
m_getDefaultInfo = FALSE; m_getDefaultInfo = false;
m_printData = printData; m_printData = printData;

View File

@@ -50,7 +50,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxConfigBase *wxConfigBase::ms_pConfig = NULL; wxConfigBase *wxConfigBase::ms_pConfig = NULL;
bool wxConfigBase::ms_bAutoCreate = TRUE; bool wxConfigBase::ms_bAutoCreate = true;
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -69,8 +69,8 @@ wxConfigBase::wxConfigBase(const wxString& appName,
long style) long style)
: m_appName(appName), m_vendorName(vendorName), m_style(style) : m_appName(appName), m_vendorName(vendorName), m_style(style)
{ {
m_bExpandEnvVars = TRUE; m_bExpandEnvVars = true;
m_bRecordDefaults = FALSE; m_bRecordDefaults = false;
} }
wxConfigBase::~wxConfigBase() wxConfigBase::~wxConfigBase()
@@ -106,21 +106,21 @@ wxConfigBase *wxConfigBase::Create()
#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \ #define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \
bool wxConfigBase::Read(const wxString& key, type *val) const \ bool wxConfigBase::Read(const wxString& key, type *val) const \
{ \ { \
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \ wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \
\ \
if ( !DoRead##name(key, val) ) \ if ( !DoRead##name(key, val) ) \
return FALSE; \ return false; \
\ \
*val = extra(*val); \ *val = extra(*val); \
\ \
return TRUE; \ return true; \
} \ } \
\ \
bool wxConfigBase::Read(const wxString& key, \ bool wxConfigBase::Read(const wxString& key, \
type *val, \ type *val, \
deftype defVal) const \ deftype defVal) const \
{ \ { \
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \ wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \
\ \
bool read = DoRead##name(key, val); \ bool read = DoRead##name(key, val); \
if ( !read ) \ if ( !read ) \
@@ -151,32 +151,32 @@ IMPLEMENT_READ_FOR_TYPE(Bool, bool, bool, bool)
// but can be overridden in the derived ones // but can be overridden in the derived ones
bool wxConfigBase::DoReadInt(const wxString& key, int *pi) const bool wxConfigBase::DoReadInt(const wxString& key, int *pi) const
{ {
wxCHECK_MSG( pi, FALSE, _T("wxConfig::Read(): NULL parameter") ); wxCHECK_MSG( pi, false, _T("wxConfig::Read(): NULL parameter") );
long l; long l;
if ( !DoReadLong(key, &l) ) if ( !DoReadLong(key, &l) )
return FALSE; return false;
wxASSERT_MSG( l < INT_MAX, _T("overflow in wxConfig::DoReadInt") ); wxASSERT_MSG( l < INT_MAX, _T("overflow in wxConfig::DoReadInt") );
*pi = (int)l; *pi = (int)l;
return TRUE; return true;
} }
bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const
{ {
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") );
long l; long l;
if ( !DoReadLong(key, &l) ) if ( !DoReadLong(key, &l) )
return FALSE; return false;
wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") ); wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") );
*val = l != 0; *val = l != 0;
return TRUE; return true;
} }
bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const
@@ -187,7 +187,7 @@ bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const
return str.ToDouble(val); return str.ToDouble(val);
} }
return FALSE; return false;
} }
// string reading helper // string reading helper
@@ -241,17 +241,17 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
if ( !strPath.IsEmpty() ) { if ( !strPath.IsEmpty() ) {
// do change the path // do change the path
m_bChanged = TRUE; m_bChanged = true;
m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR); m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR);
m_strOldPath = m_pContainer->GetPath(); m_strOldPath = m_pContainer->GetPath();
if ( m_strOldPath.Len() == 0 || if ( m_strOldPath.Len() == 0 ||
m_strOldPath.Last() != wxCONFIG_PATH_SEPARATOR ) m_strOldPath.Last() != wxCONFIG_PATH_SEPARATOR )
m_strOldPath += wxCONFIG_PATH_SEPARATOR; m_strOldPath += wxCONFIG_PATH_SEPARATOR;
m_pContainer->SetPath(strPath); m_pContainer->SetPath(strPath);
} }
else { else {
// it's a name only, without path - nothing to do // it's a name only, without path - nothing to do
m_bChanged = FALSE; m_bChanged = false;
m_strName = strEntry; m_strName = strEntry;
} }
} }

View File

@@ -64,21 +64,21 @@ bool wxControlContainer::AcceptsFocus() const
// at least one child will accept focus // at least one child will accept focus
wxWindowList::compatibility_iterator node = m_winParent->GetChildren().GetFirst(); wxWindowList::compatibility_iterator node = m_winParent->GetChildren().GetFirst();
if ( !node ) if ( !node )
return TRUE; return true;
#ifdef __WXMAC__ #ifdef __WXMAC__
// wxMac has eventually the two scrollbars as children, they don't count // wxMac has eventually the two scrollbars as children, they don't count
// as real children in the algorithm mentioned above // as real children in the algorithm mentioned above
bool hasRealChildren = false ; bool hasRealChildren = false ;
#endif #endif
while ( node ) while ( node )
{ {
wxWindow *child = node->GetData(); wxWindow *child = node->GetData();
if ( child->AcceptsFocus() ) if ( child->AcceptsFocus() )
{ {
return TRUE; return true;
} }
#ifdef __WXMAC__ #ifdef __WXMAC__
@@ -88,14 +88,14 @@ bool wxControlContainer::AcceptsFocus() const
#endif #endif
node = node->GetNext(); node = node->GetNext();
} }
#ifdef __WXMAC__ #ifdef __WXMAC__
if ( !hasRealChildren ) if ( !hasRealChildren )
return TRUE ; return true ;
#endif #endif
} }
return FALSE; return false;
} }
void wxControlContainer::SetLastFocus(wxWindow *win) void wxControlContainer::SetLastFocus(wxWindow *win)
@@ -308,7 +308,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
} }
//else: the child manages its focus itself //else: the child manages its focus itself
event.Skip( FALSE ); event.Skip( false );
return; return;
} }
@@ -344,7 +344,7 @@ bool wxControlContainer::DoSetFocus()
if (m_inSetFocus) if (m_inSetFocus)
return true; return true;
// when the panel gets the focus we move the focus to either the last // when the panel gets the focus we move the focus to either the last
// window that had the focus or the first one that can get it unless the // window that had the focus or the first one that can get it unless the
// focus had been already set to some other child // focus had been already set to some other child
@@ -367,7 +367,7 @@ bool wxControlContainer::DoSetFocus()
win = win->GetParent(); win = win->GetParent();
} }
// protect against infinite recursion: // protect against infinite recursion:
m_inSetFocus = true; m_inSetFocus = true;
@@ -401,8 +401,8 @@ bool wxControlContainer::SetFocusToChild()
bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
{ {
wxCHECK_MSG( win, FALSE, _T("wxSetFocusToChild(): invalid window") ); wxCHECK_MSG( win, false, _T("wxSetFocusToChild(): invalid window") );
wxCHECK_MSG( childLastFocused, FALSE, wxCHECK_MSG( childLastFocused, false,
_T("wxSetFocusToChild(): NULL child poonter") ); _T("wxSetFocusToChild(): NULL child poonter") );
if ( *childLastFocused ) if ( *childLastFocused )
@@ -417,7 +417,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
// not SetFocusFromKbd(): we're restoring focus back to the old // not SetFocusFromKbd(): we're restoring focus back to the old
// window and not setting it as the result of a kbd action // window and not setting it as the result of a kbd action
(*childLastFocused)->SetFocus(); (*childLastFocused)->SetFocus();
return TRUE; return true;
} }
else else
{ {
@@ -440,12 +440,12 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
*childLastFocused = child; *childLastFocused = child;
child->SetFocusFromKbd(); child->SetFocusFromKbd();
return TRUE; return true;
} }
node = node->GetNext(); node = node->GetNext();
} }
return FALSE; return false;
} }

View File

@@ -77,7 +77,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxContextHelp, wxObject)
wxContextHelp::wxContextHelp(wxWindow* win, bool beginHelp) wxContextHelp::wxContextHelp(wxWindow* win, bool beginHelp)
{ {
m_inHelp = FALSE; m_inHelp = false;
if (beginHelp) if (beginHelp)
BeginContextHelp(win); BeginContextHelp(win);
@@ -97,7 +97,7 @@ static void wxPushOrPopEventHandlers(wxContextHelp* help, wxWindow* win, bool pu
if (push) if (push)
win->PushEventHandler(new wxContextHelpEvtHandler(help)); win->PushEventHandler(new wxContextHelpEvtHandler(help));
else else
win->PopEventHandler(TRUE); win->PopEventHandler(true);
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst(); wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while (node) while (node)
@@ -116,7 +116,7 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
if (!win) if (!win)
win = wxTheApp->GetTopWindow(); win = wxTheApp->GetTopWindow();
if (!win) if (!win)
return FALSE; return false;
wxCursor cursor(wxCURSOR_QUESTION_ARROW); wxCursor cursor(wxCURSOR_QUESTION_ARROW);
wxCursor oldCursor = win->GetCursor(); wxCursor oldCursor = win->GetCursor();
@@ -126,10 +126,10 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
// wxSetCursor(cursor); // wxSetCursor(cursor);
#endif #endif
m_status = FALSE; m_status = false;
#ifdef __WXMOTIF__ #ifdef __WXMOTIF__
wxPushOrPopEventHandlers(this, win, TRUE); wxPushOrPopEventHandlers(this, win, true);
#else #else
win->PushEventHandler(new wxContextHelpEvtHandler(this)); win->PushEventHandler(new wxContextHelpEvtHandler(this));
#endif #endif
@@ -141,9 +141,9 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
win->ReleaseMouse(); win->ReleaseMouse();
#ifdef __WXMOTIF__ #ifdef __WXMOTIF__
wxPushOrPopEventHandlers(this, win, FALSE); wxPushOrPopEventHandlers(this, win, false);
#else #else
win->PopEventHandler(TRUE); win->PopEventHandler(true);
#endif #endif
win->SetCursor(oldCursor); win->SetCursor(oldCursor);
@@ -165,19 +165,19 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
DispatchEvent(winAtPtr, pt); DispatchEvent(winAtPtr, pt);
} }
return TRUE; return true;
} }
bool wxContextHelp::EndContextHelp() bool wxContextHelp::EndContextHelp()
{ {
m_inHelp = FALSE; m_inHelp = false;
return TRUE; return true;
} }
bool wxContextHelp::EventLoop() bool wxContextHelp::EventLoop()
{ {
m_inHelp = TRUE; m_inHelp = true;
while ( m_inHelp ) while ( m_inHelp )
{ {
@@ -191,16 +191,16 @@ bool wxContextHelp::EventLoop()
} }
} }
return TRUE; return true;
} }
bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event) bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event)
{ {
if (event.GetEventType() == wxEVT_LEFT_DOWN) if (event.GetEventType() == wxEVT_LEFT_DOWN)
{ {
m_contextHelp->SetStatus(TRUE); m_contextHelp->SetStatus(true);
m_contextHelp->EndContextHelp(); m_contextHelp->EndContextHelp();
return TRUE; return true;
} }
if ((event.GetEventType() == wxEVT_CHAR) || if ((event.GetEventType() == wxEVT_CHAR) ||
@@ -208,27 +208,27 @@ bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event)
(event.GetEventType() == wxEVT_ACTIVATE) || (event.GetEventType() == wxEVT_ACTIVATE) ||
(event.GetEventType() == wxEVT_MOUSE_CAPTURE_CHANGED)) (event.GetEventType() == wxEVT_MOUSE_CAPTURE_CHANGED))
{ {
// May have already been set to TRUE by a left-click // May have already been set to true by a left-click
//m_contextHelp->SetStatus(FALSE); //m_contextHelp->SetStatus(false);
m_contextHelp->EndContextHelp(); m_contextHelp->EndContextHelp();
return TRUE; return true;
} }
if ((event.GetEventType() == wxEVT_PAINT) || if ((event.GetEventType() == wxEVT_PAINT) ||
(event.GetEventType() == wxEVT_ERASE_BACKGROUND)) (event.GetEventType() == wxEVT_ERASE_BACKGROUND))
{ {
event.Skip(); event.Skip();
return FALSE; return false;
} }
return TRUE; return true;
} }
// Dispatch the help event to the relevant window // Dispatch the help event to the relevant window
bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt)
{ {
wxWindow* subjectOfHelp = win; wxWindow* subjectOfHelp = win;
bool eventProcessed = FALSE; bool eventProcessed = false;
while (subjectOfHelp && !eventProcessed) while (subjectOfHelp && !eventProcessed)
{ {
wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ; wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ;
@@ -381,11 +381,11 @@ bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window)
{ {
s_tipWindow = new wxTipWindow((wxWindow *)window, text, 100, & s_tipWindow); s_tipWindow = new wxTipWindow((wxWindow *)window, text, 100, & s_tipWindow);
return TRUE; return true;
} }
#endif // wxUSE_TIPWINDOW #endif // wxUSE_TIPWINDOW
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -410,7 +410,7 @@ bool wxHelpControllerHelpProvider::ShowHelp(wxWindowBase *window)
// If the help controller is capable of popping up the text... // If the help controller is capable of popping up the text...
else if (m_helpController->DisplayTextPopup(text, wxGetMousePosition())) else if (m_helpController->DisplayTextPopup(text, wxGetMousePosition()))
{ {
return TRUE; return true;
} }
else else
// ...else use the default method. // ...else use the default method.
@@ -421,7 +421,7 @@ bool wxHelpControllerHelpProvider::ShowHelp(wxWindowBase *window)
} }
return FALSE; return false;
} }
// Convenience function for turning context id into wxString // Convenience function for turning context id into wxString
@@ -452,7 +452,7 @@ bool wxHelpProviderModule::OnInit()
// since it could pull in extra code // since it could pull in extra code
// wxHelpProvider::Set(new wxSimpleHelpProvider); // wxHelpProvider::Set(new wxSimpleHelpProvider);
return TRUE; return true;
} }
void wxHelpProviderModule::OnExit() void wxHelpProviderModule::OnExit()

View File

@@ -79,14 +79,14 @@ bool wxControlBase::CreateControl(wxWindowBase *parent,
// even if it's possible to create controls without parents in some port, // even if it's possible to create controls without parents in some port,
// it should surely be discouraged because it doesn't work at all under // it should surely be discouraged because it doesn't work at all under
// Windows // Windows
wxCHECK_MSG( parent, FALSE, wxT("all controls must have parents") ); wxCHECK_MSG( parent, false, wxT("all controls must have parents") );
if ( !CreateBase(parent, id, pos, size, style, validator, name) ) if ( !CreateBase(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
parent->AddChild(this); parent->AddChild(this);
return TRUE; return true;
} }
void wxControlBase::Command(wxCommandEvent& event) void wxControlBase::Command(wxCommandEvent& event)
@@ -120,7 +120,7 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const
void wxControlBase::SetLabel( const wxString &label ) void wxControlBase::SetLabel( const wxString &label )
{ {
InvalidateBestSize(); InvalidateBestSize();
wxWindow::SetLabel(label); wxWindow::SetLabel(label);
} }
bool wxControlBase::SetFont(const wxFont& font) bool wxControlBase::SetFont(const wxFont& font)