PlanetSquires Forums

Support Forums => WinFBX - Windows Framework for FreeBASIC => Topic started by: Paul Squires on November 01, 2018, 02:05:08 PM

Title: CMaskedEdit
Post by: Paul Squires on November 01, 2018, 02:05:08 PM
I have the new MaskedEdit control integrated into WinFBE but I am/was a little confused about the SetText documentation.

bSetMaskedCharsOnly Set the masked characters only, without the input mask.

Unless I am interpreting the documentation incorrectly, setting bSetMaskedCharsOnly to TRUE means that you would pass a string using only the mask characters without the input mask (eg. "5551119999"). If set to FALSE then you would also pass the Input Mask (eg. "(555) 111-9999").

However, in operation the logic appears to work the exact opposite. In order to work, SetText("5551119999", FALSE) or SetText("(555) 111-9999", TRUE).

Am I right? Wrong? Documentation error?

Title: Re: CMaskedEdit
Post by: Josť Roca on November 01, 2018, 03:09:44 PM
Well, my poor attempt was to mean that in

pMskEd.EnableMask(" ddd  ddd dddd", "(___) ___-____", "_")
pMskEd.SetText("(123) 123-1212"), TRUE

where " ddd  ddd dddd" are the masked characters and "(___) ___-____" the input mask, passing true to that parameter will cause to set only the numbers (the masked characters) without the () and -, that correspond to the input mask.

But because there is a "mask" and "masked characters", I don't know how to explain it better.

With the EnableMask method, both the masked characters and the input mask are mandatory, and must be the same length.