]> git.saurik.com Git - wxWidgets.git/blame_incremental - interface/tipdlg.h
fixed links to global variables; fixed categories; use @see instead of @seealso
[wxWidgets.git] / interface / tipdlg.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: tipdlg.h
3// Purpose: documentation for wxTipProvider class
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxTipProvider
11 @wxheader{tipdlg.h}
12
13 This is the class used together with wxShowTip function.
14 It must implement wxTipProvider::GetTip function and return the
15 current tip from it (different tip each time it is called).
16
17 You will never use this class yourself, but you need it to show startup tips
18 with wxShowTip. Also, if you want to get the tips text from elsewhere than a
19 simple text file, you will want to derive a new class from wxTipProvider and
20 use it instead of the one returned by wxCreateFileTipProvider.
21
22 @library{wxadv}
23 @category{FIXME}
24
25 @seealso
26 @ref overview_tipsoverview "Startup tips overview", ::wxShowTip
27*/
28class wxTipProvider
29{
30public:
31 /**
32 Constructor.
33
34 @param currentTip
35 The starting tip index.
36 */
37 wxTipProvider(size_t currentTip);
38
39 /**
40 Returns the index of the current tip (i.e. the one which would be returned by
41 GetTip).
42 The program usually remembers the value returned by this function after calling
43 wxShowTip. Note that it is not the same as the value which
44 was passed to wxShowTip + 1 because the user might have pressed the "Next"
45 button in the tip dialog.
46 */
47 size_t GetCurrentTip() const;
48
49 /**
50 Return the text of the current tip and pass to the next one. This function is
51 pure virtual, it should be implemented in the derived classes.
52 */
53 wxString GetTip();
54
55 /**
56 Returns a modified tip. This function will be called immediately after read,
57 and before being check whether it is a comment, an empty string or a string
58 to translate. You can optionally override this in your custom user-derived
59 class
60 to optionally to modify the tip as soon as it is read. You can return any
61 modification to the string. If you return wxEmptyString, then this tip is
62 skipped, and the next one is read.
63 */
64 virtual wxString PreProcessTip(const wxString& tip);
65};
66
67
68// ============================================================================
69// Global functions/macros
70// ============================================================================
71
72/**
73 This function creates a wxTipProvider which may be
74 used with wxShowTip.
75
76 @param filename
77 The name of the file containing the tips, one per line
78 @param currentTip
79 The index of the first tip to show - normally this index
80 is remembered between the 2 program runs.
81
82 @see @ref overview_tipsoverview "Tips overview"
83*/
84wxTipProvider* wxCreateFileTipProvider(const wxString& filename,
85 size_t currentTip);
86