Source cleaning: -1/wxID_ANY/wxNOT_FOUND, ::, TRUE/true, FALSE/false, whitespaces, tabs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-08-31 12:38:46 +00:00
parent f50ff87bdb
commit 078cf5cb75
15 changed files with 80 additions and 80 deletions

View File

@@ -33,7 +33,7 @@ public :
wxNotebookPageInfo() { m_page = NULL ; m_imageId = -1 ; m_selected = false ; } wxNotebookPageInfo() { m_page = NULL ; m_imageId = -1 ; m_selected = false ; }
virtual ~wxNotebookPageInfo() { } virtual ~wxNotebookPageInfo() { }
void Create( wxNotebookPage *page , const wxString &text , bool selected , int imageId ) void Create( wxNotebookPage *page , const wxString &text , bool selected , int imageId )
{ m_page = page ; m_text = text ; m_selected = selected ; m_imageId = imageId ; } { m_page = page ; m_text = text ; m_selected = selected ; m_imageId = imageId ; }
wxNotebookPage* GetPage() const { return m_page ; } wxNotebookPage* GetPage() const { return m_page ; }
wxString GetText() const { return m_text ; } wxString GetText() const { return m_text ; }
@@ -124,7 +124,7 @@ public:
bool InsertPage(size_t nPage, bool InsertPage(size_t nPage,
wxNotebookPage *pPage, wxNotebookPage *pPage,
const wxString& strText, const wxString& strText,
bool bSelect = FALSE, bool bSelect = false,
int imageId = -1); int imageId = -1);
void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; } void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; }
@@ -158,7 +158,7 @@ public:
virtual bool MSWTranslateMessage(WXMSG *wxmsg); virtual bool MSWTranslateMessage(WXMSG *wxmsg);
#if wxUSE_CONSTRAINTS #if wxUSE_CONSTRAINTS
virtual void SetConstraintSizes(bool recurse = TRUE); virtual void SetConstraintSizes(bool recurse = true);
virtual bool DoPhase(int nPhase); virtual bool DoPhase(int nPhase);
#endif // wxUSE_CONSTRAINTS #endif // wxUSE_CONSTRAINTS

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97 // Created: 01/02/97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart // Copyright: (c) Julian Smart
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PALETTE_H_ #ifndef _WX_PALETTE_H_
@@ -52,7 +52,7 @@ public:
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
virtual bool FreeResource(bool force = FALSE); virtual bool FreeResource(bool force = false);
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
void SetHPALETTE(WXHPALETTE pal); void SetHPALETTE(WXHPALETTE pal);

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97 // Created: 01/02/97
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart // Copyright: (c) Julian Smart
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PEN_H_ #ifndef _WX_PEN_H_
@@ -132,7 +132,7 @@ public:
// Internal // Internal
bool RealizeResource(); bool RealizeResource();
bool FreeResource(bool force = FALSE); bool FreeResource(bool force = false);
WXHANDLE GetResourceHandle() const; WXHANDLE GetResourceHandle() const;
bool IsFree() const; bool IsFree() const;
void Unshare(); void Unshare();

View File

@@ -30,7 +30,7 @@ public:
bool Create(wxWindow *parent, int flags = wxBORDER_NONE); bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = true);
protected: protected:
// popups handle the position like wxTopLevelWindow, not wxWindow // popups handle the position like wxTopLevelWindow, not wxWindow

View File

@@ -32,7 +32,7 @@ public:
virtual bool Print(wxWindow *parent, virtual bool Print(wxWindow *parent,
wxPrintout *printout, wxPrintout *printout,
bool prompt = TRUE); bool prompt = true);
virtual wxDC* PrintDialog(wxWindow *parent); virtual wxDC* PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent); virtual bool Setup(wxWindow *parent);

View File

