2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tipdlg.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxTipProvider
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxTipProvider
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
This is the class used together with wxShowTip() function.
|
2008-03-08 13:52:38 +00:00
|
|
|
It must implement wxTipProvider::GetTip function and return the
|
|
|
|
current tip from it (different tip each time it is called).
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00: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 15:24:38 +00:00
|
|
|
use it instead of the one returned by wxCreateFileTipProvider().
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxadv}
|
2008-10-04 11:55:28 +00:00
|
|
|
@category{misc}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-04 11:55:28 +00:00
|
|
|
@see @ref overview_tips, ::wxShowTip
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
class wxTipProvider
|
2008-03-08 13:52:38 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param currentTip
|
2008-03-09 12:33:59 +00:00
|
|
|
The starting tip index.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
wxTipProvider(size_t currentTip);
|
|
|
|
|
2012-04-17 17:00:36 +00:00
|
|
|
virtual ~wxTipProvider();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
2012-12-01 00:14:07 +00:00
|
|
|
Returns the index of the current tip (i.e.\ the one which would be returned by GetTip()).
|
2008-10-04 11:55:28 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
The program usually remembers the value returned by this function after calling
|
2008-10-04 11:55:28 +00:00
|
|
|
wxShowTip(). Note that it is not the same as the value which was passed to
|
|
|
|
wxShowTip + 1 because the user might have pressed the "Next" button in
|
|
|
|
the tip dialog.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
size_t GetCurrentTip() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-10-04 11:55:28 +00: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.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-13 13:24:43 +00:00
|
|
|
virtual wxString GetTip() = 0;
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
// ============================================================================
|
|
|
|
// Global functions/macros
|
|
|
|
// ============================================================================
|
|
|
|
|
2009-01-05 20:48:06 +00:00
|
|
|
/** @addtogroup group_funcmacro_dialog */
|
2008-03-18 19:30:01 +00:00
|
|
|
//@{
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
2008-03-18 19:30:01 +00:00
|
|
|
This function creates a wxTipProvider which may be used with wxShowTip().
|
2008-03-08 14:43:31 +00:00
|
|
|
|
|
|
|
@param filename
|
2008-03-18 19:30:01 +00:00
|
|
|
The name of the file containing the tips, one per line.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param currentTip
|
2008-03-18 19:30:01 +00:00
|
|
|
The index of the first tip to show. Normally this index is remembered
|
|
|
|
between the 2 program runs.
|
|
|
|
|
|
|
|
@see @ref overview_tips
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-18 19:30:01 +00:00
|
|
|
@header{wx/tipdlg.h}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxTipProvider* wxCreateFileTipProvider(const wxString& filename,
|
|
|
|
size_t currentTip);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2008-03-18 19:30:01 +00:00
|
|
|
/**
|
|
|
|
This function shows a "startup tip" to the user. The return value is the
|
|
|
|
state of the "Show tips at startup" checkbox.
|
|
|
|
|
|
|
|
@param parent
|
|
|
|
The parent window for the modal dialog.
|
|
|
|
@param tipProvider
|
|
|
|
An object which is used to get the text of the tips. It may be created
|
|
|
|
with the wxCreateFileTipProvider() function.
|
|
|
|
@param showAtStartup
|
|
|
|
Should be true if startup tips are shown, false otherwise. This is
|
|
|
|
used as the initial value for "Show tips at startup" checkbox which is
|
|
|
|
shown in the tips dialog.
|
|
|
|
|
|
|
|
@see @ref overview_tips
|
|
|
|
|
|
|
|
@header{wx/tipdlg.h}
|
|
|
|
*/
|
|
|
|
bool wxShowTip(wxWindow *parent,
|
|
|
|
wxTipProvider *tipProvider,
|
|
|
|
bool showAtStartup = true);
|
|
|
|
|
|
|
|
//@}
|
|
|
|
|