How to show the hyperlink command in the status line?

Usage of the framework, compiler and tools
Post Reply
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

How to show the hyperlink command in the status line?

Post by Zinn »

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
manumart1
Posts: 67
Joined: Tue Sep 17, 2013 6:25 am

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

Post by manumart1 »

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.
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

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

Post by Zinn »

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
Post Reply