xsharp.eu • HoverButtons not visible
Page 1 of 1

HoverButtons not visible

Posted: Wed Nov 03, 2021 5:51 pm
by ic2
Fabrice asked me for a sample program in case he could VOXPort the HoverButtons Llib.

That sounded simple enough but guess what...I can't get any HoverButton visible in a newly created Standard MDI program. Tried it with everything unchecked and also once with XP Themes support but whatever I tried - no HoverButton is visible.

I know there was an issue on a dialogwindow but even importing my working Datawindow with multiple HoverButtons, stripping only some specific code, the buttons work (I can click them) but are totally invisible! I've searched all my notes, mails, NG messages and tried all kind of things. Everywhere else in my programs it works....I have no idea what I am missing.

Anyone who knows why?

Dick

HoverButtons not visible

Posted: Wed Nov 03, 2021 7:11 pm
by Jamal
Dick,

Mostly likely the WM_PAINT message is being intercepted in the Dispatch method and causing the drawing issue or the return value from the dispatch method is not correct.

You may try first to comment out the handling the of WM_PAINT message and see what happens. Does it draw?

Jamal

HoverButtons not visible

Posted: Wed Nov 03, 2021 8:04 pm
by ic2
Hello Jamal,

Yes, that finally made me find what I have done to get this working, 18 years ago! Thanks for your suggestion.

I copied my:

METHOD Dispatch(oE) CLASS __FormDialogWindow

This contains somewhere:

IF oE:OwnerDraw() == 1L // 27-10-2003 for HoverButton
RETURN 1L

and then it works....

Dick

HoverButtons not visible

Posted: Thu Nov 04, 2021 12:12 pm
by Karl-Heinz
Hi DIck,

almost two years ago I made some changes to the HoverButton lib, so Franz aka lagraf got it running with X# - at least the parts he´s using.

https://www.xsharp.eu/forum/german/1696 ... -x?start=0

- you no longer need the code from "Class HoverWindow (window).prg". There´s also no need to use a __FormDialogWindow Dispatcher, because in newer versions VO forwards ownerdraw messages to a ODDrawitem() control method, if such a method exists.

- this is how such a ODDrawItem() callback method can be used in the HoverButton class.

Code: Select all

METHOD ODDrawItem( oEvent AS Event ) AS VOID // KHR
LOCAL lpDis AS _winDRAWITEMSTRUCT	
// METHOD OnDrawItem( lpDis ) CLASS HoverButton	  <------ replaces this method !

	lpDis := PTR( _CAST , oEvent:lParam )  

	SELF:__Draw ( lpDis) 

	RETURN


- are you aware of that the hoverbutton class doesn´t support Themes ?


regards
Karl-Heinz

HoverButtons not visible

Posted: Thu Nov 04, 2021 12:26 pm
by ic2
Hello Karl-Heinz,

Thanks, I'll forward your message to Fabrice who just informed me he had a transported HoverButtons compiling. I know it doesn't support Themes.

I do have a version with METHOD OwnerDraw() CLASS Event and a _DLL FUNCTION PointInRect in the mef you say one could do without. Not sure if removing that and adding your code influences the visibility of the buttons but after trying almost anything yesterday, the (current) version in of course the "newest" VO eventually only worked after adding the __FormDialogWindow Dispatcher.

Dick

HoverButtons not visible

Posted: Thu Nov 04, 2021 1:32 pm
by Karl-Heinz
Hi Dick,

>> METHOD OwnerDraw() CLASS Event

Doing something like this no longer makes sense. I´m sure that Fabrice knows the ODDrawItem() callback method.

regards
Karl-Heinz

HoverButtons not visible

Posted: Thu Nov 04, 2021 3:41 pm
by ic2
Hello Karl-Heinz,

He already confirmed that to me. I leave it like it was in my VO programs as there it works fine for me this way as well.

Dick