Cleaning of sources (Univ related files). -1/TRUE/FALSE/wxIDY_ANY/wxDefaultCoord/whitespaces/!! issues.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-08-10 13:08:43 +00:00
parent 981a627100
commit a290fa5a7d
66 changed files with 730 additions and 741 deletions

View File

@@ -49,9 +49,9 @@ public:
wxBitmapButtonBase::SetMargins(x, y); wxBitmapButtonBase::SetMargins(x, y);
} }
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
virtual bool SetCurrent(bool doit = TRUE); virtual bool SetCurrent(bool doit = true);
virtual void Press(); virtual void Press();
virtual void Release(); virtual void Release();
@@ -64,7 +64,7 @@ protected:
virtual void OnSetBitmap(); virtual void OnSetBitmap();
// set bitmap to the given one if it's ok or to m_bmpNormal and return // set bitmap to the given one if it's ok or to m_bmpNormal and return
// TRUE if the bitmap really changed // true if the bitmap really changed
bool ChangeBitmap(const wxBitmap& bmp); bool ChangeBitmap(const wxBitmap& bmp);
private: private:

View File

@@ -113,7 +113,7 @@ protected:
virtual bool DoDrawBackground(wxDC& dc); virtual bool DoDrawBackground(wxDC& dc);
virtual void DoDraw(wxControlRenderer *renderer); virtual void DoDraw(wxControlRenderer *renderer);
virtual bool CanBeHighlighted() const { return TRUE; } virtual bool CanBeHighlighted() const { return true; }
// common part of all ctors // common part of all ctors
void Init(); void Init();

View File

@@ -22,8 +22,8 @@
// the actions supported by wxCheckBox // the actions supported by wxCheckBox
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#define wxACTION_CHECKBOX_CHECK _T("check") // SetValue(TRUE) #define wxACTION_CHECKBOX_CHECK _T("check") // SetValue(true)
#define wxACTION_CHECKBOX_CLEAR _T("clear") // SetValue(FALSE) #define wxACTION_CHECKBOX_CLEAR _T("clear") // SetValue(false)
#define wxACTION_CHECKBOX_TOGGLE _T("toggle") // toggle the check state #define wxACTION_CHECKBOX_TOGGLE _T("toggle") // toggle the check state
// additionally it accepts wxACTION_BUTTON_PRESS and RELEASE // additionally it accepts wxACTION_BUTTON_PRESS and RELEASE
@@ -101,7 +101,7 @@ public:
// overridden base class virtuals // overridden base class virtuals
virtual bool IsPressed() const { return m_isPressed; } virtual bool IsPressed() const { return m_isPressed; }
virtual bool HasTransparentBackground() { return TRUE; } virtual bool HasTransparentBackground() { return true; }
protected: protected:
virtual bool PerformAction(const wxControlAction& action, virtual bool PerformAction(const wxControlAction& action,
@@ -110,7 +110,7 @@ protected:
virtual void DoDraw(wxControlRenderer *renderer); virtual void DoDraw(wxControlRenderer *renderer);
virtual wxSize DoGetBestClientSize() const; virtual wxSize DoGetBestClientSize() const;
virtual bool CanBeHighlighted() const { return TRUE; } virtual bool CanBeHighlighted() const { return true; }
// get the size of the bitmap using either the current one or the default // get the size of the bitmap using either the current one or the default
// one (query renderer then) // one (query renderer then)

View File

@@ -75,7 +75,7 @@ public:
// implement check list box methods // implement check list box methods
virtual bool IsChecked(size_t item) const; virtual bool IsChecked(size_t item) const;
virtual void Check(size_t item, bool check = TRUE); virtual void Check(size_t item, bool check = true);
// and input handling // and input handling
virtual bool PerformAction(const wxControlAction& action, virtual bool PerformAction(const wxControlAction& action,

View File

@@ -77,7 +77,7 @@ public:
// called before showing the control to set the initial selection - notice // called before showing the control to set the initial selection - notice
// that the text passed to this method might not correspond to any valid // that the text passed to this method might not correspond to any valid
// item (if the user edited it directly), in which case the method should // item (if the user edited it directly), in which case the method should
// just return FALSE but not emit any errors // just return false but not emit any errors
virtual bool SetSelection(const wxString& value) = 0; virtual bool SetSelection(const wxString& value) = 0;
// called immediately after the control is shown // called immediately after the control is shown
@@ -137,7 +137,7 @@ public:
void ShowPopup(); void ShowPopup();
void HidePopup(); void HidePopup();
// return TRUE if the popup is currently shown // return true if the popup is currently shown
bool IsPopupShown() const { return m_isPopupShown; } bool IsPopupShown() const { return m_isPopupShown; }
// get the popup window containing the popup control // get the popup window containing the popup control
@@ -159,8 +159,8 @@ public:
virtual void OnDismiss(); virtual void OnDismiss();
// 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);
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip ); virtual void DoSetToolTip( wxToolTip *tip );

View File

@@ -49,16 +49,16 @@ public:
// is the dialog in modal state right now? // is the dialog in modal state right now?
virtual bool IsModal() const; virtual bool IsModal() const;
// For now, same as Show(TRUE) but returns return code // For now, same as Show(true) but returns return code
virtual int ShowModal(); virtual int ShowModal();
// may be called to terminate the dialog with the given return code // may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode); virtual void EndModal(int retCode);
// returns TRUE if we're in a modal loop // returns true if we're in a modal loop
bool IsModalShowing() const; bool IsModalShowing() const;
bool Show(bool show = TRUE); bool Show(bool show = true);
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------

View File

@@ -44,7 +44,7 @@ public:
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual wxPoint GetClientAreaOrigin() const; virtual wxPoint GetClientAreaOrigin() const;
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number = 1, virtual wxStatusBar* CreateStatusBar(int number = 1,
@@ -56,7 +56,7 @@ public:
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
// create main toolbar bycalling OnCreateToolBar() // create main toolbar bycalling OnCreateToolBar()
virtual wxToolBar* CreateToolBar(long style = -1, virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxString& name = wxToolBarNameStr); const wxString& name = wxToolBarNameStr);
virtual void PositionToolBar(); virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR

View File

@@ -47,8 +47,8 @@
class WXDLLEXPORT wxInputHandler : public wxObject class WXDLLEXPORT wxInputHandler : public wxObject
{ {
public: public:
// map a keyboard event to one or more actions (pressed == TRUE if the key // map a keyboard event to one or more actions (pressed == true if the key
// was pressed, FALSE if released), returns TRUE if something was done // was pressed, false if released), returns true if something was done
virtual bool HandleKey(wxInputConsumer *consumer, virtual bool HandleKey(wxInputConsumer *consumer,
const wxKeyEvent& event, const wxKeyEvent& event,
bool pressed) = 0; bool pressed) = 0;
@@ -67,12 +67,12 @@ public:
// HandleMouseMove() as the mouse maybe over the control without it having // HandleMouseMove() as the mouse maybe over the control without it having
// focus // focus
// //
// return TRUE to refresh the control, FALSE otherwise // return true to refresh the control, false otherwise
virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event);
// react to the app getting/losing activation // react to the app getting/losing activation
// //
// return TRUE to refresh the control, FALSE otherwise // return true to refresh the control, false otherwise
virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); virtual bool HandleActivation(wxInputConsumer *consumer, bool activated);
// virtual dtor for any base class // virtual dtor for any base class
@@ -94,23 +94,23 @@ public:
bool pressed) bool pressed)
{ {
return m_handler ? m_handler->HandleKey(consumer, event, pressed) return m_handler ? m_handler->HandleKey(consumer, event, pressed)
: FALSE; : false;
} }
virtual bool HandleMouse(wxInputConsumer *consumer, virtual bool HandleMouse(wxInputConsumer *consumer,
const wxMouseEvent& event) const wxMouseEvent& event)
{ {
return m_handler ? m_handler->HandleMouse(consumer, event) : FALSE; return m_handler ? m_handler->HandleMouse(consumer, event) : false;
} }
virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event) virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event)
{ {
return m_handler ? m_handler->HandleMouseMove(consumer, event) : FALSE; return m_handler ? m_handler->HandleMouseMove(consumer, event) : false;
} }
virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event) virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event)
{ {
return m_handler ? m_handler->HandleFocus(consumer, event) : FALSE; return m_handler ? m_handler->HandleFocus(consumer, event) : false;
} }
private: private:

View File

@@ -110,7 +110,7 @@ public:
virtual bool IsSelected(int n) const virtual bool IsSelected(int n) const
{ return m_selections.Index(n) != wxNOT_FOUND; } { return m_selections.Index(n) != wxNOT_FOUND; }
virtual void SetSelection(int n, bool select = TRUE); virtual void SetSelection(int n, bool select = true);
virtual int GetSelection() const; virtual int GetSelection() const;
virtual int GetSelections(wxArrayInt& aSelections) const; virtual int GetSelections(wxArrayInt& aSelections) const;
@@ -147,10 +147,10 @@ public:
void Activate(int item = -1); void Activate(int item = -1);
// select or unselect the specified or current (if -1) item // select or unselect the specified or current (if -1) item
void DoSelect(int item = -1, bool sel = TRUE); void DoSelect(int item = -1, bool sel = true);
// more readable wrapper // more readable wrapper
void DoUnselect(int item) { DoSelect(item, FALSE); } void DoUnselect(int item) { DoSelect(item, false); }
// select an item and send a notification about it // select an item and send a notification about it
void SelectAndNotify(int item); void SelectAndNotify(int item);
@@ -159,10 +159,10 @@ public:
virtual void EnsureVisible(int n); virtual void EnsureVisible(int n);
// find the first item [strictly] after the current one which starts with // find the first item [strictly] after the current one which starts with
// the given string and make it the current one, return TRUE if the current // the given string and make it the current one, return true if the current
// item changed // item changed
bool FindItem(const wxString& prefix, bool strictlyAfter = FALSE); bool FindItem(const wxString& prefix, bool strictlyAfter = false);
bool FindNextItem(const wxString& prefix) { return FindItem(prefix, TRUE); } bool FindNextItem(const wxString& prefix) { return FindItem(prefix, true); }
// extend the selection to span the range from the anchor (see below) to // extend the selection to span the range from the anchor (see below) to
// the specified or current item // the specified or current item
@@ -306,11 +306,11 @@ class WXDLLEXPORT wxStdListboxInputHandler : public wxStdInputHandler
{ {
public: public:
// if pressing the mouse button in a multiselection listbox should toggle // if pressing the mouse button in a multiselection listbox should toggle
// the item under mouse immediately, then specify TRUE as the second // the item under mouse immediately, then specify true as the second
// parameter (this is the standard behaviour, under GTK the item is toggled // parameter (this is the standard behaviour, under GTK the item is toggled
// only when the mouse is released in the multi selection listbox) // only when the mouse is released in the multi selection listbox)
wxStdListboxInputHandler(wxInputHandler *inphand, wxStdListboxInputHandler(wxInputHandler *inphand,
bool toggleOnPressAlways = TRUE); bool toggleOnPressAlways = true);
// base class methods // base class methods
virtual bool HandleKey(wxInputConsumer *consumer, virtual bool HandleKey(wxInputConsumer *consumer,
@@ -328,7 +328,7 @@ protected:
// parts of HitTest(): first finds the pseudo (because not in range) index // parts of HitTest(): first finds the pseudo (because not in range) index
// of the item and the second one adjusts it if necessary - that is if the // of the item and the second one adjusts it if necessary - that is if the
// third one returns FALSE // third one returns false
int HitTestUnsafe(const wxListBox *listbox, const wxMouseEvent& event); int HitTestUnsafe(const wxListBox *listbox, const wxMouseEvent& event);
int FixItemIndex(const wxListBox *listbox, int item); int FixItemIndex(const wxListBox *listbox, int item);
bool IsValidIndex(const wxListBox *listbox, int item); bool IsValidIndex(const wxListBox *listbox, int item);

View File

@@ -54,7 +54,7 @@ public:
// show this menu at the given position (in screen coords) and optionally // show this menu at the given position (in screen coords) and optionally
// select its first item // select its first item
void Popup(const wxPoint& pos, const wxSize& size, void Popup(const wxPoint& pos, const wxSize& size,
bool selectFirst = TRUE); bool selectFirst = true);
// dismiss the menu // dismiss the menu
void Dismiss(); void Dismiss();
@@ -65,11 +65,11 @@ public:
// implementation only from here // implementation only from here
// do as if this item were clicked, return TRUE if the resulting event was // do as if this item were clicked, return true if the resulting event was
// processed, FALSE otherwise // processed, false otherwise
bool ClickItem(wxMenuItem *item); bool ClickItem(wxMenuItem *item);
// process the key event, return TRUE if done // process the key event, return true if done
bool ProcessKeyDown(int key); bool ProcessKeyDown(int key);
#if wxUSE_ACCEL #if wxUSE_ACCEL
@@ -167,8 +167,8 @@ public:
// get the next item for the givan accel letter (used by wxFrame), return // get the next item for the givan accel letter (used by wxFrame), return
// -1 if none // -1 if none
// //
// if unique is not NULL, filled with TRUE if there is only one item with // if unique is not NULL, filled with true if there is only one item with
// this accel, FALSE if two or more // this accel, false if two or more
int FindNextItemForAccel(int idxStart, int FindNextItemForAccel(int idxStart,
int keycode, int keycode,
bool *unique = NULL) const; bool *unique = NULL) const;
@@ -183,7 +183,7 @@ public:
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
// called by wxMenu when it is dismissed // called by wxMenu when it is dismissed
void OnDismissMenu(bool dismissMenuBar = FALSE); void OnDismissMenu(bool dismissMenuBar = false);
protected: protected:
// common part of all ctors // common part of all ctors
@@ -195,7 +195,7 @@ protected:
void OnKeyDown(wxKeyEvent& event); void OnKeyDown(wxKeyEvent& event);
void OnKillFocus(wxFocusEvent& event); void OnKillFocus(wxFocusEvent& event);
// process the mouse move event, return TRUE if we did, FALSE to continue // process the mouse move event, return true if we did, false to continue
// processing as usual // processing as usual
// //
// the coordinates are client coordinates of menubar, convert if necessary // the coordinates are client coordinates of menubar, convert if necessary
@@ -236,7 +236,7 @@ protected:
void DoSelectMenu(size_t pos); void DoSelectMenu(size_t pos);
// popup the currently selected menu // popup the currently selected menu
void PopupCurrentMenu(bool selectFirst = TRUE); void PopupCurrentMenu(bool selectFirst = true);
// hide the currently selected menu // hide the currently selected menu
void DismissMenu(); void DismissMenu();

View File

@@ -36,8 +36,8 @@ public:
virtual void SetText(const wxString& text); virtual void SetText(const wxString& text);
virtual void SetCheckable(bool checkable); virtual void SetCheckable(bool checkable);
virtual void Enable(bool enable = TRUE); virtual void Enable(bool enable = true);
virtual void Check(bool check = TRUE); virtual void Check(bool check = true);
// we add some extra functions which are also available under MSW from // we add some extra functions which are also available under MSW from
// wxOwnerDrawn class - they will be moved to wxMenuItemBase later // wxOwnerDrawn class - they will be moved to wxMenuItemBase later
@@ -45,7 +45,7 @@ public:
void SetBitmaps(const wxBitmap& bmpChecked, void SetBitmaps(const wxBitmap& bmpChecked,
const wxBitmap& bmpUnchecked = wxNullBitmap); const wxBitmap& bmpUnchecked = wxNullBitmap);
void SetBitmap(const wxBitmap& bmp) { SetBitmaps(bmp); } void SetBitmap(const wxBitmap& bmp) { SetBitmaps(bmp); }
const wxBitmap& GetBitmap(bool checked = TRUE) const const wxBitmap& GetBitmap(bool checked = true) const
{ return checked ? m_bmpChecked : m_bmpUnchecked; } { return checked ? m_bmpChecked : m_bmpUnchecked; }
void SetDisabledBitmap( const wxBitmap& bmpDisabled ) void SetDisabledBitmap( const wxBitmap& bmpDisabled )
@@ -76,14 +76,14 @@ public:
wxCoord GetPosition() const wxCoord GetPosition() const
{ {
wxASSERT_MSG( m_posY != -1, _T("must call SetHeight first!") ); wxASSERT_MSG( m_posY != wxDefaultCoord, _T("must call SetHeight first!") );
return m_posY; return m_posY;
} }
wxCoord GetHeight() const wxCoord GetHeight() const
{ {
wxASSERT_MSG( m_height != -1, _T("must call SetHeight first!") ); wxASSERT_MSG( m_height != wxDefaultCoord, _T("must call SetHeight first!") );
return m_height; return m_height;
} }
@@ -102,7 +102,7 @@ protected:
// the positions of the first and last items of the radio group this item // the positions of the first and last items of the radio group this item
// belongs to or -1: start is the radio group start and is valid for all // belongs to or -1: start is the radio group start and is valid for all
// but first radio group items (m_isRadioGroupStart == FALSE), end is valid // but first radio group items (m_isRadioGroupStart == false), end is valid
// only for the first one // only for the first one
union union
{ {

View File

@@ -87,19 +87,19 @@ public:
virtual bool InsertPage(size_t nPage, virtual 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);
// style tests // style tests
// ----------- // -----------
// return TRUE if all tabs have the same width // return true if all tabs have the same width
bool FixedSizeTabs() const { return HasFlag(wxNB_FIXEDWIDTH); } bool FixedSizeTabs() const { return HasFlag(wxNB_FIXEDWIDTH); }
// return wxTOP/wxBOTTOM/wxRIGHT/wxLEFT // return wxTOP/wxBOTTOM/wxRIGHT/wxLEFT
wxDirection GetTabOrientation() const; wxDirection GetTabOrientation() const;
// return TRUE if the notebook has tabs at the sidesand not at the top (or // return true if the notebook has tabs at the sidesand not at the top (or
// bottom) as usual // bottom) as usual
bool IsVertical() const; bool IsVertical() const;
@@ -155,7 +155,7 @@ protected:
void PositionSpinBtn(); void PositionSpinBtn();
// refresh the given tab only // refresh the given tab only
void RefreshTab(int page, bool forceSelected = FALSE); void RefreshTab(int page, bool forceSelected = false);
// refresh all tabs // refresh all tabs
void RefreshAllTabs(); void RefreshAllTabs();
@@ -180,7 +180,7 @@ protected:
wxCoord GetTabWidth(int page) const wxCoord GetTabWidth(int page) const
{ return FixedSizeTabs() ? m_widthMax : m_widths[page]; } { return FixedSizeTabs() ? m_widthMax : m_widths[page]; }
// return TRUE if the tab has an associated image // return true if the tab has an associated image
bool HasImage(int page) const bool HasImage(int page) const
{ return m_imageList && m_images[page] != -1; } { return m_imageList && m_images[page] != -1; }

View File

@@ -95,12 +95,12 @@ public:
virtual wxString GetString(int n) const; virtual wxString GetString(int n) const;
virtual void SetString(int n, const wxString& label); virtual void SetString(int n, const wxString& label);
virtual void Enable(int n, bool enable = TRUE); virtual void Enable(int n, bool enable = true);
virtual void Show(int n, bool show = TRUE); virtual void Show(int n, bool show = true);
// we also override the wxControl methods to avoid virtual function hiding // we also override the wxControl methods to avoid virtual function hiding
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = true);
virtual wxString GetLabel() const; virtual wxString GetLabel() const;
virtual void SetLabel(const wxString& label); virtual void SetLabel(const wxString& label);

View File

@@ -897,7 +897,7 @@ private:
// common part of DrawItems() and DrawCheckItems() // common part of DrawItems() and DrawCheckItems()
void DoDrawItems(const wxListBox *listbox, void DoDrawItems(const wxListBox *listbox,
size_t itemFirst, size_t itemLast, size_t itemFirst, size_t itemLast,
bool isCheckLbox = FALSE); bool isCheckLbox = false);
wxWindow *m_window; wxWindow *m_window;
wxRenderer *m_renderer; wxRenderer *m_renderer;

View File

@@ -54,7 +54,7 @@ public:
// draws the arrow on the given DC in the given rectangle, uses // draws the arrow on the given DC in the given rectangle, uses
// wxControlWithArrows::GetArrowState() to get its current state // wxControlWithArrows::GetArrowState() to get its current state
void DrawArrow(Arrow arrow, wxDC& dc, const wxRect& rect, void DrawArrow(Arrow arrow, wxDC& dc, const wxRect& rect,
bool scrollbarLike = FALSE) const; bool scrollbarLike = false) const;
// process a mouse move, enter or leave event, possibly calling // process a mouse move, enter or leave event, possibly calling
// wxControlWithArrows::SetArrowState() if wxControlWithArrows::HitTest() // wxControlWithArrows::SetArrowState() if wxControlWithArrows::HitTest()
@@ -100,13 +100,13 @@ public:
// set or clear the specified flag in the arrow state: this function is // set or clear the specified flag in the arrow state: this function is
// responsible for refreshing the control // responsible for refreshing the control
virtual void SetArrowFlag(wxScrollArrows::Arrow arrow, virtual void SetArrowFlag(wxScrollArrows::Arrow arrow,
int flag, bool set = TRUE) = 0; int flag, bool set = true) = 0;
// hit testing: return on which arrow the point is (or Arrow_None) // hit testing: return on which arrow the point is (or Arrow_None)
virtual wxScrollArrows::Arrow HitTest(const wxPoint& pt) const = 0; virtual wxScrollArrows::Arrow HitTest(const wxPoint& pt) const = 0;
// called when the arrow is pressed, return TRUE to continue scrolling and // called when the arrow is pressed, return true to continue scrolling and
// FALSE to stop it // false to stop it
virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0; virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0;
}; };

View File

@@ -88,7 +88,7 @@ public:
virtual void SetThumbPosition(int thumbPos); virtual void SetThumbPosition(int thumbPos);
virtual void SetScrollbar(int position, int thumbSize, virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize, int range, int pageSize,
bool refresh = TRUE); bool refresh = true);
// wxScrollBar actions // wxScrollBar actions
void ScrollToStart(); void ScrollToStart();
@@ -128,7 +128,7 @@ protected:
virtual void DoDraw(wxControlRenderer *renderer); virtual void DoDraw(wxControlRenderer *renderer);
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
// forces update of thumb's visual appearence (does nothing if m_dirty=FALSE) // forces update of thumb's visual appearence (does nothing if m_dirty=false)
void UpdateThumb(); void UpdateThumb();
// SetThumbPosition() helper // SetThumbPosition() helper
@@ -192,14 +192,14 @@ public:
// this method is called by wxScrollBarTimer only and may be overridden // this method is called by wxScrollBarTimer only and may be overridden
// //
// return TRUE to continue scrolling, FALSE to stop the timer // return true to continue scrolling, false to stop the timer
virtual bool OnScrollTimer(wxScrollBar *scrollbar, virtual bool OnScrollTimer(wxScrollBar *scrollbar,
const wxControlAction& action); const wxControlAction& action);
protected: protected:
// the methods which must be overridden in the derived class // the methods which must be overridden in the derived class
// return TRUE if the mouse button can be used to activate scrollbar, FALSE // return true if the mouse button can be used to activate scrollbar, false
// if not (only left mouse button can do it under Windows, any button under // if not (only left mouse button can do it under Windows, any button under
// GTK+) // GTK+)
virtual bool IsAllowedButton(int button) = 0; virtual bool IsAllowedButton(int button) = 0;

View File

@@ -118,7 +118,7 @@ public:
// responsible for refreshing the control // responsible for refreshing the control
virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart, virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
int flag, int flag,
bool set = TRUE) = 0; bool set = true) = 0;
// called when the user starts dragging the thumb // called when the user starts dragging the thumb
virtual void OnThumbDragStart(int pos) = 0; virtual void OnThumbDragStart(int pos) = 0;
@@ -134,7 +134,7 @@ public:
virtual void OnPageScrollStart() = 0; virtual void OnPageScrollStart() = 0;
// called while the user keeps the mouse pressed above/below the thumb, // called while the user keeps the mouse pressed above/below the thumb,
// return TRUE to continue scrollign and FALSE to stop it (e.g. because the // return true to continue scrollign and false to stop it (e.g. because the
// scrollbar has reached the top/bottom) // scrollbar has reached the top/bottom)
virtual bool OnPageScroll(int pageInc) = 0; virtual bool OnPageScroll(int pageInc) = 0;
}; };

View File

@@ -32,7 +32,7 @@ public:
protected: protected:
// to implement in derived classes: perform the scroll action and return // to implement in derived classes: perform the scroll action and return
// TRUE to continue scrolling or FALSE to stop // true to continue scrolling or false to stop
virtual bool DoNotify() = 0; virtual bool DoNotify() = 0;
// should we skip the next timer event? // should we skip the next timer event?

View File

@@ -114,7 +114,7 @@ public:
virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart, virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
int flag, int flag,
bool set = TRUE); bool set = true);
virtual void OnThumbDragStart(int pos); virtual void OnThumbDragStart(int pos);
virtual void OnThumbDrag(int pos); virtual void OnThumbDrag(int pos);
@@ -149,7 +149,7 @@ protected:
// normalize the value to fit in the range // normalize the value to fit in the range
int NormalizeValue(int value) const; int NormalizeValue(int value) const;
// change the value by the given increment, return TRUE if really changed // change the value by the given increment, return true if really changed
bool ChangeValueBy(int inc); bool ChangeValueBy(int inc);
// change the value to the given one // change the value to the given one

View File

@@ -32,14 +32,14 @@ class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase,
public: public:
wxSpinButton(); wxSpinButton();
wxSpinButton(wxWindow *parent, wxSpinButton(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
const wxString& name = wxSPIN_BUTTON_NAME); const wxString& name = wxSPIN_BUTTON_NAME);
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
@@ -77,7 +77,7 @@ protected:
// normalize the value to fit into min..max range // normalize the value to fit into min..max range
int NormalizeValue(int value) const; int NormalizeValue(int value) const;
// change the value by +1/-1 and send the event, return TRUE if value was // change the value by +1/-1 and send the event, return true if value was
// changed // changed
bool ChangeValue(int inc); bool ChangeValue(int inc);

View File

@@ -35,7 +35,7 @@ public:
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0) long style = 0)
{ {
Create(parent, -1, label, pos, size, style); Create(parent, wxID_ANY, label, pos, size, style);
} }
wxStaticBitmap(wxWindow *parent, wxStaticBitmap(wxWindow *parent,
@@ -63,7 +63,7 @@ public:
wxIcon GetIcon() const; wxIcon GetIcon() const;
virtual bool HasTransparentBackground() { return TRUE; } virtual bool HasTransparentBackground() { return true; }
private: private:
virtual void DoDraw(wxControlRenderer *renderer); virtual void DoDraw(wxControlRenderer *renderer);

View File

@@ -26,7 +26,7 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize) const wxSize& size = wxDefaultSize)
{ {
Create(parent, -1, label, pos, size); Create(parent, wxID_ANY, label, pos, size);
} }
wxStaticBox(wxWindow *parent, wxWindowID id, wxStaticBox(wxWindow *parent, wxWindowID id,
@@ -51,7 +51,7 @@ public:
// take account of this // take account of this
virtual wxPoint GetBoxAreaOrigin() const; virtual wxPoint GetBoxAreaOrigin() const;
virtual bool HasTransparentBackground() { return TRUE; } virtual bool HasTransparentBackground() { return true; }
protected: protected:
// draw the control // draw the control
@@ -60,9 +60,9 @@ protected:
// get the size of the border // get the size of the border
wxRect GetBorderGeometry() const; wxRect GetBorderGeometry() const;
// returning TRUE from here ensures that we act as a container window for // returning true from here ensures that we act as a container window for
// our children // our children
virtual bool IsStaticBox() const { return TRUE; } virtual bool IsStaticBox() const { return true; }
private: private:
DECLARE_DYNAMIC_CLASS(wxStaticBox) DECLARE_DYNAMIC_CLASS(wxStaticBox)

View File

@@ -26,9 +26,9 @@ public:
wxCoord length, wxCoord length,
long style = wxLI_HORIZONTAL) long style = wxLI_HORIZONTAL)
{ {
Create(parent, -1, pos, Create(parent, wxID_ANY, pos,
style & wxLI_VERTICAL ? wxSize(-1, length) style & wxLI_VERTICAL ? wxSize(wxDefaultCoord, length)
: wxSize(length, -1), : wxSize(length, wxDefaultCoord),
style); style);
} }

