Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to convert characters the User enters into a Textbox to CAPs conditionally?
How to convert characters the User enters into a Textbox to CAPs conditionally? [message #1219507] Wed, 04 December 2013 05:38
Tilak Sharma is currently offline Tilak Sharma
Messages: 48
Registered: July 2009
Member
How to convert characters the User enters into a Textbox to CAPs conditionally?

We have a peculiar use-case where in, we have:


  • 1 A Textbox (org.eclipse.swt.widgets.Text), in which user types in.
  • 2 A checkbox (which reads: Convert to Uppercase)


If this checkbox is Checked, each of the character the User types in from that moment should be converted to Capital letter.
If he unchecks that and types again, we should retain the earlier text as it is and continue to accept the letters as he types in, without any case modification.

We tried using the org.eclipse.swt.events.KeyListener, but we are compelled to handle all the cases like, Backspace, Control, Delete, Tab, Num Pad key presses, etc.

We also tried VerifyListener, but that gives me the complete text and not just the recently typed in character/key.

Is there a simple way to achieve this?

Thanks,
Tilak

[Updated on: Wed, 04 December 2013 06:42]

Report message to a moderator

Previous Topic:Layout Manager for display on one line
Next Topic:How to set id`s to org.eclipse.swt.widgets.Table items and rows
Goto Forum:
  


Current Time: Fri Jul 25 12:16:45 EDT 2014

Powered by FUDForum. Page generated in 0.01913 seconds