[Iup-users] How to create a text box that allows 3 characters only

Antonio Scuri scuri at tecgraf.puc-rio.br
Wed Dec 19 10:35:32 GMT+3 2007


  You are mixing two different things.
 
  The NC attribute does exactly what you want. See the documentation of
IupText.
 
  The SIZE attribute will only define the size of the control with. So for
your 3 characters to fit into the text box you should set it to at least
3*4=12. 30 is also a good choice. The idea is that you don't need to know
which font size are being used.
 
Best,
scuri


  _____  

From: iup-users-bounces at lists.luaforge.net
[mailto:iup-users-bounces at lists.luaforge.net] On Behalf Of Steven Mak
Sent: quarta-feira, 19 de dezembro de 2007 08:32
To: iup-users at lists.luaforge.net
Subject: [Iup-users] How to create a text box that allows 3 characters only


Hi,

How to create a textbox which only permits a user enter no more than 3
characters?

  _text_ip_1 = IupText("myaction");
  IupSetAttribute(_text_ip_1, IUP_SIZE,  "30");

Also, I read from the document that "Width in 1/4's of the average width of
a character for the current FONT of each control.". I didn't get it. What is
the proper way to set the size of the textbox to cater 3 characters? Is
there any example on this?

I didn't set any FONT attribute. How I retrieve the FONT size? 

Thank you,
Steven




  _____  

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
<http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8
HDtDypao8Wcj9tAcJ> it now.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.luaforge.net/pipermail/iup-users/attachments/20071219/efe0b6c3/attachment.html


More information about the iup-users mailing list