documented how to handle C++ exceptions in wxWindows
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,12 +32,14 @@ a reference to your application object) to be visible to other files.
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{wxApp::wxApp}
|
||||
|
||||
\func{void}{wxApp}{\void}
|
||||
|
||||
Constructor. Called implicitly with a definition of a wxApp object.
|
||||
|
||||
|
||||
\membersection{wxApp::\destruct{wxApp}}
|
||||
|
||||
\func{void}{\destruct{wxApp}}{\void}
|
||||
@@ -45,18 +47,21 @@ Constructor. Called implicitly with a definition of a wxApp object.
|
||||
Destructor. Will be called implicitly on program exit if the wxApp
|
||||
object is created on the stack.
|
||||
|
||||
|
||||
\membersection{wxApp::argc}\label{wxappargc}
|
||||
|
||||
\member{int}{argc}
|
||||
|
||||
Number of command line arguments (after environment-specific processing).
|
||||
|
||||
|
||||
\membersection{wxApp::argv}\label{wxappargv}
|
||||
|
||||
\member{char **}{argv}
|
||||
|
||||
Command line arguments (after environment-specific processing).
|
||||
|
||||
|
||||
\membersection{wxApp::CreateLogTarget}\label{wxappcreatelogtarget}
|
||||
|
||||
\func{virtual wxLog*}{CreateLogTarget}{\void}
|
||||
@@ -68,6 +73,7 @@ implementation returns a new wxLogGui class.
|
||||
|
||||
\helpref{wxLog}{wxlog}
|
||||
|
||||
|
||||
\membersection{wxApp::Dispatch}\label{wxappdispatch}
|
||||
|
||||
\func{void}{Dispatch}{\void}
|
||||
@@ -85,6 +91,7 @@ This can be used for programming event loops, e.g.
|
||||
|
||||
\helpref{wxApp::Pending}{wxapppending}
|
||||
|
||||
|
||||
\membersection{wxApp::FilterEvent}\label{wxappfilterevent}
|
||||
|
||||
\func{int}{FilterEvent}{\param{wxEvent\& }{event}}
|
||||
@@ -96,6 +103,7 @@ returned and the event processing stops immediately considering that the event
|
||||
had been already processed (for the former return value) or that it is not
|
||||
going to be processed at all (for the latter one).
|
||||
|
||||
|
||||
\membersection{wxApp::GetAppName}\label{wxappgetappname}
|
||||
|
||||
\constfunc{wxString}{GetAppName}{\void}
|
||||
@@ -107,6 +115,7 @@ Returns the application name.
|
||||
wxWindows sets this to a reasonable default before
|
||||
calling \helpref{wxApp::OnInit}{wxapponinit}, but the application can reset it at will.
|
||||
|
||||
|
||||
\membersection{wxApp::GetAuto3D}\label{wxappgetauto3d}
|
||||
|
||||
\constfunc{bool}{GetAuto3D}{\void}
|
||||
@@ -117,6 +126,7 @@ Returns true if 3D control mode is on, false otherwise.
|
||||
|
||||
\helpref{wxApp::SetAuto3D}{wxappsetauto3d}
|
||||
|
||||
|
||||
\membersection{wxApp::GetClassName}\label{wxappgetclassname}
|
||||
|
||||
\constfunc{wxString}{GetClassName}{\void}
|
||||
@@ -128,6 +138,7 @@ manner to refer to the application.
|
||||
|
||||
\helpref{wxApp::SetClassName}{wxappsetclassname}
|
||||
|
||||
|
||||
\membersection{wxApp::GetExitOnFrameDelete}\label{wxappgetexitonframedelete}
|
||||
|
||||
\constfunc{bool}{GetExitOnFrameDelete}{\void}
|
||||
@@ -140,6 +151,7 @@ otherwise.
|
||||
\helpref{wxApp::SetExitOnFrameDelete}{wxappsetexitonframedelete},\\
|
||||
\helpref{wxApp shutdown overview}{wxappshutdownoverview}
|
||||
|
||||
|
||||
\membersection{wxApp::GetTopWindow}\label{wxappgettopwindow}
|
||||
|
||||
\constfunc{virtual wxWindow *}{GetTopWindow}{\void}
|
||||
@@ -155,6 +167,7 @@ function will find the first top-level window (frame or dialog) and return that.
|
||||
|
||||
\helpref{SetTopWindow}{wxappsettopwindow}
|
||||
|
||||
|
||||
\membersection{wxApp::GetUseBestVisual}\label{wxappgetusebestvisual}
|
||||
|
||||
\constfunc{bool}{GetUseBestVisual}{\void}
|
||||
@@ -166,12 +179,14 @@ different visuals, false otherwise.
|
||||
|
||||
\helpref{SetUseBestVisual}{wxappsetusebestvisual}
|
||||
|
||||
|
||||
\membersection{wxApp::GetVendorName}\label{wxappgetvendorname}
|
||||
|
||||
\constfunc{wxString}{GetVendorName}{\void}
|
||||
|
||||
Returns the application's vendor name.
|
||||
|
||||
|
||||
\membersection{wxApp::ExitMainLoop}\label{wxappexitmainloop}
|
||||
|
||||
\func{void}{ExitMainLoop}{\void}
|
||||
@@ -180,6 +195,7 @@ Call this to explicitly exit the main message (event) loop.
|
||||
You should normally exit the main loop (and the application) by deleting
|
||||
the top window.
|
||||
|
||||
|
||||
\membersection{wxApp::Initialized}\label{wxappinitialized}
|
||||
|
||||
\func{bool}{Initialized}{\void}
|
||||
@@ -190,6 +206,7 @@ message routines to determine which method of output is best for the
|
||||
current state of the program (some windowing systems may not like
|
||||
dialogs to pop up before the main loop has been entered).
|
||||
|
||||
|
||||
\membersection{wxApp::MainLoop}\label{wxappmainloop}
|
||||
|
||||
\func{int}{MainLoop}{\void}
|
||||
@@ -237,6 +254,7 @@ Returns 0 under X, and the wParam of the WM\_QUIT message under Windows.
|
||||
%%\helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnChar}{wxwindowonchar},\rtfsp
|
||||
%%\helpref{wxWindow::OnCharHook}{wxwindowoncharhook}, \helpref{wxDialog::OnCharHook}{wxdialogoncharhook}
|
||||
|
||||
|
||||
\membersection{wxApp::OnAssert}\label{wxapponassert}
|
||||
|
||||
\func{void}{OnAssert}{\param{const wxChar }{*file}, \param{int }{line}, \param{const wxChar }{*cond}, \param{const wxChar }{*msg}}
|
||||
@@ -262,14 +280,6 @@ the user to stop the program, continue or ignore all subsequent asserts.
|
||||
be {\tt NULL} if just \helpref{wxASSERT}{wxassert} or \helpref{wxFAIL}{wxfail}
|
||||
was used}
|
||||
|
||||
\membersection{wxApp::OnExit}\label{wxapponexit}
|
||||
|
||||
\func{int}{OnExit}{\void}
|
||||
|
||||
Provide this member function for any processing which needs to be
|
||||
done as the application is about to exit. OnExit is called after
|
||||
destroying all application windows and controls, but before
|
||||
wxWindows cleanup.
|
||||
|
||||
\membersection{wxApp::OnCmdLineError}\label{wxapponcmdlineerror}
|
||||
|
||||
@@ -286,6 +296,7 @@ Return {\tt true} to continue normal execution or {\tt false} to return
|
||||
|
||||
\helpref{OnInitCmdLine}{wxapponinitcmdline}
|
||||
|
||||
|
||||
\membersection{wxApp::OnCmdLineHelp}\label{wxapponcmdlinehelp}
|
||||
|
||||
\func{bool}{OnCmdLineHelp}{\param{wxCmdLineParser\& }{parser}}
|
||||
@@ -300,6 +311,7 @@ Return {\tt true} to continue normal execution or {\tt false} to return
|
||||
|
||||
\helpref{OnInitCmdLine}{wxapponinitcmdline}
|
||||
|
||||
|
||||
\membersection{wxApp::OnCmdLineParsed}\label{wxapponcmdlineparsed}
|
||||
|
||||
\func{bool}{OnCmdLineParsed}{\param{wxCmdLineParser\& }{parser}}
|
||||
@@ -318,6 +330,17 @@ Return {\tt true} to continue normal execution or {\tt false} to return
|
||||
|
||||
\helpref{OnInitCmdLine}{wxapponinitcmdline}
|
||||
|
||||
|
||||
\membersection{wxApp::OnExit}\label{wxapponexit}
|
||||
|
||||
\func{int}{OnExit}{\void}
|
||||
|
||||
Provide this member function for any processing which needs to be
|
||||
done as the application is about to exit. OnExit is called after
|
||||
destroying all application windows and controls, but before
|
||||
wxWindows cleanup.
|
||||
|
||||
|
||||
\membersection{wxApp::OnFatalException}\label{wxapponfatalexception}
|
||||
|
||||
\func{void}{OnFatalException}{\void}
|
||||
@@ -386,6 +409,7 @@ work and, in fact, probably won't.
|
||||
%%\helpref{wxCloseEvent}{wxcloseevent},\rtfsp
|
||||
%%\helpref{wxApp::OnQueryEndSession}{wxapponqueryendsession}
|
||||
|
||||
|
||||
\membersection{wxApp::OnInit}\label{wxapponinit}
|
||||
|
||||
\func{bool}{OnInit}{\void}
|
||||
@@ -400,6 +424,7 @@ OnInit().
|
||||
|
||||
Return true to continue processing, false to exit the application.
|
||||
|
||||
|
||||
\membersection{wxApp::OnInitCmdLine}\label{wxapponinitcmdline}
|
||||
|
||||
\func{void}{OnInitCmdLine}{\param{wxCmdLineParser\& }{parser}}
|
||||
@@ -408,6 +433,7 @@ Called from \helpref{OnInit}{wxapponinit} and may be used to initialize the
|
||||
parser with the command line options for this application. The base class
|
||||
versions adds support for a few standard options only.
|
||||
|
||||
|
||||
\membersection{wxApp::OnQueryEndSession}\label{wxapponqueryendsession}
|
||||
|
||||
\func{void}{OnQueryEndSession}{\param{wxCloseEvent\& }{event}}
|
||||
@@ -444,6 +470,32 @@ Under Windows, OnQueryEndSession is called in response to the WM\_QUERYENDSESSIO
|
||||
%% GD: OnXXX functions are not documented
|
||||
%%\helpref{wxApp::OnEndSession}{wxapponendsession}
|
||||
|
||||
|
||||
\membersection{wxApp::OnRun}\label{wxapponrun}
|
||||
|
||||
\func{virtual int}{OnRun}{\void}
|
||||
|
||||
This virtual function is where the execution of a program written in wxWindows
|
||||
starts. The default implementation just enters the main loop and starts
|
||||
handling the events until it terminates, either because
|
||||
\helpref{ExitMainLoop}{wxappexitmainloop} has been explicitly called or because
|
||||
the last frame has been deleted and
|
||||
\helpref{GetExitOnFrameDelete}{wxappgetexitonframedelete} flag is \true (this
|
||||
is the default).
|
||||
|
||||
|
||||
\membersection{wxApp::OnUnhandledException}{wxapponunhandledexception}
|
||||
|
||||
\func{virtual void}{OnUnhandledException}{\void}
|
||||
|
||||
This function is called when an unhandled C++ exception occurs inside
|
||||
\helpref{OnRun()}{wxapponrun} (the exceptions which occur during the program
|
||||
startup and shutdown might not be caught at all).
|
||||
Note that the exception type is lost by now, so if you want to really handle
|
||||
the exception you should override \helpref{OnRun()}{wxapponrun} and put a
|
||||
try/catch clause around the call to the base class version there.
|
||||
|
||||
|
||||
\membersection{wxApp::ProcessMessage}\label{wxappprocessmessage}
|
||||
|
||||
\func{bool}{ProcessMessage}{\param{WXMSG *}{msg}}
|
||||
@@ -468,6 +520,7 @@ BOOL CTheApp::PreTranslateMessage(MSG *msg)
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
\membersection{wxApp::Pending}\label{wxapppending}
|
||||
|
||||
\func{bool}{Pending}{\void}
|
||||
@@ -478,6 +531,7 @@ Returns true if unprocessed events are in the window system event queue.
|
||||
|
||||
\helpref{wxApp::Dispatch}{wxappdispatch}
|
||||
|
||||
|
||||
\membersection{wxApp::SendIdleEvents}\label{wxappsendidleevents}
|
||||
|
||||
\func{bool}{SendIdleEvents}{\void}
|
||||
@@ -499,6 +553,7 @@ If true is returned, more OnIdle processing is requested by one or more window.
|
||||
%%\helpref{wxApp::OnIdle}{wxapponidle}
|
||||
\helpref{wxIdleEvent}{wxidleevent}
|
||||
|
||||
|
||||
\membersection{wxApp::SetAppName}\label{wxappsetappname}
|
||||
|
||||
\func{void}{SetAppName}{\param{const wxString\& }{name}}
|
||||
@@ -511,6 +566,7 @@ wxWindows.
|
||||
|
||||
\helpref{wxApp::GetAppName}{wxappgetappname}
|
||||
|
||||
|
||||
\membersection{wxApp::SetAuto3D}\label{wxappsetauto3d}
|
||||
|
||||
\func{void}{SetAuto3D}{\param{const bool}{ auto3D}}
|
||||
@@ -530,6 +586,7 @@ This has an effect on Windows only.
|
||||
|
||||
\helpref{wxApp::GetAuto3D}{wxappgetauto3d}
|
||||
|
||||
|
||||
\membersection{wxApp::SetClassName}\label{wxappsetclassname}
|
||||
|
||||
\func{void}{SetClassName}{\param{const wxString\& }{name}}
|
||||
@@ -541,6 +598,7 @@ manner to refer to the application.
|
||||
|
||||
\helpref{wxApp::GetClassName}{wxappgetclassname}
|
||||
|
||||
|
||||
\membersection{wxApp::SetExitOnFrameDelete}\label{wxappsetexitonframedelete}
|
||||
|
||||
\func{void}{SetExitOnFrameDelete}{\param{bool}{ flag}}
|
||||
@@ -558,6 +616,7 @@ deleted. If false, the application will continue to run.}
|
||||
\helpref{wxApp::GetExitOnFrameDelete}{wxappgetexitonframedelete},\\
|
||||
\helpref{wxApp shutdown overview}{wxappshutdownoverview}
|
||||
|
||||
|
||||
\membersection{wxApp::SetTopWindow}\label{wxappsettopwindow}
|
||||
|
||||
\func{void}{SetTopWindow}{\param{wxWindow* }{window}}
|
||||
@@ -578,6 +637,7 @@ needs to use the top window.
|
||||
\helpref{wxApp::GetTopWindow}{wxappgettopwindow}, \helpref{wxApp::OnInit}{wxapponinit}
|
||||
|
||||
|
||||
|
||||
\membersection{wxApp::SetVendorName}\label{wxappsetvendorname}
|
||||
|
||||
\func{void}{SetVendorName}{\param{const wxString\& }{name}}
|
||||
@@ -590,6 +650,7 @@ wxWindows.
|
||||
|
||||
\helpref{wxApp::GetVendorName}{wxappgetvendorname}
|
||||
|
||||
|
||||
\membersection{wxApp::SetUseBestVisual}\label{wxappsetusebestvisual}
|
||||
|
||||
\func{void}{SetUseBestVisual}{\param{bool}{ flag}}
|
||||
@@ -608,6 +669,18 @@ This function currently only has effect under GTK.
|
||||
|
||||
\docparam{flag}{If true, the app will use the best visual.}
|
||||
|
||||
|
||||
\membersection{wxApp::HandleEvent}\label{wxapphandleevent}
|
||||
|
||||
\constfunc{virtual void}{HandleEvent}{\param{wxEvtHandler}{ *handler}, \param{wxEventFunction}{ func}, \param{wxEvent\& }{event}}
|
||||
|
||||
This function simply invokes the given method \arg{func} of the specified
|
||||
event handler \arg{handler} with the \arg{event} as parameter. It exists solely
|
||||
to allow to catch the C++ exceptions which could be thrown by all event
|
||||
handlers in the application in one place: if you want to do this, override this
|
||||
function in your wxApp-derived class and add try/catch clause(s) to it.
|
||||
|
||||
|
||||
\membersection{wxApp::Yield}\label{wxappyield}
|
||||
|
||||
\func{bool}{Yield}{\param{bool}{ onlyIfNeeded = false}}
|
||||
|
75
docs/latex/wx/texcept.tex
Normal file
75
docs/latex/wx/texcept.tex
Normal file
@@ -0,0 +1,75 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: texcept.tex
|
||||
%% Purpose: C++ exceptions and wxWindows overview
|
||||
%% Author: Vadim Zeitlin
|
||||
%% Modified by:
|
||||
%% Created: 17.09.03
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) 2003 Vadim Zeitlin
|
||||
%% License: wxWindows license
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{C++ exceptions overview}\label{exceptionsoverview}
|
||||
|
||||
\subsection{Introduction}
|
||||
|
||||
wxWindows had been started long before the exceptions were introduced in C++ so
|
||||
it is not very surprizing that it is not built around using them as some more
|
||||
modern C++ libraries are. For instance, the library doesn't throw exceptions to
|
||||
signal about the errors. Moreover, up to (and including) the version 2.4 of
|
||||
wxWindows, even using the exceptions in the user code was dangerous because the
|
||||
library code wasn't exception-safe and so an exception propagating through it
|
||||
could result in memory and/or resource leaks, and also not very convenient.
|
||||
|
||||
Starting from the version 2.5.1 wxWindows becomes more exception-friendly. It
|
||||
still doesn't use the exceptions by itself but it should be now safe to use the
|
||||
exceptions in the user code and the library tries to help you with this. Please
|
||||
note that making the library exception-safe is still work in progress.
|
||||
|
||||
|
||||
\subsection{Strategies for exceptions handling}
|
||||
|
||||
There are several choice for using the exceptions in wxWindows programs. First
|
||||
of all, you may not use them at all. As stated above, the library doesn't throw
|
||||
any exceptions by itself and so you don't have to worry about exceptions at all
|
||||
unless your own code throws them. This is, of course, the simplest solution but
|
||||
may be not the best one to deal with all possible errors.
|
||||
|
||||
Another strategy is to use exceptions only to signal truly fatal errors. In
|
||||
this case you probably don't expect to recover from them and the default
|
||||
behaviour -- to simply terminate the program -- may be appropriate. If it is
|
||||
not, you may override \helpref{OnUnhandledException()}{wxapponunhandledexception}
|
||||
in your wxApp-derived class to perform any clean up tasks. Note, however, that
|
||||
any information about the exact exception type is lost when this function is
|
||||
called, so if you need you should override \helpref{OnRun()}{wxapponrun} and
|
||||
add a try/catch clause around the call of the base class version. This would
|
||||
allow you to catch any exceptions generated during the execution of the main
|
||||
event loop. To deal with the exceptions which may arise during the program
|
||||
startup and/or shutdown you should insert try/catch clauses in
|
||||
\helpref{OnInit()}{wxapponinit} and/or \helpref{OnExit()}{wxappoxexit} as well.
|
||||
|
||||
Finally, you may also want to continue running even when certain exceptions
|
||||
occur. If all of your exceptions may happen only in the event handlers of a
|
||||
single class (or only in the classes derived from it), you may centralize your
|
||||
exception handling code in \helpref{ProcessEvent}{wxevthandlerprocessevent}
|
||||
method of this class. If this is impractical, you may also consider overriding
|
||||
the \helpref{wxApp::HandleEvent()}{wxapphandleevent} which allows you to handle
|
||||
all the exceptions thrown by any event handler.
|
||||
|
||||
|
||||
\subsection{Technicalities}
|
||||
|
||||
To use any kind of exception support in the library you need to build it with
|
||||
\texttt{wxUSE\_EXCEPTIONS} set to $1$. This should be the case by default but
|
||||
if it isn't, you should edit the \texttt{include/wx/msw/setup.h} file under
|
||||
Windows or run \texttt{configure} with \texttt{--enable-exceptions} argument
|
||||
under Unix.
|
||||
|
||||
On the other hand, if you do \emph{not} plan to use exceptions, setting this
|
||||
flag to $0$ or using \texttt{--disable-exceptions} could result in a leaner and
|
||||
slightly faster library.
|
||||
|
||||
As for any other library feature, there is a \helpref{sample}{sampleexcept}
|
||||
showing how to use it. Please look at its sources for further information.
|
||||
|
||||
|
@@ -25,6 +25,7 @@ This chapter contains a selection of topic overviews, first things first:
|
||||
\input texpr.tex
|
||||
\input fs.tex
|
||||
\input tevent.tex
|
||||
\input texcept.tex
|
||||
\input tstyles.tex
|
||||
\input tdelwin.tex
|
||||
\input tdialog.tex
|
||||
|
@@ -44,6 +44,7 @@ Finally, it might be helpful to do a search in the entire sample directory if
|
||||
you can't find the sample you showing the control you are interested in by
|
||||
name. Most of wxWindows classes, occur in at least one of the samples.
|
||||
|
||||
|
||||
\subsection{Minimal sample}\label{sampleminimal}
|
||||
|
||||
The minimal sample is what most people will know under the term Hello World,
|
||||
@@ -51,6 +52,7 @@ i.e. a minimal program that doesn't demonstrate anything apart from what is
|
||||
needed to write a program that will display a "hello" dialog. This is usually
|
||||
a good starting point for learning how to use wxWindows.
|
||||
|
||||
|
||||
\subsection{Art provider sample}\label{sampleartprovider}
|
||||
|
||||
The {\tt artprov} sample shows how you can customize the look of standard
|
||||
@@ -58,12 +60,14 @@ wxWindows dialogs by replacing default bitmaps/icons with your own versions.
|
||||
It also shows how you can use wxArtProvider to
|
||||
get stock bitmaps for use in your application.
|
||||
|
||||
|
||||
\subsection{Calendar sample}\label{samplecalendar}
|
||||
|
||||
This font shows the \helpref{calendar control}{wxcalendarctrl} in action. It
|
||||
shows how to configure the control (see the different options in the calendar
|
||||
menu) and also how to process the notifications from it.
|
||||
|
||||
|
||||
\subsection{Checklist sample}\label{samplechecklist}
|
||||
|
||||
This sample demonstrates the use of the \helpref{wxCheckListBox}{wxchecklistbox}
|
||||
@@ -74,6 +78,7 @@ the parent class \helpref{wxListBox}{wxlistbox} so the sample tests that class
|
||||
as well). The layout of the dialog is created using a \helpref{wxBoxSizer}{wxboxsizer}
|
||||
demonstrating a simple dynamic layout.
|
||||
|
||||
|
||||
\subsection{Config sample}\label{sampleconfig}
|
||||
|
||||
This sample demonstrates the \helpref{wxConfig}{wxconfigbase} classes in a platform
|
||||
@@ -83,6 +88,7 @@ Unix and uses the Registry under Windows.
|
||||
See \helpref{wxConfig overview}{wxconfigoverview} for the descriptions of all
|
||||
features of this class.
|
||||
|
||||
|
||||
\subsection{Controls sample}\label{samplecontrols}
|
||||
|
||||
The controls sample is the main test program for most simple controls used in
|
||||
@@ -115,17 +121,20 @@ The various controls tested are listed here:
|
||||
\twocolitem{\helpref{wxSlider}{wxslider}}{A slider that can be dragged by the user}
|
||||
\end{twocollist}
|
||||
|
||||
|
||||
\subsection{Database sample}\label{sampledb}
|
||||
|
||||
The database sample is a small test program showing how to use the ODBC
|
||||
classes written by Remstar Intl. Obviously, this sample requires a
|
||||
database with ODBC support to be correctly installed on your system.
|
||||
|
||||
|
||||
\subsection{Dialogs sample}\label{sampledialogs}
|
||||
|
||||
This sample shows how to use the common dialogs available from wxWindows. These
|
||||
dialogs are described in details in the \helpref{Common dialogs overview}{commondialogsoverview}.
|
||||
|
||||
|
||||
\subsection{Dialup sample}\label{sampledialup}
|
||||
|
||||
This sample shows \helpref{wxDialUpManager}{wxdialupmanager}
|
||||
@@ -139,6 +148,7 @@ Using the menu entries, you may also dial or hang up the line if you have a
|
||||
modem attached and (this only makes sense for Windows) list the available
|
||||
connections.
|
||||
|
||||
|
||||
\subsection{DnD sample}\label{samplednd}
|
||||
|
||||
This sample shows both clipboard and drag and drop in action. It is quite non
|
||||
@@ -177,6 +187,7 @@ programs as well - try Write/Wordpad, for example).
|
||||
Take a look at DnDShapeDataObject class to see how you may use
|
||||
\helpref{wxDataObject}{wxdataobject} to achieve this.
|
||||
|
||||
|
||||
\subsection{Dynamic sample}\label{sampledynamic}
|
||||
|
||||
This sample is a very small sample that demonstrates the use of the
|
||||
@@ -189,6 +200,7 @@ forms or similar datagrams can be created by the uses.
|
||||
|
||||
See also the \helpref{event sample}{sampleevent}
|
||||
|
||||
|
||||
\subsection{Event sample}\label{sampleevent}
|
||||
|
||||
The event sample demonstrates various features of the wxWindows events. It
|
||||
@@ -199,6 +211,19 @@ during the run time and also using
|
||||
|
||||
It replaces the old dynamic sample.
|
||||
|
||||
|
||||
\subsection{Except(ions) sample}\label{sampleexcept}
|
||||
|
||||
This very simple sample shows how to use C++ exceptions in wxWindows programs,
|
||||
i.e. where to catch the exception which may be thrown by the program code. It
|
||||
doesn't do anything very exciting by itself, you need to study its code to
|
||||
understand what goes on.
|
||||
|
||||
You need to build the library with \texttt{wxUSE\_EXCEPTIONS} being set to $1$
|
||||
and compile your code with the C++ exceptions support to be able to build this
|
||||
sample.
|
||||
|
||||
|
||||
\subsection{Exec sample}\label{sampleexec}
|
||||
|
||||
The exec sample demonstrates the \helpref{wxExecute}{wxexecute} and
|
||||
@@ -211,6 +236,7 @@ synchronous and asynchronous cases and how to kill the processes with
|
||||
\helpref{wxProcess::Kill}{wxprocesskill} and test for their existence with
|
||||
\helpref{wxProcess::Exists}{wxprocessexists}.
|
||||
|
||||
|
||||
\subsection{Font sample}\label{samplefont}
|
||||
|
||||
The font sample demonstrates \helpref{wxFont}{wxfont},
|
||||
@@ -219,10 +245,12 @@ The font sample demonstrates \helpref{wxFont}{wxfont},
|
||||
available (to wxWindows) on the computer and shows all characters of the
|
||||
chosen font as well.
|
||||
|
||||
|
||||
\subsection{Grid sample}\label{samplegrid}
|
||||
|
||||
TODO.
|
||||
|
||||
|
||||
\subsection{HTML samples}\label{samplehtml}
|
||||
|
||||
Eight HTML samples (you can find them in directory {\tt samples/html})
|
||||
@@ -254,6 +282,7 @@ documents without much work. In fact, only few function calls are sufficient.
|
||||
while {\it Helpview} is simple tool that only pops up help window and
|
||||
displays help books given at command line.
|
||||
|
||||
|
||||
\subsection{Image sample}\label{sampleimage}
|
||||
|
||||
The image sample demonstrates the use of the \helpref{wxImage}{wximage} class
|
||||
@@ -272,6 +301,7 @@ specifying the foreground and background colours with
|
||||
bitmap is then converted to a wxImage and the foreground colour (black) is
|
||||
replaced with red using \helpref{wxImage::Replace}{wximagereplace}.
|
||||
|
||||
|
||||
\subsection{Internat(ionalization) sample}\label{sampleinternat}
|
||||
|
||||
The not very clearly named internat sample demonstrates the wxWindows
|
||||
@@ -283,6 +313,7 @@ changing the other aspects of the programs behaviour.
|
||||
More information about this sample can be found in the {\tt readme.txt} file in
|
||||
its directory. Please see also \helpref{i18n overview}{internationalization}.
|
||||
|
||||
|
||||
\subsection{Layout sample}\label{samplelayout}
|
||||
|
||||
The layout sample demonstrates the two different layout systems offered
|
||||
@@ -300,6 +331,7 @@ showing how to use sizers in connection with a \helpref{wxNotebook}{wxnotebook}
|
||||
class. See also \helpref{wxNotebookSizer}{wxnotebooksizer} and
|
||||
\helpref{wxSizer}{wxsizer}.
|
||||
|
||||
|
||||
\subsection{Listctrl sample}\label{samplelistctrl}
|
||||
|
||||
This sample shows \helpref{wxListCtrl}{wxlistctrl} control. Different modes
|
||||
@@ -310,6 +342,7 @@ The sample also provides some timings for adding/deleting/sorting a lot of
|
||||
(several thousands) items into the control.
|
||||
|
||||
|
||||
|
||||
\subsection{Notebook sample}\label{samplenotebook}
|
||||
|
||||
This samples shows two controls at once: although initially it was written to
|
||||
@@ -319,6 +352,7 @@ controls you need to manually change \texttt{TEST\_LISTBOOK} definition in the
|
||||
file \texttt{notebook.h} and rebuild the sample.
|
||||
|
||||
|
||||
|
||||
\subsection{Render sample}\label{samplerender}
|
||||
|
||||
This sample shows how to replace the default wxWindows
|
||||
@@ -326,6 +360,7 @@ This sample shows how to replace the default wxWindows
|
||||
(DLL) implementing a renderer and load and unload it during the run-time.
|
||||
|
||||
|
||||
|
||||
\subsection{Rotate sample}\label{samplerotate}
|
||||
|
||||
This is a simple example which demonstrates how to rotate an image with
|
||||
@@ -334,6 +369,7 @@ be done without interpolation (left mouse button) which will be faster,
|
||||
or with interpolation (right mouse button) which is slower but gives
|
||||
better results.
|
||||
|
||||
|
||||
\subsection{Scroll subwindow sample}\label{samplescrollsub}
|
||||
|
||||
This sample demonstrates the use of the \helpref{wxScrolledWindow}{wxscrolledwindow}
|
||||
@@ -346,6 +382,7 @@ in particular using the \helpref{wxWindow::IsExposed}{wxwindowisexposed} method
|
||||
the aim to prevent unnecessary drawing in the window and thus reducing or removing
|
||||
flicker on screen.
|
||||
|
||||
|
||||
\subsection{Sockets sample}\label{samplesockets}
|
||||
|
||||
The sockets sample demonstrates how to use the communication facilities
|
||||
@@ -398,6 +435,7 @@ The sockets sample is work in progress. Some things to do:
|
||||
\item New samples which actually do something useful (suggestions accepted).
|
||||
\end{itemize}
|
||||
|
||||
|
||||
\subsection{Statbar sample}\label{samplestatbar}
|
||||
|
||||
This sample shows how to create and use wxStatusBar. Although most of the
|
||||
@@ -408,6 +446,7 @@ Here you can see how to recreate the statusbar (with possibly different number
|
||||
of fields) and how to use it to show icons/bitmaps and/or put arbitrary
|
||||
controls into it.
|
||||
|
||||
|
||||
\subsection{Text sample}\label{sampletext}
|
||||
|
||||
This sample demonstrates four features: firstly the use and many variants of
|
||||
@@ -429,6 +468,7 @@ best known from pasting text to the XTerm program.
|
||||
Last not least: some of the text controls have tooltips and the sample also shows
|
||||
how tooltips can be centrally disabled and their latency controlled.
|
||||
|
||||
|
||||
\subsection{Thread sample}\label{samplethread}
|
||||
|
||||
This sample demonstrates the use of threads in connection with GUI programs.
|
||||
@@ -449,6 +489,7 @@ used and tested in the sample as well.
|
||||
|
||||
See also \helpref{Multithreading overview}{wxthreadoverview} and \helpref{wxThread}{wxthread}.
|
||||
|
||||
|
||||
\subsection{Toolbar sample}\label{sampletoolbar}
|
||||
|
||||
The toolbar sample shows the \helpref{wxToolBar}{wxtoolbar} class in action.
|
||||
@@ -477,6 +518,7 @@ see the radio toolbar buttons in action: the first three buttons form a radio
|
||||
group, that is checking any of them automatically unchecks the previously
|
||||
checked one.
|
||||
|
||||
|
||||
\subsection{Treectrl sample}\label{sampletreectrl}
|
||||
|
||||
This sample demonstrates using \helpref{wxTreeCtrl}{wxtreectrl} class. Here
|
||||
@@ -488,6 +530,7 @@ Adding, inserting and deleting items and branches from the tree as well as
|
||||
sorting (in default alphabetical order as well as in custom one) is
|
||||
demonstrated here as well - try the corresponding menu entries.
|
||||
|
||||
|
||||
\subsection{Wizard sample}\label{samplewizard}
|
||||
|
||||
This sample shows so-called wizard dialog (implemented using
|
||||
|
Reference in New Issue
Block a user