Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > GUI Development
  New Posts New Posts RSS Feed - Changing the width of a grid column
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedChanging the width of a grid column

 Post Reply Post Reply
Author
Message
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Topic: Changing the width of a grid column
    Posted: May 04 2006 at 4:54am
The manual says that:

GPCOLWIDTH is the width of column (separate each column’s width with value marks). The width for an individual column can be accessed by ATGUIGETPROP and
ATGUISETPROP by specifying nonzero COL argument.

So if I do:

CALL ATGUISETPROP(GUIAPP, GUIFRM, 'grdMenuItem', GPCOLWIDTH, 2, 0, 200, GUIERRORS, GUISTATUS)

I should be able to change the width, but what happens is I get an error of:

Program "ATGUISETPROP": Line 59, Variable "STATE" previously undefined. Empty string used.

and GUIERRORS is:

3 3²ATGUISETPROP²²0²5001²GUI environment not initialized (command=ATGUISETPROP)

So what's going wrong?

Back to Top
pholmes View Drop Down
Groupie
Groupie


Joined: April 15 2004
Location: United States
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote pholmes Quote  Post ReplyReply Direct Link To This Post Posted: May 04 2006 at 5:13am
Sounds like your variable GUISTATUS may be incorrect. It must be the same variable that you called ATGUIINIT with.
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: May 04 2006 at 5:45am
Thanks - if you hadn't have said that I would have stared at the code for hours without seeing that I'd typed GUISTATUS when I should have typed GUISTATE.
Back to Top
pholmes View Drop Down
Groupie
Groupie


Joined: April 15 2004
Location: United States
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote pholmes Quote  Post ReplyReply Direct Link To This Post Posted: May 04 2006 at 6:12am
Been there, done that
Back to Top
homerlh View Drop Down
Beta Tester
Beta Tester


Joined: November 11 2004
Location: United States
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote homerlh Quote  Post ReplyReply Direct Link To This Post Posted: May 09 2006 at 3:00am
Greetings,

I've got a question about column widths in a grid or any of the other constructs that support multiple columns. I like to change the width of the column to pretty much reflect the widest item in the column. What I do is build the grid on a line by line basis, counting the bytes in each column. I do this for each line, comparing to the current maximum width and a previously established minimum size list.

When I have finished loading the grid, I load its values, then I load its column widths. The problem is that the column widths are always too long for long fields. Narrow fields seem to be very close, but I've got one field that thinks it is 53 characters wide. After the resize, it looks like the field would hold 15 to 20 additional characters.

Has anyone else noticed this activity and does anyone know whether anything can be done about it?

Thanks,

Larry Hazel
Back to Top
acmedia View Drop Down
Senior Member
Senior Member


Joined: April 26 2005
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote acmedia Quote  Post ReplyReply Direct Link To This Post Posted: May 09 2006 at 5:52am
I first assumed that when 'characters' was used as the unit of measurement it was based on the font AccuTerm uses for the green screen version, probably AccuTerm New, but it looks like it's not - no combination of font, size, weight, and even whether the control has a border or not gives a match.
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: May 12 2006 at 12:17pm
Hi All -

When you use a scale mode of "characters" in a GUI application, AccuTerm assumes a character is 12 points high and 6 points wide. You need to check the display resolution and DPI to convert points to pixels, and then adjust this for the font size you are actually using. Its never going to be exact - if you use a fixed-pitch font for your GUI control, it will be close, but with vaiable-pitch fonts it can be off by a large factor. Welcome to Windows!

Thanks,

Pete
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.