issue-#163 Adding 'Decimal' Tabs to Rulers

Merged to the master branch
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Robert »

Josef Templ wrote:Undo support has been added now.
Thats working nicely.

You haven't addressed my trivial comments from my previous post. Actually there are several non-bold RETURNs and HALTs in these files. Although it is not strictly part of the issue I would be tempted, when working on a file, to correct safe formatting errors.

I haven't tested the rtf stuff; I'll wait to look at the diffs.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Josef Templ »

Robert wrote:
Josef Templ wrote:Undo support has been added now.
Thats working nicely.

You haven't addressed my trivial comments from my previous post. Actually there are several non-bold RETURNs and HALTs in these files. Although it is not strictly part of the issue I would be tempted, when working on a file, to correct safe formatting errors.

I haven't tested the rtf stuff; I'll wait to look at the diffs.
Sorry, I have overlooked that. It is now bolded.

In general, I think, the "bolding" is intended only for non-local control flow,
i.e. only for RETURN that is not at the end of a function or procedure.
Anyway, it is all bolded now.

When bolding, I noticed that after Find I need to press Ctrl-b twice to get it to bold font.
This is surprising because usually it is set to bold at the first Ctrl-b click.
This is the same behavior as in 1.7 and 1.6. Very strange.

here are the diffs:
https://redmine.blackboxframework.org/p ... 6&type=sbs

- Josef
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Josef Templ »

Robert wrote:I have tested build 891 - looking excellent to me.

The details of the implementation are beyond what I can understand (without spending a LOT of time), but some trivial comments are:
- In module TextRulers the type definition of TabDialogHook should be bold.
- In OpenTabDlg are both IFs necessary, or could the second one be an ELSE?
- In NewTabDialogHook the RETURN should be bold.
- Still no Button to open Text/Docu/Rulers.odc.
TabDialogHook is for the extension interface only and I was looking into Services where the hook is also not in bold.
But this seems to be an exception. Maybe it should be bold.

In OpenTabDlg both IFs are necessary, I think.

Docu has not been added yet, so there is also no Help button. Will be added when the features are stable.

- Josef
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Robert »

Robert wrote:- In OpenTabDlg are both IFs necessary, or could the second one be an ELSE?.
Josef Templ wrote:In OpenTabDlg both IFs are necessary, I think.

Code: Select all

PROCEDURE OpenTabDlg(r: Ruler; tabIndex: INTEGER);
		VAR tc: Kernel.Module;
	BEGIN
		IF tabDialogHook = NIL THEN tc := Kernel.ThisMod("TextCmds") END;
		IF tabDialogHook # NIL THEN tabDialogHook.Open(r, tabIndex) END
	END OpenTabDlg
So calling Kernel.ThisMod can have the side effect of changing tabDialogHook from NIL to non-NIL?, or am I missing something?
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Josef Templ »

Are we still misunderstanding each other? Are you saying this is not equivalent?

Code: Select all

PROCEDURE OpenTabDlg(r: Ruler; tabIndex: INTEGER);
		VAR tc: Kernel.Module;
	BEGIN
		IF tabDialogHook = NIL THEN tc := Kernel.ThisMod("TextCmds")
		                       ELSE tabDialogHook.Open(r, tabIndex) END
	END OpenTabDlg
Anyway it is completely unimportant - I don't want to discuss it much more!
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Robert »

The previous post says it was from Josef, but actually I wrote it. Ivan made me a board administrator (which I use to move topics to "Resolved" etc) and I seem to have accidently abused my power. Sorry.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Josef Templ »

Robert wrote:
Robert wrote:- In OpenTabDlg are both IFs necessary, or could the second one be an ELSE?.
Josef Templ wrote:In OpenTabDlg both IFs are necessary, I think.

Code: Select all

PROCEDURE OpenTabDlg(r: Ruler; tabIndex: INTEGER);
		VAR tc: Kernel.Module;
	BEGIN
		IF tabDialogHook = NIL THEN tc := Kernel.ThisMod("TextCmds") END;
		IF tabDialogHook # NIL THEN tabDialogHook.Open(r, tabIndex) END
	END OpenTabDlg
So calling Kernel.ThisMod can have the side effect of changing tabDialogHook from NIL to non-NIL?, or am I missing something?
I thought I had already responded to this but the posting does not show up. Anyway here is it again:

Under a normal BB startup sequence TextCmds would be loaded anyway and tabDialogHook is already set.
Under a non-standard startup sequence (application specific, for whatever reason different, e.g. different menu bar)
TextCmds may not have been loaded yet and therefore there is an attempt to load it.
This sets tabDialogHook if the attempt is successful.
Opening the tab dialog must be done in any case if tabDialogHook is set. This is a separate step
following the optional loading step.

- Josef
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Josef Templ »

I have added a Help button and updated the docu.

The Help button opens a new Text/Docu/Tab.odc file
very much like for the Edit->Preferences dialog.
A separate document per dialog looks more systematic to me
and avoids to clutter the other docu files.

See the diffs at https://redmine.blackboxframework.org/p ... 874da85503.

- Josef
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Robert »

Josef Templ wrote:I have added a Help button and updated the docu.
I think we are very close to a good result here.

1 - Why is TextCmds.tabulator.radixChar a string rather than a single CHAR?

2 - Regarding the Help button my suggestion was to add convenient access to the existing documentation (for the existing facilities). You have added convenient access to new documentation for the new facilities.
Thats obviously good, but can't we have both? I suggest adding the line (folded!)
(Further information on using TextRulers is available <StdCmds.OpenBrowser('Text/Docu/User-Man','Text User Manual');StdLinks.ShowTarget('Text Rulers')>here<>.)
to both Text/Docu/Rulers & Text/Docu/Tab.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#163 Adding 'Decimal' Tabs to Rulers

Post by Josef Templ »

Robert wrote:
Josef Templ wrote:I have added a Help button and updated the docu.
I think we are very close to a good result here.

1 - Why is TextCmds.tabulator.radixChar a string rather than a single CHAR?

2 - Regarding the Help button my suggestion was to add convenient access to the existing documentation (for the existing facilities). You have added convenient access to new documentation for the new facilities.
Thats obviously good, but can't we have both? I suggest adding the line (folded!)
(Further information on using TextRulers is available <StdCmds.OpenBrowser('Text/Docu/User-Man','Text User Manual');StdLinks.ShowTarget('Text Rulers')>here<>.)
to both Text/Docu/Rulers & Text/Docu/Tab.
@1: it is not possible to link to a CHAR, only ARRAY OF CHAR works.

@2: I have added the suggested links. See diffs at https://redmine.blackboxframework.org/p ... adeb4f3cf0.

- Josef
Post Reply