More wxGTK work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1998-08-16 04:31:11 +00:00
parent 2d6dfbb778
commit 714e6a9e26
4 changed files with 41 additions and 48 deletions

View File

@@ -340,7 +340,6 @@ void wxPyCallback::EventThunker(wxEvent& event) {
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifdef __WXMSW__
wxPyMenu::wxPyMenu(const wxString& title, PyObject* _func) wxPyMenu::wxPyMenu(const wxString& title, PyObject* _func)
: wxMenu(title, (wxFunction)(func ? MenuCallback : NULL)), func(0) { : wxMenu(title, (wxFunction)(func ? MenuCallback : NULL)), func(0) {
@@ -373,7 +372,7 @@ void wxPyMenu::MenuCallback(wxMenu& menu, wxCommandEvent& evt) {
Py_DECREF(evtobj); Py_DECREF(evtobj);
Py_DECREF(menuobj); Py_DECREF(menuobj);
} }
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -1060,6 +1059,9 @@ wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source) {
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// $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 // 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 // - 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 // the .cpp files. It caused CVS conflicts because of the RCS ID being

View File

@@ -74,7 +74,6 @@ public:
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#ifdef __WXMSW__
class wxPyMenu : public wxMenu { class wxPyMenu : public wxMenu {
public: public:
wxPyMenu(const wxString& title = "", PyObject* func=NULL); wxPyMenu(const wxString& title = "", PyObject* func=NULL);
@@ -84,7 +83,7 @@ private:
static void MenuCallback(wxMenu& menu, wxCommandEvent& evt); static void MenuCallback(wxMenu& menu, wxCommandEvent& evt);
PyObject* func; PyObject* func;
}; };
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -103,6 +102,9 @@ private:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// $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 // Revision 1.2 1998/08/14 23:36:37 RD
// Beginings of wxGTK compatibility // Beginings of wxGTK compatibility
// //

View File

@@ -179,14 +179,18 @@ void wxEndBusyCursor();
long wxExecute(const wxString& command, bool sync = FALSE); long wxExecute(const wxString& command, bool sync = FALSE);
wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL); wxWindow * wxFindWindowByLabel(const wxString& label, wxWindow *parent=NULL);
wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL); wxWindow * wxFindWindowByName(const wxString& name, wxWindow *parent=NULL);
#ifdef __WXMSW__
wxWindow * wxGetActiveWindow(); wxWindow * wxGetActiveWindow();
long wxGetElapsedTime(bool resetTimer = TRUE); long wxGetElapsedTime(bool resetTimer = TRUE);
#endif
long wxGetFreeMemory(); long wxGetFreeMemory();
void wxGetMousePosition(int* OUTPUT, int* OUTPUT); void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
bool wxIsBusy(); bool wxIsBusy();
wxString wxNow(); wxString wxNow();
bool wxShell(const wxString& command = wxPyEmptyStr); bool wxShell(const wxString& command = wxPyEmptyStr);
#ifdef __WXMSW__
void wxStartTimer(); void wxStartTimer();
#endif
bool wxYield(); bool wxYield();
int wxGetOsVersion(int *OUTPUT, int *OUTPUT); int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
@@ -277,6 +281,7 @@ public:
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Accelerator Entry and Table // Accelerator Entry and Table
#ifdef __WXMSW__
class wxAcceleratorEntry { class wxAcceleratorEntry {
public: public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0); wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0);
@@ -296,11 +301,14 @@ public:
// ~wxAcceleratorEntry(); *** ? // ~wxAcceleratorEntry(); *** ?
}; };
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// $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 // 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 // - 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 // the .cpp files. It caused CVS conflicts because of the RCS ID being

View File