View File

@@ -27,7 +27,7 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize) const wxSize& size = wxDefaultSize)
{ {
Create(parent, -1, label, pos, size, 0, wxStaticTextNameStr); Create(parent, wxID_ANY, label, pos, size, 0, wxStaticTextNameStr);
} }
// full form // full form
@@ -55,9 +55,9 @@ public:
virtual void SetLabel(const wxString& label); virtual void SetLabel(const wxString& label);
virtual bool HasTransparentBackground() { return TRUE; } virtual bool HasTransparentBackground() { return true; }
virtual bool IsFocused() const { return FALSE; } virtual bool IsFocused() const { return false; }
protected: protected:
// calculate the optimal size for the label // calculate the optimal size for the label

View File

@@ -30,7 +30,7 @@ public:
wxStatusBarUniv() { Init(); } wxStatusBarUniv() { Init(); }
wxStatusBarUniv(wxWindow *parent, wxStatusBarUniv(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
long style = 0, long style = 0,
const wxString& name = wxPanelNameStr) const wxString& name = wxPanelNameStr)
{ {
@@ -40,7 +40,7 @@ public:
} }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
long style = 0, long style = 0,
const wxString& name = wxPanelNameStr); const wxString& name = wxPanelNameStr);

View File

@@ -176,8 +176,8 @@ public:
// ----------------------- // -----------------------
// caret stuff // caret stuff
virtual void ShowCaret(bool show = TRUE); virtual void ShowCaret(bool show = true);
void HideCaret() { ShowCaret(FALSE); } void HideCaret() { ShowCaret(false); }
void CreateCaret(); // for the current font size void CreateCaret(); // for the current font size
// helpers for cursor movement // helpers for cursor movement
@@ -231,7 +231,7 @@ public:
// override these methods to handle the caret // override these methods to handle the caret
virtual bool SetFont(const wxFont &font); virtual bool SetFont(const wxFont &font);
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
// more readable flag testing methods // more readable flag testing methods
bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; } bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; }
@@ -295,7 +295,7 @@ protected:
wxRect GetRealTextArea() const; wxRect GetRealTextArea() const;
// refresh the text in the given (in logical coords) rect // refresh the text in the given (in logical coords) rect
void RefreshTextRect(const wxRect& rect, bool textOnly = TRUE); void RefreshTextRect(const wxRect& rect, bool textOnly = true);
// refresh the line wrap marks for the given range of lines (inclusive) // refresh the line wrap marks for the given range of lines (inclusive)
void RefreshLineWrapMarks(wxTextCoord rowFirst, wxTextCoord rowLast); void RefreshLineWrapMarks(wxTextCoord rowFirst, wxTextCoord rowLast);
@@ -330,7 +330,7 @@ protected:
wxCoord *widthReal = NULL) const; wxCoord *widthReal = NULL) const;
// get the start and end of the selection for this line: if the line is // get the start and end of the selection for this line: if the line is
// outside the selection, both will be -1 and FALSE will be returned // outside the selection, both will be -1 and false will be returned
bool GetSelectedPartOfLine(wxTextCoord line, bool GetSelectedPartOfLine(wxTextCoord line,
wxTextPos *start, wxTextPos *end) const; wxTextPos *start, wxTextPos *end) const;
@@ -377,7 +377,7 @@ protected:
wxTextCoord *colStart, wxTextCoord *colStart,
wxTextCoord *colEnd, wxTextCoord *colEnd,
wxTextCoord *colRowStart, wxTextCoord *colRowStart,
bool devCoords = TRUE) const; bool devCoords = true) const;
// HitTest() version which takes the logical text coordinates and not the // HitTest() version which takes the logical text coordinates and not the
// device ones // device ones
@@ -386,7 +386,7 @@ protected:
wxTextCoord *row) const; wxTextCoord *row) const;
// get the line and the row in this line corresponding to the given row, // get the line and the row in this line corresponding to the given row,
// return TRUE if ok and FALSE if row is out of range // return true if ok and false if row is out of range
// //
// NB: this function can only be called for controls which wrap lines // NB: this function can only be called for controls which wrap lines
bool GetLineAndRow(wxTextCoord row, bool GetLineAndRow(wxTextCoord row,
@@ -456,7 +456,7 @@ private:
inline const wxArrayString& GetLines() const; inline const wxArrayString& GetLines() const;
inline size_t GetLineCount() const; inline size_t GetLineCount() const;
// replace a line (returns TRUE if the number of rows in thel ine changed) // replace a line (returns true if the number of rows in thel ine changed)
bool ReplaceLine(wxTextCoord line, const wxString& text); bool ReplaceLine(wxTextCoord line, const wxString& text);
// remove a line // remove a line

View File

@@ -108,7 +108,7 @@ struct WXDLLEXPORT wxThemeInfo
WXDLLEXPORT_DATA(extern bool) wxThemeUse##themename; \ WXDLLEXPORT_DATA(extern bool) wxThemeUse##themename; \
static struct wxThemeUserFor##themename \ static struct wxThemeUserFor##themename \
{ \ { \
wxThemeUserFor##themename() { wxThemeUse##themename = TRUE; } \ wxThemeUserFor##themename() { wxThemeUse##themename = true; } \
} wxThemeDoUse##themename } wxThemeDoUse##themename
// to declare a new theme, this macro must be used in the class declaration // to declare a new theme, this macro must be used in the class declaration
@@ -121,7 +121,7 @@ struct WXDLLEXPORT wxThemeInfo
// and this one must be inserted in the source file // and this one must be inserted in the source file
#define WX_IMPLEMENT_THEME(classname, themename, themedesc) \ #define WX_IMPLEMENT_THEME(classname, themename, themedesc) \
WXDLLEXPORT_DATA(bool) wxThemeUse##themename = TRUE; \ WXDLLEXPORT_DATA(bool) wxThemeUse##themename = true; \
wxTheme *wxCtorFor##themename() { return new classname; } \ wxTheme *wxCtorFor##themename() { return new classname; } \
wxThemeInfo classname::ms_info##themename(wxCtorFor##themename, \ wxThemeInfo classname::ms_info##themename(wxCtorFor##themename, \
wxT( #themename ), themedesc) wxT( #themename ), themedesc)

View File

@@ -110,7 +110,7 @@ protected:
void RefreshTool(wxToolBarToolBase *tool); void RefreshTool(wxToolBarToolBase *tool);
// (re)calculate the tool positions, should only be called if it is // (re)calculate the tool positions, should only be called if it is
// necessary to do it, i.e. m_needsLayout == TRUE // necessary to do it, i.e. m_needsLayout == true
void DoLayout(); void DoLayout();
// get the rect limits depending on the orientation: top/bottom for a // get the rect limits depending on the orientation: top/bottom for a

View File

@@ -143,7 +143,7 @@ public:
virtual int GetMinWidth() const; virtual int GetMinWidth() const;
virtual int GetMinHeight() const; virtual int GetMinHeight() const;
virtual bool ProvidesBackground() const { return TRUE; } virtual bool ProvidesBackground() const { return true; }
protected: protected:
// handle titlebar button click event // handle titlebar button click event
@@ -161,9 +161,9 @@ protected:
void OnNcPaint(wxNcPaintEvent& event); void OnNcPaint(wxNcPaintEvent& event);
void OnSystemMenu(wxCommandEvent& event); void OnSystemMenu(wxCommandEvent& event);
// TRUE if wxTLW should render decorations (aka titlebar) itself // true if wxTLW should render decorations (aka titlebar) itself
static int ms_drawDecorations; static int ms_drawDecorations;
// TRUE if wxTLW can be iconized // true if wxTLW can be iconized
static int ms_canIconize; static int ms_canIconize;
// true for currently active frame // true for currently active frame
bool m_isActive:1; bool m_isActive:1;

View File

@@ -91,8 +91,8 @@ public:
int pos, int pos,
int page, int page,
int range, int range,
bool refresh = TRUE ); bool refresh = true );
virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE); virtual void SetScrollPos(int orient, int pos, bool refresh = true);
virtual int GetScrollPos(int orient) const; virtual int GetScrollPos(int orient) const;
virtual int GetScrollThumb(int orient) const; virtual int GetScrollThumb(int orient) const;
virtual int GetScrollRange(int orient) const; virtual int GetScrollRange(int orient) const;
@@ -126,8 +126,8 @@ public:
// return all state flags at once (combination of wxCONTROL_XXX values) // return all state flags at once (combination of wxCONTROL_XXX values)
int GetStateFlags() const; int GetStateFlags() const;
// set the "highlighted" flag and return TRUE if it changed // set the "highlighted" flag and return true if it changed
virtual bool SetCurrent(bool doit = TRUE); virtual bool SetCurrent(bool doit = true);
// get the scrollbar (may be NULL) for the given orientation // get the scrollbar (may be NULL) for the given orientation
wxScrollBar *GetScrollbar(int orient) const wxScrollBar *GetScrollbar(int orient) const
@@ -138,33 +138,33 @@ public:
// methods used by wxColourScheme to choose the colours for this window // methods used by wxColourScheme to choose the colours for this window
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// return TRUE if this is a panel/canvas window which contains other // return true if this is a panel/canvas window which contains other
// controls only // controls only
virtual bool IsCanvasWindow() const { return FALSE; } virtual bool IsCanvasWindow() const { return false; }
// returns TRUE if the control has "transparent" areas such // returns true if the control has "transparent" areas such
// as a wxStaticText and wxCheckBox and the background should // as a wxStaticText and wxCheckBox and the background should
// be adapted from a parent window // be adapted from a parent window
virtual bool HasTransparentBackground() { return FALSE; } virtual bool HasTransparentBackground() { return false; }
// to be used with function above: transparent windows get // to be used with function above: transparent windows get
// their background from parents that return TRUE here, // their background from parents that return true here,
// so this is mostly for wxPanel, wxTopLevelWindow etc. // so this is mostly for wxPanel, wxTopLevelWindow etc.
virtual bool ProvidesBackground() const { return FALSE; } virtual bool ProvidesBackground() const { return false; }
// return TRUE if this control can be highlighted when the mouse is over // return true if this control can be highlighted when the mouse is over
// it (the theme decides itself whether it is really highlighted or not) // it (the theme decides itself whether it is really highlighted or not)
virtual bool CanBeHighlighted() const { return FALSE; } virtual bool CanBeHighlighted() const { return false; }
// return TRUE if we should use the colours/fonts returned by the // return true if we should use the colours/fonts returned by the
// corresponding GetXXX() methods instead of the default ones // corresponding GetXXX() methods instead of the default ones
bool UseBgCol() const { return m_hasBgCol; } bool UseBgCol() const { return m_hasBgCol; }
bool UseFgCol() const { return m_hasFgCol; } bool UseFgCol() const { return m_hasFgCol; }
bool UseFont() const { return m_hasFont; } bool UseFont() const { return m_hasFont; }
// return TRUE if this window serves as a container for the other windows // return true if this window serves as a container for the other windows
// only and doesn't get any input itself // only and doesn't get any input itself
virtual bool IsStaticBox() const { return FALSE; } virtual bool IsStaticBox() const { return false; }
// returns the (low level) renderer to use for drawing the control by // returns the (low level) renderer to use for drawing the control by
// querying the current theme // querying the current theme
@@ -187,11 +187,11 @@ public:
// the rect coordinates are, for us, in client coords, but if no rect is // the rect coordinates are, for us, in client coords, but if no rect is
// specified, the entire window is refreshed // specified, the entire window is refreshed
virtual void Refresh(bool eraseBackground = TRUE, virtual void Refresh(bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL); const wxRect *rect = (const wxRect *) NULL);
// we refresh the window when it is dis/enabled // we refresh the window when it is dis/enabled
virtual bool Enable(bool enable = TRUE); virtual bool Enable(bool enable = true);
// should we use the standard control colours or not? // should we use the standard control colours or not?
virtual bool ShouldInheritColours() const { return false; } virtual bool ShouldInheritColours() const { return false; }
@@ -222,7 +222,7 @@ protected:
void OnKeyUp(wxKeyEvent& event); void OnKeyUp(wxKeyEvent& event);
#endif // wxUSE_MENUS #endif // wxUSE_MENUS
// draw the control background, return TRUE if done // draw the control background, return true if done
virtual bool DoDrawBackground(wxDC& dc); virtual bool DoDrawBackground(wxDC& dc);
// draw the controls border // draw the controls border

View File

@@ -66,11 +66,11 @@ bool wxBitmapButton::Create(wxWindow *parent,
// typically too big for them // typically too big for them
if ( !wxButton::Create(parent, id, bitmap, _T(""), if ( !wxButton::Create(parent, id, bitmap, _T(""),
pos, size, style | wxBU_EXACTFIT, validator, name) ) pos, size, style | wxBU_EXACTFIT, validator, name) )
return FALSE; return false;
m_bmpNormal = bitmap; m_bmpNormal = bitmap;
return TRUE; return true;
} }
void wxBitmapButton::OnSetBitmap() void wxBitmapButton::OnSetBitmap()
@@ -103,21 +103,21 @@ bool wxBitmapButton::ChangeBitmap(const wxBitmap& bmp)
{ {
m_bitmap = bitmap; m_bitmap = bitmap;
return TRUE; return true;
} }
return FALSE; return false;
} }
bool wxBitmapButton::Enable(bool enable) bool wxBitmapButton::Enable(bool enable)
{ {
if ( !wxButton::Enable(enable) ) if ( !wxButton::Enable(enable) )
return FALSE; return false;
if ( !enable && ChangeBitmap(m_bmpDisabled) ) if ( !enable && ChangeBitmap(m_bmpDisabled) )
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxBitmapButton::SetCurrent(bool doit) bool wxBitmapButton::SetCurrent(bool doit)

View File

@@ -63,7 +63,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
void wxButton::Init() void wxButton::Init()
{ {
m_isPressed = m_isPressed =
m_isDefault = FALSE; m_isDefault = false;
} }
bool wxButton::Create(wxWindow *parent, bool wxButton::Create(wxWindow *parent,
@@ -83,7 +83,7 @@ bool wxButton::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;
SetLabel(label); SetLabel(label);
SetImageLabel(bitmap); SetImageLabel(bitmap);
@@ -91,7 +91,7 @@ bool wxButton::Create(wxWindow *parent,
CreateInputHandler(wxINP_HANDLER_BUTTON); CreateInputHandler(wxINP_HANDLER_BUTTON);
return TRUE; return true;
} }
wxButton::~wxButton() wxButton::~wxButton()
@@ -194,7 +194,7 @@ bool wxButton::DoDrawBackground(wxDC& dc)
rect, GetStateFlags()); rect, GetStateFlags());
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -205,7 +205,7 @@ void wxButton::Press()
{ {
if ( !m_isPressed ) if ( !m_isPressed )
{ {
m_isPressed = TRUE; m_isPressed = true;
Refresh(); Refresh();
} }
@@ -215,7 +215,7 @@ void wxButton::Release()
{ {
if ( m_isPressed ) if ( m_isPressed )
{ {
m_isPressed = FALSE; m_isPressed = false;
Refresh(); Refresh();
} }
@@ -257,7 +257,7 @@ bool wxButton::PerformAction(const wxControlAction& action,
else else
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -281,7 +281,7 @@ void wxButton::SetImageMargins(wxCoord x, wxCoord y)
void wxButton::SetDefault() void wxButton::SetDefault()
{ {
m_isDefault = TRUE; m_isDefault = true;
} }
// ============================================================================ // ============================================================================
@@ -292,7 +292,7 @@ wxStdButtonInputHandler::wxStdButtonInputHandler(wxInputHandler *handler)
: wxStdInputHandler(handler) : wxStdInputHandler(handler)
{ {
m_winCapture = NULL; m_winCapture = NULL;
m_winHasMouse = FALSE; m_winHasMouse = false;
} }
bool wxStdButtonInputHandler::HandleKey(wxInputConsumer *consumer, bool wxStdButtonInputHandler::HandleKey(wxInputConsumer *consumer,
@@ -304,7 +304,7 @@ bool wxStdButtonInputHandler::HandleKey(wxInputConsumer *consumer,
{ {
consumer->PerformAction(wxACTION_BUTTON_TOGGLE); consumer->PerformAction(wxACTION_BUTTON_TOGGLE);
return TRUE; return true;
} }
return wxStdInputHandler::HandleKey(consumer, event, pressed); return wxStdInputHandler::HandleKey(consumer, event, pressed);
@@ -327,11 +327,11 @@ bool wxStdButtonInputHandler::HandleMouse(wxInputConsumer *consumer,
{ {
m_winCapture = consumer->GetInputWindow(); m_winCapture = consumer->GetInputWindow();
m_winCapture->CaptureMouse(); m_winCapture->CaptureMouse();
m_winHasMouse = TRUE; m_winHasMouse = true;
consumer->PerformAction(wxACTION_BUTTON_PRESS); consumer->PerformAction(wxACTION_BUTTON_PRESS);
return TRUE; return true;
} }
else if ( event.LeftUp() ) else if ( event.LeftUp() )
{ {
@@ -346,7 +346,7 @@ bool wxStdButtonInputHandler::HandleMouse(wxInputConsumer *consumer,
// this will generate a click event // this will generate a click event
consumer->PerformAction(wxACTION_BUTTON_TOGGLE); consumer->PerformAction(wxACTION_BUTTON_TOGGLE);
return TRUE; return true;
} }
//else: the mouse was released outside the window, this doesn't //else: the mouse was released outside the window, this doesn't
// count as a click // count as a click
@@ -368,27 +368,27 @@ bool wxStdButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer,
if ( event.Leaving() ) if ( event.Leaving() )
{ {
// remember that the mouse is now outside // remember that the mouse is now outside
m_winHasMouse = FALSE; m_winHasMouse = false;
// we do have a pressed button, so release it // we do have a pressed button, so release it
consumer->GetInputWindow()->SetCurrent(FALSE); consumer->GetInputWindow()->SetCurrent(false);
consumer->PerformAction(wxACTION_BUTTON_RELEASE); consumer->PerformAction(wxACTION_BUTTON_RELEASE);
return TRUE; return true;
} }
// and entering it back should make it pressed again if it had been // and entering it back should make it pressed again if it had been
// pressed // pressed
else if ( event.Entering() ) else if ( event.Entering() )
{ {
// the mouse is (back) inside the button // the mouse is (back) inside the button
m_winHasMouse = TRUE; m_winHasMouse = true;
// we did have a pressed button which we released when leaving the // we did have a pressed button which we released when leaving the
// window, press it again // window, press it again
consumer->GetInputWindow()->SetCurrent(TRUE); consumer->GetInputWindow()->SetCurrent(true);
consumer->PerformAction(wxACTION_BUTTON_PRESS); consumer->PerformAction(wxACTION_BUTTON_PRESS);
return TRUE; return true;
} }
} }
@@ -398,16 +398,16 @@ bool wxStdButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer,
bool wxStdButtonInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer), bool wxStdButtonInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer),
const wxFocusEvent& WXUNUSED(event)) const wxFocusEvent& WXUNUSED(event))
{ {
// buttons change appearance when they get/lose focus, so return TRUE to // buttons change appearance when they get/lose focus, so return true to
// refresh // refresh
return TRUE; return true;
} }
bool wxStdButtonInputHandler::HandleActivation(wxInputConsumer *consumer, bool wxStdButtonInputHandler::HandleActivation(wxInputConsumer *consumer,
bool WXUNUSED(activated)) bool WXUNUSED(activated))
{ {
// the default button changes appearance when the app is [de]activated, so // the default button changes appearance when the app is [de]activated, so
// return TRUE to refresh // return true to refresh
return wxStaticCast(consumer->GetInputWindow(), wxButton)->IsDefault(); return wxStaticCast(consumer->GetInputWindow(), wxButton)->IsDefault();
} }

View File

@@ -54,7 +54,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
void wxCheckBox::Init() void wxCheckBox::Init()
{ {
m_isPressed = FALSE; m_isPressed = false;
m_status = Status_Unchecked; m_status = Status_Unchecked;
} }
@@ -68,14 +68,14 @@ bool wxCheckBox::Create(wxWindow *parent,
const wxString &name) const wxString &name)
{ {
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
SetLabel(label); SetLabel(label);
SetBestSize(size); SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_CHECKBOX); CreateInputHandler(wxINP_HANDLER_CHECKBOX);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -207,7 +207,7 @@ void wxCheckBox::Press()
{ {
if ( !m_isPressed ) if ( !m_isPressed )
{ {
m_isPressed = TRUE; m_isPressed = true;
Refresh(); Refresh();
} }
@@ -217,7 +217,7 @@ void wxCheckBox::Release()
{ {
if ( m_isPressed ) if ( m_isPressed )
{ {
m_isPressed = FALSE; m_isPressed = false;
Refresh(); Refresh();
} }
@@ -225,7 +225,7 @@ void wxCheckBox::Release()
void wxCheckBox::Toggle() void wxCheckBox::Toggle()
{ {
m_isPressed = FALSE; m_isPressed = false;
ChangeValue(!GetValue()); ChangeValue(!GetValue());
} }
@@ -258,15 +258,15 @@ bool wxCheckBox::PerformAction(const wxControlAction& action,
else if ( action == wxACTION_BUTTON_RELEASE ) else if ( action == wxACTION_BUTTON_RELEASE )
Release(); Release();
if ( action == wxACTION_CHECKBOX_CHECK ) if ( action == wxACTION_CHECKBOX_CHECK )
ChangeValue(TRUE); ChangeValue(true);
else if ( action == wxACTION_CHECKBOX_CLEAR ) else if ( action == wxACTION_CHECKBOX_CLEAR )
ChangeValue(FALSE); ChangeValue(false);
else if ( action == wxACTION_CHECKBOX_TOGGLE ) else if ( action == wxACTION_CHECKBOX_TOGGLE )
Toggle(); Toggle();
else else
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -96,11 +96,11 @@ bool wxCheckListBox::Create(wxWindow *parent,
{ {
if ( !wxListBox::Create(parent, id, pos, size, if ( !wxListBox::Create(parent, id, pos, size,
n, choices, style, validator, name) ) n, choices, style, validator, name) )
return FALSE; return false;
CreateInputHandler(wxINP_HANDLER_CHECKLISTBOX); CreateInputHandler(wxINP_HANDLER_CHECKLISTBOX);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -109,7 +109,7 @@ bool wxCheckListBox::Create(wxWindow *parent,
bool wxCheckListBox::IsChecked(size_t item) const bool wxCheckListBox::IsChecked(size_t item) const
{ {
wxCHECK_MSG( item < m_checks.GetCount(), FALSE, wxCHECK_MSG( item < m_checks.GetCount(), false,
_T("invalid index in wxCheckListBox::IsChecked") ); _T("invalid index in wxCheckListBox::IsChecked") );
return m_checks[item] != 0; return m_checks[item] != 0;
@@ -148,7 +148,7 @@ int wxCheckListBox::DoAppend(const wxString& item)
int pos = wxListBox::DoAppend(item); int pos = wxListBox::DoAppend(item);
// the item is initially unchecked // the item is initially unchecked
m_checks.Insert(FALSE, pos); m_checks.Insert(false, pos);
return pos; return pos;
} }
@@ -160,7 +160,7 @@ void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
size_t count = items.GetCount(); size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_checks.Insert(FALSE, pos + n); m_checks.Insert(false, pos + n);
} }
} }
@@ -172,7 +172,7 @@ void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData)
size_t count = items.GetCount(); size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_checks.Add(FALSE); m_checks.Add(false);
} }
} }
@@ -227,7 +227,7 @@ bool wxCheckListBox::PerformAction(const wxControlAction& action,
return wxListBox::PerformAction(action, numArg, strArg); return wxListBox::PerformAction(action, numArg, strArg);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -273,7 +273,7 @@ bool wxStdCheckListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
{ {
lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item); lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item);
return TRUE; return true;
} }
} }

View File

@@ -37,7 +37,7 @@
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
BEGIN_EVENT_TABLE(wxChoice, wxComboBox) BEGIN_EVENT_TABLE(wxChoice, wxComboBox)
EVT_COMBOBOX(-1, wxChoice::OnComboBox) EVT_COMBOBOX(wxID_ANY, wxChoice::OnComboBox)
END_EVENT_TABLE() END_EVENT_TABLE()
wxChoice::wxChoice(wxWindow *parent, wxWindowID id, wxChoice::wxChoice(wxWindow *parent, wxWindowID id,

View File

@@ -71,7 +71,7 @@ class wxComboButton : public wxBitmapButton
{ {
public: public:
wxComboButton(wxComboControl *combo) wxComboButton(wxComboControl *combo)
: wxBitmapButton(combo->GetParent(), -1, wxNullBitmap, : wxBitmapButton(combo->GetParent(), wxID_ANY, wxNullBitmap,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE | wxBU_EXACTFIT) wxBORDER_NONE | wxBU_EXACTFIT)
{ {
@@ -182,12 +182,12 @@ private:
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxComboButton, wxButton) BEGIN_EVENT_TABLE(wxComboButton, wxButton)
EVT_BUTTON(-1, wxComboButton::OnButton) EVT_BUTTON(wxID_ANY, wxComboButton::OnButton)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxComboListBox, wxListBox) BEGIN_EVENT_TABLE(wxComboListBox, wxListBox)
EVT_LISTBOX(-1, wxComboListBox::OnSelect) EVT_LISTBOX(wxID_ANY, wxComboListBox::OnSelect)
EVT_LISTBOX_DCLICK(-1, wxComboListBox::OnSelect) EVT_LISTBOX_DCLICK(wxID_ANY, wxComboListBox::OnSelect)
EVT_MOTION(wxComboListBox::OnMouseMove) EVT_MOTION(wxComboListBox::OnMouseMove)
EVT_LEFT_UP(wxComboListBox::OnLeftUp) EVT_LEFT_UP(wxComboListBox::OnLeftUp)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -200,7 +200,7 @@ END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxComboTextCtrl, wxTextCtrl) BEGIN_EVENT_TABLE(wxComboTextCtrl, wxTextCtrl)
EVT_KEY_DOWN(wxComboTextCtrl::OnKey) EVT_KEY_DOWN(wxComboTextCtrl::OnKey)
EVT_KEY_UP(wxComboTextCtrl::OnKey) EVT_KEY_UP(wxComboTextCtrl::OnKey)
EVT_TEXT(-1, wxComboTextCtrl::OnText) EVT_TEXT(wxID_ANY, wxComboTextCtrl::OnText)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
@@ -217,7 +217,7 @@ void wxComboControl::Init()
{ {
m_popup = (wxComboPopup *)NULL; m_popup = (wxComboPopup *)NULL;
m_winPopup = (wxPopupComboWindow *)NULL; m_winPopup = (wxPopupComboWindow *)NULL;
m_isPopupShown = FALSE; m_isPopupShown = false;
m_btn = NULL; m_btn = NULL;
m_text = NULL; m_text = NULL;
} }
@@ -236,7 +236,7 @@ bool wxComboControl::Create(wxWindow *parent,
style &= ~wxBORDER_NONE; style &= ~wxBORDER_NONE;
style |= wxBORDER_SUNKEN; style |= wxBORDER_SUNKEN;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
// create the text control and the button as our siblings (*not* children), // create the text control and the button as our siblings (*not* children),
// don't care about size/position here - they will be set in DoMoveWindow() // don't care about size/position here - they will be set in DoMoveWindow()
@@ -248,10 +248,10 @@ bool wxComboControl::Create(wxWindow *parent,
// for compatibility with the other ports, the height specified is the // for compatibility with the other ports, the height specified is the
// combined height of the combobox itself and the popup // combined height of the combobox itself and the popup
if ( size.y == -1 ) if ( size.y == wxDefaultCoord )
{ {
// ok, use default height for popup too // ok, use default height for popup too
m_heightPopup = -1; m_heightPopup = wxDefaultCoord;
} }
else else
{ {
@@ -267,13 +267,13 @@ bool wxComboControl::Create(wxWindow *parent,
// have to disable this window to avoid interfering it with message // have to disable this window to avoid interfering it with message
// processing to the text and the button... but pretend it is enabled to // processing to the text and the button... but pretend it is enabled to
// make IsEnabled() return TRUE // make IsEnabled() return true
wxControl::Enable(FALSE); // don't use non virtual Disable() here! wxControl::Enable(false); // don't use non virtual Disable() here!
m_isEnabled = TRUE; m_isEnabled = true;
CreateInputHandler(wxINP_HANDLER_COMBOBOX); CreateInputHandler(wxINP_HANDLER_COMBOBOX);
return TRUE; return true;
} }
wxComboControl::~wxComboControl() wxComboControl::~wxComboControl()
@@ -340,18 +340,18 @@ void wxComboControl::DoMoveWindow(int x, int y, int width, int height)
bool wxComboControl::Enable(bool enable) bool wxComboControl::Enable(bool enable)
{ {
if ( !wxControl::Enable(enable) ) if ( !wxControl::Enable(enable) )
return FALSE; return false;
m_btn->Enable(enable); m_btn->Enable(enable);
m_text->Enable(enable); m_text->Enable(enable);
return TRUE; return true;
} }
bool wxComboControl::Show(bool show) bool wxComboControl::Show(bool show)
{ {
if ( !wxControl::Show(show) ) if ( !wxControl::Show(show) )
return FALSE; return false;
if (m_btn) if (m_btn)
m_btn->Show(show); m_btn->Show(show);
@@ -359,7 +359,7 @@ bool wxComboControl::Show(bool show)
if (m_text) if (m_text)
m_text->Show(show); m_text->Show(show);
return TRUE; return true;
} }
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
@@ -403,7 +403,7 @@ void wxComboControl::ShowPopup()
// size and position the popup window correctly // size and position the popup window correctly
m_winPopup->SetSize(GetSize().x, m_winPopup->SetSize(GetSize().x,
m_heightPopup == -1 ? control->GetBestSize().y m_heightPopup == wxDefaultCoord ? control->GetBestSize().y
: m_heightPopup); : m_heightPopup);
wxSize sizePopup = m_winPopup->GetClientSize(); wxSize sizePopup = m_winPopup->GetClientSize();
control->SetSize(0, 0, sizePopup.x, sizePopup.y); control->SetSize(0, 0, sizePopup.x, sizePopup.y);
@@ -424,7 +424,7 @@ void wxComboControl::ShowPopup()
m_text->SelectAll(); m_text->SelectAll();
m_popup->SetSelection(m_text->GetValue()); m_popup->SetSelection(m_text->GetValue());
m_isPopupShown = TRUE; m_isPopupShown = true;
} }
void wxComboControl::HidePopup() void wxComboControl::HidePopup()
@@ -434,7 +434,7 @@ void wxComboControl::HidePopup()
m_winPopup->Dismiss(); m_winPopup->Dismiss();
m_isPopupShown = FALSE; m_isPopupShown = false;
} }
void wxComboControl::OnSelect(const wxString& value) void wxComboControl::OnSelect(const wxString& value)
@@ -459,7 +459,7 @@ wxComboTextCtrl::wxComboTextCtrl(wxComboControl *combo,
const wxString& value, const wxString& value,
long style, long style,
const wxValidator& validator) const wxValidator& validator)
: wxTextCtrl(combo->GetParent(), -1, value, : wxTextCtrl(combo->GetParent(), wxID_ANY, value,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE | style, wxBORDER_NONE | style,
validator) validator)
@@ -522,7 +522,7 @@ void wxComboTextCtrl::OnKey(wxKeyEvent& event)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxComboListBox::wxComboListBox(wxComboControl *combo, int style) wxComboListBox::wxComboListBox(wxComboControl *combo, int style)
: wxListBox(combo->GetPopupWindow(), -1, : wxListBox(combo->GetPopupWindow(), wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
0, NULL, 0, NULL,
wxBORDER_SIMPLE | wxLB_INT_HEIGHT | style), wxBORDER_SIMPLE | wxLB_INT_HEIGHT | style),
@@ -551,10 +551,10 @@ bool wxComboListBox::SetSelection(const wxString& value)
else if ( !FindItem(value) ) else if ( !FindItem(value) )
{ {
// no match att all // no match att all
return FALSE; return false;
} }
return TRUE; return true;
} }
void wxComboListBox::OnSelect(wxCommandEvent& event) void wxComboListBox::OnSelect(wxCommandEvent& event)
@@ -580,7 +580,7 @@ void wxComboListBox::OnSelect(wxCommandEvent& event)
void wxComboListBox::OnShow() void wxComboListBox::OnShow()
{ {
// nobody clicked us yet // nobody clicked us yet
m_clicked = FALSE; m_clicked = false;
} }
bool wxComboListBox::PerformAction(const wxControlAction& action, bool wxComboListBox::PerformAction(const wxControlAction& action,
@@ -593,7 +593,7 @@ bool wxComboListBox::PerformAction(const wxControlAction& action,
// we don't let the listbox handle this as instead of just using the // we don't let the listbox handle this as instead of just using the
// single key presses, as usual, we use the text ctrl value as prefix // single key presses, as usual, we use the text ctrl value as prefix
// and this is done by wxComboControl itself // and this is done by wxComboControl itself
return TRUE; return true;
} }
return wxListBox::PerformAction(action, numArg, strArg); return wxListBox::PerformAction(action, numArg, strArg);
@@ -602,7 +602,7 @@ bool wxComboListBox::PerformAction(const wxControlAction& action,
void wxComboListBox::OnLeftUp(wxMouseEvent& event) void wxComboListBox::OnLeftUp(wxMouseEvent& event)
{ {
// we should dismiss the combo now // we should dismiss the combo now
m_clicked = TRUE; m_clicked = true;
event.Skip(); event.Skip();
} }
@@ -702,7 +702,7 @@ bool wxComboBox::Create(wxWindow *parent,
if ( !wxComboControl::Create(parent, id, value, pos, size, style, if ( !wxComboControl::Create(parent, id, value, pos, size, style,
validator, name) ) validator, name) )
{ {
return FALSE; return false;
} }
wxComboListBox *combolbox = wxComboListBox *combolbox =
@@ -712,7 +712,7 @@ bool wxComboBox::Create(wxWindow *parent,
SetPopupControl(combolbox); SetPopupControl(combolbox);
return TRUE; return true;
} }
wxComboBox::~wxComboBox() wxComboBox::~wxComboBox()
@@ -911,14 +911,14 @@ bool wxComboControl::PerformAction(const wxControlAction& action,
long numArg, long numArg,
const wxString& strArg) const wxString& strArg)
{ {
bool processed = FALSE; bool processed = false;
if ( action == wxACTION_COMBOBOX_POPUP ) if ( action == wxACTION_COMBOBOX_POPUP )
{ {
if ( !m_isPopupShown ) if ( !m_isPopupShown )
{ {
ShowPopup(); ShowPopup();
processed = TRUE; processed = true;
} }
} }
else if ( action == wxACTION_COMBOBOX_DISMISS ) else if ( action == wxACTION_COMBOBOX_DISMISS )
@@ -927,7 +927,7 @@ bool wxComboControl::PerformAction(const wxControlAction& action,
{ {
HidePopup(); HidePopup();
processed = TRUE; processed = true;
} }
} }
@@ -937,7 +937,7 @@ bool wxComboControl::PerformAction(const wxControlAction& action,
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -967,11 +967,11 @@ bool wxStdComboBoxInputHandler::HandleKey(wxInputConsumer *consumer,
break; break;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
consumer->PerformAction(action); consumer->PerformAction(action);
return TRUE; return true;
} }
} }

View File

@@ -73,10 +73,10 @@ bool wxControl::Create(wxWindow *parent,
if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) ) if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) )
{ {
// underlying window creation failed? // underlying window creation failed?
return FALSE; return false;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -541,7 +541,7 @@ void wxControlRenderer::DrawBitmap(wxDC &dc,
} }
// do draw it // do draw it
dc.DrawBitmap(bmp, x, y, TRUE /* use mask */); dc.DrawBitmap(bmp, x, y, true /* use mask */);
} }
void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar,
@@ -561,7 +561,7 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar,
rectUpdate.GetBottom()); rectUpdate.GetBottom());
#if 0 //def WXDEBUG_SCROLLBAR #if 0 //def WXDEBUG_SCROLLBAR
static bool s_refreshDebug = FALSE; static bool s_refreshDebug = false;
if ( s_refreshDebug ) if ( s_refreshDebug )
{ {
wxClientDC dc(wxConstCast(scrollbar, wxScrollBar)); wxClientDC dc(wxConstCast(scrollbar, wxScrollBar));
@@ -628,7 +628,7 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar,
(wxScrollArrows::Arrow)nArrow, (wxScrollArrows::Arrow)nArrow,
m_dc, m_dc,
rectArrow, rectArrow,
TRUE // draw a scrollbar arrow, not just an arrow true // draw a scrollbar arrow, not just an arrow
); );
} }
} }
@@ -750,7 +750,7 @@ void wxControlRenderer::DoDrawItems(const wxListBox *lbox,
void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox, void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox,
size_t itemFirst, size_t itemLast) size_t itemFirst, size_t itemLast)
{ {
DoDrawItems(lbox, itemFirst, itemLast, TRUE); DoDrawItems(lbox, itemFirst, itemLast, true);
} }
#endif // wxUSE_CHECKLISTBOX #endif // wxUSE_CHECKLISTBOX

