Code cleaning: wxID_ANY, wxDefaultSize, wxDefaultPosition, true, false, wxEmptyString, tabs and white spaces.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-17 16:22:36 +00:00
parent f938940e09
commit ca65c0440a
76 changed files with 2347 additions and 2332 deletions

View File

@@ -81,13 +81,13 @@ public:
// should be used instead for them // should be used instead for them
// corresponds to wxCAL_NO_YEAR_CHANGE bit // corresponds to wxCAL_NO_YEAR_CHANGE bit
void EnableYearChange(bool enable = TRUE); void EnableYearChange(bool enable = true);
// corresponds to wxCAL_NO_MONTH_CHANGE bit // corresponds to wxCAL_NO_MONTH_CHANGE bit
void EnableMonthChange(bool enable = TRUE); void EnableMonthChange(bool enable = true);
// corresponds to wxCAL_SHOW_HOLIDAYS bit // corresponds to wxCAL_SHOW_HOLIDAYS bit
void EnableHolidayDisplay(bool display = TRUE); void EnableHolidayDisplay(bool display = true);
// customization // customization
// ------------- // -------------
@@ -159,8 +159,8 @@ public:
// ------------------------------- // -------------------------------
// forward these functions to all subcontrols // forward these functions to all subcontrols
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = true);
private: private:
// common part of all ctors // common part of all ctors
@@ -260,7 +260,7 @@ private:
// Set the flag for SetDate(): otherwise it would overwrite the year // Set the flag for SetDate(): otherwise it would overwrite the year
// typed in by the user // typed in by the user
void SetUserChangedYear() { m_userChangedYear = TRUE; } void SetUserChangedYear() { m_userChangedYear = true; }
// the subcontrols // the subcontrols
wxStaticText *m_staticMonth; wxStaticText *m_staticMonth;
@@ -298,7 +298,7 @@ private:
// the week day names // the week day names
wxString m_weekdays[7]; wxString m_weekdays[7];
// TRUE if SetDate() is being called as the result of changing the year in // true if SetDate() is being called as the result of changing the year in
// the year control // the year control
bool m_userChangedYear; bool m_userChangedYear;

View File

@@ -80,8 +80,8 @@ private:
m_yOld; m_yOld;
wxCaretTimer m_timer; wxCaretTimer m_timer;
bool m_blinkedOut, // TRUE => caret hidden right now bool m_blinkedOut, // true => caret hidden right now
m_hasFocus; // TRUE => our window has focus m_hasFocus; // true => our window has focus
}; };
#endif // _WX_CARET_H_ #endif // _WX_CARET_H_

View File

@@ -213,9 +213,9 @@ WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message,
const wxString& caption, const wxString& caption,
const wxArrayString& choices, const wxArrayString& choices,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE, bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -223,9 +223,9 @@ WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message,
const wxString& caption, const wxString& caption,
int n, const wxString *choices, int n, const wxString *choices,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE, bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -235,9 +235,9 @@ WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message,
const wxString& caption, const wxString& caption,
const wxArrayString& choices, const wxArrayString& choices,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE, bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -245,9 +245,9 @@ WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message,
const wxString& caption, const wxString& caption,
int n, const wxString *choices, int n, const wxString *choices,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE, bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -257,8 +257,9 @@ WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message,
const wxArrayString& choices, const wxArrayString& choices,
void **client_data, void **client_data,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, int x = wxDefaultPosition.x,
bool centre = TRUE, int y = wxDefaultPosition.y,
bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -267,8 +268,9 @@ WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message,
int n, const wxString *choices, int n, const wxString *choices,
void **client_data, void **client_data,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, int x = wxDefaultPosition.x,
bool centre = TRUE, int y = wxDefaultPosition.y,
bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -280,9 +282,9 @@ WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections,
const wxString& caption, const wxString& caption,
int n, const wxString *choices, int n, const wxString *choices,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE, bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);
@@ -291,9 +293,9 @@ WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections,
const wxString& caption, const wxString& caption,
const wxArrayString& choices, const wxArrayString& choices,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE, bool centre = true,
int width = wxCHOICE_WIDTH, int width = wxCHOICE_WIDTH,
int height = wxCHOICE_HEIGHT); int height = wxCHOICE_HEIGHT);

View File

@@ -47,9 +47,9 @@ public:
~wxPostScriptDC(); ~wxPostScriptDC();
#if WXWIN_COMPATIBILITY_2_2 #if WXWIN_COMPATIBILITY_2_2
wxPostScriptDC( const wxString &output, bool interactive = FALSE, wxWindow *parent = NULL ) wxPostScriptDC( const wxString &output, bool interactive = false, wxWindow *parent = NULL )
{ Create( output, interactive, parent ); } { Create( output, interactive, parent ); }
bool Create ( const wxString &output, bool interactive = FALSE, wxWindow *parent = NULL ); bool Create ( const wxString &output, bool interactive = false, wxWindow *parent = NULL );
#endif #endif
virtual bool Ok() const; virtual bool Ok() const;
@@ -75,12 +75,12 @@ public:
void DoDrawSpline(wxList *points); void DoDrawSpline(wxList *points);
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = FALSE, wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); wxCoord xsrcMask = wxDefaultPosition.x, wxCoord ysrcMask = wxDefaultPosition.y);
bool CanDrawBitmap() const { return TRUE; } bool CanDrawBitmap() const { return true; }
void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y ); void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask=FALSE ); void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false );
void DoDrawText(const wxString& text, wxCoord x, wxCoord y ); void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
@@ -104,7 +104,7 @@ public:
wxCoord GetCharHeight() const; wxCoord GetCharHeight() const;
wxCoord GetCharWidth() const; wxCoord GetCharWidth() const;
bool CanGetTextExtent() const { return TRUE; } bool CanGetTextExtent() const { return true; }
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
wxCoord *descent = (wxCoord *) NULL, wxCoord *descent = (wxCoord *) NULL,
wxCoord *externalLeading = (wxCoord *) NULL, wxCoord *externalLeading = (wxCoord *) NULL,
@@ -203,7 +203,7 @@ public:
}; };
WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData; WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE); WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = true);
#endif #endif

View File

@@ -82,7 +82,7 @@ class WXDLLEXPORT wxGenericDirCtrl: public wxControl
{ {
public: public:
wxGenericDirCtrl(); wxGenericDirCtrl();
wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1, wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = wxID_ANY,
const wxString &dir = wxDirDialogDefaultFolderStr, const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -95,7 +95,7 @@ public:
Create(parent, id, dir, pos, size, style, filter, defaultFilter, name); Create(parent, id, dir, pos, size, style, filter, defaultFilter, name);
} }
bool Create(wxWindow *parent, const wxWindowID id = -1, bool Create(wxWindow *parent, const wxWindowID id = wxID_ANY,
const wxString &dir = wxDirDialogDefaultFolderStr, const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -155,7 +155,7 @@ public:
// Find the child that matches the first part of 'path'. // Find the child that matches the first part of 'path'.
// E.g. if a child path is "/usr" and 'path' is "/usr/include" // E.g. if a child path is "/usr" and 'path' is "/usr/include"
// then the child for /usr is returned. // then the child for /usr is returned.
// If the path string has been used (we're at the leaf), done is set to TRUE // If the path string has been used (we're at the leaf), done is set to true
virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done); virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done);
// Resize the components of the control // Resize the components of the control
@@ -202,7 +202,7 @@ class WXDLLEXPORT wxDirFilterListCtrl: public wxChoice
{ {
public: public:
wxDirFilterListCtrl() { Init(); } wxDirFilterListCtrl() { Init(); }
wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1, wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0) long style = 0)
@@ -211,7 +211,7 @@ public:
Create(parent, id, pos, size, style); Create(parent, id, pos, size, style);
} }
bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1, bool Create(wxGenericDirCtrl* parent, const wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0); long style = 0);

View File

@@ -230,7 +230,7 @@ public:
// Begin drag. hotspot is the location of the drag position relative to the upper-left // Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image. // corner of the image.
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = FALSE, wxRect* rect = (wxRect*) NULL); bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = false, wxRect* rect = (wxRect*) NULL);
// Begin drag. hotspot is the location of the drag position relative to the upper-left // Begin drag. hotspot is the location of the drag position relative to the upper-left
// corner of the image. This is full screen only. fullScreenRect gives the // corner of the image. This is full screen only. fullScreenRect gives the

View File

@@ -120,8 +120,8 @@ public:
wxFileDialog(wxWindow *parent, wxFileDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = _T(""), const wxString& defaultDir = wxEmptyString,
const wxString& defaultFile = _T(""), const wxString& defaultFile = wxEmptyString,
const wxString& wildCard = wxFileSelectorDefaultWildcardStr, const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0, long style = 0,
const wxPoint& pos = wxDefaultPosition) const wxPoint& pos = wxDefaultPosition)
@@ -245,7 +245,7 @@ public:
virtual void ChangeToListMode(); virtual void ChangeToListMode();
virtual void ChangeToReportMode(); virtual void ChangeToReportMode();
virtual void ChangeToSmallIconMode(); virtual void ChangeToSmallIconMode();
virtual void ShowHidden( bool show = TRUE ); virtual void ShowHidden( bool show = true );
bool GetShowHidden() const { return m_showHidden; } bool GetShowHidden() const { return m_showHidden; }
virtual long Add( wxFileData *fd, wxListItem &item ); virtual long Add( wxFileData *fd, wxListItem &item );

View File

@@ -329,7 +329,7 @@ public:
// Reset the value in the control back to its starting value // Reset the value in the control back to its starting value
virtual void Reset() = 0; virtual void Reset() = 0;
// return TRUE to allow the given key to start editing: the base class // return true to allow the given key to start editing: the base class
// version only checks that the event has no modifiers. The derived // version only checks that the event has no modifiers. The derived
// classes are supposed to do "if ( base::IsAcceptedKey() && ... )" in // classes are supposed to do "if ( base::IsAcceptedKey() && ... )" in
// their IsAcceptedKey() implementation, although, of course, it is not a // their IsAcceptedKey() implementation, although, of course, it is not a
@@ -373,7 +373,7 @@ protected:
// if we change the colours/font of the control from the default ones, we // if we change the colours/font of the control from the default ones, we
// must restore the default later and we save them here between calls to // must restore the default later and we save them here between calls to
// Show(TRUE) and Show(FALSE) // Show(true) and Show(false)
wxColour m_colFgOld, wxColour m_colFgOld,
m_colBgOld; m_colBgOld;
wxFont m_fontOld; wxFont m_fontOld;
@@ -563,9 +563,9 @@ public:
// if !allowOthers, user can't type a string not in choices array // if !allowOthers, user can't type a string not in choices array
wxGridCellChoiceEditor(size_t count = 0, wxGridCellChoiceEditor(size_t count = 0,
const wxString choices[] = NULL, const wxString choices[] = NULL,
bool allowOthers = FALSE); bool allowOthers = false);
wxGridCellChoiceEditor(const wxArrayString& choices, wxGridCellChoiceEditor(const wxArrayString& choices,
bool allowOthers = FALSE); bool allowOthers = false);
virtual void Create(wxWindow* parent, virtual void Create(wxWindow* parent,
wxWindowID id, wxWindowID id,
@@ -662,9 +662,9 @@ public:
m_vAlign = vAlign; m_vAlign = vAlign;
} }
void SetSize(int num_rows, int num_cols); void SetSize(int num_rows, int num_cols);
void SetOverflow(bool allow = TRUE) void SetOverflow(bool allow = true)
{ m_overflow = allow ? Overflow : SingleCell; } { m_overflow = allow ? Overflow : SingleCell; }
void SetReadOnly(bool isReadOnly = TRUE) void SetReadOnly(bool isReadOnly = true)
{ m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; } { m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; }
// takes ownership of the pointer // takes ownership of the pointer
@@ -1116,17 +1116,17 @@ public:
void DoEndDragResizeCol(); void DoEndDragResizeCol();
wxGridTableBase * GetTable() const { return m_table; } wxGridTableBase * GetTable() const { return m_table; }
bool SetTable( wxGridTableBase *table, bool takeOwnership=FALSE, bool SetTable( wxGridTableBase *table, bool takeOwnership = false,
wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectionModes selmode =
wxGrid::wxGridSelectCells ); wxGrid::wxGridSelectCells );
void ClearGrid(); void ClearGrid();
bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels=TRUE ); bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels = true );
bool AppendRows( int numRows = 1, bool updateLabels=TRUE ); bool AppendRows( int numRows = 1, bool updateLabels = true );
bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels=TRUE ); bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels = true );
bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels=TRUE ); bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels = true );
bool AppendCols( int numCols = 1, bool updateLabels=TRUE ); bool AppendCols( int numCols = 1, bool updateLabels = true );
bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels=TRUE ); bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels = true );
void DrawGridCellArea( wxDC& dc , const wxGridCellCoordsArray& cells ); void DrawGridCellArea( wxDC& dc , const wxGridCellCoordsArray& cells );
void DrawGridSpace( wxDC& dc ); void DrawGridSpace( wxDC& dc );
@@ -1179,7 +1179,7 @@ public:
int GetBatchCount() { return m_batchCount; } int GetBatchCount() { return m_batchCount; }
virtual void Refresh(bool eraseb = TRUE, virtual void Refresh(bool eraseb = true,
const wxRect* rect = (const wxRect *) NULL); const wxRect* rect = (const wxRect *) NULL);
// Use this, rather than wxWindow::Refresh(), to force an // Use this, rather than wxWindow::Refresh(), to force an
@@ -1197,8 +1197,8 @@ public:
bool IsEditable() const { return m_editable; } bool IsEditable() const { return m_editable; }
void EnableEditing( bool edit ); void EnableEditing( bool edit );
void EnableCellEditControl( bool enable = TRUE ); void EnableCellEditControl( bool enable = true );
void DisableCellEditControl() { EnableCellEditControl(FALSE); } void DisableCellEditControl() { EnableCellEditControl(false); }
bool CanEnableCellControl() const; bool CanEnableCellControl() const;
bool IsCellEditControlEnabled() const; bool IsCellEditControlEnabled() const;
bool IsCellEditControlShown() const; bool IsCellEditControlShown() const;
@@ -1232,8 +1232,8 @@ public:
// check to see if a cell is either wholly visible (the default arg) or // check to see if a cell is either wholly visible (the default arg) or
// at least partially visible in the grid window // at least partially visible in the grid window
// //
bool IsVisible( int row, int col, bool wholeCellVisible = TRUE ); bool IsVisible( int row, int col, bool wholeCellVisible = true );
bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = TRUE ) bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = true )
{ return IsVisible( coords.GetRow(), coords.GetCol(), wholeCellVisible ); } { return IsVisible( coords.GetRow(), coords.GetCol(), wholeCellVisible ); }
void MakeCellVisible( int row, int col ); void MakeCellVisible( int row, int col );
void MakeCellVisible( const wxGridCellCoords& coords ) void MakeCellVisible( const wxGridCellCoords& coords )
@@ -1291,14 +1291,14 @@ public:
void SetCellHighlightPenWidth(int width); void SetCellHighlightPenWidth(int width);
void SetCellHighlightROPenWidth(int width); void SetCellHighlightROPenWidth(int width);
void EnableDragRowSize( bool enable = TRUE ); void EnableDragRowSize( bool enable = true );
void DisableDragRowSize() { EnableDragRowSize( FALSE ); } void DisableDragRowSize() { EnableDragRowSize( false ); }
bool CanDragRowSize() { return m_canDragRowSize; } bool CanDragRowSize() { return m_canDragRowSize; }
void EnableDragColSize( bool enable = TRUE ); void EnableDragColSize( bool enable = true );
void DisableDragColSize() { EnableDragColSize( FALSE ); } void DisableDragColSize() { EnableDragColSize( false ); }
bool CanDragColSize() { return m_canDragColSize; } bool CanDragColSize() { return m_canDragColSize; }
void EnableDragGridSize(bool enable = TRUE); void EnableDragGridSize(bool enable = true);
void DisableDragGridSize() { EnableDragGridSize(FALSE); } void DisableDragGridSize() { EnableDragGridSize(false); }
bool CanDragGridSize() { return m_canDragGridSize; } bool CanDragGridSize() { return m_canDragGridSize; }
// this sets the specified attribute for this cell or in this row/col // this sets the specified attribute for this cell or in this row/col
@@ -1314,7 +1314,7 @@ public:
void SetColFormatFloat(int col, int width = -1, int precision = -1); void SetColFormatFloat(int col, int width = -1, int precision = -1);
void SetColFormatCustom(int col, const wxString& typeName); void SetColFormatCustom(int col, const wxString& typeName);
void EnableGridLines( bool enable = TRUE ); void EnableGridLines( bool enable = true );
bool GridLinesEnabled() { return m_gridLinesEnabled; } bool GridLinesEnabled() { return m_gridLinesEnabled; }
// ------ row and col formatting // ------ row and col formatting
@@ -1335,26 +1335,26 @@ public:
bool GetCellOverflow( int row, int col ); bool GetCellOverflow( int row, int col );
void GetCellSize( int row, int col, int *num_rows, int *num_cols ); void GetCellSize( int row, int col, int *num_rows, int *num_cols );
void SetDefaultRowSize( int height, bool resizeExistingRows = FALSE ); void SetDefaultRowSize( int height, bool resizeExistingRows = false );
void SetRowSize( int row, int height ); void SetRowSize( int row, int height );
void SetDefaultColSize( int width, bool resizeExistingCols = FALSE ); void SetDefaultColSize( int width, bool resizeExistingCols = false );
void SetColSize( int col, int width ); void SetColSize( int col, int width );
// automatically size the column or row to fit to its contents, if // automatically size the column or row to fit to its contents, if
// setAsMin is TRUE, this optimal width will also be set as minimal width // setAsMin is true, this optimal width will also be set as minimal width
// for this column // for this column
void AutoSizeColumn( int col, bool setAsMin = TRUE ) void AutoSizeColumn( int col, bool setAsMin = true )
{ AutoSizeColOrRow(col, setAsMin, TRUE); } { AutoSizeColOrRow(col, setAsMin, true); }
void AutoSizeRow( int row, bool setAsMin = TRUE ) void AutoSizeRow( int row, bool setAsMin = true )
{ AutoSizeColOrRow(row, setAsMin, FALSE); } { AutoSizeColOrRow(row, setAsMin, false); }
// auto size all columns (very ineffective for big grids!) // auto size all columns (very ineffective for big grids!)
void AutoSizeColumns( bool setAsMin = TRUE ) void AutoSizeColumns( bool setAsMin = true )
{ (void)SetOrCalcColumnSizes(FALSE, setAsMin); } { (void)SetOrCalcColumnSizes(false, setAsMin); }
void AutoSizeRows( bool setAsMin = TRUE ) void AutoSizeRows( bool setAsMin = true )
{ (void)SetOrCalcRowSizes(FALSE, setAsMin); } { (void)SetOrCalcRowSizes(false, setAsMin); }
// auto size the grid, that is make the columns/rows of the "right" size // auto size the grid, that is make the columns/rows of the "right" size
// and also set the grid size to just fit its contents // and also set the grid size to just fit its contents
@@ -1432,23 +1432,23 @@ public:
void SetCellValue( const wxGridCellCoords& coords, const wxString& s ) void SetCellValue( const wxGridCellCoords& coords, const wxString& s )
{ SetCellValue( coords.GetRow(), coords.GetCol(), s ); } { SetCellValue( coords.GetRow(), coords.GetCol(), s ); }
// returns TRUE if the cell can't be edited // returns true if the cell can't be edited
bool IsReadOnly(int row, int col) const; bool IsReadOnly(int row, int col) const;
// make the cell editable/readonly // make the cell editable/readonly
void SetReadOnly(int row, int col, bool isReadOnly = TRUE); void SetReadOnly(int row, int col, bool isReadOnly = true);
// ------ select blocks of cells // ------ select blocks of cells
// //
void SelectRow( int row, bool addToSelected = FALSE ); void SelectRow( int row, bool addToSelected = false );
void SelectCol( int col, bool addToSelected = FALSE ); void SelectCol( int col, bool addToSelected = false );
void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol, void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol,
bool addToSelected = FALSE ); bool addToSelected = false );
void SelectBlock( const wxGridCellCoords& topLeft, void SelectBlock( const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight, const wxGridCellCoords& bottomRight,
bool addToSelected = FALSE ) bool addToSelected = false )
{ SelectBlock( topLeft.GetRow(), topLeft.GetCol(), { SelectBlock( topLeft.GetRow(), topLeft.GetCol(),
bottomRight.GetRow(), bottomRight.GetCol(), bottomRight.GetRow(), bottomRight.GetCol(),
addToSelected ); } addToSelected ); }
@@ -1533,10 +1533,10 @@ public:
// //
wxGrid( wxWindow *parent, wxGrid( wxWindow *parent,
int x, int y, int w = -1, int h = -1, int x, int y, int w = wxDefaultSize.x, int h = wxDefaultSize.y,
long style = wxWANTS_CHARS, long style = wxWANTS_CHARS,
const wxString& name = wxPanelNameStr ) const wxString& name = wxPanelNameStr )
: wxScrolledWindow( parent, -1, wxPoint(x,y), wxSize(w,h), : wxScrolledWindow( parent, wxID_ANY, wxPoint(x,y), wxSize(w,h),
(style|wxWANTS_CHARS), name ) (style|wxWANTS_CHARS), name )
{ {
Create(); Create();
@@ -1656,10 +1656,10 @@ public:
{ SetCellBackgroundColour( row, col, colour ); } { SetCellBackgroundColour( row, col, colour ); }
bool GetEditable() { return IsEditable(); } bool GetEditable() { return IsEditable(); }
void SetEditable( bool edit = TRUE ) { EnableEditing( edit ); } void SetEditable( bool edit = true ) { EnableEditing( edit ); }
bool GetEditInPlace() { return IsCellEditControlEnabled(); } bool GetEditInPlace() { return IsCellEditControlEnabled(); }
void SetEditInPlace(bool WXUNUSED(edit) = TRUE) { } void SetEditInPlace(bool WXUNUSED(edit) = true) { }
void SetCellAlignment( int align, int row, int col) void SetCellAlignment( int align, int row, int col)
{ SetCellAlignment(row, col, align, wxALIGN_CENTER); } { SetCellAlignment(row, col, align, wxALIGN_CENTER); }
@@ -1772,8 +1772,8 @@ protected:
// common part of AutoSizeColumn/Row() and GetBestSize() // common part of AutoSizeColumn/Row() and GetBestSize()
int SetOrCalcColumnSizes(bool calcOnly, bool setAsMin = TRUE); int SetOrCalcColumnSizes(bool calcOnly, bool setAsMin = true);
int SetOrCalcRowSizes(bool calcOnly, bool setAsMin = TRUE); int SetOrCalcRowSizes(bool calcOnly, bool setAsMin = true);
// common part of AutoSizeColumn/Row() // common part of AutoSizeColumn/Row()
void AutoSizeColOrRow(int n, bool setAsMin, bool column /* or row? */); void AutoSizeColOrRow(int n, bool setAsMin, bool column /* or row? */);
@@ -1810,7 +1810,7 @@ protected:
// adds an attribute to cache // adds an attribute to cache
void CacheAttr(int row, int col, wxGridCellAttr *attr) const; void CacheAttr(int row, int col, wxGridCellAttr *attr) const;
// looks for an attr in cache, returns TRUE if found // looks for an attr in cache, returns true if found
bool LookupAttr(int row, int col, wxGridCellAttr **attr) const; bool LookupAttr(int row, int col, wxGridCellAttr **attr) const;
// looks for the attr in cache, if not found asks the table and caches the // looks for the attr in cache, if not found asks the table and caches the
@@ -1839,14 +1839,14 @@ protected:
}; };
// this method not only sets m_cursorMode but also sets the correct cursor // this method not only sets m_cursorMode but also sets the correct cursor
// for the given mode and, if captureMouse is not FALSE releases the mouse // for the given mode and, if captureMouse is not false releases the mouse
// if it was captured and captures it if it must be captured // if it was captured and captures it if it must be captured
// //
// for this to work, you should always use it and not set m_cursorMode // for this to work, you should always use it and not set m_cursorMode
// directly! // directly!
void ChangeCursorMode(CursorMode mode, void ChangeCursorMode(CursorMode mode,
wxWindow *win = (wxWindow *)NULL, wxWindow *win = (wxWindow *)NULL,
bool captureMouse = TRUE); bool captureMouse = true);
wxWindow *m_winCapture; // the window which captured the mouse wxWindow *m_winCapture; // the window which captured the mouse
CursorMode m_cursorMode; CursorMode m_cursorMode;
@@ -1931,8 +1931,8 @@ public:
} }
wxGridEvent(int id, wxEventType type, wxObject* obj, wxGridEvent(int id, wxEventType type, wxObject* obj,
int row=-1, int col=-1, int x=-1, int y=-1, bool sel = TRUE, int row=-1, int col=-1, int x=-1, int y=-1, bool sel = true,
bool control=FALSE, bool shift=FALSE, bool alt=FALSE, bool meta=FALSE); bool control = false, bool shift = false, bool alt = false, bool meta = false);
virtual int GetRow() { return m_row; } virtual int GetRow() { return m_row; }
virtual int GetCol() { return m_col; } virtual int GetCol() { return m_col; }
@@ -1968,7 +1968,7 @@ public:
wxGridSizeEvent(int id, wxEventType type, wxObject* obj, wxGridSizeEvent(int id, wxEventType type, wxObject* obj,
int rowOrCol=-1, int x=-1, int y=-1, int rowOrCol=-1, int x=-1, int y=-1,
bool control=FALSE, bool shift=FALSE, bool alt=FALSE, bool meta=FALSE); bool control = false, bool shift = false, bool alt = false, bool meta = false);
int GetRowOrCol() { return m_rowOrCol; } int GetRowOrCol() { return m_rowOrCol; }
wxPoint GetPosition() { return wxPoint( m_x, m_y ); } wxPoint GetPosition() { return wxPoint( m_x, m_y ); }
@@ -1998,19 +1998,19 @@ public:
{ {
m_topLeft = wxGridNoCellCoords; m_topLeft = wxGridNoCellCoords;
m_bottomRight = wxGridNoCellCoords; m_bottomRight = wxGridNoCellCoords;
m_selecting = FALSE; m_selecting = false;
m_control = FALSE; m_control = false;
m_meta = FALSE; m_meta = false;
m_shift = FALSE; m_shift = false;
m_alt = FALSE; m_alt = false;
} }
wxGridRangeSelectEvent(int id, wxEventType type, wxObject* obj, wxGridRangeSelectEvent(int id, wxEventType type, wxObject* obj,
const wxGridCellCoords& topLeft, const wxGridCellCoords& topLeft,
const wxGridCellCoords& bottomRight, const wxGridCellCoords& bottomRight,
bool sel = TRUE, bool sel = true,
bool control=FALSE, bool shift=FALSE, bool control = false, bool shift = false,
bool alt=FALSE, bool meta=FALSE); bool alt = false, bool meta = false);
wxGridCellCoords GetTopLeftCoords() { return m_topLeft; } wxGridCellCoords GetTopLeftCoords() { return m_topLeft; }
wxGridCellCoords GetBottomRightCoords() { return m_bottomRight; } wxGridCellCoords GetBottomRightCoords() { return m_bottomRight; }
@@ -2092,40 +2092,40 @@ typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&);
typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&); typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&);
typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&); typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&);
#define EVT_GRID_CELL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CELL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CELL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CELL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CELL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CELL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CELL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CELL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_LABEL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_LABEL_LEFT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_CLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_LABEL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_CLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_LABEL_RIGHT_CLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_CLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_LABEL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_LABEL_LEFT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_LABEL_RIGHT_DCLICK(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_DCLICK, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_ROW_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_ROW_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ), #define EVT_GRID_ROW_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_ROW_SIZE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ),
#define EVT_GRID_COL_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_COL_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ), #define EVT_GRID_COL_SIZE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_COL_SIZE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ),
#define EVT_GRID_RANGE_SELECT(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_RANGE_SELECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridRangeSelectEventFunction, &fn ), NULL ), #define EVT_GRID_RANGE_SELECT(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_RANGE_SELECT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridRangeSelectEventFunction, &fn ), NULL ),
#define EVT_GRID_CELL_CHANGE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_CHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CELL_CHANGE(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_CHANGE, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_SELECT_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_SELECT_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_EDITOR_SHOWN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_EDITOR_SHOWN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_EDITOR_HIDDEN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_EDITOR_HIDDEN(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_EDITOR_CREATED(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ), #define EVT_GRID_EDITOR_CREATED(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ),
// The same as above but with the ability to specify an identifier // The same as above but with the ability to specify an identifier
#define EVT_GRID_CMD_CELL_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_CELL_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_CELL_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_CELL_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_CELL_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_CELL_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_LEFT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_CELL_RIGHT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_CELL_RIGHT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_RIGHT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_LABEL_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_LABEL_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_LABEL_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_LABEL_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_LABEL_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_LABEL_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_LEFT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_LABEL_RIGHT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_ROW_SIZE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_ROW_SIZE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_ROW_SIZE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_ROW_SIZE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_COL_SIZE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_COL_SIZE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_COL_SIZE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_COL_SIZE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridSizeEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_RANGE_SELECT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_RANGE_SELECT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridRangeSelectEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_RANGE_SELECT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_RANGE_SELECT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridRangeSelectEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_CELL_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_CELL_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CELL_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_SELECT_CELL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_SELECT_CELL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_SELECT_CELL, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_EDITOR_SHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_EDITOR_SHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_SHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_EDITOR_HIDDEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_EDITOR_HIDDEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_HIDDEN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CMD_EDITOR_CREATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ), #define EVT_GRID_CMD_EDITOR_CREATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_EDITOR_CREATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEditorCreatedEventFunction, &fn ), NULL ),
#if 0 // TODO: implement these ? others ? #if 0 // TODO: implement these ? others ?
@@ -2133,9 +2133,9 @@ extern const int wxEVT_GRID_CREATE_CELL;
extern const int wxEVT_GRID_CHANGE_LABELS; extern const int wxEVT_GRID_CHANGE_LABELS;
extern const int wxEVT_GRID_CHANGE_SEL_LABEL; extern const int wxEVT_GRID_CHANGE_SEL_LABEL;
#define EVT_GRID_CREATE_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CREATE_CELL, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CREATE_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CREATE_CELL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CHANGE_LABELS(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_LABELS, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CHANGE_LABELS(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_LABELS, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#define EVT_GRID_CHANGE_SEL_LABEL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_SEL_LABEL, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), #define EVT_GRID_CHANGE_SEL_LABEL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_SEL_LABEL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ),
#endif #endif

View File

@@ -31,24 +31,24 @@ public:
void SetSelectionMode(wxGrid::wxGridSelectionModes selmode); void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; } wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; }
void SelectRow( int row, void SelectRow( int row,
bool ControlDown = FALSE, bool ShiftDown = FALSE, bool ControlDown = false, bool ShiftDown = false,
bool AltDown = FALSE, bool MetaDown = FALSE ); bool AltDown = false, bool MetaDown = false );
void SelectCol( int col, void SelectCol( int col,
bool ControlDown = FALSE, bool ShiftDown = FALSE, bool ControlDown = false, bool ShiftDown = false,
bool AltDown = FALSE, bool MetaDown = FALSE ); bool AltDown = false, bool MetaDown = false );
void SelectBlock( int topRow, int leftCol, void SelectBlock( int topRow, int leftCol,
int bottomRow, int rightCol, int bottomRow, int rightCol,
bool ControlDown = FALSE, bool ShiftDown = FALSE, bool ControlDown = false, bool ShiftDown = false,
bool AltDown = FALSE, bool MetaDown = FALSE, bool AltDown = false, bool MetaDown = false,
bool sendEvent = TRUE ); bool sendEvent = true );
void SelectCell( int row, int col, void SelectCell( int row, int col,
bool ControlDown = FALSE, bool ShiftDown = FALSE, bool ControlDown = false, bool ShiftDown = false,
bool AltDown = FALSE, bool MetaDown = FALSE, bool AltDown = false, bool MetaDown = false,
bool sendEvent = TRUE ); bool sendEvent = true );
void ToggleCellSelection( int row, int col, void ToggleCellSelection( int row, int col,
bool ControlDown = FALSE, bool ControlDown = false,
bool ShiftDown = FALSE, bool ShiftDown = false,
bool AltDown = FALSE, bool MetaDown = FALSE ); bool AltDown = false, bool MetaDown = false );
void ClearSelection(); void ClearSelection();
void UpdateRows( size_t pos, int numRows ); void UpdateRows( size_t pos, int numRows );

View File

@@ -32,7 +32,7 @@ class WXDLLIMPEXP_ADV wxExtHelpMapList;
/// Default browser name. /// Default browser name.
# define WXEXTHELP_DEFAULTBROWSER _T("netscape") # define WXEXTHELP_DEFAULTBROWSER _T("netscape")
/// Is default browse a variant of netscape? /// Is default browse a variant of netscape?
# define WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE TRUE # define WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE true
#endif #endif
/** /**
@@ -67,7 +67,7 @@ DECLARE_CLASS(wxExtHelpController)
home directory) and tell it to load the page into the existing home directory) and tell it to load the page into the existing
window. window.
@param browsername The command to call a browser/html viewer. @param browsername The command to call a browser/html viewer.
@param isNetscape Set this to TRUE if the browser is some variant of Netscape. @param isNetscape Set this to true if the browser is some variant of Netscape.
*/ */
// Obsolete form // Obsolete form
void SetBrowser(const wxString & browsername = WXEXTHELP_DEFAULTBROWSER, void SetBrowser(const wxString & browsername = WXEXTHELP_DEFAULTBROWSER,
@@ -106,7 +106,7 @@ DECLARE_CLASS(wxExtHelpController)
@file Name of help directory. @file Name of help directory.
@return true on success @return true on success
*/ */
virtual bool LoadFile(const wxString& file = wxT("")); virtual bool LoadFile(const wxString& file = wxEmptyString);
/** Display list of all help entries. /** Display list of all help entries.
@return true on success @return true on success
@@ -144,7 +144,7 @@ DECLARE_CLASS(wxExtHelpController)
virtual void SetFrameParameters(const wxString& WXUNUSED(title), virtual void SetFrameParameters(const wxString& WXUNUSED(title),
const wxSize& WXUNUSED(size), const wxSize& WXUNUSED(size),
const wxPoint& WXUNUSED(pos) = wxDefaultPosition, const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
bool WXUNUSED(newFrameEachTime) = FALSE) bool WXUNUSED(newFrameEachTime) = false)
{ {
// does nothing by default // does nothing by default
} }

View File

@@ -57,9 +57,9 @@ class WXDLLEXPORT wxGenericImageList: public wxObject
{ {
public: public:
wxGenericImageList() { m_width = m_height = 0; } wxGenericImageList() { m_width = m_height = 0; }
wxGenericImageList( int width, int height, bool mask = TRUE, int initialCount = 1 ); wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 );
~wxGenericImageList(); ~wxGenericImageList();
bool Create( int width, int height, bool mask = TRUE, int initialCount = 1 ); bool Create( int width, int height, bool mask = true, int initialCount = 1 );
bool Create(); bool Create();
virtual int GetImageCount() const; virtual int GetImageCount() const;
@@ -75,7 +75,7 @@ public:
virtual bool Draw(int index, wxDC& dc, int x, int y, virtual bool Draw(int index, wxDC& dc, int x, int y,
int flags = wxIMAGELIST_DRAW_NORMAL, int flags = wxIMAGELIST_DRAW_NORMAL,
bool solidBackground = FALSE); bool solidBackground = false);
private: private:
wxList m_images; wxList m_images;
@@ -99,7 +99,7 @@ class WXDLLEXPORT wxImageList: public wxGenericImageList
public: public:
wxImageList() {} wxImageList() {}
wxImageList( int width, int height, bool mask = TRUE, int initialCount = 1 ) wxImageList( int width, int height, bool mask = true, int initialCount = 1 )
: wxGenericImageList(width, height, mask, initialCount) : wxGenericImageList(width, height, mask, initialCount)
{ {
} }

View File

@@ -105,7 +105,7 @@ private:
typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&); typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&);
#define EVT_QUERY_LAYOUT_INFO(func) \ #define EVT_QUERY_LAYOUT_INFO(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxQueryLayoutInfoEventFunction, & func ), NULL ), DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxQueryLayoutInfoEventFunction, & func ), NULL ),
/* /*
* This event is used to take a bite out of the available client area. * This event is used to take a bite out of the available client area.
@@ -142,7 +142,7 @@ private:
typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&); typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&);
#define EVT_CALCULATE_LAYOUT(func) \ #define EVT_CALCULATE_LAYOUT(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCalculateLayoutEventFunction, & func ), NULL ), DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCalculateLayoutEventFunction, & func ), NULL ),
#if wxUSE_SASH #if wxUSE_SASH
@@ -157,13 +157,13 @@ public:
Init(); Init();
} }
wxSashLayoutWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, wxSashLayoutWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow")) const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"))
{ {
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
} }
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow")); const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"));
// Accessors // Accessors

View File

@@ -67,7 +67,7 @@ class WXDLLEXPORT wxGenericListCtrl: public wxControl
public: public:
wxGenericListCtrl(); wxGenericListCtrl();
wxGenericListCtrl( wxWindow *parent, wxGenericListCtrl( wxWindow *parent,
wxWindowID winid = -1, wxWindowID winid = wxID_ANY,
const wxPoint &pos = wxDefaultPosition, const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize, const wxSize &size = wxDefaultSize,
long style = wxLC_ICON, long style = wxLC_ICON,
@@ -79,7 +79,7 @@ public:
~wxGenericListCtrl(); ~wxGenericListCtrl();
bool Create( wxWindow *parent, bool Create( wxWindow *parent,
wxWindowID winid = -1, wxWindowID winid = wxID_ANY,
const wxPoint &pos = wxDefaultPosition, const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize, const wxSize &size = wxDefaultSize,
long style = wxLC_ICON, long style = wxLC_ICON,
@@ -108,7 +108,7 @@ public:
bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC
int GetItemCount() const; int GetItemCount() const;
int GetColumnCount() const; int GetColumnCount() const;
void SetItemSpacing( int spacing, bool isSmall = FALSE ); void SetItemSpacing( int spacing, bool isSmall = false );
wxSize GetItemSpacing() const; wxSize GetItemSpacing() const;
void SetItemTextColour( long item, const wxColour& col); void SetItemTextColour( long item, const wxColour& col);
wxColour GetItemTextColour( long item ) const; wxColour GetItemTextColour( long item ) const;
@@ -119,7 +119,7 @@ public:
void SetTextColour(const wxColour& col); void SetTextColour(const wxColour& col);
long GetTopItem() const; long GetTopItem() const;
void SetSingleStyle( long style, bool add = TRUE ) ; void SetSingleStyle( long style, bool add = true ) ;
void SetWindowStyleFlag( long style ); void SetWindowStyleFlag( long style );
void RecreateWindow() {} void RecreateWindow() {}
long GetNextItem( long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE ) const; long GetNextItem( long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE ) const;
@@ -140,7 +140,7 @@ public:
void Edit( long item ); void Edit( long item );
bool EnsureVisible( long item ); bool EnsureVisible( long item );
long FindItem( long start, const wxString& str, bool partial = FALSE ); long FindItem( long start, const wxString& str, bool partial = false );
long FindItem( long start, long data ); long FindItem( long start, long data );
long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC
long HitTest( const wxPoint& point, int& flags); long HitTest( const wxPoint& point, int& flags);
@@ -188,7 +188,7 @@ public:
void OnSize( wxSizeEvent &event ); void OnSize( wxSizeEvent &event );
// We have to hand down a few functions // We have to hand down a few functions
virtual void Refresh(bool eraseBackground = TRUE, virtual void Refresh(bool eraseBackground = true,
const wxRect *rect = NULL); const wxRect *rect = NULL);
virtual void Freeze(); virtual void Freeze();
@@ -268,7 +268,7 @@ class WXDLLEXPORT wxListCtrl: public wxGenericListCtrl
public: public:
wxListCtrl() {} wxListCtrl() {}
wxListCtrl(wxWindow *parent, wxWindowID winid = -1, wxListCtrl(wxWindow *parent, wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxLC_ICON, long style = wxLC_ICON,

View File

@@ -160,10 +160,10 @@ public:
// no size hints // no size hints
virtual void SetSizeHints( int WXUNUSED(minW), virtual void SetSizeHints( int WXUNUSED(minW),
int WXUNUSED(minH), int WXUNUSED(minH),
int WXUNUSED(maxW) = -1, int WXUNUSED(maxW) = wxDefaultSize.x,
int WXUNUSED(maxH) = -1, int WXUNUSED(maxH) = wxDefaultSize.y,
int WXUNUSED(incW) = -1, int WXUNUSED(incW) = wxDefaultSize.x,
int WXUNUSED(incH) = -1) {} int WXUNUSED(incH) = wxDefaultSize.y) {}
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
// no toolbar bars // no toolbar bars
@@ -179,15 +179,15 @@ public:
void SetIcons( const wxIconBundle& WXUNUSED(icons) ) { } void SetIcons( const wxIconBundle& WXUNUSED(icons) ) { }
// no maximize etc // no maximize etc
virtual void Maximize( bool WXUNUSED(maximize) = TRUE) { /* Has no effect */ } virtual void Maximize( bool WXUNUSED(maximize) = true) { /* Has no effect */ }
virtual void Restore() { /* Has no effect */ } virtual void Restore() { /* Has no effect */ }
virtual void Iconize(bool WXUNUSED(iconize) = TRUE) { /* Has no effect */ } virtual void Iconize(bool WXUNUSED(iconize) = true) { /* Has no effect */ }
virtual bool IsMaximized() const { return TRUE; } virtual bool IsMaximized() const { return true; }
virtual bool IsIconized() const { return FALSE; } virtual bool IsIconized() const { return false; }
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return FALSE; } virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return false; }
virtual bool IsFullScreen() const { return FALSE; } virtual bool IsFullScreen() const { return false; }
virtual bool IsTopLevel() const { return FALSE; } virtual bool IsTopLevel() const { return false; }
void OnMenuHighlight(wxMenuEvent& event); void OnMenuHighlight(wxMenuEvent& event);
void OnActivate(wxActivateEvent& event); void OnActivate(wxActivateEvent& event);

