2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tipdlg.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxTipProvider
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxTipProvider
|
|
|
|
@wxheader{tipdlg.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
This is the class used together with wxShowTip() function.
|
2008-03-08 08:52:38 -05:00
|
|
|
It must implement wxTipProvider::GetTip function and return the
|
|
|
|
current tip from it (different tip each time it is called).
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
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
|
2008-03-10 11:24:38 -04:00
|
|
|
use it instead of the one returned by wxCreateFileTipProvider().
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxadv}
|
|
|
|
@category{FIXME}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see @ref overview_tipsoverview "Startup tips overview", ::wxShowTip
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
class wxTipProvider
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param currentTip
|
2008-03-09 08:33:59 -04:00
|
|
|
The starting tip index.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxTipProvider(size_t currentTip);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Returns the index of the current tip (i.e. the one which would be returned by
|
2008-03-08 08:52:38 -05:00
|
|
|
GetTip).
|
2008-03-08 09:43:31 -05:00
|
|
|
The program usually remembers the value returned by this function after calling
|
2008-03-10 11:24:38 -04:00
|
|
|
wxShowTip(). Note that it is not the same as the value which
|
2008-03-08 08:52:38 -05:00
|
|
|
was passed to wxShowTip + 1 because the user might have pressed the "Next"
|
|
|
|
button in the tip dialog.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
size_t GetCurrentTip() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
wxString GetTip();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a modified tip. This function will be called immediately after read,
|
2008-03-08 09:43:31 -05:00
|
|
|
and before being check whether it is a comment, an empty string or a string
|
2008-03-08 08:52:38 -05:00
|
|
|
to translate. You can optionally override this in your custom user-derived
|
2008-03-08 09:43:31 -05:00
|
|
|
class
|
|
|
|
to optionally to modify the tip as soon as it is read. You can return any
|
|
|
|
modification to the string. If you return wxEmptyString, then this tip is
|
2008-03-08 08:52:38 -05:00
|
|
|
skipped, and the next one is read.
|
|
|
|
*/
|
|
|
|
virtual wxString PreProcessTip(const wxString& tip);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
/**
|
|
|
|
This function creates a wxTipProvider which may be
|
2008-03-10 11:24:38 -04:00
|
|
|
used with wxShowTip().
|
2008-03-08 09:43:31 -05:00
|
|
|
|
|
|
|
@param filename
|
2008-03-09 08:33:59 -04:00
|
|
|
The name of the file containing the tips, one per line
|
2008-03-08 09:43:31 -05:00
|
|
|
@param currentTip
|
2008-03-09 08:33:59 -04:00
|
|
|
The index of the first tip to show - normally this index
|
|
|
|
is remembered between the 2 program runs.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see @ref overview_tipsoverview "Tips overview"
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
wxTipProvider* wxCreateFileTipProvider(const wxString& filename,
|
|
|
|
size_t currentTip);
|
2008-03-08 08:52:38 -05:00
|
|
|
|