How to change space reserved for fill-in widgets?

Skc

Member
Hi

Screen fill-in widgets.
When I define a screen frame with fields from a table in the database and using the default format of the fields, when it is shown on screen, the tendency is that :

(1) Those fields with short format eg. X(3) will show info properly though often the space reserved on the screen is longer than necessary.

(2) Those fields with longer format eg. X(35), and when the data is partly or wholly in CAPS, I often find the data shown on screen truncated.

The problem is with (2). This means that for many frames in an application, I would have to modify many screen widgets by adding something like "view-as fill-in size 45 by 1" etc. This is tedious.

Question: Is there an easier way or a way for me to tell Progress to reserve more space for fill-in widgets on all screen frames?
 
It is possible I think.

What you can do is use the FONT-TABLE:GET-TEXT-WIDTH method to find out the width of the text displayed in the fill-in. You can then add a bit of space for the fill-in borders and you should get a fairly accurate result.

In order to do this you will need to 'walk the widget tree'. If you don't know how to do this there are plenty of examples about.

I don't know the style of your UI, but you will also need to make sure that the new size that you give to a fill-in isn't too large for the frame.

For example, assuming 'hField' is a handle to the fill-in, you could do something like this:

ASSIGN
hField:WIDTH = FONT-TABLE:GET-TEXT-WIDTH(hField:SCREEN-VALUE,hField:FONT) + 1.
 
Hullo Mike

Thanks for your post. Your suggestion seems like a runtime dynamic lengthening of the width based on actual data. It's more sophisticated than what I need. ;p

To clarify: I have a customer.name field that is format "x(35)". When this field is defined in a typical frame of mine, Progress automatically gives it a certain width based on the format. This is usually sufficient. However there are times when end-user key in the customer.names all in CAPS. Then the default width would not be sufficient for display.

What I would like is to have this customer.name field to have a fixed width catering for the maximum (perhaps size 45 by 1) for ALL frames in my application. It is static. I can do this by amending all frames and putting "view-as fill-in size 45 by 1" for all such occurrences. The trouble is this is tedious. On top of that, there are other fields that need to lengthen as well.

There's a possibility of putting the "view as fill-in size 45 by 1" in the Data dictionary. That will solve the screen frames. But the cons is that all my reports that prints customer.name will be using more space than required.
 
Back
Top