I'd like to make a small request in relation to DreamSeeker's interface. I've recently discovered that transparent windows can be created, allowing controls to be layered on top of one another in the UI. Unfortunately there is no good way to layer transparent controls on top of a window and have them stick with the window when it's moved.
The features I am requesting are as follows:
Allowing windows to be parented and docked to one another.
This would integrate one new window property:
dock-bounds
Dock bounds would set the minimum and maximum x and y coordinates that a docked window could be dragged within its parent window.
The format would be: "x1,y1 to x2,y2"
And it would change three existing window properties slightly:
parent
This would require the ability to set a window's parent to another window when it is not in a child panel. It should be noted that currently windows that are not panes do not use the parent property so this won't break any current behavior.
anchor1 and anchor2
anchor1 would become useful for layering windows on top of one another when docked. This would facilitate automatic positioning as normal for an element but clamped within the area specified by dock-bounds. Anchor1 and anchor2 are not currently used by windows that are not panes so again this won't break any current behavior.
It would also add three new callbacks:
on-sizing, on-moving, on-moved
Windows UI supports WM_SIZING, WM_MOVING, and WM_MOVED. Dreamseeker now supports the .winset and .output commands to allow client-side processing of these events. Previously, these windows messages were neglected because of the extra load they would have put on the network. Now that we have the ability to process this information client-side there's no reason to not have them.
All of the required code is compatible with Windows 2000 professional or higher
min-size, max-size, aspect-ratio
Also, a min-size, max-size would be really helpful for a lot of interfaces. Interfaces get really ugly when they are scaled up or down too much. Simply working in a clamp() to the WndProc callback based on the min-size, max-size, and ratio settings would be great.
min-size and max-size would be in the form of pixels: x,y
ratio would be calculated from y/x and set the resizing to have to be a specific aspect ratio.
Here's some bad C++ that demonstrates the suggested code-flow.
void WndDockedChildMove(HWND hwnd,LPARAM lParam) {
//clamp x,y to dock-bounds area
return void;
}
//callback sent to all children of a window
BOOL CALLBACK WndDockParentMoved(HWND hwnd,LPARAM lParam) {
if(hwnd->docked) {
//set x,y,w,h to anchor1, anchor2 properties
//clamp x,y,w,h to dock-bounds area
}
return true;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
HWND par = GetAncestor(hwnd,GA_PARENT);
switch(uMsg) {
case WM_MOVING:
if(par!=NULL && hwnd->docked) {
WndDockedChildMove(hwnd,par,lParam);
}
EnumChildWindows(hwnd,&WndDockParentMoved,lParam);
//trigger onMoving event here
return 1;
case WM_MOVED:
//trigger onMoved event here
return 1;
case WM_SIZING:
if(par!=null && hwnd->docked) {
WndDockedChildMove(hwnd,par,lParam);
} else {
//clamp w,h to min-size/max-size here
}
EnumChildWindows(hwnd,&WndDockParentMoved,lParam);
//trigger onSizing event here
return 1;
//do whatever else you already do here
}
The webclient is much, much more capable of handling transparency in intelligent ways than Windows.