CCC=c++
WXWIN=../../..
+
## Pick one of these, or set your own
#TARGETDIR=$(BINLIBDEST)/site-packages/wxPython
TARGETDIR=..
wxpc wxp.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \
mdi.cpp controls.cpp controls2.cpp windows2.cpp cmndlgs.cpp \
-I$(WXWIN)/include -I/usr/lib/glib/include -I$(WXWIN)/src \
- -DSWIG_GLOBAL -D__WXGTK__ -L$(WXWIN)/lib/Linux -lwx_gtk
+# -D__WXDEBUG__ -ldmalloc \
+ -DSWIG_GLOBAL -D__WXGTK__ -L$(WXWIN)/lib/Linux -lwx_gtk \
+ -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11
wxMINOR_VERSION,
wxRELEASE_NUMBER,
+#ifdef __WXMSW__
UNKNOWN,
+#endif
NOT_FOUND,
wxVSCROLL,
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.4 1998/08/18 19:48:11 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.3 1998/08/14 23:36:33 RD
// Beginings of wxGTK compatibility
//
_StdFrameCallbacks(self)
-class wxMiniFrame(wxMiniFramePtr):
- def __init__(self,arg0,arg1,arg2,*args) :
- argl = map(None,args)
- try: argl[0] = argl[0].this
- except: pass
- try: argl[1] = argl[1].this
- except: pass
- args = tuple(argl)
- self.this = apply(windowsc.new_wxMiniFrame,(arg0.this,arg1,arg2,)+args)
- self.thisown = 1
- _StdFrameCallbacks(self)
+if wxPlatform == '__WXMSW__':
+ class wxMiniFrame(wxMiniFramePtr):
+ def __init__(self,arg0,arg1,arg2,*args) :
+ argl = map(None,args)
+ try: argl[0] = argl[0].this
+ except: pass
+ try: argl[1] = argl[1].this
+ except: pass
+ args = tuple(argl)
+ self.this = apply(windowsc.new_wxMiniFrame,(arg0.this,arg1,arg2,)+args)
+ self.thisown = 1
+ _StdFrameCallbacks(self)
class wxPanel(wxPanelPtr):
self.thisown = 1
_StdWindowCallbacks(self)
-class wxSpinButton(wxSpinButtonPtr):
- def __init__(self,arg0,*args) :
- argl = map(None,args)
- try: argl[1] = argl[1].this
- except: pass
- try: argl[2] = argl[2].this
- except: pass
- args = tuple(argl)
- self.this = apply(controlsc.new_wxSpinButton,(arg0.this,)+args)
- self.thisown = 1
- _StdWindowCallbacks(self)
+if wxPlatform == '__WXMSW__':
+ class wxSpinButton(wxSpinButtonPtr):
+ def __init__(self,arg0,*args) :
+ argl = map(None,args)
+ try: argl[1] = argl[1].this
+ except: pass
+ try: argl[2] = argl[2].this
+ except: pass
+ args = tuple(argl)
+ self.this = apply(controlsc.new_wxSpinButton,(arg0.this,)+args)
+ self.thisown = 1
+ _StdWindowCallbacks(self)
class wxStaticBitmap(wxStaticBitmapPtr):
def __init__(self,arg0,arg1,arg2,*args) :
## self.isShown = false
-_defRedirect = (wxPlatform == '__WIN32__')
+_defRedirect = (wxPlatform == '__WXMSW__')
#----------------------------------------------------------------------
# The main application class. Derive from this and implement an OnInit
#----------------------------------------------------------------------------
#
# $Log$
+# Revision 1.2 1998/08/18 19:48:12 RD
+# more wxGTK compatibility things.
+#
+# It builds now but there are serious runtime problems...
+#
# Revision 1.1 1998/08/09 08:25:49 RD
# Initial version
#
bool GetChooseFull();
wxColour& GetColour();
- wxColour& GetCustomColour(int i);
+ wxColour GetCustomColour(int i);
void SetChooseFull(int flag);
void SetColour(const wxColour& colour);
void SetCustomColour(int i, const wxColour& colour);
public:
wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
+#ifdef __WXMSW__
wxColourData& GetColourData();
+#else
+ wxColourData GetColourData();
+#endif
int ShowModal();
};
//----------------------------------------------------------------------
+#ifdef __WXMSW__
class wxDirDialog : public wxDialog {
public:
wxDirDialog(wxWindow* parent,
void SetPath(const wxString& path);
int ShowModal();
};
+#endif
//----------------------------------------------------------------------
//----------------------------------------------------------------------
+#ifdef __WXMSW__
class wxPageSetupData {
public:
wxPageSetupData();
wxPageSetupData& GetPageSetupData();
int ShowModal();
};
+#endif
//----------------------------------------------------------------------
+#ifdef __WXMSW__
class wxPrintData {
public:
wxPrintData();
wxDC* GetPrintDC();
int ShowModal();
};
+#endif
//----------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/18 19:48:13 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.2 1998/08/15 07:36:25 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
%{
#include "helpers.h"
#include <wx/slider.h>
+
+#ifdef __WXMSW__
#include <wx/spinbutt.h>
+#endif
%}
//----------------------------------------------------------------------
class wxControl : public wxWindow {
public:
void Command(wxCommandEvent& event);
- wxString& GetLabel();
+ wxString GetLabel();
void SetLabel(const wxString& label);
};
const wxValidator& validator = wxPyDefaultValidator,
char* name = "button");
+ wxBitmap& GetBitmapLabel();
+#ifdef __WXMSW__
wxBitmap& GetBitmapDisabled();
wxBitmap& GetBitmapFocus();
- wxBitmap& GetBitmapLabel();
wxBitmap& GetBitmapSelected();
void SetBitmapDisabled(const wxBitmap& bitmap);
void SetBitmapFocus(const wxBitmap& bitmap);
- void SetBitmapLabel(const wxBitmap& bitmap);
void SetBitmapSelected(const wxBitmap& bitmap);
+#endif
+ void SetBitmapLabel(const wxBitmap& bitmap);
};
void DiscardEdits();
long GetInsertionPoint();
long GetLastPosition();
+#ifdef __WXMSW__
int GetLineLength(long lineNo);
wxString GetLineText(long lineNo);
int GetNumberOfLines();
+#endif
wxString GetValue();
bool IsModified();
bool LoadFile(const wxString& filename);
void Paste();
+#ifdef __WXMSW__
void PositionToXY(long pos, long *OUTPUT, long *OUTPUT);
+#endif
void Remove(long from, long to);
void Replace(long from, long to, const wxString& value);
bool SaveFile(const wxString& filename);
void SetValue(const wxString& value);
void ShowPosition(long pos);
void WriteText(const wxString& text);
+#ifdef __WXMSW__
long XYToPosition(long x, long y);
+#endif
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
+#ifdef __WXMSW__
class wxSpinButton : public wxControl {
public:
wxSpinButton(wxWindow* parent, wxWindowID id = -1,
void SetRange(int min, int max);
void SetValue(int value);
};
+#endif
//----------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/18 19:48:14 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.2 1998/08/15 07:36:28 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 wxListCtrl : public wxControl {
public:
+#ifdef __WXMSW__
wxListCtrl(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listCtrl");
+#else
+ wxListCtrl(wxWindow* parent, wxWindowID id,
+ const wxPoint& pos = wxPyDefaultPosition,
+ const wxSize& size = wxPyDefaultSize,
+ long style = wxLC_ICON,
+ char* name = "listctrl");
+#endif
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
bool DeleteItem(long item);
bool DeleteAllItems();
bool DeleteColumn(int col);
+#ifdef __WXMSW__
bool DeleteAllColumns(void);
void ClearAll(void);
wxTextCtrl* EditLabel(long item);
bool EndEditLabel(bool cancel);
+#endif
bool EnsureVisible(long item);
long FindItem(long start, const wxString& str, bool partial = FALSE);
%name(FindItemData)long FindItem(long start, long data);
bool GetColumn(int col, wxListItem& item);
int GetColumnWidth(int col);
int GetCountPerPage();
+#ifdef __WXMSW
wxTextCtrl* GetEditControl();
+#endif
wxImageList* GetImageList(int which);
long GetItemData(long item);
int geometry = wxLIST_NEXT_ALL,
int state = wxLIST_STATE_DONTCARE);
int GetSelectedItemCount();
+#ifdef __WXMSW__
wxColour GetTextColour();
+#endif
long GetTopItem();
long HitTest(const wxPoint& point, int& OUTPUT);
%name(InsertColumnWithInfo)long InsertColumn(long col, wxListItem& info);
bool SetItemState(long item, long state, long stateMask);
void SetItemText(long item, const wxString& text);
void SetSingleStyle(long style, bool add = TRUE);
+#ifdef __WXMSW__
void SetTextColour(const wxColour& col);
+#endif
void SetWindowStyleFlag(long style);
// TODO: bool SortItems(wxListCtrlCompare fn, long data);
};
class wxTreeCtrl : public wxControl {
public:
+#ifdef __WXMSW__
wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize,
long style = wxTR_HAS_BUTTONS,
const wxValidator& validator = wxPyDefaultValidator,
char* name = "wxTreeCtrl");
+#else
+ wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
+ const wxPoint& pos = wxPyDefaultPosition,
+ const wxSize& size = wxPyDefaultSize,
+ long style = wxTR_HAS_BUTTONS,
+ char* name = "wxTreeCtrl");
+#endif
bool DeleteAllItems();
+#ifdef __WXMSW__
bool DeleteItem(long item);
+#else
+ void DeleteItem(long item);
+#endif
+#ifdef __WXMSW__
wxTextCtrl* EditLabel(long item);
bool EnsureVisible(long item);
bool ExpandItem(long item, int action);
long GetChild(long item);
+#endif
int GetCount();
+#ifdef __WXMSW__
wxTextCtrl* GetEditControl();
long GetFirstVisibleItem();
+#endif
wxImageList* GetImageList(int which = wxIMAGE_LIST_NORMAL);
int GetIndent();
long GetItemData(long item);
self->GetItem(*info);
return info;
}
+#ifdef __WXMSW__
%new wxRect* GetItemRect(long item, int textOnly = FALSE) {
wxRect* rect = new wxRect;
self->GetItemRect(item, *rect, textOnly);
return rect;
}
+#endif
}
+#ifdef __WXMSW__
int GetItemState(long item, long stateMask);
+#endif
wxString GetItemText(long item);
+#ifdef __WXMSW__
long GetNextItem(long item, int code);
long GetNextVisibleItem(long item);
+#endif
long GetParent(long item);
long GetRootItem();
long GetSelection();
int image = -1, int selImage = -1,
long insertAfter = wxTREE_INSERT_LAST);
bool ItemHasChildren(long item);
+#ifdef __WXMSW__
bool ScrollTo(long item);
+#endif
bool SelectItem(long item);
void SetIndent(int indent);
void SetImageList(wxImageList* imageList, int which = wxIMAGE_LIST_NORMAL);
bool SetItem(wxTreeItem& info);
+#ifdef __WXMSW__
bool SetItemImage(long item, int image, int selImage);
+#else
+ void SetItemImage(long item, int image, int selImage);
+#endif
+#ifdef __WXMSW__
bool SetItemState(long item, long state, long stateMask);
+#endif
void SetItemText(long item, const wxString& text);
bool SetItemData(long item, long data);
+#ifdef __WXMSW__
bool SortChildren(long item);
+#endif
};
//----------------------------------------------------------------------
+#ifdef __WXMSW__
class wxTabEvent : public wxCommandEvent {
public:
};
};
+#endif
+
//----------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/18 19:48:15 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.2 1998/08/15 07:36:30 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
%{
#include "helpers.h"
-
#include <wx/metafile.h>
%}
wxBitmap(const wxString& name, long type);
~wxBitmap();
+#ifdef __WXMSW__
void Create(int width, int height, int depth = -1);
+#endif
int GetDepth();
int GetHeight();
wxPalette* GetPalette();
void SetDepth(int depth);
void SetHeight(int height);
void SetMask(wxMask* mask);
- void SetOk(int isOk);
+#ifdef __WXMSW__
void SetPalette(wxPalette* palette);
+#endif
void SetWidth(int width);
};
class wxIcon : public wxBitmap {
public:
- wxIcon(char *name, long flags);
+#ifdef __WXMSW__
+ wxIcon(const wxString& name, long flags,
+ int desiredWidth = -1, int desiredHeight = -1);
+#endif
~wxIcon();
int GetDepth();
bool Ok();
void SetDepth(int depth);
void SetHeight(int height);
- void SetOk(int isOk);
void SetWidth(int width);
};
class wxCursor : public wxBitmap {
public:
+#ifdef __WXMSW__
wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0);
+#endif
~wxCursor();
bool Ok();
};
int GetStyle();
bool GetUnderlined();
int GetWeight();
+#ifdef __WXMSW__
void SetFaceName(const wxString& faceName);
void SetFamily(int family);
void SetPointSize(int pointSize);
void SetStyle(int style);
void SetUnderlined(bool underlined);
void SetWeight(int weight);
+#endif
};
//----------------------------------------------------------------------
int GetCap();
wxColour& GetColour();
+#ifdef __WXMSW__
// **** This one needs to return a list of ints (wxDash)
int GetDashes(wxDash **dashes);
- int GetJoin();
wxBitmap* GetStipple();
+#endif
+ int GetJoin();
int GetStyle();
int GetWidth();
bool Ok();
void SetCap(int cap_style);
void SetColour(wxColour& colour);
+#ifdef __WXMSW__
void SetDashes(int LCOUNT, wxDash* LIST);
- void SetJoin(int join_style);
void SetStipple(wxBitmap * stipple);
+#endif
+ void SetJoin(int join_style);
void SetStyle(int style);
void SetWidth(int width);
};
wxBitmap * GetStipple();
int GetStyle();
bool Ok();
+#ifdef __WXMSW__
void SetColour(wxColour &colour);
void SetStipple(wxBitmap *bitmap);
void SetStyle(int style);
+#endif
};
//----------------------------------------------------------------------
class wxDC {
public:
- wxDC();
+// wxDC(); **** abstract base class, can't instantiate.
~wxDC();
void BeginDrawing();
void EndDoc();
void EndDrawing();
void EndPage();
+#ifdef __WXWIN__
void FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
+#endif
+#ifdef __WXGTK__
+ void FloodFill(long x, long y, wxColour* colour, int style=wxFLOOD_SURFACE);
+#endif
wxBrush * GetBackground();
wxBrush * GetBrush();
long GetCharHeight();
int GetMapMode();
bool GetOptimization();
wxPen * GetPen();
- //bool GetPixel(int x, int y, wxColour *T_OUTPUT); **** See below.
+ %addmethods {
+ %new wxColour* GetPixel(long x, long y) {
+ wxColour* wc = new wxColour();
+ self->GetPixel(x, y, wc);
+ return wc;
+ }
+ }
void GetSize(int* OUTPUT, int* OUTPUT); //void GetSize(long* OUTPUT, long* OUTPUT);
wxColour& GetTextBackground();
void GetTextExtent(const wxString& string, long *OUTPUT, long *OUTPUT,
%addmethods {
- %new wxColour* GetPixel(long x, long y) {
- wxColor* wc = new wxColor();
- self->GetPixel(x, y, wc);
- return wc;
- }
-
// This one is my own creation...
void DrawBitmap(wxBitmap* bitmap, long x, long y, bool swapPalette=TRUE) {
wxMemoryDC* memDC = new wxMemoryDC;
//---------------------------------------------------------------------------
+#ifdef __WXMSW__
class wxPrinterDC : public wxDC {
public:
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output,
bool interactive = TRUE, int orientation = wxPORTRAIT);
};
+#endif
//---------------------------------------------------------------------------
+#ifdef __WXMSW__
class wxMetaFileDC : public wxDC {
public:
wxMetaFileDC(const wxString& filename = wxPyEmptyStr);
wxMetaFile* Close();
};
+#endif
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/18 19:48:16 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.2 1998/08/15 07:36:35 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
}
-//----------------------------------------------------------------------
+//---------------------------------------------------------------------
// a few native methods to add to the module
//----------------------------------------------------------------------
wxPythonApp->OnInitGui();
#endif
#ifdef __WXGTK__
- wxTheApp->argc = 0;
- wxTheApp->argv = NULL;
+ wxClassInfo::InitializeClasses();
+ PyObject* sysargv = PySys_GetObject("argv");
+ int argc = PyList_Size(sysargv);
+ char** argv = new char*[argc+1];
+ int x;
+ for(x=0; x<argc; x++)
+ argv[x] = PyString_AsString(PyList_GetItem(sysargv, x));
+ argv[argc] = NULL;
+
+
+ wxTheApp->argc = argc;
+ wxTheApp->argv = argv;
gtk_init( &wxTheApp->argc, &wxTheApp->argv );
wxPythonApp->DeletePendingObjects();
wxPythonApp->OnExit();
#ifdef __WXMSW__
- wxApp::CleanUp();
+ wxApp::CleanUp();
#endif
#ifdef __WXGTK__
- wxApp::CommonCleanUp();
+ wxApp::CommonCleanUp();
#endif
PyErr_SetString(PyExc_SystemExit, "OnInit returned false, exiting...");
return NULL;
}
+ wxTheApp->m_initialized = (wxTopLevelWindows.Number() > 0);
+
Py_INCREF(Py_None);
return Py_None;
}
#define wxPlatform "__GTK__"
#endif
#if defined(__WIN32__) || defined(__WXMSW__)
-#define wxPlatform "__WIN32__"
+#define wxPlatform "__WXMSW__"
#endif
#ifdef __WXMAC__
#define wxPlatform "__MAC__"
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.5 1998/08/18 19:48:17 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.4 1998/08/16 04:31:06 RD
// More wxGTK work.
//
// TODO: This isn't handled by the standard event-table system...
//wxMDIClientWindow* OnCreateClient();
+#ifdef __WXMSW__
void SetToolBar(wxToolBar* toolbar);
+#endif
void Tile();
};
void Activate();
void Maximize();
void Restore();
+
+ void SetMenuBar(wxMenuBar *menu_bar);
+ void SetClientSize(int width, int height);
+ void GetPosition(int* OUTPUT, int* OUTPUT) const ;
+
};
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/18 19:48:18 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.2 1998/08/15 07:36:39 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
#ifdef __WXMSW__
wxWindow * wxGetActiveWindow();
long wxGetElapsedTime(bool resetTimer = TRUE);
-#endif
long wxGetFreeMemory();
+#endif
void wxGetMousePosition(int* OUTPUT, int* OUTPUT);
bool wxIsBusy();
wxString wxNow();
-bool wxShell(const wxString& command = wxPyEmptyStr);
#ifdef __WXMSW__
+bool wxShell(const wxString& command = wxPyEmptyStr);
void wxStartTimer();
+int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
#endif
+
bool wxYield();
-int wxGetOsVersion(int *OUTPUT, int *OUTPUT);
%inline %{
char* wxGetResource(char *section, char *entry, char *file = NULL) {
char * retval;
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.4 1998/08/18 19:48:19 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.3 1998/08/16 04:31:10 RD
// More wxGTK work.
//
const wxString& strText,
bool bSelect = FALSE,
int imageId = -1);
+#ifdef __WXMSW__
bool InsertPage(int nPage,
/*wxNotebookPage*/ wxWindow *pPage,
const wxString& strText,
bool bSelect = FALSE,
int imageId = -1);
+#endif
wxNotebookPage *GetPage(int nPage);
};
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.3 1998/08/18 19:48:20 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.2 1998/08/15 07:36:50 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
#ifdef __WXMSW__
wxApp::Initialize((WXHINSTANCE)wxhInstance);
#endif
-#ifdef __WXGTK__
- wxApp::CommonInit();
-#endif
// wxPyWindows = new wxHashTable(wxKEY_INTEGER, 100);
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
+// Revision 1.4 1998/08/18 19:48:20 RD
+// more wxGTK compatibility things.
+//
+// It builds now but there are serious runtime problems...
+//
// Revision 1.3 1998/08/15 07:36:53 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