]>
git.saurik.com Git - wxWidgets.git/blob - interface/tipdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxTipProvider
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
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).
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().
25 @see @ref overview_tipsoverview "Startup tips overview", ::wxShowTip
34 The starting tip index.
36 wxTipProvider(size_t currentTip
);
39 Returns the index of the current tip (i.e. the one which would be returned by
41 The program usually remembers the value returned by this function after calling
42 wxShowTip(). Note that it is not the same as the value which
43 was passed to wxShowTip + 1 because the user might have pressed the "Next"
44 button in the tip dialog.
46 size_t GetCurrentTip() const;
49 Return the text of the current tip and pass to the next one. This function is
50 pure virtual, it should be implemented in the derived classes.
55 Returns a modified tip. This function will be called immediately after read,
56 and before being check whether it is a comment, an empty string or a string
57 to translate. You can optionally override this in your custom user-derived
59 to optionally to modify the tip as soon as it is read. You can return any
60 modification to the string. If you return wxEmptyString, then this tip is
61 skipped, and the next one is read.
63 virtual wxString
PreProcessTip(const wxString
& tip
);
68 // ============================================================================
69 // Global functions/macros
70 // ============================================================================
72 /** @ingroup group_funcmacro_dialog */
76 This function creates a wxTipProvider which may be used with wxShowTip().
79 The name of the file containing the tips, one per line.
81 The index of the first tip to show. Normally this index is remembered
82 between the 2 program runs.
84 @see @ref overview_tips
88 wxTipProvider
* wxCreateFileTipProvider(const wxString
& filename
,
92 This function shows a "startup tip" to the user. The return value is the
93 state of the "Show tips at startup" checkbox.
96 The parent window for the modal dialog.
98 An object which is used to get the text of the tips. It may be created
99 with the wxCreateFileTipProvider() function.
101 Should be true if startup tips are shown, false otherwise. This is
102 used as the initial value for "Show tips at startup" checkbox which is
103 shown in the tips dialog.
105 @see @ref overview_tips
109 bool wxShowTip(wxWindow
*parent
,
110 wxTipProvider
*tipProvider
,
111 bool showAtStartup
= true);