Finished initial review of [ca*-ch*] interface headers.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2008-04-05 09:12:23 +00:00
parent 3ccd1b4987
commit bfac616654
7 changed files with 184 additions and 122 deletions

View File

@@ -55,8 +55,8 @@ digraph Dependancies
@enddot @enddot
Please note that arrows indicate the "depends from" relation and that all blue Please note that arrows indicate the "depends from" relation and that all blue
boxes depend on the @ref page_libs_wxbase library (i.e. they are non-GUI libraries depend on the @ref page_libs_wxbase library (i.e. they are non-GUI
libraries), and all green boxes depend on the @ref page_libs_wxcore library libraries), and all green libraries depend on the @ref page_libs_wxcore library
(i.e. they are GUI libraries). (i.e. they are GUI libraries).

View File

@@ -11,62 +11,56 @@
@wxheader{caret.h} @wxheader{caret.h}
A caret is a blinking cursor showing the position where the typed text will A caret is a blinking cursor showing the position where the typed text will
appear. The text controls usually have a caret but wxCaret class also allows appear. Text controls usually have their own caret but wxCaret provides a
to use a caret in other windows. way to use a caret in other windows.
Currently, the caret appears as a rectangle of the given size. In the future, Currently, the caret appears as a rectangle of the given size. In the
it will be possible to specify a bitmap to be used for the caret shape. future, it will be possible to specify a bitmap to be used for the caret
shape.
A caret is always associated with a window and the current caret can be A caret is always associated with a window and the current caret can be
retrieved using wxWindow::GetCaret. The same caret retrieved using wxWindow::GetCaret(). The same caret can't be reused in two
can't be reused in two different windows. different windows.
@library{wxcore} @library{wxcore}
@category{misc} @category{misc}
@see wxCaret::GetBlinkTime
*/ */
class wxCaret class wxCaret
{ {
public: public:
//@{
/** /**
Create the caret of given (in pixels) width and height and associates it Default constructor.
with the given window.
*/ */
wxCaret(); wxCaret();
//@{
/**
Creates a caret with the given size (in pixels) and associates it with
the @a window.
*/
wxCaret(wxWindow* window, int width, int height); wxCaret(wxWindow* window, int width, int height);
wxCaret(wxWindowBase* window, const wxSize& size); wxCaret(wxWindowBase* window, const wxSize& size);
//@} //@}
//@{ //@{
/** /**
Create the caret of given (in pixels) width and height and associates it Creates a caret with the given size (in pixels) and associates it with
with the given window (same as constructor). the @a window (same as the equivalent constructors).
*/ */
bool Create(wxWindowBase* window, int width, int height); bool Create(wxWindowBase* window, int width, int height);
bool Create(wxWindowBase* window, const wxSize& size); bool Create(wxWindowBase* window, const wxSize& size);
//@} //@}
/** /**
Returns the blink time which is measured in milliseconds and is the time elapsed Returns the blink time which is measured in milliseconds and is the
between 2 inversions of the caret (blink time of the caret is the same time elapsed between 2 inversions of the caret (blink time of the caret
for all carets, so this functions is static). is the same for all carets, so this functions is static).
*/ */
static int GetBlinkTime(); static int GetBlinkTime();
//@{ //@{
/** /**
Get the caret position (in pixels). Get the caret position (in pixels).
@b GetPosition()
Returns a Wx::Point
@b GetPositionXY()
Returns a 2-element list
@c ( x, y )
*/ */
void GetPosition(int* x, int* y) const; void GetPosition(int* x, int* y) const;
const wxPoint GetPosition() const; const wxPoint GetPosition() const;
@@ -75,15 +69,6 @@ public:
//@{ //@{
/** /**
Get the caret size. Get the caret size.
@b GetSize()
Returns a Wx::Size
@b GetSizeWH()
Returns a 2-element list
@c ( width, height )
*/ */
void GetSize(int* width, int* height) const; void GetSize(int* width, int* height) const;
const wxSize GetSize() const; const wxSize GetSize() const;
@@ -95,7 +80,7 @@ public:
wxWindow* GetWindow() const; wxWindow* GetWindow() const;
/** /**
Same as wxCaret::Show(@false). Hides the caret, same as Show(@false).
*/ */
void Hide(); void Hide();
@@ -106,8 +91,8 @@ public:
/** /**
Returns @true if the caret is visible and @false if it is permanently Returns @true if the caret is visible and @false if it is permanently
hidden (if it is is blinking and not shown currently but will be after the hidden (if it is is blinking and not shown currently but will be after
next blink, this method still returns @true). the next blink, this method still returns @true).
*/ */
bool IsVisible() const; bool IsVisible() const;
@@ -122,9 +107,9 @@ public:
/** /**
Sets the blink time for all the carets. Sets the blink time for all the carets.
@remarks Under Windows, this function will change the blink time for all @warning Under Windows, this function will change the blink time for
carets permanently (until the next time it is called), all carets permanently (until the next time it is called),
even for the carets in other applications. even for carets in other applications.
@see GetBlinkTime() @see GetBlinkTime()
*/ */
@@ -139,8 +124,8 @@ public:
//@} //@}
/** /**
Shows or hides the caret. Notice that if the caret was hidden N times, it Shows or hides the caret. Notice that if the caret was hidden N times,
must be shown N times as well to reappear on the screen. it must be shown N times as well to reappear on the screen.
*/ */
void Show(bool show = true); void Show(bool show = true);
}; };

View File

@@ -6,14 +6,25 @@
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/**
The possible states of a 3-state wxCheckBox (Compatible with the 2-state
wxCheckBox).
*/
enum wxCheckBoxState
{
wxCHK_UNCHECKED,
wxCHK_CHECKED,
wxCHK_UNDETERMINED ///< 3-state checkbox only
};
/** /**
@class wxCheckBox @class wxCheckBox
@wxheader{checkbox.h} @wxheader{checkbox.h}
A checkbox is a labelled box which by default is either on (checkmark is A checkbox is a labelled box which by default is either on (checkmark is
visible) or off (no checkmark). Optionally (when the wxCHK_3STATE style flag visible) or off (no checkmark). Optionally (when the wxCHK_3STATE style
is set) it can have a third state, called the mixed or undetermined state. flag is set) it can have a third state, called the mixed or undetermined
Often this is used as a "Does Not Apply" state. state. Often this is used as a "Does Not Apply" state.
@beginStyleTable @beginStyleTable
@style{wxCHK_2STATE}: @style{wxCHK_2STATE}:
@@ -37,14 +48,20 @@
@library{wxcore} @library{wxcore}
@category{ctrl} @category{ctrl}
@appearance{checkbox.png} <!-- @appearance{checkbox.png} -->
@see wxRadioButton, wxCommandEvent @see wxRadioButton, wxCommandEvent
*/ */
class wxCheckBox : public wxControl class wxCheckBox : public wxControl
{ {
public: public:
//@{ /**
Default constructor.
@see Create(), wxValidator
*/
wxCheckBox();
/** /**
Constructor, creating and showing a checkbox. Constructor, creating and showing a checkbox.
@@ -58,8 +75,8 @@ public:
Checkbox position. If wxDefaultPosition is specified then a default Checkbox position. If wxDefaultPosition is specified then a default
position is chosen. position is chosen.
@param size @param size
Checkbox size. If wxDefaultSize is specified then a default Checkbox size. If wxDefaultSize is specified then a default size is
size is chosen. chosen.
@param style @param style
Window style. See wxCheckBox. Window style. See wxCheckBox.
@param validator @param validator
@@ -69,7 +86,6 @@ public:
@see Create(), wxValidator @see Create(), wxValidator
*/ */
wxCheckBox();
wxCheckBox(wxWindow* parent, wxWindowID id, wxCheckBox(wxWindow* parent, wxWindowID id,
const wxString& label, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -77,7 +93,6 @@ public:
long style = 0, long style = 0,
const wxValidator& val = wxDefaultValidator, const wxValidator& val = wxDefaultValidator,
const wxString& name = "checkBox"); const wxString& name = "checkBox");
//@}
/** /**
Destructor, destroying the checkbox. Destructor, destroying the checkbox.
@@ -96,17 +111,6 @@ public:
const wxValidator& val = wxDefaultValidator, const wxValidator& val = wxDefaultValidator,
const wxString& name = "checkBox"); const wxString& name = "checkBox");
/**
Gets the state of a 3-state checkbox.
@returns Returns wxCHK_UNCHECKED when the checkbox is unchecked,
wxCHK_CHECKED when it is checked and
wxCHK_UNDETERMINED when it's in the undetermined state.
Asserts when the function is used with a 2-state
checkbox.
*/
wxCheckBoxState Get3StateValue() const;
/** /**
Gets the state of a 2-state checkbox. Gets the state of a 2-state checkbox.
@@ -114,27 +118,34 @@ public:
*/ */
bool GetValue() const; bool GetValue() const;
/**
Gets the state of a 3-state checkbox. Asserts when the function is used
with a 2-state checkbox.
*/
wxCheckBoxState Get3StateValue() const;
/** /**
Returns whether or not the checkbox is a 3-state checkbox. Returns whether or not the checkbox is a 3-state checkbox.
@returns Returns @true if this checkbox is a 3-state checkbox, @false if @returns Returns @true if this checkbox is a 3-state checkbox, @false
it's a 2-state checkbox. if it's a 2-state checkbox.
*/ */
bool Is3State() const; bool Is3State() const;
/** /**
Returns whether or not the user can set the checkbox to the third state. Returns whether or not the user can set the checkbox to the third
state.
@returns Returns @true if the user can set the third state of this @returns Returns @true if the user can set the third state of this
checkbox, @false if it can only be set programmatically checkbox, @false if it can only be set programmatically or if
or if it's a 2-state checkbox. it's a 2-state checkbox.
*/ */
bool Is3rdStateAllowedForUser() const; bool Is3rdStateAllowedForUser() const;
/** /**
This is just a maybe more readable synonym for This is just a maybe more readable synonym for GetValue(): just as the
GetValue(): just as the latter, it returns latter, it returns @true if the checkbox is checked and @false
@true if the checkbox is checked and @false otherwise. otherwise.
*/ */
bool IsChecked() const; bool IsChecked() const;
@@ -146,5 +157,14 @@ public:
If @true, the check is on, otherwise it is off. If @true, the check is on, otherwise it is off.
*/ */
void SetValue(bool state); void SetValue(bool state);
/**
Sets the checkbox to the given state. This does not cause a
wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted.
Asserts when the checkbox is a 2-state checkbox and setting the state
to wxCHK_UNDETERMINED.
*/
void Set3StateValue(const wxCheckBoxState state);
}; };