@@ -138,11 +138,11 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE) #define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
#define CHECK_CLASS wxT("BUTTON") #define CHECK_CLASS wxT("BUTTON")
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD) #define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
#define CHECK_IS_FAFA FALSE #define CHECK_IS_FAFA FALSE
#define RADIO_CLASS wxT("BUTTON") #define RADIO_CLASS wxT("BUTTON")
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE) #define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
#define RADIO_SIZE 20 #define RADIO_SIZE 20
#define RADIO_IS_FAFA FALSE #define RADIO_IS_FAFA FALSE
#define PURE_WINDOWS #define PURE_WINDOWS
#define GROUP_CLASS wxT("BUTTON") #define GROUP_CLASS wxT("BUTTON")
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE) #define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)

View File

@@ -61,7 +61,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
(DLGPROC) wxDlgProc); (DLGPROC) wxDlgProc);
if ( !m_hWnd ) if ( !m_hWnd )
return FALSE; return false;
SubclassWin(GetHWND()); SubclassWin(GetHWND());
@@ -84,7 +84,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
CreateWindowFromHWND(this, (WXHWND) hWndNext); CreateWindowFromHWND(this, (WXHWND) hWndNext);
} }
return TRUE; return true;
} }
bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name) bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
@@ -98,7 +98,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
(DLGPROC)wxDlgProc); (DLGPROC)wxDlgProc);
if ( !m_hWnd ) if ( !m_hWnd )
return FALSE; return false;
SubclassWin(GetHWND()); SubclassWin(GetHWND());
@@ -121,7 +121,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
CreateWindowFromHWND(this, (WXHWND) hWndNext); CreateWindowFromHWND(this, (WXHWND) hWndNext);
} }
return TRUE; return true;
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -305,7 +305,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
wxLogError(wxT("Please make SS_BITMAP statics into owner-draw buttons.")); wxLogError(wxT("Please make SS_BITMAP statics into owner-draw buttons."));
} }
#endif #endif
#endif /* wxUSE_STATBMP */ #endif /* wxUSE_STATBMP */
} }
#endif #endif
else else

View File