View File

@@ -47,5 +47,4 @@ private:
#define wxMessageDialog wxGenericMessageDialog #define wxMessageDialog wxGenericMessageDialog
#endif #endif
#endif #endif // __MSGDLGH_G__
// __MSGDLGH_G__

View File

@@ -68,7 +68,7 @@ public:
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
int SetSelection(size_t nPage); int SetSelection(size_t nPage);
// cycle thru the tabs // cycle thru the tabs
// void AdvanceSelection(bool bForward = TRUE); // void AdvanceSelection(bool bForward = true);
// get the currently selected page // get the currently selected page
int GetSelection() const { return m_nSelection; } int GetSelection() const { return m_nSelection; }
@@ -109,7 +109,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);
// callbacks // callbacks
@@ -123,7 +123,7 @@ public:
// base class virtuals // base class virtuals
// ------------------- // -------------------
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
virtual void SetConstraintSizes(bool recurse = TRUE); virtual void SetConstraintSizes(bool recurse = true);
virtual bool DoPhase(int nPhase); virtual bool DoPhase(int nPhase);
// Implementation // Implementation
@@ -139,7 +139,7 @@ public:
// Implementation: calculate the layout of the view rect // Implementation: calculate the layout of the view rect
// and resize the children if required // and resize the children if required
bool RefreshLayout(bool force = TRUE); bool RefreshLayout(bool force = true);
protected: protected:
// common part of all ctors // common part of all ctors

View File

@@ -45,12 +45,12 @@ public:
{ {
Init(); Init();
Create(parent, -1, wxPoint(x, y), wxSize(width, height), style, name); Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
} }
// Constructor // Constructor
wxPanel(wxWindow *parent, wxPanel(wxWindow *parent,
wxWindowID winid = -1, wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER, long style = wxTAB_TRAVERSAL | wxNO_BORDER,
@@ -82,8 +82,8 @@ public:
virtual void InitDialog(); virtual void InitDialog();
#ifdef __WXUNIVERSAL__ #ifdef __WXUNIVERSAL__
virtual bool IsCanvasWindow() const { return TRUE; } virtual bool IsCanvasWindow() const { return true; }
virtual bool ProvidesBackground() const { return TRUE; } virtual bool ProvidesBackground() const { return true; }
#endif #endif
virtual void ApplyParentThemeBackground(const wxColour& bg) virtual void ApplyParentThemeBackground(const wxColour& bg)

View File

@@ -31,7 +31,7 @@ public:
wxPostScriptPrinter(wxPrintDialogData *data = (wxPrintDialogData *) NULL); wxPostScriptPrinter(wxPrintDialogData *data = (wxPrintDialogData *) NULL);
virtual ~wxPostScriptPrinter(); virtual ~wxPostScriptPrinter();
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE); virtual bool Print(wxWindow *parent, wxPrintout *printout, 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

@@ -43,7 +43,7 @@ enum wxSashEdgePosition {
class WXDLLIMPEXP_ADV wxSashEdge class WXDLLIMPEXP_ADV wxSashEdge
{ {
public: public:
wxSashEdge() { m_show = FALSE; m_border = FALSE; m_margin = 0; } wxSashEdge() { m_show = false; m_border = false; m_margin = 0; }
bool m_show; // Is the sash showing? bool m_show; // Is the sash showing?
bool m_border; // Do we draw a border? bool m_border; // Do we draw a border?
@@ -77,7 +77,7 @@ public:
} }
// Normal constructor // Normal constructor
wxSashWindow(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, wxSashWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow")) const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"))
{ {
Init(); Init();
@@ -86,7 +86,7 @@ public:
~wxSashWindow(); ~wxSashWindow();
bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow")); const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"));
// Set whether there's a sash in this position // Set whether there's a sash in this position
@@ -239,7 +239,7 @@ private:
typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&); typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&);
#define EVT_SASH_DRAGGED(id, fn) \ #define EVT_SASH_DRAGGED(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SASH_DRAGGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSashEventFunction, & fn ), NULL ), DECLARE_EVENT_TABLE_ENTRY( wxEVT_SASH_DRAGGED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSashEventFunction, & fn ), NULL ),
#define EVT_SASH_DRAGGED_RANGE(id1, id2, fn) \ #define EVT_SASH_DRAGGED_RANGE(id1, id2, fn) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SASH_DRAGGED, id1, id2, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSashEventFunction, & fn ), NULL ), DECLARE_EVENT_TABLE_ENTRY( wxEVT_SASH_DRAGGED, id1, id2, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSashEventFunction, & fn ), NULL ),

View File

@@ -45,7 +45,7 @@ class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
public: public:
wxGenericScrolledWindow() : wxScrollHelper(this) { } wxGenericScrolledWindow() : wxScrollHelper(this) { }
wxGenericScrolledWindow(wxWindow *parent, wxGenericScrolledWindow(wxWindow *parent,
wxWindowID winid = -1, wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle, long style = wxScrolledWindowStyle,

View File

@@ -39,7 +39,7 @@ public:
wxSpinCtrl() { Init(); } wxSpinCtrl() { Init(); }
wxSpinCtrl(wxWindow *parent, wxSpinCtrl(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -52,7 +52,7 @@ public:
} }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -76,8 +76,8 @@ public:
// implementation from now on // implementation from now on
// forward these functions to all subcontrols // forward these functions to all subcontrols
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = true);
// get the subcontrols // get the subcontrols
wxTextCtrl *GetText() const { return m_text; } wxTextCtrl *GetText() const { return m_text; }
@@ -87,7 +87,7 @@ public:
void SetTextValue(int val); void SetTextValue(int val);
// put the numeric value of the string in the text ctrl into val and return // put the numeric value of the string in the text ctrl into val and return
// TRUE or return FALSE if the text ctrl doesn't contain a number or if the // true or return false if the text ctrl doesn't contain a number or if the
// number is out of range // number is out of range
bool GetTextValue(int *val) const; bool GetTextValue(int *val) const;
@@ -122,7 +122,7 @@ public:
wxSpinCtrl() { Init(); } wxSpinCtrl() { Init(); }
wxSpinCtrl(wxWindow *parent, wxSpinCtrl(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -134,7 +134,7 @@ public:
} }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,

View File

@@ -67,7 +67,7 @@ public:
} }
// Normal constructor // Normal constructor
wxSplitterWindow(wxWindow *parent, wxWindowID id = -1, wxSplitterWindow(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxSP_3D, long style = wxSP_3D,
@@ -79,7 +79,7 @@ public:
virtual ~wxSplitterWindow(); virtual ~wxSplitterWindow();
bool Create(wxWindow *parent, wxWindowID id = -1, bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxSP_3D, long style = wxSP_3D,
@@ -376,7 +376,7 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
DECLARE_EVENT_TABLE_ENTRY( \ DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, \ wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, \
id, \ id, \
-1, \ wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \
NULL \ NULL \
), ),
@@ -385,7 +385,7 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
DECLARE_EVENT_TABLE_ENTRY( \ DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, \ wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, \
id, \ id, \
-1, \ wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \
NULL \ NULL \
), ),
@@ -394,7 +394,7 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
DECLARE_EVENT_TABLE_ENTRY( \ DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, \ wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, \
id, \ id, \
-1, \ wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \
NULL \ NULL \
), ),
@@ -403,7 +403,7 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
DECLARE_EVENT_TABLE_ENTRY( \ DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_COMMAND_SPLITTER_UNSPLIT, \ wxEVT_COMMAND_SPLITTER_UNSPLIT, \
id, \ id, \
-1, \ wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxSplitterEventFunction, &fn ), \
NULL \ NULL \
), ),

View File

@@ -121,7 +121,7 @@ public:
// Remove the tab without deleting the window // Remove the tab without deleting the window
bool RemoveTab(int id); bool RemoveTab(int id);
void ClearTabs(bool deleteTabs = TRUE); void ClearTabs(bool deleteTabs = true);
bool SetTabText(int id, const wxString& label); bool SetTabText(int id, const wxString& label);
wxString GetTabText(int id) const; wxString GetTabText(int id) const;
@@ -132,13 +132,13 @@ public:
// Draw all tabs // Draw all tabs
virtual void Draw(wxDC& dc); virtual void Draw(wxDC& dc);
// Process mouse event, return FALSE if we didn't process it // Process mouse event, return false if we didn't process it
virtual bool OnEvent(wxMouseEvent& event); virtual bool OnEvent(wxMouseEvent& event);
// Called when a tab is activated // Called when a tab is activated
virtual void OnTabActivate(int activateId, int deactivateId); virtual void OnTabActivate(int activateId, int deactivateId);
// Allows vetoing // Allows vetoing
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return TRUE; }; virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return true; };
// Allows use of application-supplied wxTabControl classes. // Allows use of application-supplied wxTabControl classes.
virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); } virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); }
@@ -162,7 +162,7 @@ public:
// Calculate tab width to fit to view, and optionally adjust the view // Calculate tab width to fit to view, and optionally adjust the view
// to fit the tabs exactly. // to fit the tabs exactly.
int CalculateTabWidth(int noTabs, bool adjustView = FALSE); int CalculateTabWidth(int noTabs, bool adjustView = false);
inline void SetTabStyle(long style) { m_tabStyle = style; } inline void SetTabStyle(long style) { m_tabStyle = style; }
inline long GetTabStyle(void) const { return m_tabStyle; } inline long GetTabStyle(void) const { return m_tabStyle; }
@@ -180,7 +180,7 @@ public:
inline int GetTopMargin(void) const { return m_topMargin; } inline int GetTopMargin(void) const { return m_topMargin; }
inline void SetTopMargin(int margin) { m_topMargin = margin; } inline void SetTopMargin(int margin) { m_topMargin = margin; }
void SetTabSelection(int sel, bool activateTool = TRUE); void SetTabSelection(int sel, bool activateTool = true);
inline int GetTabSelection() const { return m_tabSelection; } inline int GetTabSelection() const { return m_tabSelection; }
// Find tab control for id // Find tab control for id
@@ -343,7 +343,7 @@ public:
// Specific to this class // Specific to this class
void AddTabWindow(int id, wxWindow *window); void AddTabWindow(int id, wxWindow *window);
wxWindow *GetTabWindow(int id) const ; wxWindow *GetTabWindow(int id) const ;
void ClearWindows(bool deleteWindows = TRUE); void ClearWindows(bool deleteWindows = true);
inline wxWindow *GetCurrentWindow() const { return m_currentWindow; } inline wxWindow *GetCurrentWindow() const { return m_currentWindow; }
void ShowWindowForTab(int id); void ShowWindowForTab(int id);

View File

@@ -78,9 +78,9 @@ wxGetTextFromUser(const wxString& message,
const wxString& caption = wxGetTextFromUserPromptStr, const wxString& caption = wxGetTextFromUserPromptStr,
const wxString& default_value = wxEmptyString, const wxString& default_value = wxEmptyString,
wxWindow *parent = (wxWindow *) NULL, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int x = wxDefaultPosition.x,
int y = -1, int y = wxDefaultPosition.y,
bool centre = TRUE); bool centre = true);
wxString WXDLLEXPORT wxString WXDLLEXPORT
wxGetPasswordFromUser(const wxString& message, wxGetPasswordFromUser(const wxString& message,

View File

@@ -29,7 +29,7 @@ public:
{ Init(); } { Init(); }
~wxTimer(); ~wxTimer();
virtual bool Start(int millisecs = -1, bool oneShot = FALSE); virtual bool Start(int millisecs = -1, bool oneShot = false);
virtual void Stop(); virtual void Stop();
virtual bool IsRunning() const; virtual bool IsRunning() const;

View File

@@ -46,7 +46,7 @@ public:
// -------- // --------
wxGenericTreeCtrl() { Init(); } wxGenericTreeCtrl() { Init(); }
wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = -1, wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE, long style = wxTR_DEFAULT_STYLE,
@@ -59,7 +59,7 @@ public:
virtual ~wxGenericTreeCtrl(); virtual ~wxGenericTreeCtrl();
bool Create(wxWindow *parent, wxWindowID id = -1, bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE, long style = wxTR_DEFAULT_STYLE,
@@ -142,10 +142,10 @@ public:
// allow the user to expand the items which don't have any children now // allow the user to expand the items which don't have any children now
// - but instead add them only when needed, thus minimizing memory // - but instead add them only when needed, thus minimizing memory
// usage and loading time. // usage and loading time.
void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE); void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
// the item will be shown in bold // the item will be shown in bold
void SetItemBold(const wxTreeItemId& item, bool bold = TRUE); void SetItemBold(const wxTreeItemId& item, bool bold = true);
// set the item's text colour // set the item's text colour
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
@@ -183,15 +183,15 @@ public:
// number of children // number of children
// ------------------ // ------------------
// if 'recursively' is FALSE, only immediate children count, otherwise // if 'recursively' is false, only immediate children count, otherwise
// the returned number is the number of all items in this branch // the returned number is the number of all items in this branch
size_t GetChildrenCount(const wxTreeItemId& item, size_t GetChildrenCount(const wxTreeItemId& item,
bool recursively = TRUE) const; bool recursively = true) const;
// navigation // navigation
// ---------- // ----------
// wxTreeItemId.IsOk() will return FALSE if there is no such item // wxTreeItemId.IsOk() will return false if there is no such item
// get the root tree item // get the root tree item
wxTreeItemId GetRootItem() const { return m_anchor; } wxTreeItemId GetRootItem() const { return m_anchor; }
@@ -330,7 +330,7 @@ public:
// get the bounding rectangle of the item (or of its label only) // get the bounding rectangle of the item (or of its label only)
bool GetBoundingRect(const wxTreeItemId& item, bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect, wxRect& rect,
bool textOnly = FALSE) const; bool textOnly = false) const;
// Start editing the item label: this (temporarily) replaces the item // Start editing the item label: this (temporarily) replaces the item
// with a one line edit control. The item will be selected if it hadn't // with a one line edit control. The item will be selected if it hadn't
@@ -457,8 +457,8 @@ protected:
void DrawDropEffect(wxGenericTreeItem *item); void DrawDropEffect(wxGenericTreeItem *item);
void DoSelectItem(const wxTreeItemId& id, void DoSelectItem(const wxTreeItemId& id,
bool unselect_others = TRUE, bool unselect_others = true,
bool extended_select = FALSE); bool extended_select = false);
wxTreeItemId DoInsertItem(const wxTreeItemId& parent, wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
size_t previous, size_t previous,
@@ -521,7 +521,7 @@ class WXDLLEXPORT wxTreeCtrl: public wxGenericTreeCtrl
public: public:
wxTreeCtrl() {} wxTreeCtrl() {}
wxTreeCtrl(wxWindow *parent, wxWindowID id = -1, wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTR_DEFAULT_STYLE, long style = wxTR_DEFAULT_STYLE,

View File

@@ -29,7 +29,7 @@ public:
// ctor // ctor
wxWizard() { Init(); } wxWizard() { Init(); }
wxWizard(wxWindow *parent, wxWizard(wxWindow *parent,
int id = -1, int id = wxID_ANY,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap, const wxBitmap& bitmap = wxNullBitmap,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -39,7 +39,7 @@ public:
Create(parent, id, title, bitmap, pos, style); Create(parent, id, title, bitmap, pos, style);
} }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
int id = -1, int id = wxID_ANY,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap, const wxBitmap& bitmap = wxNullBitmap,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -62,9 +62,9 @@ public:
bool IsRunning() const { return m_page != NULL; } bool IsRunning() const { return m_page != NULL; }
// show the prev/next page, but call TransferDataFromWindow on the current // show the prev/next page, but call TransferDataFromWindow on the current
// page first and return FALSE without changing the page if // page first and return false without changing the page if
// TransferDataFromWindow() returns FALSE - otherwise, returns TRUE // TransferDataFromWindow() returns false - otherwise, returns true
bool ShowPage(wxWizardPage *page, bool goingForward = TRUE); bool ShowPage(wxWizardPage *page, bool goingForward = true);
// do fill the dialog with controls // do fill the dialog with controls
// this is app-overridable to, for example, set help and tooltip text // this is app-overridable to, for example, set help and tooltip text

View File

@@ -25,7 +25,7 @@
wxInfoFrame::wxInfoFrame(wxWindow *parent, const wxString& message) wxInfoFrame::wxInfoFrame(wxWindow *parent, const wxString& message)
: wxFrame(parent, -1, wxT("Busy"), : wxFrame(parent, wxID_ANY, wxT("Busy"),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
#if defined(__WXX11__) #if defined(__WXX11__)
wxTHICK_FRAME wxTHICK_FRAME
@@ -35,7 +35,7 @@ wxInfoFrame::wxInfoFrame(wxWindow *parent, const wxString& message)
| wxFRAME_TOOL_WINDOW) | wxFRAME_TOOL_WINDOW)
{ {
wxPanel *panel = new wxPanel( this ); wxPanel *panel = new wxPanel( this );
wxStaticText *text = new wxStaticText(panel, -1, message); wxStaticText *text = new wxStaticText(panel, wxID_ANY, message);
panel->SetCursor(*wxHOURGLASS_CURSOR); panel->SetCursor(*wxHOURGLASS_CURSOR);
text->SetCursor(*wxHOURGLASS_CURSOR); text->SetCursor(*wxHOURGLASS_CURSOR);
@@ -104,7 +104,7 @@ wxInfoFrame::wxInfoFrame(wxWindow *parent, const wxString& message)
wxBusyInfo::wxBusyInfo(const wxString& message, wxWindow *parent) wxBusyInfo::wxBusyInfo(const wxString& message, wxWindow *parent)
{ {
m_InfoFrame = new wxInfoFrame( parent, message); m_InfoFrame = new wxInfoFrame( parent, message);
m_InfoFrame->Show(TRUE); m_InfoFrame->Show(true);
#ifdef __WXMAC__ #ifdef __WXMAC__
m_InfoFrame->Update() ; m_InfoFrame->Update() ;
#else #else
@@ -116,7 +116,7 @@ wxBusyInfo::wxBusyInfo(const wxString& message, wxWindow *parent)
wxBusyInfo::~wxBusyInfo() wxBusyInfo::~wxBusyInfo()
{ {
m_InfoFrame->Show(FALSE); m_InfoFrame->Show(false);
m_InfoFrame->Close(); m_InfoFrame->Close();
wxYield(); wxYield();
} }

View File

@@ -96,12 +96,12 @@ BEGIN_EVENT_TABLE(wxCalendarCtrl, wxControl)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxMonthComboBox, wxComboBox) BEGIN_EVENT_TABLE(wxMonthComboBox, wxComboBox)
EVT_COMBOBOX(-1, wxMonthComboBox::OnMonthChange) EVT_COMBOBOX(wxID_ANY, wxMonthComboBox::OnMonthChange)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxYearSpinCtrl, wxSpinCtrl) BEGIN_EVENT_TABLE(wxYearSpinCtrl, wxSpinCtrl)
EVT_TEXT(-1, wxYearSpinCtrl::OnYearTextChange) EVT_TEXT(wxID_ANY, wxYearSpinCtrl::OnYearTextChange)
EVT_SPINCTRL(-1, wxYearSpinCtrl::OnYearChange) EVT_SPINCTRL(wxID_ANY, wxYearSpinCtrl::OnYearChange)
END_EVENT_TABLE() END_EVENT_TABLE()
#if wxUSE_EXTENDED_RTTI #if wxUSE_EXTENDED_RTTI
@@ -183,7 +183,7 @@ DEFINE_EVENT_TYPE(wxEVT_CALENDAR_WEEKDAY_CLICKED)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxMonthComboBox::wxMonthComboBox(wxCalendarCtrl *cal) wxMonthComboBox::wxMonthComboBox(wxCalendarCtrl *cal)
: wxComboBox(cal->GetParent(), -1, : wxComboBox(cal->GetParent(), wxID_ANY,
wxEmptyString, wxEmptyString,
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
@@ -199,11 +199,15 @@ wxMonthComboBox::wxMonthComboBox(wxCalendarCtrl *cal)
} }
SetSelection(m_cal->GetDate().GetMonth()); SetSelection(m_cal->GetDate().GetMonth());
SetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT); SetSize(wxDefaultPosition.x,
wxDefaultPosition.y,
wxDefaultSize.x,
wxDefaultSize.y,
wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT);
} }
wxYearSpinCtrl::wxYearSpinCtrl(wxCalendarCtrl *cal) wxYearSpinCtrl::wxYearSpinCtrl(wxCalendarCtrl *cal)
: wxSpinCtrl(cal->GetParent(), -1, : wxSpinCtrl(cal->GetParent(), wxID_ANY,
cal->GetDate().Format(_T("%Y")), cal->GetDate().Format(_T("%Y")),
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
@@ -238,7 +242,7 @@ void wxCalendarCtrl::Init()
m_staticYear = NULL; m_staticYear = NULL;
m_staticMonth = NULL; m_staticMonth = NULL;
m_userChangedYear = FALSE; m_userChangedYear = false;
m_widthCol = m_widthCol =
m_heightRow = 0; m_heightRow = 0;
@@ -276,7 +280,7 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
style | wxCLIP_CHILDREN | wxWANTS_CHARS, style | wxCLIP_CHILDREN | wxWANTS_CHARS,
wxDefaultValidator, name) ) wxDefaultValidator, name) )
{ {
return FALSE; return false;
} }
// needed to get the arrow keys normally used for the dialog navigation // needed to get the arrow keys normally used for the dialog navigation
@@ -290,12 +294,12 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) )
{ {
m_spinYear = new wxYearSpinCtrl(this); m_spinYear = new wxYearSpinCtrl(this);
m_staticYear = new wxStaticText(GetParent(), -1, m_date.Format(_T("%Y")), m_staticYear = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%Y")),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxALIGN_CENTRE); wxALIGN_CENTRE);
m_comboMonth = new wxMonthComboBox(this); m_comboMonth = new wxMonthComboBox(this);
m_staticMonth = new wxStaticText(GetParent(), -1, m_date.Format(_T("%B")), m_staticMonth = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%B")),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxALIGN_CENTRE); wxALIGN_CENTRE);
} }
@@ -303,12 +307,12 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
ShowCurrentControls(); ShowCurrentControls();
wxSize sizeReal; wxSize sizeReal;
if ( size.x == -1 || size.y == -1 ) if ( size.x == wxDefaultSize.x || size.y == wxDefaultSize.y )
{ {
sizeReal = DoGetBestSize(); sizeReal = DoGetBestSize();
if ( size.x != -1 ) if ( size.x != wxDefaultSize.x )
sizeReal.x = size.x; sizeReal.x = size.x;
if ( size.y != -1 ) if ( size.y != wxDefaultSize.y )
sizeReal.y = size.y; sizeReal.y = size.y;
} }
else else
@@ -327,7 +331,7 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
SetHolidayAttrs(); SetHolidayAttrs();
return TRUE; return true;
} }
wxCalendarCtrl::~wxCalendarCtrl() wxCalendarCtrl::~wxCalendarCtrl()
@@ -365,7 +369,7 @@ bool wxCalendarCtrl::Show(bool show)
{ {
if ( !wxControl::Show(show) ) if ( !wxControl::Show(show) )
{ {
return FALSE; return false;
} }
if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ) if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) )
@@ -377,14 +381,14 @@ bool wxCalendarCtrl::Show(bool show)
} }
} }
return TRUE; return true;
} }
bool wxCalendarCtrl::Enable(bool enable) bool wxCalendarCtrl::Enable(bool enable)
{ {
if ( !wxControl::Enable(enable) ) if ( !wxControl::Enable(enable) )
{ {
return FALSE; return false;
} }
if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ) if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) )
@@ -393,7 +397,7 @@ bool wxCalendarCtrl::Enable(bool enable)
GetYearControl()->Enable(enable); GetYearControl()->Enable(enable);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -484,7 +488,7 @@ void wxCalendarCtrl::EnableMonthChange(bool enable)
bool wxCalendarCtrl::SetDate(const wxDateTime& date) bool wxCalendarCtrl::SetDate(const wxDateTime& date)
{ {
bool retval = TRUE; bool retval = true;
bool sameMonth = m_date.GetMonth() == date.GetMonth(), bool sameMonth = m_date.GetMonth() == date.GetMonth(),
sameYear = m_date.GetYear() == date.GetYear(); sameYear = m_date.GetYear() == date.GetYear();
@@ -524,12 +528,12 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& date)
else else
{ {
// forbidden // forbidden
retval = FALSE; retval = false;
} }
} }
} }
m_userChangedYear = FALSE; m_userChangedYear = false;
return retval; return retval;
} }
@@ -580,15 +584,15 @@ void wxCalendarCtrl::SetDateAndNotify(const wxDateTime& date)
bool wxCalendarCtrl::SetLowerDateLimit(const wxDateTime& date /* = wxDefaultDateTime */) bool wxCalendarCtrl::SetLowerDateLimit(const wxDateTime& date /* = wxDefaultDateTime */)
{ {
bool retval = TRUE; bool retval = true;
if ( !(date.IsValid()) || ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : TRUE ) ) if ( !(date.IsValid()) || ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : true ) )
{ {
m_lowdate = date; m_lowdate = date;
} }
else else
{ {
retval = FALSE; retval = false;
} }
return retval; return retval;
@@ -596,15 +600,15 @@ bool wxCalendarCtrl::SetLowerDateLimit(const wxDateTime& date /* = wxDefaultDate
bool wxCalendarCtrl::SetUpperDateLimit(const wxDateTime& date /* = wxDefaultDateTime */) bool wxCalendarCtrl::SetUpperDateLimit(const wxDateTime& date /* = wxDefaultDateTime */)
{ {
bool retval = TRUE; bool retval = true;
if ( !(date.IsValid()) || ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE ) ) if ( !(date.IsValid()) || ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : true ) )
{ {
m_highdate = date; m_highdate = date;
} }
else else
{ {
retval = FALSE; retval = false;
} }
return retval; return retval;
@@ -612,18 +616,18 @@ bool wxCalendarCtrl::SetUpperDateLimit(const wxDateTime& date /* = wxDefaultDate
bool wxCalendarCtrl::SetDateRange(const wxDateTime& lowerdate /* = wxDefaultDateTime */, const wxDateTime& upperdate /* = wxDefaultDateTime */) bool wxCalendarCtrl::SetDateRange(const wxDateTime& lowerdate /* = wxDefaultDateTime */, const wxDateTime& upperdate /* = wxDefaultDateTime */)
{ {
bool retval = TRUE; bool retval = true;
if ( if (
( !( lowerdate.IsValid() ) || ( ( upperdate.IsValid() ) ? ( lowerdate <= upperdate ) : TRUE ) ) && ( !( lowerdate.IsValid() ) || ( ( upperdate.IsValid() ) ? ( lowerdate <= upperdate ) : true ) ) &&
( !( upperdate.IsValid() ) || ( ( lowerdate.IsValid() ) ? ( upperdate >= lowerdate ) : TRUE ) ) ) ( !( upperdate.IsValid() ) || ( ( lowerdate.IsValid() ) ? ( upperdate >= lowerdate ) : true ) ) )
{ {
m_lowdate = lowerdate; m_lowdate = lowerdate;
m_highdate = upperdate; m_highdate = upperdate;
} }
else else
{ {
retval = FALSE; retval = false;
} }
return retval; return retval;
@@ -663,20 +667,20 @@ bool wxCalendarCtrl::IsDateShown(const wxDateTime& date) const
} }
else else
{ {
return TRUE; return true;
} }
} }
bool wxCalendarCtrl::IsDateInRange(const wxDateTime& date) const bool wxCalendarCtrl::IsDateInRange(const wxDateTime& date) const
{ {
// Check if the given date is in the range specified // Check if the given date is in the range specified
return ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : TRUE ) return ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : true )
&& ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : TRUE ) ); && ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : true ) );
} }
bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
{ {
bool retval = FALSE; bool retval = false;
if ( !(IsDateInRange(*target)) ) if ( !(IsDateInRange(*target)) )
{ {
@@ -685,7 +689,7 @@ bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
if ( target->GetYear() >= GetLowerDateLimit().GetYear() ) if ( target->GetYear() >= GetLowerDateLimit().GetYear() )
{ {
*target = GetLowerDateLimit(); *target = GetLowerDateLimit();
retval = TRUE; retval = true;
} }
else else
{ {
@@ -697,7 +701,7 @@ bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
if ( target->GetYear() <= GetUpperDateLimit().GetYear() ) if ( target->GetYear() <= GetUpperDateLimit().GetYear() )
{ {
*target = GetUpperDateLimit(); *target = GetUpperDateLimit();
retval = TRUE; retval = true;
} }
else else
{ {
@@ -707,7 +711,7 @@ bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
} }
else else
{ {
retval = TRUE; retval = true;
} }
return retval; return retval;
@@ -715,11 +719,11 @@ bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const
bool wxCalendarCtrl::ChangeMonth(wxDateTime* target) const bool wxCalendarCtrl::ChangeMonth(wxDateTime* target) const
{ {
bool retval = TRUE; bool retval = true;
if ( !(IsDateInRange(*target)) ) if ( !(IsDateInRange(*target)) )
{ {
retval = FALSE; retval = false;
if ( target->GetMonth() < m_date.GetMonth() ) if ( target->GetMonth() < m_date.GetMonth() )
{ {
@@ -994,7 +998,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
{ {
wxDateTime ldpm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) - wxDateSpan::Day(); // last day prev month wxDateTime ldpm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) - wxDateSpan::Day(); // last day prev month
// Check if range permits change // Check if range permits change
if ( IsDateInRange(ldpm) && ( ( ldpm.GetYear() == m_date.GetYear() ) ? TRUE : AllowYearChange() ) ) if ( IsDateInRange(ldpm) && ( ( ldpm.GetYear() == m_date.GetYear() ) ? true : AllowYearChange() ) )
{ {
m_leftArrowRect = wxRect(larrowx - 3, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6)); m_leftArrowRect = wxRect(larrowx - 3, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID)); dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
@@ -1004,7 +1008,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
dc.DrawRectangle(m_leftArrowRect); dc.DrawRectangle(m_leftArrowRect);
} }
wxDateTime fdnm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) + wxDateSpan::Month(); // first day next month wxDateTime fdnm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) + wxDateSpan::Month(); // first day next month
if ( IsDateInRange(fdnm) && ( ( fdnm.GetYear() == m_date.GetYear() ) ? TRUE : AllowYearChange() ) ) if ( IsDateInRange(fdnm) && ( ( fdnm.GetYear() == m_date.GetYear() ) ? true : AllowYearChange() ) )
{ {
m_rightArrowRect = wxRect(rarrowx - 4, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6)); m_rightArrowRect = wxRect(rarrowx - 4, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
dc.SetBrush(wxBrush(*wxBLACK, wxSOLID)); dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
@@ -1082,10 +1086,10 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
wxCoord width; wxCoord width;
dc.GetTextExtent(dayStr, &width, (wxCoord *)NULL); dc.GetTextExtent(dayStr, &width, (wxCoord *)NULL);
bool changedColours = FALSE, bool changedColours = false,
changedFont = FALSE; changedFont = false;
bool isSel = FALSE; bool isSel = false;
wxCalendarDateAttr *attr = NULL; wxCalendarDateAttr *attr = NULL;
if ( date.GetMonth() != m_date.GetMonth() || !IsDateInRange(date) ) if ( date.GetMonth() != m_date.GetMonth() || !IsDateInRange(date) )
@@ -1093,7 +1097,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
// surrounding week or out-of-range // surrounding week or out-of-range
// draw "disabled" // draw "disabled"
dc.SetTextForeground(*wxLIGHT_GREY); dc.SetTextForeground(*wxLIGHT_GREY);
changedColours = TRUE; changedColours = true;
} }
else else
{ {
@@ -1105,7 +1109,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
dc.SetTextForeground(m_colHighlightFg); dc.SetTextForeground(m_colHighlightFg);
dc.SetTextBackground(m_colHighlightBg); dc.SetTextBackground(m_colHighlightBg);
changedColours = TRUE; changedColours = true;
} }
else if ( attr ) else if ( attr )
{ {
@@ -1125,19 +1129,19 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
if ( colFg.Ok() ) if ( colFg.Ok() )
{ {
dc.SetTextForeground(colFg); dc.SetTextForeground(colFg);
changedColours = TRUE; changedColours = true;
} }
if ( colBg.Ok() ) if ( colBg.Ok() )
{ {
dc.SetTextBackground(colBg); dc.SetTextBackground(colBg);
changedColours = TRUE; changedColours = true;
} }
if ( attr->HasFont() ) if ( attr->HasFont() )
{ {
dc.SetFont(attr->GetFont()); dc.SetFont(attr->GetFont());
changedFont = TRUE; changedFont = true;
} }
} }
} }
@@ -1257,7 +1261,7 @@ void wxCalendarCtrl::RefreshDate(const wxDateTime& date)
rect.x + rect.width, rect.y + rect.height); rect.x + rect.width, rect.y + rect.height);
#endif #endif
Refresh(TRUE, &rect); Refresh(true, &rect);
} }
void wxCalendarCtrl::HighlightRange(wxPaintDC* pDC, const wxDateTime& fromdate, const wxDateTime& todate, wxPen* pPen, wxBrush* pBrush) void wxCalendarCtrl::HighlightRange(wxPaintDC* pDC, const wxDateTime& fromdate, const wxDateTime& todate, wxPen* pPen, wxBrush* pBrush)
@@ -1351,7 +1355,7 @@ void wxCalendarCtrl::HighlightRange(wxPaintDC* pDC, const wxDateTime& fromdate,
bool wxCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *week) const bool wxCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *week) const
{ {
bool retval = TRUE; bool retval = true;
#if DEBUG_PAINT #if DEBUG_PAINT
wxLogDebug("+++ GetDateCoord: (%s) +++", date.Format("%d %m %Y")); wxLogDebug("+++ GetDateCoord: (%s) +++", date.Format("%d %m %Y"));
@@ -1428,7 +1432,7 @@ bool wxCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *week) c
{ {
*day = -1; *day = -1;
*week = -1; *week = -1;
retval = FALSE; retval = false;
} }
#if DEBUG_PAINT #if DEBUG_PAINT
@@ -1803,7 +1807,7 @@ void wxCalendarCtrl::SetHoliday(size_t day)
attr = new wxCalendarDateAttr; attr = new wxCalendarDateAttr;
} }
attr->SetHoliday(TRUE); attr->SetHoliday(true);
// can't use SetAttr() because it would delete this pointer // can't use SetAttr() because it would delete this pointer
m_attrs[day - 1] = attr; m_attrs[day - 1] = attr;
@@ -1815,7 +1819,7 @@ void wxCalendarCtrl::ResetHolidayAttrs()
{ {
if ( m_attrs[day] ) if ( m_attrs[day] )
{ {
m_attrs[day]->SetHoliday(FALSE); m_attrs[day]->SetHoliday(false);
} }
} }
} }

View File

