Page 2 of 2

Re: Drop-down menu on hover (?)

Posted: Mon Jul 21, 2025 7:57 am
by Piero
jacdelad wrote: Mon Jul 21, 2025 6:45 am Can't test right now, but I believe the button is receiving the entering message (and PB is not processing it for buttons). Don't know whether it's a but or desired behaviour by Windows.
Well, it should process the CANVAS in this case! Also, I just edited because #PB_EventType_MouseMove works better, and still doesn't work on win11!

Edit: you were "somewhat right" about the button interfering; weird fix for win11:

Code: Select all

CanvasGadget(#CAN1, 10, 10, 40, 40,#PB_Canvas_Container)
ButtonGadget(#btn1, 5, 5, 30, 30,"1")
CloseGadgetList()
CanvasGadget(#CAN2, 60, 10, 40, 40,#PB_Canvas_Container)
ButtonGadget(#btn2, 5, 5, 30, 30,"2")
But it doesn't work very well…

Re: Drop-down menu on hover (?)

Posted: Fri Jul 25, 2025 7:41 am
by AZJIO
RASHAD
Thanks for the example, I was able to integrate the code into my program.

The wrong topic wrote the first time

1. But I have a problem, the context menu of the window does not open in the left side of the window, with the items "On the Program", "Open the Ini File" and "Exit". I still can’t figure out how to disable #wm_enteridle for the left side of the window.

Code: Select all

Case #PB_Event_RightClick
	DisplayPopupMenu(#Menu, WindowID(#Window), WindowX(#Window), WindowY(#Window) + FormHeight)
	LockHide = 0
2. Also, if the mouse cursor has left the window and the menu, then the window does not hide until I close the menu.

Code: Select all

Case #PB_Event_Timer
	If EventTimer() = #TimerHide
		If NotOnWin(hGUI) And LockHide
			ToggleWinVisible = 0
			HideWindow(#Window, 1) ; this does not happen when the menu is open
		EndIf
		RemoveWindowTimer(#Window, #TimerHide)
		TH = 1
	EndIf