Add GetTopLevelParent convenience function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -973,8 +973,16 @@ do not change.", "");
|
||||
wxWindow *, GetGrandParent() const,
|
||||
"Returns the parent of the parent of this window, or None if there
|
||||
isn't one.", "");
|
||||
|
||||
|
||||
|
||||
%extend {
|
||||
DocDeclStr(wxWindow *, GetTopLevelParent(),
|
||||
"Returns the first frame or dialog in this window's parental hierarchy.", "")
|
||||
{
|
||||
return wxGetTopLevelParent(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
virtual bool , IsTopLevel() const,
|
||||
@@ -2114,6 +2122,7 @@ opaque.", "");
|
||||
%property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`");
|
||||
%property(ForegroundColour, GetForegroundColour, SetForegroundColour, doc="See `GetForegroundColour` and `SetForegroundColour`");
|
||||
%property(GrandParent, GetGrandParent, doc="See `GetGrandParent`");
|
||||
%property(TopLevelParent, GetTopLevelParent, doc="See `GetTopLevelParent`");
|
||||
%property(Handle, GetHandle, doc="See `GetHandle`");
|
||||
%property(HelpText, GetHelpText, SetHelpText, doc="See `GetHelpText` and `SetHelpText`");
|
||||
%property(Id, GetId, SetId, doc="See `GetId` and `SetId`");
|
||||
|
@@ -9097,6 +9097,14 @@ class Window(EvtHandler):
|
||||
"""
|
||||
return _core_.Window_GetGrandParent(*args, **kwargs)
|
||||
|
||||
def GetTopLevelParent(*args, **kwargs):
|
||||
"""
|
||||
GetTopLevelParent(self) -> Window
|
||||
|
||||
Returns the first frame or dialog in this window's parental hierarchy.
|
||||
"""
|
||||
return _core_.Window_GetTopLevelParent(*args, **kwargs)
|
||||
|
||||
def IsTopLevel(*args, **kwargs):
|
||||
"""
|
||||
IsTopLevel(self) -> bool
|
||||
@@ -10393,6 +10401,7 @@ class Window(EvtHandler):
|
||||
Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
|
||||
ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
|
||||
GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
|
||||
TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
|
||||
Handle = property(GetHandle,doc="See `GetHandle`")
|
||||
HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
|
||||
Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
|
||||
|
@@ -3885,6 +3885,9 @@ SWIGINTERN PyObject *wxWindow_GetChildren(wxWindow *self){
|
||||
wxWindowList& list = self->GetChildren();
|
||||
return wxPy_ConvertList(&list);
|
||||
}
|
||||
SWIGINTERN wxWindow *wxWindow_GetTopLevelParent(wxWindow *self){
|
||||
return wxGetTopLevelParent(self);
|
||||
}
|
||||
SWIGINTERN bool wxWindow_RegisterHotKey(wxWindow *self,int hotkeyId,int modifiers,int keycode){
|
||||
#if wxUSE_HOTKEY
|
||||
return self->RegisterHotKey(hotkeyId, modifiers, keycode);
|
||||
@@ -36468,6 +36471,36 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_Window_GetTopLevelParent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
wxWindow *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject *swig_obj[1] ;
|
||||
|
||||
if (!args) SWIG_fail;
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxWindow, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Window_GetTopLevelParent" "', expected argument " "1"" of type '" "wxWindow *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< wxWindow * >(argp1);
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
result = (wxWindow *)wxWindow_GetTopLevelParent(arg1);
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
}
|
||||
{
|
||||
resultobj = wxPyMake_wxObject(result, 0);
|
||||
}
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_Window_IsTopLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
@@ -58444,6 +58477,7 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"Window_GetChildren", (PyCFunction)_wrap_Window_GetChildren, METH_O, NULL},
|
||||
{ (char *)"Window_GetParent", (PyCFunction)_wrap_Window_GetParent, METH_O, NULL},
|
||||
{ (char *)"Window_GetGrandParent", (PyCFunction)_wrap_Window_GetGrandParent, METH_O, NULL},
|
||||
{ (char *)"Window_GetTopLevelParent", (PyCFunction)_wrap_Window_GetTopLevelParent, METH_O, NULL},
|
||||
{ (char *)"Window_IsTopLevel", (PyCFunction)_wrap_Window_IsTopLevel, METH_O, NULL},
|
||||
{ (char *)"Window_Reparent", (PyCFunction) _wrap_Window_Reparent, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Window_AddChild", (PyCFunction) _wrap_Window_AddChild, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
|
@@ -9097,6 +9097,14 @@ class Window(EvtHandler):
|
||||
"""
|
||||
return _core_.Window_GetGrandParent(*args, **kwargs)
|
||||
|
||||
def GetTopLevelParent(*args, **kwargs):
|
||||
"""
|
||||
GetTopLevelParent(self) -> Window
|
||||
|
||||
Returns the first frame or dialog in this window's parental hierarchy.
|
||||
"""
|
||||
return _core_.Window_GetTopLevelParent(*args, **kwargs)
|
||||
|
||||
def IsTopLevel(*args, **kwargs):
|
||||
"""
|
||||
IsTopLevel(self) -> bool
|
||||
@@ -10393,6 +10401,7 @@ class Window(EvtHandler):
|
||||
Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
|
||||
ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
|
||||
GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
|
||||
TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
|
||||
Handle = property(GetHandle,doc="See `GetHandle`")
|
||||
HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
|
||||
Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
|
||||
|
@@ -3885,6 +3885,9 @@ SWIGINTERN PyObject *wxWindow_GetChildren(wxWindow *self){
|
||||
wxWindowList& list = self->GetChildren();
|
||||
return wxPy_ConvertList(&list);
|
||||
}
|
||||
SWIGINTERN wxWindow *wxWindow_GetTopLevelParent(wxWindow *self){
|
||||
return wxGetTopLevelParent(self);
|
||||
}
|
||||
SWIGINTERN void wxWindow_SetDoubleBuffered(wxWindow *self,bool on){}
|
||||
SWIGINTERN bool wxWindow_RegisterHotKey(wxWindow *self,int hotkeyId,int modifiers,int keycode){
|
||||
#if wxUSE_HOTKEY
|
||||
@@ -36467,6 +36470,36 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_Window_GetTopLevelParent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
wxWindow *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject *swig_obj[1] ;
|
||||
|
||||
if (!args) SWIG_fail;
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxWindow, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Window_GetTopLevelParent" "', expected argument " "1"" of type '" "wxWindow *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< wxWindow * >(argp1);
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
result = (wxWindow *)wxWindow_GetTopLevelParent(arg1);
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
}
|
||||
{
|
||||
resultobj = wxPyMake_wxObject(result, 0);
|
||||
}
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_Window_IsTopLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
@@ -58443,6 +58476,7 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"Window_GetChildren", (PyCFunction)_wrap_Window_GetChildren, METH_O, NULL},
|
||||
{ (char *)"Window_GetParent", (PyCFunction)_wrap_Window_GetParent, METH_O, NULL},
|
||||
{ (char *)"Window_GetGrandParent", (PyCFunction)_wrap_Window_GetGrandParent, METH_O, NULL},
|
||||
{ (char *)"Window_GetTopLevelParent", (PyCFunction)_wrap_Window_GetTopLevelParent, METH_O, NULL},
|
||||
{ (char *)"Window_IsTopLevel", (PyCFunction)_wrap_Window_IsTopLevel, METH_O, NULL},
|
||||
{ (char *)"Window_Reparent", (PyCFunction) _wrap_Window_Reparent, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Window_AddChild", (PyCFunction) _wrap_Window_AddChild, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
|
@@ -9097,6 +9097,14 @@ class Window(EvtHandler):
|
||||
"""
|
||||
return _core_.Window_GetGrandParent(*args, **kwargs)
|
||||
|
||||
def GetTopLevelParent(*args, **kwargs):
|
||||
"""
|
||||
GetTopLevelParent(self) -> Window
|
||||
|
||||
Returns the first frame or dialog in this window's parental hierarchy.
|
||||
"""
|
||||
return _core_.Window_GetTopLevelParent(*args, **kwargs)
|
||||
|
||||
def IsTopLevel(*args, **kwargs):
|
||||
"""
|
||||
IsTopLevel(self) -> bool
|
||||
@@ -10397,6 +10405,7 @@ class Window(EvtHandler):
|
||||
Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
|
||||
ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
|
||||
GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
|
||||
TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
|
||||
Handle = property(GetHandle,doc="See `GetHandle`")
|
||||
HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
|
||||
Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
|
||||
|
@@ -3884,6 +3884,9 @@ SWIGINTERN PyObject *wxWindow_GetChildren(wxWindow *self){
|
||||
wxWindowList& list = self->GetChildren();
|
||||
return wxPy_ConvertList(&list);
|
||||
}
|
||||
SWIGINTERN wxWindow *wxWindow_GetTopLevelParent(wxWindow *self){
|
||||
return wxGetTopLevelParent(self);
|
||||
}
|
||||
SWIGINTERN void wxWindow_SetDoubleBuffered(wxWindow *self,bool on){}
|
||||
SWIGINTERN bool wxWindow_RegisterHotKey(wxWindow *self,int hotkeyId,int modifiers,int keycode){
|
||||
#if wxUSE_HOTKEY
|
||||
@@ -36452,6 +36455,36 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_Window_GetTopLevelParent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
wxWindow *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject *swig_obj[1] ;
|
||||
|
||||
if (!args) SWIG_fail;
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxWindow, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Window_GetTopLevelParent" "', expected argument " "1"" of type '" "wxWindow *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< wxWindow * >(argp1);
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
result = (wxWindow *)wxWindow_GetTopLevelParent(arg1);
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
}
|
||||
{
|
||||
resultobj = wxPyMake_wxObject(result, 0);
|
||||
}
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_Window_IsTopLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
@@ -58469,6 +58502,7 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"Window_GetChildren", (PyCFunction)_wrap_Window_GetChildren, METH_O, NULL},
|
||||
{ (char *)"Window_GetParent", (PyCFunction)_wrap_Window_GetParent, METH_O, NULL},
|
||||
{ (char *)"Window_GetGrandParent", (PyCFunction)_wrap_Window_GetGrandParent, METH_O, NULL},
|
||||
{ (char *)"Window_GetTopLevelParent", (PyCFunction)_wrap_Window_GetTopLevelParent, METH_O, NULL},
|
||||
{ (char *)"Window_IsTopLevel", (PyCFunction)_wrap_Window_IsTopLevel, METH_O, NULL},
|
||||
{ (char *)"Window_Reparent", (PyCFunction) _wrap_Window_Reparent, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Window_AddChild", (PyCFunction) _wrap_Window_AddChild, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
|
Reference in New Issue
Block a user