@@ -90,8 +90,8 @@ void wxCaretBase::SetBlinkTime(int milliseconds)
void wxCaret::InitGeneric() void wxCaret::InitGeneric()
{ {
m_hasFocus = TRUE; m_hasFocus = true;
m_blinkedOut = TRUE; m_blinkedOut = true;
m_xOld = m_xOld =
m_yOld = -1; m_yOld = -1;
@@ -156,7 +156,7 @@ void wxCaret::DoMove()
void wxCaret::OnSetFocus() void wxCaret::OnSetFocus()
{ {
m_hasFocus = TRUE; m_hasFocus = true;
if ( IsVisible() ) if ( IsVisible() )
Refresh(); Refresh();
@@ -164,7 +164,7 @@ void wxCaret::OnSetFocus()
void wxCaret::OnKillFocus() void wxCaret::OnKillFocus()
{ {
m_hasFocus = FALSE; m_hasFocus = false;
if ( IsVisible() ) if ( IsVisible() )
{ {

View File

@@ -246,8 +246,8 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
const wxPoint& pos, const wxPoint& pos,
long styleLbox) long styleLbox)
{ {
if ( !wxDialog::Create(parent, -1, caption, pos, wxDefaultSize, styleDlg) ) if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg) )
return FALSE; return false;
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
@@ -266,13 +266,13 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 3) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 4) buttons // 4) buttons
topsizer->Add( CreateButtonSizer( styleDlg & (wxOK|wxCANCEL) ), 0, wxCENTRE | wxALL, 10 ); topsizer->Add( CreateButtonSizer( styleDlg & (wxOK|wxCANCEL) ), 0, wxCENTRE | wxALL, 10 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );
@@ -282,7 +282,7 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
m_listbox->SetFocus(); m_listbox->SetFocus();
return TRUE; return true;
} }
bool wxAnyChoiceDialog::Create(wxWindow *parent, bool wxAnyChoiceDialog::Create(wxWindow *parent,
@@ -344,7 +344,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *parent,
if ( !wxAnyChoiceDialog::Create(parent, message, caption, if ( !wxAnyChoiceDialog::Create(parent, message, caption,
n, choices, n, choices,
style, pos) ) style, pos) )
return FALSE; return false;
m_selection = n > 0 ? 0 : -1; m_selection = n > 0 ? 0 : -1;
@@ -354,7 +354,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *parent,
m_listbox->SetClientData(i, clientData[i]); m_listbox->SetClientData(i, clientData[i]);
} }
return TRUE; return true;
} }
bool wxSingleChoiceDialog::Create( wxWindow *parent, bool wxSingleChoiceDialog::Create( wxWindow *parent,
@@ -415,9 +415,9 @@ bool wxMultiChoiceDialog::Create( wxWindow *parent,
n, choices, n, choices,
style, pos, style, pos,
wxLB_ALWAYS_SB | wxLB_EXTENDED) ) wxLB_ALWAYS_SB | wxLB_EXTENDED) )
return FALSE; return false;
return TRUE; return true;
} }
bool wxMultiChoiceDialog::Create( wxWindow *parent, bool wxMultiChoiceDialog::Create( wxWindow *parent,
@@ -451,7 +451,7 @@ bool wxMultiChoiceDialog::TransferDataFromWindow()
m_selections.Add(n); m_selections.Add(n);
} }
return TRUE; return true;
} }
#endif // wxUSE_CHOICEDLG #endif // wxUSE_CHOICEDLG

View File

@@ -143,9 +143,9 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data) bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
{ {
if ( !wxDialog::Create(parent, -1, _("Choose colour"), if ( !wxDialog::Create(parent, wxID_ANY, _("Choose colour"),
wxPoint(0, 0), wxSize(900, 900)) ) wxPoint(0, 0), wxSize(900, 900)) )
return FALSE; return false;
dialogParent = parent; dialogParent = parent;
@@ -156,7 +156,7 @@ bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
CalculateMeasurements(); CalculateMeasurements();
CreateWidgets(); CreateWidgets();
return TRUE; return true;
} }
int wxGenericColourDialog::ShowModal() int wxGenericColourDialog::ShowModal()
@@ -214,7 +214,7 @@ void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
PaintBasicColours(dc); PaintBasicColours(dc);
PaintCustomColours(dc); PaintCustomColours(dc);
PaintCustomColour(dc); PaintCustomColour(dc);
PaintHighlight(dc, TRUE); PaintHighlight(dc, true);
} }
void wxGenericColourDialog::CalculateMeasurements() void wxGenericColourDialog::CalculateMeasurements()
@@ -265,11 +265,11 @@ void wxGenericColourDialog::CreateWidgets()
#endif #endif
redSlider = new wxSlider(this, wxID_RED_SLIDER, singleCustomColour.Red(), 0, 255, redSlider = new wxSlider(this, wxID_RED_SLIDER, singleCustomColour.Red(), 0, 255,
wxPoint(sliderX, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS); wxPoint(sliderX, 10), wxSize(wxDefaultSize.x, sliderHeight), wxVERTICAL|wxSL_LABELS);
greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, singleCustomColour.Green(), 0, 255, greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, singleCustomColour.Green(), 0, 255,
wxPoint(sliderX + sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS); wxPoint(sliderX + sliderSpacing, 10), wxSize(wxDefaultSize.x, sliderHeight), wxVERTICAL|wxSL_LABELS);
blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, singleCustomColour.Blue(), 0, 255, blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, singleCustomColour.Blue(), 0, 255,
wxPoint(sliderX + 2*sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS); wxPoint(sliderX + 2*sliderSpacing, 10), wxSize(wxDefaultSize.x, sliderHeight), wxVERTICAL|wxSL_LABELS);
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
@@ -278,7 +278,7 @@ void wxGenericColourDialog::CreateWidgets()
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 2) static line // 2) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 3) buttons // 3) buttons
@@ -286,7 +286,7 @@ void wxGenericColourDialog::CreateWidgets()
buttonsizer->Add( new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours") ), 0, wxLEFT|wxRIGHT, 10 ); buttonsizer->Add( new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours") ), 0, wxLEFT|wxRIGHT, 10 );
topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 ); topsizer->Add( buttonsizer, 0, wxCENTRE | wxALL, 10 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );
@@ -322,7 +322,7 @@ void wxGenericColourDialog::InitializeColours(void)
wxColour curr = colourData.GetColour(); wxColour curr = colourData.GetColour();
if ( curr.Ok() ) if ( curr.Ok() )
{ {
bool initColourFound = FALSE; bool initColourFound = false;
for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++) for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
{ {
@@ -330,7 +330,7 @@ void wxGenericColourDialog::InitializeColours(void)
{ {
whichKind = 1; whichKind = 1;
colourSelection = i; colourSelection = i;
initColourFound = TRUE; initColourFound = true;
break; break;
} }
} }
@@ -479,7 +479,7 @@ void wxGenericColourDialog::OnBasicColourClick(int which)
{ {
wxClientDC dc(this); wxClientDC dc(this);
PaintHighlight(dc, FALSE); PaintHighlight(dc, false);
whichKind = 1; whichKind = 1;
colourSelection = which; colourSelection = which;
colourData.SetColour(standardColours[colourSelection]); colourData.SetColour(standardColours[colourSelection]);
@@ -489,13 +489,13 @@ void wxGenericColourDialog::OnBasicColourClick(int which)
singleCustomColour.Set(standardColours[colourSelection].Red(), standardColours[colourSelection].Green(), standardColours[colourSelection].Blue()); singleCustomColour.Set(standardColours[colourSelection].Red(), standardColours[colourSelection].Green(), standardColours[colourSelection].Blue());
PaintCustomColour(dc); PaintCustomColour(dc);
PaintHighlight(dc, TRUE); PaintHighlight(dc, true);
} }
void wxGenericColourDialog::OnCustomColourClick(int which) void wxGenericColourDialog::OnCustomColourClick(int which)
{ {
wxClientDC dc(this); wxClientDC dc(this);
PaintHighlight(dc, FALSE); PaintHighlight(dc, false);
whichKind = 2; whichKind = 2;
colourSelection = which; colourSelection = which;
colourData.SetColour(customColours[colourSelection]); colourData.SetColour(customColours[colourSelection]);
@@ -504,19 +504,19 @@ void wxGenericColourDialog::OnCustomColourClick(int which)
blueSlider->SetValue( customColours[colourSelection].Blue() ); blueSlider->SetValue( customColours[colourSelection].Blue() );
singleCustomColour.Set(customColours[colourSelection].Red(), customColours[colourSelection].Green(), customColours[colourSelection].Blue()); singleCustomColour.Set(customColours[colourSelection].Red(), customColours[colourSelection].Green(), customColours[colourSelection].Blue());
PaintCustomColour(dc); PaintCustomColour(dc);
PaintHighlight(dc, TRUE); PaintHighlight(dc, true);
} }
/* /*
void wxGenericColourDialog::OnOk(void) void wxGenericColourDialog::OnOk(void)
{ {
Show(FALSE); Show(false);
} }
void wxGenericColourDialog::OnCancel(void) void wxGenericColourDialog::OnCancel(void)
{ {
colourDialogCancelled = TRUE; colourDialogCancelled = true;
Show(FALSE); Show(false);
} }
*/ */
@@ -525,10 +525,10 @@ void wxGenericColourDialog::OnAddCustom(wxCommandEvent& WXUNUSED(event))
wxClientDC dc(this); wxClientDC dc(this);
if (whichKind != 2) if (whichKind != 2)
{ {
PaintHighlight(dc, FALSE); PaintHighlight(dc, false);
whichKind = 2; whichKind = 2;
colourSelection = 0; colourSelection = 0;
PaintHighlight(dc, TRUE); PaintHighlight(dc, true);
} }
customColours[colourSelection].Set(singleCustomColour.Red(), singleCustomColour.Green(), singleCustomColour.Blue()); customColours[colourSelection].Set(singleCustomColour.Red(), singleCustomColour.Green(), singleCustomColour.Blue());

View File

@@ -274,7 +274,7 @@ wxPostScriptDC::wxPostScriptDC ()
m_pageNumber = 0; m_pageNumber = 0;
m_clipping = FALSE; m_clipping = false;
m_underlinePosition = 0.0; m_underlinePosition = 0.0;
m_underlineThickness = 0.0; m_underlineThickness = 0.0;
@@ -293,7 +293,7 @@ wxPostScriptDC::wxPostScriptDC (const wxPrintData& printData)
m_pageNumber = 0; m_pageNumber = 0;
m_clipping = FALSE; m_clipping = false;
m_underlinePosition = 0.0; m_underlinePosition = 0.0;
m_underlineThickness = 0.0; m_underlineThickness = 0.0;
@@ -303,7 +303,7 @@ wxPostScriptDC::wxPostScriptDC (const wxPrintData& printData)
m_printData = printData; m_printData = printData;
m_ok = TRUE; m_ok = true;
} }
wxPostScriptDC::~wxPostScriptDC () wxPostScriptDC::~wxPostScriptDC ()
@@ -326,16 +326,16 @@ bool wxPostScriptDC::Create( const wxString &output, bool interactive, wxWindow
{ {
wxPrintDialogData ddata( data ); wxPrintDialogData ddata( data );
wxPrintDialog dialog( parent, &data ); wxPrintDialog dialog( parent, &data );
dialog.GetPrintDialogData().SetSetupDialog(TRUE); dialog.GetPrintDialogData().SetSetupDialog(true);
if (dialog.ShowModal() != wxID_OK) if (dialog.ShowModal() != wxID_OK)
{ {
m_ok = FALSE; m_ok = false;
return FALSE; return false;
} }
data = dialog.GetPrintDialogData().GetPrintData(); data = dialog.GetPrintDialogData().GetPrintData();
} }
return TRUE; return true;
} }
#endif #endif
@@ -353,7 +353,7 @@ void wxPostScriptDC::DoSetClippingRegion (wxCoord x, wxCoord y, wxCoord w, wxCoo
wxDC::DoSetClippingRegion(x, y, w, h); wxDC::DoSetClippingRegion(x, y, w, h);
m_clipping = TRUE; m_clipping = true;
PsPrintf( wxT("gsave\n newpath\n") PsPrintf( wxT("gsave\n newpath\n")
wxT("%d %d moveto\n") wxT("%d %d moveto\n")
@@ -374,7 +374,7 @@ void wxPostScriptDC::DestroyClippingRegion()
if (m_clipping) if (m_clipping)
{ {
m_clipping = FALSE; m_clipping = false;
PsPrint( "grestore\n" ); PsPrint( "grestore\n" );
} }
@@ -391,13 +391,13 @@ void wxPostScriptDC::Clear()
bool wxPostScriptDC::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style)) bool wxPostScriptDC::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style))
{ {
wxFAIL_MSG( wxT("wxPostScriptDC::FloodFill not implemented.") ); wxFAIL_MSG( wxT("wxPostScriptDC::FloodFill not implemented.") );
return FALSE; return false;
} }
bool wxPostScriptDC::DoGetPixel (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxColour * WXUNUSED(col)) const bool wxPostScriptDC::DoGetPixel (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxColour * WXUNUSED(col)) const
{ {
wxFAIL_MSG( wxT("wxPostScriptDC::GetPixel not implemented.") ); wxFAIL_MSG( wxT("wxPostScriptDC::GetPixel not implemented.") );
return FALSE; return false;
} }
void wxPostScriptDC::DoCrossHair (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) void wxPostScriptDC::DoCrossHair (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
@@ -863,7 +863,7 @@ void wxPostScriptDC::DoDrawEllipse (wxCoord x, wxCoord y, wxCoord width, wxCoord
void wxPostScriptDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y ) void wxPostScriptDC::DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y )
{ {
DrawBitmap( icon, x, y, TRUE ); DrawBitmap( icon, x, y, true );
} }
/* this has to be char, not wxChar */ /* this has to be char, not wxChar */
@@ -1780,11 +1780,11 @@ wxSize wxPostScriptDC::GetPPI(void) const
bool wxPostScriptDC::StartDoc( const wxString& message ) bool wxPostScriptDC::StartDoc( const wxString& message )
{ {
wxCHECK_MSG( m_ok, FALSE, wxT("invalid postscript dc") ); wxCHECK_MSG( m_ok, false, wxT("invalid postscript dc") );
if ( m_printData.GetPrintMode() != wxPRINT_MODE_STREAM ) if ( m_printData.GetPrintMode() != wxPRINT_MODE_STREAM )
{ {
if (m_printData.GetFilename() == wxT("")) if (m_printData.GetFilename() == wxEmptyString)
{ {
wxString filename = wxGetTempFileName( wxT("ps") ); wxString filename = wxGetTempFileName( wxT("ps") );
m_printData.SetFilename(filename); m_printData.SetFilename(filename);
@@ -1796,12 +1796,12 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
if (!m_pstream) if (!m_pstream)
{ {
wxLogError( _("Cannot open file for PostScript printing!")); wxLogError( _("Cannot open file for PostScript printing!"));
m_ok = FALSE; m_ok = false;
return FALSE; return false;
} }
} }
m_ok = TRUE; m_ok = true;
m_title = message; m_title = message;
PsPrint( "%!PS-Adobe-2.0\n" ); PsPrint( "%!PS-Adobe-2.0\n" );
@@ -1861,7 +1861,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
wxPageNumber = 1; wxPageNumber = 1;
m_pageNumber = 1; m_pageNumber = 1;
return TRUE; return true;
} }
void wxPostScriptDC::EndDoc () void wxPostScriptDC::EndDoc ()
@@ -1870,7 +1870,7 @@ void wxPostScriptDC::EndDoc ()
if (m_clipping) if (m_clipping)
{ {
m_clipping = FALSE; m_clipping = false;
PsPrint( "grestore\n" ); PsPrint( "grestore\n" );
} }
@@ -1955,7 +1955,7 @@ void wxPostScriptDC::EndDoc ()
command += wxT(" "); command += wxT(" ");
command += m_printData.GetFilename(); command += m_printData.GetFilename();
wxExecute( command, TRUE ); wxExecute( command, true );
wxRemoveFile( m_printData.GetFilename() ); wxRemoveFile( m_printData.GetFilename() );
} }
#endif #endif
@@ -2019,9 +2019,9 @@ bool wxPostScriptDC::DoBlit( wxCoord xdest, wxCoord ydest,
wxCoord xsrc, wxCoord ysrc, wxCoord xsrc, wxCoord ysrc,
int rop, bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) ) int rop, bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) )
{ {
wxCHECK_MSG( m_ok, FALSE, wxT("invalid postscript dc") ); wxCHECK_MSG( m_ok, false, wxT("invalid postscript dc") );
wxCHECK_MSG( source, FALSE, wxT("invalid source dc") ); wxCHECK_MSG( source, false, wxT("invalid source dc") );
/* blit into a bitmap */ /* blit into a bitmap */
wxBitmap bitmap( (int)fwidth, (int)fheight ); wxBitmap bitmap( (int)fwidth, (int)fheight );
@@ -2033,7 +2033,7 @@ bool wxPostScriptDC::DoBlit( wxCoord xdest, wxCoord ydest,
/* draw bitmap. scaling and positioning is done there */ /* draw bitmap. scaling and positioning is done there */
DrawBitmap( bitmap, xdest, ydest ); DrawBitmap( bitmap, xdest, ydest );
return TRUE; return true;
} }
wxCoord wxPostScriptDC::GetCharHeight() const wxCoord wxPostScriptDC::GetCharHeight() const
@@ -2146,7 +2146,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
/ /
/ example: / example:
/ /
/ wxPostScriptDC dc(NULL, TRUE); / wxPostScriptDC dc(NULL, true);
/ if (dc.Ok()){ / if (dc.Ok()){
/ wxSetAFMPath("d:\\wxw161\\afm\\"); / wxSetAFMPath("d:\\wxw161\\afm\\");
/ dc.StartDoc("Test"); / dc.StartDoc("Test");
@@ -2525,12 +2525,12 @@ bool wxPostScriptModule::OnInit()
{ {
wxInitializePrintSetupData(); wxInitializePrintSetupData();
return TRUE; return true;
} }
void wxPostScriptModule::OnExit() void wxPostScriptModule::OnExit()
{ {
wxInitializePrintSetupData(FALSE); wxInitializePrintSetupData(false);
} }
#endif #endif
// WXWIN_COMPATIBILITY_2_2 // WXWIN_COMPATIBILITY_2_2

View File

@@ -160,7 +160,8 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI
ULONG ulDriveNum = 0; ULONG ulDriveNum = 0;
ULONG ulDriveMap = 0; ULONG ulDriveMap = 0;
rc = ::DosQueryCurrentDisk(&ulDriveNum, &ulDriveMap); rc = ::DosQueryCurrentDisk(&ulDriveNum, &ulDriveMap);
if ( rc == 0){ if ( rc == 0)
{
size_t i = 0; size_t i = 0;
while (i < 26) while (i < 26)
{ {
@@ -307,7 +308,7 @@ bool wxIsDriveAvailable(const wxString& dirName)
if ( dirName.Len() == 3 && dirName[1u] == wxT(':') ) if ( dirName.Len() == 3 && dirName[1u] == wxT(':') )
{ {
wxString dirNameLower(dirName.Lower()); wxString dirNameLower(dirName.Lower());
// VS: always return TRUE for removable media, since Win95 doesn't // VS: always return true for removable media, since Win95 doesn't
// like it when MS-DOS app accesses empty floppy drive // like it when MS-DOS app accesses empty floppy drive
return (dirNameLower[0u] == wxT('a') || return (dirNameLower[0u] == wxT('a') ||
dirNameLower[0u] == wxT('b') || dirNameLower[0u] == wxT('b') ||
@@ -315,7 +316,7 @@ bool wxIsDriveAvailable(const wxString& dirName)
} }
else else
#endif #endif
return TRUE; return true;
} }
#elif defined(__WINDOWS__) || defined(__OS2__) #elif defined(__WINDOWS__) || defined(__OS2__)
@@ -355,12 +356,12 @@ int setdrive(int drive)
bool wxIsDriveAvailable(const wxString& dirName) bool wxIsDriveAvailable(const wxString& dirName)
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return FALSE; return false;
#else #else
#ifdef __WIN32__ #ifdef __WIN32__
UINT errorMode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); UINT errorMode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
#endif #endif
bool success = TRUE; bool success = true;
// Check if this is a root directory and if so, // Check if this is a root directory and if so,
// whether the drive is available. // whether the drive is available.
@@ -382,7 +383,7 @@ bool wxIsDriveAvailable(const wxString& dirName)
if (err == -1) if (err == -1)
{ {
success = FALSE; success = false;
} }
#endif #endif
} }
@@ -416,8 +417,8 @@ wxDirItemData::wxDirItemData(const wxString& path, const wxString& name,
* In UnixLand we just check whether the first char is a dot * In UnixLand we just check whether the first char is a dot
* For FileNameFromPath read LastDirNameInThisPath ;-) */ * For FileNameFromPath read LastDirNameInThisPath ;-) */
// m_isHidden = (bool)(wxFileNameFromPath(*m_path)[0] == '.'); // m_isHidden = (bool)(wxFileNameFromPath(*m_path)[0] == '.');
m_isHidden = FALSE; m_isHidden = false;
m_isExpanded = FALSE; m_isExpanded = false;
m_isDir = isDir; m_isDir = isDir;
} }
@@ -434,13 +435,13 @@ void wxDirItemData::SetNewDirName(const wxString& path)
bool wxDirItemData::HasSubDirs() const bool wxDirItemData::HasSubDirs() const
{ {
if (m_path.IsEmpty()) if (m_path.IsEmpty())
return FALSE; return false;
wxDir dir; wxDir dir;
{ {
wxLogNull nolog; wxLogNull nolog;
if ( !dir.Open(m_path) ) if ( !dir.Open(m_path) )
return FALSE; return false;
} }
return dir.HasSubDirs(); return dir.HasSubDirs();
@@ -449,13 +450,13 @@ bool wxDirItemData::HasSubDirs() const
bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const
{ {
if (m_path.IsEmpty()) if (m_path.IsEmpty())
return FALSE; return false;
wxDir dir; wxDir dir;
{ {
wxLogNull nolog; wxLogNull nolog;
if ( !dir.Open(m_path) ) if ( !dir.Open(m_path) )
return FALSE; return false;
} }
return dir.HasFiles(); return dir.HasFiles();
@@ -547,7 +548,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
const wxString& name) const wxString& name)
{ {
if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name)) if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
return FALSE; return false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
@@ -584,8 +585,8 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
m_treeCtrl->SetImageList(wxTheFileIconsTable->GetSmallImageList()); m_treeCtrl->SetImageList(wxTheFileIconsTable->GetSmallImageList());
m_showHidden = FALSE; m_showHidden = false;
wxDirItemData* rootData = new wxDirItemData(wxT(""), wxT(""), TRUE); wxDirItemData* rootData = new wxDirItemData(wxEmptyString, wxEmptyString, true);
wxString rootName; wxString rootName;
@@ -606,7 +607,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
SetBestSize(size); SetBestSize(size);
DoResize(); DoResize();
return TRUE; return true;
} }
wxGenericDirCtrl::~wxGenericDirCtrl() wxGenericDirCtrl::~wxGenericDirCtrl()
@@ -615,7 +616,7 @@ wxGenericDirCtrl::~wxGenericDirCtrl()
void wxGenericDirCtrl::Init() void wxGenericDirCtrl::Init()
{ {
m_showHidden = FALSE; m_showHidden = false;
m_currentFilter = 0; m_currentFilter = 0;
m_currentFilterStr = wxEmptyString; // Default: any file m_currentFilterStr = wxEmptyString; // Default: any file
m_treeCtrl = NULL; m_treeCtrl = NULL;
@@ -634,7 +635,7 @@ void wxGenericDirCtrl::ShowHidden( bool show )
const wxTreeItemId const wxTreeItemId
wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, int imageId) wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, int imageId)
{ {
wxDirItemData *dir_item = new wxDirItemData(path,name,TRUE); wxDirItemData *dir_item = new wxDirItemData(path,name,true);
wxTreeItemId id = AppendItem( m_rootId, name, imageId, -1, dir_item); wxTreeItemId id = AppendItem( m_rootId, name, imageId, -1, dir_item);
@@ -744,7 +745,7 @@ void wxGenericDirCtrl::CollapseDir(wxTreeItemId parentId)
if (!data->m_isExpanded) if (!data->m_isExpanded)
return; return;
data->m_isExpanded = FALSE; data->m_isExpanded = false;
wxTreeItemIdValue cookie; wxTreeItemIdValue cookie;
/* Workaround because DeleteChildren has disapeared (why?) and /* Workaround because DeleteChildren has disapeared (why?) and
* CollapseAndReset doesn't work as advertised (deletes parent too) */ * CollapseAndReset doesn't work as advertised (deletes parent too) */
@@ -765,7 +766,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
if (data->m_isExpanded) if (data->m_isExpanded)
return; return;
data->m_isExpanded = TRUE; data->m_isExpanded = true;
if (parentId == m_treeCtrl->GetRootItem()) if (parentId == m_treeCtrl->GetRootItem())
{ {
@@ -784,7 +785,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
// whether the drive is avaiable. // whether the drive is avaiable.
if (!wxIsDriveAvailable(dirName)) if (!wxIsDriveAvailable(dirName))
{ {
data->m_isExpanded = FALSE; data->m_isExpanded = false;
//wxMessageBox(wxT("Sorry, this drive is not available.")); //wxMessageBox(wxT("Sorry, this drive is not available."));
return; return;
} }
@@ -869,7 +870,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
path += wxString(wxFILE_SEP_PATH); path += wxString(wxFILE_SEP_PATH);
path += eachFilename; path += eachFilename;
wxDirItemData *dir_item = new wxDirItemData(path,eachFilename,TRUE); wxDirItemData *dir_item = new wxDirItemData(path,eachFilename,true);
wxTreeItemId id = AppendItem( parentId, eachFilename, wxTreeItemId id = AppendItem( parentId, eachFilename,
wxFileIconsTable::folder, -1, dir_item); wxFileIconsTable::folder, -1, dir_item);
m_treeCtrl->SetItemImage( id, wxFileIconsTable::folder_open, m_treeCtrl->SetItemImage( id, wxFileIconsTable::folder_open,
@@ -898,7 +899,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
path += wxString(wxFILE_SEP_PATH); path += wxString(wxFILE_SEP_PATH);
path += eachFilename; path += eachFilename;
//path = dirName + wxString(wxT("/")) + eachFilename; //path = dirName + wxString(wxT("/")) + eachFilename;
wxDirItemData *dir_item = new wxDirItemData(path,eachFilename,FALSE); wxDirItemData *dir_item = new wxDirItemData(path,eachFilename,false);
int image_id = wxFileIconsTable::file; int image_id = wxFileIconsTable::file;
if (eachFilename.Find(wxT('.')) != wxNOT_FOUND) if (eachFilename.Find(wxT('.')) != wxNOT_FOUND)
image_id = wxTheFileIconsTable->GetIconID(eachFilename.AfterLast(wxT('.'))); image_id = wxTheFileIconsTable->GetIconID(eachFilename.AfterLast(wxT('.')));
@@ -955,9 +956,9 @@ wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString&
if (childPath == path3) if (childPath == path3)
{ {
if (path3.Len() == path2.Len()) if (path3.Len() == path2.Len())
done = TRUE; done = true;
else else
done = FALSE; done = false;
return childId; return childId;
} }
} }
@@ -973,7 +974,7 @@ wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString&
// and select the given tree item. // and select the given tree item.
bool wxGenericDirCtrl::ExpandPath(const wxString& path) bool wxGenericDirCtrl::ExpandPath(const wxString& path)
{ {
bool done = FALSE; bool done = false;
wxTreeItemId id = FindChild(m_rootId, path, done); wxTreeItemId id = FindChild(m_rootId, path, done);
wxTreeItemId lastId = id; // The last non-zero id wxTreeItemId lastId = id; // The last non-zero id
while (id.IsOk() && !done) while (id.IsOk() && !done)
@@ -996,16 +997,16 @@ bool wxGenericDirCtrl::ExpandPath(const wxString& path)
// Find the first file in this directory // Find the first file in this directory
wxTreeItemIdValue cookie; wxTreeItemIdValue cookie;
wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie); wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie);
bool selectedChild = FALSE; bool selectedChild = false;
while (childId.IsOk()) while (childId.IsOk())
{ {
wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId); wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId);
if (data && data->m_path != wxT("") && !data->m_isDir) if (data && data->m_path != wxEmptyString && !data->m_isDir)
{ {
m_treeCtrl->SelectItem(childId); m_treeCtrl->SelectItem(childId);
m_treeCtrl->EnsureVisible(childId); m_treeCtrl->EnsureVisible(childId);
selectedChild = TRUE; selectedChild = true;
break; break;
} }
childId = m_treeCtrl->GetNextChild(lastId, cookie); childId = m_treeCtrl->GetNextChild(lastId, cookie);
@@ -1022,10 +1023,10 @@ bool wxGenericDirCtrl::ExpandPath(const wxString& path)
m_treeCtrl->EnsureVisible(lastId); m_treeCtrl->EnsureVisible(lastId);
} }
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
wxString wxGenericDirCtrl::GetPath() const wxString wxGenericDirCtrl::GetPath() const
@@ -1136,10 +1137,10 @@ bool wxGenericDirCtrl::ExtractWildcard(const wxString& filterStr, int n, wxStrin
{ {
filter = filters[n]; filter = filters[n];
description = descriptions[n]; description = descriptions[n];
return TRUE; return true;
} }
return FALSE; return false;
} }
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
@@ -1166,8 +1167,16 @@ void wxGenericDirCtrl::DoResize()
// correct control height to always be returned, rather // correct control height to always be returned, rather
// than the drop-down list height which is sometimes returned. // than the drop-down list height which is sometimes returned.
wxSize oldSize = m_filterListCtrl->GetSize(); wxSize oldSize = m_filterListCtrl->GetSize();
m_filterListCtrl->SetSize(-1, -1, oldSize.x+10, -1, wxSIZE_USE_EXISTING); m_filterListCtrl->SetSize(wxDefaultPosition.x,
m_filterListCtrl->SetSize(-1, -1, oldSize.x, -1, wxSIZE_USE_EXISTING); wxDefaultPosition.y,
oldSize.x+10,
wxDefaultSize.y,
wxSIZE_USE_EXISTING);
m_filterListCtrl->SetSize(wxDefaultPosition.x,
wxDefaultPosition.y,
oldSize.x,
wxDefaultSize.y,
wxSIZE_USE_EXISTING);
#endif #endif
filterSz = m_filterListCtrl->GetSize(); filterSz = m_filterListCtrl->GetSize();
sz.y -= (filterSz.y + verticalSpacing); sz.y -= (filterSz.y + verticalSpacing);
@@ -1215,7 +1224,7 @@ wxTreeItemId wxGenericDirCtrl::AppendItem (const wxTreeItemId & parent,
IMPLEMENT_CLASS(wxDirFilterListCtrl, wxChoice) IMPLEMENT_CLASS(wxDirFilterListCtrl, wxChoice)
BEGIN_EVENT_TABLE(wxDirFilterListCtrl, wxChoice) BEGIN_EVENT_TABLE(wxDirFilterListCtrl, wxChoice)
EVT_CHOICE(-1, wxDirFilterListCtrl::OnSelFilter) EVT_CHOICE(wxID_ANY, wxDirFilterListCtrl::OnSelFilter)
END_EVENT_TABLE() END_EVENT_TABLE()
bool wxDirFilterListCtrl::Create(wxGenericDirCtrl* parent, const wxWindowID id, bool wxDirFilterListCtrl::Create(wxGenericDirCtrl* parent, const wxWindowID id,
@@ -1448,7 +1457,7 @@ class wxFileIconsTableModule: public wxModule
DECLARE_DYNAMIC_CLASS(wxFileIconsTableModule) DECLARE_DYNAMIC_CLASS(wxFileIconsTableModule)
public: public:
wxFileIconsTableModule() {} wxFileIconsTableModule() {}
bool OnInit() { wxTheFileIconsTable = new wxFileIconsTable; return TRUE; } bool OnInit() { wxTheFileIconsTable = new wxFileIconsTable; return true; }
void OnExit() void OnExit()
{ {
if (wxTheFileIconsTable) if (wxTheFileIconsTable)
@@ -1598,27 +1607,27 @@ static wxImage CutEmptyBorders(const wxImage& img)
bool empt; bool empt;
#define MK_DTTMP(x,y) dttmp = dt + ((x + y * w) * 3) #define MK_DTTMP(x,y) dttmp = dt + ((x + y * w) * 3)
#define NOEMPTY_PIX(empt) if (dttmp[0] != mr || dttmp[1] != mg || dttmp[2] != mb) {empt = FALSE; break;} #define NOEMPTY_PIX(empt) if (dttmp[0] != mr || dttmp[1] != mg || dttmp[2] != mb) {empt = false; break;}
for (empt = TRUE, top = 0; empt && top < h; top++) for (empt = true, top = 0; empt && top < h; top++)
{ {
MK_DTTMP(0, top); MK_DTTMP(0, top);
for (i = 0; i < w; i++, dttmp+=3) for (i = 0; i < w; i++, dttmp+=3)
NOEMPTY_PIX(empt) NOEMPTY_PIX(empt)
} }
for (empt = TRUE, bottom = h-1; empt && bottom > top; bottom--) for (empt = true, bottom = h-1; empt && bottom > top; bottom--)
{ {
MK_DTTMP(0, bottom); MK_DTTMP(0, bottom);
for (i = 0; i < w; i++, dttmp+=3) for (i = 0; i < w; i++, dttmp+=3)
NOEMPTY_PIX(empt) NOEMPTY_PIX(empt)
} }
for (empt = TRUE, left = 0; empt && left < w; left++) for (empt = true, left = 0; empt && left < w; left++)
{ {
MK_DTTMP(left, 0); MK_DTTMP(left, 0);
for (i = 0; i < h; i++, dttmp+=3*w) for (i = 0; i < h; i++, dttmp+=3*w)
NOEMPTY_PIX(empt) NOEMPTY_PIX(empt)
} }
for (empt = TRUE, right = w-1; empt && right > left; right--) for (empt = true, right = w-1; empt && right > left; right--)
{ {
MK_DTTMP(right, 0); MK_DTTMP(right, 0);
for (i = 0; i < h; i++, dttmp+=3*w) for (i = 0; i < h; i++, dttmp+=3*w)

View File

@@ -60,8 +60,8 @@ BEGIN_EVENT_TABLE(wxGenericDirDialog, wxDialog)
EVT_BUTTON (wxID_OK, wxGenericDirDialog::OnOK) EVT_BUTTON (wxID_OK, wxGenericDirDialog::OnOK)
EVT_BUTTON (ID_NEW, wxGenericDirDialog::OnNew) EVT_BUTTON (ID_NEW, wxGenericDirDialog::OnNew)
EVT_BUTTON (ID_GO_HOME, wxGenericDirDialog::OnGoHome) EVT_BUTTON (ID_GO_HOME, wxGenericDirDialog::OnGoHome)
EVT_TREE_KEY_DOWN (-1, wxGenericDirDialog::OnTreeKeyDown) EVT_TREE_KEY_DOWN (wxID_ANY, wxGenericDirDialog::OnTreeKeyDown)
EVT_TREE_SEL_CHANGED (-1, wxGenericDirDialog::OnTreeSelected) EVT_TREE_SEL_CHANGED (wxID_ANY, wxGenericDirDialog::OnTreeSelected)
EVT_TEXT_ENTER (ID_TEXTCTRL, wxGenericDirDialog::OnOK) EVT_TEXT_ENTER (ID_TEXTCTRL, wxGenericDirDialog::OnOK)
EVT_CHECKBOX (ID_SHOW_HIDDEN, wxGenericDirDialog::OnShowHidden) EVT_CHECKBOX (ID_SHOW_HIDDEN, wxGenericDirDialog::OnShowHidden)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -143,7 +143,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) Static line // 3) Static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 4) Buttons // 4) Buttons
@@ -160,7 +160,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
okButton->SetDefault(); okButton->SetDefault();
m_dirCtrl->SetFocus(); m_dirCtrl->SetFocus();
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );
@@ -302,7 +302,7 @@ void wxGenericDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) )
return; return;
} }
wxDirItemData *new_data = new wxDirItemData( path, new_name, TRUE ); wxDirItemData *new_data = new wxDirItemData( path, new_name, true );
// TODO: THIS CODE DOESN'T WORK YET. We need to avoid duplication of the first child // TODO: THIS CODE DOESN'T WORK YET. We need to avoid duplication of the first child
// of the parent. // of the parent.

View File

@@ -76,11 +76,11 @@ wxGenericDragImage::~wxGenericDragImage()
void wxGenericDragImage::Init() void wxGenericDragImage::Init()
{ {
m_isDirty = FALSE; m_isDirty = false;
m_isShown = FALSE; m_isShown = false;
m_windowDC = (wxDC*) NULL; m_windowDC = (wxDC*) NULL;
m_window = (wxWindow*) NULL; m_window = (wxWindow*) NULL;
m_fullScreen = FALSE; m_fullScreen = false;
m_pBackingBitmap = (wxBitmap*) NULL; m_pBackingBitmap = (wxBitmap*) NULL;
} }
@@ -96,7 +96,7 @@ bool wxGenericDragImage::Create(const wxCursor& cursor)
{ {
m_cursor = cursor; m_cursor = cursor;
return TRUE; return true;
} }
// Create a drag image from a bitmap and optional cursor // Create a drag image from a bitmap and optional cursor
@@ -108,7 +108,7 @@ bool wxGenericDragImage::Create(const wxBitmap& image, const wxCursor& cursor)
m_cursor = cursor; m_cursor = cursor;
m_bitmap = image; m_bitmap = image;
return TRUE ; return true ;
} }
// Create a drag image from an icon and optional cursor // Create a drag image from an icon and optional cursor
@@ -120,7 +120,7 @@ bool wxGenericDragImage::Create(const wxIcon& image, const wxCursor& cursor)
m_cursor = cursor; m_cursor = cursor;
m_icon = image; m_icon = image;
return TRUE ; return true ;
} }
// Create a drag image from a string and optional cursor // Create a drag image from a string and optional cursor
@@ -202,8 +202,8 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
if (rect) if (rect)
m_boundingRect = * rect; m_boundingRect = * rect;
m_isDirty = FALSE; m_isDirty = false;
m_isDirty = FALSE; m_isDirty = false;
if (window) if (window)
{ {
@@ -266,7 +266,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
m_boundingRect.width, m_boundingRect.height); m_boundingRect.width, m_boundingRect.height);
} }
return TRUE; return true;
} }
// Begin drag. hotspot is the location of the drag position relative to the upper-left // Begin drag. hotspot is the location of the drag position relative to the upper-left
@@ -287,7 +287,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, wxW
rect.x = x; rect.y = y; rect.x = x; rect.y = y;
rect.width = sz.x; rect.height = sz.y; rect.width = sz.x; rect.height = sz.y;
return BeginDrag(hotspot, window, TRUE, & rect); return BeginDrag(hotspot, window, true, & rect);
} }
// End drag // End drag
@@ -317,7 +317,7 @@ bool wxGenericDragImage::EndDrag()
m_repairBitmap = wxNullBitmap; m_repairBitmap = wxNullBitmap;
return TRUE; return true;
} }
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window // Move the image: call from OnMouseMove. Pt is in window client coordinates if window
@@ -336,14 +336,14 @@ bool wxGenericDragImage::Move(const wxPoint& pt)
bool eraseOldImage = (m_isDirty && m_isShown); bool eraseOldImage = (m_isDirty && m_isShown);
if (m_isShown) if (m_isShown)
RedrawImage(oldPos - m_offset, pt2 - m_offset, eraseOldImage, TRUE); RedrawImage(oldPos - m_offset, pt2 - m_offset, eraseOldImage, true);
m_position = pt2; m_position = pt2;
if (m_isShown) if (m_isShown)
m_isDirty = TRUE; m_isDirty = true;
return TRUE; return true;
} }
bool wxGenericDragImage::Show() bool wxGenericDragImage::Show()
@@ -366,13 +366,13 @@ bool wxGenericDragImage::Show()
//memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y); //memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y);
memDC.SelectObject(wxNullBitmap); memDC.SelectObject(wxNullBitmap);
RedrawImage(m_position - m_offset, m_position - m_offset, FALSE, TRUE); RedrawImage(m_position - m_offset, m_position - m_offset, false, true);
} }
m_isShown = TRUE; m_isShown = true;
m_isDirty = TRUE; m_isDirty = true;
return TRUE; return true;
} }
bool wxGenericDragImage::UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC, bool wxGenericDragImage::UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC,
@@ -390,13 +390,13 @@ bool wxGenericDragImage::Hide()
if (m_isShown && m_isDirty) if (m_isShown && m_isDirty)
{ {
RedrawImage(m_position - m_offset, m_position - m_offset, TRUE, FALSE); RedrawImage(m_position - m_offset, m_position - m_offset, true, false);
} }
m_isShown = FALSE; m_isShown = false;
m_isDirty = FALSE; m_isDirty = false;
return TRUE; return true;
} }
// More efficient: erase and redraw simultaneously if possible // More efficient: erase and redraw simultaneously if possible
@@ -404,11 +404,11 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPo
bool eraseOld, bool drawNew) bool eraseOld, bool drawNew)
{ {
if (!m_windowDC) if (!m_windowDC)
return FALSE; return false;
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
if (!backing->Ok()) if (!backing->Ok())
return FALSE; return false;
wxRect oldRect(GetImageRect(oldPos)); wxRect oldRect(GetImageRect(oldPos));
wxRect newRect(GetImageRect(newPos)); wxRect newRect(GetImageRect(newPos));
@@ -472,7 +472,7 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPo
memDCTemp.SelectObject(wxNullBitmap); memDCTemp.SelectObject(wxNullBitmap);
memDC.SelectObject(wxNullBitmap); memDC.SelectObject(wxNullBitmap);
return TRUE; return true;
} }
// Override this if you are using a virtual image (drawing your own image) // Override this if you are using a virtual image (drawing your own image)
@@ -481,15 +481,15 @@ bool wxGenericDragImage::DoDrawImage(wxDC& dc, const wxPoint& pos) const
if (m_bitmap.Ok()) if (m_bitmap.Ok())
{ {
dc.DrawBitmap(m_bitmap, pos.x, pos.y, (m_bitmap.GetMask() != 0)); dc.DrawBitmap(m_bitmap, pos.x, pos.y, (m_bitmap.GetMask() != 0));
return TRUE; return true;
} }
else if (m_icon.Ok()) else if (m_icon.Ok())
{ {
dc.DrawIcon(m_icon, pos.x, pos.y); dc.DrawIcon(m_icon, pos.x, pos.y);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
// Override this if you are using a virtual image (drawing your own image) // Override this if you are using a virtual image (drawing your own image)

View File

@@ -90,16 +90,16 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
const wxString& title, const wxString& title,
int style) int style)
{ {
if ( !wxDialog::Create(parent, -1, title, if ( !wxDialog::Create(parent, wxID_ANY, title,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | style) ) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | style) )
{ {
return FALSE; return false;
} }
SetData(data); SetData(data);
wxCHECK_MSG( m_FindReplaceData, FALSE, wxCHECK_MSG( m_FindReplaceData, false,
_T("can't create dialog without data") ); _T("can't create dialog without data") );
wxBoxSizer *leftsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *leftsizer = new wxBoxSizer( wxVERTICAL );
@@ -108,27 +108,27 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
wxFlexGridSizer *sizer2Col = new wxFlexGridSizer(3); wxFlexGridSizer *sizer2Col = new wxFlexGridSizer(3);
sizer2Col->AddGrowableCol(2); sizer2Col->AddGrowableCol(2);
sizer2Col->Add(new wxStaticText(this, -1, _("Search for:"), sizer2Col->Add(new wxStaticText(this, wxID_ANY, _("Search for:"),
wxDefaultPosition, wxSize(80, -1)), wxDefaultPosition, wxSize(80, wxDefaultSize.y)),
0, 0,
wxALIGN_CENTRE_VERTICAL | wxALIGN_RIGHT); wxALIGN_CENTRE_VERTICAL | wxALIGN_RIGHT);
sizer2Col->Add(10, 0); sizer2Col->Add(10, 0);
m_textFind = new wxTextCtrl(this, -1, m_FindReplaceData->GetFindString()); m_textFind = new wxTextCtrl(this, wxID_ANY, m_FindReplaceData->GetFindString());
sizer2Col->Add(m_textFind, 1, wxALIGN_CENTRE_VERTICAL | wxEXPAND); sizer2Col->Add(m_textFind, 1, wxALIGN_CENTRE_VERTICAL | wxEXPAND);
if ( style & wxFR_REPLACEDIALOG ) if ( style & wxFR_REPLACEDIALOG )
{ {
sizer2Col->Add(new wxStaticText(this, -1, _("Replace with:"), sizer2Col->Add(new wxStaticText(this, wxID_ANY, _("Replace with:"),
wxDefaultPosition, wxSize(80, -1)), wxDefaultPosition, wxSize(80, wxDefaultSize.y)),
0, 0,
wxALIGN_CENTRE_VERTICAL | wxALIGN_CENTRE_VERTICAL |
wxALIGN_RIGHT | wxTOP, 5); wxALIGN_RIGHT | wxTOP, 5);
sizer2Col->Add(10, 0); sizer2Col->Add(10, 0);
m_textRepl = new wxTextCtrl(this, -1, m_textRepl = new wxTextCtrl(this, wxID_ANY,
m_FindReplaceData->GetReplaceString()); m_FindReplaceData->GetReplaceString());
sizer2Col->Add(m_textRepl, 1, sizer2Col->Add(m_textRepl, 1,
wxALIGN_CENTRE_VERTICAL | wxEXPAND | wxTOP, 5); wxALIGN_CENTRE_VERTICAL | wxEXPAND | wxTOP, 5);
@@ -140,16 +140,16 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
wxBoxSizer *chksizer = new wxBoxSizer( wxVERTICAL); wxBoxSizer *chksizer = new wxBoxSizer( wxVERTICAL);
m_chkWord = new wxCheckBox(this, -1, _("Whole word")); m_chkWord = new wxCheckBox(this, wxID_ANY, _("Whole word"));
chksizer->Add(m_chkWord, 0, wxALL, 3); chksizer->Add(m_chkWord, 0, wxALL, 3);
m_chkCase = new wxCheckBox(this, -1, _("Match case")); m_chkCase = new wxCheckBox(this, wxID_ANY, _("Match case"));
chksizer->Add(m_chkCase, 0, wxALL, 3); chksizer->Add(m_chkCase, 0, wxALL, 3);
optsizer->Add(chksizer, 0, wxALL, 10); optsizer->Add(chksizer, 0, wxALL, 10);
static const wxString searchDirections[] = {_("Up"), _("Down")}; static const wxString searchDirections[] = {_("Up"), _("Down")};
m_radioDir = new wxRadioBox(this, -1, _("Search direction"), m_radioDir = new wxRadioBox(this, wxID_ANY, _("Search direction"),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
WXSIZEOF(searchDirections), searchDirections); WXSIZEOF(searchDirections), searchDirections);
@@ -180,23 +180,23 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
int flags = m_FindReplaceData->GetFlags(); int flags = m_FindReplaceData->GetFlags();
if ( flags & wxFR_MATCHCASE ) if ( flags & wxFR_MATCHCASE )
m_chkCase->SetValue(TRUE); m_chkCase->SetValue(true);
if ( flags & wxFR_WHOLEWORD ) if ( flags & wxFR_WHOLEWORD )
m_chkWord->SetValue(TRUE); m_chkWord->SetValue(true);
m_radioDir->SetSelection( flags & wxFR_DOWN ); m_radioDir->SetSelection( flags & wxFR_DOWN );
if ( style & wxFR_NOMATCHCASE ) if ( style & wxFR_NOMATCHCASE )
m_chkCase->Enable(FALSE); m_chkCase->Enable(false);
if ( style & wxFR_NOWHOLEWORD ) if ( style & wxFR_NOWHOLEWORD )
m_chkWord->Enable(FALSE); m_chkWord->Enable(false);
if ( style & wxFR_NOUPDOWN) if ( style & wxFR_NOUPDOWN)
m_radioDir->Enable(FALSE); m_radioDir->Enable(false);
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );
@@ -206,7 +206,7 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
m_textFind->SetFocus(); m_textFind->SetFocus();
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -264,7 +264,7 @@ void wxGenericFindReplaceDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{ {
SendEvent(wxEVT_COMMAND_FIND_CLOSE); SendEvent(wxEVT_COMMAND_FIND_CLOSE);
Show(FALSE); Show(false);
} }
void wxGenericFindReplaceDialog::OnUpdateFindUI(wxUpdateUIEvent &event) void wxGenericFindReplaceDialog::OnUpdateFindUI(wxUpdateUIEvent &event)

View File

@@ -209,7 +209,7 @@ void wxFileData::ReadData()
// try to get a better icon // try to get a better icon
if (m_image == wxFileIconsTable::file) if (m_image == wxFileIconsTable::file)
{ {
if (m_fileName.Find(wxT('.'), TRUE) != wxNOT_FOUND) if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND)
{ {
m_image = wxTheFileIconsTable->GetIconID( m_fileName.AfterLast(wxT('.'))); m_image = wxTheFileIconsTable->GetIconID( m_fileName.AfterLast(wxT('.')));
} else if (IsExe()) } else if (IsExe())
@@ -254,7 +254,7 @@ wxString wxFileData::GetFileType() const
return _("<LINK>"); return _("<LINK>");
else if (IsDrive()) else if (IsDrive())
return _("<DRIVE>"); return _("<DRIVE>");
else if (m_fileName.Find(wxT('.'), TRUE) != wxNOT_FOUND) else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND)
return m_fileName.AfterLast(wxT('.')); return m_fileName.AfterLast(wxT('.'));
return wxEmptyString; return wxEmptyString;
@@ -361,16 +361,16 @@ void wxFileData::MakeItem( wxListItem &item )
IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl) IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl)
BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl) BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl)
EVT_LIST_DELETE_ITEM(-1, wxFileCtrl::OnListDeleteItem) EVT_LIST_DELETE_ITEM(wxID_ANY, wxFileCtrl::OnListDeleteItem)
EVT_LIST_DELETE_ALL_ITEMS(-1, wxFileCtrl::OnListDeleteAllItems) EVT_LIST_DELETE_ALL_ITEMS(wxID_ANY, wxFileCtrl::OnListDeleteAllItems)
EVT_LIST_END_LABEL_EDIT(-1, wxFileCtrl::OnListEndLabelEdit) EVT_LIST_END_LABEL_EDIT(wxID_ANY, wxFileCtrl::OnListEndLabelEdit)
EVT_LIST_COL_CLICK(-1, wxFileCtrl::OnListColClick) EVT_LIST_COL_CLICK(wxID_ANY, wxFileCtrl::OnListColClick)
END_EVENT_TABLE() END_EVENT_TABLE()
wxFileCtrl::wxFileCtrl() wxFileCtrl::wxFileCtrl()
{ {
m_showHidden = FALSE; m_showHidden = false;
m_sort_foward = 1; m_sort_foward = 1;
m_sort_field = wxFileData::FileList_Name; m_sort_field = wxFileData::FileList_Name;
} }
@@ -657,7 +657,7 @@ void wxFileCtrl::GoToParentDir()
if (!m_dirName.IsEmpty()) if (!m_dirName.IsEmpty())
{ {
if (m_dirName.Last() == wxT('.')) if (m_dirName.Last() == wxT('.'))
m_dirName = wxT(""); m_dirName = wxEmptyString;
} }
#elif defined(__UNIX__) #elif defined(__UNIX__)
if (m_dirName.IsEmpty()) if (m_dirName.IsEmpty())
@@ -858,7 +858,7 @@ BEGIN_EVENT_TABLE(wxGenericFileDialog,wxDialog)
END_EVENT_TABLE() END_EVENT_TABLE()
long wxGenericFileDialog::ms_lastViewStyle = wxLC_LIST; long wxGenericFileDialog::ms_lastViewStyle = wxLC_LIST;
bool wxGenericFileDialog::ms_lastShowHidden = FALSE; bool wxGenericFileDialog::ms_lastShowHidden = false;
wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent, wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
const wxString& message, const wxString& message,
@@ -869,10 +869,10 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
const wxPoint& pos ) const wxPoint& pos )
:wxFileDialogBase(parent, message, defaultDir, defaultFile, wildCard, style, pos) :wxFileDialogBase(parent, message, defaultDir, defaultFile, wildCard, style, pos)
{ {
wxDialog::Create( parent, -1, message, pos, wxDefaultSize, wxDialog::Create( parent, wxID_ANY, message, pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ); wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
if (wxConfig::Get(FALSE)) if (wxConfig::Get(false))
{ {
wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ViewStyle"), wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ViewStyle"),
&ms_lastViewStyle); &ms_lastViewStyle);
@@ -964,8 +964,8 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL );
if (is_pda) if (is_pda)
staticsizer->Add( new wxStaticText( this, -1, _("Current directory:") ), 0, wxRIGHT, 10 ); staticsizer->Add( new wxStaticText( this, wxID_ANY, _("Current directory:") ), 0, wxRIGHT, 10 );
m_static = new wxStaticText( this, -1, m_dir ); m_static = new wxStaticText( this, wxID_ANY, m_dir );
staticsizer->Add( m_static, 1 ); staticsizer->Add( m_static, 1 );
mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 ); mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 );
@@ -1023,7 +1023,7 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
} }
SetFilterIndex( 0 ); SetFilterIndex( 0 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( mainsizer ); SetSizer( mainsizer );
mainsizer->Fit( this ); mainsizer->Fit( this );
@@ -1036,7 +1036,7 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent,
wxGenericFileDialog::~wxGenericFileDialog() wxGenericFileDialog::~wxGenericFileDialog()
{ {
if (wxConfig::Get(FALSE)) if (wxConfig::Get(false))
{ {
wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ViewStyle"), wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ViewStyle"),
ms_lastViewStyle); ms_lastViewStyle);
@@ -1118,7 +1118,7 @@ void wxGenericFileDialog::OnTextEnter( wxCommandEvent &WXUNUSED(event) )
GetEventHandler()->ProcessEvent( cevent ); GetEventHandler()->ProcessEvent( cevent );
} }
static bool ignoreChanges = FALSE; static bool ignoreChanges = false;
void wxGenericFileDialog::OnTextChange( wxCommandEvent &WXUNUSED(event) ) void wxGenericFileDialog::OnTextChange( wxCommandEvent &WXUNUSED(event) )
{ {
@@ -1150,9 +1150,9 @@ void wxGenericFileDialog::OnSelected( wxListEvent &event )
dir += filename; dir += filename;
if (wxDirExists(dir)) return; if (wxDirExists(dir)) return;
ignoreChanges = TRUE; ignoreChanges = true;
m_text->SetValue( filename ); m_text->SetValue( filename );
ignoreChanges = FALSE; ignoreChanges = false;
} }
void wxGenericFileDialog::HandleAction( const wxString &fn ) void wxGenericFileDialog::HandleAction( const wxString &fn )

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,7 @@ wxString wxGridCellDateTimeRenderer::GetString(wxGrid& grid, int row, int col)
{ {
wxGridTableBase *table = grid.GetTable(); wxGridTableBase *table = grid.GetTable();
bool hasDatetime = FALSE; bool hasDatetime = false;
wxDateTime val; wxDateTime val;
wxString text; wxString text;
if ( table->CanGetValueAs(row, col, wxGRID_VALUE_DATETIME) ) if ( table->CanGetValueAs(row, col, wxGRID_VALUE_DATETIME) )
@@ -69,7 +69,7 @@ wxString wxGridCellDateTimeRenderer::GetString(wxGrid& grid, int row, int col)
if (tempval){ if (tempval){
val = *((wxDateTime *)tempval); val = *((wxDateTime *)tempval);
hasDatetime = TRUE; hasDatetime = true;
delete (wxDateTime *)tempval; delete (wxDateTime *)tempval;
} }
@@ -344,7 +344,7 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid,
dc.SetFont(attr.GetFont()); dc.SetFont(attr.GetFont());
wxStringTokenizer tk(data , _T(" \n\t\r")); wxStringTokenizer tk(data , _T(" \n\t\r"));
wxString thisline(wxT("")); wxString thisline = wxEmptyString;
while ( tk.HasMoreTokens() ) while ( tk.HasMoreTokens() )
{ {

View File

@@ -69,7 +69,7 @@ bool wxGridSelection::IsInSelection ( int row, int col )
{ {
wxGridCellCoords& coords = m_cellSelection[n]; wxGridCellCoords& coords = m_cellSelection[n];
if ( row == coords.GetRow() && col == coords.GetCol() ) if ( row == coords.GetRow() && col == coords.GetCol() )
return TRUE; return true;
} }
} }
@@ -83,7 +83,7 @@ bool wxGridSelection::IsInSelection ( int row, int col )
if ( BlockContainsCell(coords1.GetRow(), coords1.GetCol(), if ( BlockContainsCell(coords1.GetRow(), coords1.GetCol(),
coords2.GetRow(), coords2.GetCol(), coords2.GetRow(), coords2.GetCol(),
row, col ) ) row, col ) )
return TRUE; return true;
} }
// Now check whether the given cell is // Now check whether the given cell is
@@ -95,7 +95,7 @@ bool wxGridSelection::IsInSelection ( int row, int col )
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
if ( row == m_rowSelection[n] ) if ( row == m_rowSelection[n] )
return TRUE; return true;
} }
} }
@@ -108,10 +108,10 @@ bool wxGridSelection::IsInSelection ( int row, int col )
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
if ( col == m_colSelection[n] ) if ( col == m_colSelection[n] )
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
// Change the selection mode // Change the selection mode
@@ -165,7 +165,7 @@ void wxGridSelection::SetSelectionMode(wxGrid::wxGridSelectionModes selmode)
m_blockSelectionBottomRight.RemoveAt(n); m_blockSelectionBottomRight.RemoveAt(n);
SelectBlock( topRow, 0, SelectBlock( topRow, 0,
bottomRow, m_grid->GetNumberCols() - 1, bottomRow, m_grid->GetNumberCols() - 1,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
} }
} }
else // selmode == wxGridSelectColumns) else // selmode == wxGridSelectColumns)
@@ -176,7 +176,7 @@ void wxGridSelection::SetSelectionMode(wxGrid::wxGridSelectionModes selmode)
m_blockSelectionBottomRight.RemoveAt(n); m_blockSelectionBottomRight.RemoveAt(n);
SelectBlock( 0, leftCol, SelectBlock( 0, leftCol,
m_grid->GetNumberRows() - 1, rightCol, m_grid->GetNumberRows() - 1, rightCol,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
} }
} }
} }
@@ -210,7 +210,7 @@ void wxGridSelection::SelectRow( int row,
// Simplify list of selected blocks (if possible) // Simplify list of selected blocks (if possible)
count = m_blockSelectionTopLeft.GetCount(); count = m_blockSelectionTopLeft.GetCount();
bool done = FALSE; bool done = false;
for ( n = 0; n < count; n++ ) for ( n = 0; n < count; n++ )
{ {
wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n];
@@ -233,12 +233,12 @@ void wxGridSelection::SelectRow( int row,
else if ( coords1.GetRow() == row + 1) else if ( coords1.GetRow() == row + 1)
{ {
coords1.SetRow(row); coords1.SetRow(row);
done = TRUE; done = true;
} }
else if ( coords2.GetRow() == row - 1) else if ( coords2.GetRow() == row - 1)
{ {
coords2.SetRow(row); coords2.SetRow(row);
done = TRUE; done = true;
} }
} }
} }
@@ -263,7 +263,7 @@ void wxGridSelection::SelectRow( int row,
{ {
wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ), wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ),
wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) ); wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
// Send Event // Send Event
@@ -272,7 +272,7 @@ void wxGridSelection::SelectRow( int row,
m_grid, m_grid,
wxGridCellCoords( row, 0 ), wxGridCellCoords( row, 0 ),
wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ), wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ),
TRUE, true,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
@@ -305,7 +305,7 @@ void wxGridSelection::SelectCol( int col,
// Simplify list of selected blocks (if possible) // Simplify list of selected blocks (if possible)
count = m_blockSelectionTopLeft.GetCount(); count = m_blockSelectionTopLeft.GetCount();
bool done = FALSE; bool done = false;
for ( n = 0; n < count; n++ ) for ( n = 0; n < count; n++ )
{ {
wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n];
@@ -328,12 +328,12 @@ void wxGridSelection::SelectCol( int col,
else if ( coords1.GetCol() == col + 1) else if ( coords1.GetCol() == col + 1)
{ {
coords1.SetCol(col); coords1.SetCol(col);
done = TRUE; done = true;
} }
else if ( coords2.GetCol() == col - 1) else if ( coords2.GetCol() == col - 1)
{ {
coords2.SetCol(col); coords2.SetCol(col);
done = TRUE; done = true;
} }
} }
} }
@@ -358,7 +358,7 @@ void wxGridSelection::SelectCol( int col,
{ {
wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ), wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ),
wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) ); wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
// Send Event // Send Event
@@ -367,7 +367,7 @@ void wxGridSelection::SelectCol( int col,
m_grid, m_grid,
wxGridCellCoords( 0, col ), wxGridCellCoords( 0, col ),
wxGridCellCoords( m_grid->GetNumberRows() - 1, col ), wxGridCellCoords( m_grid->GetNumberRows() - 1, col ),
TRUE, true,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
@@ -502,7 +502,7 @@ void wxGridSelection::SelectBlock( int topRow, int leftCol,
{ {
wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( topRow, leftCol ), wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( topRow, leftCol ),
wxGridCellCoords( bottomRow, rightCol ) ); wxGridCellCoords( bottomRow, rightCol ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
// Send Event, if not disabled. // Send Event, if not disabled.
@@ -513,7 +513,7 @@ void wxGridSelection::SelectBlock( int topRow, int leftCol,
m_grid, m_grid,
wxGridCellCoords( topRow, leftCol ), wxGridCellCoords( topRow, leftCol ),
wxGridCellCoords( bottomRow, rightCol ), wxGridCellCoords( bottomRow, rightCol ),
TRUE, true,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
@@ -546,7 +546,7 @@ void wxGridSelection::SelectCell( int row, int col,
{ {
wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, col ), wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, col ),
wxGridCellCoords( row, col ) ); wxGridCellCoords( row, col ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
// Send event // Send event
@@ -557,7 +557,7 @@ void wxGridSelection::SelectCell( int row, int col,
m_grid, m_grid,
wxGridCellCoords( row, col ), wxGridCellCoords( row, col ),
wxGridCellCoords( row, col ), wxGridCellCoords( row, col ),
TRUE, true,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown); AltDown, MetaDown);
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
@@ -598,7 +598,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
if ( !m_grid->GetBatchCount() ) if ( !m_grid->GetBatchCount() )
{ {
wxRect r = m_grid->BlockToDeviceRect( coords, coords ); wxRect r = m_grid->BlockToDeviceRect( coords, coords );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
// Send event // Send event
@@ -607,7 +607,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
m_grid, m_grid,
wxGridCellCoords( row, col ), wxGridCellCoords( row, col ),
wxGridCellCoords( row, col ), wxGridCellCoords( row, col ),
FALSE, false,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
@@ -656,19 +656,19 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
{ {
if ( topRow < row ) if ( topRow < row )
SelectBlock( topRow, leftCol, row - 1, rightCol, SelectBlock( topRow, leftCol, row - 1, rightCol,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
if ( bottomRow > row ) if ( bottomRow > row )
SelectBlock( row + 1, leftCol, bottomRow, rightCol, SelectBlock( row + 1, leftCol, bottomRow, rightCol,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
} }
if ( m_selectionMode != wxGrid::wxGridSelectRows ) if ( m_selectionMode != wxGrid::wxGridSelectRows )
{ {
if ( leftCol < col ) if ( leftCol < col )
SelectBlock( row, leftCol, row, col - 1, SelectBlock( row, leftCol, row, col - 1,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
if ( rightCol > col ) if ( rightCol > col )
SelectBlock( row, col + 1, row, rightCol, SelectBlock( row, col + 1, row, rightCol,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
} }
} }
} }
@@ -687,11 +687,11 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
{ {
if ( col > 0 ) if ( col > 0 )
SelectBlock( row, 0, row, col - 1, SelectBlock( row, 0, row, col - 1,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
if ( col < m_grid->GetNumberCols() - 1 ) if ( col < m_grid->GetNumberCols() - 1 )
SelectBlock( row, col + 1, SelectBlock( row, col + 1,
row, m_grid->GetNumberCols() - 1, row, m_grid->GetNumberCols() - 1,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
} }
} }
} }
@@ -711,11 +711,11 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
{ {
if ( row > 0 ) if ( row > 0 )
SelectBlock( 0, col, row - 1, col, SelectBlock( 0, col, row - 1, col,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
if ( row < m_grid->GetNumberRows() - 1 ) if ( row < m_grid->GetNumberRows() - 1 )
SelectBlock( row + 1, col, SelectBlock( row + 1, col,
m_grid->GetNumberRows() - 1, col, m_grid->GetNumberRows() - 1, col,
FALSE, FALSE, FALSE, FALSE, FALSE ); false, false, false, false, false );
} }
} }
} }
@@ -732,7 +732,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
{ {
r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, col ), r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, col ),
wxGridCellCoords( row, col ) ); wxGridCellCoords( row, col ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
wxGridRangeSelectEvent gridEvt( m_grid->GetId(), wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
@@ -740,7 +740,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
m_grid, m_grid,
wxGridCellCoords( row, col ), wxGridCellCoords( row, col ),
wxGridCellCoords( row, col ), wxGridCellCoords( row, col ),
FALSE, false,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
@@ -752,7 +752,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
{ {
r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ), r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ),
wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) ); wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
wxGridRangeSelectEvent gridEvt( m_grid->GetId(), wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
@@ -760,7 +760,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
m_grid, m_grid,
wxGridCellCoords( row, 0 ), wxGridCellCoords( row, 0 ),
wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ), wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ),
FALSE, false,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
@@ -772,7 +772,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
{ {
r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ), r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ),
wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) ); wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
wxGridRangeSelectEvent gridEvt( m_grid->GetId(), wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
@@ -780,7 +780,7 @@ void wxGridSelection::ToggleCellSelection( int row, int col,
m_grid, m_grid,
wxGridCellCoords( 0, col ), wxGridCellCoords( 0, col ),
wxGridCellCoords( m_grid->GetNumberRows() - 1, col ), wxGridCellCoords( m_grid->GetNumberRows() - 1, col ),
FALSE, false,
ControlDown, ShiftDown, ControlDown, ShiftDown,
AltDown, MetaDown ); AltDown, MetaDown );
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
@@ -806,7 +806,7 @@ void wxGridSelection::ClearSelection()
if ( !m_grid->GetBatchCount() ) if ( !m_grid->GetBatchCount() )
{ {
r = m_grid->BlockToDeviceRect( coords1, coords1 ); r = m_grid->BlockToDeviceRect( coords1, coords1 );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
} }
} }
@@ -822,7 +822,7 @@ void wxGridSelection::ClearSelection()
if ( !m_grid->GetBatchCount() ) if ( !m_grid->GetBatchCount() )
{ {
r = m_grid->BlockToDeviceRect( coords1, coords2 ); r = m_grid->BlockToDeviceRect( coords1, coords2 );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
} }
@@ -838,7 +838,7 @@ void wxGridSelection::ClearSelection()
{ {
r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ), r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ),
wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) ); wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
} }
} }
@@ -855,7 +855,7 @@ void wxGridSelection::ClearSelection()
{ {
r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ), r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ),
wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) ); wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) );
((wxWindow *)m_grid->m_gridWin)->Refresh( FALSE, &r ); ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
} }
} }
} }
@@ -869,7 +869,7 @@ void wxGridSelection::ClearSelection()
wxGridCellCoords( 0, 0 ), wxGridCellCoords( 0, 0 ),
wxGridCellCoords( m_grid->GetNumberRows() - 1, wxGridCellCoords( m_grid->GetNumberRows() - 1,
m_grid->GetNumberCols() - 1 ), m_grid->GetNumberCols() - 1 ),
FALSE ); false );
m_grid->GetEventHandler()->ProcessEvent(gridEvt); m_grid->GetEventHandler()->ProcessEvent(gridEvt);
} }

