What mechanism should i use in order to send command from one splitter to another?
Hello well subject might seems vague, So i will try to detail it.
I am developing an Auto-CAD like application in which I am having SplitterWindow with three panes: (3 rows and 1 column)
1.0 MainView -- Used for drawing
2.0 ListView -- below mainview to display list of commands. II row
3.0 Edit View -- This is in third row. Here user will type command and this command on typing must be added to the list in listview (View no. 2) and also the appropriate action should be taken i.e. drawing figure on View1
Guide/Suggest me how to implement this.
Also tell me that will be there something different if i implement with MDI application.
Well till now i do not have any idea related to MDI application. I have just used SDI only. Well this is not the matter of much importance at this time.
Apart from this I also want Printing support for my application to print:
1.0 Content of View1 i.e. whatever figure is drawn
2.0 Content of View2 i.e listview, so that one can even get printout of commands entered to system
Thanks in advance
Sandeep
Re: What mechanism should i use in order to send command from one splitter to another?
MFC core provides generic mechanism to routing command messages. So sending WM_COMMAND message with commandID in wParam to main window would lead to command handler invokation if some of your classes (mainframe, view or document) has it. If you want to provide chained command processing (one messge invokes more than one handlers) you need no use ON_COMMAND_EX macro instead of ON_COMMAND. See details in MSDN.
Re: What mechanism should i use in order to send command from one splitter to another?
If you have used the doc/view architecture, you can store all the data (commands, etc) in the doc, and at any point you want to update the other views, call the document's UpdateAllViews function.
This calls the OnUpdate function in all views connected to the document, and each view then updates as needed (you have to write the code of course.)
Hope that helps.