From 714e6a9e261da3da9185acaa10c67789081a64ec Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 16 Aug 1998 04:31:11 +0000 Subject: [PATCH] More wxGTK work. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxPython/src/helpers.cpp | 6 ++- utils/wxPython/src/helpers.h | 6 ++- utils/wxPython/src/misc.i | 10 ++++- utils/wxPython/src/windows.i | 67 ++++++++++++---------------------- 4 files changed, 41 insertions(+), 48 deletions(-) diff --git a/utils/wxPython/src/helpers.cpp b/utils/wxPython/src/helpers.cpp index 508ad137c5..c7612e140c 100644 --- a/utils/wxPython/src/helpers.cpp +++ b/utils/wxPython/src/helpers.cpp @@ -340,7 +340,6 @@ void wxPyCallback::EventThunker(wxEvent& event) { //--------------------------------------------------------------------------- -#ifdef __WXMSW__ wxPyMenu::wxPyMenu(const wxString& title, PyObject* _func) : wxMenu(title, (wxFunction)(func ? MenuCallback : NULL)), func(0) { @@ -373,7 +372,7 @@ void wxPyMenu::MenuCallback(wxMenu& menu, wxCommandEvent& evt) { Py_DECREF(evtobj); Py_DECREF(menuobj); } -#endif + //--------------------------------------------------------------------------- @@ -1060,6 +1059,9 @@ wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source) { ///////////////////////////////////////////////////////////////////////////// // // $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 diff --git a/utils/wxPython/src/helpers.h b/utils/wxPython/src/helpers.h index 242f154c0f..fedb01c3c3 100644 --- a/utils/wxPython/src/helpers.h +++ b/utils/wxPython/src/helpers.h @@ -74,7 +74,6 @@ public: //--------------------------------------------------------------------------- -#ifdef __WXMSW__ class wxPyMenu : public wxMenu { public: wxPyMenu(const wxString& title = "", PyObject* func=NULL); @@ -84,7 +83,7 @@ private: static void MenuCallback(wxMenu& menu, wxCommandEvent& evt); PyObject* func; }; -#endif + //--------------------------------------------------------------------------- @@ -103,6 +102,9 @@ private: ///////////////////////////////////////////////////////////////////////////// // // $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 // diff --git a/utils/wxPython/src/misc.i b/utils/wxPython/src/misc.i index f8d7ed4b85..713d1a80a2 100644 --- a/utils/wxPython/src/misc.i +++ b/utils/wxPython/src/misc.i @@ -179,14 +179,18 @@ void wxEndBusyCursor(); long wxExecute(const wxString& command, bool sync = FALSE); wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL); wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL); +#ifdef __WXMSW__ wxWindow * wxGetActiveWindow(); long wxGetElapsedTime(bool resetTimer = TRUE); +#endif long wxGetFreeMemory(); void wxGetMousePosition(int* OUTPUT, int* OUTPUT); bool wxIsBusy(); wxString wxNow(); bool wxShell(const wxString& command = wxPyEmptyStr); +#ifdef __WXMSW__ void wxStartTimer(); +#endif bool wxYield(); int wxGetOsVersion(int *OUTPUT, int *OUTPUT); @@ -277,6 +281,7 @@ public: //--------------------------------------------------------------------------- // Accelerator Entry and Table +#ifdef __WXMSW__ class wxAcceleratorEntry { public: wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0); @@ -296,11 +301,14 @@ public: // ~wxAcceleratorEntry(); *** ? }; - +#endif //--------------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////////// // // $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 diff --git a/utils/wxPython/src/windows.i b/utils/wxPython/src/windows.i index 08e6ab1bb1..aa7a4131c1 100644 --- a/utils/wxPython/src/windows.i +++ b/utils/wxPython/src/windows.i @@ -67,7 +67,7 @@ public: void CaptureMouse(); - //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); @@ -78,12 +78,12 @@ public: #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(); -#ifdef __WXMSW__ int GetCharHeight(); int GetCharWidth(); -#endif void GetClientSize(int *OUTPUT, int *OUTPUT); wxLayoutConstraints * GetConstraints(); #ifdef __WXMSW__ @@ -91,42 +91,27 @@ public: #endif //wxEvtHandler* GetEventHandler(); wxFont* GetFont(); -#ifdef __WXMSW__ wxColour GetForegroundColour(); wxWindow * GetGrandParent(); -#endif int GetId(); void GetPosition(int *OUTPUT, int *OUTPUT); -#ifdef __WXMSW__ - wxString& GetLabel(); - wxString& GetName(); -#else wxString GetLabel(); wxString GetName(); -#endif wxWindow * GetParent(); int GetReturnCode(); int GetScrollThumb(int orientation); int GetScrollPos(int orientation); int GetScrollRange(int orientation); void GetSize(int *OUTPUT, int *OUTPUT); -#ifdef __WXMSW__ 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 wxString GetTitle(); -#endif long GetWindowStyleFlag(); void InitDialog(); bool IsEnabled(); bool IsRetained(); bool IsShown(); void Layout(); -#ifdef __WXMSW__ bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL); -#endif void Lower(); void MakeModal(bool flag); void Move(int x, int y); @@ -146,9 +131,7 @@ public: void SetDoubleClick(bool allowDoubleClick); void SetFocus(); void SetFont(const wxFont& font); -#ifdef __WXMSW__ void SetForegroundColour(const wxColour& colour); -#endif void SetId(int id); void SetName(const wxString& name); void SetReturnCode(int retCode); @@ -169,9 +152,7 @@ public: } } -#ifdef __WXMSW__ void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1); -#endif void SetClientSize(int width, int height); //void SetPalette(wxPalette* palette); //void SetColourMap(wxColourMap *colourMap); @@ -215,16 +196,12 @@ public: bool CreateStatusBar(int number = 1); wxMenuBar* GetMenuBar(); wxStatusBar* GetStatusBar(); -#ifdef __WXMSW__ - wxString& GetTitle(); -#else wxString GetTitle(); -#endif -#ifdef __WXMSW__ void Iconize(bool iconize); bool IsIconized(); - void SetAcceleratorTable(const wxAcceleratorTable& accel); void Maximize(bool maximize); +#ifdef __WXMSW__ + void SetAcceleratorTable(const wxAcceleratorTable& accel); #endif void SetIcon(const wxIcon& icon); void SetMenuBar(wxMenuBar* menuBar); @@ -276,11 +253,9 @@ public: void Centre(int direction = wxBOTH); void EndModal(int retCode); wxString GetTitle(); -#ifdef __WXMSW__ void Iconize(bool iconize); bool IsIconized(); void SetModal(bool flag); -#endif bool IsModal(); void SetTitle(const wxString& title); bool Show(bool show); @@ -328,20 +303,19 @@ public: 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); wxString GetTitle(); - void SetHelpString(int id, const wxString& helpString); 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); }; -#ifdef __WXMSW__ // // 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 @@ -352,7 +326,6 @@ public: wxPyMenu(const wxString& title = wxPyEmptyStr, PyObject* func = NULL); ~wxPyMenu(); }; -#endif //---------------------------------------------------------------------- @@ -364,10 +337,14 @@ public: void Check(int id, bool flag); bool Checked(int id); void Enable(int id, bool enable); + bool Enabled(int id); int FindMenuItem(const wxString& menuString, const wxString& itemString); +#ifdef __WXGTK__ + %name(FindItemForId) wxMenuItem* FindMenuItemById( int id ); +#endif #ifdef __WXMSW__ - void EnableTop(int pos, bool enable); 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); @@ -375,6 +352,8 @@ public: wxString GetLabelTop(int pos); void SetLabelTop(int pos, const wxString& label); #endif + int GetMenuCount(); + wxMenu* GetMenu(int i); }; @@ -385,19 +364,18 @@ public: bool IsSeparator(); bool IsEnabled(); bool IsChecked(); + bool IsCheckable(); int GetId(); wxMenu* GetSubMenu(); #ifdef __WXMSW__ - const wxString& GetHelp(); 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 + const wxString& GetHelp(); + void SetHelp(const wxString& strHelp); + void Enable(bool bDoEnable = TRUE); + void Check(bool bDoCheck = TRUE); bool IsCheckable(); }; @@ -405,6 +383,9 @@ public: ///////////////////////////////////////////////////////////////////////////// // // $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