Cursor on string gadget keeps moving in front
Posted: Sat May 28, 2011 6:11 pm
i have a string gadget which has a regexed input filtering which limits characters only to numerals and periods, the problem with this one is that the cursor keeps on moving in front of the entered text. is there a way to make it behave just like an ordinary string gadget?
anyway, i think you guys already know that all im after is to filter entered characters, if you guys have any different suggestion in implementing this in another way im all ears.
tia
Code: Select all
If OpenWindow(0, 0, 0, 322, 105, "Stubborn Cursor", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0, 8, 30, 306, 20, "")
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_Change
SetGadgetText(0, ReplaceRegularExpression(CreateRegularExpression(#PB_Any, "[^1234567890.]"), GetGadgetText(0), ""))
EndSelect
EndSelect
EndSelect
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIfanyway, i think you guys already know that all im after is to filter entered characters, if you guys have any different suggestion in implementing this in another way im all ears.
tia