View File

@@ -137,7 +137,7 @@ wxExtHelpController::DisplayHelp(const wxString &relativeURL)
// return false; // return false;
// } // }
// else // else
return TRUE; return true;
#elif defined(__DOS__) #elif defined(__DOS__)
@@ -173,7 +173,7 @@ wxExtHelpController::DisplayHelp(const wxString &relativeURL)
<< WXEXTHELP_SEPARATOR << relativeURL << wxT(")"); << WXEXTHELP_SEPARATOR << relativeURL << wxT(")");
success = wxExecute(command); success = wxExecute(command);
if(success != 0 ) // returns PID on success if(success != 0 ) // returns PID on success
return TRUE; return true;
} }
} }
#endif #endif
@@ -273,7 +273,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
#endif #endif
if(! wxDirExists(file)) if(! wxDirExists(file))
return FALSE; return false;
mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE; mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE;
} }
@@ -281,7 +281,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
mapFile = m_MapFile; mapFile = m_MapFile;
if(! wxFileExists(mapFile)) if(! wxFileExists(mapFile))
return FALSE; return false;
DeleteList(); DeleteList();
m_MapList = new wxList; m_MapList = new wxList;
@@ -289,7 +289,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
FILE *input = wxFopen(mapFile,wxT("rt")); FILE *input = wxFopen(mapFile,wxT("rt"));
if(! input) if(! input)
return FALSE; return false;
do do
{ {
if(fgets(buffer,WXEXTHELP_BUFLEN,input) && *buffer != WXEXTHELP_COMMENTCHAR) if(fgets(buffer,WXEXTHELP_BUFLEN,input) && *buffer != WXEXTHELP_COMMENTCHAR)
@@ -301,13 +301,13 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
break; // error break; // error
for(i=0; isdigit(buffer[i])||isspace(buffer[i])||buffer[i]=='-'; i++) for(i=0; isdigit(buffer[i])||isspace(buffer[i])||buffer[i]=='-'; i++)
; // find begin of URL ; // find begin of URL
url = wxT(""); url = wxEmptyString;
while(buffer[i] && ! isspace(buffer[i]) && buffer[i] != while(buffer[i] && ! isspace(buffer[i]) && buffer[i] !=
WXEXTHELP_COMMENTCHAR) WXEXTHELP_COMMENTCHAR)
url << (wxChar) buffer[i++]; url << (wxChar) buffer[i++];
while(buffer[i] && buffer[i] != WXEXTHELP_COMMENTCHAR) while(buffer[i] && buffer[i] != WXEXTHELP_COMMENTCHAR)
i++; i++;
doc = wxT(""); doc = wxEmptyString;
if(buffer[i]) if(buffer[i])
doc = wxString::FromAscii( (buffer + i + 1) ); // skip the comment character doc = wxString::FromAscii( (buffer + i + 1) ); // skip the comment character
m_MapList->Append(new wxExtHelpMapEntry(id,url,doc)); m_MapList->Append(new wxExtHelpMapEntry(id,url,doc));
@@ -317,7 +317,7 @@ bool wxExtHelpController::LoadFile(const wxString& ifile)
fclose(input); fclose(input);
m_MapFile = file; // now it's valid m_MapFile = file; // now it's valid
return TRUE; return true;
} }
@@ -325,7 +325,7 @@ bool
wxExtHelpController::DisplayContents() wxExtHelpController::DisplayContents()
{ {
if(! m_NumOfEntries) if(! m_NumOfEntries)
return FALSE; return false;
wxString contents; wxString contents;
wxList::compatibility_iterator node = m_MapList->GetFirst(); wxList::compatibility_iterator node = m_MapList->GetFirst();
@@ -341,7 +341,7 @@ wxExtHelpController::DisplayContents()
node = node->GetNext(); node = node->GetNext();
} }
bool rc = FALSE; bool rc = false;
wxString file; wxString file;
file << m_MapFile << WXEXTHELP_SEPARATOR << contents; file << m_MapFile << WXEXTHELP_SEPARATOR << contents;
if(file.Contains(wxT('#'))) if(file.Contains(wxT('#')))
@@ -350,14 +350,14 @@ wxExtHelpController::DisplayContents()
rc = DisplaySection(CONTENTS_ID); rc = DisplaySection(CONTENTS_ID);
// if not found, open homemade toc: // if not found, open homemade toc:
return rc ? TRUE : KeywordSearch(wxT("")); return rc ? true : KeywordSearch(wxEmptyString);
} }
bool bool
wxExtHelpController::DisplaySection(int sectionNo) wxExtHelpController::DisplaySection(int sectionNo)
{ {
if(! m_NumOfEntries) if(! m_NumOfEntries)
return FALSE; return false;
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor
wxList::compatibility_iterator node = m_MapList->GetFirst(); wxList::compatibility_iterator node = m_MapList->GetFirst();
@@ -369,7 +369,7 @@ wxExtHelpController::DisplaySection(int sectionNo)
return DisplayHelp(entry->url); return DisplayHelp(entry->url);
node = node->GetNext(); node = node->GetNext();
} }
return FALSE; return false;
} }
bool wxExtHelpController::DisplaySection(const wxString& section) bool wxExtHelpController::DisplaySection(const wxString& section)
@@ -393,7 +393,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
wxHelpSearchMode WXUNUSED(mode)) wxHelpSearchMode WXUNUSED(mode))
{ {
if(! m_NumOfEntries) if(! m_NumOfEntries)
return FALSE; return false;
wxString *choices = new wxString[m_NumOfEntries]; wxString *choices = new wxString[m_NumOfEntries];
wxString *urls = new wxString[m_NumOfEntries]; wxString *urls = new wxString[m_NumOfEntries];
@@ -419,7 +419,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
// choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR)); // choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR));
//if(choices[idx].IsEmpty()) // didn't contain the ';' //if(choices[idx].IsEmpty()) // didn't contain the ';'
// choices[idx] = (**i).doc; // choices[idx] = (**i).doc;
choices[idx] = wxT(""); choices[idx] = wxEmptyString;
for(j=0;entry->doc.c_str()[j] for(j=0;entry->doc.c_str()[j]
&& entry->doc.c_str()[j] != WXEXTHELP_COMMENTCHAR; j++) && entry->doc.c_str()[j] != WXEXTHELP_COMMENTCHAR; j++)
choices[idx] << entry->doc.c_str()[j]; choices[idx] << entry->doc.c_str()[j];
@@ -434,7 +434,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
else if(idx == 0) else if(idx == 0)
{ {
wxMessageBox(_("No entries found.")); wxMessageBox(_("No entries found."));
rc = FALSE; rc = false;
} }
else else
{ {
@@ -444,7 +444,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
if(idx != -1) if(idx != -1)
rc = DisplayHelp(urls[idx]); rc = DisplayHelp(urls[idx]);
else else
rc = FALSE; rc = false;
} }
delete[] urls; delete[] urls;
delete[] choices; delete[] choices;
@@ -455,7 +455,7 @@ wxExtHelpController::KeywordSearch(const wxString& k,
bool wxExtHelpController::Quit() bool wxExtHelpController::Quit()
{ {
return TRUE; return true;
} }
void wxExtHelpController::OnQuit() void wxExtHelpController::OnQuit()

View File

@@ -63,7 +63,7 @@ bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int
bool wxGenericImageList::Create() bool wxGenericImageList::Create()
{ {
return TRUE; return true;
} }
int wxGenericImageList::Add( const wxBitmap &bitmap ) int wxGenericImageList::Add( const wxBitmap &bitmap )
@@ -108,7 +108,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ? wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ?
#if defined(__VISAGECPP__) #if defined(__VISAGECPP__)
@@ -134,19 +134,19 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
m_images.Insert( next, newBitmap ); m_images.Insert( next, newBitmap );
} }
return TRUE; return true;
} }
bool wxGenericImageList::Remove( int index ) bool wxGenericImageList::Remove( int index )
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
delete node->GetData(); delete node->GetData();
m_images.Erase( node ); m_images.Erase( node );
return TRUE; return true;
} }
bool wxGenericImageList::RemoveAll() bool wxGenericImageList::RemoveAll()
@@ -154,7 +154,7 @@ bool wxGenericImageList::RemoveAll()
WX_CLEAR_LIST(wxList, m_images); WX_CLEAR_LIST(wxList, m_images);
m_images.Clear(); m_images.Clear();
return TRUE; return true;
} }
bool wxGenericImageList::GetSize( int index, int &width, int &height ) const bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
@@ -164,13 +164,13 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
wxList::compatibility_iterator node = m_images.Item( index ); wxList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->GetData(); wxBitmap *bm = (wxBitmap*)node->GetData();
width = bm->GetWidth(); width = bm->GetWidth();
height = bm->GetHeight(); height = bm->GetHeight();
return TRUE; return true;
} }
bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
@@ -178,7 +178,7 @@ bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->GetData(); wxBitmap *bm = (wxBitmap*)node->GetData();
@@ -187,7 +187,7 @@ bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
else else
dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 );
return TRUE; return true;
} }

View File

@@ -167,7 +167,7 @@ void wxSashLayoutWindow::OnCalculateLayout(wxCalculateLayoutEvent& event)
// Make sure the sash is erased when the window is resized // Make sure the sash is erased when the window is resized
if ((pos.x != thisRect.x || pos.y != thisRect.y || sz.x != thisRect.width || sz.y != thisRect.height) && if ((pos.x != thisRect.x || pos.y != thisRect.y || sz.x != thisRect.width || sz.y != thisRect.height) &&
(GetSashVisible(wxSASH_TOP) || GetSashVisible(wxSASH_RIGHT) || GetSashVisible(wxSASH_BOTTOM) || GetSashVisible(wxSASH_LEFT))) (GetSashVisible(wxSASH_TOP) || GetSashVisible(wxSASH_RIGHT) || GetSashVisible(wxSASH_BOTTOM) || GetSashVisible(wxSASH_LEFT)))
Refresh(TRUE); Refresh(true);
} }
@@ -215,7 +215,7 @@ bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r)
clientWindow->SetSize(rect.x, rect.y, rect.width, rect.height); clientWindow->SetSize(rect.x, rect.y, rect.width, rect.height);
return TRUE; return true;
} }
#endif // wxUSE_MDI_ARCHITECTURE #endif // wxUSE_MDI_ARCHITECTURE
@@ -304,7 +304,7 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
} }
if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0) if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0)
return FALSE; return false;
event.SetRect(rect); event.SetRect(rect);
@@ -337,6 +337,6 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow)
lastAwareWindow->SetSize(rect.x, rect.y, wxMax(0, rect.width), wxMax(0, rect.height)); lastAwareWindow->SetSize(rect.x, rect.y, wxMax(0, rect.width), wxMax(0, rect.height));
} }
return TRUE; return true;
} }

View File

