const wxSize& size = wxDefaultSize,
long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = "button");
+ const wxString& name = wxButtonNameStr);
/**
Destructor, destroying the button.
*/
bool Create(wxWindow* parent, wxWindowID id,
const wxBitmap& bitmap,
- const wxPoint& pos,
+ const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& validator,
- const wxString& name = "button");
+ long style = wxBU_AUTODRAW,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
//@{
/**
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = "button");
+ const wxString& name = wxButtonNameStr);
/**
Destructor, destroying the button.
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxValidator& validator,
- const wxString& name = "button");
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
/**
Returns the default size for the buttons. It is advised to make all the dialog
/**
Returns the X position (in client coordinates) of the event.
*/
- long GetX() const;
+ wxCoord GetX() const;
/**
Returns the Y (in client coordinates) position of the event.
*/
- long GetY() const;
+ wxCoord GetY() const;
/**
Returns @true if either CTRL or ALT keys was down
/**
Returns @true if the Alt key was down at the time of the event.
*/
- bool AltDown();
+ bool AltDown() const;
/**
Returns @true if the event was a first extra button double click.
check if any button was pressed
*/
- bool Button(int button);
+ bool Button(int button) const;
/**
If the argument is omitted, this returns @true if the event was a mouse
was generated (see Button() for the possible
values).
*/
- bool ButtonDClick(int but = wxMOUSE_BTN_ANY);
+ bool ButtonDClick(int but = wxMOUSE_BTN_ANY) const;
/**
If the argument is omitted, this returns @true if the event was a mouse
was generated (see Button() for the possible
values).
*/
- bool ButtonDown(int but = -1);
+ bool ButtonDown(int = wxMOUSE_BTN_ANY) const;
/**
If the argument is omitted, this returns @true if the event was a mouse
was generated (see Button() for the possible
values).
*/
- bool ButtonUp(int but = -1);
+ bool ButtonUp(int = wxMOUSE_BTN_ANY) const;
/**
Same as MetaDown() under Mac, same as
/**
Returns @true if the control key was down at the time of the event.
*/
- bool ControlDown();
+ bool ControlDown() const;
/**
Returns @true if this was a dragging event (motion while a button is depressed).
@see Moving()
*/
- bool Dragging();
+ bool Dragging() const;
/**
Returns @true if the mouse was entering the window.
See also Leaving().
*/
- bool Entering();
+ bool Entering() const;
/**
Returns the mouse button which generated this event or @c wxMOUSE_BTN_NONE
/**
Returns X coordinate of the physical mouse event position.
*/
- long GetX() const;
+ wxCoord GetX() const;
/**
Returns Y coordinate of the physical mouse event position.
*/
- long GetY();
+ wxCoord GetY() const;
/**
Returns @true if the event was a mouse button event (not necessarily a button
Returns client data pointer for a listbox or choice selection event
(not valid for a deselection).
*/
- void* GetClientData();
+ void* GetClientData() const;
/**
Returns client object pointer for a listbox or choice selection event
(not valid for a deselection).
*/
- wxClientData* GetClientObject();
+ wxClientData* GetClientObject() const;
/**
Returns extra information dependant on the event objects type.
multiple-selection boxes, and in this case the index and string values
are indeterminate and the listbox must be examined by the application.
*/
- long GetExtraLong();
+ long GetExtraLong() const;
/**
Returns the integer identifier corresponding to a listbox, choice or
radiobox selection (only if the event was a selection, not a
deselection), or a boolean value representing the value of a checkbox.
*/
- int GetInt();
+ int GetInt() const;
/**
Returns item index for a listbox or choice selection event (not valid for
a deselection).
*/
- int GetSelection();
+ int GetSelection() const;
/**
Returns item string for a listbox or choice selection event (not valid for
a deselection).
*/
- wxString GetString();
+ wxString GetString() const;
/**
This method can be used with checkbox and menu events: for the checkboxes, the
For a listbox or similar event, returns @true if it is a selection, @false if it
is a deselection.
*/
- bool IsSelection();
+ bool IsSelection() const;
/**
Sets the client data for this event.
If the event originated from a keyboard event, the value returned from this
function will be wxDefaultPosition.
*/
- wxPoint GetPosition() const;
+ const wxPoint& GetPosition() const;
/**
Sets the position at which the menu should be shown.
class wxHelpEvent : public wxCommandEvent
{
public:
+ // how was this help event generated?
+ enum Origin
+ {
+ Origin_Unknown, // unrecognized event source
+ Origin_Keyboard, // event generated from F1 key press
+ Origin_HelpButton // event from [?] button on the title bar (Windows)
+ };
+
/**
Constructor.
*/
- wxHelpEvent(WXTYPE eventType = 0, wxWindowID id = 0,
- const wxPoint& point);
+ wxHelpEvent(wxEventType type = wxEVT_NULL,
+ wxWindowID winid = 0,
+ const wxPoint& pt = wxDefaultPosition,
+ Origin origin = Origin_Unknown);
/**
Returns the origin of the help event which is one of the following values:
@see SetOrigin()
*/
- wxHelpEvent::Origin GetOrigin() const;
+ Origin GetOrigin() const;
/**
Returns the left-click position of the mouse, in screen coordinates. This allows
the application to position the help appropriately.
*/
- const wxPoint GetPosition() const;
+ const wxPoint& GetPosition() const;
/**
Set the help event origin, only used internally by wxWidgets normally.
@see GetOrigin()
*/
- void SetOrigin(wxHelpEvent::Origin origin);
+ void SetOrigin(Origin);
/**
Sets the left-click position of the mouse, in screen coordinates.
force the application to exit, and so this function must be called to check
this.
*/
- bool CanVeto();
+ bool CanVeto() const;
/**
Returns @true if the user is just logging off or @false if the system is
/**
Sets the 'logging off' flag.
*/
- void SetLoggingOff(bool loggingOff) const;
+ void SetLoggingOff(bool loggingOff);
/**
Call this from your event handler to veto a system shutdown or to signal
Note that the @a win window @b must remain alive until the
wxEventBlocker object destruction.
*/
- wxEventBlocker(wxWindow* win, wxEventType type = wxEVT_ANY);
+ wxEventBlocker(wxWindow* win, wxEventType = -0x000000001);
/**
Destructor. The blocker will remove itself from the chain of event handlers for
the window provided in the constructor, thus restoring normal processing of
events.
*/
- ~wxEventBlocker();
+ virtual ~wxEventBlocker();
/**
Adds to the list of event types which should be blocked the given @e eventType.
unlink itself and restore the previous and next handlers so that they point to
each other.
*/
- ~wxEvtHandler();
+ virtual ~wxEvtHandler();
/**
This function posts an event to be processed later.
@see SetClientData()
*/
- void* GetClientData();
+ void* GetClientData() const;
/**
Get a pointer to the user-supplied client data object.
@see SetEvtHandlerEnabled()
*/
- bool GetEvtHandlerEnabled();
+ bool GetEvtHandlerEnabled() const;
/**
Gets the pointer to the next handler in the chain.
SetPreviousHandler(), wxWindow::PushEventHandler,
wxWindow::PopEventHandler
*/
- wxEvtHandler* GetNextHandler();
+ wxEvtHandler* GetNextHandler() const;
/**
Gets the pointer to the previous handler in the chain.
SetNextHandler(), wxWindow::PushEventHandler,
wxWindow::PopEventHandler
*/
- wxEvtHandler* GetPreviousHandler();
+ wxEvtHandler* GetPreviousHandler() const;
/**
Processes an event, searching event tables and calling zero or more suitable
implementing the Clone function is to implement a copy constructor for
a new event (call it MyEvent) and then define the Clone function like this:
*/
- virtual wxEvent* Clone() const;
+ virtual wxEvent* Clone() const = 0;
/**
Returns the object (usually a window) associated with the
event, if any.
*/
- wxObject* GetEventObject();
+ wxObject* GetEventObject() const;
/**
Returns the identifier of the given event type,
such as @c wxEVT_COMMAND_BUTTON_CLICKED.
*/
- wxEventType GetEventType();
+ wxEventType GetEventType() const;
/**
Returns the identifier associated with this event, such as a button command id.
only differences between the timestamps and not their absolute values usually
make sense).
*/
- long GetTimestamp();
+ long GetTimestamp() const;
/**
Returns @true if the event is or is derived from
/**
Sets the timestamp for the event.
*/
- void SetTimestamp(long timeStamp);
+ void SetTimestamp(long = 0);
/**
Test if this event should be propagated or not, i.e. if the propagation level
/**
Returns a reference to the cursor specified by this event.
*/
- wxCursor GetCursor() const;
+ const wxCursor& GetCursor() const;
/**
Returns the X coordinate of the mouse in client coordinates.
class wxHyperlinkCtrl : public wxControl
{
public:
+ /**
+ Constructor. See Create() for more info.
+ */
+ wxHyperLink(wxWindow* parent, wxWindowID id,
+ const wxString& label,
+ const wxString& url,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxHL_DEFAULT_STYLE,
+ const wxString& name = "hyperlink");
+
/**
Creates the hyperlink control.
const wxString& url,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
- long style,
+ long style = wxHL_DEFAULT_STYLE,
const wxString& name = "hyperlink");
/**
Returns @true if the hyperlink has already been clicked by the user at least
one time.
*/
- bool GetVisited() const;
+ virtual bool GetVisited() const = 0;
/**
Returns the colour used to print the label when the mouse is not over the
/**
Marks the hyperlink as visited (see wxHyperlinkCtrl::SetVisitedColour).
*/
- void SetVisited(bool visited = true);
+ virtual void SetVisited(bool visited = true) = 0;
/**
Sets the colour used to print the label when the mouse is not over the control
visited).
*/
void SetVisitedColour(const wxColour& colour);
-
- /**
- Constructor. See Create() for more info.
- */
- wxHyperLink(wxWindow* parent, wxWindowID id,
- const wxString& label,
- const wxString& url,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style,
- const wxString& name = "hyperlink");
};
/**
Destroys the wxNotebook object.
*/
- ~wxNotebook();
+ virtual ~wxNotebook();
/**
Adds a new page.
This is the only difference with SetSelection().
See @ref overview_progevent "this topic" for more info.
*/
- int ChangeSelection(size_t page);
+ virtual int ChangeSelection(size_t page);
/**
Creates a notebook control. See wxNotebook() for a description
*/
bool Create(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
- const wxSize& size, long style = 0,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
const wxString& name = wxNotebookNameStr);
/**
Deletes all pages.
*/
- bool DeleteAllPages();
+ virtual bool DeleteAllPages();
/**
Deletes the specified page, and the associated window.
/**
Returns the image index for the given page.
*/
- int GetPageImage(size_t nPage) const;
+ virtual int GetPageImage(size_t nPage) const;
/**
Returns the string for the given page.
*/
- wxString GetPageText(size_t nPage) const;
+ virtual wxString GetPageText(size_t nPage) const;
/**
Returns the number of rows in the notebook control.
*/
- int GetRowCount() const;
+ virtual int GetRowCount() const;
/**
Returns the currently selected page, or -1 if none was selected.
wxNotebookEvent::GetSelection should be
used instead in this case.
*/
- int GetSelection() const;
+ virtual int GetSelection() const;
/**
If running under Windows and themes are enabled for the application, this
can be passed
to @c SetBackgroundColour. Otherwise, an uninitialised colour will be returned.
*/
- wxColour GetThemeBackgroundColour() const;
+ virtual wxColour GetThemeBackgroundColour() const;
/**
Returns the index of the tab at the specified position or @c wxNOT_FOUND
@returns Returns the zero-based tab index or wxNOT_FOUND if there is no
tab is at the specified position.
*/
- int HitTest(const wxPoint& pt, long flags = NULL);
+ virtual int HitTest(const wxPoint& pt, long* = NULL) const;
/**
Inserts a new page at the specified position.
Sets the image index for the given page. @a image is an index into
the image list which was set with SetImageList().
*/
- bool SetPageImage(size_t page, int image);
+ virtual bool SetPageImage(size_t page, int image);
/**
Sets the width and height of the pages.
@b NB: This method is currently not implemented for wxGTK.
*/
- void SetPageSize(const wxSize& size);
+ virtual void SetPageSize(const wxSize& size);
/**
Sets the text for the given page.
*/
- bool SetPageText(size_t page, const wxString& text);
+ virtual bool SetPageText(size_t page, const wxString& text);
/**
Sets the selection for the given page, returning the previous selection.
@see GetSelection()
*/
- int SetSelection(size_t page);
+ virtual int SetSelection(size_t page);
};
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-/**
- @class wxBitmapToggleButton
- @wxheader{tglbtn.h}
-
- wxBitmapToggleButton is a wxToggleButton
- that contains a bitmap instead of text.
-
- This control emits an update UI event.
-
- @beginEventTable
- @event{EVT_TOGGLEBUTTON(id, func)}:
- Handles a toggle button click event.
- @endEventTable
-
- @library{wxcore}
- @category{ctrl}
- @appearance{bitmaptogglebutton.png}
-*/
-class wxBitmapToggleButton : public wxControl
-{
-public:
- //@{
- /**
- Constructor, creating and showing a toggle button with the bitmap @e label.
- Internally calls Create().
- */
- wxBitmapToggleButton();
- wxBitmapToggleButton(wxWindow* parent, wxWindowID id,
- const wxBitmap& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& val,
- const wxString& name = "checkBox");
- //@}
-
- /**
- Create method for two-step construction.
- */
- bool Create(wxWindow* parent, wxWindowID id,
- const wxBitmap& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxValidator& val,
- const wxString& name = "checkBox");
-
- /**
- Gets the state of the toggle button.
-
- @returns Returns @true if it is pressed, @false otherwise.
- */
- bool GetValue() const;
-
- /**
- Sets the toggle button to the given state. This does not cause a
- @c EVT_TOGGLEBUTTON event to be emitted.
-
- @param state
- If @true, the button is pressed.
- */
- void SetValue(bool state);
-};
-
-
/**
@class wxToggleButton
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxValidator& val,
+ const wxValidator& val = wxDefaultValidator,
const wxString& name = "checkBox");
//@}
/**
Destructor, destroying the toggle button.
*/
- ~wxToggleButton();
+ virtual ~wxToggleButton();
/**
Creates the toggle button for two-step construction. See wxToggleButton()
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
- const wxValidator& val,
+ const wxValidator& val = wxDefaultValidator,
const wxString& name = "checkBox");
/**
void SetValue(bool state);
};
+
+/**
+ @class wxBitmapToggleButton
+ @wxheader{tglbtn.h}
+
+ wxBitmapToggleButton is a wxToggleButton
+ that contains a bitmap instead of text.
+
+ This control emits an update UI event.
+
+ @beginEventTable
+ @event{EVT_TOGGLEBUTTON(id, func)}:
+ Handles a toggle button click event.
+ @endEventTable
+
+ @library{wxcore}
+ @category{ctrl}
+ @appearance{bitmaptogglebutton.png}
+*/
+class wxBitmapToggleButton : public wxControl
+{
+public:
+ //@{
+ /**
+ Constructor, creating and showing a toggle button with the bitmap @e label.
+ Internally calls Create().
+ */
+ wxBitmapToggleButton();
+ wxBitmapToggleButton(wxWindow* parent, wxWindowID id,
+ const wxBitmap& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxValidator& val = wxDefaultValidator,
+ const wxString& name = "checkBox");
+ //@}
+
+ /**
+ Create method for two-step construction.
+ */
+ bool Create(wxWindow* parent, wxWindowID id,
+ const wxBitmap& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxValidator& val = wxDefaultValidator,
+ const wxString& name = "checkBox");
+
+ /**
+ Gets the state of the toggle button.
+
+ @returns Returns @true if it is pressed, @false otherwise.
+ */
+ virtual bool GetValue() const;
+
+ /**
+ Sets the toggle button to the given state. This does not cause a
+ @c EVT_TOGGLEBUTTON event to be emitted.
+
+ @param state
+ If @true, the button is pressed.
+ */
+ virtual void SetValue(bool state);
+};
+
*/
wxTipWindow(wxWindow* parent, const wxString& text,
wxCoord maxLength = 100,
- wxTipWindow** windowPtr,
+ wxTipWindow** windowPtr = NULL,
wxRect* rectBounds = NULL);
/**