hyper link within open edge 10.2b

jmac12

Member
I'm trying to put a hyperlink on a window. just wondering if there any way of doing that? The hyperlink is coming from a database field.. So e.g. company.web = www.google.com then user clicks on it and takes them to the website. I've tried putting a fill-in box on and changing the colour. But few problems with that, one to underline it I’ve got to change the font and that would mean adding it for all my customers so thats a no. Two if I want the glove course to appear when hovered over it, the fill-in has to be enabled which looks pants. So in summary either want to be able to put a hyperlink in or make something look and function like one.
I’m using open edge 10.2b
 
Use a TEXT widget instead of a FILL-IN and load the glove onto a small frame the size of the TEXT widget. No underline, but 2 out of 3 ain't bad...

Code:
DEFINE VARIABLE hwindow AS HANDLE      NO-UNDO.
DEFINE VARIABLE hframe1 AS HANDLE      NO-UNDO.
DEFINE VARIABLE hframe2 AS HANDLE      NO-UNDO.
DEFINE VARIABLE htext   AS HANDLE      NO-UNDO.
DEFINE VARIABLE curl    AS CHARACTER   NO-UNDO INITIAL "www.exact.com   ":U.

CREATE WINDOW hwindow ASSIGN
   TITLE          =  "Hyperlink test":U
   STATUS-AREA    =  FALSE
   MESSAGE-AREA   =  FALSE
   VISIBLE        =  TRUE
   .
CREATE FRAME hframe1 ASSIGN
   ROW            =  1
   COL            =  1
   WIDTH          =  hwindow:WIDTH
   HEIGHT         =  hwindow:HEIGHT
   PARENT         =  hwindow
   VISIBLE        =  TRUE
   .

CREATE FRAME hframe2 ASSIGN
   ROW            =  hwindow:HEIGHT / 2
   COL            =  ( hwindow:WIDTH - LENGTH( curl ) ) / 2 
   WIDTH-PIXELS   =  FONT-TABLE:GET-TEXT-WIDTH-PIXELS( curl, hwindow:FONT )
   HEIGHT         =  1
   FRAME          =  hframe1
   BOX            =  FALSE
   VISIBLE        =  TRUE
   .
 
CREATE TEXT htext ASSIGN
   FORMAT         =  SUBSTITUTE( "X(&1)":U, LENGTH( curl ) )
   SCREEN-VALUE   =  curl
   FRAME          =  hframe2
   VISIBLE        =  TRUE
   FGCOLOR        =  9
   SENSITIVE      =  TRUE
   .
   
hframe2:LOAD-MOUSE-POINTER( "GLOVE":U ).
   
ON 'MOUSE-SELECT-CLICK':U OF htext DO:
   MESSAGE htext:SCREEN-VALUE VIEW-AS ALERT-BOX.
END.
   
WAIT-FOR CLOSE OF THIS-PROCEDURE.

I also recommend using a more Windows standardized cursor instead of Progress' ET finger cursor...

Note that since you're on 10.2B you could also be using the .Net UI controls - there is a pretty easy URL selector method for text widgets instantly making it look like an URL. Minor downside is that you then need to still do too much work to get it to do anything...

Code:
            THIS-OBJECT:labeldoc_id:Text = "Created document: ":U + cdoc_id.
            THIS-OBJECT:labeldoc_id:LinkArea = NEW System.Windows.Forms.LinkArea(18, 10).
 
Back
Top