Page 2 of 2

Posted: Thu Jan 24, 2008 3:05 pm
by superadnim
If it gives you money, can you wire-transfer a bit? :lol:

Posted: Thu Jan 24, 2008 3:31 pm
by Trond
superadnim wrote:You know, you can tell Windows to hide the cursor when typing ;)
Clicking to show the menu would show the cursor again, right?

Posted: Thu Jan 24, 2008 4:25 pm
by superadnim
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.

Re:

Posted: Thu Feb 06, 2014 11:32 am
by PB
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

Re: Close popmenu hitself [Resolved]

Posted: Mon Feb 10, 2014 10:04 am
by Kwai chang caine
Thanks :wink: