#PB_EventType_LeftClick dont work with CalendarGadget +today

Just starting out? Need help? Post your questions and find answers here.
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

#PB_EventType_LeftClick dont work with CalendarGadget +today

Post 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)
Last edited by Lebostein on Fri Nov 06, 2020 12:01 pm, edited 1 time in total.
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Post 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.
poor English...

PureBasic & Delphi & VBA
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Post by Lebostein »

I don't understand. If EventType is not possible, how to use this gadget then?
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Post 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())


poor English...

PureBasic & Delphi & VBA
User avatar
leonhardt
Enthusiast
Enthusiast
Posts: 220
Joined: Wed Dec 23, 2009 3:26 pm

Re: #PB_EventType_LeftClick dont work with CalendarGadget +t

Post by leonhardt »

or you should search the forum :wink:
viewtopic.php?f=13&t=37598&hilit=eventtype
poor English...

PureBasic & Delphi & VBA
Post Reply