Rounded Editfield Focus Ring 
Author Message
 Rounded Editfield Focus Ring


I've made a custom Rounded Editfield and need to draw a focus ring around it. Any ideas anyone?

Chris Willis

Fri, 12 Aug 2005 21:51:48 GMT  
 Rounded Editfield Focus Ring


> Hi,

> I've made a custom Rounded Editfield and need to draw a focus ring around
> it. Any ideas anyone?

Ask the Mac OS to draw it?
If I'm correct there is a draw function for this in the Toolbox which
accepts a Region as a parameter.


Three thousand functions in one REALbasic plug-in. The MBS Plugin.


Sat, 13 Aug 2005 09:50:42 GMT  
 Rounded Editfield Focus Ring

Yeah, I've tried this but my region code doesn't seem to work (it is empty after I've drawn to it). Here's the code....

Note that I've just used a rectangular region for the moment to see if the code worked, but I couldn't even get the rectange to work. I've tried several things, but nothing seems to work.

-------  Declare Function NewRgn Lib "CarbonLib" () As Integer  Declare Sub OpenRgn Lib "CarbonLib" (rgn as integer)  Declare Sub CloseRgn Lib "CarbonLib" (rgn as integer)  'Declare Sub RectRgn Lib "CarbonLib" (rgn as integer, rect as ptr)  Declare Sub SetRectRgn Lib "CarbonLib" (rgn as integer, left as integer,
top as integer, right as integer, bottom as integer)  Declare Sub DisposeRgn Lib "CarbonLib" (rgn As Integer)  Declare Sub EmptyRgn Lib "CarbonLib" (rgn as integer) as boolean  Declare Function DrawThemeFocusRegion Lib "CarbonLib" (rgn As Integer, isFocus As Boolean) As Integer    dim i, OSStatus as integer  'dim m as memoryblock    i = NewRgn()  OpenRgn i  'm = newmemoryblock(8)  'm.short(0) = top + 5  'm.short(2) = left + 5  'm.short(4) = top + height - 10  'm.short(6) = left + width - 10  'RectRgn i, m  SetRectRgn i, 5, 5, width - 10, height - 10  CloseRgn i  'If EmptyRgn(i) then  'MsgBox "Empty"  'end if  OSStatus = DrawThemeFocusRegion(i, true)  'MsgBox str(OSStatus)  DisposeRgn i

Chris Willis.

Mon, 15 Aug 2005 01:11:24 GMT  
 [ 3 post ] 

 Relevant Pages 

1. Can I set an EditField Focus?

2. EditField Focus

3. EditField Focus

4. How to get wich editField has the focus?

5. Focus Ring

6. Drawing a Focus Ring using Regions

7. focus ring and scrolling

8. Returning Key focus on Text ring

9. Incorrect focus ring under windows...

10. ring 0 to ring 123

11. Ring 0 access from within a ring 3 program without VxD

12. round rounds right?


Powered by phpBB® Forum Software