Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Resizing a docking window

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Resizing a docking window
#7703
Posted by: misi01 2005-12-21 21:48:04
I took the help.zip example script, and added a docking help window into an existing window of mine.

Now I want to automatically size the height of the docking (help) window relative to the height of the main window (to which the docking window is attached).

I tried using GuiSetCtlPlacement to alter the size of the HTML control inside of the docking window, but that doesn't change the size of the docking window itself.

How can I resize the docking window?




Even with the docking window resize not working, I can still (use GuiSetCtlPlacement to) resize the HTML control to always fill the docking window. But is there any way of limiting the HTML control's size so that it doesn't cover any other controls I also happen to place into that docking window?




Also, is there a way of limitng re-docking of the window to the bottom of the main window? Otherwise, it seems the user could dock the help window to another side of the main window, thereby overlaying some controls already positioned there. Okay, not too sensible for the user to do, but if it can be prevented programming-wise, so much the better.
Michael
Message2. Re: Help and HTML
#7772
Posted by: Jeff Glatt 2006-01-09 16:35:32
The docking DLL does support limiting which sides a window can be docked to, but I haven't put a REXX interface to that in REXX GUI. It's on a To Do list.

Doing GuiSetCtlPlacement on a HTML control affects only the HTML control, not the window containing it -- in this case, the docking window. You can't use GuiSetCtlPlacement to resize a docking window. Again, there is support in the docking add-on itself to resize a docking window, but I haven't exported that to REXX GUI yet.

But let me see if I get this correct. You want to limit where the user puts the HTML help area, and you also want to force its size relative to the main window? In that case, just put the HTML control directly into the main window. Don't put it in a docking window. The whole purpose of a docking window is to give the user control over where he wants to put the window relative to the main window, and how big he wants it to be. If you're going to take that away from him, then why bother using a docking window at all?

When you have controls in a main window, and also docking windows, then you should handle the SIZE event for the main window. In the WM_SIZE handler, you should use GuiSetCtlPlacement to position and size the main window's controls, using the X, Y, Width, and Height passed to your WM_SIZE. If you always fit those controls within that passed area, then they will not be covered by any docking window.

But I believe the real problem you're having is that you don't really want a docking window. You want an area that you, not the user, can position and size. And you don't want to move other controls in your main window (which is what you should be doing if you're giving the user a docking window). In that case, you don't want a docking window.

Take RPC as an example. When you resize any docked window, the "editor window" (displaying a REXX script) automatically resizes/repositions to accomodate the user's idea of where, and how big, he wants those docking windows. That's RPC handing the SIZE event for its main window, looking at the area passed to it, and filling that limited area with the editor window. That's why the docking windows never cover the editor window. The editor window is constantly resized/repositioned to accomodate the user moving/resizing the docking windows. He makes the docked windows bigger -- the editor window shrinks to accomodate. He makes the docking windows smaller, or tears them off to float -- the editor window expands to fill up this extra space now given to it. I don't force the docking windows to be resized/repositioned to accomodate the editor window, nor do I resize them on the enduser whenever he resizes the main window. That would defeat the purpose of having them.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0