Frameless window drag

Post Reply
User avatar
GregSpa1
Posts: 8
Joined: Mon Sep 09, 2019 6:08 pm

Frameless window drag

Post by GregSpa1 » Sat Nov 02, 2019 8:57 am

Hello again.

Is there any option to set specified html area for the Delphi app frameless window drag capability?
E.g.

Code: Select all

 
.myTitleBar {
     -webkit-app-region: drag; 
}
If not, I assume it is on Delphi side using cursor behavior in the specified element. Am I right?
Is there simpler or obvious solution?
How to send js events to Delphi? I tried to find proper CEF4Deplhi example, but without luck...

Code: Select all

	myTitleBar.addEventListener('mousemove', (e) => {
		sendToDelphi(e);
	});
or just send button state

Code: Select all

	myTitleBar.addEventListener('mousedown', (e) => {
		DelphiStartWindowDrag();
	});
	
	myTitleBar.addEventListener('mouseup', (e) => {
		DelphiStopWindowDrag();
	});
Is still the JSEval example the place for some hint, or you could just clearify more? Please? :roll:

Thank you for your work and patience! :)

TIA,
Greg

User avatar
GregSpa1
Posts: 8
Joined: Mon Sep 09, 2019 6:08 pm

Re: Frameless window drag

Post by GregSpa1 » Sat Nov 02, 2019 10:30 am

OK. Got it - JS/RTTI example.

User avatar
GregSpa1
Posts: 8
Joined: Mon Sep 09, 2019 6:08 pm

Re: Frameless window drag

Post by GregSpa1 » Sat Nov 02, 2019 4:53 pm

Forked repo and added demo for Custom Title Bar:

Copy this file to bin dir:

https://github.com/GregSpa/CEF4Delphi/blob/CustomTitleBar/bin/app_view.html

and this folder(CustomTitleBar) to VCL demos:

https://github.com/GregSpa/CEF4Delphi/tree/CustomTitleBar/demos/Delphi_VCL/CustomTitleBar

JPEG to canvas pending...

Thanks,
GReg

Post Reply