git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@562
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
wxPyMenu::wxPyMenu(const wxString& title, PyObject* _func)
: wxMenu(title, (wxFunction)(func ? MenuCallback : NULL)), func(0) {
wxPyMenu::wxPyMenu(const wxString& title, PyObject* _func)
: wxMenu(title, (wxFunction)(func ? MenuCallback : NULL)), func(0) {
Py_DECREF(evtobj);
Py_DECREF(menuobj);
}
Py_DECREF(evtobj);
Py_DECREF(menuobj);
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.4 1998/08/16 04:31:06 RD
+// More wxGTK work.
+//
// Revision 1.3 1998/08/15 07:36:36 RD
// - Moved the header in the .i files out of the code that gets put into
// the .cpp files. It caused CVS conflicts because of the RCS ID being
// Revision 1.3 1998/08/15 07:36:36 RD
// - Moved the header in the .i files out of the code that gets put into
// the .cpp files. It caused CVS conflicts because of the RCS ID being
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class wxPyMenu : public wxMenu {
public:
wxPyMenu(const wxString& title = "", PyObject* func=NULL);
class wxPyMenu : public wxMenu {
public:
wxPyMenu(const wxString& title = "", PyObject* func=NULL);
static void MenuCallback(wxMenu& menu, wxCommandEvent& evt);
PyObject* func;
};
static void MenuCallback(wxMenu& menu, wxCommandEvent& evt);
PyObject* func;
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/16 04:31:09 RD
+// More wxGTK work.
+//
// Revision 1.2 1998/08/14 23:36:37 RD
// Beginings of wxGTK compatibility
//
// Revision 1.2 1998/08/14 23:36:37 RD
// Beginings of wxGTK compatibility
//
long wxExecute(const wxString& command, bool sync = FALSE);
wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
long wxExecute(const wxString& command, bool sync = FALSE);
wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
wxWindow * wxGetActiveWindow();
long wxGetElapsedTime(bool resetTimer = TRUE);
wxWindow * wxGetActiveWindow();
long wxGetElapsedTime(bool resetTimer = TRUE);
long wxGetFreeMemory();
void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
bool wxIsBusy();
wxString wxNow();
bool wxShell(const wxString& command = wxPyEmptyStr);
long wxGetFreeMemory();
void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
bool wxIsBusy();
wxString wxNow();
bool wxShell(const wxString& command = wxPyEmptyStr);
bool wxYield();
int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
bool wxYield();
int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
//---------------------------------------------------------------------------
// Accelerator Entry and Table
//---------------------------------------------------------------------------
// Accelerator Entry and Table
class wxAcceleratorEntry {
public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0);
class wxAcceleratorEntry {
public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0);
// ~wxAcceleratorEntry(); *** ?
};
// ~wxAcceleratorEntry(); *** ?
};
//---------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
//---------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/16 04:31:10 RD
+// More wxGTK work.
+//
// Revision 1.2 1998/08/15 07:36:41 RD
// - Moved the header in the .i files out of the code that gets put into
// the .cpp files. It caused CVS conflicts because of the RCS ID being
// Revision 1.2 1998/08/15 07:36:41 RD
// - Moved the header in the .i files out of the code that gets put into
// the .cpp files. It caused CVS conflicts because of the RCS ID being
- //void Center(int direction = wxHORIZONTAL);
+ void Center(int direction = wxHORIZONTAL);
void Centre(int direction = wxHORIZONTAL);
void ClientToScreen(int *BOTH, int *BOTH);
bool Close(int force = FALSE);
void Centre(int direction = wxHORIZONTAL);
void ClientToScreen(int *BOTH, int *BOTH);
bool Close(int force = FALSE);
#endif
void Enable(bool enable);
//bool FakePopupMenu(wxMenu* menu, int x, int y);
#endif
void Enable(bool enable);
//bool FakePopupMenu(wxMenu* menu, int x, int y);
+ %name(FindWindowByID) wxWindow* FindWindow(long id);
+ %name(FindWindowByName) wxWindow* FindWindow(const wxString& name);
void Fit();
wxColour GetBackgroundColour();
void Fit();
wxColour GetBackgroundColour();
int GetCharHeight();
int GetCharWidth();
int GetCharHeight();
int GetCharWidth();
void GetClientSize(int *OUTPUT, int *OUTPUT);
wxLayoutConstraints * GetConstraints();
#ifdef __WXMSW__
void GetClientSize(int *OUTPUT, int *OUTPUT);
wxLayoutConstraints * GetConstraints();
#ifdef __WXMSW__
#endif
//wxEvtHandler* GetEventHandler();
wxFont* GetFont();
#endif
//wxEvtHandler* GetEventHandler();
wxFont* GetFont();
wxColour GetForegroundColour();
wxWindow * GetGrandParent();
wxColour GetForegroundColour();
wxWindow * GetGrandParent();
int GetId();
void GetPosition(int *OUTPUT, int *OUTPUT);
int GetId();
void GetPosition(int *OUTPUT, int *OUTPUT);
-#ifdef __WXMSW__
- wxString& GetLabel();
- wxString& GetName();
-#else
wxString GetLabel();
wxString GetName();
wxString GetLabel();
wxString GetName();
wxWindow * GetParent();
int GetReturnCode();
int GetScrollThumb(int orientation);
int GetScrollPos(int orientation);
int GetScrollRange(int orientation);
void GetSize(int *OUTPUT, int *OUTPUT);
wxWindow * GetParent();
int GetReturnCode();
int GetScrollThumb(int orientation);
int GetScrollPos(int orientation);
int GetScrollRange(int orientation);
void GetSize(int *OUTPUT, int *OUTPUT);
void GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT); // int* descent = NULL, int* externalLeading = NULL, const wxFont* font = NULL, bool use16 = FALSE)
void GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT); // int* descent = NULL, int* externalLeading = NULL, const wxFont* font = NULL, bool use16 = FALSE)
-#endif
-#ifdef __WXMSW__
- wxString& GetTitle();
-#else
long GetWindowStyleFlag();
void InitDialog();
bool IsEnabled();
bool IsRetained();
bool IsShown();
void Layout();
long GetWindowStyleFlag();
void InitDialog();
bool IsEnabled();
bool IsRetained();
bool IsShown();
void Layout();
bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL);
bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL);
void Lower();
void MakeModal(bool flag);
void Move(int x, int y);
void Lower();
void MakeModal(bool flag);
void Move(int x, int y);
void SetDoubleClick(bool allowDoubleClick);
void SetFocus();
void SetFont(const wxFont& font);
void SetDoubleClick(bool allowDoubleClick);
void SetFocus();
void SetFont(const wxFont& font);
void SetForegroundColour(const wxColour& colour);
void SetForegroundColour(const wxColour& colour);
void SetId(int id);
void SetName(const wxString& name);
void SetReturnCode(int retCode);
void SetId(int id);
void SetName(const wxString& name);
void SetReturnCode(int retCode);
void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1);
void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1);
void SetClientSize(int width, int height);
//void SetPalette(wxPalette* palette);
//void SetColourMap(wxColourMap *colourMap);
void SetClientSize(int width, int height);
//void SetPalette(wxPalette* palette);
//void SetColourMap(wxColourMap *colourMap);
bool CreateStatusBar(int number = 1);
wxMenuBar* GetMenuBar();
wxStatusBar* GetStatusBar();
bool CreateStatusBar(int number = 1);
wxMenuBar* GetMenuBar();
wxStatusBar* GetStatusBar();
-#ifdef __WXMSW__
- wxString& GetTitle();
-#else
-#endif
-#ifdef __WXMSW__
void Iconize(bool iconize);
bool IsIconized();
void Iconize(bool iconize);
bool IsIconized();
- void SetAcceleratorTable(const wxAcceleratorTable& accel);
void Maximize(bool maximize);
void Maximize(bool maximize);
+#ifdef __WXMSW__
+ void SetAcceleratorTable(const wxAcceleratorTable& accel);
#endif
void SetIcon(const wxIcon& icon);
void SetMenuBar(wxMenuBar* menuBar);
#endif
void SetIcon(const wxIcon& icon);
void SetMenuBar(wxMenuBar* menuBar);
void Centre(int direction = wxBOTH);
void EndModal(int retCode);
wxString GetTitle();
void Centre(int direction = wxBOTH);
void EndModal(int retCode);
wxString GetTitle();
void Iconize(bool iconize);
bool IsIconized();
void SetModal(bool flag);
void Iconize(bool iconize);
bool IsIconized();
void SetModal(bool flag);
bool IsModal();
void SetTitle(const wxString& title);
bool Show(bool show);
bool IsModal();
void SetTitle(const wxString& title);
bool Show(bool show);
void Enable(int id, bool enable);
int FindItem(const wxString& itemString);
#ifdef __WXMSW__
void Enable(int id, bool enable);
int FindItem(const wxString& itemString);
#ifdef __WXMSW__
- wxMenuItem* FindItemForId(int id);
- wxString& GetHelpString(int id);
- wxString GetLabel(int id);
- void SetHelpString(int id, const wxString& helpString);
void SetTitle(const wxString& title);
#endif
void SetTitle(const wxString& title);
#endif
+ wxMenuItem* FindItemForId(int id);
+ wxString GetHelpString(int id);
+ wxString GetLabel(int id);
+ void SetHelpString(int id, const wxString& helpString);
bool IsChecked(int id);
bool IsEnabled(int id);
void SetLabel(int id, const wxString& label);
};
bool IsChecked(int id);
bool IsEnabled(int id);
void SetLabel(int id, const wxString& label);
};
//
// This one knows how to set a callback and handle INC- and DECREFing it. To
// be used for PopupMenus, but you must retain a referece to it while using
//
// This one knows how to set a callback and handle INC- and DECREFing it. To
// be used for PopupMenus, but you must retain a referece to it while using
wxPyMenu(const wxString& title = wxPyEmptyStr, PyObject* func = NULL);
~wxPyMenu();
};
wxPyMenu(const wxString& title = wxPyEmptyStr, PyObject* func = NULL);
~wxPyMenu();
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
void Check(int id, bool flag);
bool Checked(int id);
void Enable(int id, bool enable);
void Check(int id, bool flag);
bool Checked(int id);
void Enable(int id, bool enable);
int FindMenuItem(const wxString& menuString, const wxString& itemString);
int FindMenuItem(const wxString& menuString, const wxString& itemString);
+#ifdef __WXGTK__
+ %name(FindItemForId) wxMenuItem* FindMenuItemById( int id );
+#endif
- void EnableTop(int pos, bool enable);
wxMenuItem * FindItemForId(int id);
wxMenuItem * FindItemForId(int id);
+ void EnableTop(int pos, bool enable);
wxString GetHelpString(int id);
wxString GetLabel(int id);
void SetHelpString(int id, const wxString& helpString);
wxString GetHelpString(int id);
wxString GetLabel(int id);
void SetHelpString(int id, const wxString& helpString);
wxString GetLabelTop(int pos);
void SetLabelTop(int pos, const wxString& label);
#endif
wxString GetLabelTop(int pos);
void SetLabelTop(int pos, const wxString& label);
#endif
+ int GetMenuCount();
+ wxMenu* GetMenu(int i);
bool IsSeparator();
bool IsEnabled();
bool IsChecked();
bool IsSeparator();
bool IsEnabled();
bool IsChecked();
int GetId();
wxMenu* GetSubMenu();
#ifdef __WXMSW__
int GetId();
wxMenu* GetSubMenu();
#ifdef __WXMSW__
- const wxString& GetHelp();
void SetName(const wxString& strName);
void SetName(const wxString& strName);
- void SetHelp(const wxString& strHelp);
-#endif
- void Enable(bool bDoEnable = TRUE);
- void Check(bool bDoCheck = TRUE);
-#ifdef __WXMSW__
void DeleteSubMenu();
const wxString& GetName();
#endif
void DeleteSubMenu();
const wxString& GetName();
#endif
+ const wxString& GetHelp();
+ void SetHelp(const wxString& strHelp);
+ void Enable(bool bDoEnable = TRUE);
+ void Check(bool bDoCheck = TRUE);
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.4 1998/08/16 04:31:11 RD
+// More wxGTK work.
+//
// Revision 1.3 1998/08/15 07:36:47 RD
// - Moved the header in the .i files out of the code that gets put into
// the .cpp files. It caused CVS conflicts because of the RCS ID being
// Revision 1.3 1998/08/15 07:36:47 RD
// - Moved the header in the .i files out of the code that gets put into
// the .cpp files. It caused CVS conflicts because of the RCS ID being