The MASM Forum Archive 2004 to 2012

Specialised Projects => Custom Interface Components => Topic started by: Manos on December 21, 2004, 07:08:08 AM

Title: Docking-Floating Windows (new version)
Post by: Manos on December 21, 2004, 07:08:08 AM
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 (http://manoscoder.gr/phpBB3/viewtopic.php?f=11&t=8)
Note:
Only registered users can download.
Title: Re: Docking-Floating Windows (new version)
Post by: BasilYercin on January 19, 2005, 09:31:35 PM
Very nice demonstration.  :U 
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on January 19, 2005, 09:44:53 PM
Thank you  BasilYercin.

Regards,
Manos.
Title: Re: Docking-Floating Windows (new version)
Post by: hutch-- on January 20, 2005, 01:26:33 AM
 :U

Manos,

This is a very good docking window demo and the IDE is starting to look fine.  :clap:
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on January 20, 2005, 05:34:52 AM
Thank you hutch--

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

Manos.
Title: Re: Docking-Floating Windows (new version)
Post by: BasilYercin on May 23, 2005, 08:37:37 PM
Is there a way to obtains the source code ? :eek
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 06, 2005, 08:56:35 AM
Hi, Manos!
Very nice example!  :thumbu
Only one question - is there a way to show caption instead of grip when window is dockable?
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on June 06, 2005, 09:11:15 AM
Hi lamer.

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

Regards,
Manos.
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 06, 2005, 11:11:48 AM
We'll be looking forward for the next version!
Thanks!
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 09, 2005, 08:47:49 PM
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]
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on June 10, 2005, 11:06:07 AM
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]
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 10, 2005, 11:55:05 AM
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.
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on June 10, 2005, 01:01:46 PM
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.
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 10, 2005, 04:29:27 PM
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
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on June 10, 2005, 05:54:26 PM
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.
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 10, 2005, 06:17:22 PM
And what if I have corresponding toolbar buttons?
They are always visible in contrast to menu:bg
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on June 10, 2005, 06:24:21 PM
You can implement an OnIdle procedure that will do
the same work as WM_INITMENUPOPUP.

Manos.
Title: Re: Docking-Floating Windows (new version)
Post by: lamer on June 10, 2005, 08:39:36 PM
Quote from: Manos on June 10, 2005, 06:24:21 PM
You can implement an OnIdle procedure
Sorry?
I am just a lamer :bdg
What is OnIdle procedure?
Do you mean Timer or something like that?
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on June 11, 2005, 05:43:07 AM
You can call PeekMessage in the Message Loop of your application.
But,because I am very busy you can ask in forum for details.

Manos.
Title: Re: Docking-Floating Windows (new version)
Post by: Manos on February 05, 2011, 10:57:47 PM
I rewritten the old DockWnd.dll as a Static Library because there are some problems between different threads
and it is just like Visual Studio 6.0 in the appearance.
Using Static Library, you can include this in your projects.
You can use this library in Assembly and C/C++ projects. Therefor, I have included two files.
One named DockWnd.inc for Assembly projects and another named DockWnd.h for C/C++ projects.
This Control is easy to use for any type application and it is accompanied with an Application to understand its usage.

Manos.