docking a modeless dialog
-
Hi! I read some articles about docing control bar. But that isn't what i need. I create a modeless dialog in mainframe. it is fixed size (for example 128*128), and on top of all childframe(views). I hope the dialog has the docking capability to align itself to some corner of the mainframe. But don't know how to do it. I try MoveWindow to 0, 0 (left corner of mainframe), but it cover the toolbar! the client rect of mainframe including the area toolbar accupied. But childframe is smart to know the right size and position when it resize to largest. How can childframe know the exactly free space in mainframe? Any suggestion for me? Thank you!!
-
Hi! I read some articles about docing control bar. But that isn't what i need. I create a modeless dialog in mainframe. it is fixed size (for example 128*128), and on top of all childframe(views). I hope the dialog has the docking capability to align itself to some corner of the mainframe. But don't know how to do it. I try MoveWindow to 0, 0 (left corner of mainframe), but it cover the toolbar! the client rect of mainframe including the area toolbar accupied. But childframe is smart to know the right size and position when it resize to largest. How can childframe know the exactly free space in mainframe? Any suggestion for me? Thank you!!
-
What you want is called a dialog bar. Take a look at CDialogBar or look at this http://codeguru.earthweb.com/docking/devstudio_like_controlbar_2.shtml[^]
sorry, what i wanna is just a modeless dialog not control bar. I write a large image's browser. There is a modeless dialog which show the overview of whole image. It is on top of all the views. Its size is about 200*200, if I take a docking control bar, it will take the space 1024*200 that waste two much space. It just like photoshop, the panels of all kind tool on top of image. But I wanna my modeless dialog has a docking capability. In fact, it is also acceptable to make this dialog just on the left corner of the free space in mainframe. But I need the rect in the mainframe beside the toolbar, for GetClientRect doesn't get rid of the space toolbar occupied.
-
sorry, what i wanna is just a modeless dialog not control bar. I write a large image's browser. There is a modeless dialog which show the overview of whole image. It is on top of all the views. Its size is about 200*200, if I take a docking control bar, it will take the space 1024*200 that waste two much space. It just like photoshop, the panels of all kind tool on top of image. But I wanna my modeless dialog has a docking capability. In fact, it is also acceptable to make this dialog just on the left corner of the free space in mainframe. But I need the rect in the mainframe beside the toolbar, for GetClientRect doesn't get rid of the space toolbar occupied.
The easiest method of getting the available rectangle that you can use to position your modeless window is like this:
CRect rcAvailable; RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposQuery, &rcAvailable );
rcAvailable then contains the client rectangle without the toolbars. Hope this helps.