1. wxStaticLine implemented (generic (ugly) and MSW versions)

2. wxTextDialog looks fine under MSW again
3. startup tips added: code, sample, docs
4. read-only text controls don't participate in TAB traversal


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-06-28 21:39:49 +00:00
parent b6bff3019e
commit c50f1fb922
61 changed files with 5596 additions and 1092 deletions

View File

@@ -405,6 +405,27 @@ parameters are optional. However, it is recommended to pass a parent frame
parameter, or (in MS Windows or Motif) the wrong window frame may be brought to
the front when the dialog box is popped up.
\membersection{::wxCreateFileTipProvider}\label{wxcreatefiletipprovider}
\func{wxTipProvider *}{wxCreateFileTipProvider}{
\param{const wxString\& }{filename},
\param{size\_t }{currentTip}}
This function creates a \helpref{wxTipProvider}{wxtipprovider} which may be
used with \helpref{wxShowTip}{wxshowtip}.
\docparam{filename}{The name of the file containing the tips, one per line}
\docparam{currentTip}{The index of the first tip to show - normally this index
is remembered between the 2 program runs.}
\wxheading{See also:}
\helpref{Tips overview}{tipsoverview}
\wxheading{Include files}
<wx/tipdlg.h>
\membersection{::wxFileSelector}\label{wxfileselector}
\func{wxString}{wxFileSelector}{\param{const wxString\& }{message}, \param{const wxString\& }{default\_path = ""},\\
@@ -585,6 +606,33 @@ The symbols are not shown when the generic function is used.
<wx/msgdlg.h>
\membersection{::wxShowTip}\label{wxshowtip}
\func{bool}{wxShowTip}{
\param{wxWindow *}{parent},
\parent{wxTipProvider *}{tipProvider},
\param{bool }{showAtStartup = TRUE}}
This function shows a "startup tip" to the user.
\docparam{parent}{The parent window for the modal dialog}
\docparam{tipProvider}{An object which is used to get the text of the tips.
It may be created with
\helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider} function.}
\docparam{showAtStartup}{Should be TRUE if startup tips are shown, FALSE
otherwise. This is used as the initial value for "Show tips at startup"
checkbox which is shown in the tips dialog.}
\wxheading{See also:}
\helpref{Tips overview}{tipsoverview}
\wxheading{Include files}
<wx/tipdlg.h>
\section{GDI functions}\label{gdifunctions}
The following are relevant to the GDI (Graphics Device Interface).

View File

@@ -19,10 +19,14 @@ streambuf\\
\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The callback function will
receive the message wxEVENT\_TYPE\_TEXT\_ENTER\_COMMAND. Note
that this will break tab traversal for this panel item under
Windows.}
\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The control will generate
the message wxEVENT\_TYPE\_TEXT\_ENTER\_COMMAND (otherwise pressing <Enter> is
either processed internally by the control or used for navigation between
dialog controls).}
\twocolitem{\windowstyle{wxTE\_PROCESS\_TAB}}{The control will receieve
EVT\_CHAR messages for TAB pressed - normally, TAB is used for passing to the
next control in a dialog instead. For the control created with this style,
you can still use Ctrl-Enter to pass to the next control from the keyboard.}
\twocolitem{\windowstyle{wxTE\_MULTILINE}}{The text control allows multiple lines.}
\twocolitem{\windowstyle{wxTE\_PASSWORD}}{The text will be echoed as asterisks.}
\twocolitem{\windowstyle{wxTE\_READONLY}}{The text will not be user-editable.}

52
docs/latex/wx/tipprov.tex Normal file
View File

@@ -0,0 +1,52 @@
\section{\class{wxTipProvider}}\label{wxtipprovider}
This is the class used together with \helpref{wxShowTip}{wxshowtip} function.
It must implement \helpref{GetTip}{wxtipprovidergettip} function and return the
current tip from it (different tip each time it is called).
You will never use this class yourself, but you need it to show startup tips
with wxShowTip. Also, if you want to get the tips text from elsewhere than a
simple text file, you will want to derive a new class from wxTipProvider and
use it instead of the one returned by
\helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider}.
\wxheading{Derived from}
None.
\wxheading{Include files}
<wx/tipdlg.h>
\wxheading{See also}
\helpref{Startup tips overview}{tipsoverview}, \helpref{::wxShowTip}{wxshowtip}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTipProvider::wxTipProvider}\label{wxtipproviderctor}
\func{}{wxTipProvider}{\param{size\_t }{currentTip}}
Constructor.
\docparam{currentTip}{The starting tip index.}
\membersection{wxTipProvider::GetTip}{wxtipprovidergettip}
\func{wxString}{GetTip}{\void}
Return the text of the current tip and pass to the next one. This function is
pure virtual, it should be implemented in the derived classes.
\membersection{wxCurrentTipProvider::GetCurrentTip}{wxtipprovidergetcurrenttip}
\constfunc{size\_t}{GetCurrentTip}{\void}
Returns the index of the current tip (i.e. the one which would be returned by
GetTip).
The program usually remembers the value returned by this function after calling
\helpref{wxShowTip}{wxshowtip}. Note that it is not the same as the value which
was passed to wxShowTip $+ 1$ because the user might have pressed the "Next"
button in the tip dialog.

View File

@@ -42,3 +42,4 @@ This chapter contains a selection of topic overviews.
\input ti18n.tex
\input tstream.tex
\input tusage.tex
\input ttips.tex

42
docs/latex/wx/ttips.tex Normal file
View File

@@ -0,0 +1,42 @@
\section{Startup tips overview}\label{tipsoverview}
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
the advanced users of the program, the experience shows that the tips may be
quite helpful for the novices and so more and more programs now do this.
For a wxWindows programmer, implementing this feature is extremely easy. To
show a tip, it's enough to just call \helpref{wxShowTip}{wxshowtip} function
like this:
\begin{verbatim}
if ( ...show tips at startup?... )
{
wxTipProvider *tipProvider = wxCreateFileTipProvider("tips.txt", 0);
wxShowTip(windowParent, tipProvider);
delete tipProvider;
}
\end{verbatim}
Of course, you need to get the text of the tips from somewhere - in the example
above, the text is supposed to be in the file tips.txt from where it's read by
the {\it tip provider}. The tip provider is just an object of a class deriving
from \helpref{wxTipProvider}{wxtipprovider}. It has to implement one pure
virtual function of the base class: \helpref{GetTip}{wxtipprovidergettip}.
In the case of the tip provider created by
\helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider}, the tips are just
the lines of the text file.
If you want to implement your own tip provider (for example, if you wish to
hardcode the tips inside your program), you just have to derive another class
from wxTipProvider and pass a pointer to the object of this class to wxShowTip
- then you don't need wxCreateFileTipProvider at all.
Finally, you will probably want to save somewhere the index of the tip last
shown - so that the program doesn't always show the same tip on startup. As you
also need to remember whether to show tips or not (you shouldn't do it if the
user unchecked "Show tips on startup" checkbox in the dialog), you will
probably want to store both the index of the
last shown tip (as returned by
\helpref{wxTipProvider::GetCurrentTip}{wxtipprovidergetcurrenttip} and the flag
telling whether to show the tips at startup at all.