Progress editor - how to align text?

Posted by goo on 25-Jul-2016 08:54

OE11.6.2

I have a simple editor that I add some text into.

I.e:

Fishname + ':' + NumberofFish + ..... + Chr(10)

I would like to have ':' under each other, but no way I am getting it... I remember back in time some talk about different styles, but can't remember what it was. Is it possible to get the text aligned in the editor?

I haver tried to use FILL(' ',..... but nups...

//Geir Otto

All Replies

Posted by smat-consulting on 25-Jul-2016 09:09

Did you set the font of the editor to a fixed width one? If it is variable, it will never work...

Posted by goo on 25-Jul-2016 09:13

Do you know a font I could try?

Posted by Matt Gilarde on 25-Jul-2016 09:18

Font 2 should be defined as a fixed font already so you can use it for testing.

Posted by goo on 25-Jul-2016 09:19

I have tried Courier New, but still the same problem....I thought that was a fixed width font....

Posted by smat-consulting on 25-Jul-2016 09:20

Depends on what you have in your ini file (or registry, if you're not using an ini file).

I haven't worked with guy in a long while (doing only Web UI these days, to make app available to anybody, not just the MS users). What I do remember is, that you can define a bunch of fonts in the ini file, and then assign the font that you like to the editor-widget... The font's you define are similar to what you see in a font selection drop-down in a word processor

Most obvious choice for fixed font is courier. But I think there are others...

Posted by goo on 25-Jul-2016 09:29

When you changes the font, it ask me if I want to save it for INI file... and I do. I also see the font changed when testing, but still I haver problems.. I think I will find another way of doing it... it seems like the editor can't be used for this kind of list.... I also tested with system font... no luck

Posted by smat-consulting on 25-Jul-2016 09:39

Assuming you're in the app builder:

* select the editor-widget you want to change the font for

* click on "Object Properties" button

* click on "Fonts" button (on vertical bar on right side of dialog-box)

* select the font-number that you want to use (in my ini font2=Courier New, size=8)

If you want to do that simply in text - without the AppBuilder, you can use a statement like this:

DEFINE VARIABLE EDITOR-1 AS CHARACTER

    VIEW-AS EDITOR NO-WORD-WRAP SCROLLBAR-HORIZONTAL SCROLLBAR-VERTICAL

    SIZE 30 BY 4

    FONT 2 NO-UNDO.

Posted by goo on 25-Jul-2016 10:09

I know how to set the font :-) I also know how to set the font in the INI file.. but that does not help me since it does not seems to work with fixed-wdith fonts...

Posted by Rob Fitzpatrick on 25-Jul-2016 10:24

Have you tried using stream-io on the frame?

Posted by smat-consulting on 25-Jul-2016 10:30

Ha! Yes, I was a bit surprised - you're quite knowledgeable so why would you ask such a basic question?

I tried it quickly, and it seems to work fine for me (I'm on 11.3). Maybe you're overlooking some little detail in the setup of the session where you're observing the problem...

Maybe try to put a message statement in a ENTRY trigger of the editor-widget, to show the font-number being used, and maybe use GET-KEY-VALUE to get the definition it actually uses...

Good luck...

PS: If you have another progress programmer there, ask her/him to review your code and setup. A second pair of eyes often helps find such issues...

Posted by goo on 25-Jul-2016 11:35

By using system font and using TAB as separator instead of space and using fill(' ',.... I got it to work good enough :-) It is still some dealigned stuff on decimals, but I really don't care right now :-) thanks.... Rob, I will try using stream-io to see if that helps. Thanks :-)

This thread is closed