#if __VISUALC__ > 1100
#pragma warning(push, 1)
#else // VC 5
- // 'expression' : signed/unsigned mismatch
- #pragma warning(disable:4018)
+ // 'expression' : signed/unsigned mismatch
+ #pragma warning(disable:4018)
- // 'conversion' : conversion from 'type1' to 'type2',
- // possible loss of data
- #pragma warning(disable:4244)
+ // 'conversion' : conversion from 'type1' to 'type2',
+ // possible loss of data
+ #pragma warning(disable:4244)
- // C++ language change: to explicitly specialize class template
- // 'identifier' use the following syntax
- #pragma warning(disable:4663)
+ // C++ language change: to explicitly specialize class template
+ // 'identifier' use the following syntax
+ #pragma warning(disable:4663)
#endif
// these warning have to be disabled and not just temporarily disabled
#else
#define __WX_BO_STL ",wx containers"
#endif
-
+
// This macro is passed as argument to wxConsoleApp::CheckBuildOptions()
#define WX_BUILD_OPTIONS_SIGNATURE \
__WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \
if ( handler )
{
sm_handlers.DeleteObject(handler);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name)
DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule)
public:
wxBitmapBaseModule() {}
- bool OnInit() { wxBitmap::InitStandardHandlers(); return TRUE; };
+ bool OnInit() { wxBitmap::InitStandardHandlers(); return true; };
void OnExit() { wxBitmap::CleanUpHandlers(); };
};
m_pages.Insert(page, nPage);
InvalidateBestSize();
-
+
return true;
}
bool wxChoiceBase::SetStringSelection(const wxString& s)
{
int sel = FindString(s);
- wxCHECK_MSG( sel != -1, FALSE,
+ wxCHECK_MSG( sel != -1, false,
wxT("invalid string in wxChoice::SetStringSelection") );
Select(sel);
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
GetLongOptionName(lng).Len() == lng.Len(),
wxT("Long option contains invalid characters")
);
-
+
kind = k;
// Pass a command to the processor. The processor calls Do();
// if successful, is appended to the command history unless
-// storeIt is FALSE.
+// storeIt is false.
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) )
{
// the user code expects the command to be deleted anyhow
delete command;
- return FALSE;
+ return false;
}
if ( storeIt )
Store(command);
- return TRUE;
+ return true;
}
void wxCommandProcessor::Store(wxCommand *command)
{
m_currentCommand = m_currentCommand->GetPrevious();
SetMenuStrings();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
bool wxCommandProcessor::Redo()
{
m_currentCommand = redoNode;
SetMenuStrings();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
bool wxCommandProcessor::CanUndo() const
bool wxCommandProcessor::CanRedo() const
{
if (m_currentCommand && !m_currentCommand->GetNext())
- return FALSE;
+ return false;
if (m_currentCommand && m_currentCommand->GetNext())
- return TRUE;
+ return true;
if (!m_currentCommand && (m_commands.GetCount() > 0))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
void wxCommandProcessor::Initialize()
{
wxString undoLabel = GetUndoMenuLabel();
wxString redoLabel = GetRedoMenuLabel();
-
+
m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel);
m_commandEditMenu->Enable(wxID_UNDO, CanUndo());
{
buf = _("&Undo") + m_undoAccelerator;
}
-
+
return buf;
}
// Intialize colour to black.
m_fontColour = wxNullColour;
- m_showHelp = FALSE;
- m_allowSymbols = TRUE;
- m_enableEffects = TRUE;
+ m_showHelp = false;
+ m_allowSymbols = true;
+ m_enableEffects = true;
m_minSize = 0;
m_maxSize = 0;
#endif
m_printOrientation = wxPORTRAIT;
m_printNoCopies = 1;
- m_printCollate = FALSE;
+ m_printCollate = false;
// New, 24/3/99
m_printerName = wxT("");
- m_colour = TRUE;
+ m_colour = true;
m_duplexMode = wxDUPLEX_SIMPLEX;
m_printQuality = wxPRINT_QUALITY_HIGH;
m_paperId = wxPAPER_A4;
if (devMode->dmFields & DM_COLLATE)
{
if (devMode->dmCollate == DMCOLLATE_TRUE)
- m_printCollate = TRUE;
+ m_printCollate = true;
else
- m_printCollate = FALSE;
+ m_printCollate = false;
}
//// Number of copies
if (devMode->dmFields & DM_COLOR)
{
if (devMode->dmColor == DMCOLOR_COLOR)
- m_colour = TRUE;
+ m_colour = true;
else
- m_colour = FALSE;
+ m_colour = false;
}
else
- m_colour = TRUE;
+ m_colour = true;
//// Paper size
((wxPrintData*)this)->ConvertToNative();
return (m_devMode != NULL) ;
#else
- return TRUE;
+ return true;
#endif
}
m_printMinPage = 0;
m_printMaxPage = 0;
m_printNoCopies = 1;
- m_printAllPages = FALSE;
- m_printCollate = FALSE;
- m_printToFile = FALSE;
- m_printSelection = FALSE;
- m_printEnableSelection = FALSE;
- m_printEnablePageNumbers = TRUE;
- m_printEnablePrintToFile = TRUE;
- m_printEnableHelp = FALSE;
- m_printSetupDialog = FALSE;
+ m_printAllPages = false;
+ m_printCollate = false;
+ m_printToFile = false;
+ m_printSelection = false;
+ m_printEnableSelection = false;
+ m_printEnablePageNumbers = true;
+ m_printEnablePrintToFile = true;
+ m_printEnableHelp = false;
+ m_printSetupDialog = false;
}
wxPrintDialogData::wxPrintDialogData(const wxPrintDialogData& dialogData)
m_printMinPage = 1;
m_printMaxPage = 9999;
m_printNoCopies = 1;
- m_printAllPages = FALSE;
- m_printCollate = FALSE;
- m_printToFile = FALSE;
- m_printSelection = FALSE;
- m_printEnableSelection = FALSE;
- m_printEnablePageNumbers = TRUE;
- m_printEnablePrintToFile = TRUE;
- m_printEnableHelp = FALSE;
- m_printSetupDialog = FALSE;
+ m_printAllPages = false;
+ m_printCollate = false;
+ m_printToFile = false;
+ m_printSelection = false;
+ m_printEnableSelection = false;
+ m_printEnablePageNumbers = true;
+ m_printEnablePrintToFile = true;
+ m_printEnableHelp = false;
+ m_printSetupDialog = false;
m_printData = printData;
}
m_marginBottomRight = wxPoint(0, 0);
// Flags
- m_defaultMinMargins = FALSE;
- m_enableMargins = TRUE;
- m_enableOrientation = TRUE;
- m_enablePaper = TRUE;
- m_enablePrinter = TRUE;
- m_enableHelp = FALSE;
- m_getDefaultInfo = FALSE;
+ m_defaultMinMargins = false;
+ m_enableMargins = true;
+ m_enableOrientation = true;
+ m_enablePaper = true;
+ m_enablePrinter = true;
+ m_enableHelp = false;
+ m_getDefaultInfo = false;
}
wxPageSetupDialogData::wxPageSetupDialogData(const wxPageSetupDialogData& dialogData)
m_marginBottomRight = wxPoint(0, 0);
// Flags
- m_defaultMinMargins = FALSE;
- m_enableMargins = TRUE;
- m_enableOrientation = TRUE;
- m_enablePaper = TRUE;
- m_enablePrinter = TRUE;
- m_enableHelp = FALSE;
- m_getDefaultInfo = FALSE;
+ m_defaultMinMargins = false;
+ m_enableMargins = true;
+ m_enableOrientation = true;
+ m_enablePaper = true;
+ m_enablePrinter = true;
+ m_enableHelp = false;
+ m_getDefaultInfo = false;
m_printData = printData;
// ----------------------------------------------------------------------------
wxConfigBase *wxConfigBase::ms_pConfig = NULL;
-bool wxConfigBase::ms_bAutoCreate = TRUE;
+bool wxConfigBase::ms_bAutoCreate = true;
// ============================================================================
// implementation
long style)
: m_appName(appName), m_vendorName(vendorName), m_style(style)
{
- m_bExpandEnvVars = TRUE;
- m_bRecordDefaults = FALSE;
+ m_bExpandEnvVars = true;
+ m_bRecordDefaults = false;
}
wxConfigBase::~wxConfigBase()
#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \
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) ) \
- return FALSE; \
+ return false; \
\
*val = extra(*val); \
\
- return TRUE; \
+ return true; \
} \
\
bool wxConfigBase::Read(const wxString& key, \
type *val, \
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); \
if ( !read ) \
// but can be overridden in the derived ones
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;
if ( !DoReadLong(key, &l) )
- return FALSE;
+ return false;
wxASSERT_MSG( l < INT_MAX, _T("overflow in wxConfig::DoReadInt") );
*pi = (int)l;
- return TRUE;
+ return true;
}
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;
if ( !DoReadLong(key, &l) )
- return FALSE;
+ return false;
wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") );
*val = l != 0;
- return TRUE;
+ return true;
}
bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const
return str.ToDouble(val);
}
- return FALSE;
+ return false;
}
// string reading helper
if ( !strPath.IsEmpty() ) {
// do change the path
- m_bChanged = TRUE;
+ m_bChanged = true;
m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR);
m_strOldPath = m_pContainer->GetPath();
- if ( m_strOldPath.Len() == 0 ||
+ if ( m_strOldPath.Len() == 0 ||
m_strOldPath.Last() != wxCONFIG_PATH_SEPARATOR )
m_strOldPath += wxCONFIG_PATH_SEPARATOR;
m_pContainer->SetPath(strPath);
}
else {
// it's a name only, without path - nothing to do
- m_bChanged = FALSE;
+ m_bChanged = false;
m_strName = strEntry;
}
}
// at least one child will accept focus
wxWindowList::compatibility_iterator node = m_winParent->GetChildren().GetFirst();
if ( !node )
- return TRUE;
+ return true;
#ifdef __WXMAC__
// wxMac has eventually the two scrollbars as children, they don't count
// as real children in the algorithm mentioned above
bool hasRealChildren = false ;
#endif
-
+
while ( node )
{
wxWindow *child = node->GetData();
if ( child->AcceptsFocus() )
{
- return TRUE;
+ return true;
}
#ifdef __WXMAC__
#endif
node = node->GetNext();
}
-
+
#ifdef __WXMAC__
if ( !hasRealChildren )
- return TRUE ;
+ return true ;
#endif
}
- return FALSE;
+ return false;
}
void wxControlContainer::SetLastFocus(wxWindow *win)
}
//else: the child manages its focus itself
- event.Skip( FALSE );
+ event.Skip( false );
return;
}
if (m_inSetFocus)
return true;
-
+
// 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
// focus had been already set to some other child
win = win->GetParent();
}
-
+
// protect against infinite recursion:
m_inSetFocus = true;
bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
{
- wxCHECK_MSG( win, FALSE, _T("wxSetFocusToChild(): invalid window") );
- wxCHECK_MSG( childLastFocused, FALSE,
+ wxCHECK_MSG( win, false, _T("wxSetFocusToChild(): invalid window") );
+ wxCHECK_MSG( childLastFocused, false,
_T("wxSetFocusToChild(): NULL child poonter") );
if ( *childLastFocused )
// not SetFocusFromKbd(): we're restoring focus back to the old
// window and not setting it as the result of a kbd action
(*childLastFocused)->SetFocus();
- return TRUE;
+ return true;
}
else
{
*childLastFocused = child;
child->SetFocusFromKbd();
- return TRUE;
+ return true;
}
node = node->GetNext();
}
- return FALSE;
+ return false;
}
wxContextHelp::wxContextHelp(wxWindow* win, bool beginHelp)
{
- m_inHelp = FALSE;
+ m_inHelp = false;
if (beginHelp)
BeginContextHelp(win);
if (push)
win->PushEventHandler(new wxContextHelpEvtHandler(help));
else
- win->PopEventHandler(TRUE);
+ win->PopEventHandler(true);
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while (node)
if (!win)
win = wxTheApp->GetTopWindow();
if (!win)
- return FALSE;
+ return false;
wxCursor cursor(wxCURSOR_QUESTION_ARROW);
wxCursor oldCursor = win->GetCursor();
// wxSetCursor(cursor);
#endif
- m_status = FALSE;
+ m_status = false;
#ifdef __WXMOTIF__
- wxPushOrPopEventHandlers(this, win, TRUE);
+ wxPushOrPopEventHandlers(this, win, true);
#else
win->PushEventHandler(new wxContextHelpEvtHandler(this));
#endif
win->ReleaseMouse();
#ifdef __WXMOTIF__
- wxPushOrPopEventHandlers(this, win, FALSE);
+ wxPushOrPopEventHandlers(this, win, false);
#else
- win->PopEventHandler(TRUE);
+ win->PopEventHandler(true);
#endif
win->SetCursor(oldCursor);
DispatchEvent(winAtPtr, pt);
}
- return TRUE;
+ return true;
}
bool wxContextHelp::EndContextHelp()
{
- m_inHelp = FALSE;
+ m_inHelp = false;
- return TRUE;
+ return true;
}
bool wxContextHelp::EventLoop()
{
- m_inHelp = TRUE;
+ m_inHelp = true;
while ( m_inHelp )
{
}
}
- return TRUE;
+ return true;
}
bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event)
{
if (event.GetEventType() == wxEVT_LEFT_DOWN)
{
- m_contextHelp->SetStatus(TRUE);
+ m_contextHelp->SetStatus(true);
m_contextHelp->EndContextHelp();
- return TRUE;
+ return true;
}
if ((event.GetEventType() == wxEVT_CHAR) ||
(event.GetEventType() == wxEVT_ACTIVATE) ||
(event.GetEventType() == wxEVT_MOUSE_CAPTURE_CHANGED))
{
- // May have already been set to TRUE by a left-click
- //m_contextHelp->SetStatus(FALSE);
+ // May have already been set to true by a left-click
+ //m_contextHelp->SetStatus(false);
m_contextHelp->EndContextHelp();
- return TRUE;
+ return true;
}
if ((event.GetEventType() == wxEVT_PAINT) ||
(event.GetEventType() == wxEVT_ERASE_BACKGROUND))
{
event.Skip();
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
// Dispatch the help event to the relevant window
bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt)
{
wxWindow* subjectOfHelp = win;
- bool eventProcessed = FALSE;
+ bool eventProcessed = false;
while (subjectOfHelp && !eventProcessed)
{
wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ;
{
s_tipWindow = new wxTipWindow((wxWindow *)window, text, 100, & s_tipWindow);
- return TRUE;
+ return true;
}
#endif // wxUSE_TIPWINDOW
- return FALSE;
+ return false;
}
// ----------------------------------------------------------------------------
// If the help controller is capable of popping up the text...
else if (m_helpController->DisplayTextPopup(text, wxGetMousePosition()))
{
- return TRUE;
+ return true;
}
else
// ...else use the default method.
}
- return FALSE;
+ return false;
}
// Convenience function for turning context id into wxString
// since it could pull in extra code
// wxHelpProvider::Set(new wxSimpleHelpProvider);
- return TRUE;
+ return true;
}
void wxHelpProviderModule::OnExit()
// 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
// 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) )
- return FALSE;
+ return false;
parent->AddChild(this);
- return TRUE;
+ return true;
}
void wxControlBase::Command(wxCommandEvent& event)
void wxControlBase::SetLabel( const wxString &label )
{
InvalidateBestSize();
- wxWindow::SetLabel(label);
+ wxWindow::SetLabel(label);
}
bool wxControlBase::SetFont(const wxFont& font)