git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28748
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
66 files changed:
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 Release();
virtual void Press();
virtual void Release();
virtual void OnSetBitmap();
// set bitmap to the given one if it's ok or to m_bmpNormal and return
virtual void OnSetBitmap();
// 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);
private:
bool ChangeBitmap(const wxBitmap& bmp);
private:
virtual bool DoDrawBackground(wxDC& dc);
virtual void DoDraw(wxControlRenderer *renderer);
virtual bool DoDrawBackground(wxDC& dc);
virtual void DoDraw(wxControlRenderer *renderer);
- virtual bool CanBeHighlighted() const { return TRUE; }
+ virtual bool CanBeHighlighted() const { return true; }
// common part of all ctors
void Init();
// common part of all ctors
void Init();
// the actions supported by wxCheckBox
// ----------------------------------------------------------------------------
// the actions supported by wxCheckBox
// ----------------------------------------------------------------------------
-#define wxACTION_CHECKBOX_CHECK _T("check") // SetValue(TRUE)
-#define wxACTION_CHECKBOX_CLEAR _T("clear") // SetValue(FALSE)
+#define wxACTION_CHECKBOX_CHECK _T("check") // SetValue(true)
+#define wxACTION_CHECKBOX_CLEAR _T("clear") // SetValue(false)
#define wxACTION_CHECKBOX_TOGGLE _T("toggle") // toggle the check state
// additionally it accepts wxACTION_BUTTON_PRESS and RELEASE
#define wxACTION_CHECKBOX_TOGGLE _T("toggle") // toggle the check state
// additionally it accepts wxACTION_BUTTON_PRESS and RELEASE
// overridden base class virtuals
virtual bool IsPressed() const { return m_isPressed; }
// overridden base class virtuals
virtual bool IsPressed() const { return m_isPressed; }
- virtual bool HasTransparentBackground() { return TRUE; }
+ virtual bool HasTransparentBackground() { return true; }
protected:
virtual bool PerformAction(const wxControlAction& action,
protected:
virtual bool PerformAction(const wxControlAction& action,
virtual void DoDraw(wxControlRenderer *renderer);
virtual wxSize DoGetBestClientSize() const;
virtual void DoDraw(wxControlRenderer *renderer);
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
// one (query renderer then)
// get the size of the bitmap using either the current one or the default
// one (query renderer then)
// implement check list box methods
virtual bool IsChecked(size_t item) const;
// implement check list box methods
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
virtual bool PerformAction(const wxControlAction& action,
// and input handling
virtual bool PerformAction(const wxControlAction& action,
// called before showing the control to set the initial selection - notice
// 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
// called before showing the control to set the initial selection - notice
// 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
- // just return FALSE but not emit any errors
+ // just return false but not emit any errors
virtual bool SetSelection(const wxString& value) = 0;
// called immediately after the control is shown
virtual bool SetSelection(const wxString& value) = 0;
// called immediately after the control is shown
void ShowPopup();
void HidePopup();
void ShowPopup();
void HidePopup();
- // return TRUE if the popup is currently shown
+ // return true if the popup is currently shown
bool IsPopupShown() const { return m_isPopupShown; }
// get the popup window containing the popup control
bool IsPopupShown() const { return m_isPopupShown; }
// get the popup window containing the popup control
virtual void OnDismiss();
// forward these functions to all subcontrols
virtual void OnDismiss();
// forward these functions to all subcontrols
- virtual bool Enable(bool enable = TRUE);
- virtual bool Show(bool show = TRUE);
+ virtual bool Enable(bool enable = true);
+ virtual bool Show(bool show = true);
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );
// is the dialog in modal state right now?
virtual bool IsModal() const;
// is the dialog in modal state right now?
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();
// may be called to terminate the dialog with the given return code
virtual void EndModal(int retCode);
virtual int ShowModal();
// may be called to terminate the dialog with the given return code
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
// -------------------------------
const wxString& name = wxFrameNameStr);
virtual wxPoint GetClientAreaOrigin() const;
const wxString& name = wxFrameNameStr);
virtual wxPoint GetClientAreaOrigin() const;
- virtual bool Enable(bool enable = TRUE);
+ virtual bool Enable(bool enable = true);
#if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number = 1,
#if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number = 1,
#if wxUSE_TOOLBAR
// create main toolbar bycalling OnCreateToolBar()
virtual wxToolBar* CreateToolBar(long style = -1,
#if wxUSE_TOOLBAR
// create main toolbar bycalling OnCreateToolBar()
virtual wxToolBar* CreateToolBar(long style = -1,
+ wxWindowID id = wxID_ANY,
const wxString& name = wxToolBarNameStr);
virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR
const wxString& name = wxToolBarNameStr);
virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR
class WXDLLEXPORT wxInputHandler : public wxObject
{
public:
class WXDLLEXPORT wxInputHandler : public wxObject
{
public:
- // 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
+ // 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
virtual bool HandleKey(wxInputConsumer *consumer,
const wxKeyEvent& event,
bool pressed) = 0;
virtual bool HandleKey(wxInputConsumer *consumer,
const wxKeyEvent& event,
bool pressed) = 0;
// HandleMouseMove() as the mouse maybe over the control without it having
// focus
//
// HandleMouseMove() as the mouse maybe over the control without it having
// 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);
// react to the app getting/losing activation
//
virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event);
// 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 dtor for any base class
virtual bool HandleActivation(wxInputConsumer *consumer, bool activated);
// virtual dtor for any base class
bool pressed)
{
return m_handler ? m_handler->HandleKey(consumer, event, pressed)
bool pressed)
{
return m_handler ? m_handler->HandleKey(consumer, event, pressed)
}
virtual bool HandleMouse(wxInputConsumer *consumer,
const wxMouseEvent& event)
{
}
virtual bool HandleMouse(wxInputConsumer *consumer,
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;
virtual bool IsSelected(int n) const
{ return m_selections.Index(n) != wxNOT_FOUND; }
virtual bool IsSelected(int n) const
{ 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 GetSelections(wxArrayInt& aSelections) const;
virtual int GetSelection() const;
virtual int GetSelections(wxArrayInt& aSelections) const;
void Activate(int item = -1);
// select or unselect the specified or current (if -1) item
void Activate(int item = -1);
// 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);
- void DoUnselect(int item) { DoSelect(item, FALSE); }
+ void DoUnselect(int item) { DoSelect(item, false); }
// select an item and send a notification about it
void SelectAndNotify(int item);
// select an item and send a notification about it
void SelectAndNotify(int item);
virtual void EnsureVisible(int n);
// find the first item [strictly] after the current one which starts with
virtual void EnsureVisible(int n);
// 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
- bool FindItem(const wxString& prefix, bool strictlyAfter = FALSE);
- bool FindNextItem(const wxString& prefix) { return FindItem(prefix, TRUE); }
+ bool FindItem(const wxString& prefix, bool strictlyAfter = false);
+ bool FindNextItem(const wxString& prefix) { return FindItem(prefix, true); }
// extend the selection to span the range from the anchor (see below) to
// the specified or current item
// extend the selection to span the range from the anchor (see below) to
// the specified or current item
{
public:
// if pressing the mouse button in a multiselection listbox should toggle
{
public:
// 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
// only when the mouse is released in the multi selection listbox)
wxStdListboxInputHandler(wxInputHandler *inphand,
// parameter (this is the standard behaviour, under GTK the item is toggled
// only when the mouse is released in the multi selection listbox)
wxStdListboxInputHandler(wxInputHandler *inphand,
- bool toggleOnPressAlways = TRUE);
+ bool toggleOnPressAlways = true);
// base class methods
virtual bool HandleKey(wxInputConsumer *consumer,
// base class methods
virtual bool HandleKey(wxInputConsumer *consumer,
// 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
// 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
- // third one returns FALSE
+ // third one returns false
int HitTestUnsafe(const wxListBox *listbox, const wxMouseEvent& event);
int FixItemIndex(const wxListBox *listbox, int item);
bool IsValidIndex(const wxListBox *listbox, int item);
int HitTestUnsafe(const wxListBox *listbox, const wxMouseEvent& event);
int FixItemIndex(const wxListBox *listbox, int item);
bool IsValidIndex(const wxListBox *listbox, int item);
// show this menu at the given position (in screen coords) and optionally
// select its first item
void Popup(const wxPoint& pos, const wxSize& size,
// show this menu at the given position (in screen coords) and optionally
// select its first item
void Popup(const wxPoint& pos, const wxSize& size,
- bool selectFirst = TRUE);
+ bool selectFirst = true);
// dismiss the menu
void Dismiss();
// dismiss the menu
void Dismiss();
// implementation only from here
// implementation only from here
- // do as if this item were clicked, return TRUE if the resulting event was
- // processed, FALSE otherwise
+ // do as if this item were clicked, return true if the resulting event was
+ // 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);
#if wxUSE_ACCEL
bool ProcessKeyDown(int key);
#if wxUSE_ACCEL
// get the next item for the givan accel letter (used by wxFrame), return
// -1 if none
//
// get the next item for the givan accel letter (used by wxFrame), return
// -1 if none
//
- // if unique is not NULL, filled with TRUE if there is only one item with
- // this accel, FALSE if two or more
+ // if unique is not NULL, filled with true if there is only one item with
+ // this accel, false if two or more
int FindNextItemForAccel(int idxStart,
int keycode,
bool *unique = NULL) const;
int FindNextItemForAccel(int idxStart,
int keycode,
bool *unique = NULL) const;
#endif // wxUSE_ACCEL
// called by wxMenu when it is dismissed
#endif // wxUSE_ACCEL
// called by wxMenu when it is dismissed
- void OnDismissMenu(bool dismissMenuBar = FALSE);
+ void OnDismissMenu(bool dismissMenuBar = false);
protected:
// common part of all ctors
protected:
// common part of all ctors
void OnKeyDown(wxKeyEvent& event);
void OnKillFocus(wxFocusEvent& event);
void OnKeyDown(wxKeyEvent& 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
//
// the coordinates are client coordinates of menubar, convert if necessary
// processing as usual
//
// the coordinates are client coordinates of menubar, convert if necessary
void DoSelectMenu(size_t pos);
// popup the currently selected menu
void DoSelectMenu(size_t pos);
// popup the currently selected menu
- void PopupCurrentMenu(bool selectFirst = TRUE);
+ void PopupCurrentMenu(bool selectFirst = true);
// hide the currently selected menu
void DismissMenu();
// hide the currently selected menu
void DismissMenu();
virtual void SetText(const wxString& text);
virtual void SetCheckable(bool checkable);
virtual void SetText(const wxString& text);
virtual void SetCheckable(bool checkable);
- virtual void Enable(bool enable = TRUE);
- virtual void Check(bool check = TRUE);
+ virtual void Enable(bool enable = true);
+ virtual void Check(bool check = true);
// we add some extra functions which are also available under MSW from
// wxOwnerDrawn class - they will be moved to wxMenuItemBase later
// we add some extra functions which are also available under MSW from
// wxOwnerDrawn class - they will be moved to wxMenuItemBase later
void SetBitmaps(const wxBitmap& bmpChecked,
const wxBitmap& bmpUnchecked = wxNullBitmap);
void SetBitmap(const wxBitmap& bmp) { SetBitmaps(bmp); }
void SetBitmaps(const wxBitmap& bmpChecked,
const wxBitmap& bmpUnchecked = wxNullBitmap);
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; }
void SetDisabledBitmap( const wxBitmap& bmpDisabled )
{ return checked ? m_bmpChecked : m_bmpUnchecked; }
void SetDisabledBitmap( const wxBitmap& bmpDisabled )
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;
}
wxCoord GetHeight() const
{
return m_posY;
}
wxCoord GetHeight() const
{
- wxASSERT_MSG( m_height != -1, _T("must call SetHeight first!") );
+ wxASSERT_MSG( m_height != wxDefaultCoord, _T("must call SetHeight first!") );
// 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
// 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
- // 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
union
{
// only for the first one
union
{
virtual bool InsertPage(size_t nPage,
wxNotebookPage *pPage,
const wxString& strText,
virtual bool InsertPage(size_t nPage,
wxNotebookPage *pPage,
const wxString& strText,
int imageId = -1);
// style tests
// -----------
int imageId = -1);
// 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); }
// return wxTOP/wxBOTTOM/wxRIGHT/wxLEFT
wxDirection GetTabOrientation() const;
bool FixedSizeTabs() const { return HasFlag(wxNB_FIXEDWIDTH); }
// return wxTOP/wxBOTTOM/wxRIGHT/wxLEFT
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
bool IsVertical() const;
// bottom) as usual
bool IsVertical() const;
void PositionSpinBtn();
// refresh the given tab only
void PositionSpinBtn();
// refresh the given tab only
- void RefreshTab(int page, bool forceSelected = FALSE);
+ void RefreshTab(int page, bool forceSelected = false);
// refresh all tabs
void RefreshAllTabs();
// refresh all tabs
void RefreshAllTabs();
wxCoord GetTabWidth(int page) const
{ return FixedSizeTabs() ? m_widthMax : m_widths[page]; }
wxCoord GetTabWidth(int page) const
{ 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
{ return m_imageList && m_images[page] != -1; }
bool HasImage(int page) const
{ return m_imageList && m_images[page] != -1; }
virtual wxString GetString(int n) const;
virtual void SetString(int n, const wxString& label);
virtual wxString GetString(int n) const;
virtual void SetString(int n, const wxString& label);
- virtual void Enable(int n, bool enable = TRUE);
- virtual void Show(int n, bool show = TRUE);
+ virtual void Enable(int n, bool enable = 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 Show(bool show = TRUE);
+ virtual bool Enable(bool enable = true);
+ virtual bool Show(bool show = true);
virtual wxString GetLabel() const;
virtual void SetLabel(const wxString& label);
virtual wxString GetLabel() const;
virtual void SetLabel(const wxString& label);
const wxRect& rect,
int flags )
{ DrawBackground( dc, col, rect, flags ); }
const wxRect& rect,
int flags )
{ DrawBackground( dc, col, rect, flags ); }
// draw the label inside the given rectangle with the specified alignment
// and optionally emphasize the character with the given index
// draw the label inside the given rectangle with the specified alignment
// and optionally emphasize the character with the given index
// common part of DrawItems() and DrawCheckItems()
void DoDrawItems(const wxListBox *listbox,
size_t itemFirst, size_t itemLast,
// common part of DrawItems() and DrawCheckItems()
void DoDrawItems(const wxListBox *listbox,
size_t itemFirst, size_t itemLast,
- bool isCheckLbox = FALSE);
+ bool isCheckLbox = false);
wxWindow *m_window;
wxRenderer *m_renderer;
wxWindow *m_window;
wxRenderer *m_renderer;
// draws the arrow on the given DC in the given rectangle, uses
// wxControlWithArrows::GetArrowState() to get its current state
void DrawArrow(Arrow arrow, wxDC& dc, const wxRect& rect,
// draws the arrow on the given DC in the given rectangle, uses
// wxControlWithArrows::GetArrowState() to get its current state
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
// wxControlWithArrows::SetArrowState() if wxControlWithArrows::HitTest()
// process a mouse move, enter or leave event, possibly calling
// wxControlWithArrows::SetArrowState() if wxControlWithArrows::HitTest()
// set or clear the specified flag in the arrow state: this function is
// responsible for refreshing the control
virtual void SetArrowFlag(wxScrollArrows::Arrow arrow,
// set or clear the specified flag in the arrow state: this function is
// responsible for refreshing the control
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)
virtual wxScrollArrows::Arrow HitTest(const wxPoint& pt) const = 0;
// hit testing: return on which arrow the point is (or Arrow_None)
virtual wxScrollArrows::Arrow HitTest(const wxPoint& pt) const = 0;
- // called when the arrow is pressed, return TRUE to continue scrolling and
- // FALSE to stop it
+ // called when the arrow is pressed, return true to continue scrolling and
+ // false to stop it
virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0;
};
virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0;
};
virtual void SetThumbPosition(int thumbPos);
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
virtual void SetThumbPosition(int thumbPos);
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
// wxScrollBar actions
void ScrollToStart();
// wxScrollBar actions
void ScrollToStart();
virtual void DoDraw(wxControlRenderer *renderer);
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual void DoDraw(wxControlRenderer *renderer);
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();
// SetThumbPosition() helper
void UpdateThumb();
// SetThumbPosition() helper
// 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,
const wxControlAction& action);
protected:
// the methods which must be overridden in the derived class
virtual bool OnScrollTimer(wxScrollBar *scrollbar,
const wxControlAction& action);
protected:
// 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
// GTK+)
virtual bool IsAllowedButton(int button) = 0;
// if not (only left mouse button can do it under Windows, any button under
// GTK+)
virtual bool IsAllowedButton(int button) = 0;
// responsible for refreshing the control
virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
int flag,
// responsible for refreshing the control
virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
int flag,
// called when the user starts dragging the thumb
virtual void OnThumbDragStart(int pos) = 0;
// called when the user starts dragging the thumb
virtual void OnThumbDragStart(int pos) = 0;
virtual void OnPageScrollStart() = 0;
// called while the user keeps the mouse pressed above/below the thumb,
virtual void OnPageScrollStart() = 0;
// 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)
virtual bool OnPageScroll(int pageInc) = 0;
};
// scrollbar has reached the top/bottom)
virtual bool OnPageScroll(int pageInc) = 0;
};
protected:
// to implement in derived classes: perform the scroll action and return
protected:
// 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;
// should we skip the next timer event?
virtual bool DoNotify() = 0;
// should we skip the next timer event?
virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
int flag,
virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
int flag,
virtual void OnThumbDragStart(int pos);
virtual void OnThumbDrag(int pos);
virtual void OnThumbDragStart(int pos);
virtual void OnThumbDrag(int pos);
// normalize the value to fit in the range
int NormalizeValue(int value) const;
// normalize the value to fit in the range
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);
// change the value to the given one
bool ChangeValueBy(int inc);
// change the value to the given one
public:
wxSpinButton();
wxSpinButton(wxWindow *parent,
public:
wxSpinButton();
wxSpinButton(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
const wxString& name = wxSPIN_BUTTON_NAME);
bool Create(wxWindow *parent,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
const wxString& name = wxSPIN_BUTTON_NAME);
bool Create(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
// normalize the value to fit into min..max range
int NormalizeValue(int value) const;
// normalize the value to fit into min..max range
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
bool ChangeValue(int inc);
// changed
bool ChangeValue(int inc);
const wxSize& size = wxDefaultSize,
long style = 0)
{
const wxSize& size = wxDefaultSize,
long style = 0)
{
- Create(parent, -1, label, pos, size, style);
+ Create(parent, wxID_ANY, label, pos, size, style);
}
wxStaticBitmap(wxWindow *parent,
}
wxStaticBitmap(wxWindow *parent,
- virtual bool HasTransparentBackground() { return TRUE; }
+ virtual bool HasTransparentBackground() { return true; }
private:
virtual void DoDraw(wxControlRenderer *renderer);
private:
virtual void DoDraw(wxControlRenderer *renderer);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize)
{
const wxPoint& pos = wxDefaultPosition,
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,
// take account of this
virtual wxPoint GetBoxAreaOrigin() const;
// take account of this
virtual wxPoint GetBoxAreaOrigin() const;
- virtual bool HasTransparentBackground() { return TRUE; }
+ virtual bool HasTransparentBackground() { return true; }
protected:
// draw the control
protected:
// draw the control
// get the size of the border
wxRect GetBorderGeometry() const;
// get the size of the border
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
- virtual bool IsStaticBox() const { return TRUE; }
+ virtual bool IsStaticBox() const { return true; }
private:
DECLARE_DYNAMIC_CLASS(wxStaticBox)
private:
DECLARE_DYNAMIC_CLASS(wxStaticBox)
wxCoord length,
long style = wxLI_HORIZONTAL)
{
wxCoord length,
long style = wxLI_HORIZONTAL)
{
- Create(parent, -1, pos,
- style & wxLI_VERTICAL ? wxSize(-1, length)
- : wxSize(length, -1),
+ Create(parent, wxID_ANY, pos,
+ style & wxLI_VERTICAL ? wxSize(wxDefaultCoord, length)
+ : wxSize(length, wxDefaultCoord),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize)
{
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize)
{
- Create(parent, -1, label, pos, size, 0, wxStaticTextNameStr);
+ Create(parent, wxID_ANY, label, pos, size, 0, wxStaticTextNameStr);
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:
// calculate the optimal size for the label
protected:
// calculate the optimal size for the label
wxStatusBarUniv() { Init(); }
wxStatusBarUniv(wxWindow *parent,
wxStatusBarUniv() { Init(); }
wxStatusBarUniv(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
long style = 0,
const wxString& name = wxPanelNameStr)
{
long style = 0,
const wxString& name = wxPanelNameStr)
{
}
bool Create(wxWindow *parent,
}
bool Create(wxWindow *parent,
+ wxWindowID id = wxID_ANY,
long style = 0,
const wxString& name = wxPanelNameStr);
long style = 0,
const wxString& name = wxPanelNameStr);
// -----------------------
// caret stuff
// -----------------------
// caret stuff
- virtual void ShowCaret(bool show = TRUE);
- void HideCaret() { ShowCaret(FALSE); }
+ virtual void ShowCaret(bool show = true);
+ void HideCaret() { ShowCaret(false); }
void CreateCaret(); // for the current font size
// helpers for cursor movement
void CreateCaret(); // for the current font size
// helpers for cursor movement
// override these methods to handle the caret
virtual bool SetFont(const wxFont &font);
// override these methods to handle the caret
virtual bool SetFont(const wxFont &font);
- virtual bool Enable(bool enable = TRUE);
+ virtual bool Enable(bool enable = true);
// more readable flag testing methods
bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; }
// more readable flag testing methods
bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; }
wxRect GetRealTextArea() const;
// refresh the text in the given (in logical coords) rect
wxRect GetRealTextArea() const;
// 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)
void RefreshLineWrapMarks(wxTextCoord rowFirst, wxTextCoord rowLast);
// refresh the line wrap marks for the given range of lines (inclusive)
void RefreshLineWrapMarks(wxTextCoord rowFirst, wxTextCoord rowLast);
wxCoord *widthReal = NULL) const;
// get the start and end of the selection for this line: if the line is
wxCoord *widthReal = NULL) const;
// 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,
wxTextPos *start, wxTextPos *end) const;
bool GetSelectedPartOfLine(wxTextCoord line,
wxTextPos *start, wxTextPos *end) const;
wxTextCoord *colStart,
wxTextCoord *colEnd,
wxTextCoord *colRowStart,
wxTextCoord *colStart,
wxTextCoord *colEnd,
wxTextCoord *colRowStart,
- bool devCoords = TRUE) const;
+ bool devCoords = true) const;
// HitTest() version which takes the logical text coordinates and not the
// device ones
// HitTest() version which takes the logical text coordinates and not the
// device ones
wxTextCoord *row) const;
// get the line and the row in this line corresponding to the given row,
wxTextCoord *row) const;
// 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
bool GetLineAndRow(wxTextCoord row,
//
// NB: this function can only be called for controls which wrap lines
bool GetLineAndRow(wxTextCoord row,
inline const wxArrayString& GetLines() const;
inline size_t GetLineCount() const;
inline const wxArrayString& GetLines() 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);
// remove a line
bool ReplaceLine(wxTextCoord line, const wxString& text);
// remove a line
WXDLLEXPORT_DATA(extern bool) wxThemeUse##themename; \
static struct wxThemeUserFor##themename \
{ \
WXDLLEXPORT_DATA(extern bool) wxThemeUse##themename; \
static struct wxThemeUserFor##themename \
{ \
- wxThemeUserFor##themename() { wxThemeUse##themename = TRUE; } \
+ wxThemeUserFor##themename() { wxThemeUse##themename = true; } \
} wxThemeDoUse##themename
// to declare a new theme, this macro must be used in the class declaration
} wxThemeDoUse##themename
// to declare a new theme, this macro must be used in the class declaration
// and this one must be inserted in the source file
#define WX_IMPLEMENT_THEME(classname, themename, themedesc) \
// and this one must be inserted in the source file
#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; } \
wxThemeInfo classname::ms_info##themename(wxCtorFor##themename, \
wxT( #themename ), themedesc)
wxTheme *wxCtorFor##themename() { return new classname; } \
wxThemeInfo classname::ms_info##themename(wxCtorFor##themename, \
wxT( #themename ), themedesc)
void RefreshTool(wxToolBarToolBase *tool);
// (re)calculate the tool positions, should only be called if it is
void RefreshTool(wxToolBarToolBase *tool);
// (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();
// get the rect limits depending on the orientation: top/bottom for a
void DoLayout();
// get the rect limits depending on the orientation: top/bottom for a
virtual int GetMinWidth() const;
virtual int GetMinHeight() const;
virtual int GetMinWidth() const;
virtual int GetMinHeight() const;
- virtual bool ProvidesBackground() const { return TRUE; }
+ virtual bool ProvidesBackground() const { return true; }
protected:
// handle titlebar button click event
protected:
// handle titlebar button click event
void OnNcPaint(wxNcPaintEvent& event);
void OnSystemMenu(wxCommandEvent& event);
void OnNcPaint(wxNcPaintEvent& 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;
// true for currently active frame
bool m_isActive:1;
static int ms_canIconize;
// true for currently active frame
bool m_isActive:1;
int pos,
int page,
int range,
int pos,
int page,
int range,
- bool refresh = TRUE );
- virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
+ bool refresh = true );
+ virtual void SetScrollPos(int orient, int pos, bool refresh = true);
virtual int GetScrollPos(int orient) const;
virtual int GetScrollThumb(int orient) const;
virtual int GetScrollRange(int orient) const;
virtual int GetScrollPos(int orient) const;
virtual int GetScrollThumb(int orient) const;
virtual int GetScrollRange(int orient) const;
// return all state flags at once (combination of wxCONTROL_XXX values)
int GetStateFlags() const;
// return all state flags at once (combination of wxCONTROL_XXX values)
int GetStateFlags() const;
- // set the "highlighted" flag and return TRUE if it changed
- virtual bool SetCurrent(bool doit = TRUE);
+ // set the "highlighted" flag and return true if it changed
+ virtual bool SetCurrent(bool doit = true);
// get the scrollbar (may be NULL) for the given orientation
wxScrollBar *GetScrollbar(int orient) const
// get the scrollbar (may be NULL) for the given orientation
wxScrollBar *GetScrollbar(int orient) const
// 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
- 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
// be adapted from a parent window
// as a wxStaticText and wxCheckBox and the background should
// 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
bool UseBgCol() const { return m_hasBgCol; }
bool UseFgCol() const { return m_hasFgCol; }
bool UseFont() const { return m_hasFont; }
// corresponding GetXXX() methods instead of the default ones
bool UseBgCol() const { return m_hasBgCol; }
bool UseFgCol() const { return m_hasFgCol; }
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
// querying the current theme
// returns the (low level) renderer to use for drawing the control by
// querying the current theme
// the rect coordinates are, for us, in client coords, but if no rect is
// specified, the entire window is refreshed
// the rect coordinates are, for us, in client coords, but if no rect is
// specified, the entire window is refreshed
- virtual void Refresh(bool eraseBackground = TRUE,
+ virtual void Refresh(bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL);
// we refresh the window when it is dis/enabled
const wxRect *rect = (const wxRect *) NULL);
// 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?
virtual bool ShouldInheritColours() const { return false; }
// should we use the standard control colours or not?
virtual bool ShouldInheritColours() const { return false; }
void OnKeyUp(wxKeyEvent& event);
#endif // wxUSE_MENUS
void OnKeyUp(wxKeyEvent& event);
#endif // wxUSE_MENUS
- // draw the control background, return TRUE if done
+ // draw the control background, return true if done
virtual bool DoDrawBackground(wxDC& dc);
// draw the controls border
virtual bool DoDrawBackground(wxDC& dc);
// draw the controls border
// typically too big for them
if ( !wxButton::Create(parent, id, bitmap, _T(""),
pos, size, style | wxBU_EXACTFIT, validator, name) )
// typically too big for them
if ( !wxButton::Create(parent, id, bitmap, _T(""),
pos, size, style | wxBU_EXACTFIT, validator, name) )
}
void wxBitmapButton::OnSetBitmap()
}
void wxBitmapButton::OnSetBitmap()
}
bool wxBitmapButton::Enable(bool enable)
{
if ( !wxButton::Enable(enable) )
}
bool wxBitmapButton::Enable(bool enable)
{
if ( !wxButton::Enable(enable) )
if ( !enable && ChangeBitmap(m_bmpDisabled) )
Refresh();
if ( !enable && ChangeBitmap(m_bmpDisabled) )
Refresh();
}
bool wxBitmapButton::SetCurrent(bool doit)
}
bool wxBitmapButton::SetCurrent(bool doit)
void wxButton::Init()
{
m_isPressed =
void wxButton::Init()
{
m_isPressed =
}
bool wxButton::Create(wxWindow *parent,
}
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) )
SetLabel(label);
SetImageLabel(bitmap);
SetLabel(label);
SetImageLabel(bitmap);
CreateInputHandler(wxINP_HANDLER_BUTTON);
CreateInputHandler(wxINP_HANDLER_BUTTON);
rect, GetStateFlags());
}
rect, GetStateFlags());
}
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
else
return wxControl::PerformAction(action, numArg, strArg);
else
return wxControl::PerformAction(action, numArg, strArg);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
void wxButton::SetDefault()
{
void wxButton::SetDefault()
{
}
// ============================================================================
}
// ============================================================================
: wxStdInputHandler(handler)
{
m_winCapture = NULL;
: wxStdInputHandler(handler)
{
m_winCapture = NULL;
}
bool wxStdButtonInputHandler::HandleKey(wxInputConsumer *consumer,
}
bool wxStdButtonInputHandler::HandleKey(wxInputConsumer *consumer,
{
consumer->PerformAction(wxACTION_BUTTON_TOGGLE);
{
consumer->PerformAction(wxACTION_BUTTON_TOGGLE);
}
return wxStdInputHandler::HandleKey(consumer, event, pressed);
}
return wxStdInputHandler::HandleKey(consumer, event, pressed);
{
m_winCapture = consumer->GetInputWindow();
m_winCapture->CaptureMouse();
{
m_winCapture = consumer->GetInputWindow();
m_winCapture->CaptureMouse();
consumer->PerformAction(wxACTION_BUTTON_PRESS);
consumer->PerformAction(wxACTION_BUTTON_PRESS);
}
else if ( event.LeftUp() )
{
}
else if ( event.LeftUp() )
{
// this will generate a click event
consumer->PerformAction(wxACTION_BUTTON_TOGGLE);
// this will generate a click event
consumer->PerformAction(wxACTION_BUTTON_TOGGLE);
}
//else: the mouse was released outside the window, this doesn't
// count as a click
}
//else: the mouse was released outside the window, this doesn't
// count as a click
if ( event.Leaving() )
{
// remember that the mouse is now outside
if ( event.Leaving() )
{
// remember that the mouse is now outside
// 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);
}
// and entering it back should make it pressed again if it had been
// pressed
else if ( event.Entering() )
{
// the mouse is (back) inside the button
}
// and entering it back should make it pressed again if it had been
// pressed
else if ( event.Entering() )
{
// the mouse is (back) inside the button
// we did have a pressed button which we released when leaving the
// window, press it again
// we did have a pressed button which we released when leaving the
// window, press it again
- consumer->GetInputWindow()->SetCurrent(TRUE);
+ consumer->GetInputWindow()->SetCurrent(true);
consumer->PerformAction(wxACTION_BUTTON_PRESS);
consumer->PerformAction(wxACTION_BUTTON_PRESS);
bool wxStdButtonInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer),
const wxFocusEvent& WXUNUSED(event))
{
bool wxStdButtonInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer),
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
}
bool wxStdButtonInputHandler::HandleActivation(wxInputConsumer *consumer,
bool WXUNUSED(activated))
{
// the default button changes appearance when the app is [de]activated, so
}
bool wxStdButtonInputHandler::HandleActivation(wxInputConsumer *consumer,
bool WXUNUSED(activated))
{
// 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();
}
void wxCheckBox::Init()
{
void wxCheckBox::Init()
{
m_status = Status_Unchecked;
}
m_status = Status_Unchecked;
}
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
SetLabel(label);
SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_CHECKBOX);
SetLabel(label);
SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_CHECKBOX);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
void wxCheckBox::Toggle()
{
void wxCheckBox::Toggle()
{
ChangeValue(!GetValue());
}
ChangeValue(!GetValue());
}
else if ( action == wxACTION_BUTTON_RELEASE )
Release();
if ( action == wxACTION_CHECKBOX_CHECK )
else if ( action == wxACTION_BUTTON_RELEASE )
Release();
if ( action == wxACTION_CHECKBOX_CHECK )
else if ( action == wxACTION_CHECKBOX_CLEAR )
else if ( action == wxACTION_CHECKBOX_CLEAR )
else if ( action == wxACTION_CHECKBOX_TOGGLE )
Toggle();
else
return wxControl::PerformAction(action, numArg, strArg);
else if ( action == wxACTION_CHECKBOX_TOGGLE )
Toggle();
else
return wxControl::PerformAction(action, numArg, strArg);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
if ( !wxListBox::Create(parent, id, pos, size,
n, choices, style, validator, name) )
{
if ( !wxListBox::Create(parent, id, pos, size,
n, choices, style, validator, name) )
CreateInputHandler(wxINP_HANDLER_CHECKLISTBOX);
CreateInputHandler(wxINP_HANDLER_CHECKLISTBOX);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
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") );
return m_checks[item] != 0;
_T("invalid index in wxCheckListBox::IsChecked") );
return m_checks[item] != 0;
int pos = wxListBox::DoAppend(item);
// the item is initially unchecked
int pos = wxListBox::DoAppend(item);
// the item is initially unchecked
- m_checks.Insert(FALSE, pos);
+ m_checks.Insert(false, pos);
size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ )
{
size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- m_checks.Insert(FALSE, pos + n);
+ m_checks.Insert(false, pos + n);
size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ )
{
size_t count = items.GetCount();
for ( size_t n = 0; n < count; n++ )
{
return wxListBox::PerformAction(action, numArg, strArg);
}
return wxListBox::PerformAction(action, numArg, strArg);
}
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item);
{
lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item);
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
BEGIN_EVENT_TABLE(wxChoice, wxComboBox)
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
BEGIN_EVENT_TABLE(wxChoice, wxComboBox)
- EVT_COMBOBOX(-1, wxChoice::OnComboBox)
+ EVT_COMBOBOX(wxID_ANY, wxChoice::OnComboBox)
END_EVENT_TABLE()
wxChoice::wxChoice(wxWindow *parent, wxWindowID id,
END_EVENT_TABLE()
wxChoice::wxChoice(wxWindow *parent, wxWindowID id,
{
public:
wxComboButton(wxComboControl *combo)
{
public:
wxComboButton(wxComboControl *combo)
- : wxBitmapButton(combo->GetParent(), -1, wxNullBitmap,
+ : wxBitmapButton(combo->GetParent(), wxID_ANY, wxNullBitmap,
wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE | wxBU_EXACTFIT)
{
wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE | wxBU_EXACTFIT)
{
// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxComboButton, wxButton)
// ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxComboButton, wxButton)
- EVT_BUTTON(-1, wxComboButton::OnButton)
+ EVT_BUTTON(wxID_ANY, wxComboButton::OnButton)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxComboListBox, wxListBox)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxComboListBox, wxListBox)
- EVT_LISTBOX(-1, wxComboListBox::OnSelect)
- EVT_LISTBOX_DCLICK(-1, wxComboListBox::OnSelect)
+ EVT_LISTBOX(wxID_ANY, wxComboListBox::OnSelect)
+ EVT_LISTBOX_DCLICK(wxID_ANY, wxComboListBox::OnSelect)
EVT_MOTION(wxComboListBox::OnMouseMove)
EVT_LEFT_UP(wxComboListBox::OnLeftUp)
END_EVENT_TABLE()
EVT_MOTION(wxComboListBox::OnMouseMove)
EVT_LEFT_UP(wxComboListBox::OnLeftUp)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxComboTextCtrl, wxTextCtrl)
EVT_KEY_DOWN(wxComboTextCtrl::OnKey)
EVT_KEY_UP(wxComboTextCtrl::OnKey)
BEGIN_EVENT_TABLE(wxComboTextCtrl, wxTextCtrl)
EVT_KEY_DOWN(wxComboTextCtrl::OnKey)
EVT_KEY_UP(wxComboTextCtrl::OnKey)
- EVT_TEXT(-1, wxComboTextCtrl::OnText)
+ EVT_TEXT(wxID_ANY, wxComboTextCtrl::OnText)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
{
m_popup = (wxComboPopup *)NULL;
m_winPopup = (wxPopupComboWindow *)NULL;
{
m_popup = (wxComboPopup *)NULL;
m_winPopup = (wxPopupComboWindow *)NULL;
- m_isPopupShown = FALSE;
+ m_isPopupShown = false;
m_btn = NULL;
m_text = NULL;
}
m_btn = NULL;
m_text = NULL;
}
style &= ~wxBORDER_NONE;
style |= wxBORDER_SUNKEN;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
style &= ~wxBORDER_NONE;
style |= wxBORDER_SUNKEN;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
// 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()
// 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()
// for compatibility with the other ports, the height specified is the
// combined height of the combobox itself and the popup
// for compatibility with the other ports, the height specified is the
// combined height of the combobox itself and the popup
+ if ( size.y == wxDefaultCoord )
{
// ok, use default height for popup too
{
// ok, use default height for popup too
+ m_heightPopup = wxDefaultCoord;
// have to disable this window to avoid interfering it with message
// processing to the text and the button... but pretend it is enabled to
// have to disable this window to avoid interfering it with message
// processing to the text and the button... but pretend it is enabled to
- // make IsEnabled() return TRUE
- wxControl::Enable(FALSE); // don't use non virtual Disable() here!
- m_isEnabled = TRUE;
+ // make IsEnabled() return true
+ wxControl::Enable(false); // don't use non virtual Disable() here!
+ m_isEnabled = true;
CreateInputHandler(wxINP_HANDLER_COMBOBOX);
CreateInputHandler(wxINP_HANDLER_COMBOBOX);
}
wxComboControl::~wxComboControl()
}
wxComboControl::~wxComboControl()
bool wxComboControl::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
bool wxComboControl::Enable(bool enable)
{
if ( !wxControl::Enable(enable) )
m_btn->Enable(enable);
m_text->Enable(enable);
m_btn->Enable(enable);
m_text->Enable(enable);
}
bool wxComboControl::Show(bool show)
{
if ( !wxControl::Show(show) )
}
bool wxComboControl::Show(bool show)
{
if ( !wxControl::Show(show) )
if (m_btn)
m_btn->Show(show);
if (m_btn)
m_btn->Show(show);
if (m_text)
m_text->Show(show);
if (m_text)
m_text->Show(show);
// size and position the popup window correctly
m_winPopup->SetSize(GetSize().x,
// size and position the popup window correctly
m_winPopup->SetSize(GetSize().x,
- m_heightPopup == -1 ? control->GetBestSize().y
+ m_heightPopup == wxDefaultCoord ? control->GetBestSize().y
: m_heightPopup);
wxSize sizePopup = m_winPopup->GetClientSize();
control->SetSize(0, 0, sizePopup.x, sizePopup.y);
: m_heightPopup);
wxSize sizePopup = m_winPopup->GetClientSize();
control->SetSize(0, 0, sizePopup.x, sizePopup.y);
m_text->SelectAll();
m_popup->SetSelection(m_text->GetValue());
m_text->SelectAll();
m_popup->SetSelection(m_text->GetValue());
}
void wxComboControl::HidePopup()
}
void wxComboControl::HidePopup()
- m_isPopupShown = FALSE;
+ m_isPopupShown = false;
}
void wxComboControl::OnSelect(const wxString& value)
}
void wxComboControl::OnSelect(const wxString& value)
const wxString& value,
long style,
const wxValidator& validator)
const wxString& value,
long style,
const wxValidator& validator)
- : wxTextCtrl(combo->GetParent(), -1, value,
+ : wxTextCtrl(combo->GetParent(), wxID_ANY, value,
wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE | style,
validator)
wxDefaultPosition, wxDefaultSize,
wxBORDER_NONE | style,
validator)
// ----------------------------------------------------------------------------
wxComboListBox::wxComboListBox(wxComboControl *combo, int style)
// ----------------------------------------------------------------------------
wxComboListBox::wxComboListBox(wxComboControl *combo, int style)
- : wxListBox(combo->GetPopupWindow(), -1,
+ : wxListBox(combo->GetPopupWindow(), wxID_ANY,
wxDefaultPosition, wxDefaultSize,
0, NULL,
wxBORDER_SIMPLE | wxLB_INT_HEIGHT | style),
wxDefaultPosition, wxDefaultSize,
0, NULL,
wxBORDER_SIMPLE | wxLB_INT_HEIGHT | style),
else if ( !FindItem(value) )
{
// no match att all
else if ( !FindItem(value) )
{
// no match att all
}
void wxComboListBox::OnSelect(wxCommandEvent& event)
}
void wxComboListBox::OnSelect(wxCommandEvent& event)
void wxComboListBox::OnShow()
{
// nobody clicked us yet
void wxComboListBox::OnShow()
{
// nobody clicked us yet
}
bool wxComboListBox::PerformAction(const wxControlAction& action,
}
bool wxComboListBox::PerformAction(const wxControlAction& action,
// 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
// and this is done by wxComboControl itself
// 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
// and this is done by wxComboControl itself
}
return wxListBox::PerformAction(action, numArg, strArg);
}
return wxListBox::PerformAction(action, numArg, strArg);
void wxComboListBox::OnLeftUp(wxMouseEvent& event)
{
// we should dismiss the combo now
void wxComboListBox::OnLeftUp(wxMouseEvent& event)
{
// we should dismiss the combo now
if ( !wxComboControl::Create(parent, id, value, pos, size, style,
validator, name) )
{
if ( !wxComboControl::Create(parent, id, value, pos, size, style,
validator, name) )
{
}
wxComboListBox *combolbox =
}
wxComboListBox *combolbox =
SetPopupControl(combolbox);
SetPopupControl(combolbox);
}
wxComboBox::~wxComboBox()
}
wxComboBox::~wxComboBox()
long numArg,
const wxString& strArg)
{
long numArg,
const wxString& strArg)
{
- bool processed = FALSE;
+ bool processed = false;
if ( action == wxACTION_COMBOBOX_POPUP )
{
if ( !m_isPopupShown )
{
ShowPopup();
if ( action == wxACTION_COMBOBOX_POPUP )
{
if ( !m_isPopupShown )
{
ShowPopup();
}
}
else if ( action == wxACTION_COMBOBOX_DISMISS )
}
}
else if ( action == wxACTION_COMBOBOX_DISMISS )
return wxControl::PerformAction(action, numArg, strArg);
}
return wxControl::PerformAction(action, numArg, strArg);
}
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
+ if ( !action.IsEmpty() )
{
consumer->PerformAction(action);
{
consumer->PerformAction(action);
if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) )
{
// underlying window creation failed?
if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) )
{
// underlying window creation failed?
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
- 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,
rectUpdate.GetBottom());
#if 0 //def WXDEBUG_SCROLLBAR
rectUpdate.GetBottom());
#if 0 //def WXDEBUG_SCROLLBAR
- static bool s_refreshDebug = FALSE;
+ static bool s_refreshDebug = false;
if ( s_refreshDebug )
{
wxClientDC dc(wxConstCast(scrollbar, wxScrollBar));
if ( s_refreshDebug )
{
wxClientDC dc(wxConstCast(scrollbar, wxScrollBar));
(wxScrollArrows::Arrow)nArrow,
m_dc,
rectArrow,
(wxScrollArrows::Arrow)nArrow,
m_dc,
rectArrow,
- TRUE // draw a scrollbar arrow, not just an arrow
+ true // draw a scrollbar arrow, not just an arrow
void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox,
size_t itemFirst, size_t itemLast)
{
void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox,
size_t itemFirst, size_t itemLast)
{
- DoDrawItems(lbox, itemFirst, itemLast, TRUE);
+ DoDrawItems(lbox, itemFirst, itemLast, true);
}
#endif // wxUSE_CHECKLISTBOX
}
#endif // wxUSE_CHECKLISTBOX
m_returnCode = 0;
m_windowDisabler = NULL;
m_eventLoop = NULL;
m_returnCode = 0;
m_windowDisabler = NULL;
m_eventLoop = NULL;
- m_isShowingModal = FALSE;
+ m_isShowingModal = false;
else
{
SetReturnCode(wxID_CANCEL);
else
{
SetReturnCode(wxID_CANCEL);
else
{
SetReturnCode(wxID_OK);
else
{
SetReturnCode(wxID_OK);
- m_isShowingModal = TRUE;
+ m_isShowingModal = true;
wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") );
wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") );
- m_isShowingModal = FALSE;
+ m_isShowingModal = false;
#endif // wxUSE_TOOLBAR
m_frameMenuBar->SetSize(0,
#endif // wxUSE_TOOLBAR
m_frameMenuBar->SetSize(0,
-#ifdef __WXPM__ // FIXME -- remove this, make wxOS2/Univ behave as
+#ifdef __WXPM__ // FIXME -- remove this, make wxOS2/Univ behave as
// the rest of the world!!!
GetClientSize().y - heightMbar - heightTbar,
#else
// the rest of the world!!!
GetClientSize().y - heightMbar - heightTbar,
#else
if ( m_frameStatusBar )
{
wxSize size = GetClientSize();
if ( m_frameStatusBar )
{
wxSize size = GetClientSize();
- m_frameStatusBar->SetSize(0, size.y, size.x, -1);
+ m_frameStatusBar->SetSize(0, size.y, size.x, wxDefaultCoord);
bool wxFrame::Enable(bool enable)
{
if (!wxFrameBase::Enable(enable))
bool wxFrame::Enable(bool enable)
{
if (!wxFrameBase::Enable(enable))
#ifdef __WXMICROWIN__
if (m_frameMenuBar)
m_frameMenuBar->Enable(enable);
#endif
#ifdef __WXMICROWIN__
if (m_frameMenuBar)
m_frameMenuBar->Enable(enable);
#endif
if ( !wxGaugeBase::Create(parent, id, range, pos, size, style,
validator, name) )
{
if ( !wxGaugeBase::Create(parent, id, range, pos, size, style,
validator, name) )
{
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
if ( IsVertical() )
{
size.x = (3*size.y) / 2 + 2;
if ( IsVertical() )
{
size.x = (3*size.y) / 2 + 2;
+ size.y = wxDefaultCoord;
}
else
{
size.y = (3*size.x) / 2 + 2;
}
else
{
size.y = (3*size.x) / 2 + 2;
+ size.x = wxDefaultCoord;
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();
}
void wxInputConsumer::OnKeyUp(wxKeyEvent& event)
{
event.Skip();
}
void wxInputConsumer::OnKeyUp(wxKeyEvent& event)
{
- if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, FALSE) )
+ if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, false) )
long WXUNUSED(numArg),
const wxString& WXUNUSED(strArg))
{
long WXUNUSED(numArg),
const wxString& WXUNUSED(strArg))
{
bool wxInputHandler::HandleMouseMove(wxInputConsumer * WXUNUSED(consumer),
const wxMouseEvent& WXUNUSED(event))
{
bool wxInputHandler::HandleMouseMove(wxInputConsumer * WXUNUSED(consumer),
const wxMouseEvent& WXUNUSED(event))
{
}
bool wxInputHandler::HandleFocus(wxInputConsumer *WXUNUSED(consumer),
const wxFocusEvent& WXUNUSED(event))
{
}
bool wxInputHandler::HandleFocus(wxInputConsumer *WXUNUSED(consumer),
const wxFocusEvent& WXUNUSED(event))
{
}
bool wxInputHandler::HandleActivation(wxInputConsumer *WXUNUSED(consumer),
bool WXUNUSED(activated))
{
}
bool wxInputHandler::HandleActivation(wxInputConsumer *WXUNUSED(consumer),
bool WXUNUSED(activated))
{
}
wxInputHandler::~wxInputHandler()
}
wxInputHandler::~wxInputHandler()
// no items hence no current item
m_current = -1;
m_selAnchor = -1;
// no items hence no current item
m_current = -1;
m_selAnchor = -1;
- m_currentChanged = FALSE;
+ m_currentChanged = false;
// no need to update anything initially
m_updateCount = 0;
// no need to update anything initially
m_updateCount = 0;
m_updateScrollbarX =
m_showScrollbarX =
m_updateScrollbarY =
m_updateScrollbarX =
m_showScrollbarX =
m_updateScrollbarY =
- m_showScrollbarY = FALSE;
+ m_showScrollbarY = false;
}
wxListBox::wxListBox(wxWindow *parent,
}
wxListBox::wxListBox(wxWindow *parent,
if ( !wxControl::Create(parent, id, pos, size, style,
validator, name) )
if ( !wxControl::Create(parent, id, pos, size, style,
validator, name) )
CreateInputHandler(wxINP_HANDLER_LISTBOX);
CreateInputHandler(wxINP_HANDLER_LISTBOX);
}
wxListBox::~wxListBox()
}
wxListBox::~wxListBox()
m_itemsClientData.Insert(NULL, index);
m_itemsClientData.Insert(NULL, index);
- m_updateScrollbarY = TRUE;
+ m_updateScrollbarY = true;
if ( HasHorzScrollbar() )
{
if ( HasHorzScrollbar() )
{
{
m_maxWidth = width;
m_maxWidthItem = index;
{
m_maxWidth = width;
m_maxWidthItem = index;
- m_updateScrollbarX = TRUE;
+ m_updateScrollbarX = true;
}
// 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
// keeping track of it here, this is probably more efficient for a typical
// 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
m_itemsClientData.Insert(clientData ? clientData[n] : NULL, index);
}
m_itemsClientData.Insert(clientData ? clientData[n] : NULL, index);
}
- m_updateScrollbarY = TRUE;
+ m_updateScrollbarY = true;
{
m_maxWidth = width;
m_maxWidthItem = n;
{
m_maxWidth = width;
m_maxWidthItem = n;
- m_updateScrollbarX = TRUE;
+ m_updateScrollbarX = true;
}
// or also decreased if the old string was the longest one
else if ( n == m_maxWidthItem )
}
// or also decreased if the old string was the longest one
else if ( n == m_maxWidthItem )
- m_updateScrollbarY = TRUE;
+ m_updateScrollbarY = true;
}
// 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
if ( n == m_maxWidthItem )
// finally, if the longest item was deleted the scrollbar may disappear
if ( n == m_maxWidthItem )
void wxListBox::RefreshHorzScrollbar()
{
m_maxWidth = 0; // recalculate it
void wxListBox::RefreshHorzScrollbar()
{
m_maxWidth = 0; // recalculate it
- m_updateScrollbarX = TRUE;
+ m_updateScrollbarX = true;
}
void wxListBox::UpdateScrollbars()
}
void wxListBox::UpdateScrollbars()
else // never show it
{
charWidth = maxWidth = 0;
else // never show it
{
charWidth = maxWidth = 0;
- showScrollbarX = FALSE;
+ showScrollbarX = false;
}
// what should be the scrollbar range now?
}
// what should be the scrollbar range now?
m_updateFrom, m_updateFrom + m_updateCount - 1,
rect.GetTop(), rect.GetBottom());
m_updateFrom, m_updateFrom + m_updateCount - 1,
rect.GetTop(), rect.GetBottom());
UpdateScrollbars();
m_updateScrollbarX =
UpdateScrollbars();
m_updateScrollbarX =
- m_updateScrollbarY = FALSE;
+ m_updateScrollbarY = false;
}
if ( m_currentChanged )
{
DoEnsureVisible(m_current);
}
if ( m_currentChanged )
{
DoEnsureVisible(m_current);
- m_currentChanged = FALSE;
+ m_currentChanged = false;
bool wxListBox::SetFont(const wxFont& font)
{
if ( !wxControl::SetFont(font) )
bool wxListBox::SetFont(const wxFont& font)
{
if ( !wxControl::SetFont(font) )
CalcItemsPerPage();
RefreshAll();
CalcItemsPerPage();
RefreshAll();
}
void wxListBox::CalcItemsPerPage()
}
void wxListBox::CalcItemsPerPage()
// the scrollbars might [dis]appear
m_updateScrollbarX =
// the scrollbars might [dis]appear
m_updateScrollbarX =
- m_updateScrollbarY = TRUE;
+ m_updateScrollbarY = true;
- m_currentChanged = TRUE;
+ m_currentChanged = true;
RefreshItem(m_current);
}
RefreshItem(m_current);
}
if ( !count )
{
// empty listbox, we can't find anything in it
if ( !count )
{
// empty listbox, we can't find anything in it
}
// 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
}
void wxListBox::EnsureVisible(int n)
}
void wxListBox::EnsureVisible(int n)
UpdateScrollbars();
m_updateScrollbarX =
UpdateScrollbars();
m_updateScrollbarX =
- m_updateScrollbarY = FALSE;
+ m_updateScrollbarY = false;
else
return wxControl::PerformAction(action, numArg, strArg);
else
return wxControl::PerformAction(action, numArg, strArg);
}
// ============================================================================
}
// ============================================================================
m_btnCapture = 0;
m_toggleOnPressAlways = toggleOnPressAlways;
m_actionMouse = wxACTION_NONE;
m_btnCapture = 0;
m_toggleOnPressAlways = toggleOnPressAlways;
m_actionMouse = wxACTION_NONE;
- m_trackMouseOutside = TRUE;
+ m_trackMouseOutside = true;
}
int wxStdListboxInputHandler::HitTest(const wxListBox *lbox,
}
int wxStdListboxInputHandler::HitTest(const wxListBox *lbox,
}
// by default we always do track it
}
// by default we always do track it
- m_trackMouseOutside = TRUE;
+ m_trackMouseOutside = true;
// we're only interested in the key press events
if ( pressed && !event.AltDown() )
{
// we're only interested in the key press events
if ( pressed && !event.AltDown() )
{
int style = consumer->GetInputWindow()->GetWindowStyle();
wxControlAction action;
int style = consumer->GetInputWindow()->GetWindowStyle();
wxControlAction action;
if ( style & wxLB_MULTIPLE )
{
action = wxACTION_LISTBOX_TOGGLE;
if ( style & wxLB_MULTIPLE )
{
action = wxACTION_LISTBOX_TOGGLE;
}
break;
case WXK_RETURN:
action = wxACTION_LISTBOX_ACTIVATE;
}
break;
case WXK_RETURN:
action = wxACTION_LISTBOX_ACTIVATE;
+ if ( !action.IsEmpty() )
{
consumer->PerformAction(action, -1, strArg);
{
consumer->PerformAction(action, -1, strArg);
//else: nothing to do for multiple selection listboxes
}
//else: nothing to do for multiple selection listboxes
}
action = wxACTION_LISTBOX_ACTIVATE;
}
action = wxACTION_LISTBOX_ACTIVATE;
}
+ if ( !action.IsEmpty() )
{
lbox->PerformAction(action, item);
{
lbox->PerformAction(action, item);
}
return wxStdInputHandler::HandleMouse(consumer, event);
}
return wxStdInputHandler::HandleMouse(consumer, event);
// when we do it ourselves): in this case we only react to
// the mouse messages when they happen inside the listbox
if ( lbox->HitTest(event.GetPosition()) != wxHT_WINDOW_INSIDE )
// when we do it ourselves): in this case we only react to
// the mouse messages when they happen inside the listbox
if ( lbox->HitTest(event.GetPosition()) != wxHT_WINDOW_INSIDE )
}
int item = HitTest(lbox, event);
}
int item = HitTest(lbox, event);
// events
SetupCapture(lbox, event, item);
// events
SetupCapture(lbox, event, item);
- m_trackMouseOutside = FALSE;
+ m_trackMouseOutside = false;
}
if ( IsValidIndex(lbox, item) )
}
if ( IsValidIndex(lbox, item) )
- void SetEnabled(bool enabled = TRUE) { m_isEnabled = enabled; }
+ void SetEnabled(bool enabled = true) { m_isEnabled = enabled; }
virtual void OnDismiss();
// called when a submenu is dismissed
virtual void OnDismiss();
// called when a submenu is dismissed
- void OnSubmenuDismiss() { m_hasOpenSubMenu = FALSE; }
+ void OnSubmenuDismiss() { m_hasOpenSubMenu = false; }
// get the currently selected item (may be NULL)
wxMenuItem *GetCurrentItem() const
// get the currently selected item (may be NULL)
wxMenuItem *GetCurrentItem() const
// preselect the first item
void SelectFirst() { SetCurrent(m_menu->GetMenuItems().GetFirst()); }
// preselect the first item
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);
// process mouse move event
bool ProcessKeyDown(int key);
// process mouse move event
void ChangeCurrent(wxMenuItemList::compatibility_iterator node);
// activate item, i.e. call either ClickItem() or OpenSubmenu() depending
void ChangeCurrent(wxMenuItemList::compatibility_iterator node);
// 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...)
bool ActivateItem(wxMenuItem *item, InputMethod how = WithKeyboard);
// separator...)
bool ActivateItem(wxMenuItem *item, InputMethod how = WithKeyboard);
return wxEvtHandler::ProcessEvent(event);
}
return wxEvtHandler::ProcessEvent(event);
}
wxPopupMenuWindow::wxPopupMenuWindow(wxWindow *parent, wxMenu *menu)
{
m_menu = menu;
wxPopupMenuWindow::wxPopupMenuWindow(wxWindow *parent, wxMenu *menu)
{
m_menu = menu;
- m_hasOpenSubMenu = FALSE;
+ m_hasOpenSubMenu = false;
{
// when we are dismissed because the user clicked elsewhere or we lost
// focus in any other way, hide the parent menu as well
{
// when we are dismissed because the user clicked elsewhere or we lost
// focus in any other way, hide the parent menu as well
}
void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
}
void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
void wxPopupMenuWindow::DismissAndNotify()
{
Dismiss();
void wxPopupMenuWindow::DismissAndNotify()
{
Dismiss();
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
wxSize(m_menu->GetGeometryInfo().GetSize().x, 0),
how == WithKeyboard /* preselect first item then */);
wxSize(m_menu->GetGeometryInfo().GetSize().x, 0),
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)
// don't activate disabled items
if ( !item || !item->IsEnabled() )
{
// don't activate disabled items
if ( !item || !item->IsEnabled() )
{
}
// normal menu items generate commands, submenus can be opened and
}
// normal menu items generate commands, submenus can be opened and
}
else // separator, can't activate
{
}
else // separator, can't activate
{
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
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);
if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) )
{
// eat the event
pos = ClientToScreen(pos);
if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) )
{
// eat the event
}
//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
}
}
}
void wxPopupMenuWindow::OnLeftUp(wxMouseEvent& event)
}
void wxPopupMenuWindow::OnLeftUp(wxMouseEvent& event)
else
{
// this menu is the last opened
else
{
// this menu is the last opened
// to open it inspit of this)
if ( HasOpenSubmenu() )
{
// to open it inspit of this)
if ( HasOpenSubmenu() )
{
- wxCHECK_MSG( CanOpen(item), FALSE,
+ wxCHECK_MSG( CanOpen(item), false,
_T("has open submenu but another item selected?") );
if ( item->GetSubMenu()->ProcessKeyDown(key) )
_T("has open submenu but another item selected?") );
if ( item->GetSubMenu()->ProcessKeyDown(key) )
// 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
// 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
// menubar
if ( !m_menu->GetParent() )
{
// menubar
if ( !m_menu->GetParent() )
{
case WXK_ESCAPE:
// close just this menu
Dismiss();
case WXK_ESCAPE:
// close just this menu
Dismiss();
wxMenuItemList::compatibility_iterator nodeStart = GetNextNode();
// do we have more than one item with this accel?
wxMenuItemList::compatibility_iterator nodeStart = GetNextNode();
// do we have more than one item with this accel?
- bool notUnique = FALSE;
+ bool notUnique = false;
// translate everything to lower case before comparing
wxChar chAccel = wxTolower(key);
// translate everything to lower case before comparing
wxChar chAccel = wxTolower(key);
}
else // we already had found such item
{
}
else // we already had found such item
{
// no need to continue further, we won't find
// anything we don't already know
// no need to continue further, we won't find
// anything we don't already know
//else: just select it but don't activate as the user might
// have wanted to activate another item
//else: just select it but don't activate as the user might
// have wanted to activate another item
- // skip "processed = FALSE" below
+ // skip "processed = false" below
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 )
{
int count = GetMenuItemCount();
if ( item->GetKind() == wxITEM_RADIO )
{
int count = GetMenuItemCount();
// for now it has just one element
item->SetAsRadioGroupStart();
item->SetRadioGroupEnd(m_startRadioGroup);
// for now it has just one element
item->SetAsRadioGroupStart();
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
{
{
// dismissParent is recursive
m_menuParent->Dismiss();
{
// dismissParent is recursive
m_menuParent->Dismiss();
- m_menuParent->OnDismiss(TRUE);
+ m_menuParent->OnDismiss(true);
}
}
else // no parent menu
}
}
else // no parent menu
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") );
return m_popupMenu->ProcessKeyDown(key);
_T("can't process key events if not shown") );
return m_popupMenu->ProcessKeyDown(key);
// try its elements
if ( item->GetSubMenu()->ProcessAccelEvent(event) )
{
// try its elements
if ( item->GetSubMenu()->ProcessAccelEvent(event) )
{
}
void wxMenu::AddAccelFor(wxMenuItem *item)
}
void wxMenu::AddAccelFor(wxMenuItem *item)
: wxMenuItemBase(parentMenu, id, text, help, kind, subMenu)
{
m_posY =
: wxMenuItemBase(parentMenu, id, text, help, kind, subMenu)
{
m_posY =
+ m_height = wxDefaultCoord;
- m_isRadioGroupStart = FALSE;
+ m_isRadioGroupStart = false;
m_bmpDisabled = wxNullBitmap;
m_bmpDisabled = wxNullBitmap;
- node->GetData()->m_isChecked = FALSE;
+ node->GetData()->m_isChecked = false;
}
node = node->GetNext();
}
}
node = node->GetNext();
}
void wxMenuItem::SetAsRadioGroupStart()
{
void wxMenuItem::SetAsRadioGroupStart()
{
- m_isRadioGroupStart = TRUE;
+ m_isRadioGroupStart = true;
}
void wxMenuItem::SetRadioGroupStart(int start)
}
void wxMenuItem::SetRadioGroupStart(int start)
- m_shouldShowMenu = FALSE;
+ m_shouldShowMenu = false;
}
void wxMenuBar::Attach(wxFrame *frame)
}
void wxMenuBar::Attach(wxFrame *frame)
else // not created yet, do it now
{
// we have no way to return the error from here anyhow :-(
else // not created yet, do it now
{
// we have no way to return the error from here anyhow :-(
- (void)Create(frame, -1);
+ (void)Create(frame, wxID_ANY);
SetCursor(wxCURSOR_ARROW);
SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
// calculate and set our height (it won't be changed any more)
SetCursor(wxCURSOR_ARROW);
SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
// 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
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{
if ( !wxMenuBarBase::Insert(pos, menu, title) )
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
{
if ( !wxMenuBarBase::Insert(pos, menu, title) )
wxMenuInfo *info = new wxMenuInfo(title);
m_menuInfos.Insert(info, pos);
RefreshAllItemsAfter(pos);
wxMenuInfo *info = new wxMenuInfo(title);
m_menuInfos.Insert(info, pos);
RefreshAllItemsAfter(pos);
}
wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
}
wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
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();
}
if ( IsShowingMenu() )
{
// restore m_shouldShowMenu flag after DismissMenu() which resets
if ( IsShowingMenu() )
{
// restore m_shouldShowMenu flag after DismissMenu() which resets
bool old = m_shouldShowMenu;
DismissMenu();
bool old = m_shouldShowMenu;
DismissMenu();
- wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::OnLeftDown"));
+ wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::OnLeftDown"));
CaptureMouse();
// show it as selected
RefreshItem((size_t)m_current);
// show the menu
CaptureMouse();
// show it as selected
RefreshItem((size_t)m_current);
// show the menu
- PopupCurrentMenu(FALSE /* don't select first item - as Windows does */);
+ PopupCurrentMenu(false /* don't select first item - as Windows does */);
static wxPoint s_ptLast;
if ( pt == s_ptLast )
{
static wxPoint s_ptLast;
if ( pt == s_ptLast )
{
int currentNew = GetMenuFromPoint(pt);
if ( (currentNew == -1) || (currentNew == m_current) )
{
int currentNew = GetMenuFromPoint(pt);
if ( (currentNew == -1) || (currentNew == m_current) )
{
}
// select the new active item
}
// select the new active item
if ( m_shouldShowMenu && !m_menuShown)
{
// open the new menu if the old one we closed had been opened
if ( m_shouldShowMenu && !m_menuShown)
{
// 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 */);
}
void wxMenuBar::OnKeyDown(wxKeyEvent& event)
}
void wxMenuBar::OnKeyDown(wxKeyEvent& event)
// do we have more than one item with this accel?
if ( unique )
// do we have more than one item with this accel?
if ( unique )
// translate everything to lower case before comparing
wxChar chAccel = wxTolower(key);
// translate everything to lower case before comparing
wxChar chAccel = wxTolower(key);
else // we already had found such item
{
if ( unique )
else // we already had found such item
{
if ( unique )
// no need to continue further, we won't find
// anything we don't already know
// no need to continue further, we won't find
// anything we don't already know
if ( node->GetData()->ProcessAccelEvent(event) )
{
// menu processed it
if ( node->GetData()->ProcessAccelEvent(event) )
{
// menu processed it
wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") );
// in any case, we should show it - even if we won't
wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") );
// 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) )
{
void wxMenuBar::OnDismissMenu(bool dismissMenuBar)
{
void wxMenuBar::OnDismissMenu(bool dismissMenuBar)
{
- m_shouldShowMenu = FALSE;
+ m_shouldShowMenu = false;
m_menuShown = NULL;
if ( dismissMenuBar )
{
m_menuShown = NULL;
if ( dismissMenuBar )
{
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") );
#ifdef __WXMSW__
_T("can't show more than one popup menu at a time") );
#ifdef __WXMSW__
ms_evtLoopPopup = NULL;
// remove the handler
ms_evtLoopPopup = NULL;
// remove the handler
- PopEventHandler(TRUE /* delete it */);
+ PopEventHandler(true /* delete it */);
menu->SetInvokingWindow(NULL);
menu->SetInvokingWindow(NULL);
SetCursor(cursorOld);
#endif // __WXMSW__
SetCursor(cursorOld);
#endif // __WXMSW__
}
void wxWindow::DismissPopupMenu()
}
void wxWindow::DismissPopupMenu()
{
public:
wxNotebookSpinBtn(wxNotebook *nb)
{
public:
wxNotebookSpinBtn(wxNotebook *nb)
+ : wxSpinButton(nb, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL)
{
wxDefaultPosition, wxDefaultSize,
nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL)
{
};
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()
// ============================================================================
{
if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
{
if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
m_sizePad = GetRenderer()->GetTabPadding();
m_sizePad = GetRenderer()->GetTabPadding();
CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
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] )
{
}
int wxNotebook::GetPageImage(size_t nPage) const
}
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()") );
if ( nImage != m_images[nPage] )
_T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] )
}
wxNotebook::~wxNotebook()
}
wxNotebook::~wxNotebook()
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();
}
int imageId)
{
size_t nPages = GetPageCount();
int imageId)
{
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()") );
// modify the data
_T("invalid notebook page in InsertPage()") );
// modify the data
if ( nPages == 0 )
{
// always select the first tab to have at least some selection
if ( nPages == 0 )
{
// always select the first tab to have at least some selection
}
bool wxNotebook::DeleteAllPages()
{
if ( !wxNotebookBase::DeleteAllPages() )
}
bool wxNotebook::DeleteAllPages()
{
if ( !wxNotebookBase::DeleteAllPages() )
// clear the other arrays as well
m_titles.Clear();
// clear the other arrays as well
m_titles.Clear();
}
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
}
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
wxMemoryDC dc;
dc.SelectObject(bmp);
dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
wxMemoryDC dc;
dc.SelectObject(bmp);
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);
#else
bmp = *m_imageList->GetBitmap(image);
dc.SelectObject(wxNullBitmap);
#else
bmp = *m_imageList->GetBitmap(image);
wxSize sizeTab = CalcTabSize(page);
// we only need full relayout if the page size changes
wxSize sizeTab = CalcTabSize(page);
// we only need full relayout if the page size changes
- bool needsRelayout = FALSE;
+ bool needsRelayout = false;
if ( sizeTab.y > m_heightTab )
{
if ( sizeTab.y > m_heightTab )
{
m_heightTab = sizeTab.y;
}
m_heightTab = sizeTab.y;
}
{
// this case is special, get rid of it immediately: everything is
// visible and we don't need any spin buttons
{
// this case is special, get rid of it immediately: everything is
// visible and we don't need any spin buttons
// have to reset them manually as we don't call CalcLastVisibleTab()
m_firstVisible =
// have to reset them manually as we don't call CalcLastVisibleTab()
m_firstVisible =
const wxString& strArg)
{
if ( action == wxACTION_NOTEBOOK_NEXT )
const wxString& strArg)
{
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 )
SetSelection((int)numArg);
else
return wxControl::PerformAction(action, numArg, strArg);
else if ( action == wxACTION_NOTEBOOK_GOTO )
SetSelection((int)numArg);
else
return wxControl::PerformAction(action, numArg, strArg);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
+ if ( !action.IsEmpty() )
{
return consumer->PerformAction(action, page);
}
{
return consumer->PerformAction(action, page);
}
{
consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page);
{
consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page);
{
HandleFocusChange(consumer);
{
HandleFocusChange(consumer);
}
bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
}
bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
// we react to the focus change in the same way as to the [de]activation
HandleFocusChange(consumer);
// we react to the focus change in the same way as to the [de]activation
HandleFocusChange(consumer);
}
void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)
}
void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)
{
if ( m_radio->OnKeyDown((wxKeyEvent &)event) )
{
{
if ( m_radio->OnKeyDown((wxKeyEvent &)event) )
{
}
if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) )
}
if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) )
#if wxUSE_VALIDATORS
SetValidator(val);
#if wxUSE_VALIDATORS
SetValidator(val);
// radiobox should already have selection so select at least one item
SetSelection(0);
// radiobox should already have selection so select at least one item
SetSelection(0);
}
wxRadioBox::~wxRadioBox()
}
wxRadioBox::~wxRadioBox()
size_t count = m_buttons.GetCount();
for ( size_t n = 0; n < count; n++ )
{
size_t count = m_buttons.GetCount();
for ( size_t n = 0; n < count; n++ )
{
- m_buttons[n]->PopEventHandler(TRUE /* delete it */);
+ m_buttons[n]->PopEventHandler(true /* delete it */);
{
// make the first button in the box the start of new group by giving it
// wxRB_GROUP style
{
// make the first button in the box the start of new group by giving it
// wxRB_GROUP style
- wxRadioButton *btn = new wxRadioButton(parent, -1, choices[n],
+ wxRadioButton *btn = new wxRadioButton(parent, wxID_ANY, choices[n],
wxDefaultPosition,
wxDefaultSize,
n == 0 ? wxRB_GROUP : 0);
wxDefaultPosition,
wxDefaultSize,
n == 0 ? wxRB_GROUP : 0);
btn->SetFocus();
// this will also unselect the previously selected button in our group
btn->SetFocus();
// this will also unselect the previously selected button in our group
}
int wxRadioBox::GetSelection() const
}
int wxRadioBox::GetSelection() const
bool wxRadioBox::Enable(bool enable)
{
if ( !wxStaticBox::Enable(enable) )
bool wxRadioBox::Enable(bool enable)
{
if ( !wxStaticBox::Enable(enable) )
// also enable/disable the buttons
size_t count = m_buttons.GetCount();
// also enable/disable the buttons
size_t count = m_buttons.GetCount();
}
bool wxRadioBox::Show(bool show)
{
if ( !wxStaticBox::Show(show) )
}
bool wxRadioBox::Show(bool show)
{
if ( !wxStaticBox::Show(show) )
// also show/hide the buttons
size_t count = m_buttons.GetCount();
// also show/hide the buttons
size_t count = m_buttons.GetCount();
}
wxString wxRadioBox::GetLabel() const
}
wxString wxRadioBox::GetLabel() const
}
int selOld = GetSelection();
}
int selOld = GetSelection();
}
#endif // wxUSE_RADIOBOX
}
#endif // wxUSE_RADIOBOX
if ( !wxCheckBox::Create(parent, id, label, pos, size, style,
validator, name) )
{
if ( !wxCheckBox::Create(parent, id, label, pos, size, style,
validator, name) )
{
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
if ( arrow == m_captureData->m_arrowPressed )
{
// resume now
if ( arrow == m_captureData->m_arrowPressed )
{
// resume now
- m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, TRUE);
+ m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
}
}
else // if ( 1 ) FIXME: m_control->ShouldPauseScrolling() )
}
}
else // if ( 1 ) FIXME: m_control->ShouldPauseScrolling() )
{
// stop as the mouse left the arrow
m_control->SetArrowFlag(m_captureData->m_arrowPressed,
{
// stop as the mouse left the arrow
m_control->SetArrowFlag(m_captureData->m_arrowPressed,
- wxCONTROL_PRESSED, FALSE);
+ wxCONTROL_PRESSED, 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
UpdateCurrentFlag(Arrow_First, arrow);
UpdateCurrentFlag(Arrow_Second, arrow);
UpdateCurrentFlag(Arrow_First, 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;
}
if ( btn == -1 )
{
// we only care about button press/release events
if ( btn == -1 )
{
// we only care about button press/release events
}
if ( event.ButtonDown() || event.ButtonDClick() )
}
if ( event.ButtonDown() || event.ButtonDClick() )
if ( arrow == Arrow_None )
{
// mouse pressed over something else
if ( arrow == Arrow_None )
{
// mouse pressed over something else
}
if ( m_control->GetArrowState(arrow) & wxCONTROL_DISABLED )
{
// don't allow to press disabled arrows
}
if ( m_control->GetArrowState(arrow) & wxCONTROL_DISABLED )
{
// don't allow to press disabled arrows
}
wxConstCast(this, wxScrollArrows)->m_captureData =
}
wxConstCast(this, wxScrollArrows)->m_captureData =
{
m_captureData->m_timerScroll = tmpTimerScroll;
{
m_captureData->m_timerScroll = tmpTimerScroll;
- m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, TRUE);
+ m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true);
delete m_captureData;
wxConstCast(this, wxScrollArrows)->m_captureData = NULL;
delete m_captureData;
wxConstCast(this, wxScrollArrows)->m_captureData = NULL;
- m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, FALSE);
+ m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, false);
}
else
{
// we don't process this
}
else
{
// we don't process this
m_elementsState[n] = 0;
}
m_elementsState[n] = 0;
}
}
bool wxScrollBar::Create(wxWindow *parent,
}
bool wxScrollBar::Create(wxWindow *parent,
style &= ~wxBORDER_MASK;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
style &= ~wxBORDER_MASK;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
CreateInputHandler(wxINP_HANDLER_SCROLLBAR);
CreateInputHandler(wxINP_HANDLER_SCROLLBAR);
}
wxScrollBar::~wxScrollBar()
}
wxScrollBar::~wxScrollBar()
wxWindow *parent = GetParent();
if ( !parent )
{
wxWindow *parent = GetParent();
if ( !parent )
{
}
return (parent->GetScrollbar(wxHORIZONTAL) != this) &&
}
return (parent->GetScrollbar(wxHORIZONTAL) != this) &&
m_elementsState[Element_Thumb] |= wxCONTROL_DIRTY;
m_elementsState[m_thumbPos > m_thumbPosOld
? Element_Bar_1 : Element_Bar_2] |= wxCONTROL_DIRTY;
m_elementsState[Element_Thumb] |= wxCONTROL_DIRTY;
m_elementsState[m_thumbPos > m_thumbPosOld
? Element_Bar_1 : Element_Bar_2] |= wxCONTROL_DIRTY;
}
int wxScrollBar::GetThumbPosition() const
}
int wxScrollBar::GetThumbPosition() const
}
#ifdef WXDEBUG_SCROLLBAR
}
#ifdef WXDEBUG_SCROLLBAR
- static bool s_refreshDebug = FALSE;
+ static bool s_refreshDebug = false;
if ( s_refreshDebug )
{
wxClientDC dc(this);
if ( s_refreshDebug )
{
wxClientDC dc(this);
}
#endif // WXDEBUG_SCROLLBAR
}
#endif // WXDEBUG_SCROLLBAR
}
m_elementsState[n] &= ~wxCONTROL_DIRTY;
}
}
}
m_elementsState[n] &= ~wxCONTROL_DIRTY;
}
}
renderer->DrawScrollbar(this, m_thumbPosOld);
// clear all dirty flags
renderer->DrawScrollbar(this, m_thumbPosOld);
// clear all dirty flags
{
m_elementsState[which] = flags | wxCONTROL_DIRTY;
{
m_elementsState[which] = flags | wxCONTROL_DIRTY;
{
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?
else if ( action == wxACTION_SCROLL_THUMB_RELEASE )
{
// always notify about this
else if ( action == wxACTION_SCROLL_THUMB_RELEASE )
{
// always notify about this
scrollType = wxEVT_SCROLLWIN_THUMBRELEASE;
}
else
scrollType = wxEVT_SCROLLWIN_THUMBRELEASE;
}
else
GetParent()->GetEventHandler()->ProcessEvent(event);
}
GetParent()->GetEventHandler()->ProcessEvent(event);
}
}
void wxScrollBar::ScrollToStart()
}
void wxScrollBar::ScrollToStart()
bool wxScrollBar::ScrollLines(int nLines)
{
DoSetThumb(m_thumbPos + nLines);
bool wxScrollBar::ScrollLines(int nLines)
{
DoSetThumb(m_thumbPos + nLines);
}
bool wxScrollBar::ScrollPages(int nPages)
{
DoSetThumb(m_thumbPos + nPages*m_pageSize);
}
bool wxScrollBar::ScrollPages(int nPages)
{
DoSetThumb(m_thumbPos + nPages*m_pageSize);
}
// ============================================================================
}
// ============================================================================
int oldThumbPos = scrollbar->GetThumbPosition();
scrollbar->PerformAction(action);
if ( scrollbar->GetThumbPosition() != oldThumbPos )
int oldThumbPos = scrollbar->GetThumbPosition();
scrollbar->PerformAction(action);
if ( scrollbar->GetThumbPosition() != oldThumbPos )
// we scrolled till the end
m_timerScroll->Stop();
// we scrolled till the end
m_timerScroll->Stop();
}
void wxStdScrollBarInputHandler::StopScrolling(wxScrollBar *control)
}
void wxStdScrollBarInputHandler::StopScrolling(wxScrollBar *control)
}
// unpress the arrow and highlight the current element
}
// unpress the arrow and highlight the current element
case WXK_NEXT: action = wxACTION_SCROLL_PAGE_DOWN; break;
}
case WXK_NEXT: action = wxACTION_SCROLL_PAGE_DOWN; break;
}
+ if ( !action.IsEmpty() )
{
consumer->PerformAction(action);
{
consumer->PerformAction(action);
m_winCapture->CaptureMouse();
// generate the command
m_winCapture->CaptureMouse();
// generate the command
wxControlAction action;
switch ( ht )
{
wxControlAction action;
switch ( ht )
{
// fall through: there is no immediate action
default:
// fall through: there is no immediate action
default:
- Highlight(scrollbar, FALSE);
+ Highlight(scrollbar, false);
m_htLast = ht;
// and press the arrow or highlight thumb now instead
if ( m_htLast == wxHT_SCROLLBAR_THUMB )
m_htLast = ht;
// and press the arrow or highlight thumb now instead
if ( m_htLast == wxHT_SCROLLBAR_THUMB )
- Highlight(scrollbar, TRUE);
+ Highlight(scrollbar, true);
- Press(scrollbar, TRUE);
+ Press(scrollbar, true);
// start dragging
if ( hasAction )
// start dragging
if ( hasAction )
- Highlight(scrollbar, TRUE);
+ Highlight(scrollbar, true);
// between the mouse position and the top/left of the thumb
HandleThumbMove(scrollbar, event);
// between the mouse position and the top/left of the thumb
HandleThumbMove(scrollbar, event);
}
// no other changes are possible while the mouse is captured
}
// no other changes are possible while the mouse is captured
}
bool isArrow = scrollbar->GetArrows().HandleMouseMove(event);
}
bool isArrow = scrollbar->GetArrows().HandleMouseMove(event);
if ( ht == m_htLast )
{
// nothing changed
if ( ht == m_htLast )
{
// nothing changed
}
#ifdef DEBUG_MOUSE
wxLogDebug("Scrollbar::OnMouseMove: ht = %d", ht);
#endif // DEBUG_MOUSE
}
#ifdef DEBUG_MOUSE
wxLogDebug("Scrollbar::OnMouseMove: ht = %d", ht);
#endif // DEBUG_MOUSE
- Highlight(scrollbar, FALSE);
+ Highlight(scrollbar, false);
m_htLast = ht;
if ( !isArrow )
m_htLast = ht;
if ( !isArrow )
- Highlight(scrollbar, TRUE);
+ Highlight(scrollbar, true);
//else: already done by wxScrollArrows::HandleMouseMove
}
else if ( event.Leaving() )
{
if ( !isArrow )
//else: already done by wxScrollArrows::HandleMouseMove
}
else if ( event.Leaving() )
{
if ( !isArrow )
- Highlight(scrollbar, FALSE);
+ Highlight(scrollbar, false);
m_htLast = wxHT_NOWHERE;
}
else // event.Entering()
{
// we don't process this event
m_htLast = wxHT_NOWHERE;
}
else // event.Entering()
{
// we don't process this event
}
#endif // wxUSE_SCROLLBAR
}
#endif // wxUSE_SCROLLBAR
wxScrollTimer::wxScrollTimer()
{
wxScrollTimer::wxScrollTimer()
{
}
void wxScrollTimer::StartAutoScroll()
}
void wxScrollTimer::StartAutoScroll()
// there is an initial delay before the scrollbar starts scrolling -
// implement it by ignoring the first timer expiration and only start
// scrolling from the second one
// there is an initial delay before the scrollbar starts scrolling -
// implement it by ignoring the first timer expiration and only start
// scrolling from the second one
Start(200); // FIXME: hardcoded delay
}
Start(200); // FIXME: hardcoded delay
}
Stop();
Start(50); // FIXME: hardcoded delay
Stop();
Start(50); // FIXME: hardcoded delay
if ( btn == -1 )
{
// no...
if ( btn == -1 )
{
// no...
}
// when the mouse is pressed on any scrollbar element, we capture it
}
// when the mouse is pressed on any scrollbar element, we capture it
if ( HasCapture() )
{
// mouse already captured, nothing to do
if ( HasCapture() )
{
// mouse already captured, nothing to do
}
// determine which part of the window the user clicked in
}
// determine which part of the window the user clicked in
if ( shaftPart == Shaft_None )
{
// mouse pressed over something else
if ( shaftPart == Shaft_None )
{
// mouse pressed over something else
delete m_captureData;
wxConstCast(this, wxScrollThumb)->m_captureData = NULL;
delete m_captureData;
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
{
// we don't process this
}
else // another mouse button released
{
// we don't process this
}
bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const
}
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
if ( shaftPart != m_shaftPart )
{
// update the highlighted state
if ( shaftPart != m_shaftPart )
{
// 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
{
if ( !wxSliderBase::Create(parent, id, pos, size, style,
validator, name) )
{
if ( !wxSliderBase::Create(parent, id, pos, size, style,
validator, name) )
SetRange(minValue, maxValue);
SetValue(value);
SetRange(minValue, maxValue);
SetValue(value);
CreateInputHandler(wxINP_HANDLER_SLIDER);
CreateInputHandler(wxINP_HANDLER_SLIDER);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
bool wxSlider::ChangeValueTo(int value)
{
// check if the value is going to change at all
bool wxSlider::ChangeValueTo(int value)
{
// 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
// value!
// this method is protected and we should only call it with normalized
// value!
- wxCHECK_MSG( IsInRange(value), FALSE, _T("invalid slider value") );
+ wxCHECK_MSG( IsInRange(value), false, _T("invalid slider value") );
(void)GetEventHandler()->ProcessEvent(event);
(void)GetEventHandler()->ProcessEvent(event);
}
void wxSlider::SetValue(int value)
}
void wxSlider::SetValue(int value)
else if ( action == wxACTION_SLIDER_THUMB_DRAG )
{
// no special processing for it
else if ( action == wxACTION_SLIDER_THUMB_DRAG )
{
// no special processing for it
}
else if ( action == wxACTION_SLIDER_THUMB_MOVE ||
action == wxACTION_SLIDER_THUMB_RELEASE )
}
else if ( action == wxACTION_SLIDER_THUMB_MOVE ||
action == wxACTION_SLIDER_THUMB_RELEASE )
return wxControl::PerformAction(action, numArg, strArg);
}
return wxControl::PerformAction(action, numArg, strArg);
}
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
+ if ( !action.IsEmpty() )
{
consumer->PerformAction(action);
{
consumer->PerformAction(action);
if ( slider->GetThumb().HandleMouse(event) )
{
// processed by the thumb
if ( slider->GetThumb().HandleMouse(event) )
{
// processed by the thumb
}
return wxStdInputHandler::HandleMouse(consumer, event);
}
return wxStdInputHandler::HandleMouse(consumer, event);
if ( slider->GetThumb().HandleMouseMove(event) )
{
// processed by the thumb
if ( slider->GetThumb().HandleMouseMove(event) )
{
// processed by the thumb
}
return wxStdInputHandler::HandleMouseMove(consumer, event);
}
return wxStdInputHandler::HandleMouseMove(consumer, event);
const wxFocusEvent& WXUNUSED(event))
{
// slider's appearance changes when it gets/loses focus
const wxFocusEvent& WXUNUSED(event))
{
// slider's appearance changes when it gets/loses focus
if ( !wxSpinButtonBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
if ( !wxSpinButtonBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_SPINBTN);
SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_SPINBTN);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
// nothing changed - most likely because we are already at min/max
// value
{
// nothing changed - most likely because we are already at min/max
// value
}
wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN,
}
wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN,
if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
{
// programm has vetoed the event
if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
{
// programm has vetoed the event
event.SetEventType(wxEVT_SCROLL_THUMBTRACK);
(void)GetEventHandler()->ProcessEvent(event);
event.SetEventType(wxEVT_SCROLL_THUMBTRACK);
(void)GetEventHandler()->ProcessEvent(event);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
else
return wxControl::PerformAction(action, numArg, strArg);
else
return wxControl::PerformAction(action, numArg, strArg);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
+ if ( !action.IsEmpty() )
{
consumer->PerformAction(action);
{
consumer->PerformAction(action);
if ( spinbtn->GetArrows().HandleMouse(event) )
{
// don't refresh, everything is already done
if ( spinbtn->GetArrows().HandleMouse(event) )
{
// don't refresh, everything is already done
}
return wxStdInputHandler::HandleMouse(consumer, event);
}
return wxStdInputHandler::HandleMouse(consumer, event);
if ( spinbtn->GetArrows().HandleMouseMove(event) )
{
// processed by the arrows
if ( spinbtn->GetArrows().HandleMouseMove(event) )
{
// processed by the arrows
}
return wxStdInputHandler::HandleMouseMove(consumer, event);
}
return wxStdInputHandler::HandleMouseMove(consumer, event);
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
// set bitmap first
SetBitmap(label);
// set bitmap first
SetBitmap(label);
// and adjust our size to fit it after this
SetBestSize(size);
// and adjust our size to fit it after this
SetBestSize(size);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
}
void wxStaticBox::DoDraw(wxControlRenderer *renderer)
}
void wxStaticBox::DoDraw(wxControlRenderer *renderer)
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
wxSize sizeReal = AdjustSize(size);
if ( sizeReal != size )
SetSize(sizeReal);
wxSize sizeReal = AdjustSize(size);
if ( sizeReal != size )
SetSize(sizeReal);
}
void wxStaticLine::DoDraw(wxControlRenderer *renderer)
}
void wxStaticLine::DoDraw(wxControlRenderer *renderer)
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
const wxString &name)
{
if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) )
SetLabel(label);
SetBestSize(size);
SetLabel(label);
SetBestSize(size);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
wxDefaultPosition, wxDefaultSize,
style, name) )
{
wxDefaultPosition, wxDefaultSize,
style, name) )
{
SetSize(DoGetBestSize());
SetSize(DoGetBestSize());
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
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()") );
// this is a fix for a bug exhibited by the statbar sample: if
_T("invalid field index in GetFieldRect()") );
// this is a fix for a bug exhibited by the statbar sample: if
rect = DoGetFieldRect(n);
rect = DoGetFieldRect(n);
}
wxRect wxStatusBarUniv::DoGetFieldRect(int n) const
}
wxRect wxStatusBarUniv::DoGetFieldRect(int n) const
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()
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()
- 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
still a long) from 0 to GetLastPosition() inclusive. The positions
A text position is an unsigned int (which for reasons of compatibility is
still a long) from 0 to GetLastPosition() inclusive. The positions
m_scrollRangeY = 0;
m_updateScrollbarX =
m_scrollRangeY = 0;
m_updateScrollbarX =
- m_updateScrollbarY = FALSE;
+ m_updateScrollbarY = false;
m_widthMax = -1;
m_lineLongest = 0;
m_widthMax = -1;
m_lineLongest = 0;
// this code is unused any longer
#if 0
// this code is unused any longer
#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)
bool IsLastRow(wxTextCoord colRowStart) const
{
return colRowStart == GetRowStart(m_rowsStart.GetCount());
}
// it is in is not wrapped)
bool IsLastRow(wxTextCoord colRowStart) const
{
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
bool IsLastColInRow(wxTextCoord colRowStart,
wxTextCoord colRowEnd,
// colRowStart
bool IsLastColInRow(wxTextCoord colRowStart,
wxTextCoord colRowEnd,
// caller got it wrong
wxFAIL_MSG( _T("this column is not in the start of the row!") );
// caller got it wrong
wxFAIL_MSG( _T("this column is not in the start of the row!") );
class wxTextCtrlCommand : public wxCommand
{
public:
class wxTextCtrlCommand : public wxCommand
{
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
// wxTextCtrl to be applied
// we don't use these methods as they don't make sense for us as we need a
// wxTextCtrl to be applied
- 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 Do() { 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
virtual bool Do(wxTextCtrl *text) = 0;
// instead, our command processor uses these methods
virtual bool Do(wxTextCtrl *text) = 0;
public:
wxTextCtrlCommandProcessor(wxTextCtrl *text)
{
public:
wxTextCtrlCommandProcessor(wxTextCtrl *text)
{
- m_compressInserts = FALSE;
+ m_compressInserts = false;
virtual void Store(wxCommand *command);
// stop compressing insert commands when this is called
virtual void Store(wxCommand *command);
// stop compressing insert commands when this is called
- void StopCompressing() { m_compressInserts = FALSE; }
+ void StopCompressing() { m_compressInserts = false; }
// accessors
wxTextCtrl *GetTextCtrl() const { return m_text; }
// accessors
wxTextCtrl *GetTextCtrl() const { return m_text; }
// the control we're associated with
wxTextCtrl *m_text;
// the control we're associated with
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()
bool m_compressInserts;
};
// one so that the entire typing could be undone in one call to Undo()
bool m_compressInserts;
};
m_selStart =
m_selEnd = -1;
m_selStart =
m_selEnd = -1;
- m_isModified = FALSE;
- m_isEditable = TRUE;
+ m_isModified = false;
+ m_isEditable = true;
if ( !wxControl::Create(parent, id, pos, size, style,
validator, name) )
{
if ( !wxControl::Create(parent, id, pos, size, style,
validator, name) )
{
}
SetCursor(wxCURSOR_IBEAM);
}
SetCursor(wxCURSOR_IBEAM);
// 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()
// 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()
CreateInputHandler(wxINP_HANDLER_TEXTCTRL);
wxSizeEvent sizeEvent(GetSize(), GetId());
GetEventHandler()->ProcessEvent(sizeEvent);
CreateInputHandler(wxINP_HANDLER_TEXTCTRL);
wxSizeEvent sizeEvent(GetSize(), GetId());
GetEventHandler()->ProcessEvent(sizeEvent);
}
wxTextCtrl::~wxTextCtrl()
}
wxTextCtrl::~wxTextCtrl()
}
// the number of rows changed
}
// the number of rows changed
}
// the number of rows didn't change
}
// the number of rows didn't change
}
void wxTextCtrl::RemoveLine(wxTextCoord line)
}
void wxTextCtrl::RemoveLine(wxTextCoord line)
// 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
// row relayout
// 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
// row relayout
- bool rowsNumberChanged = FALSE;
+ bool rowsNumberChanged = false;
// (1) join lines
const wxArrayString& linesOld = GetLines();
// (1) join lines
const wxArrayString& linesOld = GetLines();
// we have the replacement line for this one
if ( ReplaceLine(line, lines[nReplaceLine]) )
{
// we have the replacement line for this one
if ( ReplaceLine(line, lines[nReplaceLine]) )
{
- rowsNumberChanged = TRUE;
+ rowsNumberChanged = true;
{
// (4b) delete all extra lines (note that we need to delete
// them backwards because indices shift while we do it)
{
// (4b) delete all extra lines (note that we need to delete
// them backwards because indices shift while we do it)
- bool deletedLongestLine = FALSE;
+ bool deletedLongestLine = false;
for ( wxTextCoord lineDel = lineEnd; lineDel >= line; lineDel-- )
{
if ( lineDel == MData().m_lineLongest )
{
// we will need to recalc the max line width
for ( wxTextCoord lineDel = lineEnd; lineDel >= line; lineDel-- )
{
if ( lineDel == MData().m_lineLongest )
{
// we will need to recalc the max line width
- deletedLongestLine = TRUE;
+ deletedLongestLine = true;
}
// even the line number changed
}
// even the line number changed
- rowsNumberChanged = TRUE;
+ rowsNumberChanged = true;
// update line to exit the loop
line = lineEnd + 1;
// update line to exit the loop
line = lineEnd + 1;
if ( nReplaceLine < nReplaceCount )
{
// even the line number changed
if ( nReplaceLine < nReplaceCount )
{
// even the line number changed
- rowsNumberChanged = TRUE;
+ rowsNumberChanged = true;
RefreshLineRange(lineEnd + 1, 0);
// the vert scrollbar might [dis]appear
RefreshLineRange(lineEnd + 1, 0);
// 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
if ( !HasSelection() )
{
// no selection at all, hence no selection in this line
if ( !HasSelection() )
{
// no selection at all, hence no selection in this line
}
wxTextCoord lineStart, colStart;
}
wxTextCoord lineStart, colStart;
if ( lineStart > line )
{
// this line is entirely above the selection
if ( lineStart > line )
{
// this line is entirely above the selection
}
wxTextCoord lineEnd, colEnd;
}
wxTextCoord lineEnd, colEnd;
if ( lineEnd < line )
{
// this line is entirely below the selection
if ( lineEnd < line )
{
// this line is entirely below the selection
}
if ( line == lineStart )
}
if ( line == lineStart )
*end = GetLineLength(line);
}
*end = GetLineLength(line);
}
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
void wxTextCtrl::MarkDirty()
{
void wxTextCtrl::MarkDirty()
{
}
void wxTextCtrl::DiscardEdits()
{
}
void wxTextCtrl::DiscardEdits()
{
}
void wxTextCtrl::SetEditable(bool editable)
}
void wxTextCtrl::SetEditable(bool editable)
// if they are out of range
if ( IsSingleLine() )
{
// if they are out of range
if ( IsSingleLine() )
{
- return x > GetLastPosition() || y > 0 ? -1 : x;
+ return x > GetLastPosition() || y > 0 ? wxDefaultCoord : x;
if ( IsSingleLine() )
{
if ( (size_t)pos > m_value.length() )
if ( IsSingleLine() )
{
if ( (size_t)pos > m_value.length() )
if ( x )
*x = pos;
if ( y )
*y = 0;
if ( x )
*x = pos;
if ( y )
*y = 0;
_T("XYToPosition() or PositionToXY() broken") );
#endif // WXDEBUG_TEXT
_T("XYToPosition() or PositionToXY() broken") );
#endif // WXDEBUG_TEXT
}
else // go further down
{
}
else // go further down
{
}
// beyond the last line
}
// beyond the last line
else // must really calculate col/line from pos
{
if ( !PositionToXY(pos, &col, &line) )
else // must really calculate col/line from pos
{
if ( !PositionToXY(pos, &col, &line) )
}
int hLine = GetLineHeight();
}
int hLine = GetLineHeight();
}
bool wxTextCtrl::PositionToDeviceXY(wxTextPos pos,
}
bool wxTextCtrl::PositionToDeviceXY(wxTextPos pos,
{
wxCoord x, y;
if ( !PositionToLogicalXY(pos, &x, &y) )
{
wxCoord x, y;
if ( !PositionToLogicalXY(pos, &x, &y) )
// finally translate the logical text rect coords into physical client
// coords
CalcScrolledPosition(m_rectText.x + x, m_rectText.y + y, xOut, yOut);
// finally translate the logical text rect coords into physical client
// coords
CalcScrolledPosition(m_rectText.x + x, m_rectText.y + y, xOut, yOut);
}
wxPoint wxTextCtrl::GetCaretPosition() const
}
wxPoint wxTextCtrl::GetCaretPosition() const
bool wxTextCtrl::DoCut()
{
if ( !HasSelection() )
bool wxTextCtrl::DoCut()
{
if ( !HasSelection() )
Copy();
RemoveSelection();
Copy();
RemoveSelection();
}
void wxTextCtrl::Paste()
}
void wxTextCtrl::Paste()
}
}
#endif // wxUSE_CLIPBOARD
}
}
#endif // wxUSE_CLIPBOARD
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
}
// 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
}
// and now do insert it
text->WriteText(m_text);
// and now do insert it
text->WriteText(m_text);
}
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
text->Remove(m_from, m_from + m_text.length());
// remove the text from where we inserted it
text->Remove(m_from, m_from + m_text.length());
}
bool wxTextCtrlRemoveCommand::CanUndo() const
}
bool wxTextCtrlRemoveCommand::CanUndo() const
m_textDeleted = text->GetSelectionText();
text->RemoveSelection();
m_textDeleted = text->GetSelectionText();
text->RemoveSelection();
}
bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text)
}
bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text)
text->SetInsertionPoint(m_from > posLast ? posLast : m_from);
text->WriteText(m_textDeleted);
text->SetInsertionPoint(m_from > posLast ? posLast : m_from);
text->WriteText(m_textDeleted);
}
void wxTextCtrl::Undo()
}
void wxTextCtrl::Undo()
#endif // 0
MData().m_updateScrollbarX =
#endif // 0
MData().m_updateScrollbarX =
- MData().m_updateScrollbarY = TRUE;
+ MData().m_updateScrollbarY = true;
wxString s(text);
wxTextCoord col;
wxString s(text);
wxTextCoord col;
+ wxCoord wReal = wxDefaultCoord;
switch ( HitTestLine(s, m_rectText.width, &col) )
{
/*
switch ( HitTestLine(s, m_rectText.width, &col) )
{
/*
col--;
// recalc the width
col--;
// recalc the width
+ wReal = wxDefaultCoord;
}
//else: we can just see it
}
//else: we can just see it
if ( colWordStart != col )
{
// will have to recalc the real width
if ( colWordStart != col )
{
// will have to recalc the real width
+ wReal = wxDefaultCoord;
+ if ( wReal == wxDefaultCoord )
{
// calc it if not done yet
wReal = GetTextWidth(s.Truncate(col));
{
// calc it if not done yet
wReal = GetTextWidth(s.Truncate(col));
wxTextCoord *colOut,
wxTextCoord *rowOut) const
{
wxTextCoord *colOut,
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,
rowInLine = 0;
if ( row < 0 )
rowInLine = 0;
if ( row < 0 )
int nLines = GetNumberOfLines();
if ( WrapLines() )
int nLines = GetNumberOfLines();
if ( WrapLines() )
if ( line == nLines )
{
// the row is out of range
if ( line == nLines )
{
// the row is out of range
}
}
else // no line wrapping, everything is easy
{
if ( row >= nLines )
}
}
else // no line wrapping, everything is easy
{
if ( row >= nLines )
if ( rowInLineOut )
*rowInLineOut = rowInLine;
if ( rowInLineOut )
*rowInLineOut = rowInLine;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
if ( dx > 0 )
{
// refresh the uncovered part on the left
if ( dx > 0 )
{
// refresh the uncovered part on the left
// and now the area on the right
rect.x = m_rectText.x + posLastVisible;
// and now the area on the right
rect.x = m_rectText.x + posLastVisible;
rect.width += m_rectText.width - posLastVisible;
}
rect.width += m_rectText.width - posLastVisible;
}
// 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
// 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
// just to suppress compiler warnings about using uninit vars below
charWidth = maxWidth = 0;
// just to suppress compiler warnings about using uninit vars below
charWidth = maxWidth = 0;
- showScrollbarX = FALSE;
+ showScrollbarX = false;
}
// calc the scrollbars ranges
}
// calc the scrollbars ranges
SetScrollbars(charWidth, lineHeight,
scrollRangeX, scrollRangeY,
x, y,
SetScrollbars(charWidth, lineHeight,
scrollRangeX, scrollRangeY,
x, y,
- TRUE /* no refresh */);
+ true /* no refresh */);
}
MData().m_updateScrollbarX =
}
MData().m_updateScrollbarX =
- MData().m_updateScrollbarY = FALSE;
+ MData().m_updateScrollbarY = false;
}
void wxTextCtrl::OnInternalIdle()
}
void wxTextCtrl::OnInternalIdle()
rect.Offset(m_rectText.GetPosition());
// don't refresh beyond the text area unless we're refreshing the line wrap
rect.Offset(m_rectText.GetPosition());
// 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 ( rect.GetRight() > m_rectText.GetRight() )
if ( textOnly )
{
if ( rect.GetRight() > m_rectText.GetRight() )
wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
}
void wxTextCtrl::RefreshLineWrapMarks(wxTextCoord rowFirst,
}
void wxTextCtrl::RefreshLineWrapMarks(wxTextCoord rowFirst,
rectMarks.y = rowFirst*GetLineHeight();
rectMarks.height = (rowLast - rowFirst)*GetLineHeight();
rectMarks.y = 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 */);
bool wxTextCtrl::SetFont(const wxFont& font)
{
if ( !wxControl::SetFont(font) )
bool wxTextCtrl::SetFont(const wxFont& font)
{
if ( !wxControl::SetFont(font) )
// and refresh everything, of course
InitInsertionPoint();
// and refresh everything, of course
InitInsertionPoint();
}
bool wxTextCtrl::Enable(bool enable)
{
if ( !wxTextCtrlBase::Enable(enable) )
}
bool wxTextCtrl::Enable(bool enable)
{
if ( !wxTextCtrlBase::Enable(enable) )
if (FindFocus() == this && GetCaret() &&
((enable && !GetCaret()->IsVisible()) ||
(!enable && GetCaret()->IsVisible())))
ShowCaret(enable);
if (FindFocus() == this && GetCaret() &&
((enable && !GetCaret()->IsVisible()) ||
(!enable && GetCaret()->IsVisible())))
ShowCaret(enable);
}
void wxTextCtrl::CreateCaret()
}
void wxTextCtrl::CreateCaret()
const wxString& strArg)
{
// has the text changed as result of this action?
const wxString& strArg)
{
// 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
// 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
// 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
// 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
// change text at all or can't be undone
wxTextCtrlCommand *command = (wxTextCtrlCommand *)NULL;
wxString action;
// the command this action corresponds to or NULL if this action doesn't
// change text at all or can't be undone
wxTextCtrlCommand *command = (wxTextCtrlCommand *)NULL;
wxString action;
- bool del = FALSE,
- sel = FALSE;
+ bool del = false,
+ sel = false;
if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_DEL, &action) )
{
if ( IsEditable() )
if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_DEL, &action) )
{
if ( IsEditable() )
}
else if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_SEL, &action) )
{
}
else if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_SEL, &action) )
{
}
else // not selection nor delete action
{
}
else // not selection nor delete action
{
if ( newPos != INVALID_POS_VALUE )
{
// remember where the cursor original had been
if ( newPos != INVALID_POS_VALUE )
{
// remember where the cursor original had been
- rememberAbscissa = TRUE;
+ rememberAbscissa = true;
if ( newPos != INVALID_POS_VALUE )
{
// remember where the cursor original had been
if ( newPos != INVALID_POS_VALUE )
{
// remember where the cursor original had been
- rememberAbscissa = TRUE;
+ rememberAbscissa = true;
// inserting text can be undone
command = new wxTextCtrlInsertCommand(strArg);
// inserting text can be undone
command = new wxTextCtrlInsertCommand(strArg);
}
}
else if ( (action == wxACTION_TEXT_PAGE_UP) ||
}
}
else if ( (action == wxACTION_TEXT_PAGE_UP) ||
}
// 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;
for ( size_t line = 0; line < count; line++ )
bool goUp = action == wxACTION_TEXT_PAGE_UP;
for ( size_t line = 0; line < count; line++ )
}
// scroll vertically only
}
// scroll vertically only
+ Scroll(wxDefaultCoord, y);
}
}
else if ( action == wxACTION_TEXT_SEL_WORD )
}
}
else if ( action == wxACTION_TEXT_SEL_WORD )
m_cmdProcessor->Submit(command);
// undoable commands always change text
m_cmdProcessor->Submit(command);
// undoable commands always change text
}
else // no undoable command
{
}
else // no undoable command
{
GetEventHandler()->ProcessEvent(event);
// as the text changed...
GetEventHandler()->ProcessEvent(event);
// as the text changed...
}
void wxTextCtrl::OnChar(wxKeyEvent& event)
}
void wxTextCtrl::OnChar(wxKeyEvent& event)
{
// we're only interested in key presses
if ( !pressed )
{
// we're only interested in key presses
if ( !pressed )
int keycode = event.GetKeyCode();
int keycode = event.GetKeyCode();
{
consumer->PerformAction(action, -1, str);
{
consumer->PerformAction(action, -1, str);
}
return wxStdInputHandler::HandleKey(consumer, event, pressed);
}
return wxStdInputHandler::HandleKey(consumer, event, pressed);
}
// never refresh entirely
}
// never refresh entirely
}
#endif // wxUSE_TEXTCTRL
}
#endif // wxUSE_TEXTCTRL
if ( ms_theme )
{
// we already have a theme
if ( ms_theme )
{
// we already have a theme
{
wxLogError(_("Failed to initialize GUI: no built-in themes found."));
{
wxLogError(_("Failed to initialize GUI: no built-in themes found."));
}
// Set the theme as current.
wxTheme::Set(theme);
}
// Set the theme as current.
wxTheme::Set(theme);
}
/* static */ wxTheme *wxTheme::Set(wxTheme *theme)
}
/* static */ wxTheme *wxTheme::Set(wxTheme *theme)
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 wxGTKRenderer::AreScrollbarsInsideBorder() const
{
// no, the scrollbars are outside the border in GTK+
bool wxGTKRenderer::AreScrollbarsInsideBorder() const
{
// no, the scrollbars are outside the border in GTK+
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
DrawUpZag(dc, x, xRight, yMid, y);
DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1);
DrawUpZag(dc, x, xRight, yMid, y);
DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1);
if ( flags & wxCONTROL_CHECKED )
dc.SetPen(m_penBlack);
else if ( flags & wxCONTROL_PRESSED )
dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
else // unchecked and unpressed
if ( flags & wxCONTROL_CHECKED )
dc.SetPen(m_penBlack);
else if ( flags & wxCONTROL_PRESSED )
dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
else // unchecked and unpressed
if ( drawIt )
DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2);
if ( drawIt )
DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2);
DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1);
if ( !(flags & wxCONTROL_CHECKED) )
DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1);
if ( !(flags & wxCONTROL_CHECKED) )
- drawIt = TRUE; // with the same pen
+ drawIt = true; // with the same pen
else if ( flags & wxCONTROL_PRESSED )
{
dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
else if ( flags & wxCONTROL_PRESSED )
{
dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), 0, wxSOLID));
}
else // checked and unpressed
}
else // checked and unpressed
if ( drawIt )
DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2);
if ( drawIt )
DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2);
// normal unchecked
dc.SelectObject(m_bitmapsCheckbox[0][1]);
// normal unchecked
dc.SelectObject(m_bitmapsCheckbox[0][1]);
- DrawUncheckBitmap(dc, rect, FALSE);
+ DrawUncheckBitmap(dc, rect, false);
// pressed checked
m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0];
// pressed unchecked
dc.SelectObject(m_bitmapsCheckbox[1][1]);
// pressed checked
m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0];
// pressed unchecked
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;
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,
wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, indexAccel);
DrawLabel(dc, label, rectLabel, flags,
wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, indexAccel);
wxSize wxGTKRenderer::GetFrameIconSize() const
{
wxSize wxGTKRenderer::GetFrameIconSize() const
{
+ return wxSize(wxDefaultCoord, wxDefaultCoord);
const wxKeyEvent& WXUNUSED(event),
bool WXUNUSED(pressed))
{
const wxKeyEvent& WXUNUSED(event),
bool WXUNUSED(pressed))
{
}
bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control,
}
bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control,
{
control->GetInputWindow()->SetFocus();
{
control->GetInputWindow()->SetFocus();
}
bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control,
}
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);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
control->PerformAction(wxACTION_CHECKBOX_TOGGLE);
{
control->PerformAction(wxACTION_CHECKBOX_TOGGLE);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
control->PerformAction(action);
{
control->PerformAction(action);
void DrawShadedRect(wxDC& dc, wxRect *rect,
const wxPen& pen1, const wxPen& pen2);
void DrawShadedRect(wxDC& dc, wxRect *rect,
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,
wxArrowDirection arrowDir, wxArrowStyle arrowStyle);
void DrawArrow(wxDC& dc, const wxRect& rect,
wxArrowDirection arrowDir, wxArrowStyle arrowStyle);
- dc.DrawBitmap(bmp, x, y, TRUE /* use mask */);
+ dc.DrawBitmap(bmp, x, y, true /* use mask */);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
void DrawSunkenBorder(wxDC& dc, wxRect *rect);
// draw the border used for scrollbar arrows
void DrawSunkenBorder(wxDC& dc, wxRect *rect);
// 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
void DrawArrow(wxDC& dc, const wxRect& rect,
// public DrawArrow()s helper
void DrawArrow(wxDC& dc, const wxRect& rect,
void DrawLine(wxDC& dc,
wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
void DrawLine(wxDC& dc,
wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
- bool transpose = FALSE)
+ bool transpose = false)
{
if ( transpose )
dc.DrawLine(y1, x1, y2, x2);
{
if ( transpose )
dc.DrawLine(y1, x1, y2, x2);
bool wxWin32Renderer::AreScrollbarsInsideBorder() const
{
bool wxWin32Renderer::AreScrollbarsInsideBorder() const
{
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
}
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,
wxRect rectLabel = rect;
int bmpWidth = bmp.GetWidth();
wxRect rectLabel = rect;
int bmpWidth = bmp.GetWidth();
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(
dc, label, rectLabel,
DoDrawLabel(
dc, label, rectLabel,
- 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,
DrawShadedRect(dc, &r, m_penBlack, m_penHighlight);
DrawShadedRect(dc, &r, m_penDarkGrey, m_penLightGrey);
DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r);
DrawShadedRect(dc, &r, m_penBlack, m_penHighlight);
DrawShadedRect(dc, &r, m_penDarkGrey, m_penLightGrey);
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
{
DrawShadedRect(dc, &r, m_penHighlight, m_penBlack);
DrawShadedRect(dc, &r, m_penLightGrey, m_penDarkGrey);
DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), r);
}
else
{
DrawShadedRect(dc, &r, m_penHighlight, m_penBlack);
DrawShadedRect(dc, &r, m_penLightGrey, m_penDarkGrey);
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);
// less than the standard one, but not when display not PDAs.
if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA)
{
// less than the standard one, but not when display not PDAs.
if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA)
{
- if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
+ if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
- wxSize szDef = wxButton::GetDefaultSize();
+ wxSize szDef = wxButton::GetDefaultSize();
if ( size->x < szDef.x )
size->x = szDef.x;
}
if ( size->x < szDef.x )
size->x = szDef.x;
}
const wxKeyEvent& WXUNUSED(event),
bool WXUNUSED(pressed))
{
const wxKeyEvent& WXUNUSED(event),
bool WXUNUSED(pressed))
{
}
bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
}
bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
wxInputHandler *handler)
: wxStdScrollBarInputHandler(renderer, handler)
{
wxInputHandler *handler)
: wxStdScrollBarInputHandler(renderer, handler)
{
- m_scrollPaused = FALSE;
+ m_scrollPaused = false;
{
// stop if went beyond the position of the original click (this can only
// happen when we scroll by pages)
{
// stop if went beyond the position of the original click (this can only
// happen when we scroll by pages)
if ( action == wxACTION_SCROLL_PAGE_DOWN )
{
stop = m_renderer->HitTestScrollbar(scrollbar, m_ptStartScrolling)
if ( action == wxACTION_SCROLL_PAGE_DOWN )
{
stop = m_renderer->HitTestScrollbar(scrollbar, m_ptStartScrolling)
}
return wxStdScrollBarInputHandler::OnScrollTimer(scrollbar, action);
}
return wxStdScrollBarInputHandler::OnScrollTimer(scrollbar, action);
// mouse move events normally - only do it while mouse is captured (i.e.
// when we're dragging the thumb or pressing on something)
if ( !m_winCapture )
// mouse move events normally - only do it while mouse is captured (i.e.
// when we're dragging the thumb or pressing on something)
if ( !m_winCapture )
if ( event.Entering() )
{
// we're not interested in this at all
if ( event.Entering() )
{
// we're not interested in this at all
}
wxScrollBar *scrollbar = wxStaticCast(control->GetInputWindow(), wxScrollBar);
}
wxScrollBar *scrollbar = wxStaticCast(control->GetInputWindow(), wxScrollBar);
if ( event.Leaving() )
{
// it surely didn't
if ( event.Leaving() )
{
// it surely didn't
}
ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition());
if ( ht == m_htLast )
{
// yes it did, resume scrolling
}
ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition());
if ( ht == m_htLast )
{
// yes it did, resume scrolling
- m_scrollPaused = FALSE;
+ m_scrollPaused = false;
if ( m_timerScroll )
{
// we were scrolling by line/page, restart timer
m_timerScroll->Start(m_interval);
if ( m_timerScroll )
{
// we were scrolling by line/page, restart timer
m_timerScroll->Start(m_interval);
- Press(scrollbar, TRUE);
+ Press(scrollbar, true);
}
else // we were dragging the thumb
{
}
else // we were dragging the thumb
{
HandleThumbMove(scrollbar, m_eventLastDrag);
}
HandleThumbMove(scrollbar, m_eventLastDrag);
}
}
}
else // normal case, scrolling hasn't been paused
}
}
else // normal case, scrolling hasn't been paused
// pause scrolling
m_interval = m_timerScroll->GetInterval();
m_timerScroll->Stop();
// pause scrolling
m_interval = m_timerScroll->GetInterval();
m_timerScroll->Stop();
- Press(scrollbar, FALSE);
+ Press(scrollbar, false);
}
else // we were dragging the thumb
{
}
else // we were dragging the thumb
{
HandleThumbMove(scrollbar, m_eventStartDrag);
}
HandleThumbMove(scrollbar, m_eventStartDrag);
}
+ if ( !action.IsEmpty() )
{
control->PerformAction(action);
{
control->PerformAction(action);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
control->PerformAction(action);
{
control->PerformAction(action);
wxWin32StatusBarInputHandler(wxInputHandler *handler)
: wxStdInputHandler(handler)
{
wxWin32StatusBarInputHandler(wxInputHandler *handler)
: wxStdInputHandler(handler)
{
}
bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar,
}
bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar,
wxTopLevelWindow *
parentTLW = wxDynamicCast(statbar->GetParent(), wxTopLevelWindow);
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") );
// a maximized window can't be resized anyhow
_T("the status bar should be a child of a TLW") );
// a maximized window can't be resized anyhow
}
bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer,
}
bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer,
statbar->SetCursor(m_cursorOld);
statbar->SetCursor(m_cursorOld);
tlw->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
tlw->IsMaximized() ? wxTOPLEVEL_BUTTON_RESTORE
: wxTOPLEVEL_BUTTON_MAXIMIZE);
tlw->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK,
tlw->IsMaximized() ? wxTOPLEVEL_BUTTON_RESTORE
: wxTOPLEVEL_BUTTON_MAXIMIZE);
}
else if ( tlw->GetWindowStyle() & wxSYSTEM_MENU )
{
}
else if ( tlw->GetWindowStyle() & wxSYSTEM_MENU )
{
hit == wxHT_TOPLEVEL_ICON)) )
{
PopupSystemMenu(tlw, event.GetPosition());
hit == wxHT_TOPLEVEL_ICON)) )
{
PopupSystemMenu(tlw, event.GetPosition());
{
if ( window->IsMaximized() )
{
{
if ( window->IsMaximized() )
{
- menu->Enable(wxID_MAXIMIZE_FRAME, FALSE);
- menu->Enable(wxID_MOVE_FRAME, FALSE);
+ menu->Enable(wxID_MAXIMIZE_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);
- menu->Enable(wxID_RESTORE_FRAME, FALSE);
+ menu->Enable(wxID_RESTORE_FRAME, false);
}
window->PopupMenu(menu, pos);
}
window->PopupMenu(menu, pos);
// ----------------------------------------------------------------------------
// 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
{
// no position yet
m_x =
{
// no position yet
m_x =
m_width =
m_height = 0;
// not pressed yet
m_width =
m_height = 0;
// not pressed yet
}
wxToolBarTool(wxToolBar *tbar, wxControl *control)
}
wxToolBarTool(wxToolBar *tbar, wxControl *control)
{
// no position yet
m_x =
{
// no position yet
m_x =
m_width =
m_height = 0;
// not pressed yet
m_width =
m_height = 0;
// not pressed yet
}
// is this tool pressed, even temporarily? (this is different from being
}
// is this tool pressed, even temporarily? (this is different from being
void Invert() { m_isInverted = !m_isInverted; }
// Set underMouse
void Invert() { m_isInverted = !m_isInverted; }
// Set underMouse
- void SetUnderMouse( bool under = TRUE ) { m_underMouse = under; }
+ void SetUnderMouse( bool under = true ) { m_underMouse = under; }
bool IsUnderMouse() { return m_underMouse; }
public:
bool IsUnderMouse() { return m_underMouse; }
public:
wxCoord m_height;
private:
wxCoord m_height;
private:
- // TRUE if the tool is pressed
+ // true if the tool is pressed
- // TRUE if the tool is under the mouse
+ // true if the tool is under the mouse
void wxToolBar::Init()
{
// no tools yet
void wxToolBar::Init()
{
// no tools yet
// unknown widths for the tools and separators
m_widthSeparator = INVALID_WIDTH;
// unknown widths for the tools and separators
m_widthSeparator = INVALID_WIDTH;
if ( !wxToolBarBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
{
if ( !wxToolBarBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
{
}
CreateInputHandler(wxINP_HANDLER_TOOLBAR);
SetBestSize(size);
}
CreateInputHandler(wxINP_HANDLER_TOOLBAR);
SetBestSize(size);
}
wxToolBar::~wxToolBar()
}
wxToolBar::~wxToolBar()
wxToolBarToolBase * WXUNUSED(tool))
{
// recalculate the toolbar geometry before redrawing it the next time
wxToolBarToolBase * WXUNUSED(tool))
{
// recalculate the toolbar geometry before redrawing it the next time
// and ensure that we indeed are going to redraw
Refresh();
// and ensure that we indeed are going to redraw
Refresh();
}
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos),
wxToolBarToolBase * WXUNUSED(tool))
{
// as above
}
bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos),
wxToolBarToolBase * WXUNUSED(tool))
{
// as above
}
void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable)
}
void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable)
{
rect.width = m_defaultWidth;
rect.height = m_defaultHeight;
{
rect.width = m_defaultWidth;
rect.height = m_defaultHeight;
bool wxToolBar::Realize()
{
if ( !wxToolBarBase::Realize() )
bool wxToolBar::Realize()
{
if ( !wxToolBarBase::Realize() )
DoLayout();
SetBestSize(wxDefaultSize);
DoLayout();
SetBestSize(wxDefaultSize);
}
void wxToolBar::DoLayout()
{
wxASSERT_MSG( m_needsLayout, _T("why are we called?") );
}
void wxToolBar::DoLayout()
{
wxASSERT_MSG( m_needsLayout, _T("why are we called?") );
wxCoord x = m_xMargin,
y = m_yMargin;
wxCoord x = m_xMargin,
y = m_yMargin;
wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags);
// Correct width and height if needed.
wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags);
// Correct width and height if needed.
- if ( width == -1 || height == -1 )
+ if ( width == wxDefaultCoord || height == wxDefaultCoord )
{
int tmp_width, tmp_height;
GetSize(&tmp_width, &tmp_height);
{
int tmp_width, tmp_height;
GetSize(&tmp_width, &tmp_height);
+ if ( width == wxDefaultCoord )
+ if ( height == wxDefaultCoord )
}
else // simple non-checkable tool
{
}
else // simple non-checkable tool
{
}
OnLeftClick( tool->GetId(), isToggled );
}
else if ( action == wxACTION_TOOLBAR_ENTER )
{
}
OnLeftClick( tool->GetId(), isToggled );
}
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() )
RefreshTool( tool );
if ( !tool->IsToggled() )
RefreshTool( tool );
}
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() )
RefreshTool( tool );
if ( !tool->IsToggled() )
RefreshTool( tool );
else
return wxControl::PerformAction(action, numArg, strArg);
else
return wxControl::PerformAction(action, numArg, strArg);
}
// ============================================================================
}
// ============================================================================
if ( event.LeftDown() || event.LeftDClick() )
{
if ( !tool || !tool->IsEnabled() )
if ( event.LeftDown() || event.LeftDClick() )
{
if ( !tool || !tool->IsEnabled() )
m_winCapture = tbar;
m_winCapture->CaptureMouse();
m_winCapture = tbar;
m_winCapture->CaptureMouse();
consumer->PerformAction( wxACTION_BUTTON_PRESS, tool->GetId() );
consumer->PerformAction( wxACTION_BUTTON_PRESS, tool->GetId() );
}
else if ( event.LeftUp() )
{
}
else if ( event.LeftUp() )
{
}
//else: don't do anything special about the double click
}
}
//else: don't do anything special about the double click
}
tool = NULL;
if (tool == m_toolLast)
tool = NULL;
if (tool == m_toolLast)
if (tool)
consumer->PerformAction( wxACTION_BUTTON_PRESS, m_toolCapture->GetId() );
if (tool)
consumer->PerformAction( wxACTION_BUTTON_PRESS, m_toolCapture->GetId() );
else
{
if (tool == m_toolLast)
else
{
if (tool == m_toolLast)
}
bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer,
}
bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer,
consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
}
consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
}
}
bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer,
}
bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer,
consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
}
consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );
}
}
#endif // wxUSE_TOOLBAR
}
#endif // wxUSE_TOOLBAR
void wxTopLevelWindow::Init()
{
void wxTopLevelWindow::Init()
{
m_windowStyle = 0;
m_pressedButton = 0;
}
m_windowStyle = 0;
m_pressedButton = 0;
}
if ( !wxTopLevelWindowNative::Create(parent, id, title, pos,
size, style, name) )
if ( !wxTopLevelWindowNative::Create(parent, id, title, pos,
size, style, name) )
if ( ms_drawDecorations )
{
if ( ms_drawDecorations )
{
m_exStyle = exstyleOrig;
}
m_exStyle = exstyleOrig;
}
}
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 )
{
wxSize size = m_renderer->GetFrameIconSize();
const wxIcon& icon = icons.GetIcon( size );
wxSize size = m_renderer->GetFrameIconSize();
const wxIcon& icon = icons.GetIcon( size );
- if ( !icon.Ok() || size.x == -1 )
+ if ( !icon.Ok() || size.x == wxDefaultCoord )
m_titlebarIcon = icon;
else
{
m_titlebarIcon = icon;
else
{
cursor = wxCursor(wxCURSOR_SIZENWSE);
break;
default:
cursor = wxCursor(wxCURSOR_SIZENWSE);
break;
default:
#if 0
// not rachable due to earlier return
break;
#endif
}
#if 0
// not rachable due to earlier return
break;
#endif
}
}
#define wxINTERACTIVE_RESIZE_DIR \
}
#define wxINTERACTIVE_RESIZE_DIR \
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 )
data.m_rect.x -= data.m_minSize.x - data.m_rect.width;
data.m_rect.width = data.m_minSize.x;
}
{
if ( data.m_flags & wxINTERACTIVE_RESIZE_W )
data.m_rect.x -= data.m_minSize.x - data.m_rect.width;
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 )
data.m_rect.x -= data.m_minSize.x - data.m_rect.width;
data.m_rect.width = data.m_maxSize.x;
}
{
if ( data.m_flags & wxINTERACTIVE_RESIZE_W )
data.m_rect.x -= data.m_minSize.x - data.m_rect.width;
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 )
data.m_rect.y -= data.m_minSize.y - data.m_rect.height;
data.m_rect.height = data.m_minSize.y;
}
{
if ( data.m_flags & wxINTERACTIVE_RESIZE_N )
data.m_rect.y -= data.m_minSize.y - data.m_rect.height;
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 )
data.m_rect.y -= data.m_minSize.y - data.m_rect.height;
{
if ( data.m_flags & wxINTERACTIVE_RESIZE_N )
data.m_rect.y -= data.m_minSize.y - data.m_rect.height;
void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
{
void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event)
{
+ wxPoint diff(wxDefaultCoord,wxDefaultCoord);
switch ( event.GetKeyCode() )
{
switch ( event.GetKeyCode() )
{
+ if ( diff.x != wxDefaultCoord )
{
if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT )
{
{
if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT )
{
if ( m_data.m_sizingCursor )
{
wxEndBusyCursor();
if ( m_data.m_sizingCursor )
{
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 )
- bool changeCur = FALSE;
+ bool changeCur = false;
if ( m_data.m_flags & wxINTERACTIVE_MOVE )
{
if ( m_data.m_flags & wxINTERACTIVE_MOVE )
{
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_N;
m_data.m_pos.y = m_data.m_window->GetPosition().y;
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_N;
m_data.m_pos.y = m_data.m_window->GetPosition().y;
}
else if ( diff.y > 0 )
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_S;
m_data.m_pos.y = m_data.m_window->GetPosition().y +
m_data.m_window->GetSize().y;
}
else if ( diff.y > 0 )
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_S;
m_data.m_pos.y = m_data.m_window->GetPosition().y +
m_data.m_window->GetSize().y;
}
}
if ( !(m_data.m_flags &
}
}
if ( !(m_data.m_flags &
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_W;
m_data.m_pos.x = m_data.m_window->GetPosition().x;
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_W;
m_data.m_pos.x = m_data.m_window->GetPosition().x;
}
else if ( diff.x > 0 )
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_E;
m_data.m_pos.x = m_data.m_window->GetPosition().x +
m_data.m_window->GetSize().x;
}
else if ( diff.x > 0 )
{
m_data.m_flags |= wxINTERACTIVE_RESIZE_E;
m_data.m_pos.x = m_data.m_window->GetPosition().x +
m_data.m_window->GetSize().x;
if ( m_data.m_sizingCursor )
wxEndBusyCursor();
wxBeginBusyCursor(&cur);
if ( m_data.m_sizingCursor )
wxEndBusyCursor();
wxBeginBusyCursor(&cur);
- m_data.m_sizingCursor = TRUE;
+ m_data.m_sizingCursor = true;
{
wxCursor sizingCursor(wxCURSOR_SIZING);
wxBeginBusyCursor(&sizingCursor);
{
wxCursor sizingCursor(wxCURSOR_SIZING);
wxBeginBusyCursor(&sizingCursor);
- data.m_sizingCursor = TRUE;
+ data.m_sizingCursor = true;
- data.m_sizingCursor = FALSE;
+ data.m_sizingCursor = false;
data.m_window = this;
data.m_evtLoop = &loop;
data.m_window = this;
data.m_evtLoop = &loop;
m_isActive = isActive;
RefreshTitleBar();
}
m_isActive = isActive;
RefreshTitleBar();
}
}
else if ( action == wxACTION_TOPLEVEL_BUTTON_PRESS )
{
m_pressedButton = numArg;
RefreshTitleBar();
}
else if ( action == wxACTION_TOPLEVEL_BUTTON_PRESS )
{
m_pressedButton = numArg;
RefreshTitleBar();
}
else if ( action == wxACTION_TOPLEVEL_BUTTON_RELEASE )
{
m_pressedButton = 0;
RefreshTitleBar();
}
else if ( action == wxACTION_TOPLEVEL_BUTTON_RELEASE )
{
m_pressedButton = 0;
RefreshTitleBar();
}
else if ( action == wxACTION_TOPLEVEL_BUTTON_CLICK )
}
else if ( action == wxACTION_TOPLEVEL_BUTTON_CLICK )
m_pressedButton = 0;
RefreshTitleBar();
ClickTitleBarButton(numArg);
m_pressedButton = 0;
RefreshTitleBar();
ClickTitleBarButton(numArg);
}
else if ( action == wxACTION_TOPLEVEL_MOVE )
{
InteractiveMove(wxINTERACTIVE_MOVE);
}
else if ( action == wxACTION_TOPLEVEL_MOVE )
{
InteractiveMove(wxINTERACTIVE_MOVE);
}
else if ( action == wxACTION_TOPLEVEL_RESIZE )
}
else if ( action == wxACTION_TOPLEVEL_RESIZE )
if ( numArg & wxHT_TOPLEVEL_BORDER_E )
flags |= wxINTERACTIVE_RESIZE_E;
InteractiveMove(flags);
if ( numArg & wxHT_TOPLEVEL_BORDER_E )
flags |= wxINTERACTIVE_RESIZE_E;
InteractiveMove(flags);
}
void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event)
{
}
void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event)
{
m_winCapture = NULL;
m_winHitTest = 0;
m_winPressed = 0;
m_winCapture = NULL;
m_winHitTest = 0;
m_winPressed = 0;
- m_borderCursorOn = FALSE;
+ m_borderCursorOn = false;
}
bool wxStdFrameInputHandler::HandleMouse(wxInputConsumer *consumer,
}
bool wxStdFrameInputHandler::HandleMouse(wxInputConsumer *consumer,
m_winHitTest = hit;
m_winPressed = hit;
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
m_winHitTest = hit;
m_winPressed = hit;
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
}
else if ( (hit & wxHT_TOPLEVEL_TITLEBAR) && !w->IsMaximized() )
{
consumer->PerformAction(wxACTION_TOPLEVEL_MOVE);
}
else if ( (hit & wxHT_TOPLEVEL_TITLEBAR) && !w->IsMaximized() )
{
consumer->PerformAction(wxACTION_TOPLEVEL_MOVE);
}
else if ( (consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER)
&& (hit & wxHT_TOPLEVEL_ANY_BORDER) )
{
consumer->PerformAction(wxACTION_TOPLEVEL_RESIZE, hit);
}
else if ( (consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER)
&& (hit & wxHT_TOPLEVEL_ANY_BORDER) )
{
consumer->PerformAction(wxACTION_TOPLEVEL_RESIZE, hit);
if ( m_winHitTest == m_winPressed )
{
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, m_winPressed);
if ( m_winHitTest == m_winPressed )
{
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, m_winPressed);
}
}
//else: the mouse was released outside the window, this doesn't
}
}
//else: the mouse was released outside the window, this doesn't
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
m_winHitTest = hit;
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
m_winHitTest = hit;
}
}
else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER )
}
}
else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER )
if ( m_borderCursorOn )
{
if ( m_borderCursorOn )
{
- m_borderCursorOn = FALSE;
+ m_borderCursorOn = false;
win->SetCursor(m_origCursor);
}
win->SetCursor(m_origCursor);
}
if ( m_borderCursorOn )
{
consumer->GetInputWindow()->SetCursor(m_origCursor);
if ( m_borderCursorOn )
{
consumer->GetInputWindow()->SetCursor(m_origCursor);
- m_borderCursorOn = FALSE;
+ m_borderCursorOn = false;
}
consumer->PerformAction(wxACTION_TOPLEVEL_ACTIVATE, activated);
}
consumer->PerformAction(wxACTION_TOPLEVEL_ACTIVATE, activated);
m_scrollbarVert =
m_scrollbarHorz = (wxScrollBar *)NULL;
m_scrollbarVert =
m_scrollbarHorz = (wxScrollBar *)NULL;
m_renderer = wxTheme::Get()->GetRenderer();
m_renderer = wxTheme::Get()->GetRenderer();
- m_oldSize.x = -1;
- m_oldSize.y = -1;
+ m_oldSize.x = wxDefaultCoord;
+ m_oldSize.y = wxDefaultCoord;
}
bool wxWindow::Create(wxWindow *parent,
}
bool wxWindow::Create(wxWindow *parent,
actualStyle | wxCLIP_CHILDREN,
name) )
{
actualStyle | wxCLIP_CHILDREN,
name) )
{
}
// Set full style again, including those we didn't want present
}
// Set full style again, including those we didn't want present
if ( style & wxALWAYS_SHOW_SB )
{
#if wxUSE_TWO_WINDOWS
if ( style & wxALWAYS_SHOW_SB )
{
#if wxUSE_TWO_WINDOWS
- SetInsertIntoMain( TRUE );
+ SetInsertIntoMain( true );
- m_scrollbarVert = new wxScrollBar(this, -1,
+ m_scrollbarVert = new wxScrollBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxSB_VERTICAL);
#if wxUSE_TWO_WINDOWS
wxDefaultPosition, wxDefaultSize,
wxSB_VERTICAL);
#if wxUSE_TWO_WINDOWS
- SetInsertIntoMain( FALSE );
+ SetInsertIntoMain( false );
if ( style & wxHSCROLL )
{
#if wxUSE_TWO_WINDOWS
if ( style & wxHSCROLL )
{
#if wxUSE_TWO_WINDOWS
- SetInsertIntoMain( TRUE );
+ SetInsertIntoMain( true );
- m_scrollbarHorz = new wxScrollBar(this, -1,
+ m_scrollbarHorz = new wxScrollBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxSB_HORIZONTAL);
#if wxUSE_TWO_WINDOWS
wxDefaultPosition, wxDefaultSize,
wxSB_HORIZONTAL);
#if wxUSE_TWO_WINDOWS
- SetInsertIntoMain( FALSE );
+ SetInsertIntoMain( false );
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
EraseBackground( dc, rect );
}
EraseBackground( dc, rect );
}
}
void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect)
}
void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect)
// debugging helper
#ifdef WXDEBUG_REFRESH
// debugging helper
#ifdef WXDEBUG_REFRESH
- static bool s_refreshDebug = FALSE;
+ static bool s_refreshDebug = false;
if ( s_refreshDebug )
{
wxWindowDC dc(this);
if ( s_refreshDebug )
{
wxWindowDC dc(this);
bool wxWindow::Enable(bool enable)
{
if ( !wxWindowNative::Enable(enable) )
bool wxWindow::Enable(bool enable)
{
if ( !wxWindowNative::Enable(enable) )
// disabled window can't keep focus
if ( FindFocus() == this && GetParent() != NULL )
// disabled window can't keep focus
if ( FindFocus() == this && GetParent() != NULL )
}
bool wxWindow::IsFocused() const
}
bool wxWindow::IsFocused() const
bool wxWindow::IsPressed() const
{
bool wxWindow::IsPressed() const
{
}
bool wxWindow::IsDefault() const
{
}
bool wxWindow::IsDefault() const
{
}
bool wxWindow::IsCurrent() const
}
bool wxWindow::IsCurrent() const
bool wxWindow::SetCurrent(bool doit)
{
if ( doit == m_isCurrent )
bool wxWindow::SetCurrent(bool doit)
{
if ( doit == m_isCurrent )
m_isCurrent = doit;
if ( CanBeHighlighted() )
Refresh();
m_isCurrent = doit;
if ( CanBeHighlighted() )
Refresh();
}
int wxWindow::GetStateFlags() const
}
int wxWindow::GetStateFlags() const
// area.
wxSize newSize = event.GetSize();
// area.
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;
return;
{
m_oldSize = newSize;
return;
rect.width = m_oldSize.x;
rect.y = m_oldSize.y-2;
rect.height = 1;
rect.width = m_oldSize.x;
rect.y = m_oldSize.y-2;
rect.height = 1;
- Refresh( TRUE, &rect );
+ Refresh( true, &rect );
}
else if (newSize.y < m_oldSize.y)
{
}
else if (newSize.y < m_oldSize.y)
{
rect.x = 0;
rect.height = 1;
rect.width = newSize.x;
rect.x = 0;
rect.height = 1;
rect.width = newSize.x;
- wxWindowNative::Refresh( TRUE, &rect );
+ wxWindowNative::Refresh( true, &rect );
}
if (newSize.x > m_oldSize.x)
}
if (newSize.x > m_oldSize.x)
rect.height = m_oldSize.y;
rect.x = m_oldSize.x-2;
rect.width = 1;
rect.height = m_oldSize.y;
rect.x = m_oldSize.x-2;
rect.width = 1;
- Refresh( TRUE, &rect );
+ Refresh( true, &rect );
}
else if (newSize.x < m_oldSize.x)
{
}
else if (newSize.x < m_oldSize.x)
{
rect.y = 0;
rect.width = 1;
rect.height = newSize.y;
rect.y = 0;
rect.width = 1;
rect.height = newSize.y;
- wxWindowNative::Refresh( TRUE, &rect );
+ wxWindowNative::Refresh( true, &rect );
rect.width = m_oldSize.x;
rect.y = m_oldSize.y-4;
rect.height = 2;
rect.width = m_oldSize.x;
rect.y = m_oldSize.y-4;
rect.height = 2;
- Refresh( TRUE, &rect );
+ Refresh( true, &rect );
}
else if (newSize.y < m_oldSize.y)
{
}
else if (newSize.y < m_oldSize.y)
{
rect.x = 0;
rect.height = 2;
rect.width = newSize.x;
rect.x = 0;
rect.height = 2;
rect.width = newSize.x;
- wxWindowNative::Refresh( TRUE, &rect );
+ wxWindowNative::Refresh( true, &rect );
}
if (newSize.x > m_oldSize.x)
}
if (newSize.x > m_oldSize.x)
rect.height = m_oldSize.y;
rect.x = m_oldSize.x-4;
rect.width = 2;
rect.height = m_oldSize.y;
rect.x = m_oldSize.x-4;
rect.width = 2;
- Refresh( TRUE, &rect );
+ Refresh( true, &rect );
}
else if (newSize.x < m_oldSize.x)
{
}
else if (newSize.x < m_oldSize.x)
{
rect.y = 0;
rect.width = 2;
rect.height = newSize.y;
rect.y = 0;
rect.width = 2;
rect.height = newSize.y;
- wxWindowNative::Refresh( TRUE, &rect );
+ wxWindowNative::Refresh( true, &rect );
wxASSERT_MSG( pageSize <= range,
_T("page size can't be greater than range") );
wxASSERT_MSG( pageSize <= range,
_T("page size can't be greater than range") );
- bool hasClientSizeChanged = FALSE;
+ bool hasClientSizeChanged = false;
wxScrollBar *scrollbar = GetScrollbar(orient);
if ( range && (pageSize < range) )
{
wxScrollBar *scrollbar = GetScrollbar(orient);
if ( range && (pageSize < range) )
{
{
// create it
#if wxUSE_TWO_WINDOWS
{
// create it
#if wxUSE_TWO_WINDOWS
- SetInsertIntoMain( TRUE );
+ SetInsertIntoMain( true );
- scrollbar = new wxScrollBar(this, -1,
+ scrollbar = new wxScrollBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
orient & wxVERTICAL ? wxSB_VERTICAL
: wxSB_HORIZONTAL);
#if wxUSE_TWO_WINDOWS
wxDefaultPosition, wxDefaultSize,
orient & wxVERTICAL ? wxSB_VERTICAL
: wxSB_HORIZONTAL);
#if wxUSE_TWO_WINDOWS
- SetInsertIntoMain( FALSE );
+ SetInsertIntoMain( false );
#endif
if ( orient & wxVERTICAL )
m_scrollbarVert = scrollbar;
#endif
if ( orient & wxVERTICAL )
m_scrollbarVert = scrollbar;
m_scrollbarHorz = scrollbar;
// the client area diminished as we created a scrollbar
m_scrollbarHorz = scrollbar;
// the client area diminished as we created a scrollbar
- hasClientSizeChanged = TRUE;
+ hasClientSizeChanged = true;
m_scrollbarHorz = NULL;
// the client area increased as we removed a scrollbar
m_scrollbarHorz = NULL;
// the client area increased as we removed a scrollbar
- hasClientSizeChanged = TRUE;
+ hasClientSizeChanged = true;
// the size of the remaining scrollbar must be adjusted
if ( m_scrollbarHorz || m_scrollbarVert )
// the size of the remaining scrollbar must be adjusted
if ( m_scrollbarHorz || m_scrollbarVert )
if ( dx )
{
r = ScrollNoRefresh(dx, 0, rect);
if ( dx )
{
r = ScrollNoRefresh(dx, 0, rect);
- Refresh(TRUE /* erase bkgnd */, &r);
+ Refresh(true /* erase bkgnd */, &r);
}
if ( dy )
{
r = ScrollNoRefresh(0, dy, rect);
}
if ( dy )
{
r = ScrollNoRefresh(0, dy, rect);
- Refresh(TRUE /* erase bkgnd */, &r);
+ Refresh(true /* erase bkgnd */, &r);
}
// scroll children accordingly:
}
// scroll children accordingly: