Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To: Hijack the Column.Init() from Column.txtbox.init
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00774641
Message ID:
00774647
Vues:
22
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.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform