HELP !!!!!!!!, How to create child window in main window ????
-
I want to use a couple of child windows in my SDI application (with caption, min and max boxes, etc...(eg. WS_OVERLAPPEDWINDOW). They are children of CMyView. When I create them in response to CMyView's WM_CREATE, the children are not shown. But when I regster a class for my children, the are shown. Why is like that? But the real problem is that those windows don't have a focus (even when a caption bar is clicked they still have inactive caption!!). Pressing a key generates WM_KEYDOWN for CMyView not for the child window. Another problem: If I create a button in the child window and click it, the button has focus all the time, even when other child window are clicked, or main window, or menu. I cannot find any example of how to create child windows in a main window. I have over 40 books on VC++ but none of those explain this. Thank you any suggestions (The same problem occurs when children are created in SDI without Doc/View support). Jerzy :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused:
-
I want to use a couple of child windows in my SDI application (with caption, min and max boxes, etc...(eg. WS_OVERLAPPEDWINDOW). They are children of CMyView. When I create them in response to CMyView's WM_CREATE, the children are not shown. But when I regster a class for my children, the are shown. Why is like that? But the real problem is that those windows don't have a focus (even when a caption bar is clicked they still have inactive caption!!). Pressing a key generates WM_KEYDOWN for CMyView not for the child window. Another problem: If I create a button in the child window and click it, the button has focus all the time, even when other child window are clicked, or main window, or menu. I cannot find any example of how to create child windows in a main window. I have over 40 books on VC++ but none of those explain this. Thank you any suggestions (The same problem occurs when children are created in SDI without Doc/View support). Jerzy :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused:
I'm probably missing something, but it seems like you should be creating an MDI application, not an SDI, if you want to open multiple child views. I'd imagine that the reason none of your books describe multiple windows in SDI is that, by definition, this isn't done. Jake
-
I'm probably missing something, but it seems like you should be creating an MDI application, not an SDI, if you want to open multiple child views. I'd imagine that the reason none of your books describe multiple windows in SDI is that, by definition, this isn't done. Jake
Thank you for your answer, but with MDI I will have the same problem (I mean if I create those windows in a view). Those multiple children are not views for documents. They are windows where I get some input from the user. Let me explain what I'm doing. I'm writing a sequencer as SDI app. User will be recording a song using a midi instrument or computer keyboard. Then he can edit recorded events in some windows like: Track window, Event window, Volume window, et... I cannot use my view as a container for all those windows. Probably the only way would be to use MDI and create diffrent views for the same document (MDI can be used to create multiple documents at the same time or multiple views for the same document). But could I use SDI and create multiple views for the single document? Thanks, Jerzy
-
Thank you for your answer, but with MDI I will have the same problem (I mean if I create those windows in a view). Those multiple children are not views for documents. They are windows where I get some input from the user. Let me explain what I'm doing. I'm writing a sequencer as SDI app. User will be recording a song using a midi instrument or computer keyboard. Then he can edit recorded events in some windows like: Track window, Event window, Volume window, et... I cannot use my view as a container for all those windows. Probably the only way would be to use MDI and create diffrent views for the same document (MDI can be used to create multiple documents at the same time or multiple views for the same document). But could I use SDI and create multiple views for the single document? Thanks, Jerzy
You could try using a CSplitterWnd... Jon Sagara "Left-handed nunchakus!"
-
Thank you for your answer, but with MDI I will have the same problem (I mean if I create those windows in a view). Those multiple children are not views for documents. They are windows where I get some input from the user. Let me explain what I'm doing. I'm writing a sequencer as SDI app. User will be recording a song using a midi instrument or computer keyboard. Then he can edit recorded events in some windows like: Track window, Event window, Volume window, et... I cannot use my view as a container for all those windows. Probably the only way would be to use MDI and create diffrent views for the same document (MDI can be used to create multiple documents at the same time or multiple views for the same document). But could I use SDI and create multiple views for the single document? Thanks, Jerzy
How about docking windows? Your users probably wont need all of the windows showing a once, so you could easily hide them. If you do go with your original window idea, I'd say do it with in a MDI style, it will be less confusing for your users. Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)
-
How about docking windows? Your users probably wont need all of the windows showing a once, so you could easily hide them. If you do go with your original window idea, I'd say do it with in a MDI style, it will be less confusing for your users. Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)
Docking windows are OK but they won't have a focus. MDI solution would require creating differnt templates for each view. Then when you create a new document framework would think a I have more than one document type and popup a dialog box with the list of types. 'Output Window' would show "Warning, Dialog creation failed". Beside this I want to have simple SDI application. I've seen hundreds of SDI application where user could open from menu some windows. In some applications those windows are children of desktop in other they are children of the main window. Jerzy
-
Docking windows are OK but they won't have a focus. MDI solution would require creating differnt templates for each view. Then when you create a new document framework would think a I have more than one document type and popup a dialog box with the list of types. 'Output Window' would show "Warning, Dialog creation failed". Beside this I want to have simple SDI application. I've seen hundreds of SDI application where user could open from menu some windows. In some applications those windows are children of desktop in other they are children of the main window. Jerzy
>>> MDI solution would require creating different templates for each view. Then when you create a new document framework would think a I have more than one document type and popup a dialog box with the list of types. <<< There is no need to create multiple templates for your purpose. You can actually use a document that is common to all the views, all you need to do is have a 'main' view (the one that gets used in the document template) and add extra views to the document from within it. This way you get full control in the main view, and have proper focus handling for all the windows. I can send you a small demo, if you’re interested. >>> Beside this I want to have simple SDI application. <<< Fair enough. >>> I've seen hundreds of SDI application where user could open from menu some windows. In some applications those windows are children of desktop in other they are children of the main window. <<< Yea I've seen some, aren’t they all mostly 'docking' windows that have had there docking ability disabled? Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)
-
>>> MDI solution would require creating different templates for each view. Then when you create a new document framework would think a I have more than one document type and popup a dialog box with the list of types. <<< There is no need to create multiple templates for your purpose. You can actually use a document that is common to all the views, all you need to do is have a 'main' view (the one that gets used in the document template) and add extra views to the document from within it. This way you get full control in the main view, and have proper focus handling for all the windows. I can send you a small demo, if you’re interested. >>> Beside this I want to have simple SDI application. <<< Fair enough. >>> I've seen hundreds of SDI application where user could open from menu some windows. In some applications those windows are children of desktop in other they are children of the main window. <<< Yea I've seen some, aren’t they all mostly 'docking' windows that have had there docking ability disabled? Ben Burnett --------- On the topic of code with no error handling -- It's not poor coding, it's "optimistic" ;)
Thanks for you patience. Can you please be so kind to send me this project, I would appreciate it very much. Thank you, Jerzy:rolleyes: My address: jerzypeter@hotmail.com