More fixes for wxPopupWindow.
More SWIGged code updates. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,7 +44,7 @@ _treeList = [
|
||||
'wxStatusBar', 'wxNotebook',
|
||||
'wxHtmlWindow',
|
||||
'wxStyledTextCtrl_1', 'wxStyledTextCtrl_2',
|
||||
##'wxPopupWindow',
|
||||
'wxPopupWindow',
|
||||
]),
|
||||
|
||||
('Common Dialogs', ['wxColourDialog', 'wxDirDialog', 'wxFileDialog',
|
||||
|
@@ -34,7 +34,10 @@ class TestPopup(wxPopupWindow):
|
||||
|
||||
def OnMouseLeftDown(self, evt):
|
||||
self.ldPos = evt.GetEventObject().ClientToScreen(evt.GetPosition())
|
||||
self.wPos = self.GetParent().ClientToScreen(self.GetPosition())
|
||||
if wxPlatform == "__WXMSW__": # this is weird...
|
||||
self.wPos = self.GetParent().ClientToScreen(self.GetPosition())
|
||||
else:
|
||||
self.wPos = self.GetPosition()
|
||||
self.CaptureMouse()
|
||||
|
||||
def OnMouseMotion(self, evt):
|
||||
@@ -47,7 +50,6 @@ class TestPopup(wxPopupWindow):
|
||||
def OnMouseLeftUp(self, evt):
|
||||
self.ReleaseMouse()
|
||||
|
||||
|
||||
def OnRightUp(self, evt):
|
||||
self.Show(false)
|
||||
self.Destroy()
|
||||
@@ -55,10 +57,12 @@ class TestPopup(wxPopupWindow):
|
||||
|
||||
class TestTransientPopup(wxPopupTransientWindow):
|
||||
"""Adds a bit of text and mouse movement to the wxPopupWindow"""
|
||||
def __init__(self, parent, style):
|
||||
def __init__(self, parent, style, log):
|
||||
wxPopupTransientWindow.__init__(self, parent, style)
|
||||
self.SetBackgroundColour("#FFB6C1")
|
||||
st = wxStaticText(self, -1,
|
||||
self.log = log
|
||||
panel = wxPanel(self, -1)
|
||||
panel.SetBackgroundColour("#FFB6C1")
|
||||
st = wxStaticText(panel, -1,
|
||||
"wxPopupTransientWindow is a\n"
|
||||
"wxPopupWindow which disappears\n"
|
||||
"automatically when the user\n"
|
||||
@@ -67,9 +71,21 @@ class TestTransientPopup(wxPopupTransientWindow):
|
||||
,
|
||||
pos=(10,10))
|
||||
sz = st.GetBestSize()
|
||||
self.SetSize( (sz.width+20, sz.height+20) )
|
||||
panel.SetSize( (sz.width+20, sz.height+20) )
|
||||
self.SetSize(panel.GetSize())
|
||||
## self.SetBackgroundColour("#FFB6C1")
|
||||
## b = wxButton(self, -1, "this is a Button", (10,10))
|
||||
## sz = b.GetBestSize()
|
||||
## self.SetSize( (sz.width+20, sz.height+20) )
|
||||
|
||||
|
||||
def ProcessLeftDown(self, evt):
|
||||
self.log.write("ProcessLeftDown\n")
|
||||
return false
|
||||
|
||||
def OnDismiss(self):
|
||||
self.log.write("OnDismiss\n")
|
||||
|
||||
|
||||
class TestPanel(wxPanel):
|
||||
def __init__(self, parent, log):
|
||||
@@ -97,15 +113,16 @@ class TestPanel(wxPanel):
|
||||
|
||||
|
||||
def OnShowPopupTransient(self, evt):
|
||||
win = TestTransientPopup(self, wxSIMPLE_BORDER)
|
||||
win = TestTransientPopup(self, wxSIMPLE_BORDER, self.log)
|
||||
|
||||
# show the popup right below or above the button
|
||||
# Show the popup right below or above the button
|
||||
# depending on available screen space...
|
||||
btn = evt.GetEventObject()
|
||||
pos = btn.ClientToScreen( (0,0) )
|
||||
sz = btn.GetSize()
|
||||
win.Position(pos, (0, sz.height))
|
||||
|
||||
win.Popup(btn)
|
||||
win.Popup()
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -585,6 +585,9 @@ class wxTextAttrPtr :
|
||||
val = apply(controlsc.wxTextAttr_GetFont,(self,) + _args, _kwargs)
|
||||
if val: val = wxFontPtr(val)
|
||||
return val
|
||||
def IsDefault(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextAttr_IsDefault,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<C wxTextAttr instance at %s>" % (self.this,)
|
||||
class wxTextAttr(wxTextAttrPtr):
|
||||
@@ -602,23 +605,11 @@ class wxTextCtrlPtr(wxControlPtr):
|
||||
def Create(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Create,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Clear(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Clear,(self,) + _args, _kwargs)
|
||||
def GetValue(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetValue,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Copy(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Copy,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Cut(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Cut,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def DiscardEdits(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_DiscardEdits,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetInsertionPoint(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetInsertionPoint,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetLastPosition(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetLastPosition,(self,) + _args, _kwargs)
|
||||
def SetValue(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetValue,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetLineLength(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetLineLength,(self,) + _args, _kwargs)
|
||||
@@ -629,47 +620,35 @@ class wxTextCtrlPtr(wxControlPtr):
|
||||
def GetNumberOfLines(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetNumberOfLines,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetValue(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetValue,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def IsModified(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_IsModified,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def LoadFile(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_LoadFile,(self,) + _args, _kwargs)
|
||||
def IsEditable(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_IsEditable,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Paste(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Paste,(self,) + _args, _kwargs)
|
||||
def GetSelection(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetSelection,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PositionToXY(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_PositionToXY,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Remove(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Remove,(self,) + _args, _kwargs)
|
||||
def Clear(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Clear,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Replace(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Replace,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Remove(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Remove,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def LoadFile(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_LoadFile,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SaveFile(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SaveFile,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetEditable(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetEditable,(self,) + _args, _kwargs)
|
||||
def DiscardEdits(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_DiscardEdits,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetInsertionPoint(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetInsertionPoint,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetInsertionPointEnd(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetInsertionPointEnd,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetSelection(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetSelection,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetValue(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetValue,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def ShowPosition(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_ShowPosition,(self,) + _args, _kwargs)
|
||||
def SetMaxLength(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetMaxLength,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def WriteText(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_WriteText,(self,) + _args, _kwargs)
|
||||
@@ -677,36 +656,6 @@ class wxTextCtrlPtr(wxControlPtr):
|
||||
def AppendText(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_AppendText,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def XYToPosition(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_XYToPosition,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanCopy(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanCopy,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanCut(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanCut,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanPaste(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanPaste,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanRedo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanRedo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanUndo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanUndo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetSelection(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetSelection,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def IsEditable(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_IsEditable,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Undo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Undo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Redo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Redo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetStyle(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetStyle,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -717,8 +666,65 @@ class wxTextCtrlPtr(wxControlPtr):
|
||||
val = apply(controlsc.wxTextCtrl_GetDefaultStyle,(self,) + _args, _kwargs)
|
||||
if val: val = wxTextAttrPtr(val)
|
||||
return val
|
||||
def SetMaxLength(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetMaxLength,(self,) + _args, _kwargs)
|
||||
def XYToPosition(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_XYToPosition,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PositionToXY(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_PositionToXY,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def ShowPosition(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_ShowPosition,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Copy(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Copy,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Cut(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Cut,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Paste(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Paste,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanCopy(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanCopy,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanCut(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanCut,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanPaste(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanPaste,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Undo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Undo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Redo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_Redo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanUndo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanUndo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CanRedo(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_CanRedo,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetInsertionPoint(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetInsertionPoint,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetInsertionPointEnd(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetInsertionPointEnd,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetInsertionPoint(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetInsertionPoint,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetLastPosition(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_GetLastPosition,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetSelection(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetSelection,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SelectAll(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SelectAll,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetEditable(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_SetEditable,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def write(self, *_args, **_kwargs):
|
||||
val = apply(controlsc.wxTextCtrl_write,(self,) + _args, _kwargs)
|
||||
|
@@ -11489,6 +11489,10 @@ SWIGEXPORT(void) initgdic() {
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP855", PyInt_FromLong((long) wxFONTENCODING_CP855));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP866", PyInt_FromLong((long) wxFONTENCODING_CP866));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP874", PyInt_FromLong((long) wxFONTENCODING_CP874));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP932", PyInt_FromLong((long) wxFONTENCODING_CP932));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP936", PyInt_FromLong((long) wxFONTENCODING_CP936));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP949", PyInt_FromLong((long) wxFONTENCODING_CP949));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP950", PyInt_FromLong((long) wxFONTENCODING_CP950));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP1250", PyInt_FromLong((long) wxFONTENCODING_CP1250));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP1251", PyInt_FromLong((long) wxFONTENCODING_CP1251));
|
||||
PyDict_SetItemString(d,"wxFONTENCODING_CP1252", PyInt_FromLong((long) wxFONTENCODING_CP1252));
|
||||
|
@@ -1268,6 +1268,10 @@ wxFONTENCODING_CP852 = gdic.wxFONTENCODING_CP852
|
||||
wxFONTENCODING_CP855 = gdic.wxFONTENCODING_CP855
|
||||
wxFONTENCODING_CP866 = gdic.wxFONTENCODING_CP866
|
||||
wxFONTENCODING_CP874 = gdic.wxFONTENCODING_CP874
|
||||
wxFONTENCODING_CP932 = gdic.wxFONTENCODING_CP932
|
||||
wxFONTENCODING_CP936 = gdic.wxFONTENCODING_CP936
|
||||
wxFONTENCODING_CP949 = gdic.wxFONTENCODING_CP949
|
||||
wxFONTENCODING_CP950 = gdic.wxFONTENCODING_CP950
|
||||
wxFONTENCODING_CP1250 = gdic.wxFONTENCODING_CP1250
|
||||
wxFONTENCODING_CP1251 = gdic.wxFONTENCODING_CP1251
|
||||
wxFONTENCODING_CP1252 = gdic.wxFONTENCODING_CP1252
|
||||
|
@@ -446,6 +446,14 @@ static void wxEvtHandler_Connect(wxEvtHandler *self,int id,int lastId,int ev
|
||||
(wxObjectEventFunction) &wxPyCallback::EventThunker,
|
||||
new wxPyCallback(func));
|
||||
}
|
||||
else if (func == Py_None) {
|
||||
self->Disconnect(id, lastId, eventType,
|
||||
(wxObjectEventFunction)
|
||||
&wxPyCallback::EventThunker);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected callable object or None.");
|
||||
}
|
||||
}
|
||||
static PyObject *_wrap_wxEvtHandler_Connect(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
|
@@ -103,11 +103,12 @@ public:
|
||||
: wxPopupTransientWindow(parent, style) {}
|
||||
|
||||
DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
|
||||
DEC_PYCALLBACK__(OnDismiss);
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
|
||||
|
||||
IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@@ -234,11 +234,12 @@ public:
|
||||
: wxPopupTransientWindow(parent, style) {}
|
||||
|
||||
DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
|
||||
DEC_PYCALLBACK__(OnDismiss);
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
|
||||
|
||||
IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
|
||||
%}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user