@@ -117,7 +117,7 @@ wxListbook::Create(wxWindow *parent,
m_line = new wxStaticLine m_line = new wxStaticLine
( (
this, this,
-1, wxID_ANY,
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
IsVertical() ? wxLI_HORIZONTAL : wxLI_VERTICAL IsVertical() ? wxLI_HORIZONTAL : wxLI_VERTICAL

View File

@@ -534,14 +534,14 @@ public:
// all these functions only do something if the line is currently visible // all these functions only do something if the line is currently visible
// change the line "selected" state, return TRUE if it really changed // change the line "selected" state, return true if it really changed
bool HighlightLine( size_t line, bool highlight = TRUE); bool HighlightLine( size_t line, bool highlight = true);
// as HighlightLine() but do it for the range of lines: this is incredibly // as HighlightLine() but do it for the range of lines: this is incredibly
// more efficient for virtual list controls! // more efficient for virtual list controls!
// //
// NB: unlike HighlightLine() this one does refresh the lines on screen // NB: unlike HighlightLine() this one does refresh the lines on screen
void HighlightLines( size_t lineFrom, size_t lineTo, bool on = TRUE ); void HighlightLines( size_t lineFrom, size_t lineTo, bool on = true );
// toggle the line state and refresh it // toggle the line state and refresh it
void ReverseHighlight( size_t line ) void ReverseHighlight( size_t line )
@@ -623,8 +623,8 @@ public:
int GetTextLength( const wxString &s ) const; int GetTextLength( const wxString &s ) const;
void SetImageList( wxImageListType *imageList, int which ); void SetImageList( wxImageListType *imageList, int which );
void SetItemSpacing( int spacing, bool isSmall = FALSE ); void SetItemSpacing( int spacing, bool isSmall = false );
int GetItemSpacing( bool isSmall = FALSE ); int GetItemSpacing( bool isSmall = false );
void SetColumn( int col, wxListItem &item ); void SetColumn( int col, wxListItem &item );
void SetColumnWidth( int col, int width ); void SetColumnWidth( int col, int width );
@@ -664,7 +664,7 @@ public:
} }
// set the scrollbars and update the positions of the items // set the scrollbars and update the positions of the items
void RecalculatePositions(bool noRefresh = FALSE); void RecalculatePositions(bool noRefresh = false);
// refresh the window and the header // refresh the window and the header
void RefreshAll(); void RefreshAll();
@@ -675,7 +675,7 @@ public:
void DeleteColumn( int col ); void DeleteColumn( int col );
void DeleteEverything(); void DeleteEverything();
void EnsureVisible( long index ); void EnsureVisible( long index );
long FindItem( long start, const wxString& str, bool partial = FALSE ); long FindItem( long start, const wxString& str, bool partial = false );
long FindItem( long start, long data); long FindItem( long start, long data);
long HitTest( int x, int y, int &flags ); long HitTest( int x, int y, int &flags );
void InsertItem( wxListItem &item ); void InsertItem( wxListItem &item );
@@ -700,11 +700,11 @@ public:
virtual bool SetFont(const wxFont& font) virtual bool SetFont(const wxFont& font)
{ {
if ( !wxScrolledWindow::SetFont(font) ) if ( !wxScrolledWindow::SetFont(font) )
return FALSE; return false;
m_lineHeight = 0; m_lineHeight = 0;
return TRUE; return true;
} }
// these are for wxListLineData usage only // these are for wxListLineData usage only
@@ -937,7 +937,7 @@ void wxListItemData::SetSize( int width, int height )
bool wxListItemData::IsHit( int x, int y ) const bool wxListItemData::IsHit( int x, int y ) const
{ {
wxCHECK_MSG( m_rect, FALSE, _T("can't be called in this mode") ); wxCHECK_MSG( m_rect, false, _T("can't be called in this mode") );
return wxRect(GetX(), GetY(), GetWidth(), GetHeight()).Inside(x, y); return wxRect(GetX(), GetY(), GetWidth(), GetHeight()).Inside(x, y);
} }
@@ -1122,7 +1122,7 @@ wxListLineData::wxListLineData( wxListMainWindow *owner )
m_gi = new GeometryInfo; m_gi = new GeometryInfo;
} }
m_highlighted = FALSE; m_highlighted = false;
InitItems( GetMode() == wxLC_REPORT ? m_owner->GetColumnCount() : 1 ); InitItems( GetMode() == wxLC_REPORT ? m_owner->GetColumnCount() : 1 );
} }
@@ -1438,10 +1438,10 @@ bool wxListLineData::SetAttributes(wxDC *dc,
dc->SetPen( *wxTRANSPARENT_PEN ); dc->SetPen( *wxTRANSPARENT_PEN );
return TRUE; return true;
} }
return FALSE; return false;
} }
void wxListLineData::Draw( wxDC *dc ) void wxListLineData::Draw( wxDC *dc )
@@ -1608,14 +1608,14 @@ void wxListLineData::DrawTextFormatted(wxDC *dc,
bool wxListLineData::Highlight( bool on ) bool wxListLineData::Highlight( bool on )
{ {
wxCHECK_MSG( !IsVirtual(), FALSE, _T("unexpected call to Highlight") ); wxCHECK_MSG( !IsVirtual(), false, _T("unexpected call to Highlight") );
if ( on == m_highlighted ) if ( on == m_highlighted )
return FALSE; return false;
m_highlighted = on; m_highlighted = on;
return TRUE; return true;
} }
void wxListLineData::ReverseHighlight( void ) void wxListLineData::ReverseHighlight( void )
@@ -1638,8 +1638,8 @@ END_EVENT_TABLE()
void wxListHeaderWindow::Init() void wxListHeaderWindow::Init()
{ {
m_currentCursor = (wxCursor *) NULL; m_currentCursor = (wxCursor *) NULL;
m_isDragging = FALSE; m_isDragging = false;
m_dirty = FALSE; m_dirty = false;
} }
wxListHeaderWindow::wxListHeaderWindow() wxListHeaderWindow::wxListHeaderWindow()
@@ -1871,8 +1871,8 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
if (event.ButtonUp()) if (event.ButtonUp())
{ {
ReleaseMouse(); ReleaseMouse();
m_isDragging = FALSE; m_isDragging = false;
m_dirty = TRUE; m_dirty = true;
m_owner->SetColumnWidth( m_column, m_currentX - m_minX ); m_owner->SetColumnWidth( m_column, m_currentX - m_minX );
SendListEvent(wxEVT_COMMAND_LIST_COL_END_DRAG, event.GetPosition()); SendListEvent(wxEVT_COMMAND_LIST_COL_END_DRAG, event.GetPosition());
} }
@@ -1891,7 +1891,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
else // not dragging else // not dragging
{ {
m_minX = 0; m_minX = 0;
bool hit_border = FALSE; bool hit_border = false;
// end of the current column // end of the current column
int xpos = 0; int xpos = 0;
@@ -1907,7 +1907,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
if ( (abs(x-xpos) < 3) && (y < 22) ) if ( (abs(x-xpos) < 3) && (y < 22) )
{ {
// near the column border // near the column border
hit_border = TRUE; hit_border = true;
break; break;
} }
@@ -1930,7 +1930,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
if ( SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, if ( SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
event.GetPosition()) ) event.GetPosition()) )
{ {
m_isDragging = TRUE; m_isDragging = true;
m_currentX = x; m_currentX = x;
CaptureMouse(); CaptureMouse();
DrawCurrent(); DrawCurrent();
@@ -2017,7 +2017,7 @@ wxListTextCtrl::wxListTextCtrl(wxListMainWindow *owner, size_t itemEdit)
m_itemEdited(itemEdit) m_itemEdited(itemEdit)
{ {
m_owner = owner; m_owner = owner;
m_finished = FALSE; m_finished = false;
wxRect rectLabel = owner->GetLineLabelRect(itemEdit); wxRect rectLabel = owner->GetLineLabelRect(itemEdit);
@@ -2035,7 +2035,7 @@ void wxListTextCtrl::Finish()
{ {
wxPendingDelete.Append(this); wxPendingDelete.Append(this);
m_finished = TRUE; m_finished = true;
m_owner->SetFocus(); m_owner->SetFocus();
} }
@@ -2048,19 +2048,19 @@ bool wxListTextCtrl::AcceptChanges()
if ( value == m_startValue ) if ( value == m_startValue )
{ {
// nothing changed, always accept // nothing changed, always accept
return TRUE; return true;
} }
if ( !m_owner->OnRenameAccept(m_itemEdited, value) ) if ( !m_owner->OnRenameAccept(m_itemEdited, value) )
{ {
// vetoed by the user // vetoed by the user
return FALSE; return false;
} }
// accepted, do rename the item // accepted, do rename the item
m_owner->SetItemText(m_itemEdited, value); m_owner->SetItemText(m_itemEdited, value);
return TRUE; return true;
} }
void wxListTextCtrl::OnChar( wxKeyEvent &event ) void wxListTextCtrl::OnChar( wxKeyEvent &event )
@@ -2103,7 +2103,7 @@ void wxListTextCtrl::OnKeyUp( wxKeyEvent &event )
sx = parentSize.x - myPos.x; sx = parentSize.x - myPos.x;
if (mySize.x > sx) if (mySize.x > sx)
sx = mySize.x; sx = mySize.x;
SetSize(sx, -1); SetSize(sx, wxDefaultSize.y);
event.Skip(); event.Skip();
} }
@@ -2140,7 +2140,7 @@ END_EVENT_TABLE()
void wxListMainWindow::Init() void wxListMainWindow::Init()
{ {
m_dirty = TRUE; m_dirty = true;
m_countVirt = 0; m_countVirt = 0;
m_lineFrom = m_lineFrom =
m_lineTo = (size_t)-1; m_lineTo = (size_t)-1;
@@ -2155,11 +2155,11 @@ void wxListMainWindow::Init()
m_small_spacing = 30; m_small_spacing = 30;
m_normal_spacing = 40; m_normal_spacing = 40;
m_hasFocus = FALSE; m_hasFocus = false;
m_dragCount = 0; m_dragCount = 0;
m_isCreated = FALSE; m_isCreated = false;
m_lastOnSame = FALSE; m_lastOnSame = false;
m_renameTimer = new wxListRenameTimer( this ); m_renameTimer = new wxListRenameTimer( this );
m_current = m_current =
@@ -2400,7 +2400,7 @@ bool wxListMainWindow::IsHighlighted(size_t line) const
else // !virtual else // !virtual
{ {
wxListLineData *ld = GetLine(line); wxListLineData *ld = GetLine(line);
wxCHECK_MSG( ld, FALSE, _T("invalid index in IsHighlighted") ); wxCHECK_MSG( ld, false, _T("invalid index in IsHighlighted") );
return ld->IsHighlighted(); return ld->IsHighlighted();
} }
@@ -2451,7 +2451,7 @@ bool wxListMainWindow::HighlightLine( size_t line, bool highlight )
else // !virtual else // !virtual
{ {
wxListLineData *ld = GetLine(line); wxListLineData *ld = GetLine(line);
wxCHECK_MSG( ld, FALSE, _T("invalid index in HighlightLine") ); wxCHECK_MSG( ld, false, _T("invalid index in HighlightLine") );
changed = ld->Highlight(highlight); changed = ld->Highlight(highlight);
} }
@@ -2545,7 +2545,7 @@ void wxListMainWindow::RefreshAfter( size_t lineFrom )
else // !report else // !report
{ {
// TODO: how to do it more efficiently? // TODO: how to do it more efficiently?
m_dirty = TRUE; m_dirty = true;
} }
} }
@@ -2740,7 +2740,7 @@ void wxListMainWindow::HighlightAll( bool on )
// we just have one item to turn off // we just have one item to turn off
if ( HasCurrent() && IsHighlighted(m_current) ) if ( HasCurrent() && IsHighlighted(m_current) )
{ {
HighlightLine(m_current, FALSE); HighlightLine(m_current, false);
RefreshLine(m_current); RefreshLine(m_current);
} }
} }
@@ -2829,7 +2829,7 @@ bool wxListMainWindow::OnRenameAccept(size_t itemEdit, const wxString& value)
le.m_itemIndex = itemEdit; le.m_itemIndex = itemEdit;
wxListLineData *data = GetLine(itemEdit); wxListLineData *data = GetLine(itemEdit);
wxCHECK_MSG( data, FALSE, _T("invalid index in OnRenameAccept()") ); wxCHECK_MSG( data, false, _T("invalid index in OnRenameAccept()") );
data->GetItem( 0, le.m_item ); data->GetItem( 0, le.m_item );
le.m_item.m_text = value; le.m_item.m_text = value;
@@ -2842,7 +2842,7 @@ void wxListMainWindow::OnRenameCancelled(size_t itemEdit)
// let owner know that the edit was cancelled // let owner know that the edit was cancelled
wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() ); wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() );
le.SetEditCanceled(TRUE); le.SetEditCanceled(true);
le.SetEventObject( GetParent() ); le.SetEventObject( GetParent() );
le.m_itemIndex = itemEdit; le.m_itemIndex = itemEdit;
@@ -2936,11 +2936,11 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
return; return;
} }
bool forceClick = FALSE; bool forceClick = false;
if (event.ButtonDClick()) if (event.ButtonDClick())
{ {
m_renameTimer->Stop(); m_renameTimer->Stop();
m_lastOnSame = FALSE; m_lastOnSame = false;
if ( current == m_lineLastClicked ) if ( current == m_lineLastClicked )
{ {
@@ -2952,7 +2952,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
{ {
// the first click was on another item, so don't interpret this as // the first click was on another item, so don't interpret this as
// a double click, but as a simple click instead // a double click, but as a simple click instead
forceClick = TRUE; forceClick = true;
} }
} }
@@ -2962,9 +2962,9 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
(hitResult == wxLIST_HITTEST_ONITEMLABEL) && (hitResult == wxLIST_HITTEST_ONITEMLABEL) &&
HasFlag(wxLC_EDIT_LABELS) ) HasFlag(wxLC_EDIT_LABELS) )
{ {
m_renameTimer->Start( 100, TRUE ); m_renameTimer->Start( 100, true );
} }
m_lastOnSame = FALSE; m_lastOnSame = false;
} }
else if (event.RightDown()) else if (event.RightDown())
{ {
@@ -2984,7 +2984,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
if ( IsSingleSel() || !(event.ControlDown() || event.ShiftDown()) ) if ( IsSingleSel() || !(event.ControlDown() || event.ShiftDown()) )
{ {
HighlightAll( FALSE ); HighlightAll( false );
ChangeCurrent(current); ChangeCurrent(current);
@@ -3098,7 +3098,7 @@ void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
{ {
// all previously selected items are unselected unless ctrl is held // all previously selected items are unselected unless ctrl is held
if ( !event.ControlDown() ) if ( !event.ControlDown() )
HighlightAll(FALSE); HighlightAll(false);
ChangeCurrent(newCurrent); ChangeCurrent(newCurrent);
@@ -3107,7 +3107,7 @@ void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
if ( !event.ControlDown() ) if ( !event.ControlDown() )
{ {
HighlightLine( m_current, TRUE ); HighlightLine( m_current, true );
} }
} }
@@ -3319,7 +3319,7 @@ void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) )
// it // it
if ( !m_hasFocus ) if ( !m_hasFocus )
{ {
m_hasFocus = TRUE; m_hasFocus = true;
RefreshSelected(); RefreshSelected();
} }
@@ -3334,7 +3334,7 @@ void wxListMainWindow::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
if ( GetParent()->GetEventHandler()->ProcessEvent( event) ) if ( GetParent()->GetEventHandler()->ProcessEvent( event) )
return; return;
} }
m_hasFocus = FALSE; m_hasFocus = false;
RefreshSelected(); RefreshSelected();
} }
@@ -3396,7 +3396,7 @@ int wxListMainWindow::GetTextLength( const wxString &s ) const
void wxListMainWindow::SetImageList( wxImageListType *imageList, int which ) void wxListMainWindow::SetImageList( wxImageListType *imageList, int which )
{ {
m_dirty = TRUE; m_dirty = true;
// calc the spacing from the icon size // calc the spacing from the icon size
int width = 0, int width = 0,
@@ -3422,7 +3422,7 @@ void wxListMainWindow::SetImageList( wxImageListType *imageList, int which )
void wxListMainWindow::SetItemSpacing( int spacing, bool isSmall ) void wxListMainWindow::SetItemSpacing( int spacing, bool isSmall )
{ {
m_dirty = TRUE; m_dirty = true;
if (isSmall) if (isSmall)
{ {
m_small_spacing = spacing; m_small_spacing = spacing;
@@ -3456,9 +3456,9 @@ void wxListMainWindow::SetColumn( int col, wxListItem &item )
wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin; wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
if ( headerWin ) if ( headerWin )
headerWin->m_dirty = TRUE; headerWin->m_dirty = true;
m_dirty = TRUE; m_dirty = true;
// invalidate it as it has to be recalculated // invalidate it as it has to be recalculated
m_headerWidth = 0; m_headerWidth = 0;
@@ -3472,10 +3472,10 @@ void wxListMainWindow::SetColumnWidth( int col, int width )
wxCHECK_RET( InReportView(), wxCHECK_RET( InReportView(),
_T("SetColumnWidth() can only be called in report mode.") ); _T("SetColumnWidth() can only be called in report mode.") );
m_dirty = TRUE; m_dirty = true;
wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin; wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
if ( headerWin ) if ( headerWin )
headerWin->m_dirty = TRUE; headerWin->m_dirty = true;
wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col );
wxCHECK_RET( node, _T("no column?") ); wxCHECK_RET( node, _T("no column?") );
@@ -3618,7 +3618,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
{ {
if ( IsSingleSel() ) if ( IsSingleSel() )
{ {
HighlightLine(oldCurrent, FALSE); HighlightLine(oldCurrent, false);
} }
RefreshLine(oldCurrent); RefreshLine(oldCurrent);
@@ -3639,7 +3639,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
// we must unselect the old current item as well or we // we must unselect the old current item as well or we
// might end up with more than one selected item in a // might end up with more than one selected item in a
// single selection control // single selection control
HighlightLine(oldCurrent, FALSE); HighlightLine(oldCurrent, false);
} }
RefreshLine( oldCurrent ); RefreshLine( oldCurrent );
@@ -3664,7 +3664,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask )
if ( oldCurrent != (size_t)-1 ) if ( oldCurrent != (size_t)-1 )
{ {
HighlightLine( oldCurrent, FALSE ); HighlightLine( oldCurrent, false );
RefreshLine( oldCurrent ); RefreshLine( oldCurrent );
} }
} }
@@ -3732,7 +3732,7 @@ void wxListMainWindow::SetItemCount(long count)
ResetVisibleLinesRange(); ResetVisibleLinesRange();
// scrollbars must be reset // scrollbars must be reset
m_dirty = TRUE; m_dirty = true;
} }
int wxListMainWindow::GetSelectedItemCount() const int wxListMainWindow::GetSelectedItemCount() const
@@ -3740,7 +3740,7 @@ int wxListMainWindow::GetSelectedItemCount() const
// deal with the quick case first // deal with the quick case first
if ( IsSingleSel() ) if ( IsSingleSel() )
{ {
return HasCurrent() ? IsHighlighted(m_current) : FALSE; return HasCurrent() ? IsHighlighted(m_current) : false;
} }
// virtual controls remmebers all its selections itself // virtual controls remmebers all its selections itself
@@ -3813,7 +3813,7 @@ void wxListMainWindow::GetItemRect( long index, wxRect &rect ) const
if ( m_dirty ) if ( m_dirty )
{ {
wxConstCast(this, wxListMainWindow)-> wxConstCast(this, wxListMainWindow)->
RecalculatePositions(TRUE /* no refresh */); RecalculatePositions(true /* no refresh */);
} }
rect = GetLineRect((size_t)index); rect = GetLineRect((size_t)index);
@@ -3829,7 +3829,7 @@ bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos) const
pos.x = rect.x; pos.x = rect.x;
pos.y = rect.y; pos.y = rect.y;
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -3887,7 +3887,7 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
(entireHeight + lineHeight - 1) / lineHeight, (entireHeight + lineHeight - 1) / lineHeight,
GetScrollPos(wxHORIZONTAL), GetScrollPos(wxHORIZONTAL),
GetScrollPos(wxVERTICAL), GetScrollPos(wxVERTICAL),
TRUE ); true );
} }
else // !report else // !report
{ {
@@ -3944,7 +3944,7 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
(y + lineHeight) / lineHeight, (y + lineHeight) / lineHeight,
GetScrollPos( wxHORIZONTAL ), GetScrollPos( wxHORIZONTAL ),
GetScrollPos( wxVERTICAL ), GetScrollPos( wxVERTICAL ),
TRUE true
); );
} }
else // "flowed" arrangement, the most complicated case else // "flowed" arrangement, the most complicated case
@@ -4025,7 +4025,7 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
0, 0,
GetScrollPos( wxHORIZONTAL ), GetScrollPos( wxHORIZONTAL ),
0, 0,
TRUE true
); );
} }
} }
@@ -4041,13 +4041,13 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh)
void wxListMainWindow::RefreshAll() void wxListMainWindow::RefreshAll()
{ {
m_dirty = FALSE; m_dirty = false;
Refresh(); Refresh();
wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin; wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
if ( headerWin && headerWin->m_dirty ) if ( headerWin && headerWin->m_dirty )
{ {
headerWin->m_dirty = FALSE; headerWin->m_dirty = false;
headerWin->Refresh(); headerWin->Refresh();
} }
} }
@@ -4141,7 +4141,7 @@ void wxListMainWindow::DeleteItem( long lindex )
} }
// we need to refresh the (vert) scrollbar as the number of items changed // we need to refresh the (vert) scrollbar as the number of items changed
m_dirty = TRUE; m_dirty = true;
SendNotify( index, wxEVT_COMMAND_LIST_DELETE_ITEM ); SendNotify( index, wxEVT_COMMAND_LIST_DELETE_ITEM );
@@ -4154,7 +4154,7 @@ void wxListMainWindow::DeleteColumn( int col )
wxCHECK_RET( node, wxT("invalid column index in DeleteColumn()") ); wxCHECK_RET( node, wxT("invalid column index in DeleteColumn()") );
m_dirty = TRUE; m_dirty = true;
delete node->GetData(); delete node->GetData();
m_columns.Erase( node ); m_columns.Erase( node );
@@ -4235,7 +4235,7 @@ void wxListMainWindow::EnsureVisible( long index )
// been added and its position is not known yet // been added and its position is not known yet
if ( m_dirty ) if ( m_dirty )
{ {
RecalculatePositions(TRUE /* no refresh */); RecalculatePositions(true /* no refresh */);
} }
MoveToItem((size_t)index); MoveToItem((size_t)index);
@@ -4323,7 +4323,7 @@ void wxListMainWindow::InsertItem( wxListItem &item )
size_t id = item.m_itemId; size_t id = item.m_itemId;
m_dirty = TRUE; m_dirty = true;
#if 0 #if 0
// this is unused variable // this is unused variable
@@ -4369,7 +4369,7 @@ void wxListMainWindow::InsertItem( wxListItem &item )
m_lines.Insert( line, id ); m_lines.Insert( line, id );
m_dirty = TRUE; m_dirty = true;
// If an item is selected at or below the point of insertion, we need to // If an item is selected at or below the point of insertion, we need to
// increment the member variables because the current row's index has gone // increment the member variables because the current row's index has gone
@@ -4386,7 +4386,7 @@ void wxListMainWindow::InsertItem( wxListItem &item )
void wxListMainWindow::InsertColumn( long col, wxListItem &item ) void wxListMainWindow::InsertColumn( long col, wxListItem &item )
{ {
m_dirty = TRUE; m_dirty = true;
if ( InReportView() ) if ( InReportView() )
{ {
if (item.m_width == wxLIST_AUTOSIZE_USEHEADER) if (item.m_width == wxLIST_AUTOSIZE_USEHEADER)
@@ -4447,7 +4447,7 @@ void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
list_ctrl_compare_func_2 = fn; list_ctrl_compare_func_2 = fn;
list_ctrl_compare_data = data; list_ctrl_compare_data = data;
m_lines.Sort( list_ctrl_compare_func_1 ); m_lines.Sort( list_ctrl_compare_func_1 );
m_dirty = TRUE; m_dirty = true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -4544,7 +4544,7 @@ wxGenericListCtrl::wxGenericListCtrl()
m_ownsImageListNormal = m_ownsImageListNormal =
m_ownsImageListSmall = m_ownsImageListSmall =
m_ownsImageListState = FALSE; m_ownsImageListState = false;
m_mainWin = (wxListMainWindow*) NULL; m_mainWin = (wxListMainWindow*) NULL;
m_headerWin = (wxListHeaderWindow*) NULL; m_headerWin = (wxListHeaderWindow*) NULL;
@@ -4578,7 +4578,7 @@ void wxGenericListCtrl::CalculateAndSetHeaderHeight()
m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight); m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight);
if ( HasHeader() ) if ( HasHeader() )
ResizeReportView(TRUE); ResizeReportView(true);
} }
} }
} }
@@ -4587,7 +4587,7 @@ void wxGenericListCtrl::CreateHeaderWindow()
{ {
m_headerWin = new wxListHeaderWindow m_headerWin = new wxListHeaderWindow
( (
this, -1, m_mainWin, this, wxID_ANY, m_mainWin,
wxPoint(0, 0), wxPoint(0, 0),
wxSize(GetClientSize().x, m_headerHeight), wxSize(GetClientSize().x, m_headerHeight),
wxTAB_TRAVERSAL wxTAB_TRAVERSAL
@@ -4608,7 +4608,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
m_imageListState = (wxImageListType *) NULL; m_imageListState = (wxImageListType *) NULL;
m_ownsImageListNormal = m_ownsImageListNormal =
m_ownsImageListSmall = m_ownsImageListSmall =
m_ownsImageListState = FALSE; m_ownsImageListState = false;
m_mainWin = (wxListMainWindow*) NULL; m_mainWin = (wxListMainWindow*) NULL;
m_headerWin = (wxListHeaderWindow*) NULL; m_headerWin = (wxListHeaderWindow*) NULL;
@@ -4621,12 +4621,12 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
} }
if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) )
return FALSE; return false;
// don't create the inner window with the border // don't create the inner window with the border
style &= ~wxBORDER_MASK; style &= ~wxBORDER_MASK;
m_mainWin = new wxListMainWindow( this, -1, wxPoint(0,0), size, style ); m_mainWin = new wxListMainWindow( this, wxID_ANY, wxPoint(0,0), size, style );
#if defined( __WXMAC__ ) && __WXMAC_CARBON__ #if defined( __WXMAC__ ) && __WXMAC_CARBON__
wxFont font ; wxFont font ;
@@ -4640,13 +4640,13 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
if ( HasFlag(wxLC_NO_HEADER) ) if ( HasFlag(wxLC_NO_HEADER) )
{ {
// VZ: why do we create it at all then? // VZ: why do we create it at all then?
m_headerWin->Show( FALSE ); m_headerWin->Show( false );
} }
} }
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
void wxGenericListCtrl::SetSingleStyle( long style, bool add ) void wxGenericListCtrl::SetSingleStyle( long style, bool add )
@@ -4696,7 +4696,7 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
if ( m_headerWin ) if ( m_headerWin )
{ {
// don't delete, just hide, as we can reuse it later // don't delete, just hide, as we can reuse it later
m_headerWin->Show(FALSE); m_headerWin->Show(false);
} }
//else: nothing to do //else: nothing to do
} }
@@ -4708,7 +4708,7 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
} }
else // already have it, just show else // already have it, just show
{ {
m_headerWin->Show( TRUE ); m_headerWin->Show( true );
} }
} }
@@ -4722,13 +4722,13 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const
{ {
m_mainWin->GetColumn( col, item ); m_mainWin->GetColumn( col, item );
return TRUE; return true;
} }
bool wxGenericListCtrl::SetColumn( int col, wxListItem& item ) bool wxGenericListCtrl::SetColumn( int col, wxListItem& item )
{ {
m_mainWin->SetColumn( col, item ); m_mainWin->SetColumn( col, item );
return TRUE; return true;
} }
int wxGenericListCtrl::GetColumnWidth( int col ) const int wxGenericListCtrl::GetColumnWidth( int col ) const
@@ -4739,7 +4739,7 @@ int wxGenericListCtrl::GetColumnWidth( int col ) const
bool wxGenericListCtrl::SetColumnWidth( int col, int width ) bool wxGenericListCtrl::SetColumnWidth( int col, int width )
{ {
m_mainWin->SetColumnWidth( col, width ); m_mainWin->SetColumnWidth( col, width );
return TRUE; return true;
} }
int wxGenericListCtrl::GetCountPerPage() const int wxGenericListCtrl::GetCountPerPage() const
@@ -4750,13 +4750,13 @@ int wxGenericListCtrl::GetCountPerPage() const
bool wxGenericListCtrl::GetItem( wxListItem &info ) const bool wxGenericListCtrl::GetItem( wxListItem &info ) const
{ {
m_mainWin->GetItem( info ); m_mainWin->GetItem( info );
return TRUE; return true;
} }
bool wxGenericListCtrl::SetItem( wxListItem &info ) bool wxGenericListCtrl::SetItem( wxListItem &info )
{ {
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
return TRUE; return true;
} }
long wxGenericListCtrl::SetItem( long index, int col, const wxString& label, int imageId ) long wxGenericListCtrl::SetItem( long index, int col, const wxString& label, int imageId )
@@ -4772,7 +4772,7 @@ long wxGenericListCtrl::SetItem( long index, int col, const wxString& label, int
info.m_mask |= wxLIST_MASK_IMAGE; info.m_mask |= wxLIST_MASK_IMAGE;
}; };
m_mainWin->SetItem(info); m_mainWin->SetItem(info);
return TRUE; return true;
} }
int wxGenericListCtrl::GetItemState( long item, long stateMask ) const int wxGenericListCtrl::GetItemState( long item, long stateMask ) const
@@ -4783,7 +4783,7 @@ int wxGenericListCtrl::GetItemState( long item, long stateMask ) const
bool wxGenericListCtrl::SetItemState( long item, long state, long stateMask ) bool wxGenericListCtrl::SetItemState( long item, long state, long stateMask )
{ {
m_mainWin->SetItemState( item, state, stateMask ); m_mainWin->SetItemState( item, state, stateMask );
return TRUE; return true;
} }
bool wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) ) bool wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) )
@@ -4793,7 +4793,7 @@ bool wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImag
info.m_mask = wxLIST_MASK_IMAGE; info.m_mask = wxLIST_MASK_IMAGE;
info.m_itemId = item; info.m_itemId = item;
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
return TRUE; return true;
} }
wxString wxGenericListCtrl::GetItemText( long item ) const wxString wxGenericListCtrl::GetItemText( long item ) const
@@ -4821,7 +4821,7 @@ bool wxGenericListCtrl::SetItemData( long item, long data )
info.m_itemId = item; info.m_itemId = item;
info.m_data = data; info.m_data = data;
m_mainWin->SetItem( info ); m_mainWin->SetItem( info );
return TRUE; return true;
} }
wxRect wxGenericListCtrl::GetViewRect() const wxRect wxGenericListCtrl::GetViewRect() const
@@ -4834,13 +4834,13 @@ bool wxGenericListCtrl::GetItemRect( long item, wxRect &rect, int WXUNUSED(code
m_mainWin->GetItemRect( item, rect ); m_mainWin->GetItemRect( item, rect );
if ( m_mainWin->HasHeader() ) if ( m_mainWin->HasHeader() )
rect.y += m_headerHeight + 1; rect.y += m_headerHeight + 1;
return TRUE; return true;
} }
bool wxGenericListCtrl::GetItemPosition( long item, wxPoint& pos ) const bool wxGenericListCtrl::GetItemPosition( long item, wxPoint& pos ) const
{ {
m_mainWin->GetItemPosition( item, pos ); m_mainWin->GetItemPosition( item, pos );
return TRUE; return true;
} }
bool wxGenericListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) ) bool wxGenericListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) )
@@ -4957,19 +4957,19 @@ void wxGenericListCtrl::SetImageList( wxImageListType *imageList, int which )
{ {
if (m_ownsImageListNormal) delete m_imageListNormal; if (m_ownsImageListNormal) delete m_imageListNormal;
m_imageListNormal = imageList; m_imageListNormal = imageList;
m_ownsImageListNormal = FALSE; m_ownsImageListNormal = false;
} }
else if ( which == wxIMAGE_LIST_SMALL ) else if ( which == wxIMAGE_LIST_SMALL )
{ {
if (m_ownsImageListSmall) delete m_imageListSmall; if (m_ownsImageListSmall) delete m_imageListSmall;
m_imageListSmall = imageList; m_imageListSmall = imageList;
m_ownsImageListSmall = FALSE; m_ownsImageListSmall = false;
} }
else if ( which == wxIMAGE_LIST_STATE ) else if ( which == wxIMAGE_LIST_STATE )
{ {
if (m_ownsImageListState) delete m_imageListState; if (m_ownsImageListState) delete m_imageListState;
m_imageListState = imageList; m_imageListState = imageList;
m_ownsImageListState = FALSE; m_ownsImageListState = false;
} }
m_mainWin->SetImageList( imageList, which ); m_mainWin->SetImageList( imageList, which );
@@ -4979,11 +4979,11 @@ void wxGenericListCtrl::AssignImageList(wxImageListType *imageList, int which)
{ {
SetImageList(imageList, which); SetImageList(imageList, which);
if ( which == wxIMAGE_LIST_NORMAL ) if ( which == wxIMAGE_LIST_NORMAL )
m_ownsImageListNormal = TRUE; m_ownsImageListNormal = true;
else if ( which == wxIMAGE_LIST_SMALL ) else if ( which == wxIMAGE_LIST_SMALL )
m_ownsImageListSmall = TRUE; m_ownsImageListSmall = true;
else if ( which == wxIMAGE_LIST_STATE ) else if ( which == wxIMAGE_LIST_STATE )
m_ownsImageListState = TRUE; m_ownsImageListState = true;
} }
bool wxGenericListCtrl::Arrange( int WXUNUSED(flag) ) bool wxGenericListCtrl::Arrange( int WXUNUSED(flag) )
@@ -4994,13 +4994,13 @@ bool wxGenericListCtrl::Arrange( int WXUNUSED(flag) )
bool wxGenericListCtrl::DeleteItem( long item ) bool wxGenericListCtrl::DeleteItem( long item )
{ {
m_mainWin->DeleteItem( item ); m_mainWin->DeleteItem( item );
return TRUE; return true;
} }
bool wxGenericListCtrl::DeleteAllItems() bool wxGenericListCtrl::DeleteAllItems()
{ {
m_mainWin->DeleteAllItems(); m_mainWin->DeleteAllItems();
return TRUE; return true;
} }
bool wxGenericListCtrl::DeleteAllColumns() bool wxGenericListCtrl::DeleteAllColumns()
@@ -5009,7 +5009,7 @@ bool wxGenericListCtrl::DeleteAllColumns()
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
DeleteColumn(0); DeleteColumn(0);
return TRUE; return true;
} }
void wxGenericListCtrl::ClearAll() void wxGenericListCtrl::ClearAll()
@@ -5024,10 +5024,10 @@ bool wxGenericListCtrl::DeleteColumn( int col )
// if we don't have the header any longer, we need to relayout the window // if we don't have the header any longer, we need to relayout the window
if ( !GetColumnCount() ) if ( !GetColumnCount() )
{ {
ResizeReportView(FALSE /* no header */); ResizeReportView(false /* no header */);
} }
return TRUE; return true;
} }
void wxGenericListCtrl::Edit( long item ) void wxGenericListCtrl::Edit( long item )
@@ -5038,7 +5038,7 @@ void wxGenericListCtrl::Edit( long item )
bool wxGenericListCtrl::EnsureVisible( long item ) bool wxGenericListCtrl::EnsureVisible( long item )
{ {
m_mainWin->EnsureVisible( item ); m_mainWin->EnsureVisible( item );
return TRUE; return true;
} }
long wxGenericListCtrl::FindItem( long start, const wxString& str, bool partial ) long wxGenericListCtrl::FindItem( long start, const wxString& str, bool partial )
@@ -5106,7 +5106,7 @@ long wxGenericListCtrl::InsertColumn( long col, wxListItem &item )
// window // window
if ( GetColumnCount() == 1 && m_mainWin->HasHeader() ) if ( GetColumnCount() == 1 && m_mainWin->HasHeader() )
{ {
ResizeReportView(TRUE /* have header */); ResizeReportView(true /* have header */);
} }
m_headerWin->Refresh(); m_headerWin->Refresh();
@@ -5148,7 +5148,7 @@ bool wxGenericListCtrl::ScrollList( int WXUNUSED(dx), int WXUNUSED(dy) )
bool wxGenericListCtrl::SortItems( wxListCtrlCompare fn, long data ) bool wxGenericListCtrl::SortItems( wxListCtrlCompare fn, long data )
{ {
m_mainWin->SortItems( fn, data ); m_mainWin->SortItems( fn, data );
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -5201,21 +5201,21 @@ bool wxGenericListCtrl::SetBackgroundColour( const wxColour &colour )
if (m_mainWin) if (m_mainWin)
{ {
m_mainWin->SetBackgroundColour( colour ); m_mainWin->SetBackgroundColour( colour );
m_mainWin->m_dirty = TRUE; m_mainWin->m_dirty = true;
} }
return TRUE; return true;
} }
bool wxGenericListCtrl::SetForegroundColour( const wxColour &colour ) bool wxGenericListCtrl::SetForegroundColour( const wxColour &colour )
{ {
if ( !wxWindow::SetForegroundColour( colour ) ) if ( !wxWindow::SetForegroundColour( colour ) )
return FALSE; return false;
if (m_mainWin) if (m_mainWin)
{ {
m_mainWin->SetForegroundColour( colour ); m_mainWin->SetForegroundColour( colour );
m_mainWin->m_dirty = TRUE; m_mainWin->m_dirty = true;
} }
if (m_headerWin) if (m_headerWin)
@@ -5223,18 +5223,18 @@ bool wxGenericListCtrl::SetForegroundColour( const wxColour &colour )
m_headerWin->SetForegroundColour( colour ); m_headerWin->SetForegroundColour( colour );
} }
return TRUE; return true;
} }
bool wxGenericListCtrl::SetFont( const wxFont &font ) bool wxGenericListCtrl::SetFont( const wxFont &font )
{ {
if ( !wxWindow::SetFont( font ) ) if ( !wxWindow::SetFont( font ) )
return FALSE; return false;
if (m_mainWin) if (m_mainWin)
{ {
m_mainWin->SetFont( font ); m_mainWin->SetFont( font );
m_mainWin->m_dirty = TRUE; m_mainWin->m_dirty = true;
} }
if (m_headerWin) if (m_headerWin)
@@ -5245,7 +5245,7 @@ bool wxGenericListCtrl::SetFont( const wxFont &font )
Refresh(); Refresh();
return TRUE; return true;
} }
@@ -5291,7 +5291,7 @@ wxDropTarget *wxGenericListCtrl::GetDropTarget() const
bool wxGenericListCtrl::SetCursor( const wxCursor &cursor ) bool wxGenericListCtrl::SetCursor( const wxCursor &cursor )
{ {
return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : FALSE; return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : false;
} }
wxColour wxGenericListCtrl::GetBackgroundColour() const wxColour wxGenericListCtrl::GetBackgroundColour() const
@@ -5309,7 +5309,7 @@ bool wxGenericListCtrl::DoPopupMenu( wxMenu *menu, int x, int y )
#if wxUSE_MENUS #if wxUSE_MENUS
return m_mainWin->PopupMenu( menu, x, y ); return m_mainWin->PopupMenu( menu, x, y );
#else #else
return FALSE; return false;
#endif // wxUSE_MENUS #endif // wxUSE_MENUS
} }

View File

@@ -934,7 +934,7 @@ void wxLogDialog::CreateDetailsControls()
heightMax *= 9; heightMax *= 9;
heightMax /= 10; heightMax /= 10;
m_listctrl->SetSize(-1, wxMin(height, heightMax)); m_listctrl->SetSize(wxDefaultSize.x, wxMin(height, heightMax));
} }
void wxLogDialog::OnListSelect(wxListEvent& event) void wxLogDialog::OnListSelect(wxListEvent& event)
@@ -1070,7 +1070,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
SetSizeHints(size.x, size.y, m_maxWidth, m_maxHeight); SetSizeHints(size.x, size.y, m_maxWidth, m_maxHeight);
// don't change the width when expanding/collapsing // don't change the width when expanding/collapsing
SetSize(-1, size.y); SetSize(wxDefaultSize.x, size.y);
#ifdef __WXGTK__ #ifdef __WXGTK__
// VS: this is neccessary in order to force frame redraw under // VS: this is neccessary in order to force frame redraw under

View File

@@ -52,7 +52,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIParentFrame, wxFrame)
BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame) BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame)
#if wxUSE_MENUS #if wxUSE_MENUS
EVT_MENU (-1, wxGenericMDIParentFrame::DoHandleMenu) EVT_MENU (wxID_ANY, wxGenericMDIParentFrame::DoHandleMenu)
#endif #endif
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -123,7 +123,7 @@ bool wxGenericMDIParentFrame::Create(wxWindow *parent,
OnCreateClient(); OnCreateClient();
return TRUE; return true;
} }
#if wxUSE_MENUS #if wxUSE_MENUS
@@ -192,12 +192,12 @@ bool wxGenericMDIParentFrame::ProcessEvent(wxEvent& event)
// Stops the same event being processed repeatedly // Stops the same event being processed repeatedly
static wxEventType inEvent = wxEVT_NULL; static wxEventType inEvent = wxEVT_NULL;
if (inEvent == event.GetEventType()) if (inEvent == event.GetEventType())
return FALSE; return false;
inEvent = event.GetEventType(); inEvent = event.GetEventType();
// Let the active child (if any) process the event first. // Let the active child (if any) process the event first.
bool res = FALSE; bool res = false;
if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent)) if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent))
#if 0 #if 0
/* This is sure to not give problems... */ /* This is sure to not give problems... */
@@ -408,12 +408,12 @@ wxGenericMDIChildFrame::~wxGenericMDIChildFrame()
if (pParentFrame != NULL) if (pParentFrame != NULL)
{ {
bool bActive = FALSE; bool bActive = false;
if (pParentFrame->GetActiveChild() == this) if (pParentFrame->GetActiveChild() == this)
{ {
pParentFrame->SetActiveChild((wxGenericMDIChildFrame*) NULL); pParentFrame->SetActiveChild((wxGenericMDIChildFrame*) NULL);
pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL); pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL);
bActive = TRUE; bActive = true;
} }
wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow(); wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow();
@@ -468,11 +468,11 @@ bool wxGenericMDIChildFrame::Create( wxGenericMDIParentFrame *parent,
m_Title = title; m_Title = title;
pClientWindow->AddPage(this, title, TRUE); pClientWindow->AddPage(this, title, true);
ApplyMDIChildFrameRect(); // Ok confirme the size change! ApplyMDIChildFrameRect(); // Ok confirme the size change!
pClientWindow->Refresh(); pClientWindow->Refresh();
return TRUE; return true;
} }
#if wxUSE_MENUS #if wxUSE_MENUS
@@ -708,10 +708,10 @@ bool wxGenericMDIClientWindow::CreateClient( wxGenericMDIParentFrame *parent, lo
GetTabView()->SetTabSize(120, 18); GetTabView()->SetTabSize(120, 18);
GetTabView()->SetTabSelectionHeight(20); GetTabView()->SetTabSelectionHeight(20);
*/ */
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
int wxGenericMDIClientWindow::SetSelection(size_t nPage) int wxGenericMDIClientWindow::SetSelection(size_t nPage)
@@ -747,7 +747,7 @@ void wxGenericMDIClientWindow::PageChanged(int OldSelection, int newSelection)
wxGenericMDIChildFrame* oldChild = (wxGenericMDIChildFrame *)GetPage(OldSelection); wxGenericMDIChildFrame* oldChild = (wxGenericMDIChildFrame *)GetPage(OldSelection);
if (oldChild) if (oldChild)
{ {
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldChild->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId());
event.SetEventObject( oldChild ); event.SetEventObject( oldChild );
oldChild->GetEventHandler()->ProcessEvent(event); oldChild->GetEventHandler()->ProcessEvent(event);
} }
@@ -759,7 +759,7 @@ void wxGenericMDIClientWindow::PageChanged(int OldSelection, int newSelection)
wxGenericMDIChildFrame* activeChild = (wxGenericMDIChildFrame *)GetPage(newSelection); wxGenericMDIChildFrame* activeChild = (wxGenericMDIChildFrame *)GetPage(newSelection);
if (activeChild) if (activeChild)
{ {
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, activeChild->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId());
event.SetEventObject( activeChild ); event.SetEventObject( activeChild );
activeChild->GetEventHandler()->ProcessEvent(event); activeChild->GetEventHandler()->ProcessEvent(event);

View File

@@ -63,7 +63,7 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
const wxString& caption, const wxString& caption,
long style, long style,
const wxPoint& pos) const wxPoint& pos)
: wxDialog( parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE ) : wxDialog( parent, wxID_ANY, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
{ {
m_dialogStyle = style; m_dialogStyle = style;
@@ -99,7 +99,7 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
bitmap = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX); bitmap = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX);
break; break;
} }
wxStaticBitmap *icon = new wxStaticBitmap(this, -1, bitmap); wxStaticBitmap *icon = new wxStaticBitmap(this, wxID_ANY, bitmap);
if (is_pda) if (is_pda)
topsizer->Add( icon, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 ); topsizer->Add( icon, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 );
else else
@@ -112,13 +112,13 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
// 3) static line // 3) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
// 4) buttons // 4) buttons
topsizer->Add( CreateButtonSizer( style & (wxOK|wxCANCEL|wxYES_NO|wxYES_DEFAULT|wxNO_DEFAULT) ), topsizer->Add( CreateButtonSizer( style & (wxOK|wxCANCEL|wxYES_NO|wxYES_DEFAULT|wxNO_DEFAULT) ),
0, wxCENTRE | wxALL, 10 ); 0, wxCENTRE | wxALL, 10 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );

View File

@@ -54,7 +54,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
EVT_PAINT(wxNotebook::OnPaint) EVT_PAINT(wxNotebook::OnPaint)
EVT_MOUSE_EVENTS(wxNotebook::OnMouseEvent) EVT_MOUSE_EVENTS(wxNotebook::OnMouseEvent)
@@ -131,16 +131,16 @@ bool wxNotebook::Create(wxWindow *parent,
// base init // base init
SetName(name); SetName(name);
m_windowId = id == -1 ? NewControlId() : id; m_windowId = id == wxID_ANY ? NewControlId() : id;
if (!wxControl::Create(parent, id, pos, size, style|wxNO_BORDER, wxDefaultValidator, name)) if (!wxControl::Create(parent, id, pos, size, style|wxNO_BORDER, wxDefaultValidator, name))
return FALSE; return false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
SetTabView(new wxNotebookTabView(this)); SetTabView(new wxNotebookTabView(this));
return TRUE; return true;
} }
// dtor // dtor
@@ -191,10 +191,10 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
{ {
m_tabView->SetTabText((int) (long) page, strText); m_tabView->SetTabText((int) (long) page, strText);
Refresh(); Refresh();
return TRUE; return true;
} }
return FALSE; return false;
} }
wxString wxNotebook::GetPageText(size_t nPage) const wxString wxNotebook::GetPageText(size_t nPage) const
@@ -221,7 +221,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage)
wxASSERT( IS_VALID_PAGE(nPage) ); wxASSERT( IS_VALID_PAGE(nPage) );
// TODO // TODO
return FALSE; return false;
} }
// set the size (the same for all pages) // set the size (the same for all pages)
@@ -249,11 +249,11 @@ void wxNotebook::SetTabSize(const wxSize& sz)
// remove one page from the notebook and delete it // remove one page from the notebook and delete it
bool wxNotebook::DeletePage(size_t nPage) bool wxNotebook::DeletePage(size_t nPage)
{ {
wxCHECK( IS_VALID_PAGE(nPage), FALSE ); wxCHECK( IS_VALID_PAGE(nPage), false );
if (m_nSelection != -1) if (m_nSelection != -1)
{ {
m_pages[m_nSelection]->Show(FALSE); m_pages[m_nSelection]->Show(false);
m_pages[m_nSelection]->Lower(); m_pages[m_nSelection]->Lower();
} }
@@ -267,21 +267,21 @@ bool wxNotebook::DeletePage(size_t nPage)
if (m_pages.GetCount() == 0) if (m_pages.GetCount() == 0)
{ {
m_nSelection = -1; m_nSelection = -1;
m_tabView->SetTabSelection(-1, FALSE); m_tabView->SetTabSelection(-1, false);
} }
else if (m_nSelection > -1) else if (m_nSelection > -1)
{ {
m_nSelection = -1; m_nSelection = -1;
m_tabView->SetTabSelection((int) (long) GetPage(0), FALSE); m_tabView->SetTabSelection((int) (long) GetPage(0), false);
if (m_nSelection != 0) if (m_nSelection != 0)
ChangePage(-1, 0); ChangePage(-1, 0);
} }
RefreshLayout(FALSE); RefreshLayout(false);
return TRUE; return true;
} }
bool wxNotebook::DeletePage(wxNotebookPage* page) bool wxNotebook::DeletePage(wxNotebookPage* page)
@@ -290,7 +290,7 @@ bool wxNotebook::DeletePage(wxNotebookPage* page)
if (pagePos > -1) if (pagePos > -1)
return DeletePage(pagePos); return DeletePage(pagePos);
else else
return FALSE; return false;
} }
bool wxNotebook::RemovePage(size_t nPage) bool wxNotebook::RemovePage(size_t nPage)
@@ -301,9 +301,9 @@ bool wxNotebook::RemovePage(size_t nPage)
// remove one page from the notebook // remove one page from the notebook
wxWindow* wxNotebook::DoRemovePage(size_t nPage) wxWindow* wxNotebook::DoRemovePage(size_t nPage)
{ {
wxCHECK( IS_VALID_PAGE(nPage), FALSE ); wxCHECK( IS_VALID_PAGE(nPage), false );
m_pages[nPage]->Show(FALSE); m_pages[nPage]->Show(false);
// m_pages[nPage]->Lower(); // m_pages[nPage]->Lower();
wxNotebookPage* pPage = GetPage(nPage); wxNotebookPage* pPage = GetPage(nPage);
@@ -315,7 +315,7 @@ wxWindow* wxNotebook::DoRemovePage(size_t nPage)
if (m_pages.GetCount() == 0) if (m_pages.GetCount() == 0)
{ {
m_nSelection = -1; m_nSelection = -1;
m_tabView->SetTabSelection(-1, TRUE); m_tabView->SetTabSelection(-1, true);
} }
else if (m_nSelection > -1) else if (m_nSelection > -1)
{ {
@@ -325,7 +325,7 @@ wxWindow* wxNotebook::DoRemovePage(size_t nPage)
{ {
m_nSelection = -1; m_nSelection = -1;
// Select the first tab. Generates a ChangePage. // Select the first tab. Generates a ChangePage.
m_tabView->SetTabSelection(0, TRUE); m_tabView->SetTabSelection(0, true);
} }
else else
{ {
@@ -337,7 +337,7 @@ wxWindow* wxNotebook::DoRemovePage(size_t nPage)
} }
} }
RefreshLayout(FALSE); RefreshLayout(false);
return pPage; return pPage;
} }
@@ -348,7 +348,7 @@ bool wxNotebook::RemovePage(wxNotebookPage* page)
if (pagePos > -1) if (pagePos > -1)
return RemovePage(pagePos); return RemovePage(pagePos);
else else
return FALSE; return false;
} }
// Find the position of the wxNotebookPage, -1 if not found. // Find the position of the wxNotebookPage, -1 if not found.
@@ -365,7 +365,7 @@ int wxNotebook::FindPagePosition(wxNotebookPage* page) const
// remove all pages // remove all pages
bool wxNotebook::DeleteAllPages() bool wxNotebook::DeleteAllPages()
{ {
m_tabView->ClearTabs(TRUE); m_tabView->ClearTabs(true);
size_t nPageCount = GetPageCount(); size_t nPageCount = GetPageCount();
size_t nPage; size_t nPage;
@@ -374,7 +374,7 @@ bool wxNotebook::DeleteAllPages()
m_pages.Clear(); m_pages.Clear();
return TRUE; return true;
} }
// same as AddPage() but does it at given position // same as AddPage() but does it at given position
@@ -385,12 +385,12 @@ bool wxNotebook::InsertPage(size_t nPage,
int imageId) int imageId)
{ {
wxASSERT( pPage != NULL ); wxASSERT( pPage != NULL );
wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE ); wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), false );
m_tabView->AddTab((int) (long) pPage, strText); m_tabView->AddTab((int) (long) pPage, strText);
if (!bSelect) if (!bSelect)
pPage->Show(FALSE); pPage->Show(false);
// save the pointer to the page // save the pointer to the page
m_pages.Insert(pPage, nPage); m_pages.Insert(pPage, nPage);
@@ -399,7 +399,7 @@ bool wxNotebook::InsertPage(size_t nPage,
{ {
// This will cause ChangePage to be called, via OnSelPage // This will cause ChangePage to be called, via OnSelPage
m_tabView->SetTabSelection((int) (long) pPage, TRUE); m_tabView->SetTabSelection((int) (long) pPage, true);
} }
// some page must be selected: either this one or the first one if there is // some page must be selected: either this one or the first one if there is
@@ -407,9 +407,9 @@ bool wxNotebook::InsertPage(size_t nPage,
if ( m_nSelection == -1 ) if ( m_nSelection == -1 )
ChangePage(-1, 0); ChangePage(-1, 0);
RefreshLayout(FALSE); RefreshLayout(false);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -420,10 +420,10 @@ bool wxNotebook::InsertPage(size_t nPage,
// time because doing it in ::Create() doesn't work (for unknown reasons) // time because doing it in ::Create() doesn't work (for unknown reasons)
void wxNotebook::OnSize(wxSizeEvent& event) void wxNotebook::OnSize(wxSizeEvent& event)
{ {
static bool s_bFirstTime = TRUE; static bool s_bFirstTime = true;
if ( s_bFirstTime ) { if ( s_bFirstTime ) {
// TODO: any first-time-size processing. // TODO: any first-time-size processing.
s_bFirstTime = FALSE; s_bFirstTime = false;
} }
RefreshLayout(); RefreshLayout();
@@ -440,7 +440,7 @@ void wxNotebook::OnInternalIdle()
wxWindow::OnInternalIdle(); wxWindow::OnInternalIdle();
#if 0 #if 0
static bool s_bFirstTime = TRUE; static bool s_bFirstTime = true;
if ( s_bFirstTime ) { if ( s_bFirstTime ) {
/* /*
wxSize sz(GetSize()); wxSize sz(GetSize());
@@ -457,7 +457,7 @@ void wxNotebook::OnInternalIdle()
GetEventHandler()->ProcessEvent(sizeEvent); GetEventHandler()->ProcessEvent(sizeEvent);
Refresh(); Refresh();
*/ */
s_bFirstTime = FALSE; s_bFirstTime = false;
} }
#endif #endif
} }
@@ -498,7 +498,7 @@ bool wxNotebook::RefreshLayout(bool force)
m_tabView->LayoutTabs(); m_tabView->LayoutTabs();
if (!force && (rect == oldRect)) if (!force && (rect == oldRect))
return FALSE; return false;
// fit the notebook page to the tab control's display area // fit the notebook page to the tab control's display area
@@ -515,7 +515,7 @@ bool wxNotebook::RefreshLayout(bool force)
} }
Refresh(); Refresh();
} }
return TRUE; return true;
} }
void wxNotebook::OnSelChange(wxNotebookEvent& event) void wxNotebook::OnSelChange(wxNotebookEvent& event)
@@ -564,12 +564,12 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
void wxNotebook::SetConstraintSizes(bool /* recurse */) void wxNotebook::SetConstraintSizes(bool /* recurse */)
{ {
// don't set the sizes of the pages - their correct size is not yet known // don't set the sizes of the pages - their correct size is not yet known
wxControl::SetConstraintSizes(FALSE); wxControl::SetConstraintSizes(false);
} }
bool wxNotebook::DoPhase(int /* nPhase */) bool wxNotebook::DoPhase(int /* nPhase */)
{ {
return TRUE; return true;
} }
void wxNotebook::Command(wxCommandEvent& WXUNUSED(event)) void wxNotebook::Command(wxCommandEvent& WXUNUSED(event))
@@ -588,7 +588,7 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
wxASSERT( nOldSel != nSel ); // impossible wxASSERT( nOldSel != nSel ); // impossible
if ( nOldSel != -1 ) { if ( nOldSel != -1 ) {
m_pages[nOldSel]->Show(FALSE); m_pages[nOldSel]->Show(false);
m_pages[nOldSel]->Lower(); m_pages[nOldSel]->Lower();
} }
@@ -599,7 +599,7 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
Refresh(); Refresh();
pPage->Show(TRUE); pPage->Show(true);
pPage->Raise(); pPage->Raise();
pPage->SetFocus(); pPage->SetFocus();
@@ -680,7 +680,7 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
// Allows Vetoing // Allows Vetoing
bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId) bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
{ {
bool retval = TRUE; bool retval = true;
if (m_notebook) if (m_notebook)
{ {

View File

@@ -81,7 +81,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
long min, long min,
long max, long max,
const wxPoint& pos) const wxPoint& pos)
: wxDialog(parent, -1, caption, : wxDialog(parent, wxID_ANY, caption,
pos, wxDefaultSize) pos, wxDefaultSize)
{ {
m_value = value; m_value = value;
@@ -99,11 +99,11 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL );
// prompt if any // prompt if any
if (!prompt.IsEmpty()) if (!prompt.IsEmpty())
inputsizer->Add( new wxStaticText( this, -1, prompt ), 0, wxCENTER | wxLEFT, 10 ); inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 );
// spin ctrl // spin ctrl
wxString valStr; wxString valStr;
valStr.Printf(wxT("%ld"), m_value); valStr.Printf(wxT("%ld"), m_value);
m_spinctrl = new wxSpinCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) ); m_spinctrl = new wxSpinCtrl(this, wxID_ANY, valStr, wxDefaultPosition, wxSize( 140, wxDefaultSize.y ) );
#if wxUSE_SPINCTRL #if wxUSE_SPINCTRL
m_spinctrl->SetRange((int)m_min, (int)m_max); m_spinctrl->SetRange((int)m_min, (int)m_max);
#endif #endif
@@ -113,14 +113,14 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 3) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 4) buttons // 4) buttons
topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 ); topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 );
SetSizer( topsizer ); SetSizer( topsizer );
SetAutoLayout( TRUE ); SetAutoLayout( true );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );
topsizer->Fit( this ); topsizer->Fit( this );

View File

@@ -122,14 +122,14 @@ bool wxPalette::Create(int n,
e->blue = blue[i]; e->blue = blue[i];
} }
return TRUE; return true;
} }
int wxPalette::GetPixel( const unsigned char red, int wxPalette::GetPixel( const unsigned char red,
const unsigned char green, const unsigned char green,
const unsigned char blue ) const const unsigned char blue ) const
{ {
if (!m_refData) return FALSE; if (!m_refData) return false;
int closest = 0; int closest = 0;
double d,distance = 1000.0; // max. dist is 256 double d,distance = 1000.0; // max. dist is 256
@@ -152,14 +152,14 @@ bool wxPalette::GetRGB(int pixel,
unsigned char *green, unsigned char *green,
unsigned char *blue) const unsigned char *blue) const
{ {
if (!m_refData) return FALSE; if (!m_refData) return false;
if (pixel >= M_PALETTEDATA->m_count) return FALSE; if (pixel >= M_PALETTEDATA->m_count) return false;
wxPaletteEntry& p = M_PALETTEDATA->m_entries[pixel]; wxPaletteEntry& p = M_PALETTEDATA->m_entries[pixel];
if (red) *red = p.red; if (red) *red = p.red;
if (green) *green = p.green; if (green) *green = p.green;
if (blue) *blue = p.blue; if (blue) *blue = p.blue;
return TRUE; return true;
} }
#endif // wxUSE_PALETTE #endif // wxUSE_PALETTE

View File

@@ -77,16 +77,16 @@ wxPostScriptPrinter::~wxPostScriptPrinter()
bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
{ {
sm_abortIt = FALSE; sm_abortIt = false;
sm_abortWindow = (wxWindow *) NULL; sm_abortWindow = (wxWindow *) NULL;
if (!printout) if (!printout)
{ {
sm_lastError = wxPRINTER_ERROR; sm_lastError = wxPRINTER_ERROR;
return FALSE; return false;
} }
printout->SetIsPreview(FALSE); printout->SetIsPreview(false);
#if 0 #if 0
// 4/9/99, JACS: this is a silly place to allow preparation, considering // 4/9/99, JACS: this is a silly place to allow preparation, considering
@@ -103,7 +103,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
if (maxPage == 0) if (maxPage == 0)
{ {
sm_lastError = wxPRINTER_ERROR; sm_lastError = wxPRINTER_ERROR;
return FALSE; return false;
} }
m_printDialogData.SetMinPage(minPage); m_printDialogData.SetMinPage(minPage);
@@ -115,7 +115,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
if (minPage != 0) if (minPage != 0)
{ {
m_printDialogData.EnablePageNumbers(TRUE); m_printDialogData.EnablePageNumbers(true);
if (m_printDialogData.GetFromPage() < m_printDialogData.GetMinPage()) if (m_printDialogData.GetFromPage() < m_printDialogData.GetMinPage())
m_printDialogData.SetFromPage(m_printDialogData.GetMinPage()); m_printDialogData.SetFromPage(m_printDialogData.GetMinPage());
else if (m_printDialogData.GetFromPage() > m_printDialogData.GetMaxPage()) else if (m_printDialogData.GetFromPage() > m_printDialogData.GetMaxPage())
@@ -126,7 +126,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
m_printDialogData.SetToPage(m_printDialogData.GetMinPage()); m_printDialogData.SetToPage(m_printDialogData.GetMinPage());
} }
else else
m_printDialogData.EnablePageNumbers(FALSE); m_printDialogData.EnablePageNumbers(false);
#endif #endif
if (m_printDialogData.GetMinPage() < 1) if (m_printDialogData.GetMinPage() < 1)
@@ -140,7 +140,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
{ {
dc = PrintDialog(parent); dc = PrintDialog(parent);
if (!dc) if (!dc)
return FALSE; return false;
} }
else else
{ {
@@ -152,7 +152,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
{ {
if (dc) delete dc; if (dc) delete dc;
sm_lastError = wxPRINTER_ERROR; sm_lastError = wxPRINTER_ERROR;
return FALSE; return false;
} }
wxSize ScreenPixels = wxGetDisplaySize(); wxSize ScreenPixels = wxGetDisplaySize();
@@ -186,7 +186,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
{ {
sm_lastError = wxPRINTER_ERROR; sm_lastError = wxPRINTER_ERROR;
wxEndBusyCursor(); wxEndBusyCursor();
return FALSE; return false;
} }
// Only set min and max, because from and to have been // Only set min and max, because from and to have been
@@ -210,7 +210,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
sm_lastError = wxPRINTER_NO_ERROR; sm_lastError = wxPRINTER_NO_ERROR;
bool keepGoing = TRUE; bool keepGoing = true;
int copyCount; int copyCount;
for (copyCount = 1; copyCount <= m_printDialogData.GetNoCopies(); copyCount ++) for (copyCount = 1; copyCount <= m_printDialogData.GetNoCopies(); copyCount ++)
@@ -234,7 +234,7 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
{ {
if (sm_abortIt) if (sm_abortIt)
{ {
keepGoing = FALSE; keepGoing = false;
sm_lastError = wxPRINTER_CANCELLED; sm_lastError = wxPRINTER_CANCELLED;
break; break;
} }
@@ -250,9 +250,9 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
} }
else else
{ {
sm_abortIt = TRUE; sm_abortIt = true;
sm_lastError = wxPRINTER_CANCELLED; sm_lastError = wxPRINTER_CANCELLED;
keepGoing = FALSE; keepGoing = false;
} }
} }
wxYield(); wxYield();
@@ -295,7 +295,7 @@ wxDC* wxPostScriptPrinter::PrintDialog(wxWindow *parent)
bool wxPostScriptPrinter::Setup(wxWindow *parent) bool wxPostScriptPrinter::Setup(wxWindow *parent)
{ {
wxGenericPrintDialog* dialog = new wxGenericPrintDialog(parent, & m_printDialogData); wxGenericPrintDialog* dialog = new wxGenericPrintDialog(parent, & m_printDialogData);
dialog->GetPrintDialogData().SetSetupDialog(TRUE); dialog->GetPrintDialogData().SetSetupDialog(true);
int ret = dialog->ShowModal(); int ret = dialog->ShowModal();
@@ -343,7 +343,7 @@ wxPostScriptPrintPreview::~wxPostScriptPrintPreview()
bool wxPostScriptPrintPreview::Print(bool interactive) bool wxPostScriptPrintPreview::Print(bool interactive)
{ {
if (!m_printPrintout) if (!m_printPrintout)
return FALSE; return false;
wxPostScriptPrinter printer(& m_printDialogData); wxPostScriptPrinter printer(& m_printDialogData);
return printer.Print(m_previewFrame, m_printPrintout, interactive); return printer.Print(m_previewFrame, m_printPrintout, interactive);
} }

View File

@@ -104,7 +104,7 @@ extern wxPrintPaperDatabase *wxThePrintPaperDatabase;
wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
wxPrintDialogData* data) wxPrintDialogData* data)
: wxDialog(parent, -1, _("Print"), : wxDialog(parent, wxID_ANY, _("Print"),
wxPoint(0, 0), wxSize(600, 600), wxPoint(0, 0), wxSize(600, 600),
wxDEFAULT_DIALOG_STYLE | wxDEFAULT_DIALOG_STYLE |
wxTAB_TRAVERSAL) wxTAB_TRAVERSAL)
@@ -117,7 +117,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
wxPrintData* data) wxPrintData* data)
: wxDialog(parent, -1, _("Print"), : wxDialog(parent, wxID_ANY, _("Print"),
wxPoint(0, 0), wxSize(600, 600), wxPoint(0, 0), wxSize(600, 600),
wxDEFAULT_DIALOG_STYLE | wxDEFAULT_DIALOG_STYLE |
wxTAB_TRAVERSAL) wxTAB_TRAVERSAL)
@@ -130,7 +130,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent,
void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent)) void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
{ {
// wxDialog::Create(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), // wxDialog::Create(parent, wxID_ANY, _("Print"), wxPoint(0, 0), wxSize(600, 600),
// wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL); // wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL);
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
@@ -138,7 +138,7 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
// 1) top row // 1) top row
wxStaticBoxSizer *topsizer = new wxStaticBoxSizer( wxStaticBoxSizer *topsizer = new wxStaticBoxSizer(
new wxStaticBox( this, -1, _( "Printer options" ) ), wxHORIZONTAL ); new wxStaticBox( this, wxID_ANY, _( "Printer options" ) ), wxHORIZONTAL );
m_printToFileCheckBox = new wxCheckBox( this, wxPRINTID_PRINTTOFILE, _("Print to File") ); m_printToFileCheckBox = new wxCheckBox( this, wxPRINTID_PRINTTOFILE, _("Print to File") );
topsizer->Add( m_printToFileCheckBox, 0, wxCENTER|wxALL, 5 ); topsizer->Add( m_printToFileCheckBox, 0, wxCENTER|wxALL, 5 );
@@ -177,30 +177,30 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
if (m_printDialogData.GetFromPage() != 0) if (m_printDialogData.GetFromPage() != 0)
{ {
bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("From:") ), 0, wxCENTER|wxALL, 5 ); bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("From:") ), 0, wxCENTER|wxALL, 5 );
m_fromText = new wxTextCtrl(this, wxPRINTID_FROM, wxT(""), wxDefaultPosition, wxSize(40, -1)); m_fromText = new wxTextCtrl(this, wxPRINTID_FROM, wxEmptyString, wxDefaultPosition, wxSize(40, wxDefaultSize.y));
bottomsizer->Add( m_fromText, 1, wxCENTER|wxRIGHT, 10 ); bottomsizer->Add( m_fromText, 1, wxCENTER|wxRIGHT, 10 );
bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("To:") ), 0, wxCENTER|wxALL, 5); bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("To:") ), 0, wxCENTER|wxALL, 5);
m_toText = new wxTextCtrl(this, wxPRINTID_TO, wxT(""), wxDefaultPosition, wxSize(40, -1)); m_toText = new wxTextCtrl(this, wxPRINTID_TO, wxEmptyString, wxDefaultPosition, wxSize(40, wxDefaultSize.y));
bottomsizer->Add( m_toText, 1, wxCENTER|wxRIGHT, 10 ); bottomsizer->Add( m_toText, 1, wxCENTER|wxRIGHT, 10 );
} }
bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Copies:") ), 0, wxCENTER|wxALL, 5 ); bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Copies:") ), 0, wxCENTER|wxALL, 5 );
m_noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, wxT(""), wxPoint(252, 130), wxSize(40, -1)); m_noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, wxEmptyString, wxPoint(252, 130), wxSize(40, wxDefaultSize.y));
bottomsizer->Add( m_noCopiesText, 1, wxCENTER|wxRIGHT, 10 ); bottomsizer->Add( m_noCopiesText, 1, wxCENTER|wxRIGHT, 10 );
mainsizer->Add( bottomsizer, 0, wxTOP|wxLEFT|wxRIGHT, 12 ); mainsizer->Add( bottomsizer, 0, wxTOP|wxLEFT|wxRIGHT, 12 );
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 4) static line // 4) static line
mainsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); mainsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 5) buttons // 5) buttons
mainsizer->Add( CreateButtonSizer( wxOK|wxCANCEL), 0, wxCENTER|wxALL, 10 ); mainsizer->Add( CreateButtonSizer( wxOK|wxCANCEL), 0, wxCENTER|wxALL, 10 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( mainsizer ); SetSizer( mainsizer );
mainsizer->Fit( this ); mainsizer->Fit( this );
@@ -285,13 +285,13 @@ void wxGenericPrintDialog::OnRange(wxCommandEvent& event)
if (event.GetInt() == 0) if (event.GetInt() == 0)
{ {
m_fromText->Enable(FALSE); m_fromText->Enable(false);
m_toText->Enable(FALSE); m_toText->Enable(false);
} }
else if (event.GetInt() == 1) else if (event.GetInt() == 1)
{ {
m_fromText->Enable(TRUE); m_fromText->Enable(true);
m_toText->Enable(TRUE); m_toText->Enable(true);
} }
} }
@@ -312,8 +312,8 @@ bool wxGenericPrintDialog::TransferDataToWindow()
{ {
if (m_printDialogData.GetEnablePageNumbers()) if (m_printDialogData.GetEnablePageNumbers())
{ {
m_fromText->Enable(TRUE); m_fromText->Enable(true);
m_toText->Enable(TRUE); m_toText->Enable(true);
if (m_printDialogData.GetFromPage() > 0) if (m_printDialogData.GetFromPage() > 0)
m_fromText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetFromPage())); m_fromText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetFromPage()));
if (m_printDialogData.GetToPage() > 0) if (m_printDialogData.GetToPage() > 0)
@@ -326,12 +326,12 @@ bool wxGenericPrintDialog::TransferDataToWindow()
} }
else else
{ {
m_fromText->Enable(FALSE); m_fromText->Enable(false);
m_toText->Enable(FALSE); m_toText->Enable(false);
if(m_rangeRadioBox) if(m_rangeRadioBox)
{ {
m_rangeRadioBox->SetSelection(0); m_rangeRadioBox->SetSelection(0);
m_rangeRadioBox->wxRadioBox::Enable(1, FALSE); m_rangeRadioBox->wxRadioBox::Enable(1, false);
} }
} }
} }
@@ -341,7 +341,7 @@ bool wxGenericPrintDialog::TransferDataToWindow()
m_printToFileCheckBox->SetValue(m_printDialogData.GetPrintToFile()); m_printToFileCheckBox->SetValue(m_printDialogData.GetPrintToFile());
m_printToFileCheckBox->Enable(m_printDialogData.GetEnablePrintToFile()); m_printToFileCheckBox->Enable(m_printDialogData.GetEnablePrintToFile());
return TRUE; return true;
} }
bool wxGenericPrintDialog::TransferDataFromWindow() bool wxGenericPrintDialog::TransferDataFromWindow()
@@ -367,9 +367,9 @@ bool wxGenericPrintDialog::TransferDataFromWindow()
if(m_rangeRadioBox) if(m_rangeRadioBox)
{ {
if (m_rangeRadioBox->GetSelection() == 0) if (m_rangeRadioBox->GetSelection() == 0)
m_printDialogData.SetAllPages(TRUE); m_printDialogData.SetAllPages(true);
else else
m_printDialogData.SetAllPages(FALSE); m_printDialogData.SetAllPages(false);
} }
} }
else else
@@ -384,7 +384,7 @@ bool wxGenericPrintDialog::TransferDataFromWindow()
m_printDialogData.SetPrintToFile(m_printToFileCheckBox->GetValue()); m_printDialogData.SetPrintToFile(m_printToFileCheckBox->GetValue());
return TRUE; return true;
} }
/* /*
@@ -394,7 +394,7 @@ TODO: collate and noCopies should be duplicated across dialog data and print dat
wxDC *wxGenericPrintDialog::GetPrintDC() wxDC *wxGenericPrintDialog::GetPrintDC()
{ {
// return new wxPostScriptDC(wxThePrintSetupData->GetPrinterFile(), FALSE, (wxWindow *) NULL); // return new wxPostScriptDC(wxThePrintSetupData->GetPrinterFile(), false, (wxWindow *) NULL);
return new wxPostScriptDC(GetPrintDialogData().GetPrintData()); return new wxPostScriptDC(GetPrintDialogData().GetPrintData());
} }
@@ -403,7 +403,7 @@ wxDC *wxGenericPrintDialog::GetPrintDC()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data): wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data):
wxDialog(parent, -1, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL) wxDialog(parent, wxID_ANY, _("Print Setup"), wxPoint(0, 0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL)
{ {
Init(data); Init(data);
} }
@@ -426,7 +426,7 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
choices[1] = _("Landscape"); choices[1] = _("Landscape");
m_orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"), m_orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"),
wxPoint(10, 80), wxSize(-1, -1), 2, choices, 1, wxRA_VERTICAL ); wxPoint(10, 80), wxDefaultSize, 2, choices, 1, wxRA_VERTICAL );
m_orientationRadioBox->SetSelection(0); m_orientationRadioBox->SetSelection(0);
(void) new wxStaticBox(this, wxPRINTID_STATIC, _("Options"), wxPoint(10, 130), wxSize(staticBoxWidth, 50) ); (void) new wxStaticBox(this, wxPRINTID_STATIC, _("Options"), wxPoint(10, 130), wxSize(staticBoxWidth, 50) );
@@ -443,14 +443,14 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Printer command:"), wxPoint(340, 30)); (void) new wxStaticText(this, wxPRINTID_STATIC, _("Printer command:"), wxPoint(340, 30));
m_printerCommandText = new wxTextCtrl(this, wxPRINTID_COMMAND, wxT(""), wxPoint(360, 55), wxSize(150, -1)); m_printerCommandText = new wxTextCtrl(this, wxPRINTID_COMMAND, wxEmptyString, wxPoint(360, 55), wxSize(150, wxDefaultSize.y));
(void) new wxStaticText(this, wxPRINTID_STATIC, _("Printer options:"), wxPoint(340, 110)); (void) new wxStaticText(this, wxPRINTID_STATIC, _("Printer options:"), wxPoint(340, 110));
m_printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, wxT(""), wxPoint(360, 135), wxSize(150, -1)); m_printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, wxEmptyString, wxPoint(360, 135), wxSize(150, wxDefaultSize.y));
wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(130, 200), wxSize(80, -1)); wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(130, 200), wxSize(80, wxDefaultSize.y));
(void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(320, 200), wxSize(80, -1)); (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(320, 200), wxSize(80, wxDefaultSize.y));
okButton->SetDefault(); okButton->SetDefault();
okButton->SetFocus(); okButton->SetFocus();
@@ -482,7 +482,7 @@ bool wxGenericPrintSetupDialog::TransferDataToWindow()
else else
m_orientationRadioBox->SetSelection(1); m_orientationRadioBox->SetSelection(1);
} }
return TRUE; return true;
} }
bool wxGenericPrintSetupDialog::TransferDataFromWindow() bool wxGenericPrintSetupDialog::TransferDataFromWindow()
@@ -512,7 +512,7 @@ bool wxGenericPrintSetupDialog::TransferDataFromWindow()
} }
} }
return TRUE; return true;
} }
wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y) wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
@@ -542,7 +542,7 @@ wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice(int *x, int *y)
wxPRINTID_PAPERSIZE, wxPRINTID_PAPERSIZE,
_("Paper Size"), _("Paper Size"),
wxPoint(*x, *y), wxPoint(*x, *y),
wxSize(width, -1), wxSize(width, wxDefaultSize.y),
n, choices ); n, choices );
// SetFont(thisFont); // SetFont(thisFont);
@@ -574,7 +574,7 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
// Transfer the current print settings from this dialog to the page setup dialog. // Transfer the current print settings from this dialog to the page setup dialog.
wxPrintDialogData data; wxPrintDialogData data;
data = GetPageSetupData().GetPrintData(); data = GetPageSetupData().GetPrintData();
data.SetSetupDialog(TRUE); data.SetSetupDialog(true);
wxPrintDialog *printDialog = new wxPrintDialog(this, & data); wxPrintDialog *printDialog = new wxPrintDialog(this, & data);
printDialog->ShowModal(); printDialog->ShowModal();
@@ -592,7 +592,7 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent, wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
wxPageSetupData* data) wxPageSetupData* data)
: wxDialog( parent, : wxDialog( parent,
-1, wxID_ANY,
_("Page Setup"), _("Page Setup"),
wxPoint(0, 0), wxPoint(0, 0),
wxSize(600, 600), wxSize(600, 600),
@@ -622,7 +622,7 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
wxPRINTID_PAPERSIZE, wxPRINTID_PAPERSIZE,
_("Paper Size"), _("Paper Size"),
wxDefaultPosition, wxDefaultPosition,
wxSize(300, -1), wxSize(300, wxDefaultSize.y),
n, choices ); n, choices );
topsizer->Add( m_paperTypeChoice, 1, wxEXPAND|wxALL, 5 ); topsizer->Add( m_paperTypeChoice, 1, wxEXPAND|wxALL, 5 );
// m_paperTypeChoice->SetSelection(sel); // m_paperTypeChoice->SetSelection(sel);
@@ -650,8 +650,8 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
table->Add( column1, 0, wxALL | wxEXPAND, 5 ); table->Add( column1, 0, wxALL | wxEXPAND, 5 );
wxBoxSizer *column2 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *column2 = new wxBoxSizer( wxVERTICAL );
m_marginLeftText = new wxTextCtrl(this, wxPRINTID_LEFTMARGIN, wxT(""), wxDefaultPosition, wxSize(textWidth, -1)); m_marginLeftText = new wxTextCtrl(this, wxPRINTID_LEFTMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultSize.y));
m_marginTopText = new wxTextCtrl(this, wxPRINTID_TOPMARGIN, wxT(""), wxDefaultPosition, wxSize(textWidth, -1)); m_marginTopText = new wxTextCtrl(this, wxPRINTID_TOPMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultSize.y));
column2->Add( m_marginLeftText, 1, wxALL, 5 ); column2->Add( m_marginLeftText, 1, wxALL, 5 );
column2->Add( m_marginTopText, 1, wxALL, 5 ); column2->Add( m_marginTopText, 1, wxALL, 5 );
table->Add( column2, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, 5 ); table->Add( column2, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, 5 );
@@ -662,8 +662,8 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
table->Add( column3, 0, wxALL | wxEXPAND, 5 ); table->Add( column3, 0, wxALL | wxEXPAND, 5 );
wxBoxSizer *column4 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *column4 = new wxBoxSizer( wxVERTICAL );
m_marginRightText = new wxTextCtrl(this, wxPRINTID_RIGHTMARGIN, wxT(""), wxDefaultPosition, wxSize(textWidth, -1)); m_marginRightText = new wxTextCtrl(this, wxPRINTID_RIGHTMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultSize.y));
m_marginBottomText = new wxTextCtrl(this, wxPRINTID_BOTTOMMARGIN, wxT(""), wxDefaultPosition, wxSize(textWidth, -1)); m_marginBottomText = new wxTextCtrl(this, wxPRINTID_BOTTOMMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultSize.y));
column4->Add( m_marginRightText, 1, wxALL, 5 ); column4->Add( m_marginRightText, 1, wxALL, 5 );
column4->Add( m_marginBottomText, 1, wxALL, 5 ); column4->Add( m_marginBottomText, 1, wxALL, 5 );
table->Add( column4, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, 5 ); table->Add( column4, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, 5 );
@@ -672,7 +672,7 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 5) static line // 5) static line
mainsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); mainsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 6) buttons // 6) buttons
@@ -681,13 +681,13 @@ wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent,
m_printerButton = new wxButton(this, wxPRINTID_SETUP, _("Printer...") ); m_printerButton = new wxButton(this, wxPRINTID_SETUP, _("Printer...") );
buttonsizer->Add( m_printerButton, 0, wxLEFT|wxRIGHT, 10 ); buttonsizer->Add( m_printerButton, 0, wxLEFT|wxRIGHT, 10 );
if ( !m_pageData.GetEnablePrinter() ) if ( !m_pageData.GetEnablePrinter() )
m_printerButton->Enable(FALSE); m_printerButton->Enable(false);
// if (m_printData.GetEnableHelp()) // if (m_printData.GetEnableHelp())
// wxButton *helpButton = new wxButton(this, (wxFunction)wxGenericPageSetupHelpProc, _("Help"), -1, -1, buttonWidth, buttonHeight); // wxButton *helpButton = new wxButton(this, (wxFunction)wxGenericPageSetupHelpProc, _("Help"), wxDefaultPosition.x, wxDefaultPosition.y, buttonWidth, buttonHeight);
mainsizer->Add( buttonsizer, 0, wxCENTER|wxALL, 10 ); mainsizer->Add( buttonsizer, 0, wxCENTER|wxALL, 10 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( mainsizer ); SetSizer( mainsizer );
mainsizer->Fit( this ); mainsizer->Fit( this );
@@ -736,7 +736,7 @@ bool wxGenericPageSetupDialog::TransferDataToWindow()
m_paperTypeChoice->SetStringSelection(type->GetName()); m_paperTypeChoice->SetStringSelection(type->GetName());
} }
return TRUE; return true;
} }
bool wxGenericPageSetupDialog::TransferDataFromWindow() bool wxGenericPageSetupDialog::TransferDataFromWindow()
@@ -781,7 +781,7 @@ bool wxGenericPageSetupDialog::TransferDataFromWindow()
} }
} }
return TRUE; return true;
} }
wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y) wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y)
@@ -810,7 +810,7 @@ wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y)
wxPRINTID_PAPERSIZE, wxPRINTID_PAPERSIZE,
_("Paper Size"), _("Paper Size"),
wxPoint(*x, *y), wxPoint(*x, *y),
wxSize(300, -1), wxSize(300, wxDefaultSize.y),
n, choices ); n, choices );
*y += 35; *y += 35;
delete[] choices; delete[] choices;

View File

@@ -651,8 +651,7 @@ XClipBox(
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
void REGION:: void REGION::
miSetExtents ( miSetExtents (Region pReg)
Region pReg)
{ {
register BoxPtr pBox, register BoxPtr pBox,
pBoxEnd, pBoxEnd,
@@ -862,7 +861,8 @@ miRegionCopy(
if (! (dstrgn->rects = (BOX *) if (! (dstrgn->rects = (BOX *)
realloc((char *) dstrgn->rects, realloc((char *) dstrgn->rects,
(unsigned) rgn->numRects * (sizeof(BOX))))) { (unsigned) rgn->numRects * (sizeof(BOX)))))
{
free(prevRects); free(prevRects);
return; return;
} }
@@ -953,7 +953,8 @@ miCoalesce(
pRegEnd = pReg->rects + pReg->numRects; pRegEnd = pReg->rects + pReg->numRects;
} }
if ((curNumRects == prevNumRects) && (curNumRects != 0)) { if ((curNumRects == prevNumRects) && (curNumRects != 0))
{
pCurBox -= curNumRects; pCurBox -= curNumRects;
/* /*
* The bands may only be coalesced if the bottom of the previous * The bands may only be coalesced if the bottom of the previous
@@ -1875,10 +1876,10 @@ XRectInRegion(
if ((region->numRects == 0) || !EXTENTCHECK(&region->extents, prect)) if ((region->numRects == 0) || !EXTENTCHECK(&region->extents, prect))
return(wxOutRegion); return(wxOutRegion);
partOut = FALSE; partOut = false;
partIn = FALSE; partIn = false;
/* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ /* can stop when both partOut and partIn are true, or we reach prect->y2 */
for (pbox = region->rects, pboxEnd = pbox + region->numRects; for (pbox = region->rects, pboxEnd = pbox + region->numRects;
pbox < pboxEnd; pbox < pboxEnd;
pbox++) pbox++)
@@ -1889,7 +1890,7 @@ XRectInRegion(
if (pbox->y1 > ry) if (pbox->y1 > ry)
{ {
partOut = TRUE; /* missed part of rectangle above */ partOut = true; /* missed part of rectangle above */
if (partIn || (pbox->y1 >= prect->y2)) if (partIn || (pbox->y1 >= prect->y2))
break; break;
ry = pbox->y1; /* x guaranteed to be == prect->x1 */ ry = pbox->y1; /* x guaranteed to be == prect->x1 */
@@ -1900,14 +1901,14 @@ XRectInRegion(
if (pbox->x1 > rx) if (pbox->x1 > rx)
{ {
partOut = TRUE; /* missed part of rectangle to left */ partOut = true; /* missed part of rectangle to left */
if (partIn) if (partIn)
break; break;
} }
if (pbox->x1 < prect->x2) if (pbox->x1 < prect->x2)
{ {
partIn = TRUE; /* definitely overlap */ partIn = true; /* definitely overlap */
if (partOut) if (partOut)
break; break;
} }

View File

@@ -80,7 +80,7 @@ void wxSashWindow::Init()
m_maximumPaneSizeY = 10000; m_maximumPaneSizeY = 10000;
m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE); m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS); m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
m_mouseCaptured = FALSE; m_mouseCaptured = false;
m_currentCursor = NULL; m_currentCursor = NULL;
// Eventually, we'll respond to colour change messages // Eventually, we'll respond to colour change messages
@@ -105,7 +105,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
if (event.LeftDown()) if (event.LeftDown())
{ {
CaptureMouse(); CaptureMouse();
m_mouseCaptured = TRUE; m_mouseCaptured = true;
if ( sashHit != wxSASH_NONE ) if ( sashHit != wxSASH_NONE )
{ {
@@ -154,7 +154,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
// Wasn't a proper drag // Wasn't a proper drag
if (m_mouseCaptured) if (m_mouseCaptured)
ReleaseMouse(); ReleaseMouse();
m_mouseCaptured = FALSE; m_mouseCaptured = false;
wxScreenDC::EndDrawingOnTop(); wxScreenDC::EndDrawingOnTop();
m_dragMode = wxSASH_DRAG_NONE; m_dragMode = wxSASH_DRAG_NONE;
@@ -166,7 +166,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
m_dragMode = wxSASH_DRAG_NONE; m_dragMode = wxSASH_DRAG_NONE;
if (m_mouseCaptured) if (m_mouseCaptured)
ReleaseMouse(); ReleaseMouse();
m_mouseCaptured = FALSE; m_mouseCaptured = false;
// Erase old tracker // Erase old tracker
DrawSashTracker(m_draggingEdge, m_oldX, m_oldY); DrawSashTracker(m_draggingEdge, m_oldX, m_oldY);
@@ -187,8 +187,8 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
wxSashDragStatus status = wxSASH_STATUS_OK; wxSashDragStatus status = wxSASH_STATUS_OK;
// the new height and width of the window - if -1, it didn't change // the new height and width of the window - if -1, it didn't change
int newHeight = -1, int newHeight = wxDefaultSize.y,
newWidth = -1; newWidth = wxDefaultSize.x;
// NB: x and y may be negative and they're relative to the sash window // NB: x and y may be negative and they're relative to the sash window
// upper left corner, while xp and yp are expressed in the parent // upper left corner, while xp and yp are expressed in the parent
@@ -253,7 +253,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
break; break;
} }
if ( newHeight == -1 ) if ( newHeight == wxDefaultSize.y )
{ {
// didn't change // didn't change
newHeight = h; newHeight = h;
@@ -265,7 +265,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
newHeight = wxMin(newHeight, m_maximumPaneSizeY); newHeight = wxMin(newHeight, m_maximumPaneSizeY);
} }
if ( newWidth == -1 ) if ( newWidth == wxDefaultSize.x )
{ {
// didn't change // didn't change
newWidth = w; newWidth = w;
@@ -289,7 +289,7 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
{ {
if (m_mouseCaptured) if (m_mouseCaptured)
ReleaseMouse(); ReleaseMouse();
m_mouseCaptured = FALSE; m_mouseCaptured = false;
} }
else if (event.Moving() && !event.Dragging()) else if (event.Moving() && !event.Dragging())
{ {

View File

@@ -84,7 +84,7 @@ public:
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
void ResetDrawnFlag() { m_hasDrawnWindow = FALSE; } void ResetDrawnFlag() { m_hasDrawnWindow = false; }
private: private:
wxScrollHelper *m_scrollHelper; wxScrollHelper *m_scrollHelper;
@@ -205,7 +205,7 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
// anything in the window. We set it to true here but reset it to false in // anything in the window. We set it to true here but reset it to false in
// wxScrolledWindow::OnPaint() handler (which wouldn't be called if the // wxScrolledWindow::OnPaint() handler (which wouldn't be called if the
// user code defined OnPaint() in the derived class) // user code defined OnPaint() in the derived class)
m_hasDrawnWindow = TRUE; m_hasDrawnWindow = true;
// pass it on to the real handler // pass it on to the real handler
bool processed = wxEvtHandler::ProcessEvent(event); bool processed = wxEvtHandler::ProcessEvent(event);
@@ -221,7 +221,7 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
{ {
m_scrollHelper->HandleOnSize((wxSizeEvent &)event); m_scrollHelper->HandleOnSize((wxSizeEvent &)event);
return TRUE; return true;
} }
if ( processed ) if ( processed )
@@ -231,18 +231,18 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
// OnDraw() below (from HandleOnPaint) // OnDraw() below (from HandleOnPaint)
if ( m_hasDrawnWindow ) if ( m_hasDrawnWindow )
{ {
return TRUE; return true;
} }
} }
// reset the skipped flag to FALSE as it might have been set to TRUE in // reset the skipped flag to false as it might have been set to true in
// ProcessEvent() above // ProcessEvent() above
event.Skip(FALSE); event.Skip(false);
if ( evType == wxEVT_PAINT ) if ( evType == wxEVT_PAINT )
{ {
m_scrollHelper->HandleOnPaint((wxPaintEvent &)event); m_scrollHelper->HandleOnPaint((wxPaintEvent &)event);
return TRUE; return true;
} }
if ( evType == wxEVT_SCROLLWIN_TOP || if ( evType == wxEVT_SCROLLWIN_TOP ||
@@ -278,7 +278,7 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
return !event.GetSkipped(); return !event.GetSkipped();
} }
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -297,7 +297,7 @@ wxScrollHelper::wxScrollHelper(wxWindow *win)
m_yScrollLinesPerPage = 0; m_yScrollLinesPerPage = 0;
m_xScrollingEnabled = m_xScrollingEnabled =
m_yScrollingEnabled = TRUE; m_yScrollingEnabled = true;
m_scaleX = m_scaleX =
m_scaleY = 1.0; m_scaleY = 1.0;
@@ -368,7 +368,7 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
m_targetWindow->SetVirtualSize( w, h ); m_targetWindow->SetVirtualSize( w, h );
if (do_refresh && !noRefresh) if (do_refresh && !noRefresh)
m_targetWindow->Refresh(TRUE, GetScrollRect()); m_targetWindow->Refresh(true, GetScrollRect());
#ifndef __WXUNIVERSAL__ #ifndef __WXUNIVERSAL__
// If the target is not the same as the window with the scrollbars, // If the target is not the same as the window with the scrollbars,
@@ -476,7 +476,7 @@ void wxScrollHelper::HandleOnScroll(wxScrollWinEvent& event)
m_win->SetScrollPos(wxVERTICAL, m_yScrollPosition); m_win->SetScrollPos(wxVERTICAL, m_yScrollPosition);
} }
bool needsRefresh = FALSE; bool needsRefresh = false;
int dx = 0, int dx = 0,
dy = 0; dy = 0;
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
@@ -487,7 +487,7 @@ void wxScrollHelper::HandleOnScroll(wxScrollWinEvent& event)
} }
else else
{ {
needsRefresh = TRUE; needsRefresh = true;
} }
} }
else else
@@ -498,13 +498,13 @@ void wxScrollHelper::HandleOnScroll(wxScrollWinEvent& event)
} }
else else
{ {
needsRefresh = TRUE; needsRefresh = true;
} }
} }
if ( needsRefresh ) if ( needsRefresh )
{ {
m_targetWindow->Refresh(TRUE, GetScrollRect()); m_targetWindow->Refresh(true, GetScrollRect());
} }
else else
{ {
@@ -581,7 +581,7 @@ int wxScrollHelper::CalcScrollInc(wxScrollWinEvent& event)
nScrollInc = noPositions - m_xScrollPosition; // As +ve as we can go nScrollInc = noPositions - m_xScrollPosition; // As +ve as we can go
} }
else else
m_targetWindow->Refresh(TRUE, GetScrollRect()); m_targetWindow->Refresh(true, GetScrollRect());
} }
else else
{ {
@@ -605,7 +605,7 @@ int wxScrollHelper::CalcScrollInc(wxScrollWinEvent& event)
else else
{ {
// VZ: why do we do this? (FIXME) // VZ: why do we do this? (FIXME)
m_targetWindow->Refresh(TRUE, GetScrollRect()); m_targetWindow->Refresh(true, GetScrollRect());
} }
} }
@@ -648,7 +648,7 @@ void wxScrollHelper::AdjustScrollbars()
{ {
m_xScrollLines = 0; m_xScrollLines = 0;
m_xScrollPosition = 0; m_xScrollPosition = 0;
m_win->SetScrollbar (wxHORIZONTAL, 0, 0, 0, FALSE); m_win->SetScrollbar (wxHORIZONTAL, 0, 0, 0, false);
} }
else else
{ {
@@ -766,7 +766,7 @@ void wxScrollHelper::AdjustScrollbars()
m_targetWindow->ScrollWindow( m_xScrollPixelsPerLine * (oldXScroll - m_xScrollPosition), 0, m_targetWindow->ScrollWindow( m_xScrollPixelsPerLine * (oldXScroll - m_xScrollPosition), 0,
GetScrollRect() ); GetScrollRect() );
else else
m_targetWindow->Refresh(TRUE, GetScrollRect()); m_targetWindow->Refresh(true, GetScrollRect());
} }
if (oldYScroll != m_yScrollPosition) if (oldYScroll != m_yScrollPosition)
@@ -775,7 +775,7 @@ void wxScrollHelper::AdjustScrollbars()
m_targetWindow->ScrollWindow( 0, m_yScrollPixelsPerLine * (oldYScroll-m_yScrollPosition), m_targetWindow->ScrollWindow( 0, m_yScrollPixelsPerLine * (oldYScroll-m_yScrollPosition),
GetScrollRect() ); GetScrollRect() );
else else
m_targetWindow->Refresh(TRUE, GetScrollRect()); m_targetWindow->Refresh(true, GetScrollRect());
} }
} }
@@ -1231,7 +1231,7 @@ bool wxGenericScrolledWindow::Layout()
CalcScrolledPosition(0,0, &x,&y); CalcScrolledPosition(0,0, &x,&y);
GetVirtualSize(&w, &h); GetVirtualSize(&w, &h);
GetSizer()->SetDimension(x, y, w, h); GetSizer()->SetDimension(x, y, w, h);
return TRUE; return true;
} }
// fall back to default for LayoutConstraints // fall back to default for LayoutConstraints

View File

@@ -60,7 +60,7 @@ bool wxSelectionStore::SelectItem(size_t item, bool select)
{ {
m_itemsSel.AddAt(item, index); m_itemsSel.AddAt(item, index);
return TRUE; return true;
} }
} }
else // reset to default state else // reset to default state
@@ -68,11 +68,11 @@ bool wxSelectionStore::SelectItem(size_t item, bool select)
if ( isSel ) if ( isSel )
{ {
m_itemsSel.RemoveAt(index); m_itemsSel.RemoveAt(index);
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
bool wxSelectionStore::SelectRange(size_t itemFrom, size_t itemTo, bool wxSelectionStore::SelectRange(size_t itemFrom, size_t itemTo,

View File

@@ -54,7 +54,7 @@ wxSplashScreen::wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int mil
m_splashStyle = splashStyle; m_splashStyle = splashStyle;
m_milliseconds = milliseconds; m_milliseconds = milliseconds;
m_window = new wxSplashScreenWindow(bitmap, this, -1, pos, size, wxNO_BORDER); m_window = new wxSplashScreenWindow(bitmap, this, wxID_ANY, pos, size, wxNO_BORDER);
SetClientSize(bitmap.GetWidth(), bitmap.GetHeight()); SetClientSize(bitmap.GetWidth(), bitmap.GetHeight());
@@ -66,10 +66,10 @@ wxSplashScreen::wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int mil
if (m_splashStyle & wxSPLASH_TIMEOUT) if (m_splashStyle & wxSPLASH_TIMEOUT)
{ {
m_timer.SetOwner(this, wxSPLASH_TIMER_ID); m_timer.SetOwner(this, wxSPLASH_TIMER_ID);
m_timer.Start(milliseconds, TRUE); m_timer.Start(milliseconds, true);
} }
Show(TRUE); Show(true);
m_window->SetFocus(); m_window->SetFocus();
#if defined( __WXMSW__ ) || defined(__WXMAC__) #if defined( __WXMSW__ ) || defined(__WXMAC__)
Update(); // Without this, you see a blank screen for an instant Update(); // Without this, you see a blank screen for an instant
@@ -85,7 +85,7 @@ wxSplashScreen::~wxSplashScreen()
void wxSplashScreen::OnNotify(wxTimerEvent& WXUNUSED(event)) void wxSplashScreen::OnNotify(wxTimerEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(true);
} }
void wxSplashScreen::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void wxSplashScreen::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
@@ -182,12 +182,12 @@ void wxSplashScreenWindow::OnEraseBackground(wxEraseEvent& event)
void wxSplashScreenWindow::OnMouseEvent(wxMouseEvent& event) void wxSplashScreenWindow::OnMouseEvent(wxMouseEvent& event)
{ {
if (event.LeftDown() || event.RightDown()) if (event.LeftDown() || event.RightDown())
GetParent()->Close(TRUE); GetParent()->Close(true);
} }
void wxSplashScreenWindow::OnChar(wxKeyEvent& WXUNUSED(event)) void wxSplashScreenWindow::OnChar(wxKeyEvent& WXUNUSED(event))
{ {
GetParent()->Close(TRUE); GetParent()->Close(true);
} }
#endif // wxUSE_SPLASH #endif // wxUSE_SPLASH

View File

@@ -51,16 +51,16 @@ bool wxStaticLine::Create( wxWindow *parent,
m_statbox = NULL; m_statbox = NULL;
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE; return false;
// ok, this is ugly but it's better than nothing: use a thin static box to // ok, this is ugly but it's better than nothing: use a thin static box to
// emulate static line // emulate static line
wxSize sizeReal = AdjustSize(size); wxSize sizeReal = AdjustSize(size);
m_statbox = new wxStaticBox(parent, id, wxT(""), pos, sizeReal, style, name); m_statbox = new wxStaticBox(parent, id, wxEmptyString, pos, sizeReal, style, name);
return TRUE; return true;
} }
wxStaticLine::~wxStaticLine() wxStaticLine::~wxStaticLine()

View File

@@ -80,10 +80,10 @@ bool wxStatusBarGeneric::Create(wxWindow *parent,
if ( !wxWindow::Create(parent, id, if ( !wxWindow::Create(parent, id,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
style | wxTAB_TRAVERSAL, name) ) style | wxTAB_TRAVERSAL, name) )
return FALSE; return false;
// The status bar should have a themed background // The status bar should have a themed background
SetThemeEnabled( TRUE ); SetThemeEnabled( true );
// Don't wish this to be found as a child // Don't wish this to be found as a child
#ifndef __WXMAC__ #ifndef __WXMAC__
@@ -102,11 +102,11 @@ bool wxStatusBarGeneric::Create(wxWindow *parent,
int height = (int)( (11*y)/10 + 2*GetBorderY()); int height = (int)( (11*y)/10 + 2*GetBorderY());
SetSize(-1, -1, -1, height); SetSize(wxDefaultPosition.x, wxDefaultPosition.y, wxDefaultSize.x, height);
SetFieldsCount(1); SetFieldsCount(1);
return TRUE; return true;
} }
@@ -159,7 +159,7 @@ void wxStatusBarGeneric::SetStatusText(const wxString& text, int number)
wxRect rect; wxRect rect;
GetFieldRect(number, rect); GetFieldRect(number, rect);
Refresh( TRUE, &rect ); Refresh( true, &rect );
} }
} }
@@ -311,7 +311,7 @@ void wxStatusBarGeneric::DrawField(wxDC& dc, int i)
// Get the position and size of the field's internal bounding rectangle // Get the position and size of the field's internal bounding rectangle
bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const
{ {
wxCHECK_MSG( (n >= 0) && (n < m_nFields), FALSE, wxCHECK_MSG( (n >= 0) && (n < m_nFields), false,
_T("invalid status bar field index") ); _T("invalid status bar field index") );
// FIXME: workarounds for OS/2 bugs have nothing to do here (VZ) // FIXME: workarounds for OS/2 bugs have nothing to do here (VZ)
@@ -345,7 +345,7 @@ bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const
rect.width = m_widthsAbs[n] - 2*m_borderX; rect.width = m_widthsAbs[n] - 2*m_borderX;
rect.height = height - 2*m_borderY; rect.height = height - 2*m_borderY;
return TRUE; return true;
} }
// Initialize colours // Initialize colours
@@ -400,7 +400,7 @@ void wxStatusBarGeneric::SetMinHeight(int height)
if ( height > (11*y)/10 ) if ( height > (11*y)/10 )
{ {
SetSize(-1, -1, -1, height + 2*m_borderY); SetSize(wxDefaultPosition.x, wxDefaultPosition.y, wxDefaultSize.x, height + 2*m_borderY);
} }
} }
@@ -432,10 +432,10 @@ void wxStatusBarGeneric::OnLeftDown(wxMouseEvent& event)
} }
else else
{ {
event.Skip( TRUE ); event.Skip( true );
} }
#else #else
event.Skip( TRUE ); event.Skip( true );
#endif #endif
} }
@@ -466,10 +466,10 @@ void wxStatusBarGeneric::OnRightDown(wxMouseEvent& event)
} }
else else
{ {
event.Skip( TRUE ); event.Skip( true );
} }
#else #else
event.Skip( TRUE ); event.Skip( true );
#endif #endif
} }

View File

@@ -49,7 +49,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxTabControl, wxObject)
wxTabControl::wxTabControl(wxTabView *v) wxTabControl::wxTabControl(wxTabView *v)
{ {
m_view = v; m_view = v;
m_isSelected = FALSE; m_isSelected = false;
m_offsetX = 0; m_offsetX = 0;
m_offsetY = 0; m_offsetY = 0;
m_width = 0; m_width = 0;
@@ -502,9 +502,9 @@ bool wxTabControl::HitTest(int x, int y) const
int tabY2 = tabY1 + GetHeight(); int tabY2 = tabY1 + GetHeight();
if (x >= tabX1 && y >= tabY1 && x <= tabX2 && y <= tabY2) if (x >= tabX1 && y >= tabY1 && x <= tabX2 && y <= tabY2)
return TRUE; return true;
else else
return FALSE; return false;
} }
IMPLEMENT_DYNAMIC_CLASS(wxTabView, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxTabView, wxObject)
@@ -540,7 +540,7 @@ wxTabView::wxTabView(long style)
wxTabView::~wxTabView() wxTabView::~wxTabView()
{ {
ClearTabs(TRUE); ClearTabs(true);
} }
// Automatically positions tabs // Automatically positions tabs
@@ -631,22 +631,22 @@ bool wxTabView::RemoveTab(int id)
// The layout has changed // The layout has changed
LayoutTabs(); LayoutTabs();
return TRUE; return true;
} }
tabNode = tabNode->GetNext(); tabNode = tabNode->GetNext();
} }
layerNode = layerNode->GetNext(); layerNode = layerNode->GetNext();
} }
return FALSE; return false;
} }
bool wxTabView::SetTabText(int id, const wxString& label) bool wxTabView::SetTabText(int id, const wxString& label)
{ {
wxTabControl* control = FindTabControlForId(id); wxTabControl* control = FindTabControlForId(id);
if (!control) if (!control)
return FALSE; return false;
control->SetLabel(label); control->SetLabel(label);
return TRUE; return true;
} }
wxString wxTabView::GetTabText(int id) const wxString wxTabView::GetTabText(int id) const
@@ -877,11 +877,11 @@ void wxTabView::Draw(wxDC& dc)
#endif #endif
} }
// Process mouse event, return FALSE if we didn't process it // Process mouse event, return false if we didn't process it
bool wxTabView::OnEvent(wxMouseEvent& event) bool wxTabView::OnEvent(wxMouseEvent& event)
{ {
if (!event.LeftDown()) if (!event.LeftDown())
return FALSE; return false;
wxCoord x, y; wxCoord x, y;
event.GetPosition(&x, &y); event.GetPosition(&x, &y);
@@ -911,16 +911,16 @@ bool wxTabView::OnEvent(wxMouseEvent& event)
} }
if (!hitControl) if (!hitControl)
return FALSE; return false;
wxTabControl *currentTab = FindTabControlForId(m_tabSelection); wxTabControl *currentTab = FindTabControlForId(m_tabSelection);
if (hitControl == currentTab) if (hitControl == currentTab)
return FALSE; return false;
ChangeTab(hitControl); ChangeTab(hitControl);
return TRUE; return true;
} }
bool wxTabView::ChangeTab(wxTabControl *control) bool wxTabView::ChangeTab(wxTabControl *control)
@@ -931,28 +931,28 @@ bool wxTabView::ChangeTab(wxTabControl *control)
oldTab = currentTab->GetId(); oldTab = currentTab->GetId();
if (control == currentTab) if (control == currentTab)
return TRUE; return true;
if (m_layers.GetCount() == 0) if (m_layers.GetCount() == 0)
return FALSE; return false;
if (!OnTabPreActivate(control->GetId(), oldTab)) if (!OnTabPreActivate(control->GetId(), oldTab))
return FALSE; return false;
// Move the tab to the bottom // Move the tab to the bottom
MoveSelectionTab(control); MoveSelectionTab(control);
if (currentTab) if (currentTab)
currentTab->SetSelected(FALSE); currentTab->SetSelected(false);
control->SetSelected(TRUE); control->SetSelected(true);
m_tabSelection = control->GetId(); m_tabSelection = control->GetId();
OnTabActivate(control->GetId(), oldTab); OnTabActivate(control->GetId(), oldTab);
// Leave window refresh for the implementing window // Leave window refresh for the implementing window
return TRUE; return true;
} }
// Move the selected tab to the bottom layer, if necessary, // Move the selected tab to the bottom layer, if necessary,
@@ -960,7 +960,7 @@ bool wxTabView::ChangeTab(wxTabControl *control)
bool wxTabView::MoveSelectionTab(wxTabControl *control) bool wxTabView::MoveSelectionTab(wxTabControl *control)
{ {
if (m_layers.GetCount() == 0) if (m_layers.GetCount() == 0)
return FALSE; return false;
wxTabLayer *firstLayer = (wxTabLayer *)m_layers.GetFirst()->GetData(); wxTabLayer *firstLayer = (wxTabLayer *)m_layers.GetFirst()->GetData();
@@ -972,14 +972,14 @@ bool wxTabView::MoveSelectionTab(wxTabControl *control)
int col = 0; int col = 0;
wxList::compatibility_iterator thisNode = FindTabNodeAndColumn(control, &col); wxList::compatibility_iterator thisNode = FindTabNodeAndColumn(control, &col);
if (!thisNode) if (!thisNode)
return FALSE; return false;
wxList::compatibility_iterator otherNode = firstLayer->Item(col); wxList::compatibility_iterator otherNode = firstLayer->Item(col);
if (!otherNode) if (!otherNode)
return FALSE; return false;
// If this is already in the bottom layer, return now // If this is already in the bottom layer, return now
if (otherNode == thisNode) if (otherNode == thisNode)
return TRUE; return true;
wxTabControl *otherTab = (wxTabControl *)otherNode->GetData(); wxTabControl *otherTab = (wxTabControl *)otherNode->GetData();
@@ -1003,7 +1003,7 @@ bool wxTabView::MoveSelectionTab(wxTabControl *control)
thisNode->SetData(otherTab); thisNode->SetData(otherTab);
otherNode->SetData(control); otherNode->SetData(control);
} }
return TRUE; return true;
} }
// Called when a tab is activated // Called when a tab is activated
@@ -1051,7 +1051,7 @@ void wxTabView::SetTabSelection(int sel, bool activateTool)
} }
if (oldControl) if (oldControl)
oldControl->SetSelected(FALSE); oldControl->SetSelected(false);
m_tabSelection = sel; m_tabSelection = sel;
@@ -1233,7 +1233,7 @@ wxPanelTabView::wxPanelTabView(wxPanel *pan, long style)
wxPanelTabView::~wxPanelTabView(void) wxPanelTabView::~wxPanelTabView(void)
{ {
ClearWindows(TRUE); ClearWindows(true);
} }
// Called when a tab is activated // Called when a tab is activated
@@ -1246,9 +1246,9 @@ void wxPanelTabView::OnTabActivate(int activateId, int deactivateId)
wxWindow *newWindow = GetTabWindow(activateId); wxWindow *newWindow = GetTabWindow(activateId);
if (oldWindow) if (oldWindow)
oldWindow->Show(FALSE); oldWindow->Show(false);
if (newWindow) if (newWindow)
newWindow->Show(TRUE); newWindow->Show(true);
m_panel->Refresh(); m_panel->Refresh();
} }
@@ -1258,7 +1258,7 @@ void wxPanelTabView::AddTabWindow(int id, wxWindow *window)
{ {
wxASSERT(m_tabWindows.find(id) == m_tabWindows.end()); wxASSERT(m_tabWindows.find(id) == m_tabWindows.end());
m_tabWindows[id] = window; m_tabWindows[id] = window;
window->Show(FALSE); window->Show(false);
} }
wxWindow *wxPanelTabView::GetTabWindow(int id) const wxWindow *wxPanelTabView::GetTabWindow(int id) const
@@ -1280,8 +1280,8 @@ void wxPanelTabView::ShowWindowForTab(int id)
if (newWindow == m_currentWindow) if (newWindow == m_currentWindow)
return; return;
if (m_currentWindow) if (m_currentWindow)
m_currentWindow->Show(FALSE); m_currentWindow->Show(false);
newWindow->Show(TRUE); newWindow->Show(true);
newWindow->Refresh(); newWindow->Refresh();
} }

View File

@@ -72,7 +72,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
const wxString& value, const wxString& value,
long style, long style,
const wxPoint& pos) const wxPoint& pos)
: wxDialog(parent, -1, caption, pos, wxDefaultSize, : wxDialog(parent, wxID_ANY, caption, pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL), wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL),
m_value(value) m_value(value)
{ {
@@ -88,7 +88,7 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
// 2) text ctrl // 2) text ctrl
m_textctrl = new wxTextCtrl(this, wxID_TEXT, value, m_textctrl = new wxTextCtrl(this, wxID_TEXT, value,
wxDefaultPosition, wxSize(300, -1), wxDefaultPosition, wxSize(300, wxDefaultSize.y),
style & ~wxTextEntryDialogStyle); style & ~wxTextEntryDialogStyle);
topsizer->Add( m_textctrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 ); topsizer->Add( m_textctrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );
@@ -100,13 +100,13 @@ wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent,
#if wxUSE_STATLINE #if wxUSE_STATLINE
// 3) static line // 3) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif #endif
// 4) buttons // 4) buttons
topsizer->Add( CreateButtonSizer( style ), 0, wxCENTRE | wxALL, 10 ); topsizer->Add( CreateButtonSizer( style ), 0, wxCENTRE | wxALL, 10 );
SetAutoLayout( TRUE ); SetAutoLayout( true );
SetSizer( topsizer ); SetSizer( topsizer );
topsizer->SetSizeHints( this ); topsizer->SetSizeHints( this );

View File

@@ -69,7 +69,7 @@ class wxTimerDesc
{ {
public: public:
wxTimerDesc(wxTimer *t) : wxTimerDesc(wxTimer *t) :
timer(t), running(FALSE), next(NULL), prev(NULL), timer(t), running(false), next(NULL), prev(NULL),
shotTime(0), deleteFlag(NULL) {} shotTime(0), deleteFlag(NULL) {}
wxTimer *timer; wxTimer *timer;
@@ -100,7 +100,7 @@ void wxTimerScheduler::QueueTimer(wxTimerDesc *desc, wxTimerTick_t when)
if ( when == 0 ) if ( when == 0 )
when = GetMillisecondsTime() + desc->timer->GetInterval(); when = GetMillisecondsTime() + desc->timer->GetInterval();
desc->shotTime = when; desc->shotTime = when;
desc->running = TRUE; desc->running = true;
wxLogTrace( wxT("timer"), wxLogTrace( wxT("timer"),
wxT("queued timer %p at tick %") wxTimerTickFmtSpec, wxT("queued timer %p at tick %") wxTimerTickFmtSpec,
@@ -125,7 +125,7 @@ void wxTimerScheduler::QueueTimer(wxTimerDesc *desc, wxTimerTick_t when)
void wxTimerScheduler::RemoveTimer(wxTimerDesc *desc) void wxTimerScheduler::RemoveTimer(wxTimerDesc *desc)
{ {
desc->running = FALSE; desc->running = false;
if ( desc == m_timers ) if ( desc == m_timers )
m_timers = desc->next; m_timers = desc->next;
if ( desc->prev ) if ( desc->prev )
@@ -150,7 +150,7 @@ void wxTimerScheduler::NotifyTimers()
oneShot = desc->timer->IsOneShot(); oneShot = desc->timer->IsOneShot();
RemoveTimer(desc); RemoveTimer(desc);
timerDeleted = FALSE; timerDeleted = false;
desc->deleteFlag = &timerDeleted; desc->deleteFlag = &timerDeleted;
desc->timer->Notify(); desc->timer->Notify();
@@ -197,7 +197,7 @@ wxTimer::~wxTimer()
// happen if somebody is really nasty and deletes the timer // happen if somebody is really nasty and deletes the timer
// from wxTimer::Notify() // from wxTimer::Notify()
if ( m_desc->deleteFlag != NULL ) if ( m_desc->deleteFlag != NULL )
*m_desc->deleteFlag = TRUE; *m_desc->deleteFlag = true;
delete m_desc; delete m_desc;
wxLogTrace( wxT("timer"), wxT(" ...done destroying timer %p..."), this); wxLogTrace( wxT("timer"), wxT(" ...done destroying timer %p..."), this);
@@ -214,10 +214,10 @@ bool wxTimer::Start(int millisecs, bool oneShot)
this, millisecs, oneShot); this, millisecs, oneShot);
if ( !wxTimerBase::Start(millisecs, oneShot) ) if ( !wxTimerBase::Start(millisecs, oneShot) )
return FALSE; return false;
gs_scheduler->QueueTimer(m_desc); gs_scheduler->QueueTimer(m_desc);
return TRUE; return true;
} }
void wxTimer::Stop() void wxTimer::Stop()
@@ -241,7 +241,7 @@ class wxTimerModule: public wxModule
DECLARE_DYNAMIC_CLASS(wxTimerModule) DECLARE_DYNAMIC_CLASS(wxTimerModule)
public: public:
wxTimerModule() {} wxTimerModule() {}
bool OnInit() { return TRUE; } bool OnInit() { return true; }
void OnExit() { delete gs_scheduler; gs_scheduler = NULL; } void OnExit() { delete gs_scheduler; gs_scheduler = NULL; }
}; };

View File

@@ -217,7 +217,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip")); wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip"));
wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) ); wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know..."), wxDefaultPosition, wxSize(wxDefaultSize.x,30) );
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD)); text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD));
#else #else

View File

@@ -126,7 +126,7 @@ wxTipWindow::wxTipWindow(wxWindow *parent,
#if wxUSE_POPUPWIN #if wxUSE_POPUPWIN
: wxPopupTransientWindow(parent) : wxPopupTransientWindow(parent)
#else #else
: wxFrame(parent, -1, _T(""), : wxFrame(parent, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxNO_BORDER | wxFRAME_NO_TASKBAR ) wxNO_BORDER | wxFRAME_NO_TASKBAR )
#endif #endif
@@ -165,7 +165,7 @@ wxTipWindow::wxTipWindow(wxWindow *parent,
#endif #endif
#else #else
Move(x, y); Move(x, y);
Show(TRUE); Show(true);
#endif #endif
} }
@@ -229,7 +229,7 @@ void wxTipWindow::Close()
} }
#if wxUSE_POPUPWIN #if wxUSE_POPUPWIN
Show(FALSE); Show(false);
#ifdef __WXGTK__ #ifdef __WXGTK__
if (GTK_WIDGET_HAS_GRAB(m_widget)) if (GTK_WIDGET_HAS_GRAB(m_widget))
gtk_grab_remove( m_widget ); gtk_grab_remove( m_widget );
@@ -245,7 +245,7 @@ void wxTipWindow::Close()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxTipWindowView::wxTipWindowView(wxWindow *parent) wxTipWindowView::wxTipWindowView(wxWindow *parent)
: wxWindow(parent, -1, : wxWindow(parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxNO_BORDER) wxNO_BORDER)
{ {
@@ -272,7 +272,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength)
widthMax = 0; widthMax = 0;
m_parent->m_heightLine = 0; m_parent->m_heightLine = 0;
bool breakLine = FALSE; bool breakLine = false;
for ( const wxChar *p = text.c_str(); ; p++ ) for ( const wxChar *p = text.c_str(); ; p++ )
{ {
if ( *p == _T('\n') || *p == _T('\0') ) if ( *p == _T('\n') || *p == _T('\0') )
@@ -293,21 +293,21 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength)
} }
current.clear(); current.clear();
breakLine = FALSE; breakLine = false;
} }
else if ( breakLine && (*p == _T(' ') || *p == _T('\t')) ) else if ( breakLine && (*p == _T(' ') || *p == _T('\t')) )
{ {
// word boundary - break the line here // word boundary - break the line here
m_parent->m_textLines.Add(current); m_parent->m_textLines.Add(current);
current.clear(); current.clear();
breakLine = FALSE; breakLine = false;
} }
else // line goes on else // line goes on
{ {
current += *p; current += *p;
dc.GetTextExtent(current, &width, &height); dc.GetTextExtent(current, &width, &height);
if ( width > maxLength ) if ( width > maxLength )
breakLine = TRUE; breakLine = true;
if ( width > widthMax ) if ( width > widthMax )
widthMax = width; widthMax = width;

View File

@@ -154,7 +154,7 @@ public:
void SetImage(int image, wxTreeItemIcon which) { m_images[which] = image; } void SetImage(int image, wxTreeItemIcon which) { m_images[which] = image; }
void SetData(wxTreeItemData *data) { m_data = data; } void SetData(wxTreeItemData *data) { m_data = data; }
void SetHasPlus(bool has = TRUE) { m_hasPlus = has; } void SetHasPlus(bool has = true) { m_hasPlus = has; }
void SetBold(bool bold) { m_isBold = bold; } void SetBold(bool bold) { m_isBold = bold; }
@@ -178,7 +178,7 @@ public:
void DeleteChildren(wxGenericTreeCtrl *tree = NULL); void DeleteChildren(wxGenericTreeCtrl *tree = NULL);
// get count of all children (and grand children if 'recursively') // get count of all children (and grand children if 'recursively')
size_t GetChildrenCount(bool recursively = TRUE) const; size_t GetChildrenCount(bool recursively = true) const;
void Insert(wxGenericTreeItem *child, size_t index) void Insert(wxGenericTreeItem *child, size_t index)
{ m_children.Insert(child, index); } { m_children.Insert(child, index); }
@@ -186,17 +186,17 @@ public:
void GetSize( int &x, int &y, const wxGenericTreeCtrl* ); void GetSize( int &x, int &y, const wxGenericTreeCtrl* );
// return the item at given position (or NULL if no item), onButton is // return the item at given position (or NULL if no item), onButton is
// TRUE if the point belongs to the item's button, otherwise it lies // true if the point belongs to the item's button, otherwise it lies
// on the item's label // on the item's label
wxGenericTreeItem *HitTest( const wxPoint& point, wxGenericTreeItem *HitTest( const wxPoint& point,
const wxGenericTreeCtrl *, const wxGenericTreeCtrl *,
int &flags, int &flags,
int level ); int level );
void Expand() { m_isCollapsed = FALSE; } void Expand() { m_isCollapsed = false; }
void Collapse() { m_isCollapsed = TRUE; } void Collapse() { m_isCollapsed = true; }
void SetHilight( bool set = TRUE ) { m_hasHilight = set; } void SetHilight( bool set = true ) { m_hasHilight = set; }
// status inquiries // status inquiries
bool HasChildren() const { return !m_children.IsEmpty(); } bool HasChildren() const { return !m_children.IsEmpty(); }
@@ -214,7 +214,7 @@ public:
if ( !m_attr ) if ( !m_attr )
{ {
m_attr = new wxTreeItemAttr; m_attr = new wxTreeItemAttr;
m_ownsAttr = TRUE; m_ownsAttr = true;
} }
return *m_attr; return *m_attr;
} }
@@ -223,13 +223,13 @@ public:
{ {
if ( m_ownsAttr ) delete m_attr; if ( m_ownsAttr ) delete m_attr;
m_attr = attr; m_attr = attr;
m_ownsAttr = FALSE; m_ownsAttr = false;
} }
// set them and delete when done // set them and delete when done
void AssignAttributes(wxTreeItemAttr *attr) void AssignAttributes(wxTreeItemAttr *attr)
{ {
SetAttributes(attr); SetAttributes(attr);
m_ownsAttr = TRUE; m_ownsAttr = true;
} }
private: private:
@@ -295,13 +295,13 @@ static bool IsDescendantOf(wxGenericTreeItem *parent, wxGenericTreeItem *item)
if ( item == parent ) if ( item == parent )
{ {
// item is a descendant of parent // item is a descendant of parent
return TRUE; return true;
} }
item = item->GetParent(); item = item->GetParent();
} }
return FALSE; return false;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -333,7 +333,7 @@ wxTreeTextCtrl::wxTreeTextCtrl(wxGenericTreeCtrl *owner,
: m_itemEdited(item), m_startValue(item->GetText()) : m_itemEdited(item), m_startValue(item->GetText())
{ {
m_owner = owner; m_owner = owner;
m_finished = FALSE; m_finished = false;
int w = m_itemEdited->GetWidth(), int w = m_itemEdited->GetWidth(),
h = m_itemEdited->GetHeight(); h = m_itemEdited->GetHeight();
@@ -373,19 +373,19 @@ bool wxTreeTextCtrl::AcceptChanges()
if ( value == m_startValue ) if ( value == m_startValue )
{ {
// nothing changed, always accept // nothing changed, always accept
return TRUE; return true;
} }
if ( !m_owner->OnRenameAccept(m_itemEdited, value) ) if ( !m_owner->OnRenameAccept(m_itemEdited, value) )
{ {
// vetoed by the user // vetoed by the user
return FALSE; return false;
} }
// accepted, do rename the item // accepted, do rename the item
m_owner->SetItemText(m_itemEdited, value); m_owner->SetItemText(m_itemEdited, value);
return TRUE; return true;
} }
void wxTreeTextCtrl::Finish() void wxTreeTextCtrl::Finish()
@@ -396,7 +396,7 @@ void wxTreeTextCtrl::Finish()
wxPendingDelete.Append(this); wxPendingDelete.Append(this);
m_finished = TRUE; m_finished = true;
m_owner->SetFocus(); // This doesn't work. TODO. m_owner->SetFocus(); // This doesn't work. TODO.
} }
@@ -438,7 +438,7 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event )
sx = parentSize.x - myPos.x; sx = parentSize.x - myPos.x;
if (mySize.x > sx) if (mySize.x > sx)
sx = mySize.x; sx = mySize.x;
SetSize(sx, -1); SetSize(sx, wxDefaultSize.y);
} }
event.Skip(); event.Skip();
@@ -476,15 +476,15 @@ wxGenericTreeItem::wxGenericTreeItem(wxGenericTreeItem *parent,
m_data = data; m_data = data;
m_x = m_y = 0; m_x = m_y = 0;
m_isCollapsed = TRUE; m_isCollapsed = true;
m_hasHilight = FALSE; m_hasHilight = false;
m_hasPlus = FALSE; m_hasPlus = false;
m_isBold = FALSE; m_isBold = false;
m_parent = parent; m_parent = parent;
m_attr = (wxTreeItemAttr *)NULL; m_attr = (wxTreeItemAttr *)NULL;
m_ownsAttr = FALSE; m_ownsAttr = false;
// We don't know the height here yet. // We don't know the height here yet.
m_width = 0; m_width = 0;
@@ -678,7 +678,7 @@ BEGIN_EVENT_TABLE(wxGenericTreeCtrl,wxScrolledWindow)
EVT_CHAR (wxGenericTreeCtrl::OnChar) EVT_CHAR (wxGenericTreeCtrl::OnChar)
EVT_SET_FOCUS (wxGenericTreeCtrl::OnSetFocus) EVT_SET_FOCUS (wxGenericTreeCtrl::OnSetFocus)
EVT_KILL_FOCUS (wxGenericTreeCtrl::OnKillFocus) EVT_KILL_FOCUS (wxGenericTreeCtrl::OnKillFocus)
EVT_TREE_ITEM_GETTOOLTIP(-1, wxGenericTreeCtrl::OnGetToolTip) EVT_TREE_ITEM_GETTOOLTIP(wxID_ANY, wxGenericTreeCtrl::OnGetToolTip)
END_EVENT_TABLE() END_EVENT_TABLE()
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) #if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
@@ -697,8 +697,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxGenericTreeCtrl)
void wxGenericTreeCtrl::Init() void wxGenericTreeCtrl::Init()
{ {
m_current = m_key_current = m_anchor = m_select_me = (wxGenericTreeItem *) NULL; m_current = m_key_current = m_anchor = m_select_me = (wxGenericTreeItem *) NULL;
m_hasFocus = FALSE; m_hasFocus = false;
m_dirty = FALSE; m_dirty = false;
m_lineHeight = 10; m_lineHeight = 10;
m_indent = 15; m_indent = 15;
@@ -725,10 +725,10 @@ void wxGenericTreeCtrl::Init()
m_imageListNormal = m_imageListButtons = m_imageListNormal = m_imageListButtons =
m_imageListState = (wxImageList *) NULL; m_imageListState = (wxImageList *) NULL;
m_ownsImageListNormal = m_ownsImageListButtons = m_ownsImageListNormal = m_ownsImageListButtons =
m_ownsImageListState = FALSE; m_ownsImageListState = false;
m_dragCount = 0; m_dragCount = 0;
m_isDragging = FALSE; m_isDragging = false;
m_dropTarget = m_oldSelection = NULL; m_dropTarget = m_oldSelection = NULL;
m_underMouse = NULL; m_underMouse = NULL;
m_textCtrl = NULL; m_textCtrl = NULL;
@@ -738,7 +738,7 @@ void wxGenericTreeCtrl::Init()
m_findTimer = NULL; m_findTimer = NULL;
m_lastOnSame = FALSE; m_lastOnSame = false;
#if defined( __WXMAC__ ) && __WXMAC_CARBON__ #if defined( __WXMAC__ ) && __WXMAC_CARBON__
m_normalFont.MacCreateThemeFont( kThemeViewsFont ) ; m_normalFont.MacCreateThemeFont( kThemeViewsFont ) ;
@@ -798,7 +798,7 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
wxGenericTreeCtrl::~wxGenericTreeCtrl() wxGenericTreeCtrl::~wxGenericTreeCtrl()
@@ -844,13 +844,13 @@ size_t wxGenericTreeCtrl::GetCount() const
void wxGenericTreeCtrl::SetIndent(unsigned int indent) void wxGenericTreeCtrl::SetIndent(unsigned int indent)
{ {
m_indent = (unsigned short) indent; m_indent = (unsigned short) indent;
m_dirty = TRUE; m_dirty = true;
} }
void wxGenericTreeCtrl::SetSpacing(unsigned int spacing) void wxGenericTreeCtrl::SetSpacing(unsigned int spacing)
{ {
m_spacing = (unsigned short) spacing; m_spacing = (unsigned short) spacing;
m_dirty = TRUE; m_dirty = true;
} }
size_t size_t
@@ -876,7 +876,7 @@ void wxGenericTreeCtrl::SetWindowStyle(const long styles)
// want to update the inherited styles, but right now // want to update the inherited styles, but right now
// none of the parents has updatable styles // none of the parents has updatable styles
m_windowStyle = styles; m_windowStyle = styles;
m_dirty = TRUE; m_dirty = true;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -1028,7 +1028,7 @@ bool wxGenericTreeCtrl::SetFont( const wxFont &font )
m_normalFont.GetFaceName(), m_normalFont.GetFaceName(),
m_normalFont.GetEncoding()); m_normalFont.GetEncoding());
return TRUE; return true;
} }
@@ -1038,7 +1038,7 @@ bool wxGenericTreeCtrl::SetFont( const wxFont &font )
bool wxGenericTreeCtrl::IsVisible(const wxTreeItemId& item) const bool wxGenericTreeCtrl::IsVisible(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
// An item is only visible if it's not a descendant of a collapsed item // An item is only visible if it's not a descendant of a collapsed item
wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem;
@@ -1046,7 +1046,7 @@ bool wxGenericTreeCtrl::IsVisible(const wxTreeItemId& item) const
while (parent) while (parent)
{ {
if (!parent->IsExpanded()) if (!parent->IsExpanded())
return FALSE; return false;
parent = parent->GetParent(); parent = parent->GetParent();
} }
@@ -1057,20 +1057,20 @@ bool wxGenericTreeCtrl::IsVisible(const wxTreeItemId& item) const
wxRect rect; wxRect rect;
if (!GetBoundingRect(item, rect)) if (!GetBoundingRect(item, rect))
return FALSE; return false;
if (rect.GetWidth() == 0 || rect.GetHeight() == 0) if (rect.GetWidth() == 0 || rect.GetHeight() == 0)
return FALSE; return false;
if (rect.GetBottom() < 0 || rect.GetTop() > clientSize.y) if (rect.GetBottom() < 0 || rect.GetTop() > clientSize.y)
return FALSE; return false;
if (rect.GetRight() < 0 || rect.GetLeft() > clientSize.x) if (rect.GetRight() < 0 || rect.GetLeft() > clientSize.x)
return FALSE; return false;
return TRUE; return true;
} }
bool wxGenericTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const bool wxGenericTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
// consider that the item does have children if it has the "+" button: it // consider that the item does have children if it has the "+" button: it
// might not have them (if it had never been expanded yet) but then it // might not have them (if it had never been expanded yet) but then it
@@ -1082,21 +1082,21 @@ bool wxGenericTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
bool wxGenericTreeCtrl::IsExpanded(const wxTreeItemId& item) const bool wxGenericTreeCtrl::IsExpanded(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
return ((wxGenericTreeItem*) item.m_pItem)->IsExpanded(); return ((wxGenericTreeItem*) item.m_pItem)->IsExpanded();
} }
bool wxGenericTreeCtrl::IsSelected(const wxTreeItemId& item) const bool wxGenericTreeCtrl::IsSelected(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
return ((wxGenericTreeItem*) item.m_pItem)->IsSelected(); return ((wxGenericTreeItem*) item.m_pItem)->IsSelected();
} }
bool wxGenericTreeCtrl::IsBold(const wxTreeItemId& item) const bool wxGenericTreeCtrl::IsBold(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") ); wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
return ((wxGenericTreeItem*) item.m_pItem)->IsBold(); return ((wxGenericTreeItem*) item.m_pItem)->IsBold();
} }
@@ -1357,7 +1357,7 @@ wxTreeItemId wxGenericTreeCtrl::DoInsertItem(const wxTreeItemId& parentId,
return AddRoot(text, image, selImage, data); return AddRoot(text, image, selImage, data);
} }
m_dirty = TRUE; // do this first so stuff below doesn't cause flicker m_dirty = true; // do this first so stuff below doesn't cause flicker
wxGenericTreeItem *item = wxGenericTreeItem *item =
new wxGenericTreeItem( parent, text, image, selImage, data ); new wxGenericTreeItem( parent, text, image, selImage, data );
@@ -1378,7 +1378,7 @@ wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text,
{ {
wxCHECK_MSG( !m_anchor, wxTreeItemId(), wxT("tree can have only one root") ); wxCHECK_MSG( !m_anchor, wxTreeItemId(), wxT("tree can have only one root") );
m_dirty = TRUE; // do this first so stuff below doesn't cause flicker m_dirty = true; // do this first so stuff below doesn't cause flicker
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text,
image, selImage, data); image, selImage, data);
@@ -1399,7 +1399,7 @@ wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text,
if (!HasFlag(wxTR_MULTIPLE)) if (!HasFlag(wxTR_MULTIPLE))
{ {
m_current = m_key_current = m_anchor; m_current = m_key_current = m_anchor;
m_current->SetHilight( TRUE ); m_current->SetHilight( true );
} }
return m_anchor; return m_anchor;
@@ -1479,7 +1479,7 @@ void wxGenericTreeCtrl::SendDeleteEvent(wxGenericTreeItem *item)
void wxGenericTreeCtrl::DeleteChildren(const wxTreeItemId& itemId) void wxGenericTreeCtrl::DeleteChildren(const wxTreeItemId& itemId)
{ {
m_dirty = TRUE; // do this first so stuff below doesn't cause flicker m_dirty = true; // do this first so stuff below doesn't cause flicker
wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem;
item->DeleteChildren(this); item->DeleteChildren(this);
@@ -1487,7 +1487,7 @@ void wxGenericTreeCtrl::DeleteChildren(const wxTreeItemId& itemId)
void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId) void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId)
{ {
m_dirty = TRUE; // do this first so stuff below doesn't cause flicker m_dirty = true; // do this first so stuff below doesn't cause flicker
wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem;
@@ -1657,7 +1657,7 @@ void wxGenericTreeCtrl::Unselect()
{ {
if (m_current) if (m_current)
{ {
m_current->SetHilight( FALSE ); m_current->SetHilight( false );
RefreshLine( m_current ); RefreshLine( m_current );
m_current = NULL; m_current = NULL;
@@ -1669,7 +1669,7 @@ void wxGenericTreeCtrl::UnselectAllChildren(wxGenericTreeItem *item)
{ {
if (item->IsSelected()) if (item->IsSelected())
{ {
item->SetHilight(FALSE); item->SetHilight(false);
RefreshLine(item); RefreshLine(item);
} }
@@ -1715,7 +1715,7 @@ bool wxGenericTreeCtrl::TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTr
size_t count = children.Count(); size_t count = children.Count();
for (size_t n=(size_t)(index+1); n<count; ++n) for (size_t n=(size_t)(index+1); n<count; ++n)
{ {
if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE; if (TagAllChildrenUntilLast(children[n], last_item, select)) return true;
} }
return TagNextChildren(parent, last_item, select); return TagNextChildren(parent, last_item, select);
@@ -1727,7 +1727,7 @@ bool wxGenericTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxG
RefreshLine(crt_item); RefreshLine(crt_item);
if (crt_item==last_item) if (crt_item==last_item)
return TRUE; return true;
if (crt_item->HasChildren()) if (crt_item->HasChildren())
{ {
@@ -1736,11 +1736,11 @@ bool wxGenericTreeCtrl::TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxG
for ( size_t n = 0; n < count; ++n ) for ( size_t n = 0; n < count; ++n )
{ {
if (TagAllChildrenUntilLast(children[n], last_item, select)) if (TagAllChildrenUntilLast(children[n], last_item, select))
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
void wxGenericTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2) void wxGenericTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2)
@@ -1779,8 +1779,8 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
{ {
if (item->IsSelected()) if (item->IsSelected())
return; // nothing to do return; // nothing to do
unselect_others = TRUE; unselect_others = true;
extended_select = FALSE; extended_select = false;
} }
else if ( unselect_others && item->IsSelected() ) else if ( unselect_others && item->IsSelected() )
{ {
@@ -1830,7 +1830,7 @@ void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId,
} }
else else
{ {
bool select=TRUE; // the default bool select = true; // the default
// Check if we need to toggle hilight (ctrl mode) // Check if we need to toggle hilight (ctrl mode)
if (!unselect_others) if (!unselect_others)
@@ -1856,7 +1856,7 @@ void wxGenericTreeCtrl::SelectItem(const wxTreeItemId& itemId, bool select)
wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem;
wxCHECK_RET( item, wxT("SelectItem(): invalid tree item") ); wxCHECK_RET( item, wxT("SelectItem(): invalid tree item") );
item->SetHilight(FALSE); item->SetHilight(false);
RefreshLine(item); RefreshLine(item);
} }
} }
@@ -2005,7 +2005,7 @@ void wxGenericTreeCtrl::SortChildren(const wxTreeItemId& itemId)
wxArrayGenericTreeItems& children = item->GetChildren(); wxArrayGenericTreeItems& children = item->GetChildren();
if ( children.Count() > 1 ) if ( children.Count() > 1 )
{ {
m_dirty = TRUE; m_dirty = true;
s_treeBeingSorted = this; s_treeBeingSorted = this;
children.Sort(tree_ctrl_compare_func); children.Sort(tree_ctrl_compare_func);
@@ -2072,8 +2072,8 @@ void wxGenericTreeCtrl::SetImageList(wxImageList *imageList)
{ {
if (m_ownsImageListNormal) delete m_imageListNormal; if (m_ownsImageListNormal) delete m_imageListNormal;
m_imageListNormal = imageList; m_imageListNormal = imageList;
m_ownsImageListNormal = FALSE; m_ownsImageListNormal = false;
m_dirty = TRUE; m_dirty = true;
// Don't do any drawing if we're setting the list to NULL, // Don't do any drawing if we're setting the list to NULL,
// since we may be in the process of deleting the tree control. // since we may be in the process of deleting the tree control.
if (imageList) if (imageList)
@@ -2084,34 +2084,34 @@ void wxGenericTreeCtrl::SetStateImageList(wxImageList *imageList)
{ {
if (m_ownsImageListState) delete m_imageListState; if (m_ownsImageListState) delete m_imageListState;
m_imageListState = imageList; m_imageListState = imageList;
m_ownsImageListState = FALSE; m_ownsImageListState = false;
} }
void wxGenericTreeCtrl::SetButtonsImageList(wxImageList *imageList) void wxGenericTreeCtrl::SetButtonsImageList(wxImageList *imageList)
{ {
if (m_ownsImageListButtons) delete m_imageListButtons; if (m_ownsImageListButtons) delete m_imageListButtons;
m_imageListButtons = imageList; m_imageListButtons = imageList;
m_ownsImageListButtons = FALSE; m_ownsImageListButtons = false;
m_dirty = TRUE; m_dirty = true;
CalculateLineHeight(); CalculateLineHeight();
} }
void wxGenericTreeCtrl::AssignImageList(wxImageList *imageList) void wxGenericTreeCtrl::AssignImageList(wxImageList *imageList)
{ {
SetImageList(imageList); SetImageList(imageList);
m_ownsImageListNormal = TRUE; m_ownsImageListNormal = true;
} }
void wxGenericTreeCtrl::AssignStateImageList(wxImageList *imageList) void wxGenericTreeCtrl::AssignStateImageList(wxImageList *imageList)
{ {
SetStateImageList(imageList); SetStateImageList(imageList);
m_ownsImageListState = TRUE; m_ownsImageListState = true;
} }
void wxGenericTreeCtrl::AssignButtonsImageList(wxImageList *imageList) void wxGenericTreeCtrl::AssignButtonsImageList(wxImageList *imageList)
{ {
SetButtonsImageList(imageList); SetButtonsImageList(imageList);
m_ownsImageListButtons = TRUE; m_ownsImageListButtons = true;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@@ -2447,7 +2447,7 @@ void wxGenericTreeCtrl::DrawDropEffect(wxGenericTreeItem *item)
{ {
// draw a line under the drop target because the item will be // draw a line under the drop target because the item will be
// dropped there // dropped there
DrawLine(item, TRUE /* below */); DrawLine(item, true /* below */);
} }
SetCursor(wxCURSOR_BULLSEYE); SetCursor(wxCURSOR_BULLSEYE);
@@ -2521,7 +2521,7 @@ void wxGenericTreeCtrl::OnPaint( wxPaintEvent &WXUNUSED(event) )
void wxGenericTreeCtrl::OnSetFocus( wxFocusEvent &event ) void wxGenericTreeCtrl::OnSetFocus( wxFocusEvent &event )
{ {
m_hasFocus = TRUE; m_hasFocus = true;
RefreshSelected(); RefreshSelected();
@@ -2530,7 +2530,7 @@ void wxGenericTreeCtrl::OnSetFocus( wxFocusEvent &event )
void wxGenericTreeCtrl::OnKillFocus( wxFocusEvent &event ) void wxGenericTreeCtrl::OnKillFocus( wxFocusEvent &event )
{ {
m_hasFocus = FALSE; m_hasFocus = false;
RefreshSelected(); RefreshSelected();
@@ -2725,7 +2725,7 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
// it may happen if the item was expanded but then all of // it may happen if the item was expanded but then all of
// its children have been deleted - so IsExpanded() returned // its children have been deleted - so IsExpanded() returned
// TRUE, but GetLastChild() returned invalid item // true, but GetLastChild() returned invalid item
if ( !lastChild ) if ( !lastChild )
break; break;
@@ -2831,7 +2831,7 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
wxRect& rect, wxRect& rect,
bool WXUNUSED(textOnly)) const bool WXUNUSED(textOnly)) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid item in wxGenericTreeCtrl::GetBoundingRect") ); wxCHECK_MSG( item.IsOk(), false, _T("invalid item in wxGenericTreeCtrl::GetBoundingRect") );
wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem;
@@ -2844,7 +2844,7 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item,
//rect.height = i->GetHeight(); //rect.height = i->GetHeight();
rect.height = GetLineHeight(i); rect.height = GetLineHeight(i);
return TRUE; return true;
} }
void wxGenericTreeCtrl::Edit( const wxTreeItemId& item ) void wxGenericTreeCtrl::Edit( const wxTreeItemId& item )
@@ -2892,7 +2892,7 @@ bool wxGenericTreeCtrl::OnRenameAccept(wxGenericTreeItem *item,
le.m_item = item; le.m_item = item;
le.SetEventObject( this ); le.SetEventObject( this );
le.m_label = value; le.m_label = value;
le.m_editCancelled = FALSE; le.m_editCancelled = false;
return !GetEventHandler()->ProcessEvent( le ) || le.IsAllowed(); return !GetEventHandler()->ProcessEvent( le ) || le.IsAllowed();
} }
@@ -2904,7 +2904,7 @@ void wxGenericTreeCtrl::OnRenameCancelled(wxGenericTreeItem *item)
le.m_item = item; le.m_item = item;
le.SetEventObject( this ); le.SetEventObject( this );
le.m_label = wxEmptyString; le.m_label = wxEmptyString;
le.m_editCancelled = TRUE; le.m_editCancelled = true;
GetEventHandler()->ProcessEvent( le ); GetEventHandler()->ProcessEvent( le );
} }
@@ -3024,7 +3024,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
if ( GetEventHandler()->ProcessEvent(nevent) && nevent.IsAllowed() ) if ( GetEventHandler()->ProcessEvent(nevent) && nevent.IsAllowed() )
{ {
// we're going to drag this item // we're going to drag this item
m_isDragging = TRUE; m_isDragging = true;
// remember the old cursor because we will change it while // remember the old cursor because we will change it while
// dragging // dragging
@@ -3037,7 +3037,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
if ( m_oldSelection ) if ( m_oldSelection )
{ {
m_oldSelection->SetHilight(FALSE); m_oldSelection->SetHilight(false);
RefreshLine(m_oldSelection); RefreshLine(m_oldSelection);
} }
} }
@@ -3071,7 +3071,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
if ( m_oldSelection ) if ( m_oldSelection )
{ {
m_oldSelection->SetHilight(TRUE); m_oldSelection->SetHilight(true);
RefreshLine(m_oldSelection); RefreshLine(m_oldSelection);
m_oldSelection = (wxGenericTreeItem *)NULL; m_oldSelection = (wxGenericTreeItem *)NULL;
} }
@@ -3085,7 +3085,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
(void)GetEventHandler()->ProcessEvent(event); (void)GetEventHandler()->ProcessEvent(event);
m_isDragging = FALSE; m_isDragging = false;
m_dropTarget = (wxGenericTreeItem *)NULL; m_dropTarget = (wxGenericTreeItem *)NULL;
ReleaseMouse(); ReleaseMouse();
@@ -3147,10 +3147,10 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
m_renameTimer = new wxTreeRenameTimer( this ); m_renameTimer = new wxTreeRenameTimer( this );
} }
m_renameTimer->Start( wxTreeRenameTimer::DELAY, TRUE ); m_renameTimer->Start( wxTreeRenameTimer::DELAY, true );
} }
m_lastOnSame = FALSE; m_lastOnSame = false;
} }
} }
else // !RightDown() && !LeftUp() ==> LeftDown() || LeftDClick() else // !RightDown() && !LeftUp() ==> LeftDown() || LeftDClick()
@@ -3200,7 +3200,7 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
if ( m_renameTimer ) if ( m_renameTimer )
m_renameTimer->Stop(); m_renameTimer->Stop();
m_lastOnSame = FALSE; m_lastOnSame = false;
// send activate event first // send activate event first
wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() ); wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
@@ -3244,7 +3244,7 @@ void wxGenericTreeCtrl::OnInternalIdle()
if (!m_dirty) return; if (!m_dirty) return;
if (m_freezeCount) return; if (m_freezeCount) return;
m_dirty = FALSE; m_dirty = false;
CalculatePositions(); CalculatePositions();
Refresh(); Refresh();
@@ -3363,7 +3363,7 @@ void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item)
rect.width = client.x; rect.width = client.x;
rect.height = client.y; rect.height = client.y;
Refresh(TRUE, &rect); Refresh(true, &rect);
AdjustMyScrollbars(); AdjustMyScrollbars();
} }
@@ -3378,7 +3378,7 @@ void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item )
rect.width = GetClientSize().x; rect.width = GetClientSize().x;
rect.height = GetLineHeight(item); //dc.GetCharHeight() + 6; rect.height = GetLineHeight(item); //dc.GetCharHeight() + 6;
Refresh(TRUE, &rect); Refresh(true, &rect);
} }
void wxGenericTreeCtrl::RefreshSelected() void wxGenericTreeCtrl::RefreshSelected()
@@ -3428,25 +3428,25 @@ void wxGenericTreeCtrl::Thaw()
bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour) bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour)
{ {
if ( !wxWindow::SetBackgroundColour(colour) ) if ( !wxWindow::SetBackgroundColour(colour) )
return FALSE; return false;
if (m_freezeCount) return TRUE; if (m_freezeCount) return true;
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour) bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour)
{ {
if ( !wxWindow::SetForegroundColour(colour) ) if ( !wxWindow::SetForegroundColour(colour) )
return FALSE; return false;
if (m_freezeCount) return TRUE; if (m_freezeCount) return true;
Refresh(); Refresh();
return TRUE; return true;
} }
// Process the tooltip event, to speed up event processing. // Process the tooltip event, to speed up event processing.

View File

@@ -85,11 +85,11 @@ BEGIN_EVENT_TABLE(wxWizard, wxDialog)
EVT_BUTTON(wxID_FORWARD, wxWizard::OnBackOrNext) EVT_BUTTON(wxID_FORWARD, wxWizard::OnBackOrNext)
EVT_BUTTON(wxID_HELP, wxWizard::OnHelp) EVT_BUTTON(wxID_HELP, wxWizard::OnHelp)
EVT_WIZARD_PAGE_CHANGED(-1, wxWizard::OnWizEvent) EVT_WIZARD_PAGE_CHANGED(wxID_ANY, wxWizard::OnWizEvent)
EVT_WIZARD_PAGE_CHANGING(-1, wxWizard::OnWizEvent) EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxWizard::OnWizEvent)
EVT_WIZARD_CANCEL(-1, wxWizard::OnWizEvent) EVT_WIZARD_CANCEL(wxID_ANY, wxWizard::OnWizEvent)
EVT_WIZARD_FINISHED(-1, wxWizard::OnWizEvent) EVT_WIZARD_FINISHED(wxID_ANY, wxWizard::OnWizEvent)
EVT_WIZARD_HELP(-1, wxWizard::OnWizEvent) EVT_WIZARD_HELP(wxID_ANY, wxWizard::OnWizEvent)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxWizard, wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxWizard, wxDialog)
@@ -129,8 +129,8 @@ bool wxWizardPage::Create(wxWizard *parent,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxChar *resource) const wxChar *resource)
{ {
if ( !wxPanel::Create(parent, -1) ) if ( !wxPanel::Create(parent, wxID_ANY) )
return FALSE; return false;
if ( resource != NULL ) if ( resource != NULL )
{ {
@@ -149,7 +149,7 @@ bool wxWizardPage::Create(wxWizard *parent,
// initially the page is hidden, it's shown only when it becomes current // initially the page is hidden, it's shown only when it becomes current
Hide(); Hide();
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -312,7 +312,7 @@ void wxWizard::AddBitmapRow(wxBoxSizer *mainColumn)
#if wxUSE_STATBMP #if wxUSE_STATBMP
if ( m_bitmap.Ok() ) if ( m_bitmap.Ok() )
{ {
m_statbmp = new wxStaticBitmap(this, -1, m_bitmap); m_statbmp = new wxStaticBitmap(this, wxID_ANY, m_bitmap);
m_sizerBmpAndPage->Add( m_sizerBmpAndPage->Add(
m_statbmp, m_statbmp,
0, // No horizontal stretching 0, // No horizontal stretching
@@ -335,7 +335,7 @@ void wxWizard::AddStaticLine(wxBoxSizer *mainColumn)
{ {
#if wxUSE_STATLINE #if wxUSE_STATLINE
mainColumn->Add( mainColumn->Add(
new wxStaticLine(this, -1), new wxStaticLine(this, wxID_ANY),
0, // Vertically unstretchable 0, // Vertically unstretchable
wxEXPAND | wxALL, // Border all around, horizontally stretchable wxEXPAND | wxALL, // Border all around, horizontally stretchable
5 // Border width 5 // Border width
@@ -490,14 +490,14 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
// we'll use this to decide whether we have to change the label of this // we'll use this to decide whether we have to change the label of this
// button or not (initially the label is "Next") // button or not (initially the label is "Next")
bool btnLabelWasNext = TRUE; bool btnLabelWasNext = true;
// Modified 10-20-2001 Robert Cavanaugh. // Modified 10-20-2001 Robert Cavanaugh.
// Fixed bug for displaying a new bitmap // Fixed bug for displaying a new bitmap
// in each *consecutive* page // in each *consecutive* page
// flag to indicate if this page uses a new bitmap // flag to indicate if this page uses a new bitmap
bool bmpIsDefault = TRUE; bool bmpIsDefault = true;
// use these labels to determine if we need to change the bitmap // use these labels to determine if we need to change the bitmap
// for this page // for this page
@@ -512,7 +512,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
!event.IsAllowed() ) !event.IsAllowed() )
{ {
// vetoed by the page // vetoed by the page
return FALSE; return false;
} }
m_page->Hide(); m_page->Hide();
@@ -537,10 +537,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
// and notify the user code (this is especially useful for modeless // and notify the user code (this is especially useful for modeless
// wizards) // wizards)
wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), FALSE, 0); wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), false, 0);
(void)GetEventHandler()->ProcessEvent(event); (void)GetEventHandler()->ProcessEvent(event);
return TRUE; return true;
} }
// position and show the new page // position and show the new page
@@ -554,7 +554,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
if ( m_page->GetBitmap().Ok() ) if ( m_page->GetBitmap().Ok() )
{ {
bmpCur = m_page->GetBitmap(); bmpCur = m_page->GetBitmap();
bmpIsDefault = FALSE; bmpIsDefault = false;
} }
#if wxUSE_STATBMP #if wxUSE_STATBMP
@@ -596,12 +596,12 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
m_page->Show(); m_page->Show();
m_page->SetFocus(); m_page->SetFocus();
return TRUE; return true;
} }
bool wxWizard::RunWizard(wxWizardPage *firstPage) bool wxWizard::RunWizard(wxWizardPage *firstPage)
{ {
wxCHECK_MSG( firstPage, FALSE, wxT("can't run empty wizard") ); wxCHECK_MSG( firstPage, false, wxT("can't run empty wizard") );
// Set before FinishLayout to enable wxWizardSizer::GetMaxChildSize // Set before FinishLayout to enable wxWizardSizer::GetMaxChildSize
m_started = true; m_started = true;
@@ -610,8 +610,8 @@ bool wxWizard::RunWizard(wxWizardPage *firstPage)
// up to this moment // up to this moment
FinishLayout(); FinishLayout();
// can't return FALSE here because there is no old page // can't return false here because there is no old page
(void)ShowPage(firstPage, TRUE /* forward */); (void)ShowPage(firstPage, true /* forward */);
return ShowModal() == wxID_OK; return ShowModal() == wxID_OK;
} }
@@ -665,7 +665,7 @@ void wxWizard::OnCancel(wxCommandEvent& WXUNUSED(eventUnused))
// page, but a small extra check won't hurt // page, but a small extra check won't hurt
wxWindow *win = m_page ? (wxWindow *)m_page : (wxWindow *)this; wxWindow *win = m_page ? (wxWindow *)m_page : (wxWindow *)this;
wxWizardEvent event(wxEVT_WIZARD_CANCEL, GetId(), FALSE, m_page); wxWizardEvent event(wxEVT_WIZARD_CANCEL, GetId(), false, m_page);
if ( !win->GetEventHandler()->ProcessEvent(event) || event.IsAllowed() ) if ( !win->GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
{ {
// no objections - close the dialog // no objections - close the dialog
@@ -716,7 +716,7 @@ void wxWizard::OnHelp(wxCommandEvent& WXUNUSED(event))
// Create and send the help event to the specific page handler // Create and send the help event to the specific page handler
// event data contains the active page so that context-sensitive // event data contains the active page so that context-sensitive
// help is possible // help is possible
wxWizardEvent eventHelp(wxEVT_WIZARD_HELP, GetId(), TRUE, m_page); wxWizardEvent eventHelp(wxEVT_WIZARD_HELP, GetId(), true, m_page);
(void)m_page->GetEventHandler()->ProcessEvent(eventHelp); (void)m_page->GetEventHandler()->ProcessEvent(eventHelp);
} }
} }