View File

@@ -10,10 +10,11 @@
@class wxCheckListBox @class wxCheckListBox
@wxheader{checklst.h} @wxheader{checklst.h}
A checklistbox is like a listbox, but allows items to be checked or unchecked. A wxCheckListBox is like a wxListBox, but allows items to be checked or
unchecked.
When using this class under Windows wxWidgets must be compiled with When using this class under Windows wxWidgets must be compiled with
USE_OWNER_DRAWN set to 1. wxUSE_OWNER_DRAWN set to 1.
Only the new functions for this class are documented; see also wxListBox. Only the new functions for this class are documented; see also wxListBox.
@@ -28,13 +29,18 @@
@library{wxcore} @library{wxcore}
@category{ctrl} @category{ctrl}
@appearance{checklistbox.png} <!-- @appearance{checklistbox.png} -->
@see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
*/ */
class wxCheckListBox : public wxListBox class wxCheckListBox : public wxListBox
{ {
public: public:
/**
Default constructor.
*/
wxCheckListBox();
//@{ //@{
/** /**
Constructor, creating and showing a list box. Constructor, creating and showing a list box.
@@ -46,8 +52,7 @@ public:
@param pos @param pos
Window position. Window position.
@param size @param size
Window size. If wxDefaultSize is specified then the window is Window size. If wxDefaultSize is specified then the window is sized
sized
appropriately. appropriately.
@param n @param n
Number of strings with which to initialise the control. Number of strings with which to initialise the control.
@@ -60,7 +65,6 @@ public:
@param name @param name
Window name. Window name.
*/ */
wxCheckListBox();
wxCheckListBox(wxWindow* parent, wxWindowID id, wxCheckListBox(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
@@ -84,8 +88,8 @@ public:
~wxCheckListBox(); ~wxCheckListBox();
/** /**
Checks the given item. Note that calling this method doesn't result in Checks the given item. Note that calling this method does not result in
wxEVT_COMMAND_CHECKLISTBOX_TOGGLE being emitted. a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.
@param item @param item
Index of item to check. Index of item to check.
@@ -93,5 +97,13 @@ public:
@true if the item is to be checked, @false otherwise. @true if the item is to be checked, @false otherwise.
*/ */
void Check(int item, bool check = true); void Check(int item, bool check = true);
/**
Returns @true if the given item is checked, @false otherwise.
@param item
Index of item whose check status is to be returned.
*/
bool IsChecked(unsigned int item) const;
}; };

View File

@@ -10,8 +10,8 @@
@class wxMultiChoiceDialog @class wxMultiChoiceDialog
@wxheader{choicdlg.h} @wxheader{choicdlg.h}
This class represents a dialog that shows a list of strings, and allows This class represents a dialog that shows a list of strings, and allows the
the user to select one or more. user to select one or more.
@library{wxbase} @library{wxbase}
@category{cmndlg} @category{cmndlg}
@@ -53,11 +53,18 @@ public:
@endStyleTable @endStyleTable
@remarks Use ShowModal() to show the dialog. @remarks Use ShowModal() to show the dialog.
@beginWxPythonOnly
For Python the two parameters @a n and @a choices are collapsed into a
multi parameter @a choices which is expected to be a Python list of
strings.
@endWxPythonOnly
*/ */
wxMultiChoiceDialog(wxWindow* parent, const wxString& message, wxMultiChoiceDialog(wxWindow* parent, const wxString& message,
const wxString& caption, const wxString& caption,
int n, int n, const wxString* choices,
const wxString* choices,
long style = wxCHOICEDLG_STYLE, long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition); const wxPoint& pos = wxDefaultPosition);
wxMultiChoiceDialog(wxWindow* parent, wxMultiChoiceDialog(wxWindow* parent,
@@ -90,8 +97,8 @@ public:
@class wxSingleChoiceDialog @class wxSingleChoiceDialog
@wxheader{choicdlg.h} @wxheader{choicdlg.h}
This class represents a dialog that shows a list of strings, and allows This class represents a dialog that shows a list of strings, and allows the
the user to select one. Double-clicking on a list item is equivalent to user to select one. Double-clicking on a list item is equivalent to
single-clicking and then pressing OK. single-clicking and then pressing OK.
@library{wxbase} @library{wxbase}
@@ -118,8 +125,8 @@ public:
@param choices @param choices
An array of strings, or a string list, containing the choices. An array of strings, or a string list, containing the choices.
@param clientData @param clientData
An array of client data to be associated with the items. An array of client data to be associated with the items. See
See GetSelectionClientData. GetSelectionClientData().
@param style @param style
A dialog style (bitlist) containing flags chosen from standard A dialog style (bitlist) containing flags chosen from standard
dialog styles and the ones listed below. The default value is dialog styles and the ones listed below. The default value is
@@ -138,11 +145,18 @@ public:
@endStyleTable @endStyleTable
@remarks Use ShowModal() to show the dialog. @remarks Use ShowModal() to show the dialog.
@beginWxPythonOnly
For Python the two parameters @a n and @a choices are collapsed into a
multi parameter @a choices which is expected to be a Python list of
strings.
@endWxPythonOnly
*/ */
wxSingleChoiceDialog(wxWindow* parent, const wxString& message, wxSingleChoiceDialog(wxWindow* parent, const wxString& message,
const wxString& caption, const wxString& caption,
int n, int n, const wxString* choices,
const wxString* choices,
void** clientData = NULL, void** clientData = NULL,
long style = wxCHOICEDLG_STYLE, long style = wxCHOICEDLG_STYLE,
const wxPoint& pos = wxDefaultPosition); const wxPoint& pos = wxDefaultPosition);

View File

@@ -11,7 +11,7 @@
@wxheader{choice.h} @wxheader{choice.h}
A choice item is used to select one of a list of strings. Unlike a A choice item is used to select one of a list of strings. Unlike a
listbox, only the selection is visible until the user pulls down the wxListBox, only the selection is visible until the user pulls down the
menu of choices. menu of choices.
@beginStyleTable @beginStyleTable
@@ -27,13 +27,20 @@
@library{wxcore} @library{wxcore}
@category{ctrl} @category{ctrl}
@appearance{choice.png} <!-- @appearance{choice.png} -->
@see wxListBox, wxComboBox, wxCommandEvent @see wxListBox, wxComboBox, wxCommandEvent
*/ */
class wxChoice : public wxControlWithItems class wxChoice : public wxControlWithItems
{ {
public: public:
/**
Default constructor.
@see Create(), wxValidator
*/
wxChoice();
//@{ //@{
/** /**
Constructor, creating and showing a choice. Constructor, creating and showing a choice.
@@ -45,8 +52,7 @@ public:
@param pos @param pos
Window position. Window position.
@param size @param size
Window size. If wxDefaultSize is specified then the choice is Window size. If wxDefaultSize is specified then the choice is sized
sized
appropriately. appropriately.
@param n @param n
Number of strings with which to initialise the choice control. Number of strings with which to initialise the choice control.
@@ -60,8 +66,14 @@ public:
Window name. Window name.
@see Create(), wxValidator @see Create(), wxValidator
@beginWxPythonOnly
The wxChoice constructor in wxPython reduces the @a n and @a choices
arguments to a single argument, which is a list of strings.
@endWxPythonOnly
*/ */
wxChoice();
wxChoice(wxWindow* parent, wxWindowID id, wxChoice(wxWindow* parent, wxWindowID id,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, int n, const wxSize& size, int n,
@@ -105,21 +117,21 @@ public:
/** /**
Gets the number of columns in this choice item. Gets the number of columns in this choice item.
@remarks This is implemented for Motif only and always returns 1 for the @remarks This is implemented for Motif only and always returns 1 for
other platforms. the other platforms.
*/ */
int GetColumns() const; int GetColumns() const;
/** /**
Unlike wxControlWithItems::GetSelection which only Unlike wxControlWithItems::GetSelection() which only returns the
returns the accepted selection value, i.e. the selection in the control once accepted selection value, i.e. the selection in the control once the
the user closes the dropdown list, this function returns the current selection. user closes the dropdown list, this function returns the current
That is, while the dropdown list is shown, it returns the currently selected selection. That is, while the dropdown list is shown, it returns the
item in it. When it is not shown, its result is the same as for the other currently selected item in it. When it is not shown, its result is the
function. same as for the other function.
@wxsince{2.6.2} (before this version @wxsince{2.6.2} (before this version,
wxControlWithItems::GetSelection itself behaved like wxControlWithItems::GetSelection() itself behaved like
this). this).
*/ */
int GetCurrentSelection() const; int GetCurrentSelection() const;
@@ -129,6 +141,9 @@ public:
@param n @param n
Number of columns. Number of columns.
@remarks This is implemented for Motif only and doesnt do anything
under other platforms.
*/ */
void SetColumns(int n = 1); void SetColumns(int n = 1);
}; };

View File

@@ -10,20 +10,18 @@
@class wxChoicebook @class wxChoicebook
@wxheader{choicebk.h} @wxheader{choicebk.h}
wxChoicebook is a class similar to wxNotebook but which wxChoicebook is a class similar to wxNotebook, but uses a wxChoice control
uses a wxChoice to show the labels instead of the to show the labels instead of the tabs.
tabs.
There is no documentation for this class yet but its usage is There is no documentation for this class yet but its usage is identical to
identical to wxNotebook (except for the features clearly related to tabs wxNotebook (except for the features clearly related to tabs only), so
only), so please refer to that class documentation for now. You can also please refer to that class documentation for now. You can also use the
use the @ref overview_samplenotebook "notebook sample" to see wxChoicebook in @ref page_samples_notebook to see wxChoicebook in action.
action.
wxChoicebook allows the use of wxBookCtrl::GetControlSizer, allowing a program wxChoicebook allows the use of wxBookCtrlBase::GetControlSizer(), allowing
to add other controls next to the choice control. This is particularly useful a program to add other controls next to the choice control. This is
when screen space is restricted, as it often is when wxChoicebook is being particularly useful when screen space is restricted, as it often is when
employed. wxChoicebook is being employed.
@beginStyleTable @beginStyleTable
@style{wxCHB_DEFAULT}: @style{wxCHB_DEFAULT}:
@@ -39,12 +37,25 @@
Place labels below the page area. Place labels below the page area.
@endStyleTable @endStyleTable
@beginEventTable{wxChoicebookEvent}
@event{EVT_CHOICEBOOK_PAGE_CHANGED(id, func)}:
The page selection was changed. Processes a
wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED event.
@event{EVT_CHOICEBOOK_PAGE_CHANGING(id, func)}:
The page selection is about to be changed. Processes a
wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING event. This event can be
vetoed (using wxNotifyEvent::Veto()).
@endEventTable
@library{wxcore} @library{wxcore}
@category{miscwnd} @category{miscwnd}
@see wxBookCtrl(), wxNotebook, @ref overview_samplenotebook "notebook sample" @see @ref overview_bookctrl, wxNotebook, @ref page_samples_notebook
@todo Write up wxBookCtrlBase documentation, where most of this class'
functionality comes from.
*/ */
class wxChoicebook : public wxBookCtrl overview class wxChoicebook : public wxBookCtrlBase
{ {
public: public:
//@{ //@{
@@ -58,5 +69,10 @@ public:
long style = 0, long style = 0,
const wxString& name = wxEmptyStr); const wxString& name = wxEmptyStr);
//@} //@}
/**
Returns the wxChoice associated with the control.
*/
wxChoice * GetChoiceCtrl() const;
}; };