Page 1 of 1
Posted: Tue Feb 04, 2003 2:50 pm
by BackupUser
Restored from previous forum. Originally posted by Nessie.
Can someone tell me if it is possible to mask the input of a string gadget or a spin gadget, as I am trying to format the time input. Is there anyway I can place a : to seperate the hours from the minutes? or is there an API function I can call instead?
Posted: Tue Feb 04, 2003 3:27 pm
by BackupUser
Restored from previous forum. Originally posted by freak.
If an Event for your StringGadget occurs, you can check with EventType() if it is #PB_EventType_Change.
This means, that the User changed the contents of the Gadget. You can then use GetGadgetText()/SetGadgetText() to add your ':' wherever you want to.
You can also create 2 seperate StringGadgets for Hours/Minutes, and put a TextGadget with ':' inbetween.
Timo
Posted: Tue Feb 04, 2003 3:36 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.
Try a search in the forum with SysDateTimePick32, it may guide you to what you're looking for.
Bye,
El_Choni
Posted: Tue Feb 04, 2003 11:50 pm
by BackupUser
Restored from previous forum. Originally posted by Kale.
i had a similar type thing in an app i wrote, i contained the time display inside a function:
Code: Select all
;sort out the time and display it
Procedure setTime()
currentDate = Date()
hours.b = Hour(currentDate)
minutes.b = Minute(currentDate)
seconds.b = Second(currentDate)
append.s = "am"
If hours >= 12
append.s = "pm"
EndIf
If hours = 0
hours = 12
EndIf
If hours > 12
hours = hours-12
EndIf
If minutes [i]Getting used to PureBasic and falling in Love![/i] :)
Posted: Wed Feb 05, 2003 1:32 pm
by BackupUser
Restored from previous forum. Originally posted by Nessie.
Thanks for the help everyone. I'll see how I get on