[futurebasic] Re: [FB] FB and Unicode

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2007 : Group Archive : Group : All Groups

From: Brian Stevens <bstevens33@...>
Date: Thu, 14 Jun 2007 21:25:37 -0700
On Jun 14, 2007, at 6:43 PM, Bob Bryce wrote:

> Can FB pass these characters, or be programmed to handle
> unicode characters,
> OR am I stuck with 256 ASCI characters??

Apple provides unicode support and there are several ways to  
implement it (depending on needs) in FB. One of the simplest ways is  
to create an edit field using the appearance button statement with a  
button type of  _kControlEditUnicodeTextProc.  There are also calls  
to MLTE that are more complicated.  If you need more advanced stuff  
just post again. Advantages of  _kControlEditUnicodeTextProc edit  
fields are:  1) looks good in OS X,   2) no size limitation like FB  
edit fields (they are tied to Apple's deprecated TextEdit manager  
which is limited to 32k)  3) can handle all unicode characters.     
There should be examples on the FB CD too. Watch out for line breaks  
and other characters added by Mail in the posted code.   Brian S.


// Code start
include "Tlbx CarbonEvents.incl"

'~'1
local fn BuildUntitled1Wnd
'~'1
dim as Rect r
dim as WindowAttributes wa

wa = _kWindowCloseBoxAttribute_kWindowCollapseBoxAttribute
//SetRect( r, 0, 0, 395, 250 )// Optional FB auto-centre
SetRect( r, 630, 408, 1025, 658 )
appearance window -1, "Untitled 1", @r, _kDocumentWindowClass, wa
def SetWindowBackground( _kThemeActiveDialogBackgroundBrush, _zTrue )


SetRect( r, 23, 23, 378, 227 )
appearance button 1, _activeBtn,,,,, @r, _kControlEditUnicodeTextProc

appearance window 1
end fn

fn BuildUntitled1Wnd


do
HandleEvents
until gFBQuit
// Code end