List of ALL possible events(?)

Everything else that doesn't fall into one of the other PB categories.
syntax error
User
User
Posts: 93
Joined: Tue Jan 13, 2004 5:11 am
Location: Midlands , UK

List of ALL possible events(?)

Post by syntax error »

Its seems PB is missing a few entries in it's docs for the events which WaitWindowEvent() and WindowEvent can spit out.

I think I have managed to unearth the main PB_ ones:

Code: Select all

ev=WaitWindowEvent() / ev=WindowEvent()


#PB_Event_ActivateWindow = $6
#PB_Event_CloseWindow = $10
#PB_Event_Gadget = $332C
#PB_Event_Menu = $332D
#PB_Event_MoveWindow = $3
#PB_Event_Repaint = $F
#PB_Event_SizeWindow = $5
#PB_Event_SysTray = $332E


et=EventType()

#PB_EventType_Change = $300
#PB_EventType_CloseItem = $FFFF
#PB_EventType_Focus = $100
#PB_EventType_LeftClick = $0
#PB_EventType_LeftDoubleClick = $2
#PB_EventType_LostFocus = $200
#PB_EventType_ReturnKey = $501
#PB_EventType_RightClick = $1
#PB_EventType_RightDoubleClick = $3
#PB_EventType_SizeItem = $FFFE
There are also tons of Windows events ...

Code: Select all

#WM_MOUSEWHEEL=$20A
#WM_MOUSELEAVE=$2A3
#WM_MOUSEHOVER=$2A1

Procedure MyWindowCallback(WindowID, Message, wParam, lParam) 
  Result = #PB_ProcessPureBasicEvents 
  Select Message
    Case #WM_LBUTTONUP         : Debug "mouse LMB up"
    Case #WM_LBUTTONDOWN       : Debug "mouse LMB down"
    Case #WM_RBUTTONUP         : Debug "mouse RMB up"
    Case #WM_RBUTTONDOWN       : Debug "mouse RMB down"
    Case #WM_MBUTTONUP         : Debug "mouse MMB up"
    Case #WM_MBUTTONDOWN       : Debug "mouse MMB down"
    Case #WM_LBUTTONDBLCLK     : Debug "mouse LMB double-click"
    Case #WM_RBUTTONDBLCLK     : Debug "mouse RMB double-click"    
    Case #WM_MBUTTONDBLCLK     : Debug "mouse MMB double-click"
    Case #WM_MOUSEWHEEL        : Debug "mouse wheel"
    Case #WM_MOUSEMOVE         : Debug "mouse move"
    Case #WM_MOUSELEAVE        : Debug "mouse leave"
    Case #WM_MOUSELAST         : Debug "mouse last"
    Case #WM_MOUSEHOVER        : Debug "mouse hover"
    Case #WM_MOUSEFIRST        : Debug "mouse first"
    Case #WM_MOUSEACTIVATE     : Debug "mouse activate"

    Case #WM_NCMOUSEMOVE       : Debug "NC mouse move"
    Case #WM_NCLBUTTONDOWN     : Debug "NC mouse LMB"

    Case #WM_KEYDOWN           : Debug "key down"
    Case #WM_KEYUP             : Debug "key UP"
    Case #WM_CHAR              : Debug "char"
    
    Case #WM_PAINT             : Debug "win paint"
    Case #WM_MOVING            : Debug "win moving"
    Case #WM_SIZING            : Debug "win sizing"
    Case #WM_MOVE              : Debug "win moved"
    Case #WM_CLOSE             : Debug "win closed"
    Case #WM_GETMINMAXINFO     : Debug "win sized"
    Case #WM_WINDOWPOSCHANGING : Debug "win pos changing"
    Case #WM_WINDOWPOSCHANGED  : Debug "win pos changed"
    
    Case #WM_SETCURSOR         : Debug "set cursor"
    Case #WM_NCHITTEST         : Debug "NC hit test"
    Case #WM_CTLCOLORBTN       : Debug "ctl color button"
    Case #WM_COMMAND           : Debug "wm command"
    Case #WM_CONTEXTMENU       : Debug "context menu"
    Case #WM_PARENTNOTIFY      : Debug "parent notify"
    Case #WM_ACTIVATE          : Debug "activate"
    Case #WM_NCACTIVATE        : Debug "NC activate"
    Case #WM_ACTIVATEAPP       : Debug "activate app"
    Case #WM_KILLFOCUS         : Debug "kill focus"
    Case #WM_GETICON           : Debug "get icon"
    Case #WM_SYSCOMMAND        : Debug "sys command"
    Case #WM_DESTROY           : Debug "destroy"
    Case #WM_NCDESTROY         : Debug "NC destroy"
    
    Default : Debug ">> &H"+Hex(Message)
  EndSelect 
  ProcedureReturn Result 
EndProcedure 

Quit = #FALSE 
If OpenWindow(0, 162, 380, 268, 69,  #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_SizeGadget, "event monitor") 
    AddKeyboardShortcut(0, #PB_Shortcut_Escape, #PB_Shortcut_Escape) 
    If CreateStatusBar(1,WindowID()) 
    EndIf 
    If CreateGadgetList(WindowID())
    ButtonGadget(0,10,10,46,20,"test")
    EndIf 
EndIf

SetWindowCallback(@MyWindowCallback()) 

Repeat 
  ev = WaitWindowEvent() 
  count=count+1 
  StatusBarText(1,0,"Count="+Str(count)+"  Event = $"+Hex(ev)) 
  Select ev 
    Case #PB_Event_CloseWindow
      Quit = #TRUE 
    Case #PB_Event_Menu 
      Select EventMenuID() 
        Case #PB_Shortcut_Escape 
          Quit = #TRUE 
      EndSelect 
  EndSelect 
Until Quit 
End
Almost ALL events are covered here but I still need to complete the collection.
Run the above example to see what I mean.
You'll see a few hex numbers pop up but I don't know WHAT event they relate to.
Any way of finding out?
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post by Danilo »

@syntax error:
You have only the few events official available, that are in the
PureBasic help file.
Thats because PureBasic is (or wants to be) platform independent
and has to work on Amiga, Linux, Windows and MacOS (in the future).

What you list here are events on the Windows operating system,
which you can look up in the programmers information for Windows
programmers: MSDN and MS Platform SDK.

There are tousands of events you have on Windows, but none of
this work the same way on other OS - thats why it has nothing to
do with PureBasic directly.
All events/infos for your questions are available in the docs for
Windows developers above.
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
syntax error
User
User
Posts: 93
Joined: Tue Jan 13, 2004 5:11 am
Location: Midlands , UK

Post by syntax error »

Danilo,
Thankyou for you assistance.
Post Reply