View File

@@ -51,7 +51,7 @@ void wxDialog::Init()
m_returnCode = 0; m_returnCode = 0;
m_windowDisabler = NULL; m_windowDisabler = NULL;
m_eventLoop = NULL; m_eventLoop = NULL;
m_isShowingModal = FALSE; m_isShowingModal = false;
} }
wxDialog::~wxDialog() wxDialog::~wxDialog()
@@ -87,7 +87,7 @@ void wxDialog::OnCancel(wxCommandEvent &WXUNUSED(event))
else else
{ {
SetReturnCode(wxID_CANCEL); SetReturnCode(wxID_CANCEL);
Show(FALSE); Show(false);
} }
} }
@@ -102,7 +102,7 @@ void wxDialog::OnOK(wxCommandEvent &WXUNUSED(event))
else else
{ {
SetReturnCode(wxID_OK); SetReturnCode(wxID_OK);
Show(FALSE); Show(false);
} }
} }
} }
@@ -185,9 +185,9 @@ int wxDialog::ShowModal()
} }
} }
Show(TRUE); Show(true);
m_isShowingModal = TRUE; m_isShowingModal = true;
wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") ); wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") );
@@ -217,9 +217,9 @@ void wxDialog::EndModal(int retCode)
return; return;
} }
m_isShowingModal = FALSE; m_isShowingModal = false;
m_eventLoop->Exit(); m_eventLoop->Exit();
Show(FALSE); Show(false);
} }

View File

@@ -136,7 +136,7 @@ void wxFrame::PositionStatusBar()
if ( m_frameStatusBar ) if ( m_frameStatusBar )
{ {
wxSize size = GetClientSize(); wxSize size = GetClientSize();
m_frameStatusBar->SetSize(0, size.y, size.x, -1); m_frameStatusBar->SetSize(0, size.y, size.x, wxDefaultCoord);
} }
} }
@@ -319,10 +319,10 @@ int wxFrame::GetMinHeight() const
bool wxFrame::Enable(bool enable) bool wxFrame::Enable(bool enable)
{ {
if (!wxFrameBase::Enable(enable)) if (!wxFrameBase::Enable(enable))
return FALSE; return false;
#ifdef __WXMICROWIN__ #ifdef __WXMICROWIN__
if (m_frameMenuBar) if (m_frameMenuBar)
m_frameMenuBar->Enable(enable); m_frameMenuBar->Enable(enable);
#endif #endif
return TRUE; return true;
} }

View File

@@ -65,12 +65,12 @@ bool wxGauge::Create(wxWindow *parent,
if ( !wxGaugeBase::Create(parent, id, range, pos, size, style, if ( !wxGaugeBase::Create(parent, id, range, pos, size, style,
validator, name) ) validator, name) )
{ {
return FALSE; return false;
} }
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -104,12 +104,12 @@ wxSize wxGauge::DoGetBestClientSize() const
if ( IsVertical() ) if ( IsVertical() )
{ {
size.x = (3*size.y) / 2 + 2; size.x = (3*size.y) / 2 + 2;
size.y = -1; size.y = wxDefaultCoord;
} }
else else
{ {
size.y = (3*size.x) / 2 + 2; size.y = (3*size.x) / 2 + 2;
size.x = -1; size.x = wxDefaultCoord;
} }
return size; return size;

View File

@@ -66,13 +66,13 @@ void wxInputConsumer::CreateInputHandler(const wxString& inphandler)
void wxInputConsumer::OnKeyDown(wxKeyEvent& event) void wxInputConsumer::OnKeyDown(wxKeyEvent& event)
{ {
if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, TRUE) ) if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, true) )
event.Skip(); event.Skip();
} }
void wxInputConsumer::OnKeyUp(wxKeyEvent& event) void wxInputConsumer::OnKeyUp(wxKeyEvent& event)
{ {
if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, FALSE) ) if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, false) )
event.Skip(); event.Skip();
} }
@@ -103,6 +103,6 @@ bool wxInputConsumer::PerformAction(const wxControlAction& WXUNUSED(action),
long WXUNUSED(numArg), long WXUNUSED(numArg),
const wxString& WXUNUSED(strArg)) const wxString& WXUNUSED(strArg))
{ {
return FALSE; return false;
} }

View File

@@ -44,19 +44,19 @@
bool wxInputHandler::HandleMouseMove(wxInputConsumer * WXUNUSED(consumer), bool wxInputHandler::HandleMouseMove(wxInputConsumer * WXUNUSED(consumer),
const wxMouseEvent& WXUNUSED(event)) const wxMouseEvent& WXUNUSED(event))
{ {
return FALSE; return false;
} }
bool wxInputHandler::HandleFocus(wxInputConsumer *WXUNUSED(consumer), bool wxInputHandler::HandleFocus(wxInputConsumer *WXUNUSED(consumer),
const wxFocusEvent& WXUNUSED(event)) const wxFocusEvent& WXUNUSED(event))
{ {
return FALSE; return false;
} }
bool wxInputHandler::HandleActivation(wxInputConsumer *WXUNUSED(consumer), bool wxInputHandler::HandleActivation(wxInputConsumer *WXUNUSED(consumer),
bool WXUNUSED(activated)) bool WXUNUSED(activated))
{ {
return FALSE; return false;
} }
wxInputHandler::~wxInputHandler() wxInputHandler::~wxInputHandler()

View File

@@ -68,7 +68,7 @@ void wxListBox::Init()
// no items hence no current item // no items hence no current item
m_current = -1; m_current = -1;
m_selAnchor = -1; m_selAnchor = -1;
m_currentChanged = FALSE; m_currentChanged = false;
// no need to update anything initially // no need to update anything initially
m_updateCount = 0; m_updateCount = 0;
@@ -77,7 +77,7 @@ void wxListBox::Init()
m_updateScrollbarX = m_updateScrollbarX =
m_showScrollbarX = m_showScrollbarX =
m_updateScrollbarY = m_updateScrollbarY =
m_showScrollbarY = FALSE; m_showScrollbarY = false;
} }
wxListBox::wxListBox(wxWindow *parent, wxListBox::wxListBox(wxWindow *parent,
@@ -137,7 +137,7 @@ bool wxListBox::Create(wxWindow *parent,
if ( !wxControl::Create(parent, id, pos, size, style, if ( !wxControl::Create(parent, id, pos, size, style,
validator, name) ) validator, name) )
return FALSE; return false;
SetWindow(this); SetWindow(this);
@@ -152,7 +152,7 @@ bool wxListBox::Create(wxWindow *parent,
CreateInputHandler(wxINP_HANDLER_LISTBOX); CreateInputHandler(wxINP_HANDLER_LISTBOX);
return TRUE; return true;
} }
wxListBox::~wxListBox() wxListBox::~wxListBox()
@@ -188,7 +188,7 @@ int wxListBox::DoAppend(const wxString& item)
m_itemsClientData.Insert(NULL, index); m_itemsClientData.Insert(NULL, index);
m_updateScrollbarY = TRUE; m_updateScrollbarY = true;
if ( HasHorzScrollbar() ) if ( HasHorzScrollbar() )
{ {
@@ -199,7 +199,7 @@ int wxListBox::DoAppend(const wxString& item)
{ {
m_maxWidth = width; m_maxWidth = width;
m_maxWidthItem = index; m_maxWidthItem = index;
m_updateScrollbarX = TRUE; m_updateScrollbarX = true;
} }
} }
@@ -222,7 +222,7 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
} }
// the number of items has changed so we might have to show the scrollbar // the number of items has changed so we might have to show the scrollbar
m_updateScrollbarY = TRUE; m_updateScrollbarY = true;
// the max width also might have changed - just recalculate it instead of // the max width also might have changed - just recalculate it instead of
// keeping track of it here, this is probably more efficient for a typical // keeping track of it here, this is probably more efficient for a typical
@@ -261,7 +261,7 @@ void wxListBox::DoSetItems(const wxArrayString& items, void **clientData)
m_itemsClientData.Insert(clientData ? clientData[n] : NULL, index); m_itemsClientData.Insert(clientData ? clientData[n] : NULL, index);
} }
m_updateScrollbarY = TRUE; m_updateScrollbarY = true;
RefreshAll(); RefreshAll();
} }
@@ -281,7 +281,7 @@ void wxListBox::SetString(int n, const wxString& s)
{ {
m_maxWidth = width; m_maxWidth = width;
m_maxWidthItem = n; m_maxWidthItem = n;
m_updateScrollbarX = TRUE; m_updateScrollbarX = true;
} }
// or also decreased if the old string was the longest one // or also decreased if the old string was the longest one
else if ( n == m_maxWidthItem ) else if ( n == m_maxWidthItem )
@@ -324,7 +324,7 @@ void wxListBox::Clear()
{ {
DoClear(); DoClear();
m_updateScrollbarY = TRUE; m_updateScrollbarY = true;
RefreshHorzScrollbar(); RefreshHorzScrollbar();
@@ -385,7 +385,7 @@ void wxListBox::Delete(int n)
} }
// the number of items has changed, hence the scrollbar may disappear // the number of items has changed, hence the scrollbar may disappear
m_updateScrollbarY = TRUE; m_updateScrollbarY = true;
// finally, if the longest item was deleted the scrollbar may disappear // finally, if the longest item was deleted the scrollbar may disappear
if ( n == m_maxWidthItem ) if ( n == m_maxWidthItem )
@@ -572,7 +572,7 @@ void wxListBox::RefreshAll()
void wxListBox::RefreshHorzScrollbar() void wxListBox::RefreshHorzScrollbar()
{ {
m_maxWidth = 0; // recalculate it m_maxWidth = 0; // recalculate it
m_updateScrollbarX = TRUE; m_updateScrollbarX = true;
} }
void wxListBox::UpdateScrollbars() void wxListBox::UpdateScrollbars()
@@ -596,7 +596,7 @@ void wxListBox::UpdateScrollbars()
else // never show it else // never show it
{ {
charWidth = maxWidth = 0; charWidth = maxWidth = 0;
showScrollbarX = FALSE; showScrollbarX = false;
} }
// what should be the scrollbar range now? // what should be the scrollbar range now?
@@ -656,7 +656,7 @@ void wxListBox::UpdateItems()
m_updateFrom, m_updateFrom + m_updateCount - 1, m_updateFrom, m_updateFrom + m_updateCount - 1,
rect.GetTop(), rect.GetBottom()); rect.GetTop(), rect.GetBottom());
Refresh(TRUE, &rect); Refresh(true, &rect);
} }
} }
@@ -667,14 +667,14 @@ void wxListBox::OnInternalIdle()
UpdateScrollbars(); UpdateScrollbars();
m_updateScrollbarX = m_updateScrollbarX =
m_updateScrollbarY = FALSE; m_updateScrollbarY = false;
} }
if ( m_currentChanged ) if ( m_currentChanged )
{ {
DoEnsureVisible(m_current); DoEnsureVisible(m_current);
m_currentChanged = FALSE; m_currentChanged = false;
} }
if ( m_updateCount ) if ( m_updateCount )
@@ -741,13 +741,13 @@ void wxListBox::DoDrawRange(wxControlRenderer *renderer,
bool wxListBox::SetFont(const wxFont& font) bool wxListBox::SetFont(const wxFont& font)
{ {
if ( !wxControl::SetFont(font) ) if ( !wxControl::SetFont(font) )
return FALSE; return false;
CalcItemsPerPage(); CalcItemsPerPage();
RefreshAll(); RefreshAll();
return TRUE; return true;
} }
void wxListBox::CalcItemsPerPage() void wxListBox::CalcItemsPerPage()
@@ -804,7 +804,7 @@ void wxListBox::OnSize(wxSizeEvent& event)
// the scrollbars might [dis]appear // the scrollbars might [dis]appear
m_updateScrollbarX = m_updateScrollbarX =
m_updateScrollbarY = TRUE; m_updateScrollbarY = true;
event.Skip(); event.Skip();
} }
@@ -909,7 +909,7 @@ void wxListBox::SetCurrentItem(int n)
if ( m_current != -1 ) if ( m_current != -1 )
{ {
m_currentChanged = TRUE; m_currentChanged = true;
RefreshItem(m_current); RefreshItem(m_current);
} }
@@ -923,7 +923,7 @@ bool wxListBox::FindItem(const wxString& prefix, bool strictlyAfter)
if ( !count ) if ( !count )
{ {
// empty listbox, we can't find anything in it // empty listbox, we can't find anything in it
return FALSE; return false;
} }
// start either from the current item or from the next one if strictlyAfter // start either from the current item or from the next one if strictlyAfter
@@ -964,12 +964,12 @@ bool wxListBox::FindItem(const wxString& prefix, bool strictlyAfter)
AnchorSelection(item); AnchorSelection(item);
} }
return TRUE; return true;
} }
} }
// nothing found // nothing found
return FALSE; return false;
} }
void wxListBox::EnsureVisible(int n) void wxListBox::EnsureVisible(int n)
@@ -979,7 +979,7 @@ void wxListBox::EnsureVisible(int n)
UpdateScrollbars(); UpdateScrollbars();
m_updateScrollbarX = m_updateScrollbarX =
m_updateScrollbarY = FALSE; m_updateScrollbarY = false;
} }
DoEnsureVisible(n); DoEnsureVisible(n);
@@ -1193,7 +1193,7 @@ bool wxListBox::PerformAction(const wxControlAction& action,
else else
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
return TRUE; return true;
} }
// ============================================================================ // ============================================================================
@@ -1207,7 +1207,7 @@ wxStdListboxInputHandler::wxStdListboxInputHandler(wxInputHandler *handler,
m_btnCapture = 0; m_btnCapture = 0;
m_toggleOnPressAlways = toggleOnPressAlways; m_toggleOnPressAlways = toggleOnPressAlways;
m_actionMouse = wxACTION_NONE; m_actionMouse = wxACTION_NONE;
m_trackMouseOutside = TRUE; m_trackMouseOutside = true;
} }
int wxStdListboxInputHandler::HitTest(const wxListBox *lbox, int wxStdListboxInputHandler::HitTest(const wxListBox *lbox,
@@ -1315,7 +1315,7 @@ wxStdListboxInputHandler::SetupCapture(wxListBox *lbox,
} }
// by default we always do track it // by default we always do track it
m_trackMouseOutside = TRUE; m_trackMouseOutside = true;
return action; return action;
} }
@@ -1327,7 +1327,7 @@ bool wxStdListboxInputHandler::HandleKey(wxInputConsumer *consumer,
// we're only interested in the key press events // we're only interested in the key press events
if ( pressed && !event.AltDown() ) if ( pressed && !event.AltDown() )
{ {
bool isMoveCmd = TRUE; bool isMoveCmd = true;
int style = consumer->GetInputWindow()->GetWindowStyle(); int style = consumer->GetInputWindow()->GetWindowStyle();
wxControlAction action; wxControlAction action;
@@ -1370,13 +1370,13 @@ bool wxStdListboxInputHandler::HandleKey(wxInputConsumer *consumer,
if ( style & wxLB_MULTIPLE ) if ( style & wxLB_MULTIPLE )
{ {
action = wxACTION_LISTBOX_TOGGLE; action = wxACTION_LISTBOX_TOGGLE;
isMoveCmd = FALSE; isMoveCmd = false;
} }
break; break;
case WXK_RETURN: case WXK_RETURN:
action = wxACTION_LISTBOX_ACTIVATE; action = wxACTION_LISTBOX_ACTIVATE;
isMoveCmd = FALSE; isMoveCmd = false;
break; break;
default: default:
@@ -1387,7 +1387,7 @@ bool wxStdListboxInputHandler::HandleKey(wxInputConsumer *consumer,
} }
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
consumer->PerformAction(action, -1, strArg); consumer->PerformAction(action, -1, strArg);
@@ -1412,7 +1412,7 @@ bool wxStdListboxInputHandler::HandleKey(wxInputConsumer *consumer,
//else: nothing to do for multiple selection listboxes //else: nothing to do for multiple selection listboxes
} }
return TRUE; return true;
} }
} }
@@ -1454,11 +1454,11 @@ bool wxStdListboxInputHandler::HandleMouse(wxInputConsumer *consumer,
action = wxACTION_LISTBOX_ACTIVATE; action = wxACTION_LISTBOX_ACTIVATE;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
lbox->PerformAction(action, item); lbox->PerformAction(action, item);
return TRUE; return true;
} }
return wxStdInputHandler::HandleMouse(consumer, event); return wxStdInputHandler::HandleMouse(consumer, event);
@@ -1478,7 +1478,7 @@ bool wxStdListboxInputHandler::HandleMouseMove(wxInputConsumer *consumer,
// when we do it ourselves): in this case we only react to // when we do it ourselves): in this case we only react to
// the mouse messages when they happen inside the listbox // the mouse messages when they happen inside the listbox
if ( lbox->HitTest(event.GetPosition()) != wxHT_WINDOW_INSIDE ) if ( lbox->HitTest(event.GetPosition()) != wxHT_WINDOW_INSIDE )
return FALSE; return false;
} }
int item = HitTest(lbox, event); int item = HitTest(lbox, event);
@@ -1489,7 +1489,7 @@ bool wxStdListboxInputHandler::HandleMouseMove(wxInputConsumer *consumer,
// events // events
SetupCapture(lbox, event, item); SetupCapture(lbox, event, item);
m_trackMouseOutside = FALSE; m_trackMouseOutside = false;
} }
if ( IsValidIndex(lbox, item) ) if ( IsValidIndex(lbox, item) )

View File

