From 7520f3da332d64a676b6f7d27a56004fabf2db36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Tue, 18 Apr 2006 09:56:17 +0000 Subject: [PATCH] wx/wxprec.h already includes wx/defs.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38791 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mgl/data.cpp | 1 - src/mgl/dirmgl.cpp | 19 ++++---- src/mgl/fontenum.cpp | 41 +++++++++-------- src/mgl/toplevel.cpp | 15 +++---- src/motif/bmpbuttn.cpp | 7 +-- src/motif/bmpmotif.cpp | 3 +- src/motif/button.cpp | 8 ++-- src/motif/checkbox.cpp | 10 ++--- src/motif/checklst.cpp | 2 - src/motif/clipbrd.cpp | 2 - src/motif/control.cpp | 4 +- src/motif/dataobj.cpp | 6 +-- src/motif/dc.cpp | 6 +-- src/motif/filedlg.cpp | 3 +- src/motif/font.cpp | 14 +++--- src/motif/menu.cpp | 3 -- src/motif/menuitem.cpp | 9 ++-- src/motif/msgdlg.cpp | 2 - src/motif/radiobut.cpp | 2 - src/motif/scrolbar.cpp | 1 - src/motif/slider.cpp | 4 +- src/motif/spinbutt.cpp | 2 - src/motif/statbmp.cpp | 7 +-- src/motif/statbox.cpp | 11 ++--- src/motif/stattext.cpp | 4 +- src/motif/textctrl.cpp | 4 +- src/msdos/mimetype.cpp | 16 +++---- src/msw/colordlg.cpp | 1 - src/msw/fontdlg.cpp | 1 - src/msw/gauge95.cpp | 5 +-- src/msw/helpbest.cpp | 3 +- src/msw/helpwin.cpp | 19 ++++---- src/msw/icon.cpp | 3 +- src/msw/msgdlg.cpp | 4 +- src/msw/mslu.cpp | 9 ++-- src/msw/ole/automtn.cpp | 10 ++--- src/msw/popupwin.cpp | 8 ++-- src/msw/printwin.cpp | 4 +- src/msw/taskbar.cpp | 11 +++-- src/msw/wince/filefnwce.cpp | 10 ++--- src/os2/combobox.cpp | 7 ++- src/os2/dataobj.cpp | 5 +-- src/os2/dirdlg.cpp | 12 +++-- src/os2/fontdlg.cpp | 12 +++-- src/os2/frame.cpp | 1 - src/os2/gauge.cpp | 25 +++++------ src/os2/gsockpm.cpp | 2 - src/os2/helpwin.cpp | 5 ++- src/os2/icon.cpp | 3 +- src/os2/joystick.cpp | 2 - src/os2/msgdlg.cpp | 13 +++--- src/os2/palette.cpp | 11 +++-- src/os2/settings.cpp | 9 ++-- src/palmos/colordlg.cpp | 1 - src/palmos/fontdlg.cpp | 1 - src/palmos/gauge.cpp | 5 +-- src/palmos/help.cpp | 5 +-- src/palmos/icon.cpp | 2 - src/palmos/msgdlg.cpp | 4 +- src/palmos/popupwin.cpp | 6 +-- src/palmos/printpalm.cpp | 2 - src/palmos/taskbar.cpp | 14 +++--- src/unix/dialup.cpp | 3 +- src/unix/joystick.cpp | 11 ++--- src/unix/mimetype.cpp | 25 +++++------ src/unix/utilsunx.cpp | 11 ++--- src/x11/dataobj.cpp | 28 ++++++------ src/x11/dc.cpp | 21 ++++----- src/x11/font.cpp | 32 +++++++------- src/x11/popupwin.cpp | 88 +++++++++++++++++++------------------ 70 files changed, 276 insertions(+), 384 deletions(-) diff --git a/src/mgl/data.cpp b/src/mgl/data.cpp index d22b68b1ef..1fb6225976 100644 --- a/src/mgl/data.cpp +++ b/src/mgl/data.cpp @@ -14,7 +14,6 @@ #pragma hdrstop #endif -#include "wx/defs.h" #include "wx/cursor.h" /* Current cursor, in order to hang on to diff --git a/src/mgl/dirmgl.cpp b/src/mgl/dirmgl.cpp index f14e2d526d..bd6e21b38a 100644 --- a/src/mgl/dirmgl.cpp +++ b/src/mgl/dirmgl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mgl/dir.cpp +// Name: src/mgl/dir.cpp // Purpose: wxDir implementation for MGL // Author: Vaclav Slavik, Vadim Zeitlin // Modified by: @@ -10,14 +10,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -25,7 +17,13 @@ #pragma hdrstop #endif -#include "wx/defs.h" +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- #ifndef __UNIX__ @@ -272,4 +270,3 @@ bool wxDir::GetNext(wxString *filename) const } #endif // !__UNIX__ - diff --git a/src/mgl/fontenum.cpp b/src/mgl/fontenum.cpp index f00e22fd38..58866a8120 100644 --- a/src/mgl/fontenum.cpp +++ b/src/mgl/fontenum.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/fontenum.cpp +// Name: src/mgl/fontenum.cpp // Purpose: wxFontEnumerator class for MGL // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -7,6 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + // ============================================================================ // declarations // ============================================================================ @@ -15,14 +22,6 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/defs.h" #include "wx/dynarray.h" #include "wx/string.h" #include "wx/utils.h" @@ -45,7 +44,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool fixedWidthOnly) { - bool found = FALSE; + bool found = false; wxMGLFontFamilyList *list = wxTheFontsManager->GetFamilyList(); wxMGLFontFamilyList::Node *node; wxMGLFontFamily *f = NULL; @@ -53,7 +52,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, if ( encoding != wxFONTENCODING_SYSTEM ) wxGetNativeFontEncoding(encoding, &info); - + for (node = list->GetFirst(); node; node = node->GetNext()) { f = node->GetData(); @@ -61,9 +60,9 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, if ( (!fixedWidthOnly || f->GetInfo()->isFixed) && (encoding == wxFONTENCODING_SYSTEM || wxTestFontEncoding(info)) ) { - found = TRUE; + found = true; if ( !OnFacename(f->GetName()) ) - return TRUE; + return true; } } @@ -72,7 +71,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool wxFontEnumerator::EnumerateEncodings(const wxString& family) { - static wxFontEncoding encodings[] = + static wxFontEncoding encodings[] = { wxFONTENCODING_ISO8859_1, wxFONTENCODING_ISO8859_2, @@ -98,11 +97,11 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) wxFONTENCODING_CP1256, wxFONTENCODING_CP1257, wxFONTENCODING_KOI8, - + wxFONTENCODING_SYSTEM }; - - static const char *encodingNames[] = + + static const char *encodingNames[] = { "iso88590-1", "iso88590-2", @@ -128,18 +127,18 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) "koi-8", NULL }; - + wxNativeEncodingInfo info; info.facename = family; - + for (size_t i = 0; encodings[i] != wxFONTENCODING_SYSTEM; i++) { if ( !wxGetNativeFontEncoding(encodings[i], &info) || - !wxTestFontEncoding(info) ) + !wxTestFontEncoding(info) ) continue; if ( !OnFontEncoding(family, encodingNames[i]) ) break; } - return TRUE; + return true; } diff --git a/src/mgl/toplevel.cpp b/src/mgl/toplevel.cpp index 80646a601f..1ec5da6c11 100644 --- a/src/mgl/toplevel.cpp +++ b/src/mgl/toplevel.cpp @@ -7,6 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + // ============================================================================ // declarations // ============================================================================ @@ -15,15 +22,7 @@ // headers // ---------------------------------------------------------------------------- -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/toplevel.h" #include "wx/app.h" #endif // WX_PRECOMP diff --git a/src/motif/bmpbuttn.cpp b/src/motif/bmpbuttn.cpp index e47b8c2b1b..de320bafb0 100644 --- a/src/motif/bmpbuttn.cpp +++ b/src/motif/bmpbuttn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bmpbuttn.cpp +// Name: src/motif/bmpbuttn.cpp // Purpose: wxBitmapButton // Author: Julian Smart // Modified by: @@ -16,8 +16,6 @@ #define XtScreen XTSCREEN #endif -#include "wx/defs.h" - #include "wx/bmpbuttn.h" #ifdef __VMS__ @@ -77,7 +75,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, xmPushButtonWidgetClass, parentWidget, #endif // See comment for wxButton::SetDefault - // XmNdefaultButtonShadowThickness, 1, + // XmNdefaultButtonShadowThickness, 1, XmNrecomputeSize, False, NULL); @@ -265,4 +263,3 @@ wxSize wxBitmapButton::DoGetBestSize() const return ret; } - diff --git a/src/motif/bmpmotif.cpp b/src/motif/bmpmotif.cpp index 2bd938cdab..bec6dd5146 100644 --- a/src/motif/bmpmotif.cpp +++ b/src/motif/bmpmotif.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp +// Name: src/motif/bmpmotif.cpp // Purpose: wxBitmap // Author: Julian Smart, originally in bitmap.cpp // Modified by: @@ -17,7 +17,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" #include "wx/motif/bmpmotif.h" #ifdef __VMS__ diff --git a/src/motif/button.cpp b/src/motif/button.cpp index b5ce08a960..af7a37ac49 100644 --- a/src/motif/button.cpp +++ b/src/motif/button.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: button.cpp +// Name: src/motif/button.cpp // Purpose: wxButton // Author: Julian Smart // Modified by: @@ -16,8 +16,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #include "wx/button.h" #ifdef __VMS__ @@ -51,7 +49,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& lbl, wxString label(lbl); if (label.empty() && wxIsStockID(id)) label = wxGetStockLabel(id); - + if( !CreateControl( parent, id, pos, size, style, validator, name ) ) return false; @@ -76,7 +74,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& lbl, XmNlabelString, text(), XmNrecomputeSize, False, // See comment for wxButton::SetDefault - // XmNdefaultButtonShadowThickness, 1, + // XmNdefaultButtonShadowThickness, 1, NULL); XtAddCallback ((Widget) m_mainWidget, diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index 6b9402557b..948b2c673a 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: checkbox.cpp +// Name: src/motif/checkbox.cpp // Purpose: wxCheckBox // Author: Julian Smart // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". @@ -16,8 +16,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #include "wx/checkbox.h" #include "wx/tglbtn.h" #include "wx/utils.h" @@ -63,7 +61,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, wxString label1(wxStripMenuCodes(label)); wxXmString text( label1 ); - + Widget parentWidget = (Widget) parent->GetClientWidget(); m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("toggle", @@ -77,7 +75,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmNtoggleMode, Is3State() ? XmTOGGLE_INDETERMINATE : XmTOGGLE_BOOLEAN, #endif NULL); - + XtAddCallback( (Widget)m_mainWidget, XmNvalueChangedCallback, (XtCallbackProc)wxCheckBoxCallback, (XtPointer)this ); diff --git a/src/motif/checklst.cpp b/src/motif/checklst.cpp index 8b8ee7ef6e..a7e8eacd04 100644 --- a/src/motif/checklst.cpp +++ b/src/motif/checklst.cpp @@ -18,8 +18,6 @@ #if wxUSE_CHECKLISTBOX -#include "wx/defs.h" - #include "wx/checklst.h" #include "wx/arrstr.h" diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 1353a842a9..9797969ea7 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -21,8 +21,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #if wxUSE_CLIPBOARD #include "wx/app.h" diff --git a/src/motif/control.cpp b/src/motif/control.cpp index e783854df5..18f8bbeb68 100644 --- a/src/motif/control.cpp +++ b/src/motif/control.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: control.cpp +// Name: src/motif/control.cpp // Purpose: wxControl class // Author: Julian Smart // Modified by: @@ -12,8 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #include "wx/control.h" #include "wx/panel.h" #include "wx/utils.h" diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp index 0647d3501b..e27b51fab6 100644 --- a/src/motif/dataobj.cpp +++ b/src/motif/dataobj.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dataobj.cpp +// Name: src/motif/dataobj.cpp // Purpose: wxDataObject class // Author: Julian Smart // Id: $Id$ @@ -10,8 +10,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_CLIPBOARD #include "wx/dataobj.h" @@ -106,7 +104,7 @@ wxString wxDataFormat::GetId() const { char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format); wxString ret( t ); // this will convert from ascii to Unicode - if (t) + if (t) XFree( t ); return ret; } diff --git a/src/motif/dc.cpp b/src/motif/dc.cpp index 46dfe4de2f..c6bd10e425 100644 --- a/src/motif/dc.cpp +++ b/src/motif/dc.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dc.cpp +// Name: src/motif/dc.cpp // Purpose: wxDC class // Author: Julian Smart // Modified by: @@ -14,9 +14,8 @@ #include "wx/dc.h" #include "wx/dcmemory.h" -#include "wx/defs.h" - IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) +IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) //----------------------------------------------------------------------------- // wxDC @@ -212,4 +211,3 @@ void wxDC::ComputeScaleAndOrigin() m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleY = m_logicalScaleY * m_userScaleY; } - diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp index 0d3c9abdbe..3ac03441b9 100644 --- a/src/motif/filedlg.cpp +++ b/src/motif/filedlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: filedlg.cpp +// Name: src/motif/filedlg.cpp // Purpose: wxFileDialog // Author: Julian Smart // Modified by: @@ -18,7 +18,6 @@ #define XtWindow XTWINDOW #endif -#include "wx/defs.h" #include "wx/utils.h" #include "wx/filedlg.h" #include "wx/intl.h" diff --git a/src/motif/font.cpp b/src/motif/font.cpp index 07d193cb74..a0a1c809b9 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -20,8 +20,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #ifdef __VMS #pragma message disable nosimpint #include "wx/vms_x_fix.h" @@ -434,7 +432,7 @@ int wxFont::GetPointSize() const wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxT(""), wxT("invalid font") ); + wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName ; } @@ -478,7 +476,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { wxCHECK_MSG( Ok(), (wxNativeFontInfo *)NULL, wxT("invalid font") ); - if(M_FONTDATA->m_nativeFontInfo.GetXFontName().IsEmpty()) + if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty()) GetInternalFont(); return &(M_FONTDATA->m_nativeFontInfo); @@ -536,7 +534,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const #endif f->m_display = ( display ? display : wxGetDisplay() ); f->m_scale = intScale; - + #if wxMOTIF_USE_RENDER_TABLE XmRendition rendition; XmRenderTable renderTable; @@ -652,13 +650,13 @@ void wxGetTextExtent(WXDisplay* display, const wxFont& font, double scale, { XRectangle ink, logical; WXFontSet fset = font.GetFontSet(scale, display); - + XmbTextExtents( (XFontSet)fset, str.c_str(), str.length(), &ink, &logical); if( width ) *width = logical.width; if( height ) *height = logical.height; - if( ascent ) *ascent = -logical.y; - if( descent ) *descent = logical.height + logical.y; + if( ascent ) *ascent = -logical.y; + if( descent ) *descent = logical.height + logical.y; } #else // if !wxMOTIF_NEW_FONT_HANDLING diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 9bc0d3a2af..21d7a88ac0 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -20,8 +20,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #include "wx/menu.h" #include "wx/menuitem.h" #include "wx/log.h" @@ -731,4 +729,3 @@ bool wxMenuBar::SetFont(const wxFont& font) return true; } - diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp index c680eaeaad..cbed0910f4 100644 --- a/src/motif/menuitem.cpp +++ b/src/motif/menuitem.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.cpp +// Name: src/motif/menuitem.cpp // Purpose: wxMenuItem implementation // Author: Julian Smart // Modified by: @@ -20,8 +20,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #include "wx/menu.h" #include "wx/menuitem.h" #include "wx/utils.h" @@ -171,7 +169,7 @@ void wxMenuItem::CreateItem (WXWidget menu, wxMenuBar * menuBar, (wxStripMenuCodes(m_text), xmLabelGadgetClass, (Widget) menu, NULL); } - else if ((!m_text.IsNull() && m_text != "") && (!m_subMenu)) + else if (!m_text.empty() && !m_subMenu) { wxString strName = wxStripMenuCodes(m_text); if (IsCheckable()) @@ -258,7 +256,7 @@ void wxMenuItem::DestroyItem(bool full) ; // Nothing } - else if ((!m_text.IsNull() && (m_text != "")) && !m_subMenu) + else if (!m_text.empty() && !m_subMenu) { if (m_buttonWidget) { @@ -412,4 +410,3 @@ wxMenuItemDisarmCallback (Widget WXUNUSED(w), XtPointer clientData, } } } - diff --git a/src/motif/msgdlg.cpp b/src/motif/msgdlg.cpp index f51da838f1..95105ec2a8 100644 --- a/src/motif/msgdlg.cpp +++ b/src/motif/msgdlg.cpp @@ -20,8 +20,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #ifdef __VMS #define XtDisplay XTDISPLAY #pragma message disable nosimpint diff --git a/src/motif/radiobut.cpp b/src/motif/radiobut.cpp index 70847aee23..956e8d65aa 100644 --- a/src/motif/radiobut.cpp +++ b/src/motif/radiobut.cpp @@ -16,8 +16,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #include "wx/radiobut.h" #include "wx/utils.h" diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 789220c16f..5b19681cf3 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -12,7 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" #include "wx/scrolbar.h" #ifdef __VMS__ diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index d82e67f19c..31ca0ae3e0 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: slider.cpp +// Name: src/motif/slider.cpp // Purpose: wxSlider // Author: Julian Smart // Modified by: @@ -12,8 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_SLIDER #include "wx/slider.h" diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp index 5276663d1e..fcdc7ec477 100644 --- a/src/motif/spinbutt.cpp +++ b/src/motif/spinbutt.cpp @@ -12,8 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_SPINBTN #include "wx/spinbutt.h" diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp index 77941b93fb..b22d663095 100644 --- a/src/motif/statbmp.cpp +++ b/src/motif/statbmp.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: statbmp.cpp +// Name: src/motif/statbmp.cpp // Purpose: wxStaticBitmap // Author: Julian Smart // Modified by: @@ -12,8 +12,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #include "wx/statbmp.h" #ifdef __VMS__ @@ -131,7 +129,7 @@ void wxStaticBitmap::DoSetBitmap() XmNlabelType, XmSTRING, XmNlabelPixmap, XmUNSPECIFIED_PIXMAP, NULL); - } + } } void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) @@ -156,4 +154,3 @@ void wxStaticBitmap::ChangeForegroundColour() m_bitmapCache.SetColoursChanged(); wxWindow::ChangeForegroundColour(); } - diff --git a/src/motif/statbox.cpp b/src/motif/statbox.cpp index 6c96295e52..744db44731 100644 --- a/src/motif/statbox.cpp +++ b/src/motif/statbox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: statbox.cpp +// Name: src/motif/statbox.cpp // Purpose: wxStaticBox // Author: Julian Smart // Modified by: @@ -16,8 +16,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #include "wx/statbox.h" #include "wx/utils.h" @@ -101,8 +99,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, // XmNshadowType, XmSHADOW_IN, NULL); - bool hasLabel = (!label.IsNull() && !label.IsEmpty()) ; - if (hasLabel) + if (!label.empty()) { wxString label1(wxStripMenuCodes(label)); wxXmString text(label1); @@ -115,11 +112,11 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, #if wxCHECK_MOTIF_VERSION( 2, 0 ) XmNframeChildType, XmFRAME_TITLE_CHILD, #else - XmNchildType, XmFRAME_TITLE_CHILD, + XmNchildType, XmFRAME_TITLE_CHILD, #endif NULL); } - + AttachWidget (parent, m_mainWidget, NULL, pos.x, pos.y, size.x, size.y); ChangeBackgroundColour(); diff --git a/src/motif/stattext.cpp b/src/motif/stattext.cpp index 79d3ea330d..953f4cd659 100644 --- a/src/motif/stattext.cpp +++ b/src/motif/stattext.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: stattext.cpp +// Name: src/motif/stattext.cpp // Purpose: wxStaticText // Author: Julian Smart // Modified by: @@ -16,8 +16,6 @@ #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #if wxUSE_STATTEXT #include "wx/stattext.h" diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index ef011a5056..81ac9740ea 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -24,8 +24,6 @@ #define XtParent XTPARENT #endif -#include "wx/defs.h" - #include #include #include @@ -488,7 +486,7 @@ void wxTextCtrl::ShowPosition(long pos) int wxTextCtrl::GetLineLength(long lineNo) const { wxString str = GetLineText (lineNo); - return (int) str.Length(); + return (int) str.length(); } wxString wxTextCtrl::GetLineText(long lineNo) const diff --git a/src/msdos/mimetype.cpp b/src/msdos/mimetype.cpp index 0665e79ab9..2966f22f65 100644 --- a/src/msdos/mimetype.cpp +++ b/src/msdos/mimetype.cpp @@ -13,22 +13,18 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif +#if wxUSE_MIMETYPE #ifndef WX_PRECOMP - #include "wx/string.h" - #if wxUSE_GUI - #include "wx/icon.h" - #endif + #include "wx/string.h" + #if wxUSE_GUI + #include "wx/icon.h" + #endif #endif //WX_PRECOMP -#if wxUSE_MIMETYPE - #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index e1eea31a00..d425d89bc6 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -26,7 +26,6 @@ #ifndef WX_PRECOMP #include - #include "wx/defs.h" #include "wx/colour.h" #include "wx/gdicmn.h" #include "wx/utils.h" diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index e0917d6159..d0bcd12089 100644 --- a/src/msw/fontdlg.cpp +++ b/src/msw/fontdlg.cpp @@ -27,7 +27,6 @@ #if wxUSE_FONTDLG #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/utils.h" #include "wx/dialog.h" #endif diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp index 2c7a7e6bec..655e9fcf67 100644 --- a/src/msw/gauge95.cpp +++ b/src/msw/gauge95.cpp @@ -24,12 +24,11 @@ #pragma hdrstop #endif +#if wxUSE_GAUGE + #ifndef WX_PRECOMP - #include "wx/defs.h" #endif -#if wxUSE_GAUGE - #include "wx/gauge.h" #include "wx/msw/private.h" diff --git a/src/msw/helpbest.cpp b/src/msw/helpbest.cpp index cb69551e1a..3782a29354 100644 --- a/src/msw/helpbest.cpp +++ b/src/msw/helpbest.cpp @@ -17,11 +17,10 @@ #endif #ifndef WX_PRECOMP -#include "wx/defs.h" + #include "wx/log.h" #endif #include "wx/filefn.h" -#include "wx/log.h" #if wxUSE_HELP && wxUSE_MS_HTML_HELP \ && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__) diff --git a/src/msw/helpwin.cpp b/src/msw/helpwin.cpp index e5739bad4f..3b9ec5549d 100644 --- a/src/msw/helpwin.cpp +++ b/src/msw/helpwin.cpp @@ -13,15 +13,14 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif +#if wxUSE_HELP + #ifndef WX_PRECOMP -#include "wx/defs.h" #endif -#if wxUSE_HELP - #include "wx/filefn.h" #include "wx/msw/helpwin.h" @@ -53,14 +52,14 @@ bool wxWinHelpController::Initialize(const wxString& filename) bool wxWinHelpController::LoadFile(const wxString& file) { - if (!file.IsEmpty()) + if (!file.empty()) m_helpFile = file; return true; } bool wxWinHelpController::DisplayContents(void) { - if (m_helpFile.IsEmpty()) return false; + if (m_helpFile.empty()) return false; wxString str = GetValidFilename(m_helpFile); @@ -70,7 +69,7 @@ bool wxWinHelpController::DisplayContents(void) bool wxWinHelpController::DisplaySection(int section) { // Use context number - if (m_helpFile.IsEmpty()) return false; + if (m_helpFile.empty()) return false; wxString str = GetValidFilename(m_helpFile); @@ -79,7 +78,7 @@ bool wxWinHelpController::DisplaySection(int section) bool wxWinHelpController::DisplayContextPopup(int contextId) { - if (m_helpFile.IsEmpty()) return false; + if (m_helpFile.empty()) return false; wxString str = GetValidFilename(m_helpFile); @@ -95,7 +94,7 @@ bool wxWinHelpController::DisplayBlock(long block) bool wxWinHelpController::KeywordSearch(const wxString& k, wxHelpSearchMode WXUNUSED(mode)) { - if (m_helpFile.IsEmpty()) return false; + if (m_helpFile.empty()) return false; wxString str = GetValidFilename(m_helpFile); @@ -115,7 +114,7 @@ wxString wxWinHelpController::GetValidFilename(const wxString& file) const wxSplitPath(file, & path, & name, & ext); wxString fullName; - if (path.IsEmpty()) + if (path.empty()) fullName = name + wxT(".hlp"); else if (path.Last() == wxT('\\')) fullName = path + name + wxT(".hlp"); diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index e0fa3ee510..2b02805615 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/icon.cpp +// Name: src/msw/icon.cpp // Purpose: wxIcon class // Author: Julian Smart // Modified by: 20.11.99 (VZ): don't derive from wxBitmap any more @@ -151,4 +151,3 @@ bool wxIcon::LoadFile(const wxString& filename, return handler->Load(this, filename, type, desiredWidth, desiredHeight); } - diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index edf1c114ed..d641c6a3d5 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -13,12 +13,11 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/defs.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/msgdlg.h" @@ -126,4 +125,3 @@ int wxMessageDialog::ShowModal() } return ans; } - diff --git a/src/msw/mslu.cpp b/src/msw/mslu.cpp index a484b58656..c2ee47cf6f 100644 --- a/src/msw/mslu.cpp +++ b/src/msw/mslu.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/mslu.cpp +// Name: src/msw/mslu.cpp // Purpose: Fixes for bugs in MSLU // Author: Vaclav Slavik // Modified by: @@ -13,12 +13,11 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop -#include + #pragma hdrstop + #include #endif #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/utils.h" #endif @@ -223,7 +222,7 @@ WXDLLIMPEXP_BASE int wxMSLU__wstat(const wxChar *name, struct _stat *buffer) } #ifdef __BORLANDC__ -//here _stati64 is defined as stati64, see msw/mslu.h line 62 +//here _stati64 is defined as stati64, see msw/mslu.h line 62 #undef _stati64 WXDLLIMPEXP_BASE int wxMSLU__wstati64(const wxChar *name, struct _stati64 *buffer) { diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 6096c4cf78..548ac661a8 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -13,11 +13,9 @@ #include "wx/wxprec.h" #if defined(__BORLANDC__) -#pragma hdrstop + #pragma hdrstop #endif -#include "wx/defs.h" - // Watcom C++ gives a linker error if this is compiled in. // With Borland C++, all samples crash if this is compiled in. #if wxUSE_OLE && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) @@ -595,11 +593,11 @@ WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& ole { wxDateTime date( variant.GetDateTime() ); oleVariant.vt = VT_DATE; - + long dosDateTime = date.GetAsDOS(); short dosDate = short((dosDateTime & 0xFFFF0000) >> 16); short dosTime = short(dosDateTime & 0xFFFF); - + DosDateTimeToVariantTime(dosDate, dosTime, & oleVariant.date); } #endif @@ -682,7 +680,7 @@ WXDLLEXPORT bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& unsigned short dosDate = 0; unsigned short dosTime = 0; VariantTimeToDosDateTime(oleVariant.date, & dosDate, & dosTime); - + long dosDateTime = (dosDate << 16) || dosTime; wxDateTime date; date.SetFromDOS(dosDateTime); diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index b4586d291b..d28e3cdfa6 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/popupwin.cpp +// Name: src/msw/popupwin.cpp // Purpose: implements wxPopupWindow for MSW // Author: Vadim Zeitlin // Modified by: @@ -24,12 +24,11 @@ #pragma hdrstop #endif +#if wxUSE_POPUPWIN + #ifndef WX_PRECOMP -#include "wx/defs.h" #endif //WX_PRECOMP -#if wxUSE_POPUPWIN - #include "wx/popupwin.h" #include "wx/msw/private.h" // for GetDesktopWindow() @@ -112,4 +111,3 @@ bool wxPopupWindow::Show(bool show) } #endif // #if wxUSE_POPUPWIN - diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index dd37d4f050..a8e3297d5a 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: printwin.cpp +// Name: src/msw/printwin.cpp // Purpose: wxWindowsPrinter framework // Author: Julian Smart // Modified by: @@ -24,8 +24,6 @@ #pragma hdrstop #endif -#include "wx/defs.h" - // Don't use the Windows printer if we're in wxUniv mode and using // the PostScript architecture #if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index c5b9b9b5c1..ec0f9b717b 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -14,15 +14,14 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/utils.h" -#include "wx/menu.h" + #include "wx/window.h" + #include "wx/frame.h" + #include "wx/utils.h" + #include "wx/menu.h" #endif #include "wx/msw/private.h" diff --git a/src/msw/wince/filefnwce.cpp b/src/msw/wince/filefnwce.cpp index c9bce9c17d..61827f0f6d 100644 --- a/src/msw/wince/filefnwce.cpp +++ b/src/msw/wince/filefnwce.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: filefn.cpp +// Name: src/msw/wince/filefn.cpp // Purpose: File- and directory-related functions // Author: Julian Smart // Modified by: @@ -19,13 +19,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" -#include "wx/file.h" #ifdef __BORLANDC__ #pragma hdrstop #endif +#include "wx/file.h" + #include #include #include @@ -123,12 +123,12 @@ int wxEof(int fd) DWORD off0 = SetFilePointer((HANDLE) fd, 0, &high0, FILE_CURRENT); if (off0 == 0xFFFFFFFF && GetLastError() != NO_ERROR) return -1; - + LONG high1 = 0; DWORD off1 = SetFilePointer((HANDLE) fd, 0, &high0, FILE_END); if (off1 == 0xFFFFFFFF && GetLastError() != NO_ERROR) return -1; - + if (off0 == off1 && high0 == high1) return 1; else diff --git a/src/os2/combobox.cpp b/src/os2/combobox.cpp index c97801ef85..5e86909cb9 100644 --- a/src/os2/combobox.cpp +++ b/src/os2/combobox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: combobox.cpp +// Name: src/os2/combobox.cpp // Purpose: wxComboBox class // Author: David Webster // Modified by: @@ -12,13 +12,12 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_COMBOBOX + #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/settings.h" #endif -#if wxUSE_COMBOBOX - #include "wx/combobox.h" #include "wx/clipbrd.h" #include "wx/os2/private.h" diff --git a/src/os2/dataobj.cpp b/src/os2/dataobj.cpp index 137101f053..3dfd2b17e5 100644 --- a/src/os2/dataobj.cpp +++ b/src/os2/dataobj.cpp @@ -20,14 +20,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_DATAOBJ + #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/intl.h" #include "wx/log.h" #endif -#if wxUSE_DATAOBJ - #include "wx/dataobj.h" #include "wx/mstream.h" #include "wx/image.h" diff --git a/src/os2/dirdlg.cpp b/src/os2/dirdlg.cpp index 915fda9f91..28af822197 100644 --- a/src/os2/dirdlg.cpp +++ b/src/os2/dirdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dirdlg.cpp +// Name: src/os2/dirdlg.cpp // Purpose: wxDirDialog // Author: David Webster // Modified by: @@ -13,11 +13,10 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/dirdlg.h" + #include + #include "wx/utils.h" + #include "wx/dialog.h" + #include "wx/dirdlg.h" #endif #include "wx/os2/private.h" @@ -46,4 +45,3 @@ int wxDirDialog::ShowModal() // TODO return wxID_CANCEL; } - diff --git a/src/os2/fontdlg.cpp b/src/os2/fontdlg.cpp index ca3bb8fd67..a4284a5e66 100644 --- a/src/os2/fontdlg.cpp +++ b/src/os2/fontdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: fontdlg.cpp +// Name: src/os2/fontdlg.cpp // Purpose: wxFontDialog class. NOTE: you can use the generic class // if you wish, instead of implementing this. // Author: David Webster @@ -14,11 +14,10 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/math.h" + #include + #include "wx/utils.h" + #include "wx/dialog.h" + #include "wx/math.h" #endif #include "wx/fontdlg.h" @@ -98,4 +97,3 @@ int wxFontDialog::ShowModal() } return wxID_CANCEL; } // end of wxFontDialg::ShowModal - diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index e7b33f7829..f8c4e9d11a 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -13,7 +13,6 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/object.h" #include "wx/dynarray.h" #include "wx/list.h" diff --git a/src/os2/gauge.cpp b/src/os2/gauge.cpp index 972246d597..2bf1c242eb 100644 --- a/src/os2/gauge.cpp +++ b/src/os2/gauge.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gauge.cpp +// Name: src/os2/gauge.cpp // Purpose: wxGauge class // Author: David Webster // Modified by: @@ -12,9 +12,8 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/scrolwin.h" + #include "wx/utils.h" + #include "wx/scrolwin.h" #endif #include "wx/os2/private.h" @@ -241,12 +240,10 @@ int wxGauge::GetValue() const return m_nGaugePos; } // end of wxGauge::GetValue -bool wxGauge::SetBackgroundColour( - const wxColour& rColour -) +bool wxGauge::SetBackgroundColour( const wxColour& rColour ) { if (!wxControl::SetBackgroundColour(rColour)) - return FALSE; + return false; LONG lColor = (LONG)rColour.GetPixel(); @@ -255,7 +252,7 @@ bool wxGauge::SetBackgroundColour( ,sizeof(LONG) ,(PVOID)&lColor ); - return TRUE; + return true; } // end of wxGauge::SetBackgroundColour void wxGauge::SetBezelFace( @@ -264,14 +261,12 @@ void wxGauge::SetBezelFace( { } // end of wxGauge::SetBezelFace -bool wxGauge::SetForegroundColour( - const wxColour& rColour -) +bool wxGauge::SetForegroundColour( const wxColour& rColour ) { if (!wxControl::SetForegroundColour(rColour)) - return FALSE; + return false; - LONG lColor = (LONG)rColour.GetPixel(); + LONG lColor = (LONG)rColour.GetPixel(); ::WinSetPresParam( GetHwnd() ,PP_FOREGROUNDCOLOR @@ -279,7 +274,7 @@ bool wxGauge::SetForegroundColour( ,(PVOID)&lColor ); - return TRUE; + return true; } // end of wxGauge::SetForegroundColour void wxGauge::SetRange( diff --git a/src/os2/gsockpm.cpp b/src/os2/gsockpm.cpp index 4258e637cf..c0281d2ac1 100644 --- a/src/os2/gsockpm.cpp +++ b/src/os2/gsockpm.cpp @@ -9,8 +9,6 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_SOCKETS #include diff --git a/src/os2/helpwin.cpp b/src/os2/helpwin.cpp index 19c6c00e4a..dacf83e524 100644 --- a/src/os2/helpwin.cpp +++ b/src/os2/helpwin.cpp @@ -12,13 +12,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_HELP + #ifndef WX_PRECOMP -#include "wx/defs.h" #endif #include "wx/os2/helpwin.h" -#if wxUSE_HELP #include #include "wx/os2/private.h" @@ -150,4 +150,5 @@ bool wxWinHelpController::Quit() void wxWinHelpController::OnQuit() { } + #endif // wxUSE_HELP diff --git a/src/os2/icon.cpp b/src/os2/icon.cpp index a7a27c525f..a8d7100033 100644 --- a/src/os2/icon.cpp +++ b/src/os2/icon.cpp @@ -13,11 +13,10 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/list.h" #include "wx/utils.h" #include "wx/app.h" diff --git a/src/os2/joystick.cpp b/src/os2/joystick.cpp index 7d9ec64512..6fef9a0116 100644 --- a/src/os2/joystick.cpp +++ b/src/os2/joystick.cpp @@ -14,8 +14,6 @@ // #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_JOYSTICK #include "wx/string.h" diff --git a/src/os2/msgdlg.cpp b/src/os2/msgdlg.cpp index 0826f701b0..7577e564ec 100644 --- a/src/os2/msgdlg.cpp +++ b/src/os2/msgdlg.cpp @@ -13,13 +13,12 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/app.h" -#include "wx/msgdlg.h" -#include "wx/math.h" + #include + #include "wx/utils.h" + #include "wx/dialog.h" + #include "wx/app.h" + #include "wx/msgdlg.h" + #include "wx/math.h" #endif #include "wx/os2/private.h" diff --git a/src/os2/palette.cpp b/src/os2/palette.cpp index 76e68ed2f0..a579c53803 100644 --- a/src/os2/palette.cpp +++ b/src/os2/palette.cpp @@ -13,12 +13,11 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/string.h" -#include "wx/os2/private.h" -#include "wx/palette.h" -#include "wx/app.h" + #include + #include "wx/string.h" + #include "wx/os2/private.h" + #include "wx/palette.h" + #include "wx/app.h" #endif #define INCL_PM diff --git a/src/os2/settings.cpp b/src/os2/settings.cpp index c75d66794f..805e567da7 100644 --- a/src/os2/settings.cpp +++ b/src/os2/settings.cpp @@ -13,11 +13,10 @@ #include "wx/wxprec.h" #ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/gdicmn.h" + #include + #include "wx/pen.h" + #include "wx/brush.h" + #include "wx/gdicmn.h" #endif #include "wx/module.h" diff --git a/src/palmos/colordlg.cpp b/src/palmos/colordlg.cpp index 3bcf27d4e6..d2edc5154b 100644 --- a/src/palmos/colordlg.cpp +++ b/src/palmos/colordlg.cpp @@ -25,7 +25,6 @@ #endif #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/intl.h" #endif diff --git a/src/palmos/fontdlg.cpp b/src/palmos/fontdlg.cpp index f1e6ec5d93..e6c238f90e 100644 --- a/src/palmos/fontdlg.cpp +++ b/src/palmos/fontdlg.cpp @@ -27,7 +27,6 @@ #if wxUSE_FONTDLG #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/math.h" diff --git a/src/palmos/gauge.cpp b/src/palmos/gauge.cpp index 157c7b9294..f0c47e3878 100644 --- a/src/palmos/gauge.cpp +++ b/src/palmos/gauge.cpp @@ -24,12 +24,11 @@ #pragma hdrstop #endif +#if wxUSE_GAUGE + #ifndef WX_PRECOMP - #include "wx/defs.h" #endif -#if wxUSE_GAUGE - #include "wx/gauge.h" #include "wx/palmos/private.h" diff --git a/src/palmos/help.cpp b/src/palmos/help.cpp index 40d91a484e..5fee68e840 100644 --- a/src/palmos/help.cpp +++ b/src/palmos/help.cpp @@ -16,12 +16,11 @@ #pragma hdrstop #endif +#if wxUSE_HELP + #ifndef WX_PRECOMP -#include "wx/defs.h" #endif -#if wxUSE_HELP - #include "wx/filefn.h" #include diff --git a/src/palmos/icon.cpp b/src/palmos/icon.cpp index 853931bafd..98af07bc41 100644 --- a/src/palmos/icon.cpp +++ b/src/palmos/icon.cpp @@ -25,7 +25,6 @@ #endif #ifndef WX_PRECOMP - #include "wx/defs.h" #include "wx/list.h" #include "wx/utils.h" #include "wx/app.h" @@ -90,4 +89,3 @@ bool wxIcon::LoadFile(const wxString& filename, { return false; } - diff --git a/src/palmos/msgdlg.cpp b/src/palmos/msgdlg.cpp index 12c15eb45f..4c1f7732b5 100644 --- a/src/palmos/msgdlg.cpp +++ b/src/palmos/msgdlg.cpp @@ -13,12 +13,11 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/defs.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/msgdlg.h" @@ -149,4 +148,3 @@ int wxMessageDialog::ShowModal() return wxResult; } - diff --git a/src/palmos/popupwin.cpp b/src/palmos/popupwin.cpp index 770436845f..009f37eaa5 100644 --- a/src/palmos/popupwin.cpp +++ b/src/palmos/popupwin.cpp @@ -24,12 +24,11 @@ #pragma hdrstop #endif +#if wxUSE_POPUPWIN + #ifndef WX_PRECOMP -#include "wx/defs.h" #endif //WX_PRECOMP -#if wxUSE_POPUPWIN - #include "wx/popupwin.h" #include "wx/palmos/private.h" // for GetDesktopWindow() @@ -65,4 +64,3 @@ bool wxPopupWindow::Show(bool show) } #endif // #if wxUSE_POPUPWIN - diff --git a/src/palmos/printpalm.cpp b/src/palmos/printpalm.cpp index 22779980fc..1ff991aa29 100644 --- a/src/palmos/printpalm.cpp +++ b/src/palmos/printpalm.cpp @@ -24,8 +24,6 @@ #pragma hdrstop #endif -#include "wx/defs.h" - // Don't use the Windows printer if we're in wxUniv mode and using // the PostScript architecture #if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) diff --git a/src/palmos/taskbar.cpp b/src/palmos/taskbar.cpp index c6e8d52f8f..8ab4274bb2 100644 --- a/src/palmos/taskbar.cpp +++ b/src/palmos/taskbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// File: taskbar.cpp +// File: src/palmos/taskbar.cpp // Purpose: Implements wxTaskBarIcon class for manipulating icons on // the task bar. // Author: Julian Smart @@ -14,15 +14,14 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/utils.h" -#include "wx/menu.h" + #include "wx/window.h" + #include "wx/frame.h" + #include "wx/utils.h" + #include "wx/menu.h" #endif #if defined(__WIN95__) @@ -107,4 +106,3 @@ long wxTaskBarIcon::WindowProc(unsigned int msg, } #endif // __WIN95__ - diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index e9d916a062..591584644c 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -15,10 +15,9 @@ #if wxUSE_DIALUP_MANAGER #ifndef WX_PRECOMP -# include "wx/defs.h" + #include "wx/string.h" #endif // !PCH -#include "wx/string.h" #include "wx/event.h" #include "wx/dialup.h" #include "wx/timer.h" diff --git a/src/unix/joystick.cpp b/src/unix/joystick.cpp index 92e36ad5d7..c60b06b758 100644 --- a/src/unix/joystick.cpp +++ b/src/unix/joystick.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: joystick.cpp +// Name: src/unix/joystick.cpp // Purpose: wxJoystick class // Author: Ported to Linux by Guilhem Lavaux // Modified by: @@ -12,8 +12,6 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" - #if wxUSE_JOYSTICK #include "wx/joystick.h" @@ -188,7 +186,7 @@ wxJoystick::wxJoystick(int joystick) if (m_device == -1) { dev_name.Printf( wxT("/dev/input/js%d"), joystick); - m_device = open(dev_name.fn_str(), O_RDONLY); + m_device = open(dev_name.fn_str(), O_RDONLY); } if (m_device != -1) @@ -295,7 +293,7 @@ int wxJoystick::GetNumberJoysticks() break; close(fd); } - + if (j == 0) { for (j=0; j<4; j++) { dev_name.Printf(wxT("/dev/input/js%d"), j); @@ -305,7 +303,7 @@ int wxJoystick::GetNumberJoysticks() close(fd); } } - + return j; } @@ -489,4 +487,3 @@ bool wxJoystick::ReleaseCapture() return false; } #endif // wxUSE_JOYSTICK - diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 0a2793f92c..c39e254545 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: unix/mimetype.cpp +// Name: src/unix/mimetype.cpp // Purpose: classes and functions to manage MIME types // Author: Vadim Zeitlin // Modified by: @@ -33,17 +33,13 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/defs.h" + #pragma hdrstop #endif #if wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE #ifndef WX_PRECOMP - #include "wx/string.h" + #include "wx/string.h" #endif #include "wx/log.h" @@ -311,7 +307,7 @@ void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename, wxLogTrace(TRACE_MIME, wxT("--- Reading from Gnome file %s '%s' ---"), filename.c_str(), pc); - + // trim trailing space and tab while ((*pc == wxT(' ')) || (*pc == wxT('\t'))) pc++; @@ -322,18 +318,18 @@ void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename, { wxString left_of_equal = sTmp.Left( equal_pos ); const wxChar *right_of_equal = pc; - right_of_equal += equal_pos+1; - + right_of_equal += equal_pos+1; + if (left_of_equal == wxT("icon_filename")) { // GNOME 2: curIconFile = right_of_equal; - + wxFileName newFile( curIconFile ); if (newFile.IsRelative() || newFile.FileExists()) { size_t nDirs = search_dirs.GetCount(); - + for (size_t nDir = 0; nDir < nDirs; nDir++) { newFile.SetPath( search_dirs[nDir] ); @@ -1309,7 +1305,7 @@ void wxMimeTypesManagerImpl::InitIfNeeded() { // set the flag first to prevent recursion m_initialized = true; - + wxString wm = wxGetenv( wxT("WINDOWMANAGER") ); if (wm.Find( wxT("kde") ) != wxNOT_FOUND) @@ -1764,7 +1760,7 @@ bool wxMimeTypesManagerImpl::DoAssociation(const wxString& strType, const wxString& strDesc) { int nIndex = AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, true); - + if ( nIndex == wxNOT_FOUND ) return false; @@ -2703,4 +2699,3 @@ static bool IsKnownUnimportantField(const wxString& fieldAll) #endif // wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE - diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 43c51fdf1c..02b49fdc57 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: unix/utilsunx.cpp +// Name: src/unix/utilsunx.cpp // Purpose: generic Unix implementation of many wx functions // Author: Vadim Zeitlin // Id: $Id$ @@ -18,8 +18,9 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/defs.h" -#include "wx/string.h" +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif #include "wx/intl.h" #include "wx/log.h" @@ -280,7 +281,7 @@ long wxExecute( const wxString& command, int flags, wxProcess *process ) // split the command line in arguments do { - argument=wxT(""); + argument = wxEmptyString; quotechar = wxT('\0'); // eat leading whitespace: @@ -884,7 +885,7 @@ wxString wxGetOsDescription() return wxString::FromAscii( buf ); } wxFAIL_MSG( _T("uname failed") ); - return _T(""); + return wxEmptyString; } #endif // !__WXMAC__ diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index fadc4afd80..4fee19a527 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dataobj.cpp +// Name: src/x11/dataobj.cpp // Purpose: wxDataObject class // Author: Julian Smart // Id: $Id$ @@ -7,7 +7,8 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#include "wx/defs.h" +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" #if wxUSE_DATAOBJ @@ -101,7 +102,7 @@ wxString wxDataFormat::GetId() const #else char *t = XGetAtomName ((Display*) wxGetDisplay(), m_format); wxString ret = wxString::FromAscii( t ); - if (t) + if (t) XFree( t ); return ret; #endif @@ -130,7 +131,7 @@ void wxDataFormat::SetId( const wxChar *id ) PrepareFormats(); m_type = wxDF_PRIVATE; wxString tmp( id ); - m_format = XInternAtom( (Display*) wxGetDisplay(), tmp.ToAscii(), FALSE ); + m_format = XInternAtom( (Display*) wxGetDisplay(), tmp.ToAscii(), FALSE ); #endif } @@ -157,17 +158,17 @@ wxDataObject::wxDataObject() bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const { size_t nFormatCount = GetFormatCount(dir); - if ( nFormatCount == 1 ) + if ( nFormatCount == 1 ) { return format == GetPreferredFormat(); } - else + else { wxDataFormat *formats = new wxDataFormat[nFormatCount]; GetAllFormats(formats,dir); size_t n; - for ( n = 0; n < nFormatCount; n++ ) + for ( n = 0; n < nFormatCount; n++ ) { if ( formats[n] == format ) break; @@ -196,7 +197,7 @@ bool wxFileDataObject::GetDataHere(void *buf) const memcpy( buf, filenames.mbc_str(), filenames.Len() + 1 ); - return TRUE; + return true; } size_t wxFileDataObject::GetDataSize() const @@ -278,7 +279,7 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) } #endif // 0/1 - return TRUE; + return true; } void wxFileDataObject::AddFile( const wxString &filename ) @@ -323,12 +324,12 @@ bool wxBitmapDataObject::GetDataHere(void *buf) const { wxFAIL_MSG( wxT("attempt to copy empty bitmap failed") ); - return FALSE; + return false; } memcpy(buf, m_pngData, m_pngSize); - return TRUE; + return true; } bool wxBitmapDataObject::SetData(size_t size, const void *buf) @@ -346,14 +347,14 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) wxPNGHandler handler; if ( !handler.LoadFile( &image, mstream ) ) { - return FALSE; + return false; } m_bitmap = image; return m_bitmap.Ok(); #else - return FALSE; + return false; #endif } @@ -378,4 +379,3 @@ void wxBitmapDataObject::DoConvertToPng() } #endif // wxUSE_DATAOBJ - diff --git a/src/x11/dc.cpp b/src/x11/dc.cpp index f36c6febaf..e3f513a143 100644 --- a/src/x11/dc.cpp +++ b/src/x11/dc.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dc.cpp +// Name: src/x11/dc.cpp // Purpose: wxDC class // Author: Julian Smart // Modified by: @@ -9,9 +9,11 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/dc.h" #include "wx/dcmemory.h" -#include "wx/defs.h" IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) @@ -21,7 +23,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject) wxDC::wxDC() { - m_ok = FALSE; + m_ok = false; #if 1 m_mm_to_pix_x = 1.0; @@ -33,8 +35,8 @@ wxDC::wxDC() (double)wxGetDisplaySizeMM().GetHeight(); #endif - m_needComputeScaleX = FALSE; /* not used yet */ - m_needComputeScaleY = FALSE; /* not used yet */ + m_needComputeScaleX = false; /* not used yet */ + m_needComputeScaleY = false; /* not used yet */ m_logicalFunction = wxCOPY; @@ -44,12 +46,12 @@ wxDC::wxDC() m_backgroundMode = wxTRANSPARENT; - m_isInteractive = FALSE; // ??? + m_isInteractive = false; // ??? } void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) { - m_clipping = TRUE; + m_clipping = true; m_clipX1 = x; m_clipY1 = y; m_clipX2 = x + width; @@ -97,8 +99,8 @@ void wxDC::SetMapMode( int mode ) } if (mode != wxMM_TEXT) { - m_needComputeScaleX = TRUE; - m_needComputeScaleY = TRUE; + m_needComputeScaleX = true; + m_needComputeScaleY = true; } } @@ -185,4 +187,3 @@ void wxDC::ComputeScaleAndOrigin() m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleY = m_logicalScaleY * m_userScaleY; } - diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 08742ac42e..f982eb15fe 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -9,6 +9,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + // ============================================================================ // declarations // ============================================================================ @@ -26,7 +29,6 @@ #pragma message enable nosimpint #endif -#include "wx/defs.h" #include "wx/string.h" #include "wx/font.h" #include "wx/gdicmn.h" @@ -95,7 +97,7 @@ public: int family = wxDEFAULT, int style = wxDEFAULT, int weight = wxDEFAULT, - bool underlined = FALSE, + bool underlined = false, const wxString& faceName = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); @@ -118,7 +120,7 @@ public: void SetFaceName(const wxString& facename); void SetEncoding(wxFontEncoding encoding); - void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; } + void SetNoAntiAliasing( bool no = true ) { m_noAA = no; } bool GetNoAntiAliasing() const { return m_noAA; } // and this one also modifies all the other font data fields @@ -213,7 +215,7 @@ void wxFontRefData::Init(int pointSize, void wxFontRefData::InitFromNative() { - m_noAA = FALSE; + m_noAA = false; #if wxUSE_UNICODE // Get native info @@ -273,7 +275,7 @@ void wxFontRefData::InitFromNative() } // Pango description are never underlined (?) - m_underlined = FALSE; + m_underlined = false; // Cannot we choose that m_encoding = wxFONTENCODING_SYSTEM; @@ -343,7 +345,7 @@ void wxFontRefData::InitFromNative() } // X fonts are never underlined... - m_underlined = FALSE; + m_underlined = false; // deal with font encoding wxString @@ -550,7 +552,7 @@ bool wxFont::Create(int pointSize, m_refData = new wxFontRefData(pointSize, family, style, weight, underlined, faceName, encoding); - return TRUE; + return true; } #if !wxUSE_UNICODE @@ -560,7 +562,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) if( !fontname ) { *this = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT); - return TRUE; + return true; } m_refData = new wxFontRefData(); @@ -653,9 +655,9 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) } //else: unknown encoding - may be give a warning here? else - return FALSE; + return false; } - return TRUE; + return true; } #endif // !wxUSE_UNICODE @@ -695,7 +697,7 @@ int wxFont::GetPointSize() const wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxT(""), wxT("invalid font") ); + wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName; } @@ -723,7 +725,7 @@ int wxFont::GetWeight() const bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") ); + wxCHECK_MSG( Ok(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } @@ -757,13 +759,13 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), FALSE, wxT("invalid font") ); + wxCHECK_MSG( Ok(), false, wxT("invalid font") ); #if wxUSE_UNICODE return wxFontBase::IsFixedWidth(); #else // Robert, is this right? HasNativeFont doesn't exist. - if ( TRUE ) + if ( true ) // if ( M_FONTDATA->HasNativeFont() ) { // the monospace fonts are supposed to have "M" in the spacing field @@ -877,7 +879,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const if (xFontName == "-*-*-*-*-*--*-*-*-*-*-*-*-*") // wxFont constructor not called with native font info parameter => take M_FONTDATA values xFontName.Clear(); - + // not found, create a new one XFontStruct *font = (XFontStruct *) wxLoadQueryNearestFont(pointSize, diff --git a/src/x11/popupwin.cpp b/src/x11/popupwin.cpp index 45b3a278c6..125130fcd2 100644 --- a/src/x11/popupwin.cpp +++ b/src/x11/popupwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: popupwin.cpp +// Name: srx/x11/popupwin.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -7,11 +7,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/defs.h" -#include "wx/log.h" +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" #if wxUSE_POPUPWIN +#include "wx/log.h" + #include "wx/popupwin.h" #include "wx/app.h" #include "wx/settings.h" @@ -36,13 +38,13 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) if (!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") )) { wxFAIL_MSG( wxT("wxPopupWindow creation failed") ); - return FALSE; + return false; } // All dialogs should really have this style m_windowStyle = style; m_windowStyle |= wxTAB_TRAVERSAL; - + wxPoint pos( 20,20 ); wxSize size( 20,20 ); wxPoint pos2 = pos; @@ -56,74 +58,74 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) Visual *xvisual = DefaultVisual( xdisplay, xscreen ); Window xparent = RootWindow( xdisplay, xscreen ); Colormap cm = DefaultColormap( xdisplay, xscreen); - + #if wxUSE_TWO_WINDOWS - bool need_two_windows = + bool need_two_windows = ((( wxSUNKEN_BORDER | wxRAISED_BORDER | wxSIMPLE_BORDER | wxHSCROLL | wxVSCROLL ) & m_windowStyle) != 0); #else - bool need_two_windows = FALSE; + bool need_two_windows = false; #endif #if wxUSE_NANOX long xattributes_mask = 0; #else - + XSetWindowAttributes xattributes; long xattributes_mask = 0; m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); m_backgroundColour.CalcPixel( (WXColormap) cm); - + m_foregroundColour = *wxBLACK; m_foregroundColour.CalcPixel( (WXColormap) cm); - + xattributes_mask |= CWBackPixel; xattributes.background_pixel = m_backgroundColour.GetPixel(); - + xattributes_mask |= CWBorderPixel; xattributes.border_pixel = BlackPixel( xdisplay, xscreen ); - + xattributes_mask |= CWOverrideRedirect | CWSaveUnder; xattributes.override_redirect = True; xattributes.save_under = True; - + xattributes_mask |= CWEventMask; #endif - + if (need_two_windows) { #if !wxUSE_NANOX - xattributes.event_mask = + xattributes.event_mask = ExposureMask | StructureNotifyMask | ColormapChangeMask; #endif - - Window xwindow = XCreateWindow( xdisplay, xparent, pos.x, pos.y, size.x, size.y, + + Window xwindow = XCreateWindow( xdisplay, xparent, pos.x, pos.y, size.x, size.y, 0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes ); -#if wxUSE_NANOX +#if wxUSE_NANOX XSelectInput( xdisplay, xwindow, ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask | PropertyChangeMask ); #endif - + // Set background to None which will prevent X11 from clearing the // background comletely. XSetWindowBackgroundPixmap( xdisplay, xwindow, None ); - + m_mainWindow = (WXWindow) xwindow; wxAddWindowToTable( xwindow, (wxWindow*) this ); - + // XMapWindow( xdisplay, xwindow ); -#if !wxUSE_NANOX - xattributes.event_mask = +#if !wxUSE_NANOX + xattributes.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask | PropertyChangeMask | VisibilityChangeMask ; #endif - + if (HasFlag( wxSUNKEN_BORDER) || HasFlag( wxRAISED_BORDER)) { pos2.x = 2; @@ -142,40 +144,40 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) pos2.x = 0; pos2.y = 0; } - - xwindow = XCreateWindow( xdisplay, xwindow, pos2.x, pos2.y, size2.x, size2.y, + + xwindow = XCreateWindow( xdisplay, xwindow, pos2.x, pos2.y, size2.x, size2.y, 0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes ); - + // Set background to None which will prevent X11 from clearing the // background comletely. XSetWindowBackgroundPixmap( xdisplay, xwindow, None ); - -#if wxUSE_NANOX + +#if wxUSE_NANOX XSelectInput( xdisplay, xwindow, ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask | PropertyChangeMask ); #endif - + m_clientWindow = (WXWindow) xwindow; wxAddClientWindowToTable( xwindow, (wxWindow*) this ); - - m_isShown = FALSE; + + m_isShown = false; XMapWindow( xdisplay, xwindow ); } else { // One window #if !wxUSE_NANOX - xattributes.event_mask = + xattributes.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask | KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask | PropertyChangeMask | VisibilityChangeMask ; #endif - - Window xwindow = XCreateWindow( xdisplay, xparent, pos.x, pos.y, size.x, size.y, + + Window xwindow = XCreateWindow( xdisplay, xparent, pos.x, pos.y, size.x, size.y, 0, DefaultDepth(xdisplay,xscreen), InputOutput, xvisual, xattributes_mask, &xattributes ); #if wxUSE_NANOX @@ -185,16 +187,16 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask | PropertyChangeMask ); #endif - + // Set background to None which will prevent X11 from clearing the // background comletely. XSetWindowBackgroundPixmap( xdisplay, xwindow, None ); - + m_mainWindow = (WXWindow) xwindow; m_clientWindow = (WXWindow) xwindow; wxAddWindowToTable( xwindow, (wxWindow*) this ); - - m_isShown = FALSE; + + m_isShown = false; // XMapWindow( xdisplay, xwindow ); } @@ -210,8 +212,8 @@ bool wxPopupWindow::Create( wxWindow *parent, int style ) wm_hints.initial_state = NormalState; XSetWMHints( xdisplay, (Window) m_mainWindow, &wm_hints); #endif - - return TRUE; + + return true; } void wxPopupWindow::DoMoveWindow(int x, int y, int width, int height ) @@ -229,7 +231,7 @@ bool wxPopupWindow::Show( bool show ) bool ret = wxWindowX11::Show( show ); Raise(); - + return ret; } -- 2.45.2