Close popmenu hitself [Resolved]
-
superadnim
- Enthusiast

- Posts: 480
- Joined: Thu Jul 27, 2006 4:06 am
-
superadnim
- Enthusiast

- Posts: 480
- Joined: Thu Jul 27, 2006 4:06 am
And how can you type while displaying a menu and partially occluding the text you are reading / writing?, what Im saying goes for editing not for viewing since you don't escape from the menu while you read, but you do when you type.
Its worth mentioning... I never encountered that situation because I've no need to leave a menu open while I'm reading something, I'm also smart enough not to open the menu on top of the text if I can... and if not, I still use the menu. ie I don't leave it waiting, after all... pop-up menus exist just to cut down on the time it takes you to access certain vital functions of an application.
Its worth mentioning... I never encountered that situation because I've no need to leave a menu open while I'm reading something, I'm also smart enough not to open the menu on top of the text if I can... and if not, I still use the menu. ie I don't leave it waiting, after all... pop-up menus exist just to cut down on the time it takes you to access certain vital functions of an application.
Re:
Fixed Fluid Byte's code to work with v5.21 LTS:
Code: Select all
Procedure WindowCallback(hWnd,uMsg,wParam,lParam)
Select uMsg
Case #WM_ENTERIDLE
GetCursorPos_(cpt.POINT)
;If WindowFromPoint_(cpt\x,cpt\y) = hwnd
If WindowFromPoint_(PeekQ(cpt))=hwnd
EndMenu_()
EndIf
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
CreatePopupMenu(0)
MenuItem(1,"Cut")
MenuItem(2,"Copy")
MenuItem(3,"Paste")
MenuBar()
OpenSubMenu("Options")
MenuItem(4,"Window...")
MenuItem(5,"Gadget...")
CloseSubMenu()
MenuBar()
MenuItem(6,"Quit")
OpenWindow(0,0,0,320,240,"Right-click!",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
SetWindowCallback(@WindowCallback())
Repeat
EventID = WaitWindowEvent()
If EventID = #WM_RBUTTONDOWN
DisplayPopupMenu(0,WindowID(0))
EndIf
Until EventID = #PB_Event_CloseWindow
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
- Kwai chang caine
- Always Here

- Posts: 5502
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France

