File: _tipdlg.i

package info (click to toggle)
wxwidgets2.6 2.6.3.2.1.5%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 83,228 kB
  • ctags: 130,941
  • sloc: cpp: 820,043; ansic: 113,030; python: 107,485; makefile: 42,996; sh: 10,305; lex: 194; yacc: 128; xml: 95; pascal: 74
file content (97 lines) | stat: -rw-r--r-- 3,177 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/////////////////////////////////////////////////////////////////////////////
// Name:        _tipdlg.i
// Purpose:     SWIG defs for wxTip classes and such
//
// Author:      Robin Dunn
//
// Created:     18-June-1999
// RCS-ID:      $Id: _tipdlg.i,v 1.6 2004/09/23 20:23:14 RD Exp $
// Copyright:   (c) 2003 by Total Control Software
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////

// Not a %module


//---------------------------------------------------------------------------
%newgroup

%{
#include <wx/tipdlg.h>
%}

//---------------------------------------------------------------------------


// wxTipProvider - a class which is used by wxTipDialog to get the text of the
// tips
class wxTipProvider
{
public:
    // wxTipProvider(size_t currentTip);  **** Abstract base class
    ~wxTipProvider();

    // get the current tip and update the internal state to return the next tip
    // when called for the next time
    virtual wxString GetTip();

    // get the current tip "index" (or whatever allows the tip provider to know
    // from where to start the next time)
    size_t GetCurrentTip();

    // Allows any user-derived class to optionally override this function to 
    // modify the tip as soon as it is read. If return wxEmptyString, then 
    // the tip is skipped, and the next one is read.
    virtual wxString PreprocessTip(const wxString& tip);
};


// The C++ version of wxPyTipProvider
%{
class wxPyTipProvider : public wxTipProvider {
public:
    wxPyTipProvider(size_t currentTip)
        : wxTipProvider(currentTip) {}

    DEC_PYCALLBACK_STRING__pure(GetTip);
    DEC_PYCALLBACK_STRING_STRING(PreprocessTip);
    PYPRIVATE;
};

IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
IMP_PYCALLBACK_STRING_STRING(wxPyTipProvider, wxTipProvider, PreprocessTip);
%}


// Now let SWIG know about it
class wxPyTipProvider : public wxTipProvider {
public:
    %pythonAppend wxPyTipProvider "self._setCallbackInfo(self, PyTipProvider)"
    wxPyTipProvider(size_t currentTip);

    void _setCallbackInfo(PyObject* self, PyObject* _class);
};



// A dialog which shows a "tip" - a short and helpful messages describing to
// the user some program characteristic. Many programs show the tips at
// startup, so the dialog has "Show tips on startup" checkbox which allows to
// the user to disable this (however, it's the program which should show, or
// not, the dialog on startup depending on its value, not this class).
//
// The function returns True if this checkbox is checked, False otherwise.
MustHaveApp(wxShowTip);
bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = true);

// a function which returns an implementation of wxTipProvider using the
// specified text file as the source of tips (each line is a tip).
%newobject wxCreateFileTipProvider;
MustHaveApp(wxCreateFileTipProvider);
wxTipProvider* wxCreateFileTipProvider(const wxString& filename, size_t currentTip);




//---------------------------------------------------------------------------
//---------------------------------------------------------------------------