Re: Discussion - how do you GUI?

new topic     » goto parent     » topic index » view thread      » older message » newer message
ryanj said...
Spock said...

Are you thinking of something along the lines of Regex? I use this a lot when importing data from text files. For me it is less important to have automatic formatting in text boxes since we try to avoid manual input as much as possible. My work has largely been to automate bulk data transfers/conversions and manual updating of data is permitted only when deemed necessary.

I guess i was thinking of having a function that gets called when the textbox changes, to determine if the format is correct, and display an error indicator without interrupting the user. I plan to add a feature like that into Redy's textbox widgetclass.

I think this is a good technique but for a small number of use cases. For instance, validating bank account numbers, IRD (IRS) numbers, etc. To do this in my Win32 library I would add a line of code in the control's Handler routine to call a validation routine, eg:

if msg = WM_CHAR then 
   ValidateMyText() 
end if 
 
... 
... 
 
procedure ValidateMyText() 
  sequence s = GetText( MyText ) 
  -- do validation here and provide feedback 
end procedure 
 

If I needed to validate a lot of different data fields I would consider putting all the different types into an independent include file and call them via the Handlers (in the app rather than the GUI library). To me this is the simplest thing that would work but YMMV.

Spock

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu