For those of us using POL, you can also subclass CGadget, and in the OnDraw() 
method make some calls to WinSetUnderlineMode(solidUnderline) and 
WinDrawChars() to draw your link; you can also stick some code in the OnEnter() 
method to switch to blazer or clipper using SysUIAppSwitch to go to the url...

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Logan Shaw
Sent: 28 November 2005 02:28
To: Palm Developer Forum
Subject: Re: url link on a form


Erico Franco wrote:
> how do i place a url link into a about form?
> 
> I already know how to open a web link using users browser but I want to 
> have a blue underlined text link that when the user tap it (instead the 
> modal form OK button) it call my openUrl() function that is already done.

Easiest method:
     Define a Graphic Button.  Make a bitmap that contains the
     URL text underlined in blue.  Associate the graphic button
     with the bitmap.  Respond to the ctlSelectEvent.

Next easiest method:
     Define a RectangleType where the URL should appear.
     Write a function to draw the URL in blue or in some
     highlight color depending on the argument.  Use
     WinSetTextColor() and WinSetForeColor() since the latter
     will be necessary to affect the color of the underline.

     Call the function with the non-highlight argument
     immediately after each call you make to FrmDrawForm().
     If you don't currently handle frmOpenEvent and frmUpdateEvent,
     add handlers for those and do a FrmDrawForm() and call the
     URL-drawing function.

     Handle penDownEvent.  If they tap within the rectangle,
     do a loop with EvtGetPen().  Use RctPtInRectangle() to
     see if they're inside the rectangle.  Every time they
     enter the rectangle, draw the URL as highlighted.  Every
     time they leave, draw it as unhighlighted.  When they
     lift the pen, if it was highlighted previously, then
     (a) unhighlight it and (b) call your openUrl() function.

I'm sure there are other ways, but as far as I know, there is
no system function to just do a URL.

   - Logan

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to