Merge the new GUI tests from SOC2010_GUI_TEST branch.

Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-08-22 22:16:05 +00:00
parent 571d991bb3
commit 232fdc630c
79 changed files with 9150 additions and 491 deletions

View File

@@ -183,7 +183,7 @@ public:
Note that on wxGTK wxAnimation is capable of loading the formats supported
by the internally-used @c gdk-pixbuf library (typically this means only
or @c wxANIMATION_TYPE_GIF).
@c wxANIMATION_TYPE_GIF).
On other platforms wxAnimation is always capable of loading both GIF and ANI
formats (i.e. both @c wxANIMATION_TYPE_GIF and @c wxANIMATION_TYPE_ANI).

View File

@@ -130,12 +130,13 @@ typedef class wxString wxArtID;
wxBitmap bmp = wxArtProvider::GetBitmap("gtk-cdrom", wxART_MENU);
#endif
@endcode
For a list of the GTK+ stock items please refer to the GTK+ documentation page
http://library.gnome.org/devel/gtk/stable/gtk-Stock-Items.html.
For a list of the GTK+ stock items please refer to the
<a href="http://library.gnome.org/devel/gtk/stable/gtk-Stock-Items.html">GTK+ documentation
page</a>.
It is also possible to load icons from the current icon theme by specifying their name
(without extension and directory components).
Icon themes recognized by GTK+ follow the freedesktop.org Icon Themes specification
(see http://freedesktop.org/Standards/icon-theme-spec).
Icon themes recognized by GTK+ follow the freedesktop.org
<a href="http://freedesktop.org/Standards/icon-theme-spec">Icon Themes specification</a>.
Note that themes are not guaranteed to contain all icons, so wxArtProvider may
return ::wxNullBitmap or ::wxNullIcon.
The default theme is typically installed in @c /usr/share/icons/hicolor.

View File

@@ -237,7 +237,7 @@ public:
@note For a combobox with @c wxCB_READONLY style the string must be in
the combobox choices list, otherwise the call to SetValue() is
ignored.
ignored. This is case insensitive.
@param text
The text to set.

View File

@@ -16,13 +16,13 @@
downloaded via HTTP protocol) in a window.
The width of the window is constant - given in the constructor - and virtual height
is changed dynamically depending on page size.
Once the window is created you can set its content by calling SetPage(text),
LoadPage(filename) or wxHtmlWindow::LoadFile.
Once the window is created you can set its content by calling SetPage() with raw HTML,
LoadPage() with a wxFileSystem location or LoadFile() with a filename.
@note
wxHtmlWindow uses the wxImage class for displaying images.
Don't forget to initialize all image formats you need before loading any page!
(See ::wxInitAllImageHandlers and wxImage::AddHandler.)
wxHtmlWindow uses the wxImage class for displaying images, as such you need to
initialize the handlers for any image formats you use before loading a page.
See ::wxInitAllImageHandlers and wxImage::AddHandler.
@beginStyleTable
@style{wxHW_SCROLLBAR_NEVER}
@@ -108,7 +108,7 @@ public:
wxString GetOpenedPage() const;
/**
Returns title of the opened page or wxEmptyString if current page does not
Returns title of the opened page or wxEmptyString if the current page does not
contain \<TITLE\> tag.
*/
wxString GetOpenedPageTitle() const;
@@ -119,20 +119,20 @@ public:
wxFrame* GetRelatedFrame() const;
/**
Moves back to the previous page.
(each page displayed using LoadPage() is stored in history list.)
Moves back to the previous page. Only pages displayed using LoadPage()
are stored in history list.
*/
bool HistoryBack();
/**
Returns @true if it is possible to go back in the history
(i.e. HistoryBack() won't fail).
i.e. HistoryBack() won't fail.
*/
bool HistoryCanBack();
/**
Returns @true if it is possible to go forward in the history
(i.e. HistoryBack() won't fail).
i.e. HistoryForward() won't fail.
*/
bool HistoryCanForward();
@@ -142,12 +142,13 @@ public:
void HistoryClear();
/**
Moves to next page in history.
Moves to next page in history. Only pages displayed using LoadPage()
are stored in history list.
*/
bool HistoryForward();
/**
Loads HTML page from file and displays it.
Loads an HTML page from a file and displays it.
@return @false if an error occurred, @true otherwise
@@ -156,12 +157,13 @@ public:
bool LoadFile(const wxFileName& filename);
/**
Unlike SetPage() this function first loads HTML page from @a location
and then displays it. See example:
Unlike SetPage() this function first loads the HTML page from @a location
and then displays it.
@param location
The address of document.
See wxFileSystem for details on address format and behaviour of "opener".
The address of the document.
See the @ref overview_fs for details on the address format
and wxFileSystem for a description of how the file is opened.
@return @false if an error occurred, @true otherwise
@@ -258,8 +260,8 @@ public:
void SelectWord(const wxPoint& pos);
/**
Returns current selection as plain text.
Returns empty string if no text is currently selected.
Returns the current selection as plain text.
Returns an empty string if no text is currently selected.
*/
wxString SelectionToText();
@@ -292,8 +294,7 @@ public:
const wxString& fixed_face = wxEmptyString);
/**
Sets HTML page and display it. This won't @b load the page!!
It will display the @e source. See example:
Sets the source of a page and displays it, for example:
@code
htmlwin -> SetPage("<html><body>Hello, world!</body></html>");
@endcode
@@ -301,7 +302,7 @@ public:
If you want to load a document from some location use LoadPage() instead.
@param source
The HTML document source to be displayed.
The HTML to be displayed.
@return @false if an error occurred, @true otherwise.
*/