@@ -126,7 +126,7 @@ wxBEGIN_FLAGS( wxNotebookStyle )
wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE) wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags // old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER)
@@ -173,7 +173,7 @@ wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxNotebook) wxBEGIN_HANDLERS_TABLE(wxNotebook)
wxEND_HANDLERS_TABLE() wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_5( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle) wxCONSTRUCTOR_5( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo) wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo)
@@ -186,7 +186,7 @@ wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxNotebookPageInfo) wxBEGIN_HANDLERS_TABLE(wxNotebookPageInfo)
wxEND_HANDLERS_TABLE() wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId ) wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId )
#else #else
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
@@ -255,14 +255,14 @@ bool wxNotebook::Create(wxWindow *parent,
{ {
if (style & wxNB_BOTTOM) if (style & wxNB_BOTTOM)
style &= ~wxNB_BOTTOM; style &= ~wxNB_BOTTOM;
if (style & wxNB_LEFT) if (style & wxNB_LEFT)
style &= ~wxNB_LEFT; style &= ~wxNB_LEFT;
if (style & wxNB_RIGHT) if (style & wxNB_RIGHT)
style &= ~wxNB_RIGHT; style &= ~wxNB_RIGHT;
} }
if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL, if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL,
wxDefaultValidator, name) ) wxDefaultValidator, name) )
return false; return false;
@@ -323,7 +323,7 @@ int wxNotebook::GetRowCount() const
int wxNotebook::SetSelection(size_t nPage) int wxNotebook::SetSelection(size_t nPage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
if ( int(nPage) != m_nSelection ) if ( int(nPage) != m_nSelection )
{ {
@@ -437,7 +437,7 @@ void wxNotebook::SetTabSize(const wxSize& sz)
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
{ {
wxSize sizeTotal = sizePage; wxSize sizeTotal = sizePage;
// We need to make getting tab size part of the wxWidgets API. // We need to make getting tab size part of the wxWidgets API.
wxSize tabSize(0, 0); wxSize tabSize(0, 0);
if (GetPageCount() > 0) if (GetPageCount() > 0)
@@ -509,8 +509,8 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
if (selNew != -1) if (selNew != -1)
{ {
// No selection change, just refresh the current selection. // No selection change, just refresh the current selection.
// Because it could be that the slection index changed // Because it could be that the slection index changed
// we need to update it. // we need to update it.
// Note: this does not mean the selection it self changed. // Note: this does not mean the selection it self changed.
m_nSelection = selNew; m_nSelection = selNew;
m_pages[m_nSelection]->Refresh(); m_pages[m_nSelection]->Refresh();
@@ -518,13 +518,13 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
else if (int(nPage) == m_nSelection) else if (int(nPage) == m_nSelection)
{ {
// The selection was deleted. // The selection was deleted.
// Determine new selection. // Determine new selection.
if (m_nSelection == int(GetPageCount())) if (m_nSelection == int(GetPageCount()))
selNew = m_nSelection - 1; selNew = m_nSelection - 1;
else else
selNew = m_nSelection; selNew = m_nSelection;
// m_nSelection must be always valid so reset it before calling // m_nSelection must be always valid so reset it before calling
// SetSelection() // SetSelection()
m_nSelection = -1; m_nSelection = -1;
@@ -577,11 +577,11 @@ bool wxNotebook::InsertPage(size_t nPage,
if (!g_TestedForTheme) if (!g_TestedForTheme)
{ {
int commCtrlVersion = wxTheApp->GetComCtl32Version() ; int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
g_UseTheme = (commCtrlVersion >= 600); g_UseTheme = (commCtrlVersion >= 600);
g_TestedForTheme = true; g_TestedForTheme = true;
} }
// Automatically apply the theme background, // Automatically apply the theme background,
// changing the colour of the panel to match the // changing the colour of the panel to match the
// tab page colour. This won't work well with all // tab page colour. This won't work well with all
@@ -998,7 +998,7 @@ void wxNotebook::ApplyThemeBackground(wxWindow*, const wxColour&)
#if wxUSE_UXTHEME #if wxUSE_UXTHEME
window->ApplyParentThemeBackground(colour); window->ApplyParentThemeBackground(colour);
for ( wxWindowList::compatibility_iterator node = window->GetChildren().GetFirst(); node; node = node->GetNext() ) for ( wxWindowList::compatibility_iterator node = window->GetChildren().GetFirst(); node; node = node->GetNext() )
{ {
wxWindow *child = node->GetData(); wxWindow *child = node->GetData();

View File

@@ -121,7 +121,7 @@ wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
} }
m_bCheckable = bCheckable; m_bCheckable = bCheckable;
m_bOwnerDrawn = FALSE; m_bOwnerDrawn = false;
m_nHeight = 0; m_nHeight = 0;
m_nMarginWidth = ms_nLastMarginWidth; m_nMarginWidth = ms_nLastMarginWidth;
m_nMinHeight = wxMSWSystemMenuFontModule::ms_systemMenuHeight; m_nMinHeight = wxMSWSystemMenuFontModule::ms_systemMenuHeight;
@@ -192,7 +192,7 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
// remember height for use in OnDrawItem // remember height for use in OnDrawItem
m_nHeight = *pheight; m_nHeight = *pheight;
return TRUE; return true;
} }
// draw the item // draw the item
@@ -203,7 +203,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
{ {
// we do nothing on focus change // we do nothing on focus change
if ( act == wxODFocusChanged ) if ( act == wxODFocusChanged )
return TRUE; return true;
// this flag determines whether or not an edge will // this flag determines whether or not an edge will
@@ -386,7 +386,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
dc.Blit(rc.x + (margin - nBmpWidth) / 2, dc.Blit(rc.x + (margin - nBmpWidth) / 2,
rc.y + heightDiff / 2, rc.y + heightDiff / 2,
nBmpWidth, nBmpHeight, nBmpWidth, nBmpHeight,
&dcMem, 0, 0, wxCOPY, TRUE /* use mask */); &dcMem, 0, 0, wxCOPY, true /* use mask */);
if ( st & wxODSelected && draw_bitmap_edge ) { if ( st & wxODSelected && draw_bitmap_edge ) {
RECT rectBmp = { rc.GetLeft(), rc.GetTop(), RECT rectBmp = { rc.GetLeft(), rc.GetTop(),
@@ -402,7 +402,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
::SetTextColor(hdc, colOldText); ::SetTextColor(hdc, colOldText);
::SetBkColor(hdc, colOldBack); ::SetBkColor(hdc, colOldBack);
return TRUE; return true;
} }

View File

@@ -57,7 +57,7 @@ wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green
wxPalette::~wxPalette(void) wxPalette::~wxPalette(void)
{ {
// FreeResource(TRUE); // FreeResource(true);
} }
bool wxPalette::FreeResource(bool WXUNUSED(force)) bool wxPalette::FreeResource(bool WXUNUSED(force))
@@ -66,7 +66,7 @@ bool wxPalette::FreeResource(bool WXUNUSED(force))
{ {
DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette); DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette);
} }
return TRUE; return true;
} }
bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
@@ -75,7 +75,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
#if defined(__WXMICROWIN__) #if defined(__WXMICROWIN__)
return (FALSE); return false;
#else #else
@@ -84,7 +84,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
NPLOGPALETTE npPal = (NPLOGPALETTE)LocalAlloc(LMEM_FIXED, sizeof(LOGPALETTE) + NPLOGPALETTE npPal = (NPLOGPALETTE)LocalAlloc(LMEM_FIXED, sizeof(LOGPALETTE) +
(WORD)n * sizeof(PALETTEENTRY)); (WORD)n * sizeof(PALETTEENTRY));
if (!npPal) if (!npPal)
return(FALSE); return false;
npPal->palVersion = 0x300; npPal->palVersion = 0x300;
npPal->palNumEntries = n; npPal->palNumEntries = n;
@@ -99,7 +99,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
} }
M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal); M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal);
LocalFree((HANDLE)npPal); LocalFree((HANDLE)npPal);
return TRUE; return true;
#endif #endif
} }
@@ -107,10 +107,10 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
{ {
#ifdef __WXMICROWIN__ #ifdef __WXMICROWIN__
return FALSE; return 0;
#else #else
if ( !m_refData ) if ( !m_refData )
return FALSE; return 0;
return ::GetNearestPaletteIndex((HPALETTE) M_PALETTEDATA->m_hPalette, PALETTERGB(red, green, blue)); return ::GetNearestPaletteIndex((HPALETTE) M_PALETTEDATA->m_hPalette, PALETTERGB(red, green, blue));
#endif #endif
@@ -119,13 +119,13 @@ int wxPalette::GetPixel(const unsigned char red, const unsigned char green, cons
bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const
{ {
#ifdef __WXMICROWIN__ #ifdef __WXMICROWIN__
return FALSE; return false;
#else #else
if ( !m_refData ) if ( !m_refData )
return FALSE; return false;
if (index < 0 || index > 255) if (index < 0 || index > 255)
return FALSE; return false;
PALETTEENTRY entry; PALETTEENTRY entry;
if (::GetPaletteEntries((HPALETTE) M_PALETTEDATA->m_hPalette, index, 1, &entry)) if (::GetPaletteEntries((HPALETTE) M_PALETTEDATA->m_hPalette, index, 1, &entry))
@@ -133,9 +133,9 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
*red = entry.peRed; *red = entry.peRed;
*green = entry.peGreen; *green = entry.peGreen;
*blue = entry.peBlue; *blue = entry.peBlue;
return TRUE; return true;
} else } else
return FALSE; return false;
#endif #endif
} }

View File

@@ -141,7 +141,7 @@ bool wxPen::RealizeResource()
if (M_PENDATA->m_style==wxTRANSPARENT) if (M_PENDATA->m_style==wxTRANSPARENT)
{ {
M_PENDATA->m_hPen = (WXHPEN) ::GetStockObject(NULL_PEN); M_PENDATA->m_hPen = (WXHPEN) ::GetStockObject(NULL_PEN);
return TRUE; return true;
} }
COLORREF ms_colour = M_PENDATA->m_colour.GetPixel(); COLORREF ms_colour = M_PENDATA->m_colour.GetPixel();
@@ -274,9 +274,9 @@ bool wxPen::RealizeResource()
if (M_PENDATA->m_hPen==0) if (M_PENDATA->m_hPen==0)
wxError("Cannot create pen","Internal error") ; wxError("Cannot create pen","Internal error") ;
#endif #endif
return TRUE; return true;
} }
return FALSE; return false;
} }
WXHANDLE wxPen::GetResourceHandle() const WXHANDLE wxPen::GetResourceHandle() const
@@ -293,9 +293,9 @@ bool wxPen::FreeResource(bool WXUNUSED(force))
{ {
DeleteObject((HPEN) M_PENDATA->m_hPen); DeleteObject((HPEN) M_PENDATA->m_hPen);
M_PENDATA->m_hPen = 0; M_PENDATA->m_hPen = 0;
return TRUE; return true;
} }
else return FALSE; else return false;
} }
bool wxPen::IsFree() const bool wxPen::IsFree() const

