Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To: Hijack the Column.Init() from Column.txtbox.init
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00774641
Message ID:
00777548
Views:
16
I can send you the textbox class, let me know the address. It is based on the codebook so do you have a copy of it?

>Can you send me form/classlib with code?
>
> MartinJ
>
>>Sorry Martin, it didn't work for me.
>>
>>>
LOCAL llRetVal
>>>
>>>DO CASE
>>>	CASE "amount"$LOWER(THIS.COMMENT) OR "amt"$LOWER(THIS.COMMENT)
>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Amount Format", "99,99,99,999.99")
>>>		THIS.Format = goApp.GetSetting("General", "Amount Format", "99R99R99R999.99")
>>>
>>>...
>>>ENDCASE
>>>
>>>IF THIS.PARENT.BASECLASS = "Column"
>>>   THIS.PARENT.INPUTMASK = THIS.INPUTMASK
>>>   THIS.PARENT.Format = THIS.Format
>>>ENDIF
>>>
>>>
>>> MartinJ
>>>
>>>>Hi all
>>>>
>>>>How can I set the InputMask of the column programatically from a textbox which is contained in this column. What is happening is that the InputMask at the time of Column.Init() takes over the this.parent.InputMask specified by the textbox.init(). The below codes though does not fail is serverly delayed in execution for it to work:
>>>>
>>>>textbox.init():
>>>>
LOCAL llRetVal
>>>>
>>>>DO CASE
>>>>	CASE "amount"$LOWER(THIS.COMMENT) OR "amt"$LOWER(THIS.COMMENT)
>>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Amount Format", "99,99,99,999.99")
>>>>
>>>>	CASE "quantity"$LOWER(THIS.COMMENT) OR "qty"$LOWER(THIS.COMMENT)
>>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Quantity Format", "9,99,99,999.999")
>>>>
>>>>	CASE "rate"$LOWER(THIS.COMMENT)
>>>>		THIS.INPUTMASK = goApp.GetSetting("General", "Rate Format", "99,99,999.9999")
>>>>ENDCASE
>>>>
>>>>IF THIS.PARENT.CLASS = "Column"
>>>>	THIS.PARENT.INPUTMASK = THIS.INPUTMASK
>>>>ENDIF
>>>>
>>>>llRetVal = DODEFAULT()
>>>>
>>>>RETURN llRetVal
>>>>
>>>>What IMO happens is that the column is already init()ed and the InputMask, if any, specified in the column takes precedence in the display and any further modifications, as in this case, to the Column.InputMask doe not have any effects.
>>>>
>>>>I use drag-n-drop of grid and it's column. Though I have worked on a grid builder which replaces the textboxes with the textboxes from my library, how to go about hijaking column classes.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform