1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declaration of wxTipDialog
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
16 #pragma interface "tipdlg.h"
19 // ----------------------------------------------------------------------------
20 // headers which we must include here
21 // ----------------------------------------------------------------------------
25 #if wxUSE_STARTUP_TIPS
27 #include "wx/textfile.h"
29 // ----------------------------------------------------------------------------
30 // wxTipProvider - a class which is used by wxTipDialog to get the text of the
32 // ----------------------------------------------------------------------------
34 // the abstract base class: it provides the tips, i.e. implements the GetTip()
35 // function which returns the new tip each time it's called. To support this,
36 // wxTipProvider evidently needs some internal state which is the tip "index"
37 // and which should be saved/restored by the program to not always show one and
38 // the same tip (of course, you may use random starting position as well...)
39 class WXDLLEXPORT wxTipProvider
42 wxTipProvider(size_t currentTip
) { m_currentTip
= currentTip
; }
44 // get the current tip and update the internal state to return the next tip
45 // when called for the next time
46 virtual wxString
GetTip() = 0;
48 // get the current tip "index" (or whatever allows the tip provider to know
49 // from where to start the next time)
50 size_t GetCurrentTip() const { return m_currentTip
; }
52 // virtual dtor for the base class
53 virtual ~wxTipProvider() { }
59 // a function which returns an implementation of wxTipProvider using the
60 // specified text file as the source of tips (each line is a tip).
62 // NB: the caller is responsible for deleting the pointer!
63 WXDLLEXPORT wxTipProvider
*wxCreateFileTipProvider(const wxString
& filename
,
66 // ----------------------------------------------------------------------------
68 // ----------------------------------------------------------------------------
70 // A dialog which shows a "tip" - a short and helpful messages describing to
71 // the user some program characteristic. Many programs show the tips at
72 // startup, so the dialog has "Show tips on startup" checkbox which allows to
73 // the user to disable this (however, it's the program which should show, or
74 // not, the dialog on startup depending on its value, not this class).
76 // The function returns TRUE if this checkbox is checked, FALSE otherwise.
77 WXDLLEXPORT
bool wxShowTip(wxWindow
*parent
,
78 wxTipProvider
*tipProvider
,
79 bool showAtStartup
= TRUE
);
81 #endif // wxUSE_STARTUP_TIPS
83 #endif // _WX_TIPDLG_H_