View File

@@ -6,7 +6,7 @@
// Created: 04/01/98 // Created: 04/01/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Julian Smart // Copyright: (c) Julian Smart
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
@@ -57,32 +57,32 @@ void wxEnablePenAppHooks (bool hook)
if (hook) if (hook)
{ {
if (g_hPenWin) if (g_hPenWin)
return; return;
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, register this app so all // If running on a Pen Windows system, register this app so all
// EDIT controls in dialogs are replaced by HEDIT controls. // EDIT controls in dialogs are replaced by HEDIT controls.
if ((g_hPenWin = (HANDLE)GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL) if ((g_hPenWin = (HANDLE)GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL)
{ {
// We do this fancy GetProcAddress simply because we don't // We do this fancy GetProcAddress simply because we don't
// know if we're running Pen Windows. // know if we're running Pen Windows.
if ((RegPenApp = (PENREGPROC)GetProcAddress (g_hPenWin, "RegisterPenApp")) != NULL) if ((RegPenApp = (PENREGPROC)GetProcAddress (g_hPenWin, "RegisterPenApp")) != NULL)
(*RegPenApp) (RPA_DEFAULT, TRUE); (*RegPenApp) (RPA_DEFAULT, TRUE);
} }
} }
else else
{ {
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, unregister // If running on a Pen Windows system, unregister
if (g_hPenWin) if (g_hPenWin)
{ {
// Unregister this app // Unregister this app
if (RegPenApp != NULL) if (RegPenApp != NULL)
(*RegPenApp) (RPA_DEFAULT, FALSE); (*RegPenApp) (RPA_DEFAULT, FALSE);
g_hPenWin = (HANDLE) NULL; g_hPenWin = (HANDLE) NULL;
} }
} }
#endif /* ! Windows-NT */ #endif /* ! Windows-NT */
} }
#endif #endif
@@ -113,7 +113,7 @@ void wxCleanUpPenWin(void)
if (g_hPenWin) { if (g_hPenWin) {
// Unregister this app // Unregister this app
if (RegPenApp != NULL) if (RegPenApp != NULL)
(*RegPenApp)(RPA_DEFAULT, FALSE); (*RegPenApp)(RPA_DEFAULT, FALSE);
} }
#endif #endif
} }

