EventType()

Syntax

EventType = EventType()
Description
After a WindowEvent() or WaitWindowEvent() function, use this function to determine of which type the event is. The following gadgets support EventType():

- CanvasGadget() - The CanvasGadget has a special set of event types.
- ComboBoxGadget()
- DateGadget()
- EditorGadget()
- ExplorerListGadget()
- ExplorerTreeGadget()
- ImageGadget()
- ListViewGadget()
- ListIconGadget()
- MDIGadget()
- OpenGLGadget()
- SpinGadget()
- StringGadget()
- TreeGadget()
- WebGadget() - The WebGadget has a special set of event types.

(See the gadget definition to see which events are supported.)

Parameters

None.

Return value

The following values are possible, if an event of the type #PB_Event_Gadget (library Gadget) or #PB_Event_SysTray (library Systray) occurs:
  #PB_EventType_LeftClick       : Left mouse button click
  #PB_EventType_RightClick      : right mouse button click
  #PB_EventType_LeftDoubleClick : Left mouse button double click
  #PB_EventType_RightDoubleClick: Right mouse button double click
  #PB_EventType_Focus           : Get the focus.
  #PB_EventType_LostFocus       : Lose the focus.
  #PB_EventType_Change          : Content change.
  #PB_EventType_DragStart       : The user tries to start a Drag & Drop operation.

Example

  If OpenWindow(0, 0, 0, 230, 120, "Eventtypes example...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
     ListIconGadget(1, 10, 10, 150, 100, "ListIcon", 140, #PB_ListIcon_GridLines) 
     For a = 1 To 4 
       AddGadgetItem(1, -1, "Line "+Str(a)) 
     Next
  
     Repeat
       Event = WaitWindowEvent()
       
       Select Event
       
         Case #PB_Event_Gadget
           Select EventGadget()
             Case 1 
               Select EventType()
                 Case #PB_EventType_LeftClick        : Debug "Click with left mouse button"
                 Case #PB_EventType_RightClick       : Debug "Click with right mouse button"
                 Case #PB_EventType_LeftDoubleClick  : Debug "Double-click with left mouse button"
                 Case #PB_EventType_RightDoubleClick : Debug "Double-click with right mouse button"
               EndSelect
           EndSelect
       
       EndSelect
     Until Event = #PB_Event_CloseWindow
  EndIf

See Also

WaitWindowEvent(), WindowEvent()

Supported OS

All

<- EventTimer() - Window Index - EventWindow() ->