1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG defs for wxTip classes and such
7 // Created: 18-June-1999
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 #include <wx/tipdlg.h>
23 //---------------------------------------------------------------------------
26 // wxTipProvider - a class which is used by wxTipDialog to get the text of the
31 // wxTipProvider(size_t currentTip); **** Abstract base class
34 // get the current tip and update the internal state to return the next tip
35 // when called for the next time
36 virtual wxString GetTip();
38 // get the current tip "index" (or whatever allows the tip provider to know
39 // from where to start the next time)
40 size_t GetCurrentTip();
42 // Allows any user-derived class to optionally override this function to
43 // modify the tip as soon as it is read. If return wxEmptyString, then
44 // the tip is skipped, and the next one is read.
45 virtual wxString PreprocessTip(const wxString& tip);
49 // The C++ version of wxPyTipProvider
51 class wxPyTipProvider : public wxTipProvider {
53 wxPyTipProvider(size_t currentTip)
54 : wxTipProvider(currentTip) {}
56 DEC_PYCALLBACK_STRING__pure(GetTip);
57 DEC_PYCALLBACK_STRING_STRING(PreprocessTip);
61 IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
62 IMP_PYCALLBACK_STRING_STRING(wxPyTipProvider, wxTipProvider, PreprocessTip);
66 // Now let SWIG know about it
67 class wxPyTipProvider : public wxTipProvider {
69 %pythonAppend wxPyTipProvider "self._setCallbackInfo(self, PyTipProvider)"
70 wxPyTipProvider(size_t currentTip);
72 void _setCallbackInfo(PyObject* self, PyObject* _class);
77 // A dialog which shows a "tip" - a short and helpful messages describing to
78 // the user some program characteristic. Many programs show the tips at
79 // startup, so the dialog has "Show tips on startup" checkbox which allows to
80 // the user to disable this (however, it's the program which should show, or
81 // not, the dialog on startup depending on its value, not this class).
83 // The function returns True if this checkbox is checked, False otherwise.
84 bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = True);
86 // a function which returns an implementation of wxTipProvider using the
87 // specified text file as the source of tips (each line is a tip).
88 %newobject wxCreateFileTipProvider;
89 wxTipProvider* wxCreateFileTipProvider(const wxString& filename, size_t currentTip);
94 //---------------------------------------------------------------------------
95 //---------------------------------------------------------------------------