Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Resizing Docked Form's Height Programmatically
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01017705
Message ID:
01017720
Views:
47
Hi Malcolm,

On idea #1, yeah I was thinking that might work depending on how smooth the results end up being. I saw something in here in the last week where I think Tamar was using a technique similar to this to set focus to some controls. I may look that thread up, she had it down to where you could save the mouse position and then restore it and if it looked really bad I don't think she would have done it. So there's that.

On idea #2, prior to VFP 9 I've been using toolbars to create "panels" in my VFP applications. They lacked the ability to stack or tab dock like the VFP 9 dockable forms do though. However, what the toolbars have (and I am trying to figure out how to recreate in VFP dockable forms) was the ability to be turned into "collapsible" panels. A Toolbar automatically resizes based on the controls placed inside it... so it was just a matter of putting a container in the toolbar and voila! I mean if I made the height of the container inside the toolbar shorter then the toolbar would collapse upward or downward depending on the docking position, and if I made the width of the container shorter the toolbar would collapse left or right depending on the docking position (think of a sliding panel that you can open or close). This was great for all kinds of things... add a webbrowser control and you could even have really slick embedded help window.

So, in this case I want my cake and eat it too. <g>

I fired up SPY++ and took a look at what the heck the VFP Team did to make these dockable forms... there is always a containing window (hidden most of the time, but it has a HWND) and as for the parts that can be resized such as between stacked forms and the side of a docked window... well those are actually windows and as such they have HWND. The windows messages being sent to those windows to resize are mainly move and size messages, so I've been playing with SendMessage() API using the HWNDs of the windows and the constants WM_MOVE and WM_SIZE. No luck yet getting those suckers to move, but maybe I am just missing a piece that I'll eventually figure out... there's a lot of stuff going on when you resize those docked forms using the splitter bar between them, and I'm not sure I have figured out the exact sequence in which the messages need to be sent. If I can get them to move or resize then the next thing I'll do is pop over to news2news and grab the code Anatoliy Mogylevets has there for finding all those hidden window handles so I won't have to rely on SPY++ and can create some code that can actually be distributed.

If the mouse trick works, then that is a plus because that will be way easier. If this can be figured out, then a class could be created that when added to a form would take the place of the titlebar of that form when docked that could collapse it left, right, up, or down (depending on dockposition and such). There are a lot of really nice applications these days with dockable panels/forms that do just that. I'd like to think we could have the same in VFP, without the use of an expensive ActiveX control. Add that to what dockable forms already do, and we'd have something really phenomenal.

If anyone has any other ideas, whether it's code or just a thought... I'm all ears.

>Hi Craig,
>
>Two ideas, one easy, one lots of work.
>
>1. Use the MOUSE command to simulate a click and drag resize.
>
>2. Implement your own docking form framework, i.e. create a class of forms that behave similar to VFP docking forms, but with your extended behavior. Thanks to your demos, there's a lot to like about dockable forms, and yet, to me, VFP 9's dockable forms still have that 1.0 "almost, but not quite finished" feel.
>
>Malcolm
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform