wxNotebookPageInfo() { m_page = NULL ; m_imageId = -1 ; m_selected = false ; }
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 ; }
wxNotebookPage* GetPage() const { return m_page ; }
wxString GetText() const { return m_text ; }
bool InsertPage(size_t nPage,
wxNotebookPage *pPage,
const wxString& strText,
- bool bSelect = FALSE,
+ bool bSelect = false,
int imageId = -1);
void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; }
virtual bool MSWTranslateMessage(WXMSG *wxmsg);
#if wxUSE_CONSTRAINTS
- virtual void SetConstraintSizes(bool recurse = TRUE);
+ virtual void SetConstraintSizes(bool recurse = true);
virtual bool DoPhase(int nPhase);
#endif // wxUSE_CONSTRAINTS
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PALETTE_H_
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); }
void SetHPALETTE(WXHPALETTE pal);
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PEN_H_
// Internal
bool RealizeResource();
- bool FreeResource(bool force = FALSE);
+ bool FreeResource(bool force = false);
WXHANDLE GetResourceHandle() const;
bool IsFree() const;
void Unshare();
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
- virtual bool Show(bool show = TRUE);
+ virtual bool Show(bool show = true);
protected:
// popups handle the position like wxTopLevelWindow, not wxWindow
virtual bool Print(wxWindow *parent,
wxPrintout *printout,
- bool prompt = TRUE);
+ bool prompt = true);
virtual wxDC* PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent);
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
#define CHECK_CLASS wxT("BUTTON")
#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_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
#define RADIO_SIZE 20
-#define RADIO_IS_FAFA FALSE
+#define RADIO_IS_FAFA FALSE
#define PURE_WINDOWS
#define GROUP_CLASS wxT("BUTTON")
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
(DLGPROC) wxDlgProc);
if ( !m_hWnd )
- return FALSE;
+ return false;
SubclassWin(GetHWND());
CreateWindowFromHWND(this, (WXHWND) hWndNext);
}
- return TRUE;
+ return true;
}
bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
(DLGPROC)wxDlgProc);
if ( !m_hWnd )
- return FALSE;
+ return false;
SubclassWin(GetHWND());
CreateWindowFromHWND(this, (WXHWND) hWndNext);
}
- return TRUE;
+ return true;
}
// ---------------------------------------------------------------------------
wxLogError(wxT("Please make SS_BITMAP statics into owner-draw buttons."));
}
#endif
-#endif /* wxUSE_STATBMP */
+#endif /* wxUSE_STATBMP */
}
#endif
else
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
-
+
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
wxBEGIN_HANDLERS_TABLE(wxNotebook)
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_HANDLERS_TABLE(wxNotebookPageInfo)
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
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
{
if (style & wxNB_BOTTOM)
style &= ~wxNB_BOTTOM;
-
+
if (style & wxNB_LEFT)
style &= ~wxNB_LEFT;
-
+
if (style & wxNB_RIGHT)
style &= ~wxNB_RIGHT;
}
-
+
if ( !CreateControl(parent, id, pos, size, style | wxTAB_TRAVERSAL,
wxDefaultValidator, name) )
return false;
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 )
{
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
{
wxSize sizeTotal = sizePage;
-
+
// We need to make getting tab size part of the wxWidgets API.
wxSize tabSize(0, 0);
if (GetPageCount() > 0)
if (selNew != -1)
{
// No selection change, just refresh the current selection.
- // Because it could be that the slection index changed
- // we need to update it.
+ // Because it could be that the slection index changed
+ // we need to update it.
// Note: this does not mean the selection it self changed.
m_nSelection = selNew;
m_pages[m_nSelection]->Refresh();
else if (int(nPage) == m_nSelection)
{
// The selection was deleted.
-
+
// Determine new selection.
if (m_nSelection == int(GetPageCount()))
selNew = m_nSelection - 1;
else
selNew = m_nSelection;
-
+
// m_nSelection must be always valid so reset it before calling
// SetSelection()
m_nSelection = -1;
if (!g_TestedForTheme)
{
int commCtrlVersion = wxTheApp->GetComCtl32Version() ;
-
+
g_UseTheme = (commCtrlVersion >= 600);
g_TestedForTheme = true;
}
-
+
// Automatically apply the theme background,
// changing the colour of the panel to match the
// tab page colour. This won't work well with all
#if wxUSE_UXTHEME
window->ApplyParentThemeBackground(colour);
-
+
for ( wxWindowList::compatibility_iterator node = window->GetChildren().GetFirst(); node; node = node->GetNext() )
{
wxWindow *child = node->GetData();
}
m_bCheckable = bCheckable;
- m_bOwnerDrawn = FALSE;
+ m_bOwnerDrawn = false;
m_nHeight = 0;
m_nMarginWidth = ms_nLastMarginWidth;
m_nMinHeight = wxMSWSystemMenuFontModule::ms_systemMenuHeight;
// remember height for use in OnDrawItem
m_nHeight = *pheight;
- return TRUE;
+ return true;
}
// draw the item
{
// we do nothing on focus change
if ( act == wxODFocusChanged )
- return TRUE;
+ return true;
// this flag determines whether or not an edge will
dc.Blit(rc.x + (margin - nBmpWidth) / 2,
rc.y + heightDiff / 2,
nBmpWidth, nBmpHeight,
- &dcMem, 0, 0, wxCOPY, TRUE /* use mask */);
+ &dcMem, 0, 0, wxCOPY, true /* use mask */);
if ( st & wxODSelected && draw_bitmap_edge ) {
RECT rectBmp = { rc.GetLeft(), rc.GetTop(),
::SetTextColor(hdc, colOldText);
::SetBkColor(hdc, colOldBack);
- return TRUE;
+ return true;
}
wxPalette::~wxPalette(void)
{
-// FreeResource(TRUE);
+// FreeResource(true);
}
bool wxPalette::FreeResource(bool WXUNUSED(force))
{
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)
#if defined(__WXMICROWIN__)
- return (FALSE);
+ return false;
#else
NPLOGPALETTE npPal = (NPLOGPALETTE)LocalAlloc(LMEM_FIXED, sizeof(LOGPALETTE) +
(WORD)n * sizeof(PALETTEENTRY));
if (!npPal)
- return(FALSE);
+ return false;
npPal->palVersion = 0x300;
npPal->palNumEntries = n;
}
M_PALETTEDATA->m_hPalette = (WXHPALETTE) CreatePalette((LPLOGPALETTE)npPal);
LocalFree((HANDLE)npPal);
- return TRUE;
+ return true;
#endif
}
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
{
#ifdef __WXMICROWIN__
- return FALSE;
+ return 0;
#else
if ( !m_refData )
- return FALSE;
+ return 0;
return ::GetNearestPaletteIndex((HPALETTE) M_PALETTEDATA->m_hPalette, PALETTERGB(red, green, blue));
#endif
bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const
{
#ifdef __WXMICROWIN__
- return FALSE;
+ return false;
#else
if ( !m_refData )
- return FALSE;
+ return false;
if (index < 0 || index > 255)
- return FALSE;
+ return false;
PALETTEENTRY entry;
if (::GetPaletteEntries((HPALETTE) M_PALETTEDATA->m_hPalette, index, 1, &entry))
*red = entry.peRed;
*green = entry.peGreen;
*blue = entry.peBlue;
- return TRUE;
+ return true;
} else
- return FALSE;
+ return false;
#endif
}
if (M_PENDATA->m_style==wxTRANSPARENT)
{
M_PENDATA->m_hPen = (WXHPEN) ::GetStockObject(NULL_PEN);
- return TRUE;
+ return true;
}
COLORREF ms_colour = M_PENDATA->m_colour.GetPixel();
if (M_PENDATA->m_hPen==0)
wxError("Cannot create pen","Internal error") ;
#endif
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
WXHANDLE wxPen::GetResourceHandle() const
{
DeleteObject((HPEN) M_PENDATA->m_hPen);
M_PENDATA->m_hPen = 0;
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
bool wxPen::IsFree() const
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
if (hook)
{
if (g_hPenWin)
- return;
+ return;
///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, register this app so all
// EDIT controls in dialogs are replaced by HEDIT controls.
if ((g_hPenWin = (HANDLE)GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL)
- {
- // We do this fancy GetProcAddress simply because we don't
- // know if we're running Pen Windows.
- if ((RegPenApp = (PENREGPROC)GetProcAddress (g_hPenWin, "RegisterPenApp")) != NULL)
- (*RegPenApp) (RPA_DEFAULT, TRUE);
- }
+ {
+ // We do this fancy GetProcAddress simply because we don't
+ // know if we're running Pen Windows.
+ if ((RegPenApp = (PENREGPROC)GetProcAddress (g_hPenWin, "RegisterPenApp")) != NULL)
+ (*RegPenApp) (RPA_DEFAULT, TRUE);
+ }
}
else
{
///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, unregister
if (g_hPenWin)
- {
- // Unregister this app
- if (RegPenApp != NULL)
- (*RegPenApp) (RPA_DEFAULT, FALSE);
- g_hPenWin = (HANDLE) NULL;
- }
+ {
+ // Unregister this app
+ if (RegPenApp != NULL)
+ (*RegPenApp) (RPA_DEFAULT, FALSE);
+ g_hPenWin = (HANDLE) NULL;
+ }
}
-#endif /* ! Windows-NT */
+#endif /* ! Windows-NT */
}
#endif
if (g_hPenWin) {
// Unregister this app
if (RegPenApp != NULL)
- (*RegPenApp)(RPA_DEFAULT, FALSE);
+ (*RegPenApp)(RPA_DEFAULT, FALSE);
}
#endif
}
Hide();
return wxPopupWindowBase::Create(parent) &&
- wxWindow::Create(parent, -1,
+ wxWindow::Create(parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
flags | wxPOPUP_WINDOW);
}
bool wxPopupWindow::Show(bool show)
{
if ( !wxWindowMSW::Show(show) )
- return FALSE;
+ return false;
if ( show )
{
}
}
- return TRUE;
+ return true;
}
#endif // #if wxUSE_POPUPWIN
{
m_dialogParent = NULL;
m_printerDC = NULL;
- m_destroyDC = TRUE;
+ m_destroyDC = true;
}
wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data)
{
m_dialogParent = p;
m_printerDC = NULL;
- m_destroyDC = TRUE;
+ m_destroyDC = true;
if ( data )
m_printDialogData = *data;
m_printDialogData.SetOwnerWindow(p);
- return TRUE;
+ return true;
}
wxPrintDialog::~wxPrintDialog()
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);
m_printerDC = pdc;
{
if (m_printerDC)
{
- m_destroyDC = FALSE;
+ m_destroyDC = false;
return m_printerDC;
}
else
#if defined(__WIN95__)
m_pageSetupData.SetOwnerWindow(p);
#endif
- return TRUE;
+ return true;
}
wxPageSetupDialog::~wxPageSetupDialog()
wxGenericPageSetupDialog *genericPageSetupDialog = new wxGenericPageSetupDialog(GetParent(), & m_pageSetupData);
int ret = genericPageSetupDialog->ShowModal();
m_pageSetupData = genericPageSetupDialog->GetPageSetupData();
- genericPageSetupDialog->Close(TRUE);
+ genericPageSetupDialog->Close(true);
return ret;
#endif
}
/* 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)) {
TranslateMessage(&msg);
DispatchMessage(&msg);