@@ -75,7 +75,7 @@ public:
m_width = 0; m_width = 0;
} }
void SetEnabled(bool enabled = TRUE) { m_isEnabled = enabled; } void SetEnabled(bool enabled = true) { m_isEnabled = enabled; }
// accessors // accessors
@@ -136,7 +136,7 @@ public:
virtual void OnDismiss(); virtual void OnDismiss();
// called when a submenu is dismissed // called when a submenu is dismissed
void OnSubmenuDismiss() { m_hasOpenSubMenu = FALSE; } void OnSubmenuDismiss() { m_hasOpenSubMenu = false; }
// get the currently selected item (may be NULL) // get the currently selected item (may be NULL)
wxMenuItem *GetCurrentItem() const wxMenuItem *GetCurrentItem() const
@@ -153,7 +153,7 @@ public:
// preselect the first item // preselect the first item
void SelectFirst() { SetCurrent(m_menu->GetMenuItems().GetFirst()); } void SelectFirst() { SetCurrent(m_menu->GetMenuItems().GetFirst()); }
// process the key event, return TRUE if done // process the key event, return true if done
bool ProcessKeyDown(int key); bool ProcessKeyDown(int key);
// process mouse move event // process mouse move event
@@ -190,7 +190,7 @@ protected:
void ChangeCurrent(wxMenuItemList::compatibility_iterator node); void ChangeCurrent(wxMenuItemList::compatibility_iterator node);
// activate item, i.e. call either ClickItem() or OpenSubmenu() depending // activate item, i.e. call either ClickItem() or OpenSubmenu() depending
// on what it is, return TRUE if something was done (i.e. it's not a // on what it is, return true if something was done (i.e. it's not a
// separator...) // separator...)
bool ActivateItem(wxMenuItem *item, InputMethod how = WithKeyboard); bool ActivateItem(wxMenuItem *item, InputMethod how = WithKeyboard);
@@ -258,7 +258,7 @@ public:
} }
else else
{ {
// return FALSE; // return false;
return wxEvtHandler::ProcessEvent(event); return wxEvtHandler::ProcessEvent(event);
} }
@@ -304,7 +304,7 @@ END_EVENT_TABLE()
wxPopupMenuWindow::wxPopupMenuWindow(wxWindow *parent, wxMenu *menu) wxPopupMenuWindow::wxPopupMenuWindow(wxWindow *parent, wxMenu *menu)
{ {
m_menu = menu; m_menu = menu;
m_hasOpenSubMenu = FALSE; m_hasOpenSubMenu = false;
ResetCurrent(); ResetCurrent();
@@ -473,7 +473,7 @@ void wxPopupMenuWindow::OnDismiss()
{ {
// when we are dismissed because the user clicked elsewhere or we lost // when we are dismissed because the user clicked elsewhere or we lost
// focus in any other way, hide the parent menu as well // focus in any other way, hide the parent menu as well
HandleDismiss(TRUE); HandleDismiss(true);
} }
void wxPopupMenuWindow::HandleDismiss(bool dismissParent) void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
@@ -486,7 +486,7 @@ void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
void wxPopupMenuWindow::DismissAndNotify() void wxPopupMenuWindow::DismissAndNotify()
{ {
Dismiss(); Dismiss();
HandleDismiss(TRUE); HandleDismiss(true);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -648,7 +648,7 @@ void wxPopupMenuWindow::OpenSubmenu(wxMenuItem *item, InputMethod how)
wxSize(m_menu->GetGeometryInfo().GetSize().x, 0), wxSize(m_menu->GetGeometryInfo().GetSize().x, 0),
how == WithKeyboard /* preselect first item then */); how == WithKeyboard /* preselect first item then */);
m_hasOpenSubMenu = TRUE; m_hasOpenSubMenu = true;
} }
bool wxPopupMenuWindow::ActivateItem(wxMenuItem *item, InputMethod how) bool wxPopupMenuWindow::ActivateItem(wxMenuItem *item, InputMethod how)
@@ -656,7 +656,7 @@ bool wxPopupMenuWindow::ActivateItem(wxMenuItem *item, InputMethod how)
// don't activate disabled items // don't activate disabled items
if ( !item || !item->IsEnabled() ) if ( !item || !item->IsEnabled() )
{ {
return FALSE; return false;
} }
// normal menu items generate commands, submenus can be opened and // normal menu items generate commands, submenus can be opened and
@@ -671,10 +671,10 @@ bool wxPopupMenuWindow::ActivateItem(wxMenuItem *item, InputMethod how)
} }
else // separator, can't activate else // separator, can't activate
{ {
return FALSE; return false;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -696,19 +696,19 @@ bool wxPopupMenuWindow::ProcessLeftDown(wxMouseEvent& event)
{ {
wxPopupMenuWindow *win = menu->m_popupMenu; wxPopupMenuWindow *win = menu->m_popupMenu;
wxCHECK_MSG( win, FALSE, _T("parent menu not shown?") ); wxCHECK_MSG( win, false, _T("parent menu not shown?") );
pos = ClientToScreen(pos); pos = ClientToScreen(pos);
if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) ) if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) )
{ {
// eat the event // eat the event
return TRUE; return true;
} }
//else: it is outside the parent menu as well, do dismiss this one //else: it is outside the parent menu as well, do dismiss this one
} }
} }
return FALSE; return false;
} }
void wxPopupMenuWindow::OnLeftUp(wxMouseEvent& event) void wxPopupMenuWindow::OnLeftUp(wxMouseEvent& event)
@@ -833,7 +833,7 @@ void wxPopupMenuWindow::OnMouseLeave(wxMouseEvent& event)
else else
{ {
// this menu is the last opened // this menu is the last opened
resetCurrent = TRUE; resetCurrent = true;
} }
if ( resetCurrent ) if ( resetCurrent )
@@ -866,14 +866,14 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
// to open it inspit of this) // to open it inspit of this)
if ( HasOpenSubmenu() ) if ( HasOpenSubmenu() )
{ {
wxCHECK_MSG( CanOpen(item), FALSE, wxCHECK_MSG( CanOpen(item), false,
_T("has open submenu but another item selected?") ); _T("has open submenu but another item selected?") );
if ( item->GetSubMenu()->ProcessKeyDown(key) ) if ( item->GetSubMenu()->ProcessKeyDown(key) )
return TRUE; return true;
} }
bool processed = TRUE; bool processed = true;
// handle the up/down arrows, home, end, esc and return here, pass the // handle the up/down arrows, home, end, esc and return here, pass the
// left/right arrows to the menu bar except when the right arrow can be // left/right arrows to the menu bar except when the right arrow can be
@@ -885,7 +885,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
// menubar // menubar
if ( !m_menu->GetParent() ) if ( !m_menu->GetParent() )
{ {
processed = FALSE; processed = false;
break; break;
} }
@@ -894,7 +894,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
case WXK_ESCAPE: case WXK_ESCAPE:
// close just this menu // close just this menu
Dismiss(); Dismiss();
HandleDismiss(FALSE); HandleDismiss(false);
break; break;
case WXK_RETURN: case WXK_RETURN:
@@ -939,7 +939,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
} }
else else
{ {
processed = FALSE; processed = false;
} }
} }
break; break;
@@ -952,7 +952,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
} }
else else
{ {
processed = FALSE; processed = false;
} }
break; break;
@@ -966,7 +966,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
wxMenuItemList::compatibility_iterator nodeStart = GetNextNode(); wxMenuItemList::compatibility_iterator nodeStart = GetNextNode();
// do we have more than one item with this accel? // do we have more than one item with this accel?
bool notUnique = FALSE; bool notUnique = false;
// translate everything to lower case before comparing // translate everything to lower case before comparing
wxChar chAccel = wxTolower(key); wxChar chAccel = wxTolower(key);
@@ -998,7 +998,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
} }
else // we already had found such item else // we already had found such item
{ {
notUnique = TRUE; notUnique = true;
// no need to continue further, we won't find // no need to continue further, we won't find
// anything we don't already know // anything we don't already know
@@ -1031,12 +1031,12 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
//else: just select it but don't activate as the user might //else: just select it but don't activate as the user might
// have wanted to activate another item // have wanted to activate another item
// skip "processed = FALSE" below // skip "processed = false" below
break; break;
} }
} }
processed = FALSE; processed = false;
} }
return processed; return processed;
@@ -1124,11 +1124,6 @@ void wxMenu::EndRadioGroup()
wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{ {
#if 0
// not used at all
bool check = FALSE;
#endif
if ( item->GetKind() == wxITEM_RADIO ) if ( item->GetKind() == wxITEM_RADIO )
{ {
int count = GetMenuItemCount(); int count = GetMenuItemCount();
@@ -1141,12 +1136,6 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
// for now it has just one element // for now it has just one element
item->SetAsRadioGroupStart(); item->SetAsRadioGroupStart();
item->SetRadioGroupEnd(m_startRadioGroup); item->SetRadioGroupEnd(m_startRadioGroup);
// ensure that we have a checked item in the radio group
#if 0
// not used at all
check = TRUE;
#endif
} }
else // extend the current radio group else // extend the current radio group
{ {
@@ -1330,7 +1319,7 @@ void wxMenu::OnDismiss(bool dismissParent)
{ {
// dismissParent is recursive // dismissParent is recursive
m_menuParent->Dismiss(); m_menuParent->Dismiss();
m_menuParent->OnDismiss(TRUE); m_menuParent->OnDismiss(true);
} }
} }
else // no parent menu else // no parent menu
@@ -1396,7 +1385,7 @@ void wxMenu::Dismiss()
bool wxMenu::ProcessKeyDown(int key) bool wxMenu::ProcessKeyDown(int key)
{ {
wxCHECK_MSG( m_popupMenu, FALSE, wxCHECK_MSG( m_popupMenu, false,
_T("can't process key events if not shown") ); _T("can't process key events if not shown") );
return m_popupMenu->ProcessKeyDown(key); return m_popupMenu->ProcessKeyDown(key);
@@ -1447,12 +1436,12 @@ bool wxMenu::ProcessAccelEvent(const wxKeyEvent& event)
// try its elements // try its elements
if ( item->GetSubMenu()->ProcessAccelEvent(event) ) if ( item->GetSubMenu()->ProcessAccelEvent(event) )
{ {
return TRUE; return true;
} }
} }
} }
return FALSE; return false;
} }
void wxMenu::AddAccelFor(wxMenuItem *item) void wxMenu::AddAccelFor(wxMenuItem *item)
@@ -1494,10 +1483,10 @@ wxMenuItem::wxMenuItem(wxMenu *parentMenu,
: wxMenuItemBase(parentMenu, id, text, help, kind, subMenu) : wxMenuItemBase(parentMenu, id, text, help, kind, subMenu)
{ {
m_posY = m_posY =
m_height = -1; m_height = wxDefaultCoord;
m_radioGroup.start = -1; m_radioGroup.start = -1;
m_isRadioGroupStart = FALSE; m_isRadioGroupStart = false;
m_bmpDisabled = wxNullBitmap; m_bmpDisabled = wxNullBitmap;
@@ -1630,7 +1619,7 @@ void wxMenuItem::Check(bool check)
{ {
if ( n != pos ) if ( n != pos )
{ {
node->GetData()->m_isChecked = FALSE; node->GetData()->m_isChecked = false;
} }
node = node->GetNext(); node = node->GetNext();
} }
@@ -1646,7 +1635,7 @@ void wxMenuItem::Check(bool check)
void wxMenuItem::SetAsRadioGroupStart() void wxMenuItem::SetAsRadioGroupStart()
{ {
m_isRadioGroupStart = TRUE; m_isRadioGroupStart = true;
} }
void wxMenuItem::SetRadioGroupStart(int start) void wxMenuItem::SetRadioGroupStart(int start)
@@ -1677,7 +1666,7 @@ void wxMenuBar::Init()
m_menuShown = NULL; m_menuShown = NULL;
m_shouldShowMenu = FALSE; m_shouldShowMenu = false;
} }
void wxMenuBar::Attach(wxFrame *frame) void wxMenuBar::Attach(wxFrame *frame)
@@ -1701,14 +1690,14 @@ void wxMenuBar::Attach(wxFrame *frame)
else // not created yet, do it now else // not created yet, do it now
{ {
// we have no way to return the error from here anyhow :-( // we have no way to return the error from here anyhow :-(
(void)Create(frame, -1); (void)Create(frame, wxID_ANY);
SetCursor(wxCURSOR_ARROW); SetCursor(wxCURSOR_ARROW);
SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT)); SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
// calculate and set our height (it won't be changed any more) // calculate and set our height (it won't be changed any more)
SetSize(-1, GetBestSize().y); SetSize(wxDefaultCoord, GetBestSize().y);
} }
// remember the last frame which had us to avoid unnecessarily reparenting // remember the last frame which had us to avoid unnecessarily reparenting
@@ -1743,14 +1732,14 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{ {
if ( !wxMenuBarBase::Insert(pos, menu, title) ) if ( !wxMenuBarBase::Insert(pos, menu, title) )
return FALSE; return false;
wxMenuInfo *info = new wxMenuInfo(title); wxMenuInfo *info = new wxMenuInfo(title);
m_menuInfos.Insert(info, pos); m_menuInfos.Insert(info, pos);
RefreshAllItemsAfter(pos); RefreshAllItemsAfter(pos);
return TRUE; return true;
} }
wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
@@ -1814,7 +1803,7 @@ void wxMenuBar::EnableTop(size_t pos, bool enable)
bool wxMenuBar::IsEnabledTop(size_t pos) const bool wxMenuBar::IsEnabledTop(size_t pos) const
{ {
wxCHECK_MSG( pos < GetCount(), FALSE, _T("invalid index in IsEnabledTop") ); wxCHECK_MSG( pos < GetCount(), false, _T("invalid index in IsEnabledTop") );
return m_menuInfos[pos].IsEnabled(); return m_menuInfos[pos].IsEnabled();
} }
@@ -2025,7 +2014,7 @@ void wxMenuBar::DoSelectMenu(size_t pos)
if ( IsShowingMenu() ) if ( IsShowingMenu() )
{ {
// restore m_shouldShowMenu flag after DismissMenu() which resets // restore m_shouldShowMenu flag after DismissMenu() which resets
// it to FALSE // it to false
bool old = m_shouldShowMenu; bool old = m_shouldShowMenu;
DismissMenu(); DismissMenu();
@@ -2101,7 +2090,7 @@ void wxMenuBar::OnLeftDown(wxMouseEvent& event)
RefreshItem((size_t)m_current); RefreshItem((size_t)m_current);
// show the menu // show the menu
PopupCurrentMenu(FALSE /* don't select first item - as Windows does */); PopupCurrentMenu(false /* don't select first item - as Windows does */);
} }
} }
} }
@@ -2128,7 +2117,7 @@ bool wxMenuBar::ProcessMouseEvent(const wxPoint& pt)
static wxPoint s_ptLast; static wxPoint s_ptLast;
if ( pt == s_ptLast ) if ( pt == s_ptLast )
{ {
return FALSE; return false;
} }
s_ptLast = pt; s_ptLast = pt;
@@ -2137,7 +2126,7 @@ bool wxMenuBar::ProcessMouseEvent(const wxPoint& pt)
int currentNew = GetMenuFromPoint(pt); int currentNew = GetMenuFromPoint(pt);
if ( (currentNew == -1) || (currentNew == m_current) ) if ( (currentNew == -1) || (currentNew == m_current) )
{ {
return FALSE; return false;
} }
// select the new active item // select the new active item
@@ -2148,10 +2137,10 @@ bool wxMenuBar::ProcessMouseEvent(const wxPoint& pt)
if ( m_shouldShowMenu && !m_menuShown) if ( m_shouldShowMenu && !m_menuShown)
{ {
// open the new menu if the old one we closed had been opened // open the new menu if the old one we closed had been opened
PopupCurrentMenu(FALSE /* don't select first item - as Windows does */); PopupCurrentMenu(false /* don't select first item - as Windows does */);
} }
return TRUE; return true;
} }
void wxMenuBar::OnKeyDown(wxKeyEvent& event) void wxMenuBar::OnKeyDown(wxKeyEvent& event)
@@ -2303,7 +2292,7 @@ int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
// do we have more than one item with this accel? // do we have more than one item with this accel?
if ( unique ) if ( unique )
*unique = TRUE; *unique = true;
// translate everything to lower case before comparing // translate everything to lower case before comparing
wxChar chAccel = wxTolower(key); wxChar chAccel = wxTolower(key);
@@ -2343,7 +2332,7 @@ int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
else // we already had found such item else // we already had found such item
{ {
if ( unique ) if ( unique )
*unique = FALSE; *unique = false;
// no need to continue further, we won't find // no need to continue further, we won't find
// anything we don't already know // anything we don't already know
@@ -2384,13 +2373,13 @@ bool wxMenuBar::ProcessAccelEvent(const wxKeyEvent& event)
if ( node->GetData()->ProcessAccelEvent(event) ) if ( node->GetData()->ProcessAccelEvent(event) )
{ {
// menu processed it // menu processed it
return TRUE; return true;
} }
} }
} }
// not found // not found
return FALSE; return false;
} }
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
@@ -2407,7 +2396,7 @@ void wxMenuBar::PopupCurrentMenu(bool selectFirst)
wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") ); wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") );
// in any case, we should show it - even if we won't // in any case, we should show it - even if we won't
m_shouldShowMenu = TRUE; m_shouldShowMenu = true;
if ( IsEnabledTop(m_current) ) if ( IsEnabledTop(m_current) )
{ {
@@ -2445,7 +2434,7 @@ void wxMenuBar::DismissMenu()
void wxMenuBar::OnDismissMenu(bool dismissMenuBar) void wxMenuBar::OnDismissMenu(bool dismissMenuBar)
{ {
m_shouldShowMenu = FALSE; m_shouldShowMenu = false;
m_menuShown = NULL; m_menuShown = NULL;
if ( dismissMenuBar ) if ( dismissMenuBar )
{ {
@@ -2485,7 +2474,7 @@ wxEventLoop *wxWindow::ms_evtLoopPopup = NULL;
bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
{ {
wxCHECK_MSG( !ms_evtLoopPopup, FALSE, wxCHECK_MSG( !ms_evtLoopPopup, false,
_T("can't show more than one popup menu at a time") ); _T("can't show more than one popup menu at a time") );
#ifdef __WXMSW__ #ifdef __WXMSW__
@@ -2535,7 +2524,7 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
ms_evtLoopPopup = NULL; ms_evtLoopPopup = NULL;
// remove the handler // remove the handler
PopEventHandler(TRUE /* delete it */); PopEventHandler(true /* delete it */);
menu->SetInvokingWindow(NULL); menu->SetInvokingWindow(NULL);
@@ -2543,7 +2532,7 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y)
SetCursor(cursorOld); SetCursor(cursorOld);
#endif // __WXMSW__ #endif // __WXMSW__
return TRUE; return true;
} }
void wxWindow::DismissPopupMenu() void wxWindow::DismissPopupMenu()

View File

@@ -68,7 +68,7 @@ class wxNotebookSpinBtn : public wxSpinButton
{ {
public: public:
wxNotebookSpinBtn(wxNotebook *nb) wxNotebookSpinBtn(wxNotebook *nb)
: wxSpinButton(nb, -1, : wxSpinButton(nb, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL) nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL)
{ {
@@ -88,7 +88,7 @@ private:
}; };
BEGIN_EVENT_TABLE(wxNotebookSpinBtn, wxSpinButton) BEGIN_EVENT_TABLE(wxNotebookSpinBtn, wxSpinButton)
EVT_SPIN(-1, wxNotebookSpinBtn::OnSpin) EVT_SPIN(wxID_ANY, wxNotebookSpinBtn::OnSpin)
END_EVENT_TABLE() END_EVENT_TABLE()
// ============================================================================ // ============================================================================
@@ -127,7 +127,7 @@ bool wxNotebook::Create(wxWindow *parent,
{ {
if ( !wxControl::Create(parent, id, pos, size, style, if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) ) wxDefaultValidator, name) )
return FALSE; return false;
m_sizePad = GetRenderer()->GetTabPadding(); m_sizePad = GetRenderer()->GetTabPadding();
@@ -135,7 +135,7 @@ bool wxNotebook::Create(wxWindow *parent,
CreateInputHandler(wxINP_HANDLER_NOTEBOOK); CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -151,7 +151,7 @@ wxString wxNotebook::GetPageText(size_t nPage) const
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") );
if ( strText != m_titles[nPage] ) if ( strText != m_titles[nPage] )
{ {
@@ -169,7 +169,7 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
} }
} }
return TRUE; return true;
} }
int wxNotebook::GetPageImage(size_t nPage) const int wxNotebook::GetPageImage(size_t nPage) const
@@ -181,9 +181,9 @@ int wxNotebook::GetPageImage(size_t nPage) const
bool wxNotebook::SetPageImage(size_t nPage, int nImage) bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{ {
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") );
wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE, wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false,
_T("invalid image index in SetPageImage()") ); _T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] ) if ( nImage != m_images[nPage] )
@@ -200,7 +200,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage)
RefreshTab(nPage); RefreshTab(nPage);
} }
return TRUE; return true;
} }
wxNotebook::~wxNotebook() wxNotebook::~wxNotebook()
@@ -242,7 +242,7 @@ int wxNotebook::SetSelection(size_t nPage)
if ( selOld != INVALID_PAGE ) if ( selOld != INVALID_PAGE )
{ {
RefreshTab(selOld, TRUE /* this tab was selected */); RefreshTab(selOld, true /* this tab was selected */);
m_pages[selOld]->Hide(); m_pages[selOld]->Hide();
} }
@@ -293,7 +293,7 @@ bool wxNotebook::InsertPage(size_t nPage,
int imageId) int imageId)
{ {
size_t nPages = GetPageCount(); size_t nPages = GetPageCount();
wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage), FALSE, wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage), false,
_T("invalid notebook page in InsertPage()") ); _T("invalid notebook page in InsertPage()") );
// modify the data // modify the data
@@ -325,7 +325,7 @@ bool wxNotebook::InsertPage(size_t nPage,
if ( nPages == 0 ) if ( nPages == 0 )
{ {
// always select the first tab to have at least some selection // always select the first tab to have at least some selection
bSelect = TRUE; bSelect = true;
Relayout(); Relayout();
Refresh(); Refresh();
@@ -344,13 +344,13 @@ bool wxNotebook::InsertPage(size_t nPage,
pPage->Hide(); pPage->Hide();
} }
return TRUE; return true;
} }
bool wxNotebook::DeleteAllPages() bool wxNotebook::DeleteAllPages()
{ {
if ( !wxNotebookBase::DeleteAllPages() ) if ( !wxNotebookBase::DeleteAllPages() )
return FALSE; return false;
// clear the other arrays as well // clear the other arrays as well
m_titles.Clear(); m_titles.Clear();
@@ -366,7 +366,7 @@ bool wxNotebook::DeleteAllPages()
Relayout(); Relayout();
return TRUE; return true;
} }
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
@@ -470,7 +470,7 @@ void wxNotebook::DoDrawTab(wxDC& dc, const wxRect& rect, size_t n)
wxMemoryDC dc; wxMemoryDC dc;
dc.SelectObject(bmp); dc.SelectObject(bmp);
dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, TRUE); m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true);
dc.SelectObject(wxNullBitmap); dc.SelectObject(wxNullBitmap);
#else #else
bmp = *m_imageList->GetBitmap(image); bmp = *m_imageList->GetBitmap(image);
@@ -833,7 +833,7 @@ void wxNotebook::ResizeTab(int page)
wxSize sizeTab = CalcTabSize(page); wxSize sizeTab = CalcTabSize(page);
// we only need full relayout if the page size changes // we only need full relayout if the page size changes
bool needsRelayout = FALSE; bool needsRelayout = false;
if ( IsVertical() ) if ( IsVertical() )
{ {
@@ -845,7 +845,7 @@ void wxNotebook::ResizeTab(int page)
if ( sizeTab.y > m_heightTab ) if ( sizeTab.y > m_heightTab )
{ {
needsRelayout = TRUE; needsRelayout = true;
m_heightTab = sizeTab.y; m_heightTab = sizeTab.y;
} }
@@ -1071,7 +1071,7 @@ void wxNotebook::UpdateSpinBtn()
{ {
// this case is special, get rid of it immediately: everything is // this case is special, get rid of it immediately: everything is
// visible and we don't need any spin buttons // visible and we don't need any spin buttons
allTabsShown = TRUE; allTabsShown = true;
// have to reset them manually as we don't call CalcLastVisibleTab() // have to reset them manually as we don't call CalcLastVisibleTab()
m_firstVisible = m_firstVisible =
@@ -1301,15 +1301,15 @@ bool wxNotebook::PerformAction(const wxControlAction& action,
const wxString& strArg) const wxString& strArg)
{ {
if ( action == wxACTION_NOTEBOOK_NEXT ) if ( action == wxACTION_NOTEBOOK_NEXT )
SetSelection(GetNextPage(TRUE)); SetSelection(GetNextPage(true));
else if ( action == wxACTION_NOTEBOOK_PREV ) else if ( action == wxACTION_NOTEBOOK_PREV )
SetSelection(GetNextPage(FALSE)); SetSelection(GetNextPage(false));
else if ( action == wxACTION_NOTEBOOK_GOTO ) else if ( action == wxACTION_NOTEBOOK_GOTO )
SetSelection((int)numArg); SetSelection((int)numArg);
else else
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1365,7 +1365,7 @@ bool wxStdNotebookInputHandler::HandleKey(wxInputConsumer *consumer,
break; break;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
return consumer->PerformAction(action, page); return consumer->PerformAction(action, page);
} }
@@ -1385,7 +1385,7 @@ bool wxStdNotebookInputHandler::HandleMouse(wxInputConsumer *consumer,
{ {
consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page); consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page);
return FALSE; return false;
} }
} }
@@ -1404,7 +1404,7 @@ wxStdNotebookInputHandler::HandleFocus(wxInputConsumer *consumer,
{ {
HandleFocusChange(consumer); HandleFocusChange(consumer);
return FALSE; return false;
} }
bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer, bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
@@ -1413,7 +1413,7 @@ bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
// we react to the focus change in the same way as to the [de]activation // we react to the focus change in the same way as to the [de]activation
HandleFocusChange(consumer); HandleFocusChange(consumer);
return FALSE; return false;
} }
void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer) void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)

View File

@@ -74,7 +74,7 @@ public:
{ {
if ( m_radio->OnKeyDown((wxKeyEvent &)event) ) if ( m_radio->OnKeyDown((wxKeyEvent &)event) )
{ {
return TRUE; return true;
} }
} }
@@ -169,7 +169,7 @@ bool wxRadioBox::Create(wxWindow *parent,
} }
if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) ) if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) )
return FALSE; return false;
#if wxUSE_VALIDATORS #if wxUSE_VALIDATORS
SetValidator(val); SetValidator(val);
@@ -193,7 +193,7 @@ bool wxRadioBox::Create(wxWindow *parent,
// radiobox should already have selection so select at least one item // radiobox should already have selection so select at least one item
SetSelection(0); SetSelection(0);
return TRUE; return true;
} }
wxRadioBox::~wxRadioBox() wxRadioBox::~wxRadioBox()
@@ -205,7 +205,7 @@ wxRadioBox::~wxRadioBox()
size_t count = m_buttons.GetCount(); size_t count = m_buttons.GetCount();
for ( size_t n = 0; n < count; n++ ) for ( size_t n = 0; n < count; n++ )
{ {
m_buttons[n]->PopEventHandler(TRUE /* delete it */); m_buttons[n]->PopEventHandler(true /* delete it */);
delete m_buttons[n]; delete m_buttons[n];
} }
@@ -246,7 +246,7 @@ void wxRadioBox::Append(int count, const wxString *choices)
{ {
// make the first button in the box the start of new group by giving it // make the first button in the box the start of new group by giving it
// wxRB_GROUP style // wxRB_GROUP style
wxRadioButton *btn = new wxRadioButton(parent, -1, choices[n], wxRadioButton *btn = new wxRadioButton(parent, wxID_ANY, choices[n],
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
n == 0 ? wxRB_GROUP : 0); n == 0 ? wxRB_GROUP : 0);
@@ -273,7 +273,7 @@ void wxRadioBox::SetSelection(int n)
btn->SetFocus(); btn->SetFocus();
// this will also unselect the previously selected button in our group // this will also unselect the previously selected button in our group
btn->SetValue(TRUE); btn->SetValue(true);
} }
int wxRadioBox::GetSelection() const int wxRadioBox::GetSelection() const
@@ -343,7 +343,7 @@ void wxRadioBox::Show(int n, bool show)
bool wxRadioBox::Enable(bool enable) bool wxRadioBox::Enable(bool enable)
{ {
if ( !wxStaticBox::Enable(enable) ) if ( !wxStaticBox::Enable(enable) )
return FALSE; return false;
// also enable/disable the buttons // also enable/disable the buttons
size_t count = m_buttons.GetCount(); size_t count = m_buttons.GetCount();
@@ -352,13 +352,13 @@ bool wxRadioBox::Enable(bool enable)
Enable(n, enable); Enable(n, enable);
} }
return TRUE; return true;
} }
bool wxRadioBox::Show(bool show) bool wxRadioBox::Show(bool show)
{ {
if ( !wxStaticBox::Show(show) ) if ( !wxStaticBox::Show(show) )
return FALSE; return false;
// also show/hide the buttons // also show/hide the buttons
size_t count = m_buttons.GetCount(); size_t count = m_buttons.GetCount();
@@ -367,7 +367,7 @@ bool wxRadioBox::Show(bool show)
Show(n, show); Show(n, show);
} }
return TRUE; return true;
} }
wxString wxRadioBox::GetLabel() const wxString wxRadioBox::GetLabel() const
@@ -517,7 +517,7 @@ bool wxRadioBox::OnKeyDown(wxKeyEvent& event)
break; break;
default: default:
return FALSE; return false;
} }
int selOld = GetSelection(); int selOld = GetSelection();
@@ -530,7 +530,7 @@ bool wxRadioBox::OnKeyDown(wxKeyEvent& event)
SendRadioEvent(); SendRadioEvent();
} }
return TRUE; return true;
} }
#endif // wxUSE_RADIOBOX #endif // wxUSE_RADIOBOX

View File

@@ -62,10 +62,10 @@ bool wxRadioButton::Create(wxWindow *parent,
if ( !wxCheckBox::Create(parent, id, label, pos, size, style, if ( !wxCheckBox::Create(parent, id, label, pos, size, style,
validator, name) ) validator, name) )
{ {
return FALSE; return false;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -134,7 +134,7 @@ void wxRadioButton::ClearValue()
{ {
if ( IsChecked() ) if ( IsChecked() )
{ {
SetValue(FALSE); SetValue(false);
} }
} }

View File

@@ -181,10 +181,10 @@ bool wxScrollArrows::HandleMouseMove(const wxMouseEvent& event) const
if ( arrow == m_captureData->m_arrowPressed ) if ( arrow == m_captureData->m_arrowPressed )
{ {
// resume now // resume now
m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, TRUE); m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
timer->Start(); timer->Start();
return TRUE; return true;
} }
} }
else // if ( 1 ) FIXME: m_control->ShouldPauseScrolling() ) else // if ( 1 ) FIXME: m_control->ShouldPauseScrolling() )
@@ -194,14 +194,14 @@ bool wxScrollArrows::HandleMouseMove(const wxMouseEvent& event) const
{ {
// stop as the mouse left the arrow // stop as the mouse left the arrow
m_control->SetArrowFlag(m_captureData->m_arrowPressed, m_control->SetArrowFlag(m_captureData->m_arrowPressed,
wxCONTROL_PRESSED, FALSE); wxCONTROL_PRESSED, false);
timer->Stop(); timer->Stop();
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
// reset the wxCONTROL_CURRENT flag for the arrows which don't have the // reset the wxCONTROL_CURRENT flag for the arrows which don't have the
@@ -209,7 +209,7 @@ bool wxScrollArrows::HandleMouseMove(const wxMouseEvent& event) const
UpdateCurrentFlag(Arrow_First, arrow); UpdateCurrentFlag(Arrow_First, arrow);
UpdateCurrentFlag(Arrow_Second, arrow); UpdateCurrentFlag(Arrow_Second, arrow);
// return TRUE if it was really an event for an arrow // return true if it was really an event for an arrow
return !event.Leaving() && arrow != Arrow_None; return !event.Leaving() && arrow != Arrow_None;
} }
@@ -219,7 +219,7 @@ bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const
if ( btn == -1 ) if ( btn == -1 )
{ {
// we only care about button press/release events // we only care about button press/release events
return FALSE; return false;
} }
if ( event.ButtonDown() || event.ButtonDClick() ) if ( event.ButtonDown() || event.ButtonDClick() )
@@ -230,13 +230,13 @@ bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const
if ( arrow == Arrow_None ) if ( arrow == Arrow_None )
{ {
// mouse pressed over something else // mouse pressed over something else
return FALSE; return false;
} }
if ( m_control->GetArrowState(arrow) & wxCONTROL_DISABLED ) if ( m_control->GetArrowState(arrow) & wxCONTROL_DISABLED )
{ {
// don't allow to press disabled arrows // don't allow to press disabled arrows
return TRUE; return true;
} }
wxConstCast(this, wxScrollArrows)->m_captureData = wxConstCast(this, wxScrollArrows)->m_captureData =
@@ -257,7 +257,7 @@ bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const
{ {
m_captureData->m_timerScroll = tmpTimerScroll; m_captureData->m_timerScroll = tmpTimerScroll;
m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, TRUE); m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
} }
else else
{ {
@@ -274,14 +274,14 @@ bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const
delete m_captureData; delete m_captureData;
wxConstCast(this, wxScrollArrows)->m_captureData = NULL; wxConstCast(this, wxScrollArrows)->m_captureData = NULL;
m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, FALSE); m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, false);
} }
else else
{ {
// we don't process this // we don't process this
return FALSE; return false;
} }
return TRUE; return true;
} }

View File

@@ -133,7 +133,7 @@ void wxScrollBar::Init()
m_elementsState[n] = 0; m_elementsState[n] = 0;
} }
m_dirty = FALSE; m_dirty = false;
} }
bool wxScrollBar::Create(wxWindow *parent, bool wxScrollBar::Create(wxWindow *parent,
@@ -148,7 +148,7 @@ bool wxScrollBar::Create(wxWindow *parent,
style &= ~wxBORDER_MASK; style &= ~wxBORDER_MASK;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
SetBestSize(size); SetBestSize(size);
@@ -157,7 +157,7 @@ bool wxScrollBar::Create(wxWindow *parent,
CreateInputHandler(wxINP_HANDLER_SCROLLBAR); CreateInputHandler(wxINP_HANDLER_SCROLLBAR);
return TRUE; return true;
} }
wxScrollBar::~wxScrollBar() wxScrollBar::~wxScrollBar()
@@ -173,7 +173,7 @@ bool wxScrollBar::IsStandalone() const
wxWindow *parent = GetParent(); wxWindow *parent = GetParent();
if ( !parent ) if ( !parent )
{ {
return TRUE; return true;
} }
return (parent->GetScrollbar(wxHORIZONTAL) != this) && return (parent->GetScrollbar(wxHORIZONTAL) != this) &&
@@ -222,7 +222,7 @@ void wxScrollBar::DoSetThumb(int pos)
m_elementsState[Element_Thumb] |= wxCONTROL_DIRTY; m_elementsState[Element_Thumb] |= wxCONTROL_DIRTY;
m_elementsState[m_thumbPos > m_thumbPosOld m_elementsState[m_thumbPos > m_thumbPosOld
? Element_Bar_1 : Element_Bar_2] |= wxCONTROL_DIRTY; ? Element_Bar_1 : Element_Bar_2] |= wxCONTROL_DIRTY;
m_dirty = TRUE; m_dirty = true;
} }
int wxScrollBar::GetThumbPosition() const int wxScrollBar::GetThumbPosition() const
@@ -376,7 +376,7 @@ void wxScrollBar::UpdateThumb()
} }
#ifdef WXDEBUG_SCROLLBAR #ifdef WXDEBUG_SCROLLBAR
static bool s_refreshDebug = FALSE; static bool s_refreshDebug = false;
if ( s_refreshDebug ) if ( s_refreshDebug )
{ {
wxClientDC dc(this); wxClientDC dc(this);
@@ -392,14 +392,14 @@ void wxScrollBar::UpdateThumb()
} }
#endif // WXDEBUG_SCROLLBAR #endif // WXDEBUG_SCROLLBAR
Refresh(FALSE, &rect); Refresh(false, &rect);
} }
m_elementsState[n] &= ~wxCONTROL_DIRTY; m_elementsState[n] &= ~wxCONTROL_DIRTY;
} }
} }
m_dirty = FALSE; m_dirty = false;
} }
} }
@@ -408,7 +408,7 @@ void wxScrollBar::DoDraw(wxControlRenderer *renderer)
renderer->DrawScrollbar(this, m_thumbPosOld); renderer->DrawScrollbar(this, m_thumbPosOld);
// clear all dirty flags // clear all dirty flags
m_dirty = FALSE; m_dirty = false;
m_thumbPosOld = -1; m_thumbPosOld = -1;
} }
@@ -456,7 +456,7 @@ void wxScrollBar::SetState(Element which, int flags)
{ {
m_elementsState[which] = flags | wxCONTROL_DIRTY; m_elementsState[which] = flags | wxCONTROL_DIRTY;
m_dirty = TRUE; m_dirty = true;
} }
} }
@@ -481,7 +481,7 @@ bool wxScrollBar::PerformAction(const wxControlAction& action,
{ {
int thumbOld = m_thumbPos; int thumbOld = m_thumbPos;
bool notify = FALSE; // send an event about the change? bool notify = false; // send an event about the change?
wxEventType scrollType; wxEventType scrollType;
@@ -536,7 +536,7 @@ bool wxScrollBar::PerformAction(const wxControlAction& action,
else if ( action == wxACTION_SCROLL_THUMB_RELEASE ) else if ( action == wxACTION_SCROLL_THUMB_RELEASE )
{ {
// always notify about this // always notify about this
notify = TRUE; notify = true;
scrollType = wxEVT_SCROLLWIN_THUMBRELEASE; scrollType = wxEVT_SCROLLWIN_THUMBRELEASE;
} }
else else
@@ -562,7 +562,7 @@ bool wxScrollBar::PerformAction(const wxControlAction& action,
GetParent()->GetEventHandler()->ProcessEvent(event); GetParent()->GetEventHandler()->ProcessEvent(event);
} }
return TRUE; return true;
} }
void wxScrollBar::ScrollToStart() void wxScrollBar::ScrollToStart()
@@ -578,13 +578,13 @@ void wxScrollBar::ScrollToEnd()
bool wxScrollBar::ScrollLines(int nLines) bool wxScrollBar::ScrollLines(int nLines)
{ {
DoSetThumb(m_thumbPos + nLines); DoSetThumb(m_thumbPos + nLines);
return TRUE; return true;
} }
bool wxScrollBar::ScrollPages(int nPages) bool wxScrollBar::ScrollPages(int nPages)
{ {
DoSetThumb(m_thumbPos + nPages*m_pageSize); DoSetThumb(m_thumbPos + nPages*m_pageSize);
return TRUE; return true;
} }
// ============================================================================ // ============================================================================
@@ -654,12 +654,12 @@ bool wxStdScrollBarInputHandler::OnScrollTimer(wxScrollBar *scrollbar,
int oldThumbPos = scrollbar->GetThumbPosition(); int oldThumbPos = scrollbar->GetThumbPosition();
scrollbar->PerformAction(action); scrollbar->PerformAction(action);
if ( scrollbar->GetThumbPosition() != oldThumbPos ) if ( scrollbar->GetThumbPosition() != oldThumbPos )
return TRUE; return true;
// we scrolled till the end // we scrolled till the end
m_timerScroll->Stop(); m_timerScroll->Stop();
return FALSE; return false;
} }
void wxStdScrollBarInputHandler::StopScrolling(wxScrollBar *control) void wxStdScrollBarInputHandler::StopScrolling(wxScrollBar *control)
@@ -680,7 +680,7 @@ void wxStdScrollBarInputHandler::StopScrolling(wxScrollBar *control)
} }
// unpress the arrow and highlight the current element // unpress the arrow and highlight the current element
Press(control, FALSE); Press(control, false);
} }
wxCoord wxCoord
@@ -721,11 +721,11 @@ bool wxStdScrollBarInputHandler::HandleKey(wxInputConsumer *consumer,
case WXK_NEXT: action = wxACTION_SCROLL_PAGE_DOWN; break; case WXK_NEXT: action = wxACTION_SCROLL_PAGE_DOWN; break;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
consumer->PerformAction(action); consumer->PerformAction(action);
return TRUE; return true;
} }
} }
@@ -758,7 +758,7 @@ bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer,
m_winCapture->CaptureMouse(); m_winCapture->CaptureMouse();
// generate the command // generate the command
bool hasAction = TRUE; bool hasAction = true;
wxControlAction action; wxControlAction action;
switch ( ht ) switch ( ht )
{ {
@@ -788,18 +788,18 @@ bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer,
// fall through: there is no immediate action // fall through: there is no immediate action
default: default:
hasAction = FALSE; hasAction = false;
} }
// remove highlighting // remove highlighting
Highlight(scrollbar, FALSE); Highlight(scrollbar, false);
m_htLast = ht; m_htLast = ht;
// and press the arrow or highlight thumb now instead // and press the arrow or highlight thumb now instead
if ( m_htLast == wxHT_SCROLLBAR_THUMB ) if ( m_htLast == wxHT_SCROLLBAR_THUMB )
Highlight(scrollbar, TRUE); Highlight(scrollbar, true);
else else
Press(scrollbar, TRUE); Press(scrollbar, true);
// start dragging // start dragging
if ( hasAction ) if ( hasAction )
@@ -827,7 +827,7 @@ bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer,
} }
m_htLast = ht; m_htLast = ht;
Highlight(scrollbar, TRUE); Highlight(scrollbar, true);
} }
else else
{ {
@@ -855,11 +855,11 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
// between the mouse position and the top/left of the thumb // between the mouse position and the top/left of the thumb
HandleThumbMove(scrollbar, event); HandleThumbMove(scrollbar, event);
return TRUE; return true;
} }
// no other changes are possible while the mouse is captured // no other changes are possible while the mouse is captured
return FALSE; return false;
} }
bool isArrow = scrollbar->GetArrows().HandleMouseMove(event); bool isArrow = scrollbar->GetArrows().HandleMouseMove(event);
@@ -874,35 +874,35 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
if ( ht == m_htLast ) if ( ht == m_htLast )
{ {
// nothing changed // nothing changed
return FALSE; return false;
} }
#ifdef DEBUG_MOUSE #ifdef DEBUG_MOUSE
wxLogDebug("Scrollbar::OnMouseMove: ht = %d", ht); wxLogDebug("Scrollbar::OnMouseMove: ht = %d", ht);
#endif // DEBUG_MOUSE #endif // DEBUG_MOUSE
Highlight(scrollbar, FALSE); Highlight(scrollbar, false);
m_htLast = ht; m_htLast = ht;
if ( !isArrow ) if ( !isArrow )
Highlight(scrollbar, TRUE); Highlight(scrollbar, true);
//else: already done by wxScrollArrows::HandleMouseMove //else: already done by wxScrollArrows::HandleMouseMove
} }
else if ( event.Leaving() ) else if ( event.Leaving() )
{ {
if ( !isArrow ) if ( !isArrow )
Highlight(scrollbar, FALSE); Highlight(scrollbar, false);
m_htLast = wxHT_NOWHERE; m_htLast = wxHT_NOWHERE;
} }
else // event.Entering() else // event.Entering()
{ {
// we don't process this event // we don't process this event
return FALSE; return false;
} }
// we did something // we did something
return TRUE; return true;
} }
#endif // wxUSE_SCROLLBAR #endif // wxUSE_SCROLLBAR
@@ -913,7 +913,7 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
wxScrollTimer::wxScrollTimer() wxScrollTimer::wxScrollTimer()
{ {
m_skipNext = FALSE; m_skipNext = false;
} }
void wxScrollTimer::StartAutoScroll() void wxScrollTimer::StartAutoScroll()
@@ -928,7 +928,7 @@ void wxScrollTimer::StartAutoScroll()
// there is an initial delay before the scrollbar starts scrolling - // there is an initial delay before the scrollbar starts scrolling -
// implement it by ignoring the first timer expiration and only start // implement it by ignoring the first timer expiration and only start
// scrolling from the second one // scrolling from the second one
m_skipNext = TRUE; m_skipNext = true;
Start(200); // FIXME: hardcoded delay Start(200); // FIXME: hardcoded delay
} }
@@ -940,7 +940,7 @@ void wxScrollTimer::Notify()
Stop(); Stop();
Start(50); // FIXME: hardcoded delay Start(50); // FIXME: hardcoded delay
m_skipNext = FALSE; m_skipNext = false;
} }
else else
{ {

View File

@@ -156,7 +156,7 @@ bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
if ( btn == -1 ) if ( btn == -1 )
{ {
// no... // no...
return FALSE; return false;
} }
// when the mouse is pressed on any scrollbar element, we capture it // when the mouse is pressed on any scrollbar element, we capture it
@@ -166,7 +166,7 @@ bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
if ( HasCapture() ) if ( HasCapture() )
{ {
// mouse already captured, nothing to do // mouse already captured, nothing to do
return FALSE; return false;
} }
// determine which part of the window the user clicked in // determine which part of the window the user clicked in
@@ -175,7 +175,7 @@ bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
if ( shaftPart == Shaft_None ) if ( shaftPart == Shaft_None )
{ {
// mouse pressed over something else // mouse pressed over something else
return FALSE; return false;
} }
// capture the mouse // capture the mouse
@@ -219,15 +219,15 @@ bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const
delete m_captureData; delete m_captureData;
wxConstCast(this, wxScrollThumb)->m_captureData = NULL; wxConstCast(this, wxScrollThumb)->m_captureData = NULL;
m_control->SetShaftPartState(shaftPart, wxCONTROL_PRESSED, FALSE); m_control->SetShaftPartState(shaftPart, wxCONTROL_PRESSED, false);
} }
else // another mouse button released else // another mouse button released
{ {
// we don't process this // we don't process this
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
@@ -242,7 +242,7 @@ bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
} }
// we process all mouse events while the mouse is captured by us // we process all mouse events while the mouse is captured by us
return TRUE; return true;
} }
else // no capture else // no capture
{ {
@@ -260,9 +260,9 @@ bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
if ( shaftPart != m_shaftPart ) if ( shaftPart != m_shaftPart )
{ {
// update the highlighted state // update the highlighted state
m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT, FALSE); m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT, false);
wxConstCast(this, wxScrollThumb)->m_shaftPart = shaftPart; wxConstCast(this, wxScrollThumb)->m_shaftPart = shaftPart;
m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT, TRUE); m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT, true);
} }
// if the event happened on the shaft, it was for us and we processed // if the event happened on the shaft, it was for us and we processed

View File

@@ -143,7 +143,7 @@ bool wxSlider::Create(wxWindow *parent,
{ {
if ( !wxSliderBase::Create(parent, id, pos, size, style, if ( !wxSliderBase::Create(parent, id, pos, size, style,
validator, name) ) validator, name) )
return FALSE; return false;
SetRange(minValue, maxValue); SetRange(minValue, maxValue);
SetValue(value); SetValue(value);
@@ -154,7 +154,7 @@ bool wxSlider::Create(wxWindow *parent,
CreateInputHandler(wxINP_HANDLER_SLIDER); CreateInputHandler(wxINP_HANDLER_SLIDER);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -184,11 +184,11 @@ bool wxSlider::ChangeValueBy(int inc)
bool wxSlider::ChangeValueTo(int value) bool wxSlider::ChangeValueTo(int value)
{ {
// check if the value is going to change at all // check if the value is going to change at all
if (value == m_value) return FALSE; if (value == m_value) return false;
// this method is protected and we should only call it with normalized // this method is protected and we should only call it with normalized
// value! // value!
wxCHECK_MSG( IsInRange(value), FALSE, _T("invalid slider value") ); wxCHECK_MSG( IsInRange(value), false, _T("invalid slider value") );
m_value = value; m_value = value;
@@ -201,7 +201,7 @@ bool wxSlider::ChangeValueTo(int value)
(void)GetEventHandler()->ProcessEvent(event); (void)GetEventHandler()->ProcessEvent(event);
return TRUE; return true;
} }
void wxSlider::SetValue(int value) void wxSlider::SetValue(int value)
@@ -773,7 +773,7 @@ bool wxSlider::PerformAction(const wxControlAction& action,
else if ( action == wxACTION_SLIDER_THUMB_DRAG ) else if ( action == wxACTION_SLIDER_THUMB_DRAG )
{ {
// no special processing for it // no special processing for it
return TRUE; return true;
} }
else if ( action == wxACTION_SLIDER_THUMB_MOVE || else if ( action == wxACTION_SLIDER_THUMB_MOVE ||
action == wxACTION_SLIDER_THUMB_RELEASE ) action == wxACTION_SLIDER_THUMB_RELEASE )
@@ -785,7 +785,7 @@ bool wxSlider::PerformAction(const wxControlAction& action,
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -987,11 +987,11 @@ bool wxStdSliderButtonInputHandler::HandleKey(wxInputConsumer *consumer,
break; break;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
consumer->PerformAction(action); consumer->PerformAction(action);
return TRUE; return true;
} }
} }
@@ -1006,7 +1006,7 @@ bool wxStdSliderButtonInputHandler::HandleMouse(wxInputConsumer *consumer,
if ( slider->GetThumb().HandleMouse(event) ) if ( slider->GetThumb().HandleMouse(event) )
{ {
// processed by the thumb // processed by the thumb
return FALSE; return false;
} }
return wxStdInputHandler::HandleMouse(consumer, event); return wxStdInputHandler::HandleMouse(consumer, event);
@@ -1020,7 +1020,7 @@ bool wxStdSliderButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer,
if ( slider->GetThumb().HandleMouseMove(event) ) if ( slider->GetThumb().HandleMouseMove(event) )
{ {
// processed by the thumb // processed by the thumb
return FALSE; return false;
} }
return wxStdInputHandler::HandleMouseMove(consumer, event); return wxStdInputHandler::HandleMouseMove(consumer, event);
@@ -1031,7 +1031,7 @@ wxStdSliderButtonInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer),
const wxFocusEvent& WXUNUSED(event)) const wxFocusEvent& WXUNUSED(event))
{ {
// slider's appearance changes when it gets/loses focus // slider's appearance changes when it gets/loses focus
return TRUE; return true;
} }
#endif // wxUSE_SLIDER #endif // wxUSE_SLIDER

View File

@@ -101,13 +101,13 @@ bool wxSpinButton::Create(wxWindow *parent,
if ( !wxSpinButtonBase::Create(parent, id, pos, size, style, if ( !wxSpinButtonBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) ) wxDefaultValidator, name) )
return FALSE; return false;
SetBestSize(size); SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_SPINBTN); CreateInputHandler(wxINP_HANDLER_SPINBTN);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -167,7 +167,7 @@ bool wxSpinButton::ChangeValue(int inc)
{ {
// nothing changed - most likely because we are already at min/max // nothing changed - most likely because we are already at min/max
// value // value
return FALSE; return false;
} }
wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN, wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN,
@@ -178,7 +178,7 @@ bool wxSpinButton::ChangeValue(int inc)
if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() ) if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
{ {
// programm has vetoed the event // programm has vetoed the event
return FALSE; return false;
} }
m_value = valueNew; m_value = valueNew;
@@ -187,7 +187,7 @@ bool wxSpinButton::ChangeValue(int inc)
event.SetEventType(wxEVT_SCROLL_THUMBTRACK); event.SetEventType(wxEVT_SCROLL_THUMBTRACK);
(void)GetEventHandler()->ProcessEvent(event); (void)GetEventHandler()->ProcessEvent(event);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -357,7 +357,7 @@ bool wxSpinButton::PerformAction(const wxControlAction& action,
else else
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -390,11 +390,11 @@ bool wxStdSpinButtonInputHandler::HandleKey(wxInputConsumer *consumer,
break; break;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
consumer->PerformAction(action); consumer->PerformAction(action);
return TRUE; return true;
} }
} }
@@ -409,7 +409,7 @@ bool wxStdSpinButtonInputHandler::HandleMouse(wxInputConsumer *consumer,
if ( spinbtn->GetArrows().HandleMouse(event) ) if ( spinbtn->GetArrows().HandleMouse(event) )
{ {
// don't refresh, everything is already done // don't refresh, everything is already done
return FALSE; return false;
} }
return wxStdInputHandler::HandleMouse(consumer, event); return wxStdInputHandler::HandleMouse(consumer, event);
@@ -423,7 +423,7 @@ bool wxStdSpinButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer,
if ( spinbtn->GetArrows().HandleMouseMove(event) ) if ( spinbtn->GetArrows().HandleMouseMove(event) )
{ {
// processed by the arrows // processed by the arrows
return FALSE; return false;
} }
return wxStdInputHandler::HandleMouseMove(consumer, event); return wxStdInputHandler::HandleMouseMove(consumer, event);

View File

@@ -58,7 +58,7 @@ bool wxStaticBitmap::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;
// set bitmap first // set bitmap first
SetBitmap(label); SetBitmap(label);
@@ -66,7 +66,7 @@ bool wxStaticBitmap::Create(wxWindow *parent,
// and adjust our size to fit it after this // and adjust our size to fit it after this
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -56,11 +56,11 @@ bool wxStaticBox::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;
SetLabel(label); SetLabel(label);
return TRUE; return true;
} }
void wxStaticBox::DoDraw(wxControlRenderer *renderer) void wxStaticBox::DoDraw(wxControlRenderer *renderer)

View File

@@ -56,13 +56,13 @@ bool wxStaticLine::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;
wxSize sizeReal = AdjustSize(size); wxSize sizeReal = AdjustSize(size);
if ( sizeReal != size ) if ( sizeReal != size )
SetSize(sizeReal); SetSize(sizeReal);
return TRUE; return true;
} }
void wxStaticLine::DoDraw(wxControlRenderer *renderer) void wxStaticLine::DoDraw(wxControlRenderer *renderer)

View File

