How to show the hyperlink command in the status line?

Usage of the framework, compiler and tools

How to show the hyperlink command in the status line?

Postby Zinn » Fri Feb 12, 2016 5:26 pm

In BlackBox I can create hyperlinks by writing
<InfoCmds.Start('http://community.blackboxframework.org/')>BlackBox Component Builder Forums<>
select the line and use the menus Tools -> Create Link.
It is shown as
BlackBox Component Builder Forums

When I point with the mouse on this hyperlink I would like to see its command in the status line:
InfoCmds.Start('http://community.blackboxframework.org/')
and the hyperlink itself should by underlined
BlackBox Component Builder Forums
How to implement this task.

Thank you very much for any help.
- Helmut
Zinn
 
Posts: 58
Joined: Mon Nov 24, 2014 10:47 am

Re: How to show the hyperlink command in the status line?

Postby manumart1 » Sun Feb 14, 2016 12:38 am

I practised this change in module StdLinks:

Code: Select all
PROCEDURE (v: Link) HandleCtrlMsg* (f: Views.Frame; VAR msg: Controllers.Message; VAR focus: Views.View);
...
   PROCEDURE ShowDest();      <------ new subprogram
      VAR s: POINTER TO ARRAY OF CHAR; quot: CHAR;
         len, k, j: INTEGER;
   BEGIN
      IF v.cmd = NIL THEN
         Dialog.ShowStatus("")
      ELSE
         len := LEN(v.cmd);
         k := 0; WHILE (k < len) & (v.cmd[k] # "(") DO INC(k) END;
         IF k < len THEN
            NEW(s, len - k);
            INC(k); quot := v.cmd[k];
            INC(k); j := 0;
            WHILE (k < len) & (v.cmd[k] # quot) DO s[j] := v.cmd[k]; INC(k); INC(j) END;
            s[j] := 0X;
            Dialog.ShowStatus(s)
         ELSE
            Dialog.ShowStatus(v.cmd)
         END
      END;
   END ShowDest;

BEGIN
   WITH msg: Controllers.PollCursorMsg DO
      msg.cursor := Ports.refCursor
   | msg: TextControllers.FilterPollCursorMsg DO
      ShowDest;      <------
      IF isHot(msg.controller, msg.x, msg.y, {}) THEN
         msg.cursor := Ports.refCursor; msg.done := TRUE;
      END
...
END HandleCtrlMsg;

It only shows the destination of the link in the status bar, but does not underline the text of the link.
manumart1
 
Posts: 66
Joined: Tue Sep 17, 2013 6:25 am

Re: How to show the hyperlink command in the status line?

Postby Zinn » Sun Feb 14, 2016 9:50 am

Manuel, thank you very much.
It works perfectly.
Personally I prefer to see the complete command and changed ShowDest to

Code: Select all
      PROCEDURE ShowDest;
      BEGIN
         IF v.cmd = NIL THEN
            Dialog.ShowStatus("")
         ELSE
            Dialog.ShowStatus(v.cmd)
         END;
      END ShowDest;

- Helmut
Zinn
 
Posts: 58
Joined: Mon Nov 24, 2014 10:47 am


Return to Common questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron