FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

TEXT

Make an Edit Field acting like a button


If you are talking about static text, then there is an easy solution. Just get a Rect that surrounds the text and check FN PTinRect every time there is a mouse click in your widow to see if it was hit. You should definatly provide some feedback that the text is being clicked -- change the color or something. The code will look something like this: (off the top of my head-- so it may not be completely correct)

MyClicked=_false

LONG IF FN PTINRECT (Pt, Rect) 'User Has Clicked Text
  WHILE FN Button 'While they hold down the mouse they can still change there mind
    CALL GETMOUSE (MyPoint) 'Check New Mousepoint
    LONG IF FN PTINRECT (MyPoint, Rect) 'Is it still in Text's Rect
      LONG IF Not MyClicked 'Don't Need to hilite if it already is Hilite Text
        MyClicked=_zTrue
      END IF
    XELSE 'No longer in Rect-- need to unhilite text
      LONG IF MyClicked 'Don't Need to UnHilite if it already is Show Text Normally
        MyClicked=_false
      END IF
    END IF
  WEND

LONG IF MyClicked
' Was clicked-- do your stuff
XELSE
'--User changed Mind -- don't react
END IF

This may seem like a lot of work for a simple hit test-- but on the mac we must always give the user a chance to change their mind.

Jon