@@ -57,12 +57,12 @@ bool wxStaticText::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;
SetLabel(label); SetLabel(label);
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -68,7 +68,7 @@ bool wxStatusBarUniv::Create(wxWindow *parent,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
style, name) ) style, name) )
{ {
return FALSE; return false;
} }
SetFieldsCount(1); SetFieldsCount(1);
@@ -77,7 +77,7 @@ bool wxStatusBarUniv::Create(wxWindow *parent,
SetSize(DoGetBestSize()); SetSize(DoGetBestSize());
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -254,7 +254,7 @@ void wxStatusBarUniv::OnSize(wxSizeEvent& event)
bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const
{ {
wxCHECK_MSG( n >= 0 && n < m_nFields, FALSE, wxCHECK_MSG( n >= 0 && n < m_nFields, false,
_T("invalid field index in GetFieldRect()") ); _T("invalid field index in GetFieldRect()") );
// this is a fix for a bug exhibited by the statbar sample: if // this is a fix for a bug exhibited by the statbar sample: if
@@ -265,7 +265,7 @@ bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const
rect = DoGetFieldRect(n); rect = DoGetFieldRect(n);
return TRUE; return true;
} }
wxRect wxStatusBarUniv::DoGetFieldRect(int n) const wxRect wxStatusBarUniv::DoGetFieldRect(int n) const

View File

@@ -44,7 +44,7 @@
Everywhere in this file LINE refers to a logical line of text, and ROW to a Everywhere in this file LINE refers to a logical line of text, and ROW to a
physical line of text on the display. They are the same unless WrapLines() physical line of text on the display. They are the same unless WrapLines()
is TRUE in which case a single LINE may correspond to multiple ROWs. is true in which case a single LINE may correspond to multiple ROWs.
A text position is an unsigned int (which for reasons of compatibility is A text position is an unsigned int (which for reasons of compatibility is
still a long) from 0 to GetLastPosition() inclusive. The positions still a long) from 0 to GetLastPosition() inclusive. The positions
@@ -270,7 +270,7 @@ struct WXDLLEXPORT wxTextMultiLineData
m_scrollRangeY = 0; m_scrollRangeY = 0;
m_updateScrollbarX = m_updateScrollbarX =
m_updateScrollbarY = FALSE; m_updateScrollbarY = false;
m_widthMax = -1; m_widthMax = -1;
m_lineLongest = 0; m_lineLongest = 0;
@@ -367,14 +367,14 @@ public:
// this code is unused any longer // this code is unused any longer
#if 0 #if 0
// return TRUE if the column is in the start of the last row (hence the row // return true if the column is in the start of the last row (hence the row
// it is in is not wrapped) // it is in is not wrapped)
bool IsLastRow(wxTextCoord colRowStart) const bool IsLastRow(wxTextCoord colRowStart) const
{ {
return colRowStart == GetRowStart(m_rowsStart.GetCount()); return colRowStart == GetRowStart(m_rowsStart.GetCount());
} }
// return TRUE if the column is the last column of the row starting in // return true if the column is the last column of the row starting in
// colRowStart // colRowStart
bool IsLastColInRow(wxTextCoord colRowStart, bool IsLastColInRow(wxTextCoord colRowStart,
wxTextCoord colRowEnd, wxTextCoord colRowEnd,
@@ -400,7 +400,7 @@ public:
// caller got it wrong // caller got it wrong
wxFAIL_MSG( _T("this column is not in the start of the row!") ); wxFAIL_MSG( _T("this column is not in the start of the row!") );
return FALSE; return false;
} }
#endif // 0 #endif // 0
@@ -501,12 +501,12 @@ struct WXDLLEXPORT wxTextWrappedData : public wxTextMultiLineData
class wxTextCtrlCommand : public wxCommand class wxTextCtrlCommand : public wxCommand
{ {
public: public:
wxTextCtrlCommand(const wxString& name) : wxCommand(TRUE, name) { } wxTextCtrlCommand(const wxString& name) : wxCommand(true, name) { }
// we don't use these methods as they don't make sense for us as we need a // we don't use these methods as they don't make sense for us as we need a
// wxTextCtrl to be applied // wxTextCtrl to be applied
virtual bool Do() { wxFAIL_MSG(_T("shouldn't be called")); return FALSE; } virtual bool Do() { wxFAIL_MSG(_T("shouldn't be called")); return false; }
virtual bool Undo() { wxFAIL_MSG(_T("shouldn't be called")); return FALSE; } virtual bool Undo() { wxFAIL_MSG(_T("shouldn't be called")); return false; }
// instead, our command processor uses these methods // instead, our command processor uses these methods
virtual bool Do(wxTextCtrl *text) = 0; virtual bool Do(wxTextCtrl *text) = 0;
@@ -572,7 +572,7 @@ class wxTextCtrlCommandProcessor : public wxCommandProcessor
public: public:
wxTextCtrlCommandProcessor(wxTextCtrl *text) wxTextCtrlCommandProcessor(wxTextCtrl *text)
{ {
m_compressInserts = FALSE; m_compressInserts = false;
m_text = text; m_text = text;
} }
@@ -581,7 +581,7 @@ public:
virtual void Store(wxCommand *command); virtual void Store(wxCommand *command);
// stop compressing insert commands when this is called // stop compressing insert commands when this is called
void StopCompressing() { m_compressInserts = FALSE; } void StopCompressing() { m_compressInserts = false; }
// accessors // accessors
wxTextCtrl *GetTextCtrl() const { return m_text; } wxTextCtrl *GetTextCtrl() const { return m_text; }
@@ -601,7 +601,7 @@ private:
// the control we're associated with // the control we're associated with
wxTextCtrl *m_text; wxTextCtrl *m_text;
// if the flag is TRUE we're compressing subsequent insert commands into // if the flag is true we're compressing subsequent insert commands into
// one so that the entire typing could be undone in one call to Undo() // one so that the entire typing could be undone in one call to Undo()
bool m_compressInserts; bool m_compressInserts;
}; };
@@ -628,8 +628,8 @@ void wxTextCtrl::Init()
m_selStart = m_selStart =
m_selEnd = -1; m_selEnd = -1;
m_isModified = FALSE; m_isModified = false;
m_isEditable = TRUE; m_isEditable = true;
m_posLast = m_posLast =
m_curPos = m_curPos =
@@ -704,7 +704,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
if ( !wxControl::Create(parent, id, pos, size, style, if ( !wxControl::Create(parent, id, pos, size, style,
validator, name) ) validator, name) )
{ {
return FALSE; return false;
} }
SetCursor(wxCURSOR_IBEAM); SetCursor(wxCURSOR_IBEAM);
@@ -737,14 +737,14 @@ bool wxTextCtrl::Create(wxWindow *parent,
// we can't show caret right now as we're not shown yet and so it would // we can't show caret right now as we're not shown yet and so it would
// result in garbage on the screen - we'll do it after first OnPaint() // result in garbage on the screen - we'll do it after first OnPaint()
m_hasCaret = FALSE; m_hasCaret = false;
CreateInputHandler(wxINP_HANDLER_TEXTCTRL); CreateInputHandler(wxINP_HANDLER_TEXTCTRL);
wxSizeEvent sizeEvent(GetSize(), GetId()); wxSizeEvent sizeEvent(GetSize(), GetId());
GetEventHandler()->ProcessEvent(sizeEvent); GetEventHandler()->ProcessEvent(sizeEvent);
return TRUE; return true;
} }
wxTextCtrl::~wxTextCtrl() wxTextCtrl::~wxTextCtrl()
@@ -877,7 +877,7 @@ bool wxTextCtrl::ReplaceLine(wxTextCoord line,
} }
// the number of rows changed // the number of rows changed
return TRUE; return true;
} }
} }
else // no line wrap else // no line wrap
@@ -886,7 +886,7 @@ bool wxTextCtrl::ReplaceLine(wxTextCoord line,
} }
// the number of rows didn't change // the number of rows didn't change
return FALSE; return false;
} }
void wxTextCtrl::RemoveLine(wxTextCoord line) void wxTextCtrl::RemoveLine(wxTextCoord line)
@@ -1003,7 +1003,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
// as if it does we need to refresh everything below the changed // as if it does we need to refresh everything below the changed
// text (it will be shifted...) and we can avoid it if there is no // text (it will be shifted...) and we can avoid it if there is no
// row relayout // row relayout
bool rowsNumberChanged = FALSE; bool rowsNumberChanged = false;
// (1) join lines // (1) join lines
const wxArrayString& linesOld = GetLines(); const wxArrayString& linesOld = GetLines();
@@ -1111,7 +1111,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
// we have the replacement line for this one // we have the replacement line for this one
if ( ReplaceLine(line, lines[nReplaceLine]) ) if ( ReplaceLine(line, lines[nReplaceLine]) )
{ {
rowsNumberChanged = TRUE; rowsNumberChanged = true;
} }
UpdateMaxWidth(line); UpdateMaxWidth(line);
@@ -1120,13 +1120,13 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
{ {
// (4b) delete all extra lines (note that we need to delete // (4b) delete all extra lines (note that we need to delete
// them backwards because indices shift while we do it) // them backwards because indices shift while we do it)
bool deletedLongestLine = FALSE; bool deletedLongestLine = false;
for ( wxTextCoord lineDel = lineEnd; lineDel >= line; lineDel-- ) for ( wxTextCoord lineDel = lineEnd; lineDel >= line; lineDel-- )
{ {
if ( lineDel == MData().m_lineLongest ) if ( lineDel == MData().m_lineLongest )
{ {
// we will need to recalc the max line width // we will need to recalc the max line width
deletedLongestLine = TRUE; deletedLongestLine = true;
} }
RemoveLine(lineDel); RemoveLine(lineDel);
@@ -1138,7 +1138,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
} }
// even the line number changed // even the line number changed
rowsNumberChanged = TRUE; rowsNumberChanged = true;
// update line to exit the loop // update line to exit the loop
line = lineEnd + 1; line = lineEnd + 1;
@@ -1149,7 +1149,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
if ( nReplaceLine < nReplaceCount ) if ( nReplaceLine < nReplaceCount )
{ {
// even the line number changed // even the line number changed
rowsNumberChanged = TRUE; rowsNumberChanged = true;
do do
{ {
@@ -1207,7 +1207,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
RefreshLineRange(lineEnd + 1, 0); RefreshLineRange(lineEnd + 1, 0);
// the vert scrollbar might [dis]appear // the vert scrollbar might [dis]appear
MData().m_updateScrollbarY = TRUE; MData().m_updateScrollbarY = true;
} }
// must recalculate it - will do later // must recalculate it - will do later
@@ -1526,7 +1526,7 @@ bool wxTextCtrl::GetSelectedPartOfLine(wxTextCoord line,
if ( !HasSelection() ) if ( !HasSelection() )
{ {
// no selection at all, hence no selection in this line // no selection at all, hence no selection in this line
return FALSE; return false;
} }
wxTextCoord lineStart, colStart; wxTextCoord lineStart, colStart;
@@ -1534,7 +1534,7 @@ bool wxTextCtrl::GetSelectedPartOfLine(wxTextCoord line,
if ( lineStart > line ) if ( lineStart > line )
{ {
// this line is entirely above the selection // this line is entirely above the selection
return FALSE; return false;
} }
wxTextCoord lineEnd, colEnd; wxTextCoord lineEnd, colEnd;
@@ -1542,7 +1542,7 @@ bool wxTextCtrl::GetSelectedPartOfLine(wxTextCoord line,
if ( lineEnd < line ) if ( lineEnd < line )
{ {
// this line is entirely below the selection // this line is entirely below the selection
return FALSE; return false;
} }
if ( line == lineStart ) if ( line == lineStart )
@@ -1567,7 +1567,7 @@ bool wxTextCtrl::GetSelectedPartOfLine(wxTextCoord line,
*end = GetLineLength(line); *end = GetLineLength(line);
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1587,12 +1587,12 @@ bool wxTextCtrl::IsEditable() const
void wxTextCtrl::MarkDirty() void wxTextCtrl::MarkDirty()
{ {
m_isModified = TRUE; m_isModified = true;
} }
void wxTextCtrl::DiscardEdits() void wxTextCtrl::DiscardEdits()
{ {
m_isModified = FALSE; m_isModified = false;
} }
void wxTextCtrl::SetEditable(bool editable) void wxTextCtrl::SetEditable(bool editable)
@@ -1670,7 +1670,7 @@ wxTextPos wxTextCtrl::XYToPosition(wxTextCoord x, wxTextCoord y) const
// if they are out of range // if they are out of range
if ( IsSingleLine() ) if ( IsSingleLine() )
{ {
return x > GetLastPosition() || y > 0 ? -1 : x; return x > GetLastPosition() || y > 0 ? wxDefaultCoord : x;
} }
else // multiline else // multiline
{ {
@@ -1705,14 +1705,14 @@ bool wxTextCtrl::PositionToXY(wxTextPos pos,
if ( IsSingleLine() ) if ( IsSingleLine() )
{ {
if ( (size_t)pos > m_value.length() ) if ( (size_t)pos > m_value.length() )
return FALSE; return false;
if ( x ) if ( x )
*x = pos; *x = pos;
if ( y ) if ( y )
*y = 0; *y = 0;
return TRUE; return true;
} }
else // multiline else // multiline
{ {
@@ -1737,7 +1737,7 @@ bool wxTextCtrl::PositionToXY(wxTextPos pos,
_T("XYToPosition() or PositionToXY() broken") ); _T("XYToPosition() or PositionToXY() broken") );
#endif // WXDEBUG_TEXT #endif // WXDEBUG_TEXT
return TRUE; return true;
} }
else // go further down else // go further down
{ {
@@ -1746,7 +1746,7 @@ bool wxTextCtrl::PositionToXY(wxTextPos pos,
} }
// beyond the last line // beyond the last line
return FALSE; return false;
} }
} }
@@ -1820,7 +1820,7 @@ bool wxTextCtrl::PositionToLogicalXY(wxTextPos pos,
else // must really calculate col/line from pos else // must really calculate col/line from pos
{ {
if ( !PositionToXY(pos, &col, &line) ) if ( !PositionToXY(pos, &col, &line) )
return FALSE; return false;
} }
int hLine = GetLineHeight(); int hLine = GetLineHeight();
@@ -1849,7 +1849,7 @@ bool wxTextCtrl::PositionToLogicalXY(wxTextPos pos,
if ( yOut ) if ( yOut )
*yOut = y; *yOut = y;
return TRUE; return true;
} }
bool wxTextCtrl::PositionToDeviceXY(wxTextPos pos, bool wxTextCtrl::PositionToDeviceXY(wxTextPos pos,
@@ -1858,13 +1858,13 @@ bool wxTextCtrl::PositionToDeviceXY(wxTextPos pos,
{ {
wxCoord x, y; wxCoord x, y;
if ( !PositionToLogicalXY(pos, &x, &y) ) if ( !PositionToLogicalXY(pos, &x, &y) )
return FALSE; return false;
// finally translate the logical text rect coords into physical client // finally translate the logical text rect coords into physical client
// coords // coords
CalcScrolledPosition(m_rectText.x + x, m_rectText.y + y, xOut, yOut); CalcScrolledPosition(m_rectText.x + x, m_rectText.y + y, xOut, yOut);
return TRUE; return true;
} }
wxPoint wxTextCtrl::GetCaretPosition() const wxPoint wxTextCtrl::GetCaretPosition() const
@@ -2138,13 +2138,13 @@ void wxTextCtrl::Cut()
bool wxTextCtrl::DoCut() bool wxTextCtrl::DoCut()
{ {
if ( !HasSelection() ) if ( !HasSelection() )
return FALSE; return false;
Copy(); Copy();
RemoveSelection(); RemoveSelection();
return TRUE; return true;
} }
void wxTextCtrl::Paste() void wxTextCtrl::Paste()
@@ -2168,12 +2168,12 @@ bool wxTextCtrl::DoPaste()
{ {
WriteText(text); WriteText(text);
return TRUE; return true;
} }
} }
#endif // wxUSE_CLIPBOARD #endif // wxUSE_CLIPBOARD
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -2213,7 +2213,7 @@ void wxTextCtrlCommandProcessor::Store(wxCommand *command)
} }
// append the following insert commands to this one // append the following insert commands to this one
m_compressInserts = TRUE; m_compressInserts = true;
// let the base class version will do the job normally // let the base class version will do the job normally
} }
@@ -2248,17 +2248,17 @@ bool wxTextCtrlInsertCommand::Do(wxTextCtrl *text)
// and now do insert it // and now do insert it
text->WriteText(m_text); text->WriteText(m_text);
return TRUE; return true;
} }
bool wxTextCtrlInsertCommand::Undo(wxTextCtrl *text) bool wxTextCtrlInsertCommand::Undo(wxTextCtrl *text)
{ {
wxCHECK_MSG( CanUndo(), FALSE, _T("impossible to undo insert cmd") ); wxCHECK_MSG( CanUndo(), false, _T("impossible to undo insert cmd") );
// remove the text from where we inserted it // remove the text from where we inserted it
text->Remove(m_from, m_from + m_text.length()); text->Remove(m_from, m_from + m_text.length());
return TRUE; return true;
} }
bool wxTextCtrlRemoveCommand::CanUndo() const bool wxTextCtrlRemoveCommand::CanUndo() const
@@ -2273,7 +2273,7 @@ bool wxTextCtrlRemoveCommand::Do(wxTextCtrl *text)
m_textDeleted = text->GetSelectionText(); m_textDeleted = text->GetSelectionText();
text->RemoveSelection(); text->RemoveSelection();
return TRUE; return true;
} }
bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text) bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text)
@@ -2284,7 +2284,7 @@ bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text)
text->SetInsertionPoint(m_from > posLast ? posLast : m_from); text->SetInsertionPoint(m_from > posLast ? posLast : m_from);
text->WriteText(m_textDeleted); text->WriteText(m_textDeleted);
return TRUE; return true;
} }
void wxTextCtrl::Undo() void wxTextCtrl::Undo()
@@ -2481,7 +2481,7 @@ void wxTextCtrl::OnSize(wxSizeEvent& event)
#endif // 0 #endif // 0
MData().m_updateScrollbarX = MData().m_updateScrollbarX =
MData().m_updateScrollbarY = TRUE; MData().m_updateScrollbarY = true;
} }
event.Skip(); event.Skip();
@@ -2665,7 +2665,7 @@ size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text,
wxString s(text); wxString s(text);
wxTextCoord col; wxTextCoord col;
wxCoord wReal = -1; wxCoord wReal = wxDefaultCoord;
switch ( HitTestLine(s, m_rectText.width, &col) ) switch ( HitTestLine(s, m_rectText.width, &col) )
{ {
/* /*
@@ -2690,7 +2690,7 @@ size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text,
col--; col--;
// recalc the width // recalc the width
wReal = -1; wReal = wxDefaultCoord;
} }
//else: we can just see it //else: we can just see it
@@ -2709,7 +2709,7 @@ size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text,
if ( colWordStart != col ) if ( colWordStart != col )
{ {
// will have to recalc the real width // will have to recalc the real width
wReal = -1; wReal = wxDefaultCoord;
col = colWordStart; col = colWordStart;
} }
@@ -2732,7 +2732,7 @@ size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text,
if ( widthReal ) if ( widthReal )
{ {
if ( wReal == -1 ) if ( wReal == wxDefaultCoord )
{ {
// calc it if not done yet // calc it if not done yet
wReal = GetTextWidth(s.Truncate(col)); wReal = GetTextWidth(s.Truncate(col));
@@ -2975,7 +2975,7 @@ wxTextCtrlHitTestResult wxTextCtrl::HitTestLogical(const wxPoint& pos,
wxTextCoord *colOut, wxTextCoord *colOut,
wxTextCoord *rowOut) const wxTextCoord *rowOut) const
{ {
return HitTest2(pos.y, pos.x, 0, rowOut, colOut, NULL, NULL, FALSE); return HitTest2(pos.y, pos.x, 0, rowOut, colOut, NULL, NULL, false);
} }
wxTextCtrlHitTestResult wxTextCtrl::HitTest2(wxCoord y0, wxTextCtrlHitTestResult wxTextCtrl::HitTest2(wxCoord y0,
@@ -3179,7 +3179,7 @@ bool wxTextCtrl::GetLineAndRow(wxTextCoord row,
rowInLine = 0; rowInLine = 0;
if ( row < 0 ) if ( row < 0 )
return FALSE; return false;
int nLines = GetNumberOfLines(); int nLines = GetNumberOfLines();
if ( WrapLines() ) if ( WrapLines() )
@@ -3202,13 +3202,13 @@ bool wxTextCtrl::GetLineAndRow(wxTextCoord row,
if ( line == nLines ) if ( line == nLines )
{ {
// the row is out of range // the row is out of range
return FALSE; return false;
} }
} }
else // no line wrapping, everything is easy else // no line wrapping, everything is easy
{ {
if ( row >= nLines ) if ( row >= nLines )
return FALSE; return false;
line = row; line = row;
} }
@@ -3218,7 +3218,7 @@ bool wxTextCtrl::GetLineAndRow(wxTextCoord row,
if ( rowInLineOut ) if ( rowInLineOut )
*rowInLineOut = rowInLine; *rowInLineOut = rowInLine;
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -3363,7 +3363,7 @@ void wxTextCtrl::ScrollText(wxTextCoord col)
if ( dx > 0 ) if ( dx > 0 )
{ {
// refresh the uncovered part on the left // refresh the uncovered part on the left
Refresh(TRUE, &rect); Refresh(true, &rect);
// and now the area on the right // and now the area on the right
rect.x = m_rectText.x + posLastVisible; rect.x = m_rectText.x + posLastVisible;
@@ -3376,7 +3376,7 @@ void wxTextCtrl::ScrollText(wxTextCoord col)
rect.width += m_rectText.width - posLastVisible; rect.width += m_rectText.width - posLastVisible;
} }
Refresh(TRUE, &rect); Refresh(true, &rect);
// I don't know exactly why is this needed here but without it we may // I don't know exactly why is this needed here but without it we may
// scroll the window again (from the same method) before the previously // scroll the window again (from the same method) before the previously
@@ -3544,7 +3544,7 @@ void wxTextCtrl::UpdateScrollbars()
// just to suppress compiler warnings about using uninit vars below // just to suppress compiler warnings about using uninit vars below
charWidth = maxWidth = 0; charWidth = maxWidth = 0;
showScrollbarX = FALSE; showScrollbarX = false;
} }
// calc the scrollbars ranges // calc the scrollbars ranges
@@ -3581,7 +3581,7 @@ void wxTextCtrl::UpdateScrollbars()
SetScrollbars(charWidth, lineHeight, SetScrollbars(charWidth, lineHeight,
scrollRangeX, scrollRangeY, scrollRangeX, scrollRangeY,
x, y, x, y,
TRUE /* no refresh */); true /* no refresh */);
if ( scrollRangeXOld ) if ( scrollRangeXOld )
{ {
@@ -3598,7 +3598,7 @@ void wxTextCtrl::UpdateScrollbars()
} }
MData().m_updateScrollbarX = MData().m_updateScrollbarX =
MData().m_updateScrollbarY = FALSE; MData().m_updateScrollbarY = false;
} }
void wxTextCtrl::OnInternalIdle() void wxTextCtrl::OnInternalIdle()
@@ -3837,7 +3837,7 @@ void wxTextCtrl::RefreshTextRect(const wxRect& rectClient, bool textOnly)
rect.Offset(m_rectText.GetPosition()); rect.Offset(m_rectText.GetPosition());
// don't refresh beyond the text area unless we're refreshing the line wrap // don't refresh beyond the text area unless we're refreshing the line wrap
// marks in which case textOnly is FALSE // marks in which case textOnly is false
if ( textOnly ) if ( textOnly )
{ {
if ( rect.GetRight() > m_rectText.GetRight() ) if ( rect.GetRight() > m_rectText.GetRight() )
@@ -3874,7 +3874,7 @@ void wxTextCtrl::RefreshTextRect(const wxRect& rectClient, bool textOnly)
wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"), wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y, rect.x + rect.width, rect.y + rect.height); rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
Refresh(TRUE, &rect); Refresh(true, &rect);
} }
void wxTextCtrl::RefreshLineWrapMarks(wxTextCoord rowFirst, void wxTextCtrl::RefreshLineWrapMarks(wxTextCoord rowFirst,
@@ -3888,7 +3888,7 @@ void wxTextCtrl::RefreshLineWrapMarks(wxTextCoord rowFirst,
rectMarks.y = rowFirst*GetLineHeight(); rectMarks.y = rowFirst*GetLineHeight();
rectMarks.height = (rowLast - rowFirst)*GetLineHeight(); rectMarks.height = (rowLast - rowFirst)*GetLineHeight();
RefreshTextRect(rectMarks, FALSE /* don't limit to text area */); RefreshTextRect(rectMarks, false /* don't limit to text area */);
} }
} }
@@ -4215,7 +4215,7 @@ void wxTextCtrl::DoDraw(wxControlRenderer *renderer)
{ {
ShowCaret(); ShowCaret();
m_hasCaret = TRUE; m_hasCaret = true;
} }
} }
@@ -4226,7 +4226,7 @@ void wxTextCtrl::DoDraw(wxControlRenderer *renderer)
bool wxTextCtrl::SetFont(const wxFont& font) bool wxTextCtrl::SetFont(const wxFont& font)
{ {
if ( !wxControl::SetFont(font) ) if ( !wxControl::SetFont(font) )
return FALSE; return false;
// and refresh everything, of course // and refresh everything, of course
InitInsertionPoint(); InitInsertionPoint();
@@ -4246,20 +4246,20 @@ bool wxTextCtrl::SetFont(const wxFont& font)
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxTextCtrl::Enable(bool enable) bool wxTextCtrl::Enable(bool enable)
{ {
if ( !wxTextCtrlBase::Enable(enable) ) if ( !wxTextCtrlBase::Enable(enable) )
return FALSE; return false;
if (FindFocus() == this && GetCaret() && if (FindFocus() == this && GetCaret() &&
((enable && !GetCaret()->IsVisible()) || ((enable && !GetCaret()->IsVisible()) ||
(!enable && GetCaret()->IsVisible()))) (!enable && GetCaret()->IsVisible())))
ShowCaret(enable); ShowCaret(enable);
return TRUE; return true;
} }
void wxTextCtrl::CreateCaret() void wxTextCtrl::CreateCaret()
@@ -4387,28 +4387,28 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
const wxString& strArg) const wxString& strArg)
{ {
// has the text changed as result of this action? // has the text changed as result of this action?
bool textChanged = FALSE; bool textChanged = false;
// the remembered cursor abscissa for multiline text controls is usually // the remembered cursor abscissa for multiline text controls is usually
// reset after each user action but for ones which do use it (UP and DOWN // reset after each user action but for ones which do use it (UP and DOWN
// for example) we shouldn't do it - as indicated by this flag // for example) we shouldn't do it - as indicated by this flag
bool rememberAbscissa = FALSE; bool rememberAbscissa = false;
// the command this action corresponds to or NULL if this action doesn't // the command this action corresponds to or NULL if this action doesn't
// change text at all or can't be undone // change text at all or can't be undone
wxTextCtrlCommand *command = (wxTextCtrlCommand *)NULL; wxTextCtrlCommand *command = (wxTextCtrlCommand *)NULL;
wxString action; wxString action;
bool del = FALSE, bool del = false,
sel = FALSE; sel = false;
if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_DEL, &action) ) if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_DEL, &action) )
{ {
if ( IsEditable() ) if ( IsEditable() )
del = TRUE; del = true;
} }
else if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_SEL, &action) ) else if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_SEL, &action) )
{ {
sel = TRUE; sel = true;
} }
else // not selection nor delete action else // not selection nor delete action
{ {
@@ -4448,7 +4448,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
if ( newPos != INVALID_POS_VALUE ) if ( newPos != INVALID_POS_VALUE )
{ {
// remember where the cursor original had been // remember where the cursor original had been
rememberAbscissa = TRUE; rememberAbscissa = true;
} }
} }
} }
@@ -4461,7 +4461,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
if ( newPos != INVALID_POS_VALUE ) if ( newPos != INVALID_POS_VALUE )
{ {
// remember where the cursor original had been // remember where the cursor original had been
rememberAbscissa = TRUE; rememberAbscissa = true;
} }
} }
} }
@@ -4488,7 +4488,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
// inserting text can be undone // inserting text can be undone
command = new wxTextCtrlInsertCommand(strArg); command = new wxTextCtrlInsertCommand(strArg);
textChanged = TRUE; textChanged = true;
} }
} }
else if ( (action == wxACTION_TEXT_PAGE_UP) || else if ( (action == wxACTION_TEXT_PAGE_UP) ||
@@ -4505,7 +4505,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
} }
// remember where the cursor original had been // remember where the cursor original had been
rememberAbscissa = TRUE; rememberAbscissa = true;
bool goUp = action == wxACTION_TEXT_PAGE_UP; bool goUp = action == wxACTION_TEXT_PAGE_UP;
for ( size_t line = 0; line < count; line++ ) for ( size_t line = 0; line < count; line++ )
@@ -4552,7 +4552,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
} }
// scroll vertically only // scroll vertically only
Scroll(-1, y); Scroll(wxDefaultCoord, y);
} }
} }
else if ( action == wxACTION_TEXT_SEL_WORD ) else if ( action == wxACTION_TEXT_SEL_WORD )
@@ -4667,7 +4667,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
m_cmdProcessor->Submit(command); m_cmdProcessor->Submit(command);
// undoable commands always change text // undoable commands always change text
textChanged = TRUE; textChanged = true;
} }
else // no undoable command else // no undoable command
{ {
@@ -4684,10 +4684,10 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig,
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
// as the text changed... // as the text changed...
m_isModified = TRUE; m_isModified = true;
} }
return TRUE; return true;
} }
void wxTextCtrl::OnChar(wxKeyEvent& event) void wxTextCtrl::OnChar(wxKeyEvent& event)
@@ -4762,7 +4762,7 @@ bool wxStdTextCtrlInputHandler::HandleKey(wxInputConsumer *consumer,
{ {
// we're only interested in key presses // we're only interested in key presses
if ( !pressed ) if ( !pressed )
return FALSE; return false;
int keycode = event.GetKeyCode(); int keycode = event.GetKeyCode();
@@ -4875,7 +4875,7 @@ bool wxStdTextCtrlInputHandler::HandleKey(wxInputConsumer *consumer,
{ {
consumer->PerformAction(action, -1, str); consumer->PerformAction(action, -1, str);
return TRUE; return true;
} }
return wxStdInputHandler::HandleKey(consumer, event, pressed); return wxStdInputHandler::HandleKey(consumer, event, pressed);
@@ -4958,7 +4958,7 @@ wxStdTextCtrlInputHandler::HandleFocus(wxInputConsumer *consumer,
} }
// never refresh entirely // never refresh entirely
return FALSE; return false;
} }
#endif // wxUSE_TEXTCTRL #endif // wxUSE_TEXTCTRL

View File

@@ -86,7 +86,7 @@ wxThemeInfo::wxThemeInfo(Constructor c,
if ( ms_theme ) if ( ms_theme )
{ {
// we already have a theme // we already have a theme
return TRUE; return true;
} }
wxString nameDefTheme; wxString nameDefTheme;
@@ -121,13 +121,13 @@ wxThemeInfo::wxThemeInfo(Constructor c,
{ {
wxLogError(_("Failed to initialize GUI: no built-in themes found.")); wxLogError(_("Failed to initialize GUI: no built-in themes found."));
return FALSE; return false;
} }
// Set the theme as current. // Set the theme as current.
wxTheme::Set(theme); wxTheme::Set(theme);
return TRUE; return true;
} }
/* static */ wxTheme *wxTheme::Set(wxTheme *theme) /* static */ wxTheme *wxTheme::Set(wxTheme *theme)

View File

@@ -534,7 +534,7 @@ protected:
wxStdScrollBarInputHandler::Press(scrollbar, doIt); wxStdScrollBarInputHandler::Press(scrollbar, doIt);
} }
virtual bool IsAllowedButton(int WXUNUSED(button)) { return TRUE; } virtual bool IsAllowedButton(int WXUNUSED(button)) { return true; }
bool IsArrow() const bool IsArrow() const
{ {
@@ -1082,7 +1082,7 @@ wxRect wxGTKRenderer::GetBorderDimensions(wxBorder border) const
bool wxGTKRenderer::AreScrollbarsInsideBorder() const bool wxGTKRenderer::AreScrollbarsInsideBorder() const
{ {
// no, the scrollbars are outside the border in GTK+ // no, the scrollbars are outside the border in GTK+
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1405,13 +1405,13 @@ void wxGTKRenderer::DrawRadioBitmap(wxDC& dc,
DrawUpZag(dc, x, xRight, yMid, y); DrawUpZag(dc, x, xRight, yMid, y);
DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1); DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1);
bool drawIt = TRUE; bool drawIt = true;
if ( flags & wxCONTROL_CHECKED ) if ( flags & wxCONTROL_CHECKED )
dc.SetPen(m_penBlack); dc.SetPen(m_penBlack);
else if ( flags & wxCONTROL_PRESSED ) else if ( flags & wxCONTROL_PRESSED )
dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID)); dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
else // unchecked and unpressed else // unchecked and unpressed
drawIt = FALSE; drawIt = false;
if ( drawIt ) if ( drawIt )
DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2); DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2);
@@ -1424,14 +1424,14 @@ void wxGTKRenderer::DrawRadioBitmap(wxDC& dc,
DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1); DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1);
if ( !(flags & wxCONTROL_CHECKED) ) if ( !(flags & wxCONTROL_CHECKED) )
drawIt = TRUE; // with the same pen drawIt = true; // with the same pen
else if ( flags & wxCONTROL_PRESSED ) else if ( flags & wxCONTROL_PRESSED )
{ {
dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID)); dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
drawIt = TRUE; drawIt = true;
} }
else // checked and unpressed else // checked and unpressed
drawIt = FALSE; drawIt = false;
if ( drawIt ) if ( drawIt )
DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2); DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2);
@@ -1482,14 +1482,14 @@ wxBitmap wxGTKRenderer::GetCheckBitmap(int flags)
// normal unchecked // normal unchecked
dc.SelectObject(m_bitmapsCheckbox[0][1]); dc.SelectObject(m_bitmapsCheckbox[0][1]);
DrawUncheckBitmap(dc, rect, FALSE); DrawUncheckBitmap(dc, rect, false);
// pressed checked // pressed checked
m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0]; m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0];
// pressed unchecked // pressed unchecked
dc.SelectObject(m_bitmapsCheckbox[1][1]); dc.SelectObject(m_bitmapsCheckbox[1][1]);
DrawUncheckBitmap(dc, rect, TRUE); DrawUncheckBitmap(dc, rect, true);
} }
int row = flags & wxCONTROL_PRESSED ? 1 : 0; int row = flags & wxCONTROL_PRESSED ? 1 : 0;
@@ -1588,7 +1588,7 @@ void wxGTKRenderer::DoDrawCheckOrRadioBitmap(wxDC& dc,
rectLabel.SetRight(rect.GetRight()); rectLabel.SetRight(rect.GetRight());
} }
dc.DrawBitmap(bitmap, xBmp, yBmp, TRUE /* use mask */); dc.DrawBitmap(bitmap, xBmp, yBmp, true /* use mask */);
DrawLabel(dc, label, rectLabel, flags, DrawLabel(dc, label, rectLabel, flags,
wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, indexAccel); wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, indexAccel);
@@ -2823,7 +2823,7 @@ wxSize wxGTKRenderer::GetFrameMinSize(int WXUNUSED(flags)) const
wxSize wxGTKRenderer::GetFrameIconSize() const wxSize wxGTKRenderer::GetFrameIconSize() const
{ {
return wxSize(-1, -1); return wxSize(wxDefaultCoord, wxDefaultCoord);
} }
int int
@@ -4476,7 +4476,7 @@ bool wxGTKInputHandler::HandleKey(wxInputConsumer * WXUNUSED(control),
const wxKeyEvent& WXUNUSED(event), const wxKeyEvent& WXUNUSED(event),
bool WXUNUSED(pressed)) bool WXUNUSED(pressed))
{ {
return FALSE; return false;
} }
bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control, bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control,
@@ -4487,10 +4487,10 @@ bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control,
{ {
control->GetInputWindow()->SetFocus(); control->GetInputWindow()->SetFocus();
return TRUE; return true;
} }
return FALSE; return false;
} }
bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control, bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control,
@@ -4498,18 +4498,18 @@ bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control,
{ {
if ( event.Entering() ) if ( event.Entering() )
{ {
control->GetInputWindow()->SetCurrent(TRUE); control->GetInputWindow()->SetCurrent(true);
} }
else if ( event.Leaving() ) else if ( event.Leaving() )
{ {
control->GetInputWindow()->SetCurrent(FALSE); control->GetInputWindow()->SetCurrent(false);
} }
else else
{ {
return FALSE; return false;
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -4527,11 +4527,11 @@ bool wxGTKCheckboxInputHandler::HandleKey(wxInputConsumer *control,
{ {
control->PerformAction(wxACTION_CHECKBOX_TOGGLE); control->PerformAction(wxACTION_CHECKBOX_TOGGLE);
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -4621,7 +4621,7 @@ bool wxGTKTextCtrlInputHandler::HandleKey(wxInputConsumer *control,
{ {
control->PerformAction(action); control->PerformAction(action);
return TRUE; return true;
} }
} }

View File

@@ -122,7 +122,7 @@ protected:
void DrawShadedRect(wxDC& dc, wxRect *rect, void DrawShadedRect(wxDC& dc, wxRect *rect,
const wxPen& pen1, const wxPen& pen2); const wxPen& pen1, const wxPen& pen2);
void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = FALSE); void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = false);
void DrawArrow(wxDC& dc, const wxRect& rect, void DrawArrow(wxDC& dc, const wxRect& rect,
wxArrowDirection arrowDir, wxArrowStyle arrowStyle); wxArrowDirection arrowDir, wxArrowStyle arrowStyle);
@@ -575,7 +575,7 @@ void wxMetalRenderer::DrawArrow(wxDC& dc,
x--; x--;
// draw it // draw it
dc.DrawBitmap(bmp, x, y, TRUE /* use mask */); dc.DrawBitmap(bmp, x, y, true /* use mask */);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -443,7 +443,7 @@ protected:
void DrawSunkenBorder(wxDC& dc, wxRect *rect); void DrawSunkenBorder(wxDC& dc, wxRect *rect);
// draw the border used for scrollbar arrows // draw the border used for scrollbar arrows
void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = FALSE); void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = false);
// public DrawArrow()s helper // public DrawArrow()s helper
void DrawArrow(wxDC& dc, const wxRect& rect, void DrawArrow(wxDC& dc, const wxRect& rect,
@@ -469,7 +469,7 @@ protected:
void DrawLine(wxDC& dc, void DrawLine(wxDC& dc,
wxCoord x1, wxCoord y1, wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2, wxCoord x2, wxCoord y2,
bool transpose = FALSE) bool transpose = false)
{ {
if ( transpose ) if ( transpose )
dc.DrawLine(y1, x1, y2, x2); dc.DrawLine(y1, x1, y2, x2);
@@ -1917,7 +1917,7 @@ wxRect wxWin32Renderer::GetBorderDimensions(wxBorder border) const
bool wxWin32Renderer::AreScrollbarsInsideBorder() const bool wxWin32Renderer::AreScrollbarsInsideBorder() const
{ {
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -2284,7 +2284,7 @@ void wxWin32Renderer::DrawCheckItem(wxDC& dc,
} }
dc.DrawBitmap(bmp, rect.x, rect.y + (rect.height - bmp.GetHeight()) / 2 - 1, dc.DrawBitmap(bmp, rect.x, rect.y + (rect.height - bmp.GetHeight()) / 2 - 1,
TRUE /* use mask */); true /* use mask */);
wxRect rectLabel = rect; wxRect rectLabel = rect;
int bmpWidth = bmp.GetWidth(); int bmpWidth = bmp.GetWidth();
@@ -2365,7 +2365,7 @@ void wxWin32Renderer::DrawCheckOrRadioButton(wxDC& dc,
rectLabel.SetRight(rect.GetRight()); rectLabel.SetRight(rect.GetRight());
} }
dc.DrawBitmap(bitmap, xBmp, yBmp, TRUE /* use mask */); dc.DrawBitmap(bitmap, xBmp, yBmp, true /* use mask */);
DoDrawLabel( DoDrawLabel(
dc, label, rectLabel, dc, label, rectLabel,
@@ -3418,7 +3418,7 @@ void wxWin32Renderer::DrawArrow(wxDC& dc,
x--; x--;
// draw it // draw it
dc.DrawBitmap(bmp, x, y, TRUE /* use mask */); dc.DrawBitmap(bmp, x, y, true /* use mask */);
} }
void wxWin32Renderer::DrawArrowButton(wxDC& dc, void wxWin32Renderer::DrawArrowButton(wxDC& dc,
@@ -3768,14 +3768,14 @@ void wxWin32Renderer::DrawFrameButton(wxDC& dc,
DrawShadedRect(dc, &r, m_penBlack, m_penHighlight); DrawShadedRect(dc, &r, m_penBlack, m_penHighlight);
DrawShadedRect(dc, &r, m_penDarkGrey, m_penLightGrey); DrawShadedRect(dc, &r, m_penDarkGrey, m_penLightGrey);
DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r); DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r);
dc.DrawBitmap(m_bmpFrameButtons[idx], r.x+1, r.y+1, TRUE); dc.DrawBitmap(m_bmpFrameButtons[idx], r.x+1, r.y+1, true);
} }
else else
{ {
DrawShadedRect(dc, &r, m_penHighlight, m_penBlack); DrawShadedRect(dc, &r, m_penHighlight, m_penBlack);
DrawShadedRect(dc, &r, m_penLightGrey, m_penDarkGrey); DrawShadedRect(dc, &r, m_penLightGrey, m_penDarkGrey);
DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r); DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r);
dc.DrawBitmap(m_bmpFrameButtons[idx], r.x, r.y, TRUE); dc.DrawBitmap(m_bmpFrameButtons[idx], r.x, r.y, true);
} }
} }
@@ -4163,7 +4163,7 @@ bool wxWin32InputHandler::HandleKey(wxInputConsumer * WXUNUSED(control),
const wxKeyEvent& WXUNUSED(event), const wxKeyEvent& WXUNUSED(event),
bool WXUNUSED(pressed)) bool WXUNUSED(pressed))
{ {
return FALSE; return false;
} }
bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control, bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
@@ -4179,11 +4179,11 @@ bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
{ {
win->SetFocus(); win->SetFocus();
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -4195,7 +4195,7 @@ wxWin32ScrollBarInputHandler(wxWin32Renderer *renderer,
wxInputHandler *handler) wxInputHandler *handler)
: wxStdScrollBarInputHandler(renderer, handler) : wxStdScrollBarInputHandler(renderer, handler)
{ {
m_scrollPaused = FALSE; m_scrollPaused = false;
m_interval = 0; m_interval = 0;
} }
@@ -4204,7 +4204,7 @@ bool wxWin32ScrollBarInputHandler::OnScrollTimer(wxScrollBar *scrollbar,
{ {
// stop if went beyond the position of the original click (this can only // stop if went beyond the position of the original click (this can only
// happen when we scroll by pages) // happen when we scroll by pages)
bool stop = FALSE; bool stop = false;
if ( action == wxACTION_SCROLL_PAGE_DOWN ) if ( action == wxACTION_SCROLL_PAGE_DOWN )
{ {
stop = m_renderer->HitTestScrollbar(scrollbar, m_ptStartScrolling) stop = m_renderer->HitTestScrollbar(scrollbar, m_ptStartScrolling)
@@ -4222,7 +4222,7 @@ bool wxWin32ScrollBarInputHandler::OnScrollTimer(wxScrollBar *scrollbar,
scrollbar->Refresh(); scrollbar->Refresh();
return FALSE; return false;
} }
return wxStdScrollBarInputHandler::OnScrollTimer(scrollbar, action); return wxStdScrollBarInputHandler::OnScrollTimer(scrollbar, action);
@@ -4255,12 +4255,12 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
// mouse move events normally - only do it while mouse is captured (i.e. // mouse move events normally - only do it while mouse is captured (i.e.
// when we're dragging the thumb or pressing on something) // when we're dragging the thumb or pressing on something)
if ( !m_winCapture ) if ( !m_winCapture )
return FALSE; return false;
if ( event.Entering() ) if ( event.Entering() )
{ {
// we're not interested in this at all // we're not interested in this at all
return FALSE; return false;
} }
wxScrollBar *scrollbar = wxStaticCast(control->GetInputWindow(), wxScrollBar); wxScrollBar *scrollbar = wxStaticCast(control->GetInputWindow(), wxScrollBar);
@@ -4272,20 +4272,20 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
if ( event.Leaving() ) if ( event.Leaving() )
{ {
// it surely didn't // it surely didn't
return FALSE; return false;
} }
ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition()); ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition());
if ( ht == m_htLast ) if ( ht == m_htLast )
{ {
// yes it did, resume scrolling // yes it did, resume scrolling
m_scrollPaused = FALSE; m_scrollPaused = false;
if ( m_timerScroll ) if ( m_timerScroll )
{ {
// we were scrolling by line/page, restart timer // we were scrolling by line/page, restart timer
m_timerScroll->Start(m_interval); m_timerScroll->Start(m_interval);
Press(scrollbar, TRUE); Press(scrollbar, true);
} }
else // we were dragging the thumb else // we were dragging the thumb
{ {
@@ -4293,7 +4293,7 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
HandleThumbMove(scrollbar, m_eventLastDrag); HandleThumbMove(scrollbar, m_eventLastDrag);
} }
return TRUE; return true;
} }
} }
else // normal case, scrolling hasn't been paused else // normal case, scrolling hasn't been paused
@@ -4345,10 +4345,10 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
// pause scrolling // pause scrolling
m_interval = m_timerScroll->GetInterval(); m_interval = m_timerScroll->GetInterval();
m_timerScroll->Stop(); m_timerScroll->Stop();
m_scrollPaused = TRUE; m_scrollPaused = true;
// unpress the arrow // unpress the arrow
Press(scrollbar, FALSE); Press(scrollbar, false);
} }
else // we were dragging the thumb else // we were dragging the thumb
{ {
@@ -4361,7 +4361,7 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control,
HandleThumbMove(scrollbar, m_eventStartDrag); HandleThumbMove(scrollbar, m_eventStartDrag);
} }
return TRUE; return true;
} }
} }
@@ -4398,15 +4398,15 @@ bool wxWin32CheckboxInputHandler::HandleKey(wxInputConsumer *control,
break; break;
} }
if ( !!action ) if ( !action.IsEmpty() )
{ {
control->PerformAction(action); control->PerformAction(action);
return TRUE; return true;
} }
} }
return FALSE; return false;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -4440,7 +4440,7 @@ bool wxWin32TextCtrlInputHandler::HandleKey(wxInputConsumer *control,
{ {
control->PerformAction(action); control->PerformAction(action);
return TRUE; return true;
} }
} }
@@ -4455,7 +4455,7 @@ wxWin32StatusBarInputHandler::
wxWin32StatusBarInputHandler(wxInputHandler *handler) wxWin32StatusBarInputHandler(wxInputHandler *handler)
: wxStdInputHandler(handler) : wxStdInputHandler(handler)
{ {
m_isOnGrip = FALSE; m_isOnGrip = false;
} }
bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar, bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar,
@@ -4467,7 +4467,7 @@ bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar,
wxTopLevelWindow * wxTopLevelWindow *
parentTLW = wxDynamicCast(statbar->GetParent(), wxTopLevelWindow); parentTLW = wxDynamicCast(statbar->GetParent(), wxTopLevelWindow);
wxCHECK_MSG( parentTLW, FALSE, wxCHECK_MSG( parentTLW, false,
_T("the status bar should be a child of a TLW") ); _T("the status bar should be a child of a TLW") );
// a maximized window can't be resized anyhow // a maximized window can't be resized anyhow
@@ -4485,7 +4485,7 @@ bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar,
} }
} }
return FALSE; return false;
} }
bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer, bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer,
@@ -4508,7 +4508,7 @@ bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer,
statbar->SetCursor(m_cursorOld); statbar->SetCursor(m_cursorOld);
return TRUE; return true;
} }
} }
} }
@@ -4673,7 +4673,7 @@ bool wxWin32FrameInputHandler::HandleMouse(wxInputConsumer *consumer,
tlw->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, tlw->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
tlw->IsMaximized() ? wxTOPLEVEL_BUTTON_RESTORE tlw->IsMaximized() ? wxTOPLEVEL_BUTTON_RESTORE
: wxTOPLEVEL_BUTTON_MAXIMIZE); : wxTOPLEVEL_BUTTON_MAXIMIZE);
return TRUE; return true;
} }
else if ( tlw->GetWindowStyle() & wxSYSTEM_MENU ) else if ( tlw->GetWindowStyle() & wxSYSTEM_MENU )
{ {
@@ -4683,7 +4683,7 @@ bool wxWin32FrameInputHandler::HandleMouse(wxInputConsumer *consumer,
hit == wxHT_TOPLEVEL_ICON)) ) hit == wxHT_TOPLEVEL_ICON)) )
{ {
PopupSystemMenu(tlw, event.GetPosition()); PopupSystemMenu(tlw, event.GetPosition());
return TRUE; return true;
} }
} }
} }
@@ -4712,13 +4712,13 @@ void wxWin32FrameInputHandler::PopupSystemMenu(wxTopLevelWindow *window,
{ {
if ( window->IsMaximized() ) if ( window->IsMaximized() )
{ {
menu->Enable(wxID_MAXIMIZE_FRAME, FALSE); menu->Enable(wxID_MAXIMIZE_FRAME, false);
menu->Enable(wxID_MOVE_FRAME, FALSE); menu->Enable(wxID_MOVE_FRAME, false);
if ( window->GetWindowStyle() & wxRESIZE_BORDER ) if ( window->GetWindowStyle() & wxRESIZE_BORDER )
menu->Enable(wxID_RESIZE_FRAME, FALSE); menu->Enable(wxID_RESIZE_FRAME, false);
} }
else else
menu->Enable(wxID_RESTORE_FRAME, FALSE); menu->Enable(wxID_RESTORE_FRAME, false);
} }
window->PopupMenu(menu, pos); window->PopupMenu(menu, pos);

View File

@@ -48,7 +48,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// value meaning that m_widthSeparator is not initialized // value meaning that m_widthSeparator is not initialized
static const wxCoord INVALID_WIDTH = -1; static const wxCoord INVALID_WIDTH = wxDefaultCoord;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxToolBarTool: our implementation of wxToolBarToolBase // wxToolBarTool: our implementation of wxToolBarToolBase
@@ -71,15 +71,15 @@ public:
{ {
// no position yet // no position yet
m_x = m_x =
m_y = -1; m_y = wxDefaultCoord;
m_width = m_width =
m_height = 0; m_height = 0;
// not pressed yet // not pressed yet
m_isInverted = FALSE; m_isInverted = false;
// mouse not here yet // mouse not here yet
m_underMouse = FALSE; m_underMouse = false;
} }
wxToolBarTool(wxToolBar *tbar, wxControl *control) wxToolBarTool(wxToolBar *tbar, wxControl *control)
@@ -87,15 +87,15 @@ public:
{ {
// no position yet // no position yet
m_x = m_x =
m_y = -1; m_y = wxDefaultCoord;
m_width = m_width =
m_height = 0; m_height = 0;
// not pressed yet // not pressed yet
m_isInverted = FALSE; m_isInverted = false;
// mouse not here yet // mouse not here yet
m_underMouse = FALSE; m_underMouse = false;
} }
// is this tool pressed, even temporarily? (this is different from being // is this tool pressed, even temporarily? (this is different from being
@@ -110,7 +110,7 @@ public:
void Invert() { m_isInverted = !m_isInverted; } void Invert() { m_isInverted = !m_isInverted; }
// Set underMouse // Set underMouse
void SetUnderMouse( bool under = TRUE ) { m_underMouse = under; } void SetUnderMouse( bool under = true ) { m_underMouse = under; }
bool IsUnderMouse() { return m_underMouse; } bool IsUnderMouse() { return m_underMouse; }
public: public:
@@ -121,10 +121,10 @@ public:
wxCoord m_height; wxCoord m_height;
private: private:
// TRUE if the tool is pressed // true if the tool is pressed
bool m_isInverted; bool m_isInverted;
// TRUE if the tool is under the mouse // true if the tool is under the mouse
bool m_underMouse; bool m_underMouse;
}; };
@@ -141,7 +141,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl);
void wxToolBar::Init() void wxToolBar::Init()
{ {
// no tools yet // no tools yet
m_needsLayout = FALSE; m_needsLayout = false;
// unknown widths for the tools and separators // unknown widths for the tools and separators
m_widthSeparator = INVALID_WIDTH; m_widthSeparator = INVALID_WIDTH;
@@ -165,14 +165,14 @@ bool wxToolBar::Create(wxWindow *parent,
if ( !wxToolBarBase::Create(parent, id, pos, size, style, if ( !wxToolBarBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) ) wxDefaultValidator, name) )
{ {
return FALSE; return false;
} }
CreateInputHandler(wxINP_HANDLER_TOOLBAR); CreateInputHandler(wxINP_HANDLER_TOOLBAR);
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
wxToolBar::~wxToolBar() wxToolBar::~wxToolBar()
@@ -245,23 +245,23 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
wxToolBarToolBase * WXUNUSED(tool)) wxToolBarToolBase * WXUNUSED(tool))
{ {
// recalculate the toolbar geometry before redrawing it the next time // recalculate the toolbar geometry before redrawing it the next time
m_needsLayout = TRUE; m_needsLayout = true;
// and ensure that we indeed are going to redraw // and ensure that we indeed are going to redraw
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos),
wxToolBarToolBase * WXUNUSED(tool)) wxToolBarToolBase * WXUNUSED(tool))
{ {
// as above // as above
m_needsLayout = TRUE; m_needsLayout = true;
Refresh(); Refresh();
return TRUE; return true;
} }
void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable) void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable)
@@ -420,21 +420,21 @@ wxRect wxToolBar::GetToolRect(wxToolBarToolBase *toolBase) const
bool wxToolBar::Realize() bool wxToolBar::Realize()
{ {
if ( !wxToolBarBase::Realize() ) if ( !wxToolBarBase::Realize() )
return FALSE; return false;
m_needsLayout = TRUE; m_needsLayout = true;
DoLayout(); DoLayout();
SetBestSize(wxDefaultSize); SetBestSize(wxDefaultSize);
return TRUE; return true;
} }
void wxToolBar::DoLayout() void wxToolBar::DoLayout()
{ {
wxASSERT_MSG( m_needsLayout, _T("why are we called?") ); wxASSERT_MSG( m_needsLayout, _T("why are we called?") );
m_needsLayout = FALSE; m_needsLayout = false;
wxCoord x = m_xMargin, wxCoord x = m_xMargin,
y = m_yMargin; y = m_yMargin;
@@ -496,14 +496,14 @@ void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags); wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags);
// Correct width and height if needed. // Correct width and height if needed.
if ( width == -1 || height == -1 ) if ( width == wxDefaultCoord || height == wxDefaultCoord )
{ {
int tmp_width, tmp_height; int tmp_width, tmp_height;
GetSize(&tmp_width, &tmp_height); GetSize(&tmp_width, &tmp_height);
if ( width == -1 ) if ( width == wxDefaultCoord )
width = tmp_width; width = tmp_width;
if ( height == -1 ) if ( height == wxDefaultCoord )
height = tmp_height; height = tmp_height;
} }
@@ -685,17 +685,17 @@ bool wxToolBar::PerformAction(const wxControlAction& action,
} }
else // simple non-checkable tool else // simple non-checkable tool
{ {
isToggled = FALSE; isToggled = false;
} }
OnLeftClick( tool->GetId(), isToggled ); OnLeftClick( tool->GetId(), isToggled );
} }
else if ( action == wxACTION_TOOLBAR_ENTER ) else if ( action == wxACTION_TOOLBAR_ENTER )
{ {
wxCHECK_MSG( tool, FALSE, _T("no tool to enter?") ); wxCHECK_MSG( tool, false, _T("no tool to enter?") );
if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() ) if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() )
{ {
tool->SetUnderMouse( TRUE ); tool->SetUnderMouse( true );
if ( !tool->IsToggled() ) if ( !tool->IsToggled() )
RefreshTool( tool ); RefreshTool( tool );
@@ -703,11 +703,11 @@ bool wxToolBar::PerformAction(const wxControlAction& action,
} }
else if ( action == wxACTION_TOOLBAR_LEAVE ) else if ( action == wxACTION_TOOLBAR_LEAVE )
{ {
wxCHECK_MSG( tool, FALSE, _T("no tool to leave?") ); wxCHECK_MSG( tool, false, _T("no tool to leave?") );
if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() ) if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() )
{ {
tool->SetUnderMouse( FALSE ); tool->SetUnderMouse( false );
if ( !tool->IsToggled() ) if ( !tool->IsToggled() )
RefreshTool( tool ); RefreshTool( tool );
@@ -716,7 +716,7 @@ bool wxToolBar::PerformAction(const wxControlAction& action,
else else
return wxControl::PerformAction(action, numArg, strArg); return wxControl::PerformAction(action, numArg, strArg);
return TRUE; return true;
} }
// ============================================================================ // ============================================================================
@@ -752,7 +752,7 @@ bool wxStdToolbarInputHandler::HandleMouse(wxInputConsumer *consumer,
if ( event.LeftDown() || event.LeftDClick() ) if ( event.LeftDown() || event.LeftDClick() )
{ {
if ( !tool || !tool->IsEnabled() ) if ( !tool || !tool->IsEnabled() )
return TRUE; return true;
m_winCapture = tbar; m_winCapture = tbar;
m_winCapture->CaptureMouse(); m_winCapture->CaptureMouse();
@@ -761,7 +761,7 @@ bool wxStdToolbarInputHandler::HandleMouse(wxInputConsumer *consumer,
consumer->PerformAction( wxACTION_BUTTON_PRESS, tool->GetId() ); consumer->PerformAction( wxACTION_BUTTON_PRESS, tool->GetId() );
return TRUE; return true;
} }
else if ( event.LeftUp() ) else if ( event.LeftUp() )
{ {
@@ -781,7 +781,7 @@ bool wxStdToolbarInputHandler::HandleMouse(wxInputConsumer *consumer,
m_toolCapture = NULL; m_toolCapture = NULL;
return TRUE; return true;
} }
//else: don't do anything special about the double click //else: don't do anything special about the double click
} }
@@ -815,7 +815,7 @@ bool wxStdToolbarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
tool = NULL; tool = NULL;
if (tool == m_toolLast) if (tool == m_toolLast)
return TRUE; return true;
if (tool) if (tool)
consumer->PerformAction( wxACTION_BUTTON_PRESS, m_toolCapture->GetId() ); consumer->PerformAction( wxACTION_BUTTON_PRESS, m_toolCapture->GetId() );
@@ -827,7 +827,7 @@ bool wxStdToolbarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
else else
{ {
if (tool == m_toolLast) if (tool == m_toolLast)
return TRUE; return true;
if (m_toolLast) if (m_toolLast)
{ {
@@ -844,10 +844,10 @@ bool wxStdToolbarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
m_toolLast = tool; m_toolLast = tool;
} }
return TRUE; return true;
} }
return FALSE; return false;
} }
bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer, bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer,
@@ -859,7 +859,7 @@ bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer,
consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() ); consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
} }
return TRUE; return true;
} }
bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer, bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer,
@@ -871,7 +871,7 @@ bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer,
consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() ); consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
} }
return TRUE; return true;
} }
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR

