Delphi 6 TListView and SubItemImages Not Transparent - delphi

I have a ListView where each row is displaying an alternate row color (e.g., white row, then light green row, then white row).
An imagelist has been assigned to the listview so that it display images down the left hand side.
The problem I have is when I use the imagelist and set the subitemimage to display an item in one of the other columns the image does not appear transparent.
How can I make these subitem images transparent?

Related

How to draw a border on a FireMonkey TListView object

If you drop a FMX.TStringGrid onto a new FireMonkey form, the grid gets shown with a thin border.
If you drop a FMX.TTListView onto the form, there is no border.
Neither component seems to have a property for enabling/disabling the border, or setting the border colour or width.
I assume this is due to the cross-platform requirement, so how should it be done? Do I need to add a panel, then put the listview inside the panel? Or is it something to do with the style, as in needing a TStyleBook?
Yes, the TListView has no border. Firemonkey offers several ways to add a border to any visual control. For adding a simple border I would not try to change the styles.
In my opinion, the simplest solution is to put a rectangle from the palette (from Shapes) into the form.
Set in the rectangle the Stroke to the desired color and thickness.
As the next step, go to the structure-view in the designer and move the Listview as a child element into this rectangle. Change the Align property of the listview to Client.
To display the border-lines again, you must set all the values ​​for Padding (bottom, left, right and top) of the rectangle to the value thickness of the rectangle stroke.
If you like you can also add a TShadowEffect on your rectangle or listview control.

highcharts stacked column draw horizontal line

I need to draw horizontal line on highcharts stacked column as image below
In image Bold black line is showing, I need to draw same, however Bar color opacity changes when it split columns.

Prevent delphi from redrawing columns

I have a string grid where user can change colors of columns. I'm storing a color in a string it looks likethis : columnToColor:= '1;233,233,233' 1 is the column 233;233;233 is a rgb color; I change this string everytime i have to change colors. It never contains more than one column and one color
In my drawcellevent i'm doing this:
color := Explode(';',columnToColor); //this will return an array
if (length(color)-1 >= 0) then
begin
if TryStrToInt(color[0], val) then
begin
if aCol = StrToInt(color[0]) then
begin
cellText := grid.Cells[aCol,aRow];
grid.Canvas.Brush.Color := TColor(RGB(StrToInt(color[1]),StrToInt(color[2]),StrToInt(color[3])));
rec := grid.CellRect(aCol,aRow);
grid.Canvas.FillRect(rec);
grid.Canvas.TextOut(rec.Left,rec.top,cellText);
end;
end;
end;
I'm calling invalidateCol from another procedure using a hacked StringGrid class:
With TCustomStringGrid(grid) do
InvalidateCol(grid.col)
This works when i change only one column color. I can scroll freely trought the grid and it will still be there with the good column color. But when i change the color of another column the colors are shown when their are still visibile. Once i scroll horizontally and get back to the columns only the last colored column is colored and other are set to default color. The color only stays on the last colored column. So if i color 2 columns and i click on the first one, the cell's color is set to default. And i scroll horizontally the whole column 1 is set to default color. Only the second column keep its color what ever i do.
How can i fix this pls?
This is perhaps becoming a little more clear to me. The problem is that you want the grid control to paint each column in separate colors. Although your columnToColor string specifies the color for only a single column, you want each column to have, potentially, a different color. When you scroll the grid, and columns are re-painted, only the column specified in columnToColor has the desired color.
All this is happening because Windows controls need to be able to re-paint themselves completely at any time. Once you have painted a control, the control does not remember its state. If it becomes invalid (control dragged over, scrolled, etc.) then the control must be able to re-paint itself in its entirety.
Your code fails to do that. Since it only remembers the color for the most recently modified column, when it needs to paint other columns, they get the default color. Your approach cannot succeed since the control only keeps track of one single column color.
The solution is simple enough. You need to remember the color for each column. An obvious way to do so would be to hold the colors in an array:
FColumnColor: array of TColor;
or
FColumnColor: TArray<TColor>;
in a more modern Delphi. Or perhaps even TList<TColor>.
When you need to change a column's color do so by modifying FColumnColor[ColIndex]. Likewise, whenever you need to paint, read the color out of FColumnColor[ColIndex].

Remove black border from TcolorButton

Is there anyway to remove the black border from a TColorbutton ? Delphi xe5, developing for iOSdelp
There are actually three black or gray borders.
First, add a custom stylebook to your app. The docwiki tells how to do this:
http://docwiki.embarcadero.com/RADStudio/XE5/en/Customizing_the_Design_of_a_FireMonkey_Application
Follow step #2 (Step 3 doesn't work for mobile applications.)
Open the style editor and locate ColorButtonStyle.
Expand the tree node and click on "background" in the structure.
In the object inspector locate Fill and expand that node.
Change the fill Kind to bkNone.
That removes the wide gray bordered, leaving two dark gray 1px borders.
Further down the list of properties just below Sides is Stroke.
Change it's Kind to bkNone. That removes the outer gray line.
Depending on your app you may need to also edit the color animations below the background rectangle. I did this by erasing (blanking out) the triggers since I was unable to delete the animations.
Next go the Fill component and set the stroke kind to bkNone. That removes the inner gray line.
You may also also want to set the Fill Margins to 0 so the color extends to the outside of the object. (i.e no padding now that the gray is not there.)
Gary

How to change the text color of TStringGrid in Firemonkey Delphi XE5

I want to be able to change text color for certain rows. For example if cell value below 0 i want in red, other than that green.

Resources