KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

MaskedTextBox - Discussion
Goto page 1, 2  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 11, 2006 5:08 pm    Post subject: MaskedTextBox - Discussion Reply with quote

Just uploaded a new version of classic. Added the following:

MaskedTextBox.BackColor
MaskedTextBox.ForeColor

Added the following to MaskedTextBox.Mask

< Shift down. Converts all characters that follow to lowercase.

> Shift up. Converts all characters that follow to uppercase.

| Disable a previous shift up or shift down.

-Shawn
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 11, 2006 5:18 pm    Post subject: Reply with quote

Here's a tiny test script ...

Code:

Break On

$System = CreateObject("Kixtart.System")

$Form = $System.Form()
$Form.Text = "Form1"
$Form.Size = 640,300
$Form.FontSize = 10

$Fields =
"Name", "TextBox", 200, "",
"Phone", "MaskedTextBox", 200, "(000) 000-0000",
"Postal Code", "MaskedTextBox", 200, ">L0L-0L0",
"IP Address", "MaskedTextBox", 200, "[012]00.[012]00.[012]00.[012]00"

$Top = 10

For $i = 0 To UBound($Fields)

 $Label = $Form.Controls.Add("Label")
 $Label.Width = 100
 $Label.Left = 10
 $Label.Top = $Top
 $Label.Text = $Fields[$i]

 $TextBox = $Form.Controls.Add($Fields[$i+1])
 $TextBox.Top = $Label.Top
 $TextBox.Left = $Label.Right
 $TextBox.Width = $Fields[$i+2]
 If $Fields[$i+3]
  $TextBox.Mask = $Fields[$i+3]
 Endif

 $Label2 = $Form.Controls.Add("Label")
 $Label2.Width = 200
 $Label2.Left = $TextBox.Right + 5
 $Label2.Top = $Top
 $Label2.Text = $Fields[$i+3]

 $Top = $Label.Bottom + 5

 $i = $i + 3

Next

$Form.Center
$Form.Show
$Timer.Start

While $Form.Visible
 $= Execute($System.Application.DoEvents())
Loop

Exit 0
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Thu May 11, 2006 5:53 pm    Post subject: Reply with quote

Not to high-jack this thread, but anything on OnTextChanged event for MaskedTextBox?

Wink
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Thu May 11, 2006 6:01 pm    Post subject: Reply with quote

For match set masking, do you put the '<' '>' '|' characters inside the bracket or out?

Like this?

"2\000->[JFMASOND]|[aepuco][nbrylgptvc]-[0-3]0,[0-2]0:[0-5]0:[0-5]0"


Or like this?

"2\000-[>JFMASOND]|[aepuco][nbrylgptvc]-[0-3]0,[0-2]0:[0-5]0:[0-5]0"


Both do not work Crying or Very sad
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 11, 2006 7:12 pm    Post subject: Reply with quote

It would be outside the brackets, but the mask rules still have to apply, so it would probably look like this:

>[JFMASONDjfmasond]

Have to think about whether thats make sense or not though. Guess the question is - should the case conversion happen before checking the mask - or after.
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Thu May 11, 2006 7:19 pm    Post subject: Reply with quote

Shawn wrote:
It would be outside the brackets, but the mask rules still have to apply, so it would probably look like this:

>[JFMASONDjfmasond]

Have to think about whether thats make sense or not though. Guess the question is - should the case conversion happen before checking the mask - or after.


I'd say before. It isn't quite intuitive to include both uppercase and lowercase in the mask when using the conversion characters ('<' ">' '|')
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu May 11, 2006 8:50 pm    Post subject: Reply with quote

I agree. Just posted a new build. Give a try with this mask:

2\000->[JFMASOND]<[aepuco][nbrylgptvc]-[0-3]0,[0-2]0:[0-5]0:[0-5]0

-Shawn
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Thu May 11, 2006 9:41 pm    Post subject: Reply with quote

Shawn wrote:
I agree. Just posted a new build. Give a try with this mask:

2\000->[JFMASOND]<[aepuco][nbrylgptvc]-[0-3]0,[0-2]0:[0-5]0:[0-5]0

-Shawn


That worked great, thanks!
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri May 12, 2006 1:41 am    Post subject: Reply with quote

Just working on the copy & paste thing. Intuitively, how would you think that should work.
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Fri May 12, 2006 4:45 pm    Post subject: Reply with quote

Shawn wrote:
Just working on the copy & paste thing. Intuitively, how would you think that should work.


IMO, similar to Microsoft's Product Key field. You can paste in the entire key in the first block and it will auto-complete the rest of the fields.

In this case, it would be the first position of the masked field. Each character can then run through the series of mask checking. If it passes 100%, paste it in, otherwise nothing happens.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri May 12, 2006 5:34 pm    Post subject: Reply with quote

I just posted a new version of the dev. build. The pasting isn't there yet, but I did rework the keyboard handing of the MaskedTextBox ALOT. But its subtle. Tell me if you notice any difference with keying stuff. You can now arrow onto mask elements - hitting HOME/END takes you HOME and to the END. etc.
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Fri May 12, 2006 5:44 pm    Post subject: Reply with quote

Shawn wrote:
I just posted a new version of the dev. build. The pasting isn't there yet, but I did rework the keyboard handing of the MaskedTextBox ALOT. But its subtle. Tell me if you notice any difference with keying stuff. You can now arrow onto mask elements - hitting HOME/END takes you HOME and to the END. etc.


Using this mask,

"2\000->[JFMASOND]<[aepuco][nbrylgptvc]-[0-3]0,[0-2]0:[0-5]0:[0-5]0"

I was able to delete the all dashes by placing in front and pressing the delete key

From
2006-May-12,10:43:03
To
2006_May_12,10:43:03

I was also able to delete the '2' even though it's hard-coded.

From
2006-May-12,10:43:03
To
_006-May-12,10:43:03

Conclusion : dashes and commas can be deleted as well as any hard-coded values such as the '2' and '0'
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri May 12, 2006 5:58 pm    Post subject: Reply with quote

Good catch. Posted a new build give a try.

One of my favorite new behaviors is if you go HOME (on a mask that has literals at the beginning, like your date) ... then if you press a valid key - it takes you right to the next available spot and fills it in.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri May 12, 2006 6:01 pm    Post subject: Reply with quote

The other new behavior - if you go to END ... then you use your LEFT arrow - it positions the cursor to the RIGHT of the character, instead of the beginning of the character - which isn't intuitive I thought.
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Fri May 12, 2006 6:29 pm    Post subject: Reply with quote

The new build zip file is corrupted. Can you re-up it?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group