View File

@@ -61,7 +61,7 @@ int wxTopLevelWindow::ms_canIconize = -1;
void wxTopLevelWindow::Init() void wxTopLevelWindow::Init()
{ {
m_isActive = FALSE; m_isActive = false;
m_windowStyle = 0; m_windowStyle = 0;
m_pressedButton = 0; m_pressedButton = 0;
} }
@@ -108,7 +108,7 @@ bool wxTopLevelWindow::Create(wxWindow *parent,
if ( !wxTopLevelWindowNative::Create(parent, id, title, pos, if ( !wxTopLevelWindowNative::Create(parent, id, title, pos,
size, style, name) ) size, style, name) )
return FALSE; return false;
if ( ms_drawDecorations ) if ( ms_drawDecorations )
{ {
@@ -116,12 +116,12 @@ bool wxTopLevelWindow::Create(wxWindow *parent,
m_exStyle = exstyleOrig; m_exStyle = exstyleOrig;
} }
return TRUE; return true;
} }
bool wxTopLevelWindow::ShowFullScreen(bool show, long style) bool wxTopLevelWindow::ShowFullScreen(bool show, long style)
{ {
if ( show == IsFullScreen() ) return FALSE; if ( show == IsFullScreen() ) return false;
if ( ms_drawDecorations ) if ( ms_drawDecorations )
{ {
@@ -305,7 +305,7 @@ void wxTopLevelWindow::SetIcons(const wxIconBundle& icons)
wxSize size = m_renderer->GetFrameIconSize(); wxSize size = m_renderer->GetFrameIconSize();
const wxIcon& icon = icons.GetIcon( size ); const wxIcon& icon = icons.GetIcon( size );
if ( !icon.Ok() || size.x == -1 ) if ( !icon.Ok() || size.x == wxDefaultCoord )
m_titlebarIcon = icon; m_titlebarIcon = icon;
else else
{ {
@@ -353,16 +353,16 @@ static bool wxGetResizingCursor(long hitTestResult, wxCursor& cursor)
cursor = wxCursor(wxCURSOR_SIZENWSE); cursor = wxCursor(wxCURSOR_SIZENWSE);
break; break;
default: default:
return FALSE; return false;
#if 0 #if 0
// not rachable due to earlier return // not rachable due to earlier return
break; break;
#endif #endif
} }
return TRUE; return true;
} }
return FALSE; return false;
} }
#define wxINTERACTIVE_RESIZE_DIR \ #define wxINTERACTIVE_RESIZE_DIR \
@@ -426,25 +426,25 @@ void wxApplyResize(wxInteractiveMoveData& data, const wxPoint& diff)
data.m_rect.height += diff.y; data.m_rect.height += diff.y;
} }
if ( data.m_minSize.x != -1 && data.m_rect.width < data.m_minSize.x ) if ( data.m_minSize.x != wxDefaultCoord && data.m_rect.width < data.m_minSize.x )
{ {
if ( data.m_flags & wxINTERACTIVE_RESIZE_W ) if ( data.m_flags & wxINTERACTIVE_RESIZE_W )
data.m_rect.x -= data.m_minSize.x - data.m_rect.width; data.m_rect.x -= data.m_minSize.x - data.m_rect.width;
data.m_rect.width = data.m_minSize.x; data.m_rect.width = data.m_minSize.x;
} }
if ( data.m_maxSize.x != -1 && data.m_rect.width > data.m_maxSize.x ) if ( data.m_maxSize.x != wxDefaultCoord && data.m_rect.width > data.m_maxSize.x )
{ {
if ( data.m_flags & wxINTERACTIVE_RESIZE_W ) if ( data.m_flags & wxINTERACTIVE_RESIZE_W )
data.m_rect.x -= data.m_minSize.x - data.m_rect.width; data.m_rect.x -= data.m_minSize.x - data.m_rect.width;
data.m_rect.width = data.m_maxSize.x; data.m_rect.width = data.m_maxSize.x;
} }
if ( data.m_minSize.y != -1 && data.m_rect.height < data.m_minSize.y ) if ( data.m_minSize.y != wxDefaultCoord && data.m_rect.height < data.m_minSize.y )
{ {
if ( data.m_flags & wxINTERACTIVE_RESIZE_N ) if ( data.m_flags & wxINTERACTIVE_RESIZE_N )
data.m_rect.y -= data.m_minSize.y - data.m_rect.height; data.m_rect.y -= data.m_minSize.y - data.m_rect.height;
data.m_rect.height = data.m_minSize.y; data.m_rect.height = data.m_minSize.y;
} }
if ( data.m_maxSize.y != -1 && data.m_rect.height > data.m_maxSize.y ) if ( data.m_maxSize.y != wxDefaultCoord && data.m_rect.height > data.m_maxSize.y )
{ {
if ( data.m_flags & wxINTERACTIVE_RESIZE_N ) if ( data.m_flags & wxINTERACTIVE_RESIZE_N )
data.m_rect.y -= data.m_minSize.y - data.m_rect.height; data.m_rect.y -= data.m_minSize.y - data.m_rect.height;
@@ -484,7 +484,7 @@ void wxInteractiveMoveHandler::OnMouseDown(wxMouseEvent& WXUNUSED(event))
void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event) void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
{ {
wxPoint diff(-1,-1); wxPoint diff(wxDefaultCoord,wxDefaultCoord);
switch ( event.GetKeyCode() ) switch ( event.GetKeyCode() )
{ {
@@ -501,7 +501,7 @@ void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
return; return;
} }
if ( diff.x != -1 ) if ( diff.x != wxDefaultCoord )
{ {
if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT ) if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT )
{ {
@@ -509,7 +509,7 @@ void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
if ( m_data.m_sizingCursor ) if ( m_data.m_sizingCursor )
{ {
wxEndBusyCursor(); wxEndBusyCursor();
m_data.m_sizingCursor = FALSE; m_data.m_sizingCursor = false;
} }
if ( m_data.m_flags & wxINTERACTIVE_MOVE ) if ( m_data.m_flags & wxINTERACTIVE_MOVE )
@@ -520,7 +520,7 @@ void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
} }
wxPoint warp; wxPoint warp;
bool changeCur = FALSE; bool changeCur = false;
if ( m_data.m_flags & wxINTERACTIVE_MOVE ) if ( m_data.m_flags & wxINTERACTIVE_MOVE )
{ {
@@ -537,14 +537,14 @@ void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
{ {
m_data.m_flags |= wxINTERACTIVE_RESIZE_N; m_data.m_flags |= wxINTERACTIVE_RESIZE_N;
m_data.m_pos.y = m_data.m_window->GetPosition().y; m_data.m_pos.y = m_data.m_window->GetPosition().y;
changeCur = TRUE; changeCur = true;
} }
else if ( diff.y > 0 ) else if ( diff.y > 0 )
{ {
m_data.m_flags |= wxINTERACTIVE_RESIZE_S; m_data.m_flags |= wxINTERACTIVE_RESIZE_S;
m_data.m_pos.y = m_data.m_window->GetPosition().y + m_data.m_pos.y = m_data.m_window->GetPosition().y +
m_data.m_window->GetSize().y; m_data.m_window->GetSize().y;
changeCur = TRUE; changeCur = true;
} }
} }
if ( !(m_data.m_flags & if ( !(m_data.m_flags &
@@ -554,14 +554,14 @@ void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
{ {
m_data.m_flags |= wxINTERACTIVE_RESIZE_W; m_data.m_flags |= wxINTERACTIVE_RESIZE_W;
m_data.m_pos.x = m_data.m_window->GetPosition().x; m_data.m_pos.x = m_data.m_window->GetPosition().x;
changeCur = TRUE; changeCur = true;
} }
else if ( diff.x > 0 ) else if ( diff.x > 0 )
{ {
m_data.m_flags |= wxINTERACTIVE_RESIZE_E; m_data.m_flags |= wxINTERACTIVE_RESIZE_E;
m_data.m_pos.x = m_data.m_window->GetPosition().x + m_data.m_pos.x = m_data.m_window->GetPosition().x +
m_data.m_window->GetSize().x; m_data.m_window->GetSize().x;
changeCur = TRUE; changeCur = true;
} }
} }
@@ -595,7 +595,7 @@ void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
if ( m_data.m_sizingCursor ) if ( m_data.m_sizingCursor )
wxEndBusyCursor(); wxEndBusyCursor();
wxBeginBusyCursor(&cur); wxBeginBusyCursor(&cur);
m_data.m_sizingCursor = TRUE; m_data.m_sizingCursor = true;
} }
} }
} }
@@ -627,11 +627,11 @@ void wxTopLevelWindow::InteractiveMove(int flags)
{ {
wxCursor sizingCursor(wxCURSOR_SIZING); wxCursor sizingCursor(wxCURSOR_SIZING);
wxBeginBusyCursor(&sizingCursor); wxBeginBusyCursor(&sizingCursor);
data.m_sizingCursor = TRUE; data.m_sizingCursor = true;
} }
else else
#endif #endif
data.m_sizingCursor = FALSE; data.m_sizingCursor = false;
data.m_window = this; data.m_window = this;
data.m_evtLoop = &loop; data.m_evtLoop = &loop;
@@ -705,21 +705,21 @@ bool wxTopLevelWindow::PerformAction(const wxControlAction& action,
m_isActive = isActive; m_isActive = isActive;
RefreshTitleBar(); RefreshTitleBar();
} }
return TRUE; return true;
} }
else if ( action == wxACTION_TOPLEVEL_BUTTON_PRESS ) else if ( action == wxACTION_TOPLEVEL_BUTTON_PRESS )
{ {
m_pressedButton = numArg; m_pressedButton = numArg;
RefreshTitleBar(); RefreshTitleBar();
return TRUE; return true;
} }
else if ( action == wxACTION_TOPLEVEL_BUTTON_RELEASE ) else if ( action == wxACTION_TOPLEVEL_BUTTON_RELEASE )
{ {
m_pressedButton = 0; m_pressedButton = 0;
RefreshTitleBar(); RefreshTitleBar();
return TRUE; return true;
} }
else if ( action == wxACTION_TOPLEVEL_BUTTON_CLICK ) else if ( action == wxACTION_TOPLEVEL_BUTTON_CLICK )
@@ -727,13 +727,13 @@ bool wxTopLevelWindow::PerformAction(const wxControlAction& action,
m_pressedButton = 0; m_pressedButton = 0;
RefreshTitleBar(); RefreshTitleBar();
ClickTitleBarButton(numArg); ClickTitleBarButton(numArg);
return TRUE; return true;
} }
else if ( action == wxACTION_TOPLEVEL_MOVE ) else if ( action == wxACTION_TOPLEVEL_MOVE )
{ {
InteractiveMove(wxINTERACTIVE_MOVE); InteractiveMove(wxINTERACTIVE_MOVE);
return TRUE; return true;
} }
else if ( action == wxACTION_TOPLEVEL_RESIZE ) else if ( action == wxACTION_TOPLEVEL_RESIZE )
@@ -748,16 +748,16 @@ bool wxTopLevelWindow::PerformAction(const wxControlAction& action,
if ( numArg & wxHT_TOPLEVEL_BORDER_E ) if ( numArg & wxHT_TOPLEVEL_BORDER_E )
flags |= wxINTERACTIVE_RESIZE_E; flags |= wxINTERACTIVE_RESIZE_E;
InteractiveMove(flags); InteractiveMove(flags);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event) void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event)
{ {
bool ret = TRUE; bool ret = true;
switch (event.GetId()) switch (event.GetId())
{ {
@@ -785,7 +785,7 @@ void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event)
break; break;
default: default:
ret = FALSE; ret = false;
} }
if ( !ret ) if ( !ret )
@@ -803,7 +803,7 @@ wxStdFrameInputHandler::wxStdFrameInputHandler(wxInputHandler *inphand)
m_winCapture = NULL; m_winCapture = NULL;
m_winHitTest = 0; m_winHitTest = 0;
m_winPressed = 0; m_winPressed = 0;
m_borderCursorOn = FALSE; m_borderCursorOn = false;
} }
bool wxStdFrameInputHandler::HandleMouse(wxInputConsumer *consumer, bool wxStdFrameInputHandler::HandleMouse(wxInputConsumer *consumer,
@@ -831,18 +831,18 @@ bool wxStdFrameInputHandler::HandleMouse(wxInputConsumer *consumer,
m_winHitTest = hit; m_winHitTest = hit;
m_winPressed = hit; m_winPressed = hit;
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed); consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
return TRUE; return true;
} }
else if ( (hit & wxHT_TOPLEVEL_TITLEBAR) && !w->IsMaximized() ) else if ( (hit & wxHT_TOPLEVEL_TITLEBAR) && !w->IsMaximized() )
{ {
consumer->PerformAction(wxACTION_TOPLEVEL_MOVE); consumer->PerformAction(wxACTION_TOPLEVEL_MOVE);
return TRUE; return true;
} }
else if ( (consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER) else if ( (consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER)
&& (hit & wxHT_TOPLEVEL_ANY_BORDER) ) && (hit & wxHT_TOPLEVEL_ANY_BORDER) )
{ {
consumer->PerformAction(wxACTION_TOPLEVEL_RESIZE, hit); consumer->PerformAction(wxACTION_TOPLEVEL_RESIZE, hit);
return TRUE; return true;
} }
} }
@@ -856,7 +856,7 @@ bool wxStdFrameInputHandler::HandleMouse(wxInputConsumer *consumer,
if ( m_winHitTest == m_winPressed ) if ( m_winHitTest == m_winPressed )
{ {
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, m_winPressed); consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, m_winPressed);
return TRUE; return true;
} }
} }
//else: the mouse was released outside the window, this doesn't //else: the mouse was released outside the window, this doesn't
@@ -882,7 +882,7 @@ bool wxStdFrameInputHandler::HandleMouseMove(wxInputConsumer *consumer,
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed); consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
m_winHitTest = hit; m_winHitTest = hit;
return TRUE; return true;
} }
} }
else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER ) else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER )
@@ -897,7 +897,7 @@ bool wxStdFrameInputHandler::HandleMouseMove(wxInputConsumer *consumer,
if ( m_borderCursorOn ) if ( m_borderCursorOn )
{ {
m_borderCursorOn = FALSE; m_borderCursorOn = false;
win->SetCursor(m_origCursor); win->SetCursor(m_origCursor);
} }
@@ -924,8 +924,8 @@ bool wxStdFrameInputHandler::HandleActivation(wxInputConsumer *consumer,
if ( m_borderCursorOn ) if ( m_borderCursorOn )
{ {
consumer->GetInputWindow()->SetCursor(m_origCursor); consumer->GetInputWindow()->SetCursor(m_origCursor);
m_borderCursorOn = FALSE; m_borderCursorOn = false;
} }
consumer->PerformAction(wxACTION_TOPLEVEL_ACTIVATE, activated); consumer->PerformAction(wxACTION_TOPLEVEL_ACTIVATE, activated);
return FALSE; return false;
} }

View File

@@ -106,12 +106,12 @@ void wxWindow::Init()
m_scrollbarVert = m_scrollbarVert =
m_scrollbarHorz = (wxScrollBar *)NULL; m_scrollbarHorz = (wxScrollBar *)NULL;
m_isCurrent = FALSE; m_isCurrent = false;
m_renderer = wxTheme::Get()->GetRenderer(); m_renderer = wxTheme::Get()->GetRenderer();
m_oldSize.x = -1; m_oldSize.x = wxDefaultCoord;
m_oldSize.y = -1; m_oldSize.y = wxDefaultCoord;
} }
bool wxWindow::Create(wxWindow *parent, bool wxWindow::Create(wxWindow *parent,
@@ -135,7 +135,7 @@ bool wxWindow::Create(wxWindow *parent,
actualStyle | wxCLIP_CHILDREN, actualStyle | wxCLIP_CHILDREN,
name) ) name) )
{ {
return FALSE; return false;
} }
// Set full style again, including those we didn't want present // Set full style again, including those we didn't want present
@@ -146,13 +146,13 @@ bool wxWindow::Create(wxWindow *parent,
if ( style & wxALWAYS_SHOW_SB ) if ( style & wxALWAYS_SHOW_SB )
{ {
#if wxUSE_TWO_WINDOWS #if wxUSE_TWO_WINDOWS
SetInsertIntoMain( TRUE ); SetInsertIntoMain( true );
#endif #endif
m_scrollbarVert = new wxScrollBar(this, -1, m_scrollbarVert = new wxScrollBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxSB_VERTICAL); wxSB_VERTICAL);
#if wxUSE_TWO_WINDOWS #if wxUSE_TWO_WINDOWS
SetInsertIntoMain( FALSE ); SetInsertIntoMain( false );
#endif #endif
} }
@@ -160,13 +160,13 @@ bool wxWindow::Create(wxWindow *parent,
if ( style & wxHSCROLL ) if ( style & wxHSCROLL )
{ {
#if wxUSE_TWO_WINDOWS #if wxUSE_TWO_WINDOWS
SetInsertIntoMain( TRUE ); SetInsertIntoMain( true );
#endif #endif
m_scrollbarHorz = new wxScrollBar(this, -1, m_scrollbarHorz = new wxScrollBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxSB_HORIZONTAL); wxSB_HORIZONTAL);
#if wxUSE_TWO_WINDOWS #if wxUSE_TWO_WINDOWS
SetInsertIntoMain( FALSE ); SetInsertIntoMain( false );
#endif #endif
} }
@@ -176,7 +176,7 @@ bool wxWindow::Create(wxWindow *parent,
PositionScrollbars(); PositionScrollbars();
} }
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -335,7 +335,7 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
EraseBackground( dc, rect ); EraseBackground( dc, rect );
} }
return TRUE; return true;
} }
void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect) void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect)
@@ -403,7 +403,7 @@ void wxWindow::Refresh(bool eraseBackground, const wxRect *rectClient)
// debugging helper // debugging helper
#ifdef WXDEBUG_REFRESH #ifdef WXDEBUG_REFRESH
static bool s_refreshDebug = FALSE; static bool s_refreshDebug = false;
if ( s_refreshDebug ) if ( s_refreshDebug )
{ {
wxWindowDC dc(this); wxWindowDC dc(this);
@@ -442,7 +442,7 @@ void wxWindow::Refresh(bool eraseBackground, const wxRect *rectClient)
bool wxWindow::Enable(bool enable) bool wxWindow::Enable(bool enable)
{ {
if ( !wxWindowNative::Enable(enable) ) if ( !wxWindowNative::Enable(enable) )
return FALSE; return false;
// disabled window can't keep focus // disabled window can't keep focus
if ( FindFocus() == this && GetParent() != NULL ) if ( FindFocus() == this && GetParent() != NULL )
@@ -457,7 +457,7 @@ bool wxWindow::Enable(bool enable)
Refresh(); Refresh();
} }
return TRUE; return true;
} }
bool wxWindow::IsFocused() const bool wxWindow::IsFocused() const
@@ -468,12 +468,12 @@ bool wxWindow::IsFocused() const
bool wxWindow::IsPressed() const bool wxWindow::IsPressed() const
{ {
return FALSE; return false;
} }
bool wxWindow::IsDefault() const bool wxWindow::IsDefault() const
{ {
return FALSE; return false;
} }
bool wxWindow::IsCurrent() const bool wxWindow::IsCurrent() const
@@ -484,14 +484,14 @@ bool wxWindow::IsCurrent() const
bool wxWindow::SetCurrent(bool doit) bool wxWindow::SetCurrent(bool doit)
{ {
if ( doit == m_isCurrent ) if ( doit == m_isCurrent )
return FALSE; return false;
m_isCurrent = doit; m_isCurrent = doit;
if ( CanBeHighlighted() ) if ( CanBeHighlighted() )
Refresh(); Refresh();
return TRUE; return true;
} }
int wxWindow::GetStateFlags() const int wxWindow::GetStateFlags() const
@@ -540,7 +540,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
// area. // area.
wxSize newSize = event.GetSize(); wxSize newSize = event.GetSize();
if (m_oldSize.x == -1 && m_oldSize.y == -1) if (m_oldSize.x == wxDefaultCoord && m_oldSize.y == wxDefaultCoord)
{ {
m_oldSize = newSize; m_oldSize = newSize;
return; return;
@@ -555,7 +555,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.width = m_oldSize.x; rect.width = m_oldSize.x;
rect.y = m_oldSize.y-2; rect.y = m_oldSize.y-2;
rect.height = 1; rect.height = 1;
Refresh( TRUE, &rect ); Refresh( true, &rect );
} }
else if (newSize.y < m_oldSize.y) else if (newSize.y < m_oldSize.y)
{ {
@@ -564,7 +564,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.x = 0; rect.x = 0;
rect.height = 1; rect.height = 1;
rect.width = newSize.x; rect.width = newSize.x;
wxWindowNative::Refresh( TRUE, &rect ); wxWindowNative::Refresh( true, &rect );
} }
if (newSize.x > m_oldSize.x) if (newSize.x > m_oldSize.x)
@@ -574,7 +574,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.height = m_oldSize.y; rect.height = m_oldSize.y;
rect.x = m_oldSize.x-2; rect.x = m_oldSize.x-2;
rect.width = 1; rect.width = 1;
Refresh( TRUE, &rect ); Refresh( true, &rect );
} }
else if (newSize.x < m_oldSize.x) else if (newSize.x < m_oldSize.x)
{ {
@@ -583,7 +583,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.y = 0; rect.y = 0;
rect.width = 1; rect.width = 1;
rect.height = newSize.y; rect.height = newSize.y;
wxWindowNative::Refresh( TRUE, &rect ); wxWindowNative::Refresh( true, &rect );
} }
} }
else else
@@ -596,7 +596,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.width = m_oldSize.x; rect.width = m_oldSize.x;
rect.y = m_oldSize.y-4; rect.y = m_oldSize.y-4;
rect.height = 2; rect.height = 2;
Refresh( TRUE, &rect ); Refresh( true, &rect );
} }
else if (newSize.y < m_oldSize.y) else if (newSize.y < m_oldSize.y)
{ {
@@ -605,7 +605,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.x = 0; rect.x = 0;
rect.height = 2; rect.height = 2;
rect.width = newSize.x; rect.width = newSize.x;
wxWindowNative::Refresh( TRUE, &rect ); wxWindowNative::Refresh( true, &rect );
} }
if (newSize.x > m_oldSize.x) if (newSize.x > m_oldSize.x)
@@ -615,7 +615,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.height = m_oldSize.y; rect.height = m_oldSize.y;
rect.x = m_oldSize.x-4; rect.x = m_oldSize.x-4;
rect.width = 2; rect.width = 2;
Refresh( TRUE, &rect ); Refresh( true, &rect );
} }
else if (newSize.x < m_oldSize.x) else if (newSize.x < m_oldSize.x)
{ {
@@ -624,7 +624,7 @@ void wxWindow::OnSize(wxSizeEvent& event)
rect.y = 0; rect.y = 0;
rect.width = 2; rect.width = 2;
rect.height = newSize.y; rect.height = newSize.y;
wxWindowNative::Refresh( TRUE, &rect ); wxWindowNative::Refresh( true, &rect );
} }
} }
@@ -841,7 +841,7 @@ void wxWindow::SetScrollbar(int orient,
wxASSERT_MSG( pageSize <= range, wxASSERT_MSG( pageSize <= range,
_T("page size can't be greater than range") ); _T("page size can't be greater than range") );
bool hasClientSizeChanged = FALSE; bool hasClientSizeChanged = false;
wxScrollBar *scrollbar = GetScrollbar(orient); wxScrollBar *scrollbar = GetScrollbar(orient);
if ( range && (pageSize < range) ) if ( range && (pageSize < range) )
{ {
@@ -849,14 +849,14 @@ void wxWindow::SetScrollbar(int orient,
{ {
// create it // create it
#if wxUSE_TWO_WINDOWS #if wxUSE_TWO_WINDOWS
SetInsertIntoMain( TRUE ); SetInsertIntoMain( true );
#endif #endif
scrollbar = new wxScrollBar(this, -1, scrollbar = new wxScrollBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
orient & wxVERTICAL ? wxSB_VERTICAL orient & wxVERTICAL ? wxSB_VERTICAL
: wxSB_HORIZONTAL); : wxSB_HORIZONTAL);
#if wxUSE_TWO_WINDOWS #if wxUSE_TWO_WINDOWS
SetInsertIntoMain( FALSE ); SetInsertIntoMain( false );
#endif #endif
if ( orient & wxVERTICAL ) if ( orient & wxVERTICAL )
m_scrollbarVert = scrollbar; m_scrollbarVert = scrollbar;
@@ -864,7 +864,7 @@ void wxWindow::SetScrollbar(int orient,
m_scrollbarHorz = scrollbar; m_scrollbarHorz = scrollbar;
// the client area diminished as we created a scrollbar // the client area diminished as we created a scrollbar
hasClientSizeChanged = TRUE; hasClientSizeChanged = true;
PositionScrollbars(); PositionScrollbars();
} }
@@ -897,7 +897,7 @@ void wxWindow::SetScrollbar(int orient,
m_scrollbarHorz = NULL; m_scrollbarHorz = NULL;
// the client area increased as we removed a scrollbar // the client area increased as we removed a scrollbar
hasClientSizeChanged = TRUE; hasClientSizeChanged = true;
// the size of the remaining scrollbar must be adjusted // the size of the remaining scrollbar must be adjusted
if ( m_scrollbarHorz || m_scrollbarVert ) if ( m_scrollbarHorz || m_scrollbarVert )
@@ -971,13 +971,13 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
if ( dx ) if ( dx )
{ {
r = ScrollNoRefresh(dx, 0, rect); r = ScrollNoRefresh(dx, 0, rect);
Refresh(TRUE /* erase bkgnd */, &r); Refresh(true /* erase bkgnd */, &r);
} }
if ( dy ) if ( dy )
{ {
r = ScrollNoRefresh(0, dy, rect); r = ScrollNoRefresh(0, dy, rect);
Refresh(TRUE /* erase bkgnd */, &r); Refresh(true /* erase bkgnd */, &r);
} }
// scroll children accordingly: // scroll children accordingly: