> > Mark Chappell wrote: > >> 3. Is there a way to get FBtoC to create non-static edit fields >> without showing the *#$(&@ focus rectangle (which, when it >> disappears, leaves a several pixel-wide overdrawn area, thus >> precluding tight packing of edit fields, as adjacent fields >> overwrite each other) > > > I don't know of a way. The FB5 demo below shows how to get the > visual appearance of no focus rect. But it does this by erasing the > system-drawn halo before it becomes visible, and won't serve your > purpose. I think you will have to adjust your layout to leave at > least 7 pixels between editable text fields. OK, that's clear enough. Thanks. > > > Robert P. > > '----------------- > include "Tlbx CarbonEvents.incl" > > local fn ControlFocusRectObliterator( nextHandler as > EventHandlerCallRef, theEvent as EventRef, userData as ptr ) > '~'1 > dim as OSStatus result : result = _eventNotHandledErr > dim as ControlRef @ c > dim as Rect r > dim as ControlPartCode @ part > > fn GetEventParameter( theEvent, _kEventParamDirectObject, > _typeControlRef, #0, sizeof( c ), #0, @c ) > fn GetEventParameter( theEvent, _kEventParamControlPart, > _typeControlPartCode, #0, sizeof( part ), #0, @part ) > long if ( part != _kControlFocusNoPart ) > // We are getting focus. > // First, let HIToolbox handle the focus change... > result = fn CallNextEventHandler( nextHandler, theEvent ) > //...erase the focus rect... > GetControlBounds( c, @r ) > InsetRect( r, -2, -2 ) > fn DrawThemeFocusRect( r, _false ) > //...then fix up the frame > InsetRect( r, 1, 1 ) > fn DrawThemeEditTextFrame( r, _kThemeStateActive ) > end if > end fn = result > > > local fn InstallControlFocusRectObliterator( c as ControlRef ) > '~'1 > dim as EventTypeSpec controlEvents > > controlEvents.eventClass = _kEventClassControl > controlEvents.eventKind = _kEventControlSetFocusPart > end fn = fn InstallEventHandler( fn GetControlEventTarget( c ), @fn > ControlFocusRectObliterator, 1, @controlEvents, #0, #0 ) > > > local fn BuildWindow > '~'1 > dim as Rect r > > SetRect( r, 0, 44, 640, 524 ) > appearance window -1,, @r, _kDocumentWindowClass > > SetRect( r, 234, 190, 398, 206 ) > appearance button 1,,,,, "No focus ring", @r, > _kControlEditUnicodeTextProc > fn InstallControlFocusRectObliterator( button&( 1 ) ) > > OffsetRect( r, 0, 40 ) > appearance button 2,,,,, "Focus ring" , @r, > _kControlEditUnicodeTextProc > > appearance window 1 > end fn > > > fn BuildWindow > do > HandleEvents > until gFBQuit > '----------------- > > -- > To unsubscribe, send ANY message to: futurebasic-unsubscribe@... >