[futurebasic] Evil Appearance edit buttons

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2004 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Thu, 8 Jan 2004 23:54:21 -0500

I am suffering grief from Appearance runtime button - edit fields.

  _kControlEditUnicodeTextProc = 912
dim as ControlFontStyleRec  cfs
cfs.flags = _kControlUseFontMask_kControlUseJustMask
cfs.font  = _kControlFontBigSystemFont
cfs.just  = _teJustRight // Ignored it seems...

SetRect(r, 250, 209, 280, 225)
appearance button _LevelsMasterWhiteField,¬
                   _activeBtn,¬
                   1, 0, 1, , @r,¬
                   _kControlEditUnicodeTextProc
def SetButtonFontStyle( _LevelsMasterWhiteField, cfs )
def SetButtonTextString(_LevelsMasterWhiteField, "255")

Problem 1....how can one set it to center or right justify? Doesn't 
work (te is a clue, probably ignored by this type of control.)

Problem 2...how can one filter input with same control so that one 
can't type in alpha characters (0-255 only is legal)

Seems impossible. Carbon Events required?

?

_kControlEditUnicodeTextProc gives much benefit, such as prettier text, 
and not the scraggly (in OS X) regular EF type, but the downside 
appears to be the 2 problems I have.

Argh. How can we write professional looking apps given these factors?  
Problem 1 is not really a problem. But Problem 2 would be so spiffy if 
it could be handled by a Key filter...

The control above doesn't seem to generate an _evKey anything. I'm 
confoundabulated.

Anybody have a suggestion to beat this nematode?

Robert Bob