View File

@@ -86,44 +86,65 @@
@beginEventEmissionTable{wxListEvent}
@event{EVT_LIST_BEGIN_DRAG(id, func)}
Begin dragging with the left mouse button.
Processes a @c wxEVT_COMMAND_LIST_BEGIN_DRAG event type.
@event{EVT_LIST_BEGIN_RDRAG(id, func)}
Begin dragging with the right mouse button..
@event{EVT_LIST_BEGIN_LABEL_EDIT(id, func)}
Begin dragging with the right mouse button.
Processes a @c wxEVT_COMMAND_LIST_BEGIN_RDRAG event type.
@event{EVT_BEGIN_LABEL_EDIT(id, func)}
Begin editing a label. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT event type.
@event{EVT_LIST_END_LABEL_EDIT(id, func)}
Finish editing a label. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_LIST_END_LABEL_EDIT event type.
@event{EVT_LIST_DELETE_ITEM(id, func)}
An item was deleted.
Processes a @c wxEVT_COMMAND_LIST_DELETE_ITEM event type.
@event{EVT_LIST_DELETE_ALL_ITEMS(id, func)}
All items were deleted.
Processes a @c wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS event type.
@event{EVT_LIST_ITEM_SELECTED(id, func)}
The item has been selected.
Processes a @c wxEVT_COMMAND_LIST_ITEM_SELECTED event type.
@event{EVT_LIST_ITEM_DESELECTED(id, func)}
The item has been deselected.
Processes a @c wxEVT_COMMAND_LIST_ITEM_DESELECTED event type.
@event{EVT_LIST_ITEM_ACTIVATED(id, func)}
The item has been activated (ENTER or double click).
Processes a @c wxEVT_COMMAND_LIST_ITEM_ACTIVATED event type.
@event{EVT_LIST_ITEM_FOCUSED(id, func)}
The currently focused item has changed.
Processes a @c wxEVT_COMMAND_LIST_ITEM_FOCUSED event type.
@event{EVT_LIST_ITEM_MIDDLE_CLICK(id, func)}
The middle mouse button has been clicked on an item.
The middle mouse button has been clicked on an item. This is
only supported by the generic control.
Processes a @c wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK event type.
@event{EVT_LIST_ITEM_RIGHT_CLICK(id, func)}
The right mouse button has been clicked on an item.
Processes a @c wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK event type.
@event{EVT_LIST_KEY_DOWN(id, func)}
A key has been pressed.
Processes a @c wxEVT_COMMAND_LIST_KEY_DOWN event type.
@event{EVT_LIST_INSERT_ITEM(id, func)}
An item has been inserted.
Processes a @c wxEVT_COMMAND_LIST_INSERT_ITEM event type.
@event{EVT_LIST_COL_CLICK(id, func)}
A column (m_col) has been left-clicked.
Processes a @c wxEVT_COMMAND_LIST_COL_CLICK event type.
@event{EVT_LIST_COL_RIGHT_CLICK(id, func)}
A column (m_col) has been right-clicked.
Processes a @c wxEVT_COMMAND_LIST_COL_RIGHT_CLICK event type.
@event{EVT_LIST_COL_BEGIN_DRAG(id, func)}
The user started resizing a column - can be vetoed.
Processes a @c wxEVT_COMMAND_LIST_COL_BEGIN_DRAG event type.
@event{EVT_LIST_COL_DRAGGING(id, func)}
The divider between columns is being dragged.
Processes a @c wxEVT_COMMAND_LIST_COL_DRAGGING event type.
@event{EVT_LIST_COL_END_DRAG(id, func)}
A column has been resized by the user.
Processes a @c wxEVT_COMMAND_LIST_COL_END_DRAG event type.
@event{EVT_LIST_CACHE_HINT(id, func)}
Prepare cache for a virtual list control.
Processes a @c wxEVT_COMMAND_LIST_CACHE_HINT event type.
@endEventTable
@@ -198,6 +219,9 @@ public:
/**
Deletes all items and all columns.
@note This sends an event of type @c wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS
under all platforms.
*/
void ClearAll();

View File

@@ -13,41 +13,41 @@
@beginEventTable{wxRichTextEvent}
@event{EVT_RICHTEXT_CHARACTER(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_CHARACTER event, generated when the user
Process a @c wxEVT_COMMAND_RICHTEXT_CHARACTER event, generated when the user
presses a character key. Valid event functions: GetFlags, GetPosition, GetCharacter.
@event{EVT_RICHTEXT_DELETE(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_DELETE event, generated when the user
Process a @c wxEVT_COMMAND_RICHTEXT_DELETE event, generated when the user
presses the backspace or delete key. Valid event functions: GetFlags, GetPosition.
@event{EVT_RICHTEXT_RETURN(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_RETURN event, generated when the user
Process a @c wxEVT_COMMAND_RICHTEXT_RETURN event, generated when the user
presses the return key. Valid event functions: GetFlags, GetPosition.
@event{EVT_RICHTEXT_STYLE_CHANGED(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED event, generated when
Process a @c wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED event, generated when
styling has been applied to the control. Valid event functions: GetPosition, GetRange.
@event{EVT_RICHTEXT_STYLESHEET_CHANGED(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING event, generated
Process a @c wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING event, generated
when the control's stylesheet has changed, for example the user added,
edited or deleted a style. Valid event functions: GetRange, GetPosition.
@event{EVT_RICHTEXT_STYLESHEET_REPLACING(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING event, generated
Process a @c wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING event, generated
when the control's stylesheet is about to be replaced, for example when
a file is loaded into the control.
Valid event functions: Veto, GetOldStyleSheet, GetNewStyleSheet.
@event{EVT_RICHTEXT_STYLESHEET_REPLACED(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED event, generated
Process a @c wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED event, generated
when the control's stylesheet has been replaced, for example when a file
is loaded into the control.
Valid event functions: GetOldStyleSheet, GetNewStyleSheet.
@event{EVT_RICHTEXT_CONTENT_INSERTED(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED event, generated when
Process a @c wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED event, generated when
content has been inserted into the control.
Valid event functions: GetPosition, GetRange.
@event{EVT_RICHTEXT_CONTENT_DELETED(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED event, generated when
Process a @c wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED event, generated when
content has been deleted from the control.
Valid event functions: GetPosition, GetRange.
@event{EVT_RICHTEXT_BUFFER_RESET(id, func)}
Process a wxEVT_COMMAND_RICHTEXT_BUFFER_RESET event, generated when the
Process a @c wxEVT_COMMAND_RICHTEXT_BUFFER_RESET event, generated when the
buffer has been reset by deleting all content.
You can use this to set a default style for the first new paragraph.
@endEventTable
@@ -74,30 +74,30 @@ public:
wxRichTextEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
/**
Returns the character pressed, within a wxEVT_COMMAND_RICHTEXT_CHARACTER event.
Returns the character pressed, within a @c wxEVT_COMMAND_RICHTEXT_CHARACTER event.
*/
wxChar GetCharacter() const;
/**
Returns flags indicating modifier keys pressed.
Possible values are wxRICHTEXT_CTRL_DOWN, wxRICHTEXT_SHIFT_DOWN, and wxRICHTEXT_ALT_DOWN.
Possible values are @c wxRICHTEXT_CTRL_DOWN, @c wxRICHTEXT_SHIFT_DOWN, and @c wxRICHTEXT_ALT_DOWN.
*/
int GetFlags() const;
/**
Returns the new style sheet.
Can be used in a wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING or
wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED event handler.
Can be used in a @c wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING or
@c wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED event handler.
*/
wxRichTextStyleSheet* GetNewStyleSheet() const;
/**
Returns the old style sheet.
Can be used in a wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING or
wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED event handler.
Can be used in a @c wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING or
@c wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED event handler.
*/
wxRichTextStyleSheet* GetOldStyleSheet() const;
@@ -119,7 +119,7 @@ public:
/**
Sets flags indicating modifier keys pressed.
Possible values are wxRICHTEXT_CTRL_DOWN, wxRICHTEXT_SHIFT_DOWN, and wxRICHTEXT_ALT_DOWN.
Possible values are @c wxRICHTEXT_CTRL_DOWN, @c wxRICHTEXT_SHIFT_DOWN, and @c wxRICHTEXT_ALT_DOWN.
*/
void SetFlags(int flags);

View File

@@ -65,51 +65,73 @@
Begin dragging with the left mouse button.
If you want to enable left-dragging you need to intercept this event
and explicitely call wxTreeEvent::Allow(), as it's vetoed by default.
Processes a @c wxEVT_COMMAND_TREE_BEGIN_DRAG event type.
@event{EVT_TREE_BEGIN_RDRAG(id, func)}
Begin dragging with the right mouse button.
If you want to enable right-dragging you need to intercept this event
and explicitely call wxTreeEvent::Allow(), as it's vetoed by default.
Processes a @c wxEVT_COMMAND_TREE_BEGIN_RDRAG event type.
@event{EVT_TREE_END_DRAG(id, func)}
End dragging with the left or right mouse button.
Processes a @c wxEVT_COMMAND_TREE_END_DRAG event type.
@event{EVT_TREE_BEGIN_LABEL_EDIT(id, func)}
Begin editing a label. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT event type.
@event{EVT_TREE_END_LABEL_EDIT(id, func)}
Finish editing a label. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT event type.
@event{EVT_TREE_DELETE_ITEM(id, func)}
An item was deleted.
Processes a @c wxEVT_COMMAND_TREE_DELETE_ITEM event type.
@event{EVT_TREE_GET_INFO(id, func)}
Request information from the application.
Processes a @c wxEVT_COMMAND_TREE_GET_INFO event type.
@event{EVT_TREE_SET_INFO(id, func)}
Information is being supplied.
Processes a @c wxEVT_COMMAND_TREE_SET_INFO event type.
@event{EVT_TREE_ITEM_ACTIVATED(id, func)}
The item has been activated, i.e. chosen by double clicking it with
mouse or from keyboard.
Processes a @c wxEVT_COMMAND_TREE_ITEM_ACTIVATED event type.
@event{EVT_TREE_ITEM_COLLAPSED(id, func)}
The item has been collapsed.
Processes a @c wxEVT_COMMAND_TREE_ITEM_COLLAPSED event type.
@event{EVT_TREE_ITEM_COLLAPSING(id, func)}
The item is being collapsed. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_TREE_ITEM_COLLAPSING event type.
@event{EVT_TREE_ITEM_EXPANDED(id, func)}
The item has been expanded.
Processes a @c wxEVT_COMMAND_TREE_ITEM_EXPANDED event type.
@event{EVT_TREE_ITEM_EXPANDING(id, func)}
The item is being expanded. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_TREE_ITEM_EXPANDING event type.
@event{EVT_TREE_ITEM_RIGHT_CLICK(id, func)}
The user has clicked the item with the right mouse button.
Processes a @c wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK event type.
@event{EVT_TREE_ITEM_MIDDLE_CLICK(id, func)}
The user has clicked the item with the middle mouse button.
The user has clicked the item with the middle mouse button. This is
only supported by the generic control.
Processes a @c wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK event type.
@event{EVT_TREE_SEL_CHANGED(id, func)}
Selection has changed.
Processes a @c wxEVT_COMMAND_TREE_SEL_CHANGED event type.
@event{EVT_TREE_SEL_CHANGING(id, func)}
Selection is changing. This can be prevented by calling Veto().
Processes a @c wxEVT_COMMAND_TREE_SEL_CHANGING event type.
@event{EVT_TREE_KEY_DOWN(id, func)}
A key has been pressed.
Processes a @c wxEVT_COMMAND_TREE_KEY_DOWN event type.
@event{EVT_TREE_ITEM_GETTOOLTIP(id, func)}
The opportunity to set the item tooltip is being given to the application
(call wxTreeEvent::SetToolTip). Windows only.
Processes a @c wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP event type.
@event{EVT_TREE_ITEM_MENU(id, func)}
The context menu for the selected item has been requested, either by a
right click or by using the menu key.
Processes a @c wxEVT_COMMAND_TREE_ITEM_MENU event type.
@event{EVT_TREE_STATE_IMAGE_CLICK(id, func)}
The state image has been clicked. Windows only.
Processes a @c wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK event type.
@endEventTable