Restored from previous forum. Originally posted by effigy.
How would I monitor for a click event on a textgadget. It looks as though by default this does not come in like other gadgets.
Just for some background, the reason I want to do this is because I am trying to build a calendar select routine similar to what Outlook has. I know there is a API calendar that would work, but I just don't like the looks of it.
Thanks in advance.
Derek
Click event for textgadget
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by freak.
This Gadget is a static Gadget, this means, it can receive no events.
You can use a WindowCallback Procedure (see SetWindowCallback() ) to monitor the #WM_LBUTTONDOWN Message and then check with WindowMouseX()/WindowMouseY() where the click was.
Timo
This Gadget is a static Gadget, this means, it can receive no events.
You can use a WindowCallback Procedure (see SetWindowCallback() ) to monitor the #WM_LBUTTONDOWN Message and then check with WindowMouseX()/WindowMouseY() where the click was.
Timo
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Justin.
It's easier, you only have to add the SS_NOTIFY style. only for windows.
It's easier, you only have to add the SS_NOTIFY style. only for windows.
Code: Select all
;Purebasic Window Editor v2.91
;GADGET IDs
#Text0=0
#Button1=1
;WINDOW ID
#Window1=0
#SS_NOTIFY=256
;WINDOW
OpenWindow(#Window1,203,142,409,158,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered,"Window1")
CreateGadgetList(WindowID(#Window1))
TextGadget(#Text0,10,16,90,24,"Click me",#SS_NOTIFY)
ButtonGadget(#Button1,300,112,90,24,"Cancel")
;EVENT LOOP
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_EventGadget
Select EventGadgetID()
Case #Button1
exit=1
Case #Text0
messagerequester("","Click",0)
EndSelect
EndSelect
Until EventID=#PB_EventCloseWindow or exit
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm