~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to wxPython/src/_popupwin.i

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////////////////////
 
2
// Name:        _popupwin.i
 
3
// Purpose:     SWIG interface defs for wxPopupWindow and derived classes
 
4
//
 
5
// Author:      Robin Dunn
 
6
//
 
7
// Created:     22-Dec-1998
 
8
// RCS-ID:      $Id: _popupwin.i 52876 2008-03-27 21:35:38Z RD $
 
9
// Copyright:   (c) 2003 by Total Control Software
 
10
// Licence:     wxWindows license
 
11
/////////////////////////////////////////////////////////////////////////////
 
12
 
 
13
// Not a %module
 
14
 
 
15
 
 
16
//---------------------------------------------------------------------------
 
17
 
 
18
%{
 
19
#include <wx/popupwin.h>
 
20
%}
 
21
 
 
22
//---------------------------------------------------------------------------
 
23
%newgroup;
 
24
 
 
25
MustHaveApp(wxPopupWindow);
 
26
 
 
27
// wxPopupWindow: a special kind of top level window used for popup menus,
 
28
// combobox popups and such.
 
29
MustHaveApp(wxPopupWindow);
 
30
 
 
31
class wxPopupWindow : public wxWindow {
 
32
public:
 
33
    %pythonAppend wxPopupWindow         "self._setOORInfo(self)"
 
34
    %pythonAppend wxPopupWindow()       ""
 
35
    
 
36
    wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
 
37
    %RenameCtor(PrePopupWindow, wxPopupWindow());
 
38
 
 
39
    bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
 
40
 
 
41
    // move the popup window to the right position, i.e. such that it is
 
42
    // entirely visible
 
43
    //
 
44
    // the popup is positioned at ptOrigin + size if it opens below and to the
 
45
    // right (default), at ptOrigin - sizePopup if it opens above and to the
 
46
    // left &c
 
47
    //
 
48
    // the point must be given in screen coordinates!
 
49
    void Position(const wxPoint& ptOrigin,
 
50
                  const wxSize& size);
 
51
};
 
52
 
 
53
 
 
54
//---------------------------------------------------------------------------
 
55
%newgroup;
 
56
 
 
57
%{
 
58
class wxPyPopupTransientWindow : public wxPopupTransientWindow
 
59
{
 
60
public:
 
61
    wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
 
62
    wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
 
63
        : wxPopupTransientWindow(parent, style) {}
 
64
 
 
65
    DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
 
66
    DEC_PYCALLBACK__(OnDismiss);
 
67
    DEC_PYCALLBACK_BOOL_(CanDismiss);
 
68
    PYPRIVATE;
 
69
};
 
70
 
 
71
 
 
72
IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
 
73
IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
 
74
IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
 
75
%}
 
76
 
 
77
 
 
78
MustHaveApp(wxPyPopupTransientWindow);
 
79
 
 
80
// wxPopupTransientWindow: a wxPopupWindow which disappears automatically
 
81
// when the user clicks mouse outside it or if it loses focus in any other way
 
82
 
 
83
%rename(PopupTransientWindow) wxPyPopupTransientWindow;
 
84
class wxPyPopupTransientWindow : public wxPopupWindow
 
85
{
 
86
public:
 
87
    %pythonAppend wxPyPopupTransientWindow         "self._setOORInfo(self);" setCallbackInfo(PopupTransientWindow)
 
88
    %pythonAppend wxPyPopupTransientWindow()       ""
 
89
    
 
90
    wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
 
91
    %RenameCtor(PrePopupTransientWindow, wxPyPopupTransientWindow());
 
92
 
 
93
    void _setCallbackInfo(PyObject* self, PyObject* _class);
 
94
 
 
95
    // popup the window (this will show it too) and keep focus at winFocus
 
96
    // (or itself if it's NULL), dismiss the popup if we lose focus
 
97
    virtual void Popup(wxWindow *focus = NULL);
 
98
 
 
99
    // hide the window
 
100
    virtual void Dismiss();
 
101
 
 
102
    virtual bool CanDismiss();
 
103
    virtual bool ProcessLeftDown(wxMouseEvent& event);
 
104
 
 
105
};
 
106
 
 
107
//---------------------------------------------------------------------------