You need access to the right pane that contains the edit control. How to do that depends on how your panes are organised.
I assume a
CSplitterWnd
with two static panes containing a tree control and an edit control. Then you have three options:
- Passing the information to your
CFormLeft
class upon creation from the parent window
- Get the information during run-time from the parent window
- Add appropriate functions to the parent window
In all cases the parent (
CSplitterWnd
) window should have members for the panes (
CLeftPane
and
CRightPane
).
[EDIT]
and a pointer to it (
this
) must be passed as parent parameter when creating the pane views.
[EDIT]
For the first case add a
CRightPane*
member to your
CLeftPane
class that is initialised in some way (constructor or a setter function; both called from the parent window).
For the second case implement a function to get a pointer to the right pane from the splitter parent window, cast the parent window from within
CLeftPane
and call the getter function
CMySplitterWnd *pParent = (CMySplitterWnd *)GetParent();
CRightPane* pRightPane = pParent->GetRightPane();
Once you have the pointer to the right pane view, you can call functions or send messages as required. If necessary add functions to the
CRightPane*
class for specific tasks (e.g. for accessing the edit control).
For the third case implement a function in the parent that forwards commands to the right pane
CMySplitterWnd *pParent = (CMySplitterWnd *)GetParent();
pParent->SetRightPaneEditText(strItemText);