Page 1 of 1

#PB_EventType_LeftClick dont work with CalendarGadget +today

Posted: Fri Nov 06, 2020 11:44 am
by Lebostein
if you click left on the number of current date, no event is triggered:

Code: Select all

  If OpenWindow(0, 0, 0, 250, 200, "CalendarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CalendarGadget(0, 10, 10, 230, 180)
    Repeat
      event = WaitWindowEvent()
      If event = #PB_Event_Gadget And EventGadget() = 0 And EventType() = #PB_EventType_LeftClick: Debug "w": EndIf
    Until event = #PB_Event_CloseWindow
  EndIf
The current behavior corresponds more to #PB_EventType_Change

The user of my tool should click two times on the gadget to define the start and the end date. And if the start and end date is the same, I get no event from the second click....

Other bug: If I click right and select "today" in the popup (if an other day is selected), then the #PB_EventType_LeftClick event is triggered too. But there is no left click in this case....

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Posted: Fri Nov 06, 2020 11:59 am
by leonhardt
Lebostein wrote:if you click left on the number of current date, no event is triggered:

Code: Select all

  If OpenWindow(0, 0, 0, 250, 200, "CalendarGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CalendarGadget(0, 10, 10, 230, 180)
    Repeat
      event = WaitWindowEvent()
      If event = #PB_Event_Gadget And EventGadget() = 0 And EventType() = #PB_EventType_LeftClick: Debug "w": EndIf
    Until event = #PB_Event_CloseWindow
  EndIf
The current behavior corresponds more to #PB_EventType_Change

The user of my tool should click two times on the gadget to define the start and the end date. And if the start and end date is the same, I get no event from the second click....

Other bug: If I click right and select "today" (if an other day is selected), then the #PB_EventType_LeftClick event is triggered too. But there is no left click in this case....

the doc says:
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()
- WebGadget() - The WebGadget has a special set of event types.

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Posted: Fri Nov 06, 2020 12:03 pm
by Lebostein
I don't understand. If EventType is not possible, how to use this gadget then?

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Posted: Fri Nov 06, 2020 12:10 pm
by leonhardt
Lebostein wrote:I don't understand. If EventType is not possible, how to use this gadget then?
maybe you can use a callback . for example:

Code: Select all


;button gadget 0 callback
Procedure BtnCallback(hwnd,msg,wparam,lparam)
      If msg=#WM_LBUTTONDOWN
        

    ElseIf msg=#WM_LBUTTONUP

    EndIf
    ProcedureReturn CallWindowProc_(Proc,hwnd,msg,wparam,lparam)


EndProcedure

Proc=SetWindowLong_(GadgetID(0),#GWL_WNDPROC,@BtnCallback())



Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Posted: Fri Nov 06, 2020 12:19 pm
by leonhardt
or you should search the forum :wink:
viewtopic.php?f=13&t=37598&hilit=eventtype