Skip to main content
I've been trying to write an ATGUI program using the data grid.  I want to change the row colors on some of the rows but not all. I was able to do it using the ATGUISETPROPS subroutine but it's pretty slow.  My grid displays that data quickly enough by filling it in with the ATGUISETPROPS and loading them all at once. There are only about 30 rows.  After they're displayed I make a second pass highlighting the special rows. It pops up the "Waiting..." dialog and you can watch the colors flow down.

Is there anyway to set multiple row colors all at once like ATGUISETPROPS?

When I refresh the grid with new data the highlights stay there. I tried setting all the foreground and background colors for the entire grid by using ATGUISETPROP and setting the col and row values to zero. I couldn't get it to work so instead of just setting the highlight colors I have to reset them all for each row whenever I load new data. Is there a better way to re-initialize the grid colors?

Finally, is there any way to disable the checkbox on specific rows?


------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
I've been trying to write an ATGUI program using the data grid.  I want to change the row colors on some of the rows but not all. I was able to do it using the ATGUISETPROPS subroutine but it's pretty slow.  My grid displays that data quickly enough by filling it in with the ATGUISETPROPS and loading them all at once. There are only about 30 rows.  After they're displayed I make a second pass highlighting the special rows. It pops up the "Waiting..." dialog and you can watch the colors flow down.

Is there anyway to set multiple row colors all at once like ATGUISETPROPS?

When I refresh the grid with new data the highlights stay there. I tried setting all the foreground and background colors for the entire grid by using ATGUISETPROP and setting the col and row values to zero. I couldn't get it to work so instead of just setting the highlight colors I have to reset them all for each row whenever I load new data. Is there a better way to re-initialize the grid colors?

Finally, is there any way to disable the checkbox on specific rows?


------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
Hi Joe,

Can you set multiple row colours at once?  No.

However, you can speed the process up enormously by using macros. In the normal state, every call to an ATGUI subroutine results in a round trip between the client and the server. That makes updating a lot of properties really slow. So, a macro "records" all the property changes, and when you "run" the macro, it sends all those changes to the client in one hit.

To start recording a macro:

CALL ATGUIBEGINMACRO("", GUIERRORS, GUISTATE)

Now do all your property setting.

To run the macro:

CALL ATGUIENDMACRO(MACRO, GUIERRORS, GUISTATE)
IF (MACRO NE "") THEN
    CALL ATGUIRUNMACRO(MACRO, "", GUIERRORS, GUISTATE)
END

Of course, you should also be checking for errors after each CALL.

Check out the section in the help titled: GUI Macro Functions

Your second question is equally awkward. You can't change the state of individual cells in the grid. But you can make whole columns read-only. So, presumably, you have some rules for when you want a checkbox to be enabled/disabled. You will need to use the ACTIVATEROW event to set the initial column read-only state when you enter a row, and then update that state as other things change. It is awkward but it works!

Cheers,

Brian

------------------------------
Brian Speirs
Senior Analyst - Information Systems
Self Registered
Wellington NZ
------------------------------
I've been trying to write an ATGUI program using the data grid.  I want to change the row colors on some of the rows but not all. I was able to do it using the ATGUISETPROPS subroutine but it's pretty slow.  My grid displays that data quickly enough by filling it in with the ATGUISETPROPS and loading them all at once. There are only about 30 rows.  After they're displayed I make a second pass highlighting the special rows. It pops up the "Waiting..." dialog and you can watch the colors flow down.

Is there anyway to set multiple row colors all at once like ATGUISETPROPS?

When I refresh the grid with new data the highlights stay there. I tried setting all the foreground and background colors for the entire grid by using ATGUISETPROP and setting the col and row values to zero. I couldn't get it to work so instead of just setting the highlight colors I have to reset them all for each row whenever I load new data. Is there a better way to re-initialize the grid colors?

Finally, is there any way to disable the checkbox on specific rows?


------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
One point I missed - resetting the grid colours. Just set the GPFORECOLOR and GPBACKCOLOR for the entire grid (i.e. use ATGUISETPROPS or set COL and ROW to zero in ATGUISETPROP.

Cheers,

Brian

------------------------------
Brian Speirs
Senior Analyst - Information Systems
Self Registered
Wellington NZ
------------------------------
Hi Joe,

Can you set multiple row colours at once?  No.

However, you can speed the process up enormously by using macros. In the normal state, every call to an ATGUI subroutine results in a round trip between the client and the server. That makes updating a lot of properties really slow. So, a macro "records" all the property changes, and when you "run" the macro, it sends all those changes to the client in one hit.

To start recording a macro:

CALL ATGUIBEGINMACRO("", GUIERRORS, GUISTATE)

Now do all your property setting.

To run the macro:

CALL ATGUIENDMACRO(MACRO, GUIERRORS, GUISTATE)
IF (MACRO NE "") THEN
    CALL ATGUIRUNMACRO(MACRO, "", GUIERRORS, GUISTATE)
END

Of course, you should also be checking for errors after each CALL.

Check out the section in the help titled: GUI Macro Functions

Your second question is equally awkward. You can't change the state of individual cells in the grid. But you can make whole columns read-only. So, presumably, you have some rules for when you want a checkbox to be enabled/disabled. You will need to use the ACTIVATEROW event to set the initial column read-only state when you enter a row, and then update that state as other things change. It is awkward but it works!

Cheers,

Brian

------------------------------
Brian Speirs
Senior Analyst - Information Systems
Self Registered
Wellington NZ
------------------------------

Thanks Brian!

The macro did the trick. Now the screen refreshes like normal.  That fixes the main issue.  The others would have been nice but aren't really needed for my app.

I wasn't able to set the foreground and background colors for the entire grid by setting col and row to zero. It just didn't seem to do anything. It's possible there's a bug. I have an older version of the ATGUI programs from AccuTerm 7.1. Upgrading isn't an option here because we're retiring our MVDB system by the end of the year.

Using the macro sped everything up just fine so I don't mind setting the row colors individually.

Thanks again for the help!



------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------

Thanks Brian!

The macro did the trick. Now the screen refreshes like normal.  That fixes the main issue.  The others would have been nice but aren't really needed for my app.

I wasn't able to set the foreground and background colors for the entire grid by setting col and row to zero. It just didn't seem to do anything. It's possible there's a bug. I have an older version of the ATGUI programs from AccuTerm 7.1. Upgrading isn't an option here because we're retiring our MVDB system by the end of the year.

Using the macro sped everything up just fine so I don't mind setting the row colors individually.

Thanks again for the help!



------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
------------------------------
OK. I know I have struck the issue of colours remaining on the screen before. Try setting the GPVALUE of the grid to an empty string when you clear the dataset, then rebuild the grid for your next dataset.

[Note one issue I often bump into is setting properties for a grid BEFORE I have put the data into it. That causes the GUI to crash, because by definition, you cannot set a property on a row that doesn't (yet) exist. The answer to that one is to explicitly set GPROWS to the final value before setting the properties (like colours), and then everything displays nicely when the data is pushed into the grid].

Cheers,

Brian

------------------------------
Brian Speirs
Senior Analyst - Information Systems
Self Registered
Wellington NZ
------------------------------