View File

@@ -50,7 +50,7 @@ bool wxPopupWindow::Create(wxWindow *parent, int flags)
Hide(); Hide();
return wxPopupWindowBase::Create(parent) && return wxPopupWindowBase::Create(parent) &&
wxWindow::Create(parent, -1, wxWindow::Create(parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
flags | wxPOPUP_WINDOW); flags | wxPOPUP_WINDOW);
} }
@@ -100,7 +100,7 @@ WXHWND wxPopupWindow::MSWGetParent() const
bool wxPopupWindow::Show(bool show) bool wxPopupWindow::Show(bool show)
{ {
if ( !wxWindowMSW::Show(show) ) if ( !wxWindowMSW::Show(show) )
return FALSE; return false;
if ( show ) if ( show )
{ {
@@ -111,7 +111,7 @@ bool wxPopupWindow::Show(bool show)
} }
} }
return TRUE; return true;
} }
#endif // #if wxUSE_POPUPWIN #endif // #if wxUSE_POPUPWIN

View File

@@ -68,7 +68,7 @@ wxPrintDialog::wxPrintDialog()
{ {
m_dialogParent = NULL; m_dialogParent = NULL;
m_printerDC = NULL; m_printerDC = NULL;
m_destroyDC = TRUE; m_destroyDC = true;
} }
wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data) wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data)
@@ -89,14 +89,14 @@ bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data)
{ {
m_dialogParent = p; m_dialogParent = p;
m_printerDC = NULL; m_printerDC = NULL;
m_destroyDC = TRUE; m_destroyDC = true;
if ( data ) if ( data )
m_printDialogData = *data; m_printDialogData = *data;
m_printDialogData.SetOwnerWindow(p); m_printDialogData.SetOwnerWindow(p);
return TRUE; return true;
} }
wxPrintDialog::~wxPrintDialog() wxPrintDialog::~wxPrintDialog()
@@ -121,7 +121,7 @@ int wxPrintDialog::ShowModal()
p->hwndOwner = 0; p->hwndOwner = 0;
if ( ret != FALSE && ((PRINTDLG *)m_printDialogData.GetNativeData())->hDC) if ( ret != false && ((PRINTDLG *)m_printDialogData.GetNativeData())->hDC)
{ {
wxPrinterDC *pdc = new wxPrinterDC((WXHDC) ((PRINTDLG *)m_printDialogData.GetNativeData())->hDC); wxPrinterDC *pdc = new wxPrinterDC((WXHDC) ((PRINTDLG *)m_printDialogData.GetNativeData())->hDC);
m_printerDC = pdc; m_printerDC = pdc;
@@ -138,7 +138,7 @@ wxDC *wxPrintDialog::GetPrintDC()
{ {
if (m_printerDC) if (m_printerDC)
{ {
m_destroyDC = FALSE; m_destroyDC = false;
return m_printerDC; return m_printerDC;
} }
else else
@@ -169,7 +169,7 @@ bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data)
#if defined(__WIN95__) #if defined(__WIN95__)
m_pageSetupData.SetOwnerWindow(p); m_pageSetupData.SetOwnerWindow(p);
#endif #endif
return TRUE; return true;
} }
wxPageSetupDialog::~wxPageSetupDialog() wxPageSetupDialog::~wxPageSetupDialog()
@@ -200,7 +200,7 @@ int wxPageSetupDialog::ShowModal()
wxGenericPageSetupDialog *genericPageSetupDialog = new wxGenericPageSetupDialog(GetParent(), & m_pageSetupData); wxGenericPageSetupDialog *genericPageSetupDialog = new wxGenericPageSetupDialog(GetParent(), & m_pageSetupData);
int ret = genericPageSetupDialog->ShowModal(); int ret = genericPageSetupDialog->ShowModal();
m_pageSetupData = genericPageSetupDialog->GetPageSetupData(); m_pageSetupData = genericPageSetupDialog->GetPageSetupData();
genericPageSetupDialog->Close(TRUE); genericPageSetupDialog->Close(true);
return ret; return ret;
#endif #endif
} }

View File

@@ -417,7 +417,7 @@ LONG APIENTRY _EXPORT wxAbortProc(HDC WXUNUSED(hPr), int WXUNUSED(Code))
/* Process messages intended for the abort dialog box */ /* Process messages intended for the abort dialog box */
while (!wxPrinterBase::sm_abortIt && PeekMessage(&msg, 0, 0, 0, TRUE)) while (!wxPrinterBase::sm_abortIt && ::PeekMessage(&msg, 0, 0, 0, TRUE))
if (!IsDialogMessage((HWND) wxPrinterBase::sm_abortWindow->GetHWND(), &msg)) { if (!IsDialogMessage((HWND) wxPrinterBase::sm_abortWindow->GetHWND(), &msg)) {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);