a few bug fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-08-19 01:50:44 +00:00
parent 0f4e4da55c
commit b0b9777d40
18 changed files with 225 additions and 113 deletions

View File

@@ -1 +1 @@
ver = '2.2.0'
ver = '2.2.1'

View File

@@ -575,8 +575,8 @@ public:
size_t num, x;
num = self->GetSelections(array);
for (x=0; x < num; x++) {
PyObject* item = wxPyConstructObject((void*)&array.Item(x),
"wxTreeItemId");
wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
PyList_Append(rval, item);
}
wxPySaveThread(doSave);

View File

@@ -245,7 +245,9 @@ PyObject* __wxSetDictionary(PyObject* /* self */, PyObject* args)
//---------------------------------------------------------------------------
PyObject* wxPyConstructObject(void* ptr, const char* className) {
PyObject* wxPyConstructObject(void* ptr,
const char* className,
int setThisOwn) {
char buff[64]; // should always be big enough...
char swigptr[64];
@@ -263,6 +265,10 @@ PyObject* wxPyConstructObject(void* ptr, const char* className) {
PyObject* obj = PyInstance_New(classobj, arg, NULL);
Py_DECREF(arg);
if (setThisOwn) {
PyObject_SetAttrString(obj, "thisown", PyInt_FromLong(1));
}
return obj;
}

View File

@@ -67,7 +67,9 @@ PyObject* __wxSetDictionary(PyObject*, PyObject* args);
void wxPyEventThunker(wxObject*, wxEvent& event);
HELPEREXPORT PyObject* wxPyConstructObject(void* ptr, const char* className);
HELPEREXPORT PyObject* wxPyConstructObject(void* ptr,
const char* className,
int setThisOwn=0);
HELPEREXPORT bool wxPyRestoreThread();
HELPEREXPORT void wxPySaveThread(bool doSave);
HELPEREXPORT PyObject* wxPy_ConvertList(wxListBase* list, const char* className);

View File

@@ -6167,8 +6167,8 @@ static PyObject * wxPyTreeCtrl_GetSelections(wxPyTreeCtrl *self) {
size_t num, x;
num = self->GetSelections(array);
for (x=0; x < num; x++) {
PyObject* item = wxPyConstructObject((void*)&array.Item(x),
"wxTreeItemId");
wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
PyList_Append(rval, item);
}
wxPySaveThread(doSave);

View File

@@ -86,12 +86,6 @@ class wxValidatorPtr(wxEvtHandlerPtr):
return val
def __repr__(self):
return "<C wxValidator instance at %s>" % (self.this,)
_prop_list_ = {
'window' : ('GetWindow', 'SetWindow'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
class wxValidator(wxValidatorPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxValidator,_args,_kwargs)
@@ -523,43 +517,24 @@ class wxWindowPtr(wxEvtHandlerPtr):
return val
def __repr__(self):
return "<C wxWindow instance at %s>" % (self.this,)
# replaces broken shadow method
# replaces broken shadow methods
def GetCaret(self, *_args, **_kwargs):
from misc2 import wxCaretPtr
val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
if val: val = wxCaretPtr(val)
return val
_prop_list_ = {
'size' : ('GetSize', 'SetSize'),
'enabled' : ('IsEnabled', 'Enable'),
'background' : ('GetBackgroundColour', 'SetBackgroundColour'),
'foreground' : ('GetForegroundColour', 'SetForegroundColour'),
'children' : ('GetChildren', None),
'charHeight' : ('GetCharHeight', None),
'charWidth' : ('GetCharWidth', None),
'clientSize' : ('GetClientSize', 'SetClientSize'),
'font' : ('GetFont', 'SetFont'),
'grandParent' : ('GetGrandParent', None),
'handle' : ('GetHandle', None),
'label' : ('GetLabel', 'SetLabel'),
'name' : ('GetName', 'SetName'),
'parent' : ('GetParent', None),
'position' : ('GetPosition', 'SetPosition'),
'title' : ('GetTitle', 'SetTitle'),
'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'),
'visible' : ('IsShown', 'Show'),
'toolTip' : ('GetToolTip', 'SetToolTip'),
'sizer' : ('GetSizer', 'SetSizer'),
'validator' : ('GetValidator', 'SetValidator'),
'dropTarget' : ('GetDropTarget', 'SetDropTarget'),
'caret' : ('GetCaret', 'SetCaret'),
'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'),
'constraints' : ('GetConstraints', 'SetConstraints'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
def GetSizer(self, *_args, **_kwargs):
from sizers import wxSizerPtr
val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs)
if val: val = wxSizerPtr(val)
return val
def GetToolTip(self, *_args, **_kwargs):
from misc2 import wxToolTipPtr
val = apply(windowsc.wxWindow_GetToolTip,(self,) + _args, _kwargs)
if val: val = wxToolTipPtr(val)
return val
class wxWindow(wxWindowPtr):
def __init__(self,*_args,**_kwargs):

View File

@@ -107,13 +107,13 @@ public:
wxWindow* GetWindow();
void SetWindow(wxWindow* window);
// Properties list
%pragma(python) addtoclass = "
_prop_list_ = {
'window' : ('GetWindow', 'SetWindow'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
"
// // Properties list
// %pragma(python) addtoclass = "
// _prop_list_ = {
// 'window' : ('GetWindow', 'SetWindow'),
// }
// _prop_list_.update(wxEvtHandler._prop_list_)
// "
};
%inline %{
@@ -373,47 +373,59 @@ public:
void SetCaret(wxCaret *caret);
wxCaret *GetCaret();
%pragma(python) addtoclass = "# replaces broken shadow method
%pragma(python) addtoclass = "# replaces broken shadow methods
def GetCaret(self, *_args, **_kwargs):
from misc2 import wxCaretPtr
val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
if val: val = wxCaretPtr(val)
return val
def GetSizer(self, *_args, **_kwargs):
from sizers import wxSizerPtr
val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs)
if val: val = wxSizerPtr(val)
return val
def GetToolTip(self, *_args, **_kwargs):
from misc2 import wxToolTipPtr
val = apply(windowsc.wxWindow_GetToolTip,(self,) + _args, _kwargs)
if val: val = wxToolTipPtr(val)
return val
"
// Properties list
%pragma(python) addtoclass = "
_prop_list_ = {
'size' : ('GetSize', 'SetSize'),
'enabled' : ('IsEnabled', 'Enable'),
'background' : ('GetBackgroundColour', 'SetBackgroundColour'),
'foreground' : ('GetForegroundColour', 'SetForegroundColour'),
'children' : ('GetChildren', None),
'charHeight' : ('GetCharHeight', None),
'charWidth' : ('GetCharWidth', None),
'clientSize' : ('GetClientSize', 'SetClientSize'),
'font' : ('GetFont', 'SetFont'),
'grandParent' : ('GetGrandParent', None),
'handle' : ('GetHandle', None),
'label' : ('GetLabel', 'SetLabel'),
'name' : ('GetName', 'SetName'),
'parent' : ('GetParent', None),
'position' : ('GetPosition', 'SetPosition'),
'title' : ('GetTitle', 'SetTitle'),
'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'),
'visible' : ('IsShown', 'Show'),
'toolTip' : ('GetToolTip', 'SetToolTip'),
'sizer' : ('GetSizer', 'SetSizer'),
'validator' : ('GetValidator', 'SetValidator'),
'dropTarget' : ('GetDropTarget', 'SetDropTarget'),
'caret' : ('GetCaret', 'SetCaret'),
'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'),
'constraints' : ('GetConstraints', 'SetConstraints'),
// // Properties list
// %pragma(python) addtoclass = "
// _prop_list_ = {
// 'size' : ('GetSize', 'SetSize'),
// 'enabled' : ('IsEnabled', 'Enable'),
// 'background' : ('GetBackgroundColour', 'SetBackgroundColour'),
// 'foreground' : ('GetForegroundColour', 'SetForegroundColour'),
// 'children' : ('GetChildren', None),
// 'charHeight' : ('GetCharHeight', None),
// 'charWidth' : ('GetCharWidth', None),
// 'clientSize' : ('GetClientSize', 'SetClientSize'),
// 'font' : ('GetFont', 'SetFont'),
// 'grandParent' : ('GetGrandParent', None),
// 'handle' : ('GetHandle', None),
// 'label' : ('GetLabel', 'SetLabel'),
// 'name' : ('GetName', 'SetName'),
// 'parent' : ('GetParent', None),
// 'position' : ('GetPosition', 'SetPosition'),
// 'title' : ('GetTitle', 'SetTitle'),
// 'style' : ('GetWindowStyleFlag', 'SetWindowStyleFlag'),
// 'visible' : ('IsShown', 'Show'),
// 'toolTip' : ('GetToolTip', 'SetToolTip'),
// 'sizer' : ('GetSizer', 'SetSizer'),
// 'validator' : ('GetValidator', 'SetValidator'),
// 'dropTarget' : ('GetDropTarget', 'SetDropTarget'),
// 'caret' : ('GetCaret', 'SetCaret'),
// 'autoLayout' : ('GetAutoLayout', 'SetAutoLayout'),
// 'constraints' : ('GetConstraints', 'SetConstraints'),
}
_prop_list_.update(wxEvtHandler._prop_list_)
"
// }
// _prop_list_.update(wxEvtHandler._prop_list_)
// "
};
//%clear int* x, int* y;