@@ -67,7 +67,7 @@ public:
void CaptureMouse(); void CaptureMouse();
//void Center(int direction = wxHORIZONTAL); void Center(int direction = wxHORIZONTAL);
void Centre(int direction = wxHORIZONTAL); void Centre(int direction = wxHORIZONTAL);
void ClientToScreen(int *BOTH, int *BOTH); void ClientToScreen(int *BOTH, int *BOTH);
bool Close(int force = FALSE); bool Close(int force = FALSE);
@@ -78,12 +78,12 @@ public:
#endif #endif
void Enable(bool enable); void Enable(bool enable);
//bool FakePopupMenu(wxMenu* menu, int x, int y); //bool FakePopupMenu(wxMenu* menu, int x, int y);
%name(FindWindowByID) wxWindow* FindWindow(long id);
%name(FindWindowByName) wxWindow* FindWindow(const wxString& name);
void Fit(); void Fit();
wxColour GetBackgroundColour(); wxColour GetBackgroundColour();
#ifdef __WXMSW__
int GetCharHeight(); int GetCharHeight();
int GetCharWidth(); int GetCharWidth();
#endif
void GetClientSize(int *OUTPUT, int *OUTPUT); void GetClientSize(int *OUTPUT, int *OUTPUT);
wxLayoutConstraints * GetConstraints(); wxLayoutConstraints * GetConstraints();
#ifdef __WXMSW__ #ifdef __WXMSW__
@@ -91,42 +91,27 @@ public:
#endif #endif
//wxEvtHandler* GetEventHandler(); //wxEvtHandler* GetEventHandler();
wxFont* GetFont(); wxFont* GetFont();
#ifdef __WXMSW__
wxColour GetForegroundColour(); wxColour GetForegroundColour();
wxWindow * GetGrandParent(); wxWindow * GetGrandParent();
#endif
int GetId(); int GetId();
void GetPosition(int *OUTPUT, int *OUTPUT); void GetPosition(int *OUTPUT, int *OUTPUT);
#ifdef __WXMSW__
wxString& GetLabel();
wxString& GetName();
#else
wxString GetLabel(); wxString GetLabel();
wxString GetName(); wxString GetName();
#endif
wxWindow * GetParent(); wxWindow * GetParent();
int GetReturnCode(); int GetReturnCode();
int GetScrollThumb(int orientation); int GetScrollThumb(int orientation);
int GetScrollPos(int orientation); int GetScrollPos(int orientation);
int GetScrollRange(int orientation); int GetScrollRange(int orientation);
void GetSize(int *OUTPUT, int *OUTPUT); 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) 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(); wxString GetTitle();
#endif
long GetWindowStyleFlag(); long GetWindowStyleFlag();
void InitDialog(); void InitDialog();
bool IsEnabled(); bool IsEnabled();
bool IsRetained(); bool IsRetained();
bool IsShown(); bool IsShown();
void Layout(); void Layout();
#ifdef __WXMSW__
bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL); bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL);
#endif
void Lower(); void Lower();
void MakeModal(bool flag); void MakeModal(bool flag);
void Move(int x, int y); void Move(int x, int y);
@@ -146,9 +131,7 @@ public:
void SetDoubleClick(bool allowDoubleClick); void SetDoubleClick(bool allowDoubleClick);
void SetFocus(); void SetFocus();
void SetFont(const wxFont& font); void SetFont(const wxFont& font);
#ifdef __WXMSW__
void SetForegroundColour(const wxColour& colour); void SetForegroundColour(const wxColour& colour);
#endif
void SetId(int id); void SetId(int id);
void SetName(const wxString& name); void SetName(const wxString& name);
void SetReturnCode(int retCode); 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); 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 SetClientSize(int width, int height);
//void SetPalette(wxPalette* palette); //void SetPalette(wxPalette* palette);
//void SetColourMap(wxColourMap *colourMap); //void SetColourMap(wxColourMap *colourMap);
@@ -215,16 +196,12 @@ public:
bool CreateStatusBar(int number = 1); bool CreateStatusBar(int number = 1);
wxMenuBar* GetMenuBar(); wxMenuBar* GetMenuBar();
wxStatusBar* GetStatusBar(); wxStatusBar* GetStatusBar();
#ifdef __WXMSW__
wxString& GetTitle();
#else
wxString GetTitle(); wxString GetTitle();
#endif
#ifdef __WXMSW__
void Iconize(bool iconize); void Iconize(bool iconize);
bool IsIconized(); bool IsIconized();
void SetAcceleratorTable(const wxAcceleratorTable& accel);
void Maximize(bool maximize); void Maximize(bool maximize);
#ifdef __WXMSW__
void SetAcceleratorTable(const wxAcceleratorTable& accel);
#endif #endif
void SetIcon(const wxIcon& icon); void SetIcon(const wxIcon& icon);
void SetMenuBar(wxMenuBar* menuBar); void SetMenuBar(wxMenuBar* menuBar);
@@ -276,11 +253,9 @@ public:
void Centre(int direction = wxBOTH); void Centre(int direction = wxBOTH);
void EndModal(int retCode); void EndModal(int retCode);
wxString GetTitle(); wxString GetTitle();
#ifdef __WXMSW__
void Iconize(bool iconize); void Iconize(bool iconize);
bool IsIconized(); bool IsIconized();
void SetModal(bool flag); void SetModal(bool flag);
#endif
bool IsModal(); bool IsModal();
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
bool Show(bool show); bool Show(bool show);
@@ -328,20 +303,19 @@ public:
void Enable(int id, bool enable); void Enable(int id, bool enable);
int FindItem(const wxString& itemString); int FindItem(const wxString& itemString);
#ifdef __WXMSW__ #ifdef __WXMSW__
wxMenuItem* FindItemForId(int id);
wxString& GetHelpString(int id);
wxString GetLabel(int id);
wxString GetTitle(); wxString GetTitle();
void SetHelpString(int id, const wxString& helpString);
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
#endif #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 IsChecked(int id);
bool IsEnabled(int id); bool IsEnabled(int id);
void SetLabel(int id, const wxString& label); void SetLabel(int id, const wxString& label);
}; };
#ifdef __WXMSW__
// //
// This one knows how to set a callback and handle INC- and DECREFing it. To // 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 // 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(const wxString& title = wxPyEmptyStr, PyObject* func = NULL);
~wxPyMenu(); ~wxPyMenu();
}; };
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@@ -364,10 +337,14 @@ public:
void Check(int id, bool flag); void Check(int id, bool flag);
bool Checked(int id); bool Checked(int id);
void Enable(int id, bool enable); void Enable(int id, bool enable);
bool Enabled(int id);
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
#ifdef __WXMSW__ #ifdef __WXMSW__
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 GetHelpString(int id);
wxString GetLabel(int id); wxString GetLabel(int id);
void SetHelpString(int id, const wxString& helpString); void SetHelpString(int id, const wxString& helpString);
@@ -375,6 +352,8 @@ public:
wxString GetLabelTop(int pos); wxString GetLabelTop(int pos);
void SetLabelTop(int pos, const wxString& label); void SetLabelTop(int pos, const wxString& label);
#endif #endif
int GetMenuCount();
wxMenu* GetMenu(int i);
}; };
@@ -385,19 +364,18 @@ public:
bool IsSeparator(); bool IsSeparator();
bool IsEnabled(); bool IsEnabled();
bool IsChecked(); bool IsChecked();
bool IsCheckable();
int GetId(); int GetId();
wxMenu* GetSubMenu(); wxMenu* GetSubMenu();
#ifdef __WXMSW__ #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(); void DeleteSubMenu();
const wxString& GetName(); const wxString& GetName();
#endif #endif
const wxString& GetHelp();
void SetHelp(const wxString& strHelp);
void Enable(bool bDoEnable = TRUE);
void Check(bool bDoCheck = TRUE);
bool IsCheckable(); bool IsCheckable();
}; };
@@ -405,6 +383,9 @@ public:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// $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 // 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 // - 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 // the .cpp files. It caused CVS conflicts because of the RCS ID being