]> git.saurik.com Git - wxWidgets.git/blame_incremental - utils/wxPython/src/helpers.h
Just a teeny change -- addition of wxFrame::IsMaximized. For wxMDIChildFrame
[wxWidgets.git] / utils / wxPython / src / helpers.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: helpers.h
3// Purpose: Helper functions/classes for the wxPython extenaion module
4//
5// Author: Robin Dunn
6//
7// Created: 7/1/97
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef __wxp_helpers__
14#define __wxp_helpers__
15
16#include <wx/wx.h>
17
18
19//----------------------------------------------------------------------
20
21class wxPyApp: public wxApp
22{
23public:
24 int MainLoop(void);
25 bool OnInit(void);
26 void AfterMainLoop(void);
27};
28
29extern wxPyApp *wxPythonApp;
30
31//----------------------------------------------------------------------
32
33void __wxPreStart();
34PyObject* __wxStart(PyObject*, PyObject* args);
35
36extern PyObject* wxPython_dict;
37PyObject* __wxSetDictionary(PyObject*, PyObject* args);
38
39extern wxHashTable* wxPyWindows; // keep track of all windows so we
40 // don't accidentally delete them twice.
41
42void wxPyEventThunker(wxObject*, wxEvent& event);
43
44//----------------------------------------------------------------------
45
46
47#ifndef SWIGCODE
48extern "C" void SWIG_MakePtr(char *, void *, char *);
49extern "C" char *SWIG_GetPtr(char *, void **, char *);
50#endif
51
52
53#ifdef _MSC_VER
54# pragma warning(disable:4800)
55#endif
56
57typedef unsigned char byte;
58
59
60// Non-const versions to keep SWIG happy.
61extern wxPoint wxPyDefaultPosition;
62extern wxSize wxPyDefaultSize;
63extern wxString wxPyEmptyStr;
64
65//----------------------------------------------------------------------
66
67class wxPyCallback : public wxObject {
68public:
69 wxPyCallback(PyObject* func) { m_func = func; Py_INCREF(m_func); }
70 ~wxPyCallback() { Py_DECREF(m_func); }
71
72 void EventThunker(wxEvent& event);
73
74 PyObject* m_func;
75};
76
77//---------------------------------------------------------------------------
78
79class wxPyMenu : public wxMenu {
80public:
81 wxPyMenu(const wxString& title = "", PyObject* func=NULL);
82 ~wxPyMenu();
83
84private:
85 static void MenuCallback(wxMenu& menu, wxCommandEvent& evt);
86 PyObject* func;
87};
88
89
90//---------------------------------------------------------------------------
91
92class wxPyTimer : public wxTimer {
93public:
94 wxPyTimer(PyObject* callback);
95 ~wxPyTimer();
96
97 void Notify();
98
99private:
100 PyObject* func;
101};
102
103//---------------------------------------------------------------------------
104/////////////////////////////////////////////////////////////////////////////
105//
106// $Log$
107// Revision 1.6 1998/11/25 08:45:26 RD
108// Added wxPalette, wxRegion, wxRegionIterator, wxTaskbarIcon
109// Added events for wxGrid
110// Other various fixes and additions
111//
112// Revision 1.5 1998/10/02 06:40:40 RD
113//
114// Version 0.4 of wxPython for MSW.
115//
116// Revision 1.4 1998/08/27 21:59:09 RD
117// Some chicken-and-egg problems solved for wxPython on wxGTK
118//
119// Revision 1.3 1998/08/16 04:31:09 RD
120// More wxGTK work.
121//
122// Revision 1.2 1998/08/14 23:36:37 RD
123// Beginings of wxGTK compatibility
124//
125// Revision 1.1 1998/08/09 08:25:51 RD
126// Initial version
127//
128//
129
130#endif
131