Hi,
I find myself in a position where I don’t know where I am
I have a the following layout (attached the layout xrc file):
Where the important facts are that it’s a wxFrame that contains these three resizable panes:
- “wxTreeCtrl” named “TreeView”,
- “wxGrid” named “TableView”
- “wxGrid” named “InspectorView”
Now, I have a function for sorting the data in the grids (in response to a mouse left double click),
but - I don’t know how to determine if the dclick was done while in “TableView” or in “InspectorView”.
I tried FindFocus() and GetLabel(), but neither gave me the correct answer if I dclicked while in the “InspectorView”.grid.
Can you suggest how to find in which grid the dclick was performed ?
Thanks,
Ron.
svm_initial_splitter_windows.xrc (4.87 KB)
Barak, Ron wrote:
Hi,
I find myself in a position where I don't know where I am
I have a the following layout (attached the layout xrc file):
<object class="*wxFrame*" name="svm5parser">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="*wxSplitterWindow*" name="window_1">
<object class="wxPanel" name="window_1_pane_1">
<object class="wxBoxSizer">
<object class="sizeritem">
*<object class="wxTreeCtrl" name="TreeView">*
<object class="wxPanel" name="window_1_pane_2">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="*wxSplitterWindow*" name="window_2">
<object class="wxPanel" name="window_2_pane_1">
<object class="wxBoxSizer">
<object class="sizeritem">
*<object class="wxGrid" name="TableView">*
<object class="wxPanel" name="window_2_pane_2">
<object class="wxBoxSizer">
<object class="sizeritem">
* <object class="wxGrid" name="InspectorView">
* <object class="sizeritem">
<object class="wxStaticText" name="tablecont">
Where the important facts are that it's a wxFrame that contains these three resizable panes:
1. "wxTreeCtrl" named "TreeView",
2. "wxGrid" named "TableView"
3. "wxGrid" named "InspectorView"
Now, I have a function for sorting the data in the grids (in response to a mouse left double click),
but - I don't know how to determine if the dclick was done while in "TableView" or in "InspectorView".
I tried FindFocus() and GetLabel(), but neither gave me the correct answer if I dclicked while in the "InspectorView".grid.
Can you suggest how to find in which grid the dclick was performed ?
Thanks,
Ron.
I would recommend using the GetName() function of your grid instance. So something like this:
myGrid.GetName()
That seems too easy, but I think it might just work.
···
-------------------
Mike Driscoll
Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org
Hi Mike,
Thanks for the suggestion, but it does not work in my app.
I put some prints in my code, and when I dclick while in InspectorView, I get:
189. self.grid.GetLabel()== TableView
190. self.grid.GetName()== TableView
193. self.__dict__['inspector'].GetLabel()== InspectorView
194. self.__dict__['inspector'].GetName()== InspectorView
Since I dclicked while in InspectorView, what I expected was for lines 189 and 193, and lines 190 and 194 to return the same results.
Bye,
Ron.
···
-----Original Message-----
From: Mike Driscoll [mailto:mike@pythonlibrary.org]
Sent: Monday, December 08, 2008 18:04
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] Cannot determin in which SplitterWindow pane a dclick was performed
Barak, Ron wrote:
Hi,
I find myself in a position where I don't know where I am I have a
the following layout (attached the layout xrc file):
<object class="*wxFrame*" name="svm5parser">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="*wxSplitterWindow*" name="window_1">
<object class="wxPanel" name="window_1_pane_1">
<object class="wxBoxSizer">
<object class="sizeritem">
*<object class="wxTreeCtrl"
name="TreeView">*
<object class="wxPanel" name="window_1_pane_2">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="*wxSplitterWindow*"
name="window_2">
<object class="wxPanel"
name="window_2_pane_1">
<object class="wxBoxSizer">
<object class="sizeritem">
*<object
class="wxGrid" name="TableView">*
<object class="wxPanel"
name="window_2_pane_2">
<object class="wxBoxSizer">
<object class="sizeritem">
* <object
class="wxGrid" name="InspectorView">
* <object class="sizeritem">
<object
class="wxStaticText" name="tablecont">
Where the important facts are that it's a wxFrame that contains these
three resizable panes:
1. "wxTreeCtrl" named "TreeView",
2. "wxGrid" named "TableView"
3. "wxGrid" named "InspectorView"
Now, I have a function for sorting the data in the grids (in response
to a mouse left double click), but - I don't know how to determine if
the dclick was done while in "TableView" or in "InspectorView".
I tried FindFocus() and GetLabel(), but neither gave me the correct
answer if I dclicked while in the "InspectorView".grid.
Can you suggest how to find in which grid the dclick was performed ?
Thanks,
Ron.
I would recommend using the GetName() function of your grid instance. So something like this:
myGrid.GetName()
That seems too easy, but I think it might just work.
-------------------
Mike Driscoll
Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org