News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Docking-Floating Windows (new version)

Started by Manos, December 21, 2004, 07:08:08 AM

Previous topic - Next topic

Manos

Because I did not found a befitting Control to create and manage Docking-Floating
windows, I tried to build the DockWnd Control as DLL.
This Control is easy to use for any type application.
To understand the above, I have build the TestDock application that
demonstrates the usage of DockWnd Control.

Manos.

Download this from: here
Note:
Only registered users can download.

BasilYercin


Manos


hutch--

 :U

Manos,

This is a very good docking window demo and the IDE is starting to look fine.  :clap:
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Manos

Thank you hutch--

Now,I am writting the IDE code editor from scratch.

Manos.

BasilYercin

Is there a way to obtains the source code ? :eek

lamer

Hi, Manos!
Very nice example!  :thumbu
Only one question - is there a way to show caption instead of grip when window is dockable?

Manos

Hi lamer.

In this version no,but in the next version
I 'll set an option for caption.

Regards,
Manos.

lamer

We'll be looking forward for the next version!
Thanks!

lamer

Hi, Manos!
I am a bit surprised with a behavor of DockWnd.
When I try to resize a window which is left or top docked (left and top only, not right and bottom) it draws on the main MDI some kind of "pseudo" window, on the right or on the bottom, depending on the docked position. This "pseudo" window looks like the real one and stays on the MDI background until you erase it by minimizing or somehow else.
I post a little example. May be something wrong with it? Or with my machine? ::)

[attachment deleted by admin]

Manos

Hi lamer.

To solve the problem you must add the WS_CLIPSIBLINGS in the style of MDIClient window.
Also,for correct use of your program,you have to write the WM_COMMAND like follow:

.if ax==IDM_EXIT
     invoke SendMessage,hWnd,WM_CLOSE,0,0
.else
     invoke DefFrameProc,hWnd,hwndClient,uMsg,wParam,lParam   
    ret
.endif

Have a look in follow attached.

Regards,
Manos.




[attachment deleted by admin]

lamer

Hi,Manos!
Thanks for help - the WS_CLIPSIBLINGS realy solved the problem.
As for WM_COMMAND, of course you are right, I've just forgot about .else, because I've wanted to write the sample as quick as possible.
There is one more thing, that I can not to solve yet:
How to catch the moment when user clicks on close button (on both docked and non-docked windows).
I've tried to use WM_SHOWWINDOW and it does work while clicking on close button.
But... when window changes the style from docked to non-docked and vice versa - it sends the same message - WM_SHOWWINDOW.
May be you can add some custom message that will be sent by window when user clicks on close button?

Thanks again.

Manos

Hi lamer.

Try to use WM_STYLECHANGED or WM_STYLECHANGING.
When the DockWnd is docked has the WS_CHILD and when it is floating
has the WS_POPUP.
I think that the above will help you.

Manos.

lamer

Hi, Manos!
I have thought about this before - but I still do not see how it can help me.
The sequence of messages the window gets while becomes floating from docked is :
WM_SHOWWINDOW (with wParam=FALSE), WM_STYLECHANGED, WM_STYLECHANGED.
And vice versa:
WM_SHOWWINDOW (with wParam=FALSE), WM_STYLECHANGED, WM_STYLECHANGED, WM_SHOWWINDOW (with wParam=TRUE).
The only way is to assume, that if it gets WM_STYLECHANGED message, it is still visible.
Suppose, you have a menu that you must check or uncheck depending on visibility of this window. So you have to:
1. Uncheck it - WM_SHOWWINDOW (with wParam=FALSE)
2. Check it - WM_STYLECHANGED
3. Check it - WM_STYLECHANGED
4. Check it - WM_SHOWWINDOW (with wParam=TRUE)
I guess it is too much for simple checking/unchecking :bg
But some special message may come in handy.

Regards

Manos

Try this:

.elseif uMsg==WM_INITMENUPOPUP

        invoke IsWindowVisible,hDock
       .if eax
               invoke CheckMenuItem,wParam,IDM_???,MF_CHECKED
       .else
               invoke CheckMenuItem,wParam,IDM_???,MF_UNCHECKED
       .endif

Manos.