issue-#163 Adding 'Decimal' Tabs to Rulers

Merged to the master branch
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 »

Previous and Next buttons (<, and >) have been added to the Tab dialog.
Also a tabulator number has been added.

- Josef
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

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

Post by luowy »

good work!

about "horizontal line":
I often use "pageBreak" to simulate a horizontal line for a table, but these dummy lines can't printed like you see.
it's pity I cant find a solution wih a easy way. Is anyone interested in this feature?
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 »

luowy wrote:about "horizontal line":
I often use "pageBreak" to simulate a horizontal line for a table, but these dummy lines can't printed like you see.
it's pity I cant find a solution wih a easy way. Is anyone interested in this feature?
You can use an "underlined" table row.
Since white space is also underlined starting with 1.7 this works pretty well.

You could also implement a special view that displays a thin line.
This, however, requires some programming and it requires the special view to be available
when the text is opened, maybe by someone else.

- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

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

Post by Zinn »

(1)
Subsystem Ctls provides a special line view with attribute of colour and thickness.

(2)
In module TextRulers at the procedure Internalize the ELSE part is missing for backward compatibility.

Code: Select all

		IF thisVersion >= 2 THEN
			...
		ELSE
			i := 0; WHILE i < a.tabs.len DO a.tabs.tab[i].type := {}; INC(i) END
		END
	END Internalize;


(3)
The form field for the position number is too small. Position numbers greater than 9.99 are not displayed correctly.
e.g. 16.00 cm is displayed as .6. cm

- Helmut
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 »

For horizontal lines Helmut might be referring to module CtlsFigures on the CPC site.

There is a lot of work in this change, and I have not read it all carefully. But I shall make a some initial observations below:

1 - What is the logic? Is it "If a field contains 1 or more decimal characters, use the last as the alignment point, otherwise use the right edge of the field as the alignment point"?
The code seems to give special significance to the '.' character, but maybe I am looking at an obsolete diff.

2 - (Not a BlackBox issue!). The Tab units were in inches when I am used to cm. Because of the new BlackBox false virus problem I have recently changed from Windows 7 to 10, and it was quite a search to find how to set the units to metric.

3 - On the Tabulator Settings form I think it would be helpful to have a button that opened the Docu file. I think this would be helpful on very many forms. I am not suggesting that we methodically add such buttons everywhere, but when we add or change forms we could adopt a habbit of adding Docu buttons.

4 - If you change the nature of a Tab (eg left to center) while the Settings form is open, the form does not update immediately to reflect this change.

5 - Do we want the "Apply" button. Is it not simpler to make all changes immediately auto-apply?

6 - Personally I am used to, and now prefer, the old BlackBox tab look rather than the Word look. I don't feel very strongly about this; what do other people prefer?

7 - I definitely don't like the way non-numeric fields are right justified. I think of decimal alignment as a variant of center alignment, and would like non-numeric fields to be center justified. This would preserve backward compatibility for my old documents, and cause no problems for new users of this new ruler feature.


Despite these comments I think Josef has done a great job here (again).
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

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

Post by Zinn »

Robert wrote: 7 - I definitely don't like the way non-numeric fields are right justified. I think of decimal alignment as a variant of center alignment, and would like non-numeric fields to be center justified. This would preserve backward compatibility for my old documents, and cause no problems for new users of this new ruler feature.
I'm not agree. In my opinion right justify is the correct rule.
When you enter a number the number is moved to the correct position immediately.
With Robert's rule the number position jumps after enter the decimal point.
That is ugly.
-Helmut
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 »

Zinn wrote: In module TextRulers at the procedure Internalize the ELSE part is missing for backward compatibility.

Code: Select all

		IF thisVersion >= 2 THEN
			...
		ELSE
			i := 0; WHILE i < a.tabs.len DO a.tabs.tab[i].type := {}; INC(i) END
		END
	END Internalize;
This is compensated for by the line

Code: Select all

		i := 0; WHILE i < a.tabs.len DO rd.ReadInt(stop); InitTab(stop, a.tabs, a.tabsData, i); INC(i) END;
Note the InitTab call.

- 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 »

Zinn wrote:
Robert wrote:With Robert's rule the number position jumps after enter the decimal point.
That is ugly.
Are you saying this after trying my posted code?
I ask because my code is buggy, and does produce ugly jumps. My preferred rule also produces jumps, but so does the new rule.
Type in "123.456", in the natural order. Both rules produce jumps after the "2", "3", & ".". I think the fact that the sequences of jumps are slightly different is a very minor issue, what matters is the final amount of jump, which is the same in both cases.
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 »

Zinn wrote: The form field for the position number is too small. Position numbers greater than 9.99 are not displayed correctly.
e.g. 16.00 cm is displayed as .6. cm
I have increased the Position field so that it displays 99,99 also with a 10pt Dialog default font.

- 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:For horizontal lines Helmut might be referring to module CtlsFigures on the CPC site.

There is a lot of work in this change, and I have not read it all carefully. But I shall make a some initial observations below:

1 - What is the logic? Is it "If a field contains 1 or more decimal characters, use the last as the alignment point, otherwise use the right edge of the field as the alignment point"?
The code seems to give special significance to the '.' character, but maybe I am looking at an obsolete diff.

2 - (Not a BlackBox issue!). The Tab units were in inches when I am used to cm. Because of the new BlackBox false virus problem I have recently changed from Windows 7 to 10, and it was quite a search to find how to set the units to metric.

3 - On the Tabulator Settings form I think it would be helpful to have a button that opened the Docu file. I think this would be helpful on very many forms. I am not suggesting that we methodically add such buttons everywhere, but when we add or change forms we could adopt a habbit of adding Docu buttons.

4 - If you change the nature of a Tab (eg left to center) while the Settings form is open, the form does not update immediately to reflect this change.

5 - Do we want the "Apply" button. Is it not simpler to make all changes immediately auto-apply?

6 - Personally I am used to, and now prefer, the old BlackBox tab look rather than the Word look. I don't feel very strongly about this; what do other people prefer?

7 - I definitely don't like the way non-numeric fields are right justified. I think of decimal alignment as a variant of center alignment, and would like non-numeric fields to be center justified. This would preserve backward compatibility for my old documents, and cause no problems for new users of this new ruler feature.


Despite these comments I think Josef has done a great job here (again).
@1: the rightmost radix char defines the alignment position. By default it is the "." but it can be changed by setting another TextRulers.defaultRadixChar.
When stored, the defaults are no longer used. The default is only used when a new tab is inserted.
Alignment is right-adjusted if there is no radix char at all.
This strategy is in line with what I have seen from other text processors, in particular with Open Office.

@2: this is a Windows setup issue. Dialog.metricSystem uses the user#s preferences via the Windows registry.
In principle it would also be possible to use the default radix char from the registry but this requires some more changes,
in Dialog and HostDialog, I guess, but it would be possible, I think.

@3: I agree in principle that forms should have a Help button. The docu is not yet updated.
If there is a Help button, should it link to a separate docu file (per form) or should it link into a
target of a more general docu text? Probably, it would be better to have a separate docu file per form.

@4: this is not easily possible, at least I don't know how to implement this synchronization.
OpenOffice uses a modal dialog for that purpose and this would solve the problem but there are no modal dialogs in BlackBox, are they?

@5: this leads to troubles and is not the way typical forms in BB work.
If you edit the tab position, for example, you may need to edit two digits and applying after editing the first digit would already
change the tab position. It also doesn't save any work because you (normally) close the Tab dialog after editing. By pressing ENTER
the changes are applied and the form is closed in one step.

@6: The triangle look was inspired by MacWrite, a text processor bundled with the first MacOs, I think.
In the meantime this is no longer in widespread use. Its development has ended around 1995.
The look applied in Word and OpenOffice is much more commonly known now and that is why it has been adapted.
Actually, I thought quite some time before adding the new look.
If you think of BB as a platform for real-world application development ( I am using it for that),
it should also be easy for a secretary to use the text processor and that is easier when at least some symbols are familiar.

@7: All text processors that I have looked at treat decimal tabs as a form of right alignment, not centered.
If you have a column of numbers isn't it quite natural to align it as

Code: Select all

   0
   0.5
   3.14159
- Josef
Post Reply