Page 1 of 1

How to show the hyperlink command in the status line?

Posted: Fri Feb 12, 2016 5:26 pm
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

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

Posted: Sun Feb 14, 2016 12:38 am
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.

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

Posted: Sun Feb 14, 2016 9:50 am
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