Finished adding @tableofcontents to all overviews in the manual.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12,10 +12,6 @@
|
|||||||
|
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_app_intro Introduction
|
|
||||||
|
|
||||||
A wxWidgets application does not have a @e main procedure; the equivalent is
|
A wxWidgets application does not have a @e main procedure; the equivalent is
|
||||||
the wxApp::OnInit member defined for a class derived from wxApp.
|
the wxApp::OnInit member defined for a class derived from wxApp.
|
||||||
|
|
||||||
@@ -129,4 +125,3 @@ int MyApp::OnExit()
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -12,12 +12,6 @@
|
|||||||
|
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
@see @ref group_class_containers
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_container_intro Overview
|
|
||||||
|
|
||||||
For historical reasons, wxWidgets uses custom container classes internally.
|
For historical reasons, wxWidgets uses custom container classes internally.
|
||||||
This was unfortunately unavoidable during a long time when the standard library
|
This was unfortunately unavoidable during a long time when the standard library
|
||||||
wasn't widely available and can't be easily changed even now that it is for
|
wasn't widely available and can't be easily changed even now that it is for
|
||||||
@@ -50,6 +44,8 @@ it isn't and only use legacy wxWidgets containers such as wxArray<T> and
|
|||||||
wxList<T> when you must, i.e. when you use a wxWidgets function taking or
|
wxList<T> when you must, i.e. when you use a wxWidgets function taking or
|
||||||
returning a container of such type.
|
returning a container of such type.
|
||||||
|
|
||||||
|
@see @ref group_class_containers
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_container_legacy Legacy Classes
|
@section overview_container_legacy Legacy Classes
|
||||||
|
@@ -12,12 +12,6 @@
|
|||||||
|
|
||||||
@tableofcontents
|
@tableofcontents
|
||||||
|
|
||||||
@see @ref overview_rtti, wxEvtHandler::Bind(), wxAny
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_cpp_rtti_disabled_intro Introduction
|
|
||||||
|
|
||||||
@note C++ RTTI is usually enabled by default in most wxWidgets builds. If you
|
@note C++ RTTI is usually enabled by default in most wxWidgets builds. If you
|
||||||
do not know if your build has C++ RTTI enabled or not, then it probably
|
do not know if your build has C++ RTTI enabled or not, then it probably
|
||||||
is enabled, and you should not worry about anything mentioned in this
|
is enabled, and you should not worry about anything mentioned in this
|
||||||
@@ -34,6 +28,8 @@ is a shared library or DLL build. More specifically, a template class instance
|
|||||||
created in one physical binary may not be recognized as its correct type when
|
created in one physical binary may not be recognized as its correct type when
|
||||||
used in another one.
|
used in another one.
|
||||||
|
|
||||||
|
@see @ref overview_rtti, wxEvtHandler::Bind(), wxAny
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_cpp_rtti_disabled_bind Bind() Issues
|
@section overview_cpp_rtti_disabled_bind Bind() Issues
|
||||||
|
@@ -10,19 +10,7 @@
|
|||||||
|
|
||||||
@page overview_events Events and Event Handling
|
@page overview_events Events and Event Handling
|
||||||
|
|
||||||
Related classes: wxEvtHandler, wxWindow, wxEvent
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_events_introduction
|
|
||||||
@li @ref overview_events_eventhandling
|
|
||||||
@li @ref overview_events_processing
|
|
||||||
@li @ref overview_events_custom
|
|
||||||
@li @ref overview_events_misc
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_events_introduction Introduction to Events
|
|
||||||
|
|
||||||
Like with all the other GUI frameworks, the control of flow in wxWidgets
|
Like with all the other GUI frameworks, the control of flow in wxWidgets
|
||||||
applications is event-based: the program normally performs most of its actions
|
applications is event-based: the program normally performs most of its actions
|
||||||
@@ -57,6 +45,9 @@ To be more precise, each event is described by:
|
|||||||
event), checking the event source object or its id allows to distinguish
|
event), checking the event source object or its id allows to distinguish
|
||||||
between them.
|
between them.
|
||||||
|
|
||||||
|
@see wxEvtHandler, wxWindow, wxEvent
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_events_eventhandling Event Handling
|
@section overview_events_eventhandling Event Handling
|
||||||
|
|
||||||
@@ -872,11 +863,10 @@ your identifiers don't conflict accidentally.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@subsection overview_events_list List of wxWidgets events
|
@subsection overview_events_list List of wxWidgets Events
|
||||||
|
|
||||||
For the full list of event classes, please see the
|
For the full list of event classes, please see the
|
||||||
@ref group_class_events "event classes group page".
|
@ref group_class_events "event classes group page".
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,15 +10,7 @@
|
|||||||
|
|
||||||
@page overview_exceptions C++ Exceptions
|
@page overview_exceptions C++ Exceptions
|
||||||
|
|
||||||
@li @ref overview_exceptions_introduction
|
@tableofcontents
|
||||||
@li @ref overview_exceptions_strategies
|
|
||||||
@li @ref overview_exceptions_tech
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_exceptions_introduction Introduction
|
|
||||||
|
|
||||||
wxWidgets had been started long before the exceptions were introduced in C++ so
|
wxWidgets had been started long before the exceptions were introduced in C++ so
|
||||||
it is not very surprising that it is not built around using them as some more
|
it is not very surprising that it is not built around using them as some more
|
||||||
@@ -34,7 +26,8 @@ safe to use the exceptions in the user code and the library tries to help you
|
|||||||
with this.
|
with this.
|
||||||
|
|
||||||
|
|
||||||
@section overview_exceptions_strategies Strategies for exceptions handling
|
|
||||||
|
@section overview_exceptions_strategies Strategies for Exception Handling
|
||||||
|
|
||||||
There are several choice for using the exceptions in wxWidgets programs. First
|
There are several choice for using the exceptions in wxWidgets programs. First
|
||||||
of all, you may not use them at all. As stated above, the library doesn't throw
|
of all, you may not use them at all. As stated above, the library doesn't throw
|
||||||
|
@@ -10,9 +10,7 @@
|
|||||||
|
|
||||||
@page overview_file File Classes and Functions
|
@page overview_file File Classes and Functions
|
||||||
|
|
||||||
Classes: wxFile, wxDir, wxTempFile, wxTextFile
|
@tableofcontents
|
||||||
|
|
||||||
Functions: see @ref group_funcmacro_file.
|
|
||||||
|
|
||||||
wxWidgets provides some functions and classes to facilitate working with files.
|
wxWidgets provides some functions and classes to facilitate working with files.
|
||||||
As usual, the accent is put on cross-platform features which explains, for
|
As usual, the accent is put on cross-platform features which explains, for
|
||||||
@@ -38,5 +36,6 @@ wxDir is a helper class for enumerating the files or subdirectories of a
|
|||||||
directory. It may be used to enumerate all files, only files satisfying the
|
directory. It may be used to enumerate all files, only files satisfying the
|
||||||
given template mask or only non-hidden files.
|
given template mask or only non-hidden files.
|
||||||
|
|
||||||
*/
|
@see wxFile, wxDir, wxTempFile, wxTextFile, @ref group_funcmacro_file
|
||||||
|
|
||||||
|
*/
|
||||||
|
@@ -10,21 +10,15 @@
|
|||||||
|
|
||||||
@page overview_fs wxFileSystem Overview
|
@page overview_fs wxFileSystem Overview
|
||||||
|
|
||||||
The wxHTML library uses a @b virtual file systems mechanism
|
@tableofcontents
|
||||||
similar to the one used in Midnight Commander, Dos Navigator,
|
|
||||||
FAR or almost any modern file manager. It allows the user to access
|
|
||||||
data stored in archives as if they were ordinary files. On-the-fly
|
|
||||||
generated files that exist only in memory are also supported.
|
|
||||||
|
|
||||||
@li @ref overview_fs_classes
|
The wxHTML library uses a @b virtual file system mechanism similar to the one
|
||||||
@li @ref overview_fs_locations
|
used in Midnight Commander, Dos Navigator, FAR or almost any modern file
|
||||||
@li @ref overview_fs_combined
|
manager. It allows the user to access data stored in archives as if they were
|
||||||
@li @ref overview_fs_wxhtmlfs
|
ordinary files. On-the-fly generated files that exist only in memory are also
|
||||||
@li @ref overview_fs_init
|
supported.
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_fs_classes Classes
|
@section overview_fs_classes Classes
|
||||||
|
|
||||||
@@ -113,4 +107,3 @@ bool MyApp::OnInit()
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,19 +10,11 @@
|
|||||||
|
|
||||||
@page overview_font wxFont Overview
|
@page overview_font wxFont Overview
|
||||||
|
|
||||||
Class: wxFont, wxFontDialog
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_font_intro
|
A font is an object which determines the appearance of text, primarily when
|
||||||
@li @ref overview_font_nativeinfo
|
drawing text to a window or device context. A font is determined by the
|
||||||
|
following parameters (not all of them have to be specified, of course):
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_font_intro Introduction
|
|
||||||
|
|
||||||
A font is an object which determines the appearance of text, primarily
|
|
||||||
when drawing text to a window or device context. A font is determined by
|
|
||||||
the following parameters (not all of them have to be specified, of course):
|
|
||||||
|
|
||||||
@beginDefList
|
@beginDefList
|
||||||
@itemdef{Point size, This is the standard way of referring to text size.}
|
@itemdef{Point size, This is the standard way of referring to text size.}
|
||||||
@@ -54,16 +46,18 @@ standard Windows fonts, or if allowing the user to specify a face name, store
|
|||||||
the family name with any file that might be transported to a different Windows
|
the family name with any file that might be transported to a different Windows
|
||||||
machine or other platform.
|
machine or other platform.
|
||||||
|
|
||||||
@note There is currently a difference between the appearance
|
@see wxFont, wxFontDialog
|
||||||
of fonts on the two platforms, if the mapping mode is anything other than
|
|
||||||
wxMM_TEXT. Under X, font size is always specified in points. Under MS
|
@note There is currently a difference between the appearance of fonts on the
|
||||||
Windows, the unit for text is points but the text is scaled according to the
|
two platforms, if the mapping mode is anything other than wxMM_TEXT.
|
||||||
current mapping mode. However, user scaling on a device context will also
|
Under X, font size is always specified in points. Under MS Windows, the
|
||||||
scale fonts under both environments.
|
unit for text is points but the text is scaled according to the current
|
||||||
|
mapping mode. However, user scaling on a device context will also scale
|
||||||
|
fonts under both environments.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_font_nativeinfo Native font information
|
@section overview_font_nativeinfo Native Font Information
|
||||||
|
|
||||||
An alternative way of choosing fonts is to use the native font description.
|
An alternative way of choosing fonts is to use the native font description.
|
||||||
This is the only acceptable solution if the user is allowed to choose the font
|
This is the only acceptable solution if the user is allowed to choose the font
|
||||||
@@ -83,4 +77,3 @@ are available for all the ports and should be used to make your program work
|
|||||||
correctly when they are implemented later.
|
correctly when they are implemented later.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_fontencoding Font Encodings
|
@page overview_fontencoding Font Encodings
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
wxWidgets has support for multiple font encodings.
|
wxWidgets has support for multiple font encodings.
|
||||||
|
|
||||||
By encoding we mean here the mapping between the character codes and the
|
By encoding we mean here the mapping between the character codes and the
|
||||||
@@ -20,10 +22,10 @@ letters of foreign alphabets and here other encodings come into play. Please
|
|||||||
note that we will only discuss 8-bit fonts here and not Unicode
|
note that we will only discuss 8-bit fonts here and not Unicode
|
||||||
(see @ref overview_unicode).
|
(see @ref overview_unicode).
|
||||||
|
|
||||||
Font encoding support is ensured by several classes:
|
Font encoding support is ensured by several classes: wxFont itself, but also
|
||||||
wxFont itself, but also wxFontEnumerator and wxFontMapper. wxFont encoding
|
wxFontEnumerator and wxFontMapper. wxFont encoding support is reflected by a
|
||||||
support is reflected by a (new) constructor parameter @e encoding which takes
|
(new) constructor parameter @e encoding which takes one of the following values
|
||||||
one of the following values (elements of enumeration type @c wxFontEncoding):
|
(elements of enumeration type @c wxFontEncoding):
|
||||||
|
|
||||||
@beginDefList
|
@beginDefList
|
||||||
@itemdef{wxFONTENCODING_SYSTEM,
|
@itemdef{wxFONTENCODING_SYSTEM,
|
||||||
@@ -63,26 +65,23 @@ written in Cyrillic) are different on different platforms and because the
|
|||||||
fonts in the given encoding might just not be installed (this is especially a
|
fonts in the given encoding might just not be installed (this is especially a
|
||||||
problem with Unix, or, in general, non-Win32 systems).
|
problem with Unix, or, in general, non-Win32 systems).
|
||||||
|
|
||||||
To clarify, the wxFontEnumerator
|
To clarify, the wxFontEnumerator class may be used to enumerate both all
|
||||||
class may be used to enumerate both all available encodings and to find the
|
available encodings and to find the facename(s) in which the given encoding
|
||||||
facename(s) in which the given encoding exists. If you can find the font in
|
exists. If you can find the font in the correct encoding with wxFontEnumerator
|
||||||
the correct encoding with wxFontEnumerator then your troubles are over, but,
|
then your troubles are over, but, unfortunately, sometimes this is not enough.
|
||||||
unfortunately, sometimes this is not enough. For example, there is no standard
|
For example, there is no standard way (that I know of, please tell me if you
|
||||||
way (that I know of, please tell me if you do!) to find a font on a Windows system
|
do!) to find a font on a Windows system for KOI8 encoding (only for WinCyrillic
|
||||||
for KOI8 encoding (only for WinCyrillic one which is quite different), so
|
one which is quite different), so wxFontEnumerator will never return one, even
|
||||||
wxFontEnumerator will never return one, even if the user has installed a KOI8
|
if the user has installed a KOI8 font on his system.
|
||||||
font on his system.
|
|
||||||
|
|
||||||
To solve this problem, a wxFontMapper class is provided.
|
To solve this problem, a wxFontMapper class is provided.
|
||||||
|
|
||||||
This class stores the mapping between the encodings and the font face
|
This class stores the mapping between the encodings and the font face names
|
||||||
names which support them in wxConfigBase object.
|
which support them in wxConfigBase object. Of course, it would be fairly
|
||||||
Of course, it would be fairly useless if it tried to determine these mappings by
|
useless if it tried to determine these mappings by itself, so, instead, it
|
||||||
itself, so, instead, it (optionally) asks the user and remembers his answers
|
(optionally) asks the user and remembers his answers so that the next time the
|
||||||
so that the next time the program will automatically choose the correct font.
|
program will automatically choose the correct font. All these topics are
|
||||||
All these topics are illustrated by the @ref page_samples_font;
|
illustrated by the @ref page_samples_font; please refer to it and the
|
||||||
please refer to it and the documentation of the classes mentioned here for
|
documentation of the classes mentioned here for further explanations.
|
||||||
further explanations.
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,67 +10,57 @@
|
|||||||
|
|
||||||
@page overview_grid wxGrid Overview
|
@page overview_grid wxGrid Overview
|
||||||
|
|
||||||
Classes: wxGrid
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_grid_intro
|
|
||||||
@li @ref overview_grid_simpleexample
|
|
||||||
@li @ref overview_grid_complexexample
|
|
||||||
@li @ref overview_grid_classrelations
|
|
||||||
@li @ref overview_grid_keyboardmouse
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_grid_intro Introduction
|
|
||||||
|
|
||||||
wxGrid and its related classes are used for displaying and editing tabular
|
wxGrid and its related classes are used for displaying and editing tabular
|
||||||
data. wxGrid supports custom attributes for the table cells, allowing to
|
data. wxGrid supports custom attributes for the table cells, allowing to
|
||||||
completely customize its appearance and uses a separate grid table
|
completely customize its appearance and uses a separate grid table
|
||||||
(wxGridTableBase-derived) class for the data management meaning that it
|
(wxGridTableBase-derived) class for the data management meaning that it can be
|
||||||
can be used to display arbitrary amounts of data.
|
used to display arbitrary amounts of data.
|
||||||
|
|
||||||
@section overview_grid_simpleexample Getting started: a simple example
|
|
||||||
|
|
||||||
For simple applications you need only refer to the wxGrid class in your
|
|
||||||
code. This example shows how you might create a grid in a frame or
|
@section overview_grid_simpleexample Getting Started
|
||||||
dialog constructor and illustrates some of the formatting functions.
|
|
||||||
|
For simple applications you need only refer to the wxGrid class in your code.
|
||||||
|
This example shows how you might create a grid in a frame or dialog constructor
|
||||||
|
and illustrates some of the formatting functions.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
// Create a wxGrid object
|
// Create a wxGrid object
|
||||||
|
|
||||||
grid = new wxGrid( this,
|
grid = new wxGrid( this,
|
||||||
-1,
|
-1,
|
||||||
wxPoint( 0, 0 ),
|
wxPoint( 0, 0 ),
|
||||||
wxSize( 400, 300 ) );
|
wxSize( 400, 300 ) );
|
||||||
|
|
||||||
// Then we call CreateGrid to set the dimensions of the grid
|
// Then we call CreateGrid to set the dimensions of the grid
|
||||||
// (100 rows and 10 columns in this example)
|
// (100 rows and 10 columns in this example)
|
||||||
grid->CreateGrid( 100, 10 );
|
grid->CreateGrid( 100, 10 );
|
||||||
|
|
||||||
// We can set the sizes of individual rows and columns
|
// We can set the sizes of individual rows and columns
|
||||||
// in pixels
|
// in pixels
|
||||||
grid->SetRowSize( 0, 60 );
|
grid->SetRowSize( 0, 60 );
|
||||||
grid->SetColSize( 0, 120 );
|
grid->SetColSize( 0, 120 );
|
||||||
|
|
||||||
// And set grid cell contents as strings
|
// And set grid cell contents as strings
|
||||||
grid->SetCellValue( 0, 0, "wxGrid is good" );
|
grid->SetCellValue( 0, 0, "wxGrid is good" );
|
||||||
|
|
||||||
// We can specify that some cells are read->only
|
// We can specify that some cells are read->only
|
||||||
grid->SetCellValue( 0, 3, "This is read->only" );
|
grid->SetCellValue( 0, 3, "This is read->only" );
|
||||||
grid->SetReadOnly( 0, 3 );
|
grid->SetReadOnly( 0, 3 );
|
||||||
|
|
||||||
// Colours can be specified for grid cell contents
|
// Colours can be specified for grid cell contents
|
||||||
grid->SetCellValue(3, 3, "green on grey");
|
grid->SetCellValue(3, 3, "green on grey");
|
||||||
grid->SetCellTextColour(3, 3, *wxGREEN);
|
grid->SetCellTextColour(3, 3, *wxGREEN);
|
||||||
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
|
grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY);
|
||||||
|
|
||||||
// We can specify the some cells will store numeric
|
// We can specify the some cells will store numeric
|
||||||
// values rather than strings. Here we set grid column 5
|
// values rather than strings. Here we set grid column 5
|
||||||
// to hold floating point values displayed with width of 6
|
// to hold floating point values displayed with width of 6
|
||||||
// and precision of 2
|
// and precision of 2
|
||||||
grid->SetColFormatFloat(5, 6, 2);
|
grid->SetColFormatFloat(5, 6, 2);
|
||||||
grid->SetCellValue(0, 6, "3.1415");
|
grid->SetCellValue(0, 6, "3.1415");
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Here is a list of classes related to wxGrid:
|
Here is a list of classes related to wxGrid:
|
||||||
@@ -113,21 +103,9 @@ Here is a list of classes related to wxGrid:
|
|||||||
@li wxGridTypeRegistry: Contains information about the data types supported by
|
@li wxGridTypeRegistry: Contains information about the data types supported by
|
||||||
the grid.
|
the grid.
|
||||||
|
|
||||||
@section overview_grid_complexexample A more complex example
|
|
||||||
|
|
||||||
@todo To be written
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_grid_classrelations How the wxGrid classes relate to each other
|
@section overview_grid_resizing Column and Row Sizes
|
||||||
|
|
||||||
@todo To be written
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_grid_keyboardmouse Keyboard and mouse actions
|
|
||||||
|
|
||||||
@todo To be written
|
|
||||||
|
|
||||||
@section overview_grid_resizing Column and row sizes
|
|
||||||
|
|
||||||
@b NB: This section will discuss the resizing of wxGrid rows only to avoid
|
@b NB: This section will discuss the resizing of wxGrid rows only to avoid
|
||||||
repetitions but everything in it also applies to grid columns, just replace @c
|
repetitions but everything in it also applies to grid columns, just replace @c
|
||||||
|
@@ -10,20 +10,22 @@
|
|||||||
|
|
||||||
@page overview_helloworld Hello World Example
|
@page overview_helloworld Hello World Example
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
This page shows a very simple wxWidgets program that can be used as a skeleton
|
This page shows a very simple wxWidgets program that can be used as a skeleton
|
||||||
for your own code. While it does nothing very useful, it introduces a couple of
|
for your own code. While it does nothing very useful, it introduces a couple of
|
||||||
important concepts and explains how to write a working wxWidgets application.
|
important concepts and explains how to write a working wxWidgets application.
|
||||||
|
|
||||||
First, you have to include wxWidgets' header files, of course. This can
|
First, you have to include wxWidgets' header files, of course. This can be done
|
||||||
be done on a file by file basis (such as @c wx/window.h) or using one
|
on a file by file basis (such as @c wx/window.h) or using one global include
|
||||||
global include (@c wx/wx.h) which includes most of the commonly needed headers
|
(@c wx/wx.h) which includes most of the commonly needed headers (although not
|
||||||
(although not all of them as there are simply too many wxWidgets headers to
|
all of them as there are simply too many wxWidgets headers to pull in all of
|
||||||
pull in all of them). For the platforms with support for precompiled headers,
|
them). For the platforms with support for precompiled headers, as indicated by
|
||||||
as indicated by @c WX_PRECOMP, this global header is already included by @c
|
@c WX_PRECOMP, this global header is already included by @c wx/wxprec.h so we
|
||||||
wx/wxprec.h so we only include it for the other ones:
|
only include it for the other ones:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
// wxWidgets "Hello world" Program
|
// wxWidgets "Hello world" Program
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
#include <wx/wxprec.h>
|
#include <wx/wxprec.h>
|
||||||
@@ -45,17 +47,16 @@ public:
|
|||||||
};
|
};
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
The main window is created by deriving a class from wxFrame and
|
The main window is created by deriving a class from wxFrame and giving it a
|
||||||
giving it a menu and a status bar in its constructor. Also, any class
|
menu and a status bar in its constructor. Also, any class that wishes to
|
||||||
that wishes to respond to any "event" (such as mouse clicks or
|
respond to any "event" (such as mouse clicks or messages from the menu or a
|
||||||
messages from the menu or a button) must declare an event table
|
button) must declare an event table using the macro below.
|
||||||
using the macro below.
|
|
||||||
|
|
||||||
Finally, the way to react to such events must be done in "handlers".
|
Finally, the way to react to such events must be done in "handlers". In our
|
||||||
In our sample, we react to three menu items, one for our custom menu
|
sample, we react to three menu items, one for our custom menu command and two
|
||||||
command and two for the standard "Exit" and "About" commands (any program
|
for the standard "Exit" and "About" commands (any program should normally
|
||||||
should normally implement the latter two). Notice that these handlers
|
implement the latter two). Notice that these handlers don't need to be neither
|
||||||
don't need to be neither virtual nor public.
|
virtual nor public.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
class MyFrame: public wxFrame
|
class MyFrame: public wxFrame
|
||||||
@@ -83,20 +84,20 @@ enum
|
|||||||
};
|
};
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Notice that you don't need to define identifiers for the "About" and "Exit"
|
Notice that you don't need to define identifiers for the "About" and "Exit". We
|
||||||
We then proceed to actually implement an event table in which the events
|
then proceed to actually implement an event table in which the events are
|
||||||
are routed to their respective handler functions in the class MyFrame.
|
routed to their respective handler functions in the class MyFrame.
|
||||||
|
|
||||||
There are predefined macros for routing all common events, ranging from
|
There are predefined macros for routing all common events, ranging from the
|
||||||
the selection of a list box entry to a resize event when a user resizes
|
selection of a list box entry to a resize event when a user resizes a window on
|
||||||
a window on the screen. If @c wxID_ANY is given as the ID, the given handler will be
|
the screen. If @c wxID_ANY is given as the ID, the given handler will be
|
||||||
invoked for any event of the specified type, so that you could add just
|
invoked for any event of the specified type, so that you could add just one
|
||||||
one entry in the event table for all menu commands or all button commands etc.
|
entry in the event table for all menu commands or all button commands etc.
|
||||||
|
|
||||||
The origin of the event can still be distinguished in the event handler as
|
The origin of the event can still be distinguished in the event handler as the
|
||||||
the (only) parameter in an event handler is a reference to a wxEvent object,
|
(only) parameter in an event handler is a reference to a wxEvent object, which
|
||||||
which holds various information about the event (such as the ID of and a
|
holds various information about the event (such as the ID of and a pointer to
|
||||||
pointer to the class, which emitted the event).
|
the class, which emitted the event).
|
||||||
|
|
||||||
@code
|
@code
|
||||||
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
@@ -106,31 +107,32 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
As in all programs there must be a "main" function. Under wxWidgets main is implemented
|
As in all programs there must be a "main" function. Under wxWidgets main is
|
||||||
using this macro, which creates an application instance and starts the program.
|
implemented using this macro, which creates an application instance and starts
|
||||||
|
the program.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
wxIMPLEMENT_APP(MyApp)
|
wxIMPLEMENT_APP(MyApp)
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
As mentioned above, wxApp::OnInit() is called upon startup and should be
|
As mentioned above, wxApp::OnInit() is called upon startup and should be used
|
||||||
used to initialize the program, maybe showing a "splash screen" and creating
|
to initialize the program, maybe showing a "splash screen" and creating the
|
||||||
the main window (or several). The frame should get a title bar text ("Hello World")
|
main window (or several). The frame should get a title bar text ("Hello World")
|
||||||
and a position and start-up size. One frame can also be declared to be the
|
and a position and start-up size. One frame can also be declared to be the top
|
||||||
top window. Returning @true indicates a successful initialization.
|
window. Returning @true indicates a successful initialization.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
bool MyApp::OnInit()
|
bool MyApp::OnInit()
|
||||||
{
|
{
|
||||||
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50,50), wxSize(450,340) );
|
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50, 50), wxSize(450, 340) );
|
||||||
frame->Show( true );
|
frame->Show( true );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
In the constructor of the main window (or later on) we create a menu with our menu
|
In the constructor of the main window (or later on) we create a menu with our
|
||||||
items as well as a status bar to be shown at the bottom of the main window. Both have
|
menu items as well as a status bar to be shown at the bottom of the main
|
||||||
to be associated with the frame with respective calls.
|
window. Both have to be associated with the frame with respective calls.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
@@ -188,6 +190,7 @@ void MyFrame::OnAbout(wxCommandEvent& event)
|
|||||||
The implementation of custom menu command handler may perform whatever task
|
The implementation of custom menu command handler may perform whatever task
|
||||||
your program needs to do, in this case we will simply show a message from it as
|
your program needs to do, in this case we will simply show a message from it as
|
||||||
befits a hello world example:
|
befits a hello world example:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
void MyFrame::OnHello(wxCommandEvent& event)
|
void MyFrame::OnHello(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
@@ -196,8 +199,9 @@ void MyFrame::OnHello(wxCommandEvent& event)
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Here is the entire program that can be copied and pasted:
|
Here is the entire program that can be copied and pasted:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
// wxWidgets "Hello world" Program
|
// wxWidgets "Hello world" Program
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
#include <wx/wxprec.h>
|
#include <wx/wxprec.h>
|
||||||
@@ -240,7 +244,7 @@ wxIMPLEMENT_APP(MyApp);
|
|||||||
|
|
||||||
bool MyApp::OnInit()
|
bool MyApp::OnInit()
|
||||||
{
|
{
|
||||||
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50,50), wxSize(450,340) );
|
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50, 50), wxSize(450, 340) );
|
||||||
frame->Show( true );
|
frame->Show( true );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -285,4 +289,3 @@ void MyFrame::OnHello(wxCommandEvent& event)
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_html wxHTML Overview
|
@page overview_html wxHTML Overview
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
The wxHTML library provides classes for parsing and displaying HTML.
|
The wxHTML library provides classes for parsing and displaying HTML.
|
||||||
It is not intended to be a high-end HTML browser. If you are looking for
|
It is not intended to be a high-end HTML browser. If you are looking for
|
||||||
something like that try <http://www.mozilla.org/>.
|
something like that try <http://www.mozilla.org/>.
|
||||||
@@ -27,36 +29,27 @@ See @c src/html/m_*.cpp files for details.
|
|||||||
|
|
||||||
There is a generic wxHtmlParser class, independent of wxHtmlWindow.
|
There is a generic wxHtmlParser class, independent of wxHtmlWindow.
|
||||||
|
|
||||||
@li @ref overview_html_quickstart
|
|
||||||
@li @ref overview_html_printing
|
|
||||||
@li @ref overview_html_helpformats
|
|
||||||
@li @ref overview_html_filters
|
|
||||||
@li @ref overview_html_cells
|
|
||||||
@li @ref overview_html_handlers
|
|
||||||
@li @ref overview_html_supptags
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
@section overview_html_quickstart wxHTML Quick Start
|
||||||
|
|
||||||
|
|
||||||
@section overview_html_quickstart wxHTML quick start
|
|
||||||
|
|
||||||
@subsection overview_html_quickstart_disphtml Displaying HTML
|
@subsection overview_html_quickstart_disphtml Displaying HTML
|
||||||
|
|
||||||
First of all, you must include @c wx/wxhtml.h.
|
First of all, you must include @c wx/wxhtml.h.
|
||||||
|
|
||||||
Class wxHtmlWindow (derived from ::wxScrolledWindow) is used to display HTML documents.
|
Class wxHtmlWindow (derived from ::wxScrolledWindow) is used to display HTML
|
||||||
|
documents.
|
||||||
|
|
||||||
It has two important methods: wxHtmlWindow::LoadPage and wxHtmlWindow::SetPage.
|
It has two important methods: wxHtmlWindow::LoadPage and wxHtmlWindow::SetPage.
|
||||||
LoadPage loads and displays HTML file while SetPage displays directly the
|
LoadPage loads and displays HTML file while SetPage displays directly the
|
||||||
passed @b string. See the example:
|
passed @b string. See the example:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
mywin -> LoadPage("test.htm");
|
mywin->LoadPage("test.htm");
|
||||||
mywin -> SetPage("htmlbody"
|
mywin->SetPage("htmlbody"
|
||||||
"h1Error/h1"
|
"h1Error/h1"
|
||||||
"Some error occurred :-H)"
|
"Some error occurred :-H)"
|
||||||
"/body/hmtl");
|
"/body/hmtl");
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
@subsection overview_html_quickstart_settingup Setting up wxHtmlWindow
|
@subsection overview_html_quickstart_settingup Setting up wxHtmlWindow
|
||||||
@@ -71,9 +64,9 @@ wxHtmlWindow::SetRelatedFrame and wxHtmlWindow::SetRelatedStatusBar.
|
|||||||
See the example:
|
See the example:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
html = new wxHtmlWindow(this);
|
html = new wxHtmlWindow(this);
|
||||||
html -> SetRelatedFrame(this, "HTML : %%s");
|
html->SetRelatedFrame(this, "HTML : %%s");
|
||||||
html -> SetRelatedStatusBar(0);
|
html->SetRelatedStatusBar(0);
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
The first command associates the HTML object with its parent frame
|
The first command associates the HTML object with its parent frame
|
||||||
@@ -101,32 +94,33 @@ The last two functions are used to store user customization info wxConfig stuff
|
|||||||
|
|
||||||
@section overview_html_printing HTML Printing
|
@section overview_html_printing HTML Printing
|
||||||
|
|
||||||
The wxHTML library provides printing facilities with several levels of complexity.
|
The wxHTML library provides printing facilities with several levels of
|
||||||
The easiest way to print an HTML document is to use the wxHtmlEasyPrinting class.
|
complexity. The easiest way to print an HTML document is to use the
|
||||||
|
wxHtmlEasyPrinting class.
|
||||||
|
|
||||||
It lets you print HTML documents with only one command and you don't have to worry
|
It lets you print HTML documents with only one command and you don't have to
|
||||||
about deriving from the wxPrintout class at all. It is only a simple wrapper around the
|
worry about deriving from the wxPrintout class at all. It is only a simple
|
||||||
wxHtmlPrintout, normal wxWidgets printout class.
|
wrapper around the wxHtmlPrintout, normal wxWidgets printout class.
|
||||||
|
|
||||||
And finally there is the low level class wxHtmlDCRenderer which you can use to
|
And finally there is the low level class wxHtmlDCRenderer which you can use to
|
||||||
render HTML into a rectangular area on any DC.
|
render HTML into a rectangular area on any DC. It supports rendering into
|
||||||
|
multiple rectangles with the same width. The most common use of this is placing
|
||||||
|
one rectangle on each page or printing into two columns.
|
||||||
|
|
||||||
It supports rendering into multiple rectangles with the same
|
|
||||||
width. (The most common use of this is placing one rectangle on each page or
|
|
||||||
printing into two columns.)
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_html_helpformats Help Files Format
|
@section overview_html_helpformats Help Files Format
|
||||||
|
|
||||||
wxHTML library can be used to show an help manual to the user; in fact, it supports
|
wxHTML library can be used to show an help manual to the user; in fact, it
|
||||||
natively (through wxHtmlHelpController) a reduced version of MS HTML Workshop format.
|
supports natively (through wxHtmlHelpController) a reduced version of MS HTML
|
||||||
|
Workshop format.
|
||||||
|
|
||||||
A @b book consists of three files: the header file, the contents file
|
A @b book consists of three files: the header file, the contents file
|
||||||
and the index file.
|
and the index file.
|
||||||
|
|
||||||
You can make a regular zip archive of these files, plus the HTML and any
|
You can make a regular zip archive of these files, plus the HTML and any image
|
||||||
image files, for wxHTML (or helpview) to read; and the @c ".zip" file can
|
files, for wxHTML (or helpview) to read; and the @c ".zip" file can optionally
|
||||||
optionally be renamed to @c ".htb".
|
be renamed to @c ".htb".
|
||||||
|
|
||||||
@subsection overview_html_helpformats_hhp Header file (.hhp)
|
@subsection overview_html_helpformats_hhp Header file (.hhp)
|
||||||
|
|
||||||
@@ -159,56 +153,54 @@ It contains exactly one list (@c <ul>....@c </ul> statement):
|
|||||||
|
|
||||||
@code
|
@code
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><object type="text/sitemap">
|
||||||
<li><object type="text/sitemap">
|
|
||||||
<param name="Name" value="@topic name@">
|
<param name="Name" value="@topic name@">
|
||||||
<param name="ID" value=@numeric_id@>
|
<param name="ID" value=@numeric_id@>
|
||||||
<param name="Local" value="@filename.htm@">
|
<param name="Local" value="@filename.htm@">
|
||||||
</object>
|
</object>
|
||||||
<li><object type="text/sitemap">
|
<li><object type="text/sitemap">
|
||||||
<param name="Name" value="@topic name@">
|
<param name="Name" value="@topic name@">
|
||||||
<param name="ID" value=@numeric_id@>
|
<param name="ID" value=@numeric_id@>
|
||||||
<param name="Local" value="@filename.htm@">
|
<param name="Local" value="@filename.htm@">
|
||||||
</object>
|
</object>
|
||||||
...
|
...
|
||||||
</ul>
|
</ul>
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
You can modify value attributes of param tags.
|
You can modify value attributes of param tags. The <em>topic name</em> is name
|
||||||
The <em>topic name</em> is name of chapter/topic as is displayed in
|
of chapter/topic as is displayed in contents, <em>filename.htm</em> is the HTML
|
||||||
contents, <em>filename.htm</em> is the HTML page name (relative to the @c ".hhp" file)
|
page name (relative to the @c ".hhp" file) and <em>numeric_id</em> is optional,
|
||||||
and <em>numeric_id</em> is optional - it is used only when you use wxHtmlHelpController::Display(int).
|
it is used only when you use wxHtmlHelpController::Display(int).
|
||||||
|
|
||||||
Items in the list may be nested - one @c <li> statement may contain a @c <ul> sub-statement:
|
Items in the list may be nested - one @c <li> statement may contain a
|
||||||
|
@c <ul> sub-statement:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><object type="text/sitemap">
|
||||||
<li><object type="text/sitemap">
|
<param name="Name" value="Top node">
|
||||||
<param name="Name" value="Top node">
|
<param name="Local" value="top.htm">
|
||||||
<param name="Local" value="top.htm">
|
</object>
|
||||||
</object>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><object type="text/sitemap">
|
<li><object type="text/sitemap">
|
||||||
<param name="Name" value="subnode in topnode">
|
<param name="Name" value="subnode in topnode">
|
||||||
<param name="Local" value="subnode1.htm">
|
<param name="Local" value="subnode1.htm">
|
||||||
</object>
|
</object>
|
||||||
...
|
...
|
||||||
</ul>
|
</ul>
|
||||||
|
<li><object type="text/sitemap">
|
||||||
<li><object type="text/sitemap">
|
<param name="Name" value="Another Top">
|
||||||
<param name="Name" value="Another Top">
|
<param name="Local" value="top2.htm">
|
||||||
<param name="Local" value="top2.htm">
|
</object>
|
||||||
</object>
|
...
|
||||||
...
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
@subsection overview_html_helpformats_hhk Index file (.hhk)
|
@subsection overview_html_helpformats_hhk Index Files (.hhk)
|
||||||
|
|
||||||
|
Index files have same format as contents files except that ID params are
|
||||||
|
ignored and sublists are @b not allowed.
|
||||||
|
|
||||||
Index files have same format as contents files except that ID params are ignored
|
|
||||||
and sublists are @b not allowed.
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_html_filters Input Filters
|
@section overview_html_filters Input Filters
|
||||||
@@ -221,6 +213,7 @@ To make a file type known to wxHtmlWindow you must create a wxHtmlFilter filter
|
|||||||
register it using wxHtmlWindow::AddFilter.
|
register it using wxHtmlWindow::AddFilter.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_html_cells Cells and Containers
|
@section overview_html_cells Cells and Containers
|
||||||
|
|
||||||
This article describes mechanism used by wxHtmlWinParser and
|
This article describes mechanism used by wxHtmlWinParser and
|
||||||
@@ -262,20 +255,18 @@ to the parent container. See explanation:
|
|||||||
There clearly must be same number of calls to OpenContainer as to
|
There clearly must be same number of calls to OpenContainer as to
|
||||||
CloseContainer.
|
CloseContainer.
|
||||||
|
|
||||||
@subsubsection overview_html_cells_conttaghandler_example Example
|
This code creates a new paragraph (container at same depth level) with
|
||||||
|
"Hello, world!":
|
||||||
This code creates a new paragraph (container at same depth level)
|
|
||||||
with "Hello, world!":
|
|
||||||
|
|
||||||
@code
|
@code
|
||||||
m_WParser -> CloseContainer();
|
m_WParser->CloseContainer();
|
||||||
c = m_WParser -> OpenContainer();
|
c = m_WParser->OpenContainer();
|
||||||
|
|
||||||
m_WParser -> AddText("Hello, ");
|
m_WParser->AddText("Hello, ");
|
||||||
m_WParser -> AddText("world!");
|
m_WParser->AddText("world!");
|
||||||
|
|
||||||
m_WParser -> CloseContainer();
|
m_WParser->CloseContainer();
|
||||||
m_WParser -> OpenContainer();
|
m_WParser->OpenContainer();
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
and here is image of the situation:
|
and here is image of the situation:
|
||||||
@@ -286,14 +277,14 @@ You can see that there was an opened container before the code was executed.
|
|||||||
We closed it, created our own container, then closed our container and opened
|
We closed it, created our own container, then closed our container and opened
|
||||||
new container.
|
new container.
|
||||||
|
|
||||||
The result was that we had @e same depth level after executing.
|
The result was that we had @e same depth level after executing. This is general
|
||||||
This is general rule that should be followed by tag handlers:
|
rule that should be followed by tag handlers: leave depth level of containers
|
||||||
leave depth level of containers unmodified (in other words, number of
|
unmodified (in other words, number of OpenContainer and CloseContainer calls
|
||||||
OpenContainer and CloseContainer calls should be same within
|
should be same within wxHtmlTagHandler::HandleTag's body).
|
||||||
wxHtmlTagHandler::HandleTag's body).
|
|
||||||
|
Notice that it would be usually better to use wxHtmlContainerCell::InsertCell
|
||||||
|
instead of adding text to the parser directly.
|
||||||
|
|
||||||
Notice that it would be usually better to use wxHtmlContainerCell::InsertCell instead
|
|
||||||
of adding text to the parser directly.
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_html_handlers Tag Handlers
|
@section overview_html_handlers Tag Handlers
|
||||||
@@ -427,19 +418,22 @@ See macros reference:
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
@section overview_html_supptags Tags supported by wxHTML
|
|
||||||
|
@section overview_html_supptags Supported HTML Tags
|
||||||
|
|
||||||
wxHTML is not full implementation of HTML standard. Instead, it supports most
|
wxHTML is not full implementation of HTML standard. Instead, it supports most
|
||||||
common tags so that it is possible to display @e simple HTML documents with it.
|
common tags so that it is possible to display @e simple HTML documents with it.
|
||||||
(For example it works fine with pages created in Netscape Composer or generated by tex2rtf).
|
(For example it works fine with pages created in Netscape Composer or generated
|
||||||
|
by tex2rtf).
|
||||||
|
|
||||||
Following tables list all tags known to wxHTML, together with supported parameters.
|
Following tables list all tags known to wxHTML, together with supported
|
||||||
|
parameters.
|
||||||
|
|
||||||
A tag has general form of @c tagname param_1 param_2 ... param_n where param_i is
|
A tag has general form of @c tagname param_1 param_2 ... param_n where param_i
|
||||||
either @c paramname="paramvalue" or @c paramname=paramvalue - these two are equivalent.
|
is either @c paramname="paramvalue" or @c paramname=paramvalue - these two are
|
||||||
Unless stated otherwise, wxHTML is case-insensitive.
|
equivalent. Unless stated otherwise, wxHTML is case-insensitive.
|
||||||
|
|
||||||
@subsection overview_html_supptags_commonvalues Table of common parameter values
|
@subsection overview_html_supptags_commonvalues Common Parameter Values
|
||||||
|
|
||||||
We will use these substitutions in tags descriptions:
|
We will use these substitutions in tags descriptions:
|
||||||
|
|
||||||
@@ -484,7 +478,7 @@ We will use these substitutions in tags descriptions:
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
@subsection overview_html_supptags_list List of supported tags
|
@subsection overview_html_supptags_list List of Supported Tags
|
||||||
|
|
||||||
@code
|
@code
|
||||||
A NAME=[string]
|
A NAME=[string]
|
||||||
@@ -577,18 +571,18 @@ U
|
|||||||
UL
|
UL
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
@subsection overview_html_suppstyles_list List of supported styles
|
@subsection overview_html_suppstyles_list Supported Styles
|
||||||
|
|
||||||
wxHTML doesn't really have CSS support but it does support a few simple styles:
|
wxHTML doesn't really have CSS support but it does support a few simple styles:
|
||||||
you can use @c "text-align", @c "width", @c "vertical-align" and @c
|
you can use @c "text-align", @c "width", @c "vertical-align" and @c
|
||||||
"background" with all elements and for @c SPAN elements a few other styles are
|
"background" with all elements and for @c SPAN elements a few other styles are
|
||||||
additionally recognized:
|
additionally recognized:
|
||||||
- @c color
|
|
||||||
- @c font-family
|
- @c color
|
||||||
- @c font-size (only in point units)
|
- @c font-family
|
||||||
- @c font-style (only "oblique", "italic" and "normal" values are supported)
|
- @c font-size (only in point units)
|
||||||
- @c font-weight (only "bold" and "normal" values are supported)
|
- @c font-style (only "oblique", "italic" and "normal" values are supported)
|
||||||
- @c text-decoration (only "underline" value is supported)
|
- @c font-weight (only "bold" and "normal" values are supported)
|
||||||
|
- @c text-decoration (only "underline" value is supported)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,13 +10,7 @@
|
|||||||
|
|
||||||
@page overview_i18n Internationalization
|
@page overview_i18n Internationalization
|
||||||
|
|
||||||
@li @ref overview_i18n_intro
|
@tableofcontents
|
||||||
@li @ref overview_i18n_menuaccel
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_i18n_intro Introduction
|
|
||||||
|
|
||||||
Although internationalization of an application (i18n for short) involves far
|
Although internationalization of an application (i18n for short) involves far
|
||||||
more than just translating its text messages to another message - date, time
|
more than just translating its text messages to another message - date, time
|
||||||
@@ -70,6 +64,7 @@ Translating your application involves several steps:
|
|||||||
given language: see wxLocale.
|
given language: see wxLocale.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_i18n_menuaccel Translating Menu Accelerators
|
@section overview_i18n_menuaccel Translating Menu Accelerators
|
||||||
|
|
||||||
If you translate the accelerator modifier names (Ctrl, Alt and Shift) in your
|
If you translate the accelerator modifier names (Ctrl, Alt and Shift) in your
|
||||||
@@ -87,4 +82,3 @@ translated special key names such as Backspace, End, Insert, etc.
|
|||||||
@li @ref page_samples_internat - Shows you how all this looks in practice.
|
@li @ref page_samples_internat - Shows you how all this looks in practice.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,15 +10,7 @@
|
|||||||
|
|
||||||
@page overview_ipc Interprocess Communication
|
@page overview_ipc Interprocess Communication
|
||||||
|
|
||||||
Classes: wxServer, wxConnection, wxClient
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_ipc_datatransfer
|
|
||||||
@li @ref overview_ipc_examples
|
|
||||||
@li @ref overview_ipc_dde
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
wxWidgets has a number of different classes to help with interprocess
|
wxWidgets has a number of different classes to help with interprocess
|
||||||
communication and network programming. This section only discusses one family
|
communication and network programming. This section only discusses one family
|
||||||
@@ -216,4 +208,3 @@ connection->StartAdvise("Item");
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,9 +10,10 @@
|
|||||||
|
|
||||||
@page overview_listctrl wxListCtrl Overview
|
@page overview_listctrl wxListCtrl Overview
|
||||||
|
|
||||||
Classes: wxListCtrl, wxImageList
|
@tableofcontents
|
||||||
|
|
||||||
@todo Sorry, this topic hasn't been written yet.
|
@todo The wxListCtrl topic overview still needs to be written, sorry.
|
||||||
|
|
||||||
|
@see wxListCtrl, wxImageList, wxListItem
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -8,22 +8,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@page overview_log wxLog Classes Overview
|
@page overview_log Logging Overview
|
||||||
|
|
||||||
Classes: wxLog, wxLogStderr, wxLogStream, wxLogTextCtrl, wxLogWindow, wxLogGui, wxLogNull, wxLogBuffer,
|
@tableofcontents
|
||||||
wxLogChain, wxLogInterposer, wxLogInterposerTemp, wxStreamToTextRedirector, wxLogFormatter
|
|
||||||
|
|
||||||
Table of contents:
|
|
||||||
@li @ref overview_log_introduction
|
|
||||||
@li @ref overview_log_enable
|
|
||||||
@li @ref overview_log_targets
|
|
||||||
@li @ref overview_log_mt
|
|
||||||
@li @ref overview_log_customize
|
|
||||||
@li @ref overview_log_tracemasks
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_log_introduction Introduction
|
|
||||||
|
|
||||||
This is a general overview of logging classes provided by wxWidgets. The word
|
This is a general overview of logging classes provided by wxWidgets. The word
|
||||||
logging here has a broad sense, including all of the program output, not only
|
logging here has a broad sense, including all of the program output, not only
|
||||||
@@ -75,6 +62,8 @@ of arguments or a variable argument list pointer. Here are all of them:
|
|||||||
this function takes a trace mask as the first argument which allows to
|
this function takes a trace mask as the first argument which allows to
|
||||||
further restrict the amount of messages generated.
|
further restrict the amount of messages generated.
|
||||||
|
|
||||||
|
@see @ref group_funcmacro_log "Logging Functions and Macros"
|
||||||
|
|
||||||
The usage of these functions should be fairly straightforward, however it may
|
The usage of these functions should be fairly straightforward, however it may
|
||||||
be asked why not use the other logging facilities, such as C standard stdio
|
be asked why not use the other logging facilities, such as C standard stdio
|
||||||
functions or C++ streams. The short answer is that they're all very good
|
functions or C++ streams. The short answer is that they're all very good
|
||||||
@@ -111,6 +100,7 @@ classes are. Some of advantages in using wxWidgets log functions are:
|
|||||||
about data file writing error.
|
about data file writing error.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_log_enable Log Messages Selection
|
@section overview_log_enable Log Messages Selection
|
||||||
|
|
||||||
By default, most log messages are enabled. In particular, this means that
|
By default, most log messages are enabled. In particular, this means that
|
||||||
@@ -141,24 +131,28 @@ you could give it the value "MyProgram" by default and re-define it as
|
|||||||
"MyProgram/DB" in the module working with the database and "MyProgram/DB/Trans"
|
"MyProgram/DB" in the module working with the database and "MyProgram/DB/Trans"
|
||||||
in its part managing the transactions. Then you could use
|
in its part managing the transactions. Then you could use
|
||||||
wxLog::SetComponentLevel() in the following ways:
|
wxLog::SetComponentLevel() in the following ways:
|
||||||
@code
|
|
||||||
// disable all database error messages, everybody knows databases never
|
|
||||||
// fail anyhow
|
|
||||||
wxLog::SetComponentLevel("MyProgram/DB", wxLOG_FatalError);
|
|
||||||
|
|
||||||
// but enable tracing for the transactions as somehow our changes don't
|
@code
|
||||||
// get committed sometimes
|
// disable all database error messages, everybody knows databases never
|
||||||
wxLog::SetComponentLevel("MyProgram/DB/Trans", wxLOG_Trace);
|
// fail anyhow
|
||||||
|
wxLog::SetComponentLevel("MyProgram/DB", wxLOG_FatalError);
|
||||||
|
|
||||||
|
// but enable tracing for the transactions as somehow our changes don't
|
||||||
|
// get committed sometimes
|
||||||
|
wxLog::SetComponentLevel("MyProgram/DB/Trans", wxLOG_Trace);
|
||||||
|
|
||||||
|
// also enable tracing messages from wxWidgets dynamic module loading
|
||||||
|
// mechanism
|
||||||
|
wxLog::SetComponentLevel("wx/base/module", wxLOG_Trace);
|
||||||
|
@endcode
|
||||||
|
|
||||||
// also enable tracing messages from wxWidgets dynamic module loading
|
|
||||||
// mechanism
|
|
||||||
wxLog::SetComponentLevel("wx/base/module", wxLOG_Trace);
|
|
||||||
@endcode
|
|
||||||
Notice that the log level set explicitly for the transactions code overrides
|
Notice that the log level set explicitly for the transactions code overrides
|
||||||
the log level of the parent component but that all other database code
|
the log level of the parent component but that all other database code
|
||||||
subcomponents inherit its setting by default and so won't generate any log
|
subcomponents inherit its setting by default and so won't generate any log
|
||||||
messages at all.
|
messages at all.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_log_targets Log Targets
|
@section overview_log_targets Log Targets
|
||||||
|
|
||||||
After having enumerated all the functions which are normally used to log the
|
After having enumerated all the functions which are normally used to log the
|
||||||
@@ -170,8 +164,9 @@ from wxLog. As such, it implements the virtual functions of the base class
|
|||||||
which are called when a message is logged. Only one log target is @e active at
|
which are called when a message is logged. Only one log target is @e active at
|
||||||
any moment, this is the one used by @ref group_funcmacro_log "wxLogXXX() functions".
|
any moment, this is the one used by @ref group_funcmacro_log "wxLogXXX() functions".
|
||||||
The normal usage of a log object (i.e. object of a class derived from wxLog) is
|
The normal usage of a log object (i.e. object of a class derived from wxLog) is
|
||||||
to install it as the active target with a call to @e SetActiveTarget() and it will be used
|
to install it as the active target with a call to @e SetActiveTarget() and it
|
||||||
automatically by all subsequent calls to @ref group_funcmacro_log "wxLogXXX() functions".
|
will be used automatically by all subsequent calls to
|
||||||
|
@ref group_funcmacro_log "wxLogXXX() functions".
|
||||||
|
|
||||||
To create a new log target class you only need to derive it from wxLog and
|
To create a new log target class you only need to derive it from wxLog and
|
||||||
override one or several of wxLog::DoLogRecord(), wxLog::DoLogTextAtLevel() and
|
override one or several of wxLog::DoLogRecord(), wxLog::DoLogTextAtLevel() and
|
||||||
@@ -184,7 +179,6 @@ formatting. Finally, it is enough to override wxLog::DoLogText() if you only
|
|||||||
want to redirect the log messages and the destination doesn't depend on the
|
want to redirect the log messages and the destination doesn't depend on the
|
||||||
message log level.
|
message log level.
|
||||||
|
|
||||||
|
|
||||||
There are some predefined classes deriving from wxLog and which might be
|
There are some predefined classes deriving from wxLog and which might be
|
||||||
helpful to see how you can create a new log target class and, of course, may
|
helpful to see how you can create a new log target class and, of course, may
|
||||||
also be used without any change. There are:
|
also be used without any change. There are:
|
||||||
@@ -222,12 +216,15 @@ also be used without any change. There are:
|
|||||||
wxLogMessage("..."); // ok
|
wxLogMessage("..."); // ok
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
@see @ref group_class_logging "Logging Classes"
|
||||||
|
|
||||||
The log targets can also be combined: for example you may wish to redirect the
|
The log targets can also be combined: for example you may wish to redirect the
|
||||||
messages somewhere else (for example, to a log file) but also process them as
|
messages somewhere else (for example, to a log file) but also process them as
|
||||||
normally. For this the wxLogChain, wxLogInterposer, and wxLogInterposerTemp can
|
normally. For this the wxLogChain, wxLogInterposer, and wxLogInterposerTemp can
|
||||||
be used.
|
be used.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_log_mt Logging in Multi-Threaded Applications
|
@section overview_log_mt Logging in Multi-Threaded Applications
|
||||||
|
|
||||||
Starting with wxWidgets 2.9.1, logging functions can be safely called from any
|
Starting with wxWidgets 2.9.1, logging functions can be safely called from any
|
||||||
@@ -247,6 +244,7 @@ affect the current thread, i.e. logging messages may still be generated by the
|
|||||||
other threads after a call to @c EnableLogging(false).
|
other threads after a call to @c EnableLogging(false).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_log_customize Logging Customization
|
@section overview_log_customize Logging Customization
|
||||||
|
|
||||||
To completely change the logging behaviour you may define a custom log target.
|
To completely change the logging behaviour you may define a custom log target.
|
||||||
@@ -294,7 +292,7 @@ The @e dialog sample illustrates this approach by defining a custom log target
|
|||||||
customizing the dialog used by wxLogGui for the single messages.
|
customizing the dialog used by wxLogGui for the single messages.
|
||||||
|
|
||||||
|
|
||||||
@section overview_log_tracemasks Using trace masks
|
@section overview_log_tracemasks Using Trace Masks
|
||||||
|
|
||||||
Notice that the use of log trace masks is hardly necessary any longer in
|
Notice that the use of log trace masks is hardly necessary any longer in
|
||||||
current wxWidgets version as the same effect can be achieved by using
|
current wxWidgets version as the same effect can be achieved by using
|
||||||
@@ -328,4 +326,3 @@ wxLog::AddTraceMask( wxTRACE_OleCalls );
|
|||||||
The standard trace masks are given in wxLogTrace() documentation.
|
The standard trace masks are given in wxLogTrace() documentation.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,23 +10,14 @@
|
|||||||
|
|
||||||
@page overview_mbconv wxMBConv Overview
|
@page overview_mbconv wxMBConv Overview
|
||||||
|
|
||||||
Classes: wxMBConv, wxMBConvLibc, wxMBConvUTF7, wxMBConvUTF8, wxCSConv,
|
@tableofcontents
|
||||||
wxMBConvUTF16, wxMBConvUTF32
|
|
||||||
|
|
||||||
The wxMBConv classes in wxWidgets enable an Unicode-aware application to easily
|
The wxMBConv classes in wxWidgets enable an Unicode-aware application to easily
|
||||||
convert between Unicode and the variety of 8-bit encoding systems still in use.
|
convert between Unicode and the variety of 8-bit encoding systems still in use.
|
||||||
|
|
||||||
@li @ref overview_mbconv_need
|
@see @ref group_class_conv
|
||||||
@li @ref overview_mbconv_string
|
|
||||||
@li @ref overview_mbconv_classes
|
|
||||||
@li @ref overview_mbconv_objects
|
|
||||||
@li @ref overview_mbconv_csconv
|
|
||||||
@li @ref overview_mbconv_converting
|
|
||||||
@li @ref overview_mbconv_buffers
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_mbconv_need Background: The Need for Conversion
|
@section overview_mbconv_need Background: The Need for Conversion
|
||||||
|
|
||||||
@@ -190,4 +181,3 @@ reflects the correct return value of cWX2MB (either char* or wxCharBuffer),
|
|||||||
except for the const.
|
except for the const.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,16 +10,7 @@
|
|||||||
|
|
||||||
@page overview_nonenglish Writing Non-English Applications
|
@page overview_nonenglish Writing Non-English Applications
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
@li @ref overview_nonenglish_locales
|
|
||||||
@li @ref overview_nonenglish_strings
|
|
||||||
@li @ref overview_nonenglish_fontmapping
|
|
||||||
@li @ref overview_nonenglish_converting
|
|
||||||
@li @ref overview_nonenglish_help
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
This article describes how to write applications that communicate with the user
|
This article describes how to write applications that communicate with the user
|
||||||
in a language other than English. Unfortunately many languages use different
|
in a language other than English. Unfortunately many languages use different
|
||||||
@@ -39,6 +30,7 @@ In the following text, wherever @e iso8859-2 and @e windows-1250 are used, any
|
|||||||
encodings are meant and any encodings may be substituted there.
|
encodings are meant and any encodings may be substituted there.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_nonenglish_locales Locales
|
@section overview_nonenglish_locales Locales
|
||||||
|
|
||||||
The best way to ensure correctly displayed texts in a GUI across platforms is
|
The best way to ensure correctly displayed texts in a GUI across platforms is
|
||||||
@@ -174,4 +166,3 @@ This additional entry tells the HTML help controller what encoding is used in
|
|||||||
contents and index tables.
|
contents and index tables.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
@page overview_persistence Persistent Objects Overview
|
@page overview_persistence Persistent Objects Overview
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
Persistent objects are simply the objects which automatically save their state
|
Persistent objects are simply the objects which automatically save their state
|
||||||
when they are destroyed and restore it when they are recreated, even during
|
when they are destroyed and restore it when they are recreated, even during
|
||||||
another program invocation.
|
another program invocation.
|
||||||
@@ -23,53 +25,56 @@ persistence is implemented in a non-intrusive way so that the original object
|
|||||||
class doesn't need to be modified at all in order to add support for saving and
|
class doesn't need to be modified at all in order to add support for saving and
|
||||||
restoring its properties.
|
restoring its properties.
|
||||||
|
|
||||||
The persistence framework involves
|
The persistence framework includes the following components:
|
||||||
- wxPersistenceManager which all persistent objects register themselves with.
|
|
||||||
This class handles actual saving and restoring of persistent data as well as
|
- wxPersistenceManager which all persistent objects register themselves with.
|
||||||
various global aspects of persistence, e.g. it can be used to disable
|
This class handles actual saving and restoring of persistent data as well as
|
||||||
restoring the saved data.
|
various global aspects of persistence, e.g. it can be used to disable
|
||||||
- wxPersistentObject is the base class for all persistent objects or, rather,
|
restoring the saved data.
|
||||||
adaptors for the persistent objects as this class main purpose is to provide
|
- wxPersistentObject is the base class for all persistent objects or, rather,
|
||||||
the bridge between the original class -- which has no special persistence
|
adaptors for the persistent objects as this class main purpose is to provide
|
||||||
support -- and wxPersistenceManager,
|
the bridge between the original class -- which has no special persistence
|
||||||
- wxPersistentWindow<> which derives from wxPersistentObject and implements some
|
support -- and wxPersistenceManager,
|
||||||
of its methods using wxWindow-specific functionality. Notably,
|
- wxPersistentWindow<> which derives from wxPersistentObject and implements some
|
||||||
wxPersistenceManager handles the destruction of persistent windows
|
of its methods using wxWindow-specific functionality. Notably,
|
||||||
automatically implicitly while it has to be done explicitly for the
|
wxPersistenceManager handles the destruction of persistent windows
|
||||||
arbitrary persistent objects.
|
automatically implicitly while it has to be done explicitly for the
|
||||||
- wxCreatePersistentObject() function which is used to create the
|
arbitrary persistent objects.
|
||||||
appropriate persistence adapter for the object.
|
- wxCreatePersistentObject() function which is used to create the
|
||||||
|
appropriate persistence adapter for the object.
|
||||||
|
|
||||||
|
|
||||||
@section persistence_using Using Persistent Windows
|
@section persistence_using Using Persistent Windows
|
||||||
|
|
||||||
wxWidgets has built-in support for a (constantly growing) number of controls.
|
wxWidgets has built-in support for a (constantly growing) number of controls.
|
||||||
Currently the following classes are supported:
|
Currently the following classes are supported:
|
||||||
- wxTopLevelWindow (and hence wxFrame and wxDialog)
|
|
||||||
- wxBookCtrlBase, i.e. wxNotebook, wxListbook, wxToolbook and wxChoicebook
|
- wxTopLevelWindow (and hence wxFrame and wxDialog)
|
||||||
- wxTreebook
|
- wxBookCtrlBase (i.e. wxNotebook, wxListbook, wxToolbook and wxChoicebook)
|
||||||
|
- wxTreebook
|
||||||
|
|
||||||
To automatically save and restore the properties of the windows of classes
|
To automatically save and restore the properties of the windows of classes
|
||||||
listed above you need to
|
listed above you need to:
|
||||||
|
|
||||||
-# Set a unique name for the window using wxWindow::SetName(): this step is
|
-# Set a unique name for the window using wxWindow::SetName(): this step is
|
||||||
important as the name is used in the configuration file and so must be
|
important as the name is used in the configuration file and so must be
|
||||||
unique among all windows of the same class.
|
unique among all windows of the same class.
|
||||||
-# Call wxPersistenceManager::Register() at any moment after creating the
|
-# Call wxPersistenceManager::Register() at any moment after creating the
|
||||||
window and then wxPersistenceManager::Restore() when the settings may be
|
window and then wxPersistenceManager::Restore() when the settings may be
|
||||||
restored (which can't be always done immediately, e.g. often the window
|
restored (which can't be always done immediately, e.g. often the window
|
||||||
needs to be populated first). If settings can be restored immediately after
|
needs to be populated first). If settings can be restored immediately after
|
||||||
the window creation, as is often the case for wxTopLevelWindow, for
|
the window creation, as is often the case for wxTopLevelWindow, for
|
||||||
example, then wxPersistenceManager::RegisterAndRestore() can be used to do
|
example, then wxPersistenceManager::RegisterAndRestore() can be used to do
|
||||||
both at once.
|
both at once.
|
||||||
-# If you do not want the settings for the window to be saved (for example
|
-# If you do not want the settings for the window to be saved (for example
|
||||||
the changes to the dialog size are usually not saved if the dialog was
|
the changes to the dialog size are usually not saved if the dialog was
|
||||||
cancelled), you need to call wxPersistenceManager::Unregister() manually.
|
cancelled), you need to call wxPersistenceManager::Unregister() manually.
|
||||||
Otherwise the settings will be automatically saved when the control itself
|
Otherwise the settings will be automatically saved when the control itself
|
||||||
is destroyed.
|
is destroyed.
|
||||||
|
|
||||||
Example of using a notebook control which automatically remembers the last open
|
Example of using a notebook control which automatically remembers the last open
|
||||||
page:
|
page:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
wxNotebook *book = new wxNotebook(parent, wxID_ANY);
|
wxNotebook *book = new wxNotebook(parent, wxID_ANY);
|
||||||
book->SetName("MyBook"); // do not use the default name
|
book->SetName("MyBook"); // do not use the default name
|
||||||
@@ -89,15 +94,15 @@ page:
|
|||||||
User-defined classes can be easily integrated with wxPersistenceManager. To add
|
User-defined classes can be easily integrated with wxPersistenceManager. To add
|
||||||
support for your custom class @c MyWidget you just need to:
|
support for your custom class @c MyWidget you just need to:
|
||||||
|
|
||||||
-# Define a new @c MyPersistentWidget class inheriting from
|
-# Define a new @c MyPersistentWidget class inheriting from
|
||||||
wxPersistentWindow<MyWidget>.
|
wxPersistentWindow<MyWidget>.
|
||||||
-# Implement its pure virtual GetKind() method returning a unique string
|
-# Implement its pure virtual GetKind() method returning a unique string
|
||||||
identifying all @c MyWidget objects, typically something like @c "widget"
|
identifying all @c MyWidget objects, typically something like @c "widget"
|
||||||
-# Implement its pure virtual Save() and Restore() methods to actually save
|
-# Implement its pure virtual Save() and Restore() methods to actually save
|
||||||
and restore the widget settings using wxPersistentObject::SaveValue() and
|
and restore the widget settings using wxPersistentObject::SaveValue() and
|
||||||
wxPersistentObject::RestoreValue() methods.
|
wxPersistentObject::RestoreValue() methods.
|
||||||
-# Define wxCreatePersistentObject() overload taking @c MyWidget * and
|
-# Define wxCreatePersistentObject() overload taking @c MyWidget * and
|
||||||
returning a new @c MyPersistentWidget object.
|
returning a new @c MyPersistentWidget object.
|
||||||
|
|
||||||
If you want to add persistence support for a class not deriving from wxWindow,
|
If you want to add persistence support for a class not deriving from wxWindow,
|
||||||
you need to derive @c MyPersistentWidget directly from wxPersistentObject and
|
you need to derive @c MyPersistentWidget directly from wxPersistentObject and
|
||||||
@@ -106,5 +111,4 @@ Additionally, you must ensure that wxPersistenceManager::SaveAndUnregister() is
|
|||||||
called when your object is destroyed as this can be only done automatically for
|
called when your object is destroyed as this can be only done automatically for
|
||||||
windows.
|
windows.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,33 +10,7 @@
|
|||||||
|
|
||||||
@page overview_printing Printing Framework Overview
|
@page overview_printing Printing Framework Overview
|
||||||
|
|
||||||
Classes:
|
@tableofcontents
|
||||||
@li wxPrintout
|
|
||||||
@li wxPrinter
|
|
||||||
@li wxPrintPreview
|
|
||||||
@li wxPrinterDC
|
|
||||||
@li wxPostScriptDC
|
|
||||||
@li wxPrintDialog
|
|
||||||
@li wxPrintData
|
|
||||||
@li wxPrintDialogData
|
|
||||||
@li wxPageSetupDialog
|
|
||||||
@li wxPageSetupDialogData
|
|
||||||
|
|
||||||
|
|
||||||
@li @ref overview_printing_printout
|
|
||||||
@li @ref overview_printing_printer
|
|
||||||
@li @ref overview_printing_printpreview
|
|
||||||
@li @ref overview_printing_printerdc
|
|
||||||
@li @ref overview_printing_postscriptdc
|
|
||||||
@li @ref overview_printing_printdialog
|
|
||||||
@li @ref overview_printing_printdata
|
|
||||||
@li @ref overview_printing_printdialogdata
|
|
||||||
@li @ref overview_printing_pagesetupdialog
|
|
||||||
@li @ref overview_printing_pagesetupdialogdata
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
The printing framework relies on the application to provide classes whose
|
The printing framework relies on the application to provide classes whose
|
||||||
member functions can respond to particular requests, such as 'print this page'
|
member functions can respond to particular requests, such as 'print this page'
|
||||||
@@ -53,6 +27,8 @@ A brief description of each class's role and how they work together follows.
|
|||||||
For the special case of printing under Unix, where various different printing
|
For the special case of printing under Unix, where various different printing
|
||||||
backends have to be offered, please have a look at @ref overview_unixprinting.
|
backends have to be offered, please have a look at @ref overview_unixprinting.
|
||||||
|
|
||||||
|
@see @ref group_class_printing
|
||||||
|
|
||||||
|
|
||||||
@section overview_printing_printout wxPrintout
|
@section overview_printing_printout wxPrintout
|
||||||
|
|
||||||
@@ -227,4 +203,3 @@ range (from the wxPrintDialogData) or the paper size and/or page orientation
|
|||||||
(from the wxPageSetupDialogData).
|
(from the wxPageSetupDialogData).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,42 +10,22 @@
|
|||||||
|
|
||||||
@page overview_propgrid wxPropertyGrid Overview
|
@page overview_propgrid wxPropertyGrid Overview
|
||||||
|
|
||||||
Key Classes:
|
@tableofcontents
|
||||||
@li wxPGProperty
|
|
||||||
@li wxPropertyGrid
|
|
||||||
@li wxPropertyGridEvent
|
|
||||||
@li wxPropertyGridManager
|
|
||||||
@li wxPropertyGridPage
|
|
||||||
|
|
||||||
wxPropertyGrid is a specialized grid for editing properties - in other
|
wxPropertyGrid is a specialized grid for editing properties - in other words
|
||||||
words name = value pairs. List of ready-to-use property classes include
|
name = value pairs. List of ready-to-use property classes include strings,
|
||||||
strings, numbers, flag sets, fonts, colours and many others. It is possible,
|
numbers, flag sets, fonts, colours and many others. It is possible, for
|
||||||
for example, to categorize properties, set up a complete tree-hierarchy,
|
example, to categorize properties, set up a complete tree-hierarchy, add more
|
||||||
add more than two columns, and set arbitrary per-property attributes.
|
than two columns, and set arbitrary per-property attributes.
|
||||||
|
|
||||||
|
As this version of wxPropertyGrid has some backward-incompatible changes from
|
||||||
|
version 1.4, everybody who need to maintain custom property classes should
|
||||||
|
carefully read final section in @ref propgrid_compat.
|
||||||
|
|
||||||
|
@see wxPropertyGrid, wxPropertyGridEvent, wxPropertyGridManager,
|
||||||
|
wxPropertyGridPage, wxPGProperty
|
||||||
|
|
||||||
As this version of wxPropertyGrid has some backward-incompatible changes
|
|
||||||
from version 1.4, everybody who need to maintain custom property classes
|
|
||||||
should carefully read final section in @ref propgrid_compat.
|
|
||||||
|
|
||||||
@li @ref propgrid_basics
|
|
||||||
@li @ref propgrid_categories
|
|
||||||
@li @ref propgrid_parentprops
|
|
||||||
@li @ref propgrid_enumandflags
|
|
||||||
@li @ref propgrid_advprops
|
|
||||||
@li @ref propgrid_processingvalues
|
|
||||||
@li @ref propgrid_iterating
|
|
||||||
@li @ref propgrid_events
|
|
||||||
@li @ref propgrid_tooltipandhint
|
|
||||||
@li @ref propgrid_validating
|
|
||||||
@li @ref propgrid_populating
|
|
||||||
@li @ref propgrid_cellrender
|
|
||||||
@li @ref propgrid_keyhandling
|
|
||||||
@li @ref propgrid_customizing
|
|
||||||
@li @ref propgrid_usage2
|
|
||||||
@li @ref propgrid_subclassing
|
|
||||||
@li @ref propgrid_misc
|
|
||||||
@li @ref propgrid_proplist
|
|
||||||
@li @ref propgrid_compat
|
|
||||||
|
|
||||||
@section propgrid_basics Creating and Populating wxPropertyGrid
|
@section propgrid_basics Creating and Populating wxPropertyGrid
|
||||||
|
|
||||||
|
@@ -10,20 +10,11 @@
|
|||||||
|
|
||||||
@page overview_python wxPython Overview
|
@page overview_python wxPython Overview
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
This topic was written by Robin Dunn, author of the
|
This topic was written by Robin Dunn, author of the
|
||||||
<a href="http://www.python.org/">wxPython</a> wrapper.
|
<a href="http://www.python.org/">wxPython</a> wrapper.
|
||||||
|
|
||||||
@li @ref overview_python_what
|
|
||||||
@li @ref overview_python_why
|
|
||||||
@li @ref overview_python_othergui
|
|
||||||
@li @ref overview_python_using
|
|
||||||
@li @ref overview_python_classes
|
|
||||||
@li @ref overview_python_help
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_python_what What is wxPython?
|
@section overview_python_what What is wxPython?
|
||||||
|
|
||||||
wxPython is a blending of the wxWidgets GUI classes and the Python programming
|
wxPython is a blending of the wxWidgets GUI classes and the Python programming
|
||||||
@@ -466,4 +457,3 @@ Or you can send mail directly to the list using this address:
|
|||||||
wxpython-users@lists.wxwidgets.org
|
wxpython-users@lists.wxwidgets.org
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,17 +10,7 @@
|
|||||||
|
|
||||||
@page overview_refcount Reference Counting
|
@page overview_refcount Reference Counting
|
||||||
|
|
||||||
@li @ref overview_refcount_ignore
|
@tableofcontents
|
||||||
@li @ref overview_refcount_equality
|
|
||||||
@li @ref overview_refcount_destruct
|
|
||||||
@li @ref overview_refcount_list
|
|
||||||
@li @ref overview_refcount_object
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_refcount_ignore Why You Shouldn't Care About It
|
|
||||||
|
|
||||||
Many wxWidgets objects use a technique known as <em>reference counting</em>,
|
Many wxWidgets objects use a technique known as <em>reference counting</em>,
|
||||||
also known as <em>copy on write</em> (COW). This means that when an object is
|
also known as <em>copy on write</em> (COW). This means that when an object is
|
||||||
@@ -97,20 +87,20 @@ operators and copy constructors since they are reference-counted:
|
|||||||
Note that the list above reports the objects which are reference counted in all
|
Note that the list above reports the objects which are reference counted in all
|
||||||
ports of wxWidgets; some ports may use this technique also for other classes.
|
ports of wxWidgets; some ports may use this technique also for other classes.
|
||||||
|
|
||||||
All the objects implement a function @b IsOk() to test if they are referencing valid
|
All the objects implement a function @b IsOk() to test if they are referencing
|
||||||
data; when the objects are in uninitialized state, you can only use the @b IsOk() getter;
|
valid data; when the objects are in uninitialized state, you can only use the
|
||||||
trying to call any other getter, e.g. wxBrush::GetStyle() on the ::wxNullBrush object,
|
@b IsOk() getter; trying to call any other getter, e.g. wxBrush::GetStyle() on
|
||||||
will result in an assert failure in debug builds.
|
the ::wxNullBrush object, will result in an assert failure in debug builds.
|
||||||
|
|
||||||
|
|
||||||
@section overview_refcount_object Making Your Own Reference Counted Class
|
@section overview_refcount_object Making Your Own Reference Counted Class
|
||||||
|
|
||||||
Reference counting can be implemented easily using wxObject or using
|
Reference counting can be implemented easily using wxObject or using the
|
||||||
the intermediate wxRefCounter class directly.
|
intermediate wxRefCounter class directly. Alternatively, you can also use the
|
||||||
Alternatively, you can also use the wxObjectDataPtr<T> template.
|
wxObjectDataPtr<T> template.
|
||||||
|
|
||||||
First, derive a new class from wxRefCounter (or wxObjectRefData when
|
First, derive a new class from wxRefCounter (or wxObjectRefData when using a
|
||||||
using a wxObject derived class) and put the memory-consuming data in it.
|
wxObject derived class) and put the memory-consuming data in it.
|
||||||
|
|
||||||
Then derive a new class from wxObject and implement there the public interface
|
Then derive a new class from wxObject and implement there the public interface
|
||||||
which will be seen by the user of your class. You'll probably want to add a
|
which will be seen by the user of your class. You'll probably want to add a
|
||||||
@@ -133,4 +123,3 @@ that the modifications won't affect other instances which are eventually
|
|||||||
sharing your object's data.
|
sharing your object's data.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_referencenotes Notes on Using this Reference Manual
|
@page overview_referencenotes Notes on Using this Reference Manual
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
In the descriptions of the wxWidgets classes and their member functions, note
|
In the descriptions of the wxWidgets classes and their member functions, note
|
||||||
that descriptions of inherited member functions are not duplicated in derived
|
that descriptions of inherited member functions are not duplicated in derived
|
||||||
classes unless their behaviour is different. So in using a class such as
|
classes unless their behaviour is different. So in using a class such as
|
||||||
@@ -20,4 +22,3 @@ value of ::wxDefaultSize and ::wxDefaultPosition, in which case wxWidgets will
|
|||||||
choose suitable values.
|
choose suitable values.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,25 +10,13 @@
|
|||||||
|
|
||||||
@page overview_resyntax Regular Expressions
|
@page overview_resyntax Regular Expressions
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
A <em>regular expression</em> describes strings of characters. It's a pattern
|
A <em>regular expression</em> describes strings of characters. It's a pattern
|
||||||
that matches certain strings and doesn't match others.
|
that matches certain strings and doesn't match others.
|
||||||
|
|
||||||
@li @ref overview_resyntax_differentflavors
|
@see wxRegEx
|
||||||
@li @ref overview_resyntax_syntax
|
|
||||||
@li @ref overview_resyntax_bracket
|
|
||||||
@li @ref overview_resyntax_escapes
|
|
||||||
@li @ref overview_resyntax_metasyntax
|
|
||||||
@li @ref overview_resyntax_matching
|
|
||||||
@li @ref overview_resyntax_limits
|
|
||||||
@li @ref overview_resyntax_bre
|
|
||||||
@li @ref overview_resyntax_characters
|
|
||||||
|
|
||||||
@see
|
|
||||||
|
|
||||||
@li wxRegEx
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_resyntax_differentflavors Different Flavors of Regular Expressions
|
@section overview_resyntax_differentflavors Different Flavors of Regular Expressions
|
||||||
@@ -662,4 +650,3 @@ Note that the character names are case sensitive.
|
|||||||
</tr></table></center>
|
</tr></table></center>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,48 +10,7 @@
|
|||||||
|
|
||||||
@page overview_richtextctrl wxRichTextCtrl Overview
|
@page overview_richtextctrl wxRichTextCtrl Overview
|
||||||
|
|
||||||
@li @ref overview_richtextctrl_classes
|
@tableofcontents
|
||||||
@li @ref overview_richtextctrl_intro
|
|
||||||
@li @ref overview_richtextctrl_example
|
|
||||||
@li @ref overview_richtextctrl_starting
|
|
||||||
@li @ref overview_richtextctrl_styles
|
|
||||||
@li @ref overview_richtextctrl_dialogs
|
|
||||||
@li @ref overview_richtextctrl_impl
|
|
||||||
@li @ref overview_richtextctrl_nested_object
|
|
||||||
@li @ref overview_richtextctrl_context_menus
|
|
||||||
@li @ref overview_richtextctrl_roadmap
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_richtextctrl_classes Related Classes
|
|
||||||
|
|
||||||
<b>Major classes:</b>
|
|
||||||
wxRichTextCtrl, wxRichTextBuffer, wxRichTextEvent
|
|
||||||
|
|
||||||
<b>Helper classes:</b>
|
|
||||||
wxTextAttr, wxRichTextRange
|
|
||||||
|
|
||||||
<b>File handler classes:</b>
|
|
||||||
wxRichTextFileHandler, wxRichTextHTMLHandler, wxRichTextXMLHandler
|
|
||||||
|
|
||||||
<b>Style classes:</b>
|
|
||||||
wxRichTextCharacterStyleDefinition, wxRichTextParagraphStyleDefinition,
|
|
||||||
wxRichTextListStyleDefinition, wxRichTextStyleSheet
|
|
||||||
|
|
||||||
<b>Additional controls:</b>
|
|
||||||
wxRichTextStyleComboCtrl, wxRichTextStyleListBox, wxRichTextStyleListCtrl
|
|
||||||
|
|
||||||
<b>Printing classes:</b>
|
|
||||||
wxRichTextPrinting, wxRichTextPrintout, wxRichTextHeaderFooterData
|
|
||||||
|
|
||||||
<b>Dialog classes:</b>
|
|
||||||
wxRichTextStyleOrganiserDialog, wxRichTextFormattingDialog,
|
|
||||||
wxSymbolPickerDialog
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_richtextctrl_intro Introduction
|
|
||||||
|
|
||||||
wxRichTextCtrl provides a generic implementation of a rich text editor that can
|
wxRichTextCtrl provides a generic implementation of a rich text editor that can
|
||||||
handle different character styles, paragraph formatting, and images. It's aimed
|
handle different character styles, paragraph formatting, and images. It's aimed
|
||||||
@@ -60,9 +19,9 @@ editing, wxStyledTextCtrl is a better choice.
|
|||||||
|
|
||||||
Despite its name, it cannot currently read or write RTF (rich text format)
|
Despite its name, it cannot currently read or write RTF (rich text format)
|
||||||
files. Instead, it uses its own XML format, and can also read and write plain
|
files. Instead, it uses its own XML format, and can also read and write plain
|
||||||
text. In future we expect to provide RTF or OpenDocument file capabilities. Custom file formats
|
text. In future we expect to provide RTF or OpenDocument file capabilities.
|
||||||
can be supported by creating additional file handlers and registering them with
|
Custom file formats can be supported by creating additional file handlers and
|
||||||
the control.
|
registering them with the control.
|
||||||
|
|
||||||
wxRichTextCtrl is largely compatible with the wxTextCtrl API, but extends it
|
wxRichTextCtrl is largely compatible with the wxTextCtrl API, but extends it
|
||||||
where necessary. The control can be used where the native rich text
|
where necessary. The control can be used where the native rich text
|
||||||
@@ -94,6 +53,33 @@ A good way to understand wxRichTextCtrl's capabilities is to compile and run
|
|||||||
the sample, @c samples/richtext, and browse the code.
|
the sample, @c samples/richtext, and browse the code.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section overview_richtextctrl_classes Related Classes
|
||||||
|
|
||||||
|
<b>Major classes:</b>
|
||||||
|
wxRichTextCtrl, wxRichTextBuffer, wxRichTextEvent
|
||||||
|
|
||||||
|
<b>Helper classes:</b>
|
||||||
|
wxTextAttr, wxRichTextRange
|
||||||
|
|
||||||
|
<b>File handler classes:</b>
|
||||||
|
wxRichTextFileHandler, wxRichTextHTMLHandler, wxRichTextXMLHandler
|
||||||
|
|
||||||
|
<b>Style classes:</b>
|
||||||
|
wxRichTextCharacterStyleDefinition, wxRichTextParagraphStyleDefinition,
|
||||||
|
wxRichTextListStyleDefinition, wxRichTextStyleSheet
|
||||||
|
|
||||||
|
<b>Additional controls:</b>
|
||||||
|
wxRichTextStyleComboCtrl, wxRichTextStyleListBox, wxRichTextStyleListCtrl
|
||||||
|
|
||||||
|
<b>Printing classes:</b>
|
||||||
|
wxRichTextPrinting, wxRichTextPrintout, wxRichTextHeaderFooterData
|
||||||
|
|
||||||
|
<b>Dialog classes:</b>
|
||||||
|
wxRichTextStyleOrganiserDialog, wxRichTextFormattingDialog,
|
||||||
|
wxSymbolPickerDialog
|
||||||
|
|
||||||
|
|
||||||
@section overview_richtextctrl_example Code Example
|
@section overview_richtextctrl_example Code Example
|
||||||
|
|
||||||
The following code is an example taken from the sample, and adds text and
|
The following code is an example taken from the sample, and adds text and
|
||||||
@@ -416,54 +402,65 @@ objects with the same style where just one would do. So a Defragment function
|
|||||||
is called when updating the control's display, to ensure that the minimum
|
is called when updating the control's display, to ensure that the minimum
|
||||||
number of objects is used.
|
number of objects is used.
|
||||||
|
|
||||||
|
|
||||||
@section overview_richtextctrl_nested_object Nested Objects
|
@section overview_richtextctrl_nested_object Nested Objects
|
||||||
|
|
||||||
wxRichTextCtrl supports nested objects such as text boxes and tables. To achieve
|
wxRichTextCtrl supports nested objects such as text boxes and tables. To
|
||||||
compatibility with the existing API, there is the concept of @e object @e focus.
|
achieve compatibility with the existing API, there is the concept of @e object
|
||||||
When the user clicks on a nested text box, the object focus is set to that
|
@e focus. When the user clicks on a nested text box, the object focus is set to
|
||||||
container object so all keyboard input and API functions apply to that
|
that container object so all keyboard input and API functions apply to that
|
||||||
container. The application can change the focus using wxRichTextCtrl::SetObjectFocus.
|
container. The application can change the focus using
|
||||||
Call this function with a @null parameter to set the focus back to the top-level
|
wxRichTextCtrl::SetObjectFocus. Call this function with a @c null parameter to
|
||||||
object.
|
set the focus back to the top-level object.
|
||||||
|
|
||||||
An event will be sent to the control when the focus changes.
|
An event will be sent to the control when the focus changes.
|
||||||
|
|
||||||
When the user clicks on the control, wxRichTextCtrl determines which container to set
|
When the user clicks on the control, wxRichTextCtrl determines which container
|
||||||
as the current object focus by calling the found container's overrided wxRichTextObject::AcceptsFocus
|
to set as the current object focus by calling the found container's overrided
|
||||||
function. For example, although a table is a container, it must not itself be
|
wxRichTextObject::AcceptsFocus function. For example, although a table is a
|
||||||
the object focus because there is no text editing at the table level. Instead, a cell
|
container, it must not itself be the object focus because there is no text
|
||||||
within the table must accept the focus.
|
editing at the table level. Instead, a cell within the table must accept the
|
||||||
|
focus.
|
||||||
|
|
||||||
Since with nested objects it is not possible to represent a section with merely
|
Since with nested objects it is not possible to represent a section with merely
|
||||||
a start position and an end position, the class wxRichTextSelection is provided
|
a start position and an end position, the class wxRichTextSelection is provided
|
||||||
which stores multiple ranges (for non-contiguous selections such as table cells) and
|
which stores multiple ranges (for non-contiguous selections such as table
|
||||||
a pointer to the container object in question. You can pass wxRichTextSelection
|
cells) and a pointer to the container object in question. You can pass
|
||||||
to wxRichTextCtrl::SetSelection or get an instance of it from wxRichTextCtrl::GetSelection.
|
wxRichTextSelection to wxRichTextCtrl::SetSelection or get an instance of it
|
||||||
|
from wxRichTextCtrl::GetSelection.
|
||||||
|
|
||||||
When selecting multiple objects, such as cell tables, the wxRichTextCtrl dragging handler code calls the
|
When selecting multiple objects, such as cell tables, the wxRichTextCtrl
|
||||||
function wxRichTextObject::HandlesChildSelections to determine whether the children
|
dragging handler code calls the function
|
||||||
can be individual selections. Currently only table cells can be multiply-selected
|
wxRichTextObject::HandlesChildSelections to determine whether the children can
|
||||||
|
be individual selections. Currently only table cells can be multiply-selected
|
||||||
in this way.
|
in this way.
|
||||||
|
|
||||||
@section overview_richtextctrl_context_menus Context menus and property dialogs
|
|
||||||
|
|
||||||
There are three ways you can make use of context menus: you can let wxRichTextCtrl handle everything and provide a basic menu;
|
@section overview_richtextctrl_context_menus Context Menus and Property Dialogs
|
||||||
you can set your own context menu using wxRichTextCtrl::SetContextMenu but let wxRichTextCtrl handle showing it and adding property items;
|
|
||||||
or you can override the default context menu behaviour by adding a context menu event handler
|
|
||||||
to your class in the normal way.
|
|
||||||
|
|
||||||
If you right-click over a text box in cell in a table, you may want to edit the properties of
|
There are three ways you can make use of context menus: you can let
|
||||||
one of these objects - but which properties will you be editing?
|
wxRichTextCtrl handle everything and provide a basic menu; you can set your own
|
||||||
|
context menu using wxRichTextCtrl::SetContextMenu but let wxRichTextCtrl handle
|
||||||
|
showing it and adding property items; or you can override the default context
|
||||||
|
menu behaviour by adding a context menu event handler to your class in the
|
||||||
|
normal way.
|
||||||
|
|
||||||
Well, the default behaviour allows up to three property-editing menu items simultaneously - for the object clicked on,
|
If you right-click over a text box in cell in a table, you may want to edit the
|
||||||
the container of that object, and the container's parent (depending on whether any of these
|
properties of one of these objects - but which properties will you be editing?
|
||||||
objects return @true from their wxRichTextObject::CanEditProperties functions).
|
|
||||||
If you supply a context menu, add a property command item using the wxID_RICHTEXT_PROPERTIES1 identifier,
|
Well, the default behaviour allows up to three property-editing menu items
|
||||||
so that wxRichTextCtrl can find the position to add command items. The object should
|
simultaneously - for the object clicked on, the container of that object, and
|
||||||
tell the control what label to use by returning a string from wxRichTextObject::GetPropertiesMenuLabel.
|
the container's parent (depending on whether any of these objects return @true
|
||||||
|
from their wxRichTextObject::CanEditProperties functions). If you supply a
|
||||||
|
context menu, add a property command item using the wxID_RICHTEXT_PROPERTIES1
|
||||||
|
identifier, so that wxRichTextCtrl can find the position to add command items.
|
||||||
|
The object should tell the control what label to use by returning a string from
|
||||||
|
wxRichTextObject::GetPropertiesMenuLabel.
|
||||||
|
|
||||||
|
Since there may be several property-editing commands showing, it is recommended
|
||||||
|
that you don't include the word Properties - just the name of the object, such
|
||||||
|
as Text Box or Table.
|
||||||
|
|
||||||
Since there may be several property-editing commands showing, it is recommended that you don't
|
|
||||||
include the word Properties - just the name of the object, such as Text Box or Table.
|
|
||||||
|
|
||||||
@section overview_richtextctrl_roadmap Development Roadmap
|
@section overview_richtextctrl_roadmap Development Roadmap
|
||||||
|
|
||||||
@@ -504,4 +501,3 @@ high level to low level wxDC API is unnecessary. However this would require
|
|||||||
additions to the wxWidgets API.
|
additions to the wxWidgets API.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_roughguide A Quick Guide to Writing Applications
|
@page overview_roughguide A Quick Guide to Writing Applications
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
To set a wxWidgets application going, you will need to derive a wxApp class and
|
To set a wxWidgets application going, you will need to derive a wxApp class and
|
||||||
override wxApp::OnInit.
|
override wxApp::OnInit.
|
||||||
|
|
||||||
@@ -54,9 +56,6 @@ platform-independent @ref group_funcmacro_file, and you may find it handy to
|
|||||||
maintain and search a list of paths using wxPathList. There's many
|
maintain and search a list of paths using wxPathList. There's many
|
||||||
@ref group_funcmacro_misc of operating system methods and other functions.
|
@ref group_funcmacro_misc of operating system methods and other functions.
|
||||||
|
|
||||||
@see
|
@see @ref group_class
|
||||||
|
|
||||||
@li @ref group_class
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,20 +10,7 @@
|
|||||||
|
|
||||||
@page overview_rtti Runtime Type Information (RTTI)
|
@page overview_rtti Runtime Type Information (RTTI)
|
||||||
|
|
||||||
@li @ref overview_rtti_intro
|
@tableofcontents
|
||||||
@li @ref overview_rtti_classinfo
|
|
||||||
@li @ref overview_rtti_example
|
|
||||||
|
|
||||||
@see
|
|
||||||
|
|
||||||
@li wxObject
|
|
||||||
@li wxClassInfo
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_rtti_intro Introduction
|
|
||||||
|
|
||||||
One of the failings of C++ used to be that no runtime information was provided
|
One of the failings of C++ used to be that no runtime information was provided
|
||||||
about a class and its position in the inheritance hierarchy. Another, which
|
about a class and its position in the inheritance hierarchy. Another, which
|
||||||
@@ -72,6 +59,8 @@ The function wxCreateDynamicObject can be used to construct a new object of a
|
|||||||
given type, by supplying a string name. If you have a pointer to the
|
given type, by supplying a string name. If you have a pointer to the
|
||||||
wxClassInfo object instead, then you can simply call wxClassInfo::CreateObject.
|
wxClassInfo object instead, then you can simply call wxClassInfo::CreateObject.
|
||||||
|
|
||||||
|
@see wxObject
|
||||||
|
|
||||||
|
|
||||||
@section overview_rtti_classinfo wxClassInfo
|
@section overview_rtti_classinfo wxClassInfo
|
||||||
|
|
||||||
@@ -93,11 +82,6 @@ You can get the wxClassInfo for a class by using the CLASSINFO macro, e.g.
|
|||||||
CLASSINFO(wxFrame). You can get the wxClassInfo for an object using
|
CLASSINFO(wxFrame). You can get the wxClassInfo for an object using
|
||||||
wxObject::GetClassInfo.
|
wxObject::GetClassInfo.
|
||||||
|
|
||||||
@see
|
|
||||||
|
|
||||||
@li wxObject
|
|
||||||
@li wxCreateDynamicObject
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_rtti_example Example
|
@section overview_rtti_example Example
|
||||||
|
|
||||||
@@ -128,4 +112,3 @@ wxFrame::wxFrame()
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,13 +10,7 @@
|
|||||||
|
|
||||||
@page overview_scrolling Scrolled Windows
|
@page overview_scrolling Scrolled Windows
|
||||||
|
|
||||||
Classes: wxWindow, wxScrolledWindow, wxScrollBar
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_scrolling_model
|
|
||||||
@li @ref overview_scrolling_example
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
Scrollbars come in various guises in wxWidgets. All windows have the potential
|
Scrollbars come in various guises in wxWidgets. All windows have the potential
|
||||||
to show a vertical scrollbar and/or a horizontal scrollbar: it is a basic
|
to show a vertical scrollbar and/or a horizontal scrollbar: it is a basic
|
||||||
@@ -42,6 +36,8 @@ this, you would derive from wxWindow and implement scrolling yourself. wxGrid
|
|||||||
is an example of a class that implements its own scrolling, largely because
|
is an example of a class that implements its own scrolling, largely because
|
||||||
columns and rows can vary in size.
|
columns and rows can vary in size.
|
||||||
|
|
||||||
|
@see wxScrollBar
|
||||||
|
|
||||||
|
|
||||||
@section overview_scrolling_model The Scrollbar Model
|
@section overview_scrolling_model The Scrollbar Model
|
||||||
|
|
||||||
@@ -98,4 +94,3 @@ AdjustScrollbars, which can be called initially and also from your wxSizeEvent
|
|||||||
handler function.
|
handler function.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
@page overview_sizer Sizers Overview
|
@page overview_sizer Sizers Overview
|
||||||
|
|
||||||
Classes: wxSizer, wxBoxSizer, wxStaticBoxSizer, wxGridSizer, wxFlexGridSizer,
|
@tableofcontents
|
||||||
wxGridBagSizer
|
|
||||||
|
|
||||||
Sizers, as represented by the wxSizer class and its descendants in the
|
Sizers, as represented by the wxSizer class and its descendants in the
|
||||||
wxWidgets class hierarchy, have become the method of choice to define the
|
wxWidgets class hierarchy, have become the method of choice to define the
|
||||||
@@ -29,16 +28,10 @@ classes.
|
|||||||
For information about the wxWidgets resource system, which can describe
|
For information about the wxWidgets resource system, which can describe
|
||||||
sizer-based dialogs, see the @ref overview_xrc.
|
sizer-based dialogs, see the @ref overview_xrc.
|
||||||
|
|
||||||
@li @ref overview_sizer_idea
|
@see wxSizer, wxBoxSizer, wxStaticBoxSizer, wxGridSizer, wxFlexGridSizer,
|
||||||
@li @ref overview_sizer_features
|
wxGridBagSizer
|
||||||
@li @ref overview_sizer_hiding
|
|
||||||
@li @ref overview_sizer_box
|
|
||||||
@li @ref overview_sizer_types
|
|
||||||
@li @ref overview_sizer_button
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_sizer_idea The Idea Behind Sizers
|
@section overview_sizer_idea The Idea Behind Sizers
|
||||||
|
|
||||||
@@ -368,4 +361,3 @@ wxMORE // return wxID_MORE
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,12 +10,10 @@
|
|||||||
|
|
||||||
@page overview_splitterwindow wxSplitterWindow Overview
|
@page overview_splitterwindow wxSplitterWindow Overview
|
||||||
|
|
||||||
Classes: wxSplitterWindow
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_splitterwindow_appearance
|
@see wxSplitterWindow
|
||||||
@li @ref overview_splitterwindow_example
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_splitterwindow_appearance Appearance
|
@section overview_splitterwindow_appearance Appearance
|
||||||
@@ -80,4 +78,3 @@ void MyFrame::OnUnsplit(wxCommandEvent& event)
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -8,32 +8,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@page overview_stream Stream classes overview
|
@page overview_stream Stream Classes Overview
|
||||||
|
|
||||||
Classes:
|
@tableofcontents
|
||||||
@li wxStreamBase
|
|
||||||
@li wxStreamBuffer
|
|
||||||
@li wxInputStream
|
|
||||||
@li wxOutputStream
|
|
||||||
@li wxFilterInputStream
|
|
||||||
@li wxFilterOutputStream
|
|
||||||
@li wxFileInputStream
|
|
||||||
@li wxFileOutputStream
|
|
||||||
@li wxTextInputStream
|
|
||||||
@li wxTextOutputStream
|
|
||||||
@li wxDataInputStream
|
|
||||||
@li wxDataOutputStream
|
|
||||||
|
|
||||||
@li @ref overview_stream_intro
|
|
||||||
@li @ref overview_stream_example
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_stream_intro Introduction
|
|
||||||
|
|
||||||
@subsection overview_stream_intro_std wxWidgets and Standard Streams
|
|
||||||
|
|
||||||
wxWidgets provides its own set of stream classes in order to support platforms
|
wxWidgets provides its own set of stream classes in order to support platforms
|
||||||
not providing standard C++ streams implementation and also to make it possible
|
not providing standard C++ streams implementation and also to make it possible
|
||||||
@@ -51,7 +28,8 @@ stream as a standard stream (the converse possibility to use a standard stream
|
|||||||
as a wxWidgets stream is planned for a future release).
|
as a wxWidgets stream is planned for a future release).
|
||||||
|
|
||||||
|
|
||||||
@subsection overview_stream_intro_overview Stream Classes
|
|
||||||
|
@section overview_stream_classes Stream Classes
|
||||||
|
|
||||||
wxStream classes are divided in two main groups:
|
wxStream classes are divided in two main groups:
|
||||||
|
|
||||||
@@ -126,4 +104,3 @@ off_t position = in_stream.TellI();
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,22 +10,7 @@
|
|||||||
|
|
||||||
@page overview_string wxString Overview
|
@page overview_string wxString Overview
|
||||||
|
|
||||||
Classes: wxString, wxArrayString, wxStringTokenizer
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_string_intro
|
|
||||||
@li @ref overview_string_internal
|
|
||||||
@li @ref overview_string_binary
|
|
||||||
@li @ref overview_string_comparison
|
|
||||||
@li @ref overview_string_advice
|
|
||||||
@li @ref overview_string_related
|
|
||||||
@li @ref overview_string_tuning
|
|
||||||
@li @ref overview_string_settings
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_string_intro Introduction
|
|
||||||
|
|
||||||
wxString is a class which represents a Unicode string of arbitrary length and
|
wxString is a class which represents a Unicode string of arbitrary length and
|
||||||
containing arbitrary Unicode characters.
|
containing arbitrary Unicode characters.
|
||||||
@@ -44,7 +29,7 @@ has been done to make existing code using ANSI string literals work as it did
|
|||||||
in previous versions.
|
in previous versions.
|
||||||
|
|
||||||
|
|
||||||
@section overview_string_internal Internal wxString encoding
|
@section overview_string_internal Internal wxString Encoding
|
||||||
|
|
||||||
Since wxWidgets 3.0 wxString internally uses <b>UTF-16</b> (with Unicode
|
Since wxWidgets 3.0 wxString internally uses <b>UTF-16</b> (with Unicode
|
||||||
code units stored in @c wchar_t) under Windows and <b>UTF-8</b> (with Unicode
|
code units stored in @c wchar_t) under Windows and <b>UTF-8</b> (with Unicode
|
||||||
@@ -246,7 +231,7 @@ For this conversion, the @a wxConvLibc class instance is used.
|
|||||||
See wxCSConv and wxMBConv.
|
See wxCSConv and wxMBConv.
|
||||||
|
|
||||||
|
|
||||||
@subsection overview_string_iterating Iterating wxString's characters
|
@subsection overview_string_iterating Iterating wxString Characters
|
||||||
|
|
||||||
As previously described, when <tt>wxUSE_UNICODE_UTF8==1</tt>, wxString internally
|
As previously described, when <tt>wxUSE_UNICODE_UTF8==1</tt>, wxString internally
|
||||||
uses the variable-length UTF8 encoding.
|
uses the variable-length UTF8 encoding.
|
||||||
@@ -288,7 +273,7 @@ these problems: wxIsEmpty() verifies whether the string is empty (returning
|
|||||||
case-insensitive string comparison function known either as @c stricmp() or
|
case-insensitive string comparison function known either as @c stricmp() or
|
||||||
@c strcasecmp() on different platforms.
|
@c strcasecmp() on different platforms.
|
||||||
|
|
||||||
The <tt>@<wx/string.h@></tt> header also defines ::wxSnprintf and ::wxVsnprintf
|
The <tt>@<wx/string.h@></tt> header also defines wxSnprintf() and wxVsnprintf()
|
||||||
functions which should be used instead of the inherently dangerous standard
|
functions which should be used instead of the inherently dangerous standard
|
||||||
@c sprintf() and which use @c snprintf() instead which does buffer size checks
|
@c sprintf() and which use @c snprintf() instead which does buffer size checks
|
||||||
whenever possible. Of course, you may also use wxString::Printf which is also
|
whenever possible. Of course, you may also use wxString::Printf which is also
|
||||||
@@ -391,4 +376,3 @@ also defined, otherwise @c wxUSE_UNICODE_WCHAR is.
|
|||||||
See also @ref page_wxusedef_important.
|
See also @ref page_wxusedef_important.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -15,50 +15,52 @@
|
|||||||
|
|
||||||
@page overview_thread Multithreading Overview
|
@page overview_thread Multithreading Overview
|
||||||
|
|
||||||
Classes: wxThread, wxThreadHelper, wxMutex, wxCriticalSection, wxCondition, wxSemaphore
|
@tableofcontents
|
||||||
|
|
||||||
|
|
||||||
@section overview_thread_intro When to use multiple threads
|
|
||||||
|
|
||||||
wxWidgets provides a complete set of classes encapsulating objects necessary in
|
wxWidgets provides a complete set of classes encapsulating objects necessary in
|
||||||
multithreaded (MT) programs: the wxThread class itself and different
|
multi-threaded (MT) applications: the wxThread class itself and different
|
||||||
synchronization objects: mutexes (see wxMutex) and critical sections (see
|
synchronization objects: mutexes (see wxMutex) and critical sections (see
|
||||||
wxCriticalSection) with conditions (see wxCondition). The thread API in
|
wxCriticalSection) with conditions (see wxCondition). The thread API in
|
||||||
wxWidgets resembles to POSIX1.c threads API (a.k.a. pthreads), although several
|
wxWidgets resembles to POSIX1.c threads API (a.k.a. pthreads), although several
|
||||||
functions have different names and some features inspired by Win32 thread API
|
functions have different names and some features inspired by Win32 thread API
|
||||||
are there as well.
|
are there as well.
|
||||||
|
|
||||||
These classes hopefully make writing MT programs easier and they also
|
These classes hopefully make writing MT programs easier and they also provide
|
||||||
provide some extra error checking (compared to the native - be it Win32 or
|
some extra error checking (compared to the native - be it Win32 or Posix -
|
||||||
Posix - thread API), however it is still a non-trivial undertaking especially
|
thread API), however it is still a non-trivial undertaking especially for large
|
||||||
for large projects.
|
projects. Before starting an MT application (or starting to add MT features to
|
||||||
Before starting an MT application (or starting to add MT
|
an existing one) it is worth asking oneself if there is no easier and safer way
|
||||||
features to an existing one) it is worth asking oneself if there is no easier
|
to implement the same functionality. Of course, in some situations threads
|
||||||
and safer way to implement the same functionality.
|
really make sense (classical example is a server application which launches a
|
||||||
Of course, in some situations threads really make sense (classical example is a
|
new thread for each new client), but in others it might be an overkill. On the
|
||||||
server application which launches a new thread for each new client), but in others
|
other hand, the recent evolution of the computer hardware shows an important
|
||||||
it might be an overkill.
|
trend towards multi-core systems, which are better exploited using multiple
|
||||||
On the other hand, the recent evolution of the computer hardware shows
|
threads (e.g. you may want to split a long task among as many threads as many
|
||||||
an important trend towards multi-core systems, which are better exploited using
|
CPU (cores) the system reports; see wxThread::GetCPUCount).
|
||||||
multiple threads (e.g. you may want to split a long task among as many threads
|
|
||||||
as many CPU (cores) the system reports; see wxThread::GetCPUCount).
|
|
||||||
|
|
||||||
To implement non-blocking operations @e without using multiple threads you have
|
To implement non-blocking operations @e without using multiple threads you have
|
||||||
two possible implementation choices:
|
two possible implementation choices:
|
||||||
|
|
||||||
- use wxIdleEvent (e.g. to perform a long calculation while updating a progress dialog)
|
- use wxIdleEvent (e.g. to perform a long calculation while updating a progress dialog)
|
||||||
- do everything at once but call wxWindow::Update() or wxApp::YieldFor(wxEVT_CATEGORY_UI)
|
- do everything at once but call wxWindow::Update() or wxApp::YieldFor(wxEVT_CATEGORY_UI)
|
||||||
periodically to update the screen.
|
periodically to update the screen.
|
||||||
If instead you choose to use threads in your application, please read also
|
|
||||||
the following sections of this overview.
|
|
||||||
|
|
||||||
@section overview_thread_notes Important notes for multithreaded applications
|
If instead you choose to use threads in your application, please read the
|
||||||
|
following section of this overview.
|
||||||
|
|
||||||
When writing a multi-threaded application, it is strongly recommended
|
@see wxThread, wxThreadHelper, wxMutex, wxCriticalSection, wxCondition,
|
||||||
that <b>no secondary threads call GUI functions</b>.
|
wxSemaphore
|
||||||
The design which uses one GUI thread and several worker threads which communicate
|
|
||||||
with the main one using @b events is much more robust and will undoubtedly save you
|
|
||||||
countless problems (example: under Win32 a thread can only access GDI objects such
|
|
||||||
as pens, brushes, device contexts created by itself and not by the other threads).
|
@section overview_thread_notes Important Notes for Multi-threaded Applications
|
||||||
|
|
||||||
|
When writing a multi-threaded application, it is strongly recommended that
|
||||||
|
<b>no secondary threads call GUI functions</b>. The design which uses one GUI
|
||||||
|
thread and several worker threads which communicate with the main one using
|
||||||
|
@b events is much more robust and will undoubtedly save you countless problems
|
||||||
|
(example: under Win32 a thread can only access GDI objects such as pens,
|
||||||
|
brushes, device contexts created by itself and not by the other threads).
|
||||||
|
|
||||||
For communication between secondary threads and the main thread, you may use
|
For communication between secondary threads and the main thread, you may use
|
||||||
wxEvtHandler::QueueEvent or its short version ::wxQueueEvent. These functions
|
wxEvtHandler::QueueEvent or its short version ::wxQueueEvent. These functions
|
||||||
@@ -66,25 +68,23 @@ have a thread-safe implementation so that they can be used as they are for
|
|||||||
sending events from one thread to another. However there is no built in method
|
sending events from one thread to another. However there is no built in method
|
||||||
to send messages to the worker threads and you will need to use the available
|
to send messages to the worker threads and you will need to use the available
|
||||||
synchronization classes to implement the solution which suits your needs
|
synchronization classes to implement the solution which suits your needs
|
||||||
yourself. In particular, please note that it is not enough to derive
|
yourself. In particular, please note that it is not enough to derive your class
|
||||||
your class from wxThread and wxEvtHandler to send messages to it: in fact, this
|
from wxThread and wxEvtHandler to send messages to it: in fact, this does not
|
||||||
does not work at all.
|
work at all. You're instead encouraged to use wxThreadHelper as it greatly
|
||||||
You're instead encouraged to use wxThreadHelper as it greatly simplifies the
|
simplifies the communication and the sharing of resources.
|
||||||
communication and the sharing of resources.
|
|
||||||
|
|
||||||
You should also look at the wxThread docs for important notes about secondary
|
You should also look at the wxThread docs for important notes about secondary
|
||||||
threads and their deletion.
|
threads and their deletion.
|
||||||
|
|
||||||
Last, remember that if wxEventLoopBase::YieldFor() is used directly or indirectly
|
Last, remember that if wxEventLoopBase::YieldFor() is used directly or
|
||||||
(e.g. through wxProgressDialog) in your code, then you may have both re-entrancy
|
indirectly (e.g. through wxProgressDialog) in your code, then you may have both
|
||||||
problems and also problems caused by the processing of events out of order.
|
re-entrancy problems and also problems caused by the processing of events out
|
||||||
To resolve the last problem wxThreadEvent can be used: thanks to its implementation
|
of order. To resolve the last problem wxThreadEvent can be used: thanks to its
|
||||||
of the wxThreadEvent::GetEventCategory function wxThreadEvent classes in fact
|
implementation of the wxThreadEvent::GetEventCategory function wxThreadEvent
|
||||||
do not get processed by wxEventLoopBase::YieldFor() unless you specify the
|
classes in fact do not get processed by wxEventLoopBase::YieldFor() unless you
|
||||||
@c wxEVT_CATEGORY_THREAD flag.
|
specify the @c wxEVT_CATEGORY_THREAD flag.
|
||||||
|
|
||||||
See also the @sample{thread} for a sample showing some simple interactions
|
See also the @sample{thread} for a sample showing some simple interactions
|
||||||
between the main and secondary threads.
|
between the main and secondary threads.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_tips wxTipProvider Overview
|
@page overview_tips wxTipProvider Overview
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
Many "modern" Windows programs have a feature (some would say annoyance) of
|
Many "modern" Windows programs have a feature (some would say annoyance) of
|
||||||
presenting the user tips at program startup. While this is probably useless to
|
presenting the user tips at program startup. While this is probably useless to
|
||||||
the advanced users of the program, the experience shows that the tips may be
|
the advanced users of the program, the experience shows that the tips may be
|
||||||
@@ -73,4 +75,3 @@ See the dialogs program in your samples folder for a working example inside a
|
|||||||
program.
|
program.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,16 +10,7 @@
|
|||||||
|
|
||||||
@page overview_toolbar Toolbar Overview
|
@page overview_toolbar Toolbar Overview
|
||||||
|
|
||||||
Classes: wxToolBar
|
@tableofcontents
|
||||||
|
|
||||||
@li @ref overview_toolbar_intro
|
|
||||||
@li @ref overview_toolbar_library
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_toolbar_intro Introduction
|
|
||||||
|
|
||||||
The toolbar family of classes allows an application to use toolbars in a
|
The toolbar family of classes allows an application to use toolbars in a
|
||||||
variety of configurations and styles.
|
variety of configurations and styles.
|
||||||
@@ -90,4 +81,3 @@ Include @c "wx/toolbar.h", or if using a class directly, one of:
|
|||||||
An example of using a toolbar is given in the "toolbar" sample.
|
An example of using a toolbar is given in the "toolbar" sample.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
@page overview_treectrl wxTreeCtrl Overview
|
@page overview_treectrl wxTreeCtrl Overview
|
||||||
|
|
||||||
Classes: wxTreeCtrl, wxImageList
|
@tableofcontents
|
||||||
|
|
||||||
The tree control displays its items in a tree like structure. Each item has
|
The tree control displays its items in a tree like structure. Each item has
|
||||||
its own (optional) icon and a label. An item may be either collapsed (meaning
|
its own (optional) icon and a label. An item may be either collapsed (meaning
|
||||||
@@ -19,6 +19,8 @@ shown). Each item in the tree is identified by its @c itemId which is of opaque
|
|||||||
data type wxTreeItemId. You can test whether an item is valid by calling
|
data type wxTreeItemId. You can test whether an item is valid by calling
|
||||||
wxTreeItemId::IsOk.
|
wxTreeItemId::IsOk.
|
||||||
|
|
||||||
|
@see wxTreeCtrl, wxImageList
|
||||||
|
|
||||||
The items text and image may be retrieved and changed with (Get|Set)ItemText
|
The items text and image may be retrieved and changed with (Get|Set)ItemText
|
||||||
and (Get|Set)ItemImage. In fact, an item may even have two images associated
|
and (Get|Set)ItemImage. In fact, an item may even have two images associated
|
||||||
with it: the normal one and another one for selected state which is
|
with it: the normal one and another one for selected state which is
|
||||||
@@ -79,4 +81,3 @@ nothing by default, but it is common to associate them with deleting an item
|
|||||||
from a tree and inserting a new one into it.
|
from a tree and inserting a new one into it.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_unicode Unicode Support in wxWidgets
|
@page overview_unicode Unicode Support in wxWidgets
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
This section describes how does wxWidgets support Unicode and how can it affect
|
This section describes how does wxWidgets support Unicode and how can it affect
|
||||||
your programs.
|
your programs.
|
||||||
|
|
||||||
@@ -19,14 +21,8 @@ correct any more. Please see @ref overview_changes_unicode for the details of
|
|||||||
these changes.
|
these changes.
|
||||||
|
|
||||||
You can skip the first two sections if you're already familiar with Unicode and
|
You can skip the first two sections if you're already familiar with Unicode and
|
||||||
wish to jump directly in the details of its support in the library:
|
wish to jump directly in the details of its support in the library.
|
||||||
@li @ref overview_unicode_what
|
|
||||||
@li @ref overview_unicode_encodings
|
|
||||||
@li @ref overview_unicode_supportin
|
|
||||||
@li @ref overview_unicode_pitfalls
|
|
||||||
@li @ref overview_unicode_supportout
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_unicode_what What is Unicode?
|
@section overview_unicode_what What is Unicode?
|
||||||
@@ -436,4 +432,3 @@ the return value of any of the functions mentioned in this section to another
|
|||||||
function directly.
|
function directly.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_unixprinting Printing Under Unix (GTK+)
|
@page overview_unixprinting Printing Under Unix (GTK+)
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
Printing under Unix has always been a cause of problems as Unix does not
|
Printing under Unix has always been a cause of problems as Unix does not
|
||||||
provide a standard way to display text and graphics on screen and print it to a
|
provide a standard way to display text and graphics on screen and print it to a
|
||||||
printer using the same application programming interface - instead, displaying
|
printer using the same application programming interface - instead, displaying
|
||||||
@@ -43,4 +45,3 @@ code. Note that the application will not require a GTK+ version = 2.10 to be
|
|||||||
installed in order to run (there will be no dependency on this version).
|
installed in order to run (there will be no dependency on this version).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,18 +10,7 @@
|
|||||||
|
|
||||||
@page overview_validator wxValidator Overview
|
@page overview_validator wxValidator Overview
|
||||||
|
|
||||||
Classes: wxValidator, wxTextValidator, wxGenericValidator, wxIntegerValidator,
|
@tableofcontents
|
||||||
wxFloatingPointValidator
|
|
||||||
|
|
||||||
@li @ref overview_validator_intro
|
|
||||||
@li @ref overview_validator_anatomy
|
|
||||||
@li @ref overview_validator_dialogs
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_validator_intro Validator basic concepts
|
|
||||||
|
|
||||||
The aim of the validator concept is to make dialogs very much easier to write.
|
The aim of the validator concept is to make dialogs very much easier to write.
|
||||||
A validator is an object that can be plugged into a control (such as a
|
A validator is an object that can be plugged into a control (such as a
|
||||||
@@ -63,6 +52,10 @@ giving the error, and the dialog is not dismissed.
|
|||||||
Note that any wxWindow may have a validator; using the @c wxWS_EX_VALIDATE_RECURSIVELY
|
Note that any wxWindow may have a validator; using the @c wxWS_EX_VALIDATE_RECURSIVELY
|
||||||
style (see wxWindow extended styles) you can also implement recursive validation.
|
style (see wxWindow extended styles) you can also implement recursive validation.
|
||||||
|
|
||||||
|
@see wxValidator, wxTextValidator, wxGenericValidator, wxIntegerValidator,
|
||||||
|
wxFloatingPointValidator
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_validator_anatomy Anatomy of a Validator
|
@section overview_validator_anatomy Anatomy of a Validator
|
||||||
|
|
||||||
@@ -147,4 +140,3 @@ the controls setting validators, since validators can't be specified in a
|
|||||||
dialog resource.
|
dialog resource.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,23 +10,15 @@
|
|||||||
|
|
||||||
@page overview_windowdeletion Window Deletion
|
@page overview_windowdeletion Window Deletion
|
||||||
|
|
||||||
Classes: wxCloseEvent, wxWindow
|
@tableofcontents
|
||||||
|
|
||||||
Window deletion can be a confusing subject, so this overview is provided to
|
Window deletion can be a confusing subject, so this overview is provided to
|
||||||
help make it clear when and how you delete windows, or respond to user requests
|
help make it clear when and how you delete windows, or respond to user requests
|
||||||
to close windows.
|
to close windows.
|
||||||
|
|
||||||
@li @ref overview_windowdeletion_sequence
|
@see wxCloseEvent, wxWindow
|
||||||
@li @ref overview_windowdeletion_close
|
|
||||||
@li @ref overview_windowdeletion_default
|
|
||||||
@li @ref overview_windowdeletion_menuexit
|
|
||||||
@li @ref overview_windowdeletion_exitapp
|
|
||||||
@li @ref overview_windowdeletion_deletion
|
|
||||||
@li @ref overview_windowdeletion_windowkinds
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_windowdeletion_sequence Sequence of Events During Window Deletion
|
@section overview_windowdeletion_sequence Sequence of Events During Window Deletion
|
||||||
|
|
||||||
@@ -118,4 +110,3 @@ wish. For consistency, continue to use the wxWindow::Destroy function instead
|
|||||||
of the @c delete operator when deleting these kinds of windows explicitly.
|
of the @c delete operator when deleting these kinds of windows explicitly.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,21 +10,7 @@
|
|||||||
|
|
||||||
@page overview_windowids Window IDs
|
@page overview_windowids Window IDs
|
||||||
|
|
||||||
@li @ref overview_windowids_intro
|
@tableofcontents
|
||||||
@li @ref overview_windowids_type
|
|
||||||
@li @ref overview_windowids_using
|
|
||||||
|
|
||||||
@see
|
|
||||||
|
|
||||||
@li wxIdManager
|
|
||||||
@li wxWindow::NewControlId
|
|
||||||
@li wxWindow::UnreserveControlId
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_windowids_intro Introduction
|
|
||||||
|
|
||||||
Various controls and other parts of wxWidgets need an ID. Sometimes the ID may
|
Various controls and other parts of wxWidgets need an ID. Sometimes the ID may
|
||||||
be directly provided by the user or have a predefined value, such as
|
be directly provided by the user or have a predefined value, such as
|
||||||
@@ -50,6 +36,8 @@ one another. This is accomplished by keeping a reference count for each of the
|
|||||||
IDs that can possibly be returned by wxWindow::NewControlId. Other IDs are not
|
IDs that can possibly be returned by wxWindow::NewControlId. Other IDs are not
|
||||||
reference counted.
|
reference counted.
|
||||||
|
|
||||||
|
@see wxIdManager, wxWindow::NewControlId(), wxWindow::UnreserveControlId()
|
||||||
|
|
||||||
|
|
||||||
@section overview_windowids_type Data Types
|
@section overview_windowids_type Data Types
|
||||||
|
|
||||||
@@ -85,4 +73,3 @@ This is done already for windows, menu items, and tool bar items. It should
|
|||||||
only be used in the main thread, as it is not thread safe.
|
only be used in the main thread, as it is not thread safe.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,16 +10,13 @@
|
|||||||
|
|
||||||
@page overview_windowsizing Window Sizing Overview
|
@page overview_windowsizing Window Sizing Overview
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
It can sometimes be confusing to keep track of the various size-related
|
It can sometimes be confusing to keep track of the various size-related
|
||||||
attributes of a wxWindow, how they relate to each other, and how they interact
|
attributes of a wxWindow, how they relate to each other, and how they interact
|
||||||
with sizers. This document will attempt to clear the fog a little, and give
|
with sizers. This document will attempt to clear the fog a little, and give
|
||||||
some simple explanations of things.
|
some simple explanations of things.
|
||||||
|
|
||||||
@li @ref overview_windowsizing_glossary
|
|
||||||
@li @ref overview_windowsizing_func
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_windowsizing_glossary Glossary
|
@section overview_windowsizing_glossary Glossary
|
||||||
@@ -121,4 +118,3 @@ some simple explanations of things.
|
|||||||
the default @c EVT_SIZE handler for container windows.
|
the default @c EVT_SIZE handler for container windows.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
@page overview_windowstyles Window Styles
|
@page overview_windowstyles Window Styles
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
Window styles are used to specify alternative behaviour and appearances for
|
Window styles are used to specify alternative behaviour and appearances for
|
||||||
windows, when they are created. The symbols are defined in such a way that they
|
windows, when they are created. The symbols are defined in such a way that they
|
||||||
can be combined in a 'bit-list' using the C++ @e bitwise-or operator.
|
can be combined in a 'bit-list' using the C++ @e bitwise-or operator.
|
||||||
@@ -27,4 +29,3 @@ Most windows can use the generic styles listed for wxWindow in addition to
|
|||||||
their own styles.
|
their own styles.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
@page overview_xrc XML Based Resource System (XRC)
|
@page overview_xrc XML Based Resource System (XRC)
|
||||||
|
|
||||||
Classes: wxXmlResource, wxXmlResourceHandler
|
@tableofcontents
|
||||||
|
|
||||||
The XML-based resource system, known as XRC, allows user interface elements
|
The XML-based resource system, known as XRC, allows user interface elements
|
||||||
such as dialogs, menu bars and toolbars, to be stored in text files and loaded
|
such as dialogs, menu bars and toolbars, to be stored in text files and loaded
|
||||||
@@ -36,15 +36,8 @@ There are several advantages to using XRC resources:
|
|||||||
|
|
||||||
XRC was written by Vaclav Slavik.
|
XRC was written by Vaclav Slavik.
|
||||||
|
|
||||||
@li @ref overview_xrc_gettingstarted
|
@see wxXmlResource, wxXmlResourceHandler, @ref overview_xrcformat
|
||||||
@li @ref overview_xrc_xrcsample
|
|
||||||
@li @ref overview_xrc_binaryresourcefiles
|
|
||||||
@li @ref overview_xrc_embeddedresource
|
|
||||||
@li @ref overview_xrc_cppheader
|
|
||||||
@li @ref overview_xrc_newresourcehandlers
|
|
||||||
|
|
||||||
See also the separate @ref overview_xrcformat page for more information, and
|
|
||||||
details about the XRC file format.
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_xrc_gettingstarted Getting Started with XRC
|
@section overview_xrc_gettingstarted Getting Started with XRC
|
||||||
@@ -545,4 +538,3 @@ built-in getters it contains. It's very easy to retrieve also complex
|
|||||||
structures out of XRC files using them.
|
structures out of XRC files using them.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -18,34 +18,10 @@
|
|||||||
|
|
||||||
@page overview_xrcformat XRC File Format
|
@page overview_xrcformat XRC File Format
|
||||||
|
|
||||||
Table of contents:
|
@tableofcontents
|
||||||
- @ref overview_xrcformat_overview
|
|
||||||
- @ref overview_xrcformat_root
|
|
||||||
- @ref overview_xrcformat_objects
|
|
||||||
- @ref overview_xrcformat_object
|
|
||||||
- @ref overview_xrcformat_object_ref
|
|
||||||
- @ref overview_xrcformat_datatypes
|
|
||||||
- @ref overview_xrcformat_windows
|
|
||||||
- @ref overview_xrcformat_std_props
|
|
||||||
- @ref overview_xrcformat_controls
|
|
||||||
- @ref overview_xrcformat_sizers
|
|
||||||
- @ref overview_xrcformat_other_objects
|
|
||||||
- @ref overview_xrcformat_platform
|
|
||||||
- @ref overview_xrcformat_idranges
|
|
||||||
- @ref overview_xrcformat_extending
|
|
||||||
- @ref overview_xrcformat_extending_subclass
|
|
||||||
- @ref overview_xrcformat_extending_unknown
|
|
||||||
- @ref overview_xrcformat_extending_custom
|
|
||||||
- @ref overview_xrcformat_packed
|
|
||||||
- @ref overview_xrcformat_oldversions
|
|
||||||
|
|
||||||
This document describes the format of XRC resource files, as used by wxXmlResource.
|
This document describes the format of XRC resource files, as used by
|
||||||
|
wxXmlResource.
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_xrcformat_overview Overview
|
|
||||||
|
|
||||||
XRC file is a XML file with all of its elements in the
|
XRC file is a XML file with all of its elements in the
|
||||||
@c http://www.wxwidgets.org/wxxrc namespace. For backward compatibility,
|
@c http://www.wxwidgets.org/wxxrc namespace. For backward compatibility,
|
||||||
@@ -66,6 +42,7 @@ Child objects are not directly accessible via wxXmlResource, they can only
|
|||||||
be accessed using XRCCTRL().
|
be accessed using XRCCTRL().
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@section overview_xrcformat_root Resource Root Element
|
@section overview_xrcformat_root Resource Root Element
|
||||||
|
|
||||||
The root element is always @c \<resource\>. It has one optional attribute, @c
|
The root element is always @c \<resource\>. It has one optional attribute, @c
|
||||||
|
@@ -4315,7 +4315,7 @@ public:
|
|||||||
|
|
||||||
See the macro DEFINE_EVENT_TYPE() for more info.
|
See the macro DEFINE_EVENT_TYPE() for more info.
|
||||||
|
|
||||||
@see @ref overview_events_introduction
|
@see @ref overview_events
|
||||||
*/
|
*/
|
||||||
typedef int wxEventType;
|
typedef int wxEventType;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user