How to move a BlackBox document view to the second monitor?

Usage of the framework, compiler and tools
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: How to move a BlackBox document view to the second monit

Post by Zinn »

Thank you for your sample. It works. It doesn't behave the way as I expect. I can move the window to the other monitor, but I can't edit the decouple child windows with the BlackBox menu.
- Helmut
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: How to move a BlackBox document view to the second monit

Post by Robert »

Zinn wrote:... but I can't edit the decouple child windows with the BlackBox menu.- Helmut
I can - sometimes!

Sometimes the BlackBox Menus are completely disabled (I can't even close the main window), sometimes they do drop down, but have no effect. For example the text color in the decoupled child does not change. And sometimes they work properly.

Sometimes I can't edit the child at all.

The behaviour seems to be different if I use the Decouple Command from a Button in a Form, or if I make it a normal menu item. But this is not consistent, so I'm not sure if I'm imagining this difference.

This seems to be a useful feature, but only if it can be made to operate reliably.
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: How to move a BlackBox document view to the second monit

Post by Robert »

Robert wrote:This seems to be a useful feature, but only if it can be made to operate reliably.
Frustrating: This is a useful feature, but not reliable enough.
This morning I wanted to minimise the main BlackBox window, but couldn't without first opening a new window; typing a few characters at random, then closing it.
luowy
Posts: 87
Joined: Thu Dec 17, 2015 1:32 pm

Re: How to move a BlackBox document view to the second monit

Post by luowy »

@Robert
I modified it, You can give it a try;

Code: Select all

	PROCEDURE DecoupleChildWindow* ;
     (* Decouples the currently focussed child window from the Hostwindows.main, 
       such that it can float freely over the desktop *)
	VAR
		win: HostWindows.Window; style: SET;
		res: INTEGER;
	BEGIN
		win := HostWindows.dir.Focus(Controllers.targetPath);
		IF (win # NIL)&(HostWindows.dir.Next(win) # NIL) THEN
			HostWindows.dir.Select(HostWindows.dir.Next(win),FALSE);
			style := BITS(WinApi.GetWindowLongW(win.wnd, WinApi.GWL_STYLE)); (* window style *)
			res := WinApi.SetWindowLong(win.wnd, WinApi.GWL_HWNDPARENT,  0);
			res := WinApi.SetWindowLong(win.wnd, WinApi.GWL_STYLE, ORD(style + WinApi.WS_POPUP - WinApi.WS_CHILD));
		END;
	END DecoupleChildWindow;
Last edited by luowy on Fri Jun 12, 2020 1:09 am, edited 1 time in total.
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: How to move a BlackBox document view to the second monit

Post by Robert »

luowy wrote:@Robert I modified it, You can give it a try;
Still not ideal!
I've done very few tests, but:
1 - The Attributes menu does not work; I could not set some selected text to red.
2 - Sometimes (not always!) when I focus the child, then drag it over the main BlackBox window, it goes behind rather than in front.
luowy
Posts: 87
Joined: Thu Dec 17, 2015 1:32 pm

Re: How to move a BlackBox document view to the second monit

Post by luowy »

1, yes, it has changed parent, being a sibling window of BB, out of control of the BB' menus,
but the shotcuts can work。

In order to use the BB menu, can press F2, duplicate a sub window to edit,
it's a normal MDI window, synchronized with the popup;

2, remove the style WS_CHILD, the proc has been updated;
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: How to move a BlackBox document view to the second monit

Post by Robert »

luowy wrote:In order to use the BB menu, can press F2, duplicate a sub window to edit,
it's a normal MDI window, synchronized with the popup
That's a good solution for me - works well.
Robert wrote:Sometimes (not always!) when I focus the child, then drag it over the main BlackBox window, it goes behind rather than in front.
What seems to be the case is that when you focus a "freed" window, then move it to another (maybe the main BlackBox, or your email program, or whatever) it goes behind which is not what I want.
BUT, if the "freed" window is already partially overlapping the other window when you focus it, it goes in front.
Now I understand this behaviour it is fine for me.

Thanks.
Post Reply