big problem whit #PB_String_Numeric (flickering)
Posted: Sun Jan 09, 2011 4:35 pm
Hi
I need a numeric string input whit 1000 digit separator. for example : 2,002,152 , 25.000 , ...etc
i have a big problem whit #PB_String_Numeric (#ES_NUMBER) whenever my stringggadget is in panel it has a big flickering, else it has a weak flickering always.
because if user input a non numerical digit into stringgadget, we will see a flickering that extended to all window.
i try this :
1- have u a better tip?
2- can u improvement this code?
3- can u add any 3-Digit separator .(useful for currency ).
4- in above code i don't have any control on Paste event.
I need a numeric string input whit 1000 digit separator. for example : 2,002,152 , 25.000 , ...etc
i have a big problem whit #PB_String_Numeric (#ES_NUMBER) whenever my stringggadget is in panel it has a big flickering, else it has a weak flickering always.
because if user input a non numerical digit into stringgadget, we will see a flickering that extended to all window.
i try this :
Code: Select all
Global Number.s="0123456789"
Procedure Numeric()
Change$ = GetGadgetText(0)
For i=1 To Len(Number)
For j=1 To Len(Change$)
If FindString(Number, Mid(Change$, j, 1), 0) = 0 : SetGadgetText(0, RemoveString(Change$, Mid(Change$, j, 1)) ) : SendMessage_(GadgetID(0), #EM_SETSEL, $FFFF, $FFFF) : EndIf
Next
Next
EndProcedure
If OpenWindow(0, 0, 0, 230, 120, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StringGadget(0,50,50,100,25,"")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Select EventType()
Case #PB_EventType_Change : Numeric()
EndSelect
EndSelect
; Case #WM_CHAR :Numeric()
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
1- have u a better tip?
2- can u improvement this code?
3- can u add any 3-Digit separator .(useful for currency ).
4- in above code i don't have any control on Paste event.