dcl_Grid_SetColumnImage

Started by johnM, August 03, 2011, 01:23:54 PM

Previous topic - Next topic

johnM

(dcl_Grid_GetColumnImage QD_ELE1_ELE1_Grid1 1) returns 0 (there is no image at column header)
(dcl_Grid_SetColumnImage QD_ELE1_ELE1_Grid1 1 0) returns dcl error "no image at specific index"
i have 4 images set up. dcl gave them numbers 100 101 102 103
i use 3 images for buttons with no issue
i am trying to use an image when the uset clicks a button
no mater what number i use for (dcl_Grid_SetColumnImage QD_ELE1_ELE1_Grid1 1 0 or 100 or 102 ect...)
i get the error.

using studio 6.0.2.5


Fred Tomke

He, he, in that case the internal image list of the grid will be used, not the project's image list. Double click the grid in the z/tab panel to add the needed images there. Grid, tree, and listview have an internal image list.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

johnM

thanks for that quick responce
i just figured it out and was going to post
i was clicking on everything but the properties of the grid

johnM

i spoke too soon
how would i set it to none
i have only 1 image the image index is 0
if i use -1 or 1 i get the error

Fred Tomke

Hi, John, I had no try, but have a test with (dcl_Control_SetColumnImageList <CONTROL> -1).

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

johnM

no luck it expects 2 arguments 1=column# 2=image index
-1 for index results in an error
the help file and properties says that the function should return Boolean (T if successful; otherwise NIL)
that leads me to believe that there is a bug or a fix needed to add the -1 option.

work around:
i made a blank transparent image and then had it load on initalize
then i have the other image as index 1 so i can toggle between the two
it works, but i prefer not to have the column header text shifted to the right unless the image is applied

other note: i also found out that all the images must be the same size or else they will all take on index 0 size
i made a 5x5 blank so the text would not shift that much but the index 1 image was 22x22 and when i set the image on the grid column to image 1 only a little part showed.

Fred Tomke

Quote from: johnM on August 03, 2011, 03:13:15 PM
other note: i also found out that all the images must be the same size or else they will all take on index 0 size

That's right. That's by design.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Quote from: johnM on August 03, 2011, 02:37:57 PM
how would i set it to none
i have only 1 image the image index is 0
if i use -1 or 1 i get the error

That might be a bug. There is a quirk with the grid control such that resetting the image to -1 will remove the image but not the space it occupied, so it's possible that the code intentionally prevents removing an image once it is set. For that reason, I'm not entirely certain that the behavior is a bug. It should at least be documented in any case.
Owen Wengerd (Outside The Box) / ManuSoft