Detect if DateGadget() was edited

Share your advanced PureBasic knowledge/code with the community.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Detect if DateGadget() was edited

Post by c4s »

Just a very small trick I needed right now:

Code: Select all

If OpenWindow(0, 0, 0, 200, 250, "DateGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	DateGadget(1, 10, 10, 180, 25, "Date: %mm/%dd/%yyyy Time: %hh:%ii", 0) : DateSet = Date() : DateSet - Second(DateSet)

	Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow


	If GetGadgetState(1) <> DateSet
		Debug "DateGadget() edited"
	Else
		Debug "DateGadget() not edited"
	EndIf
EndIf
Maybe it can help someone searching the helpfile for a function (as I did ;)).
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!