View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006510 | JEDI VCL | 00 JVCL Components | public | 2016-04-28 17:02 | 2016-08-04 20:55 |
| Reporter | CDametto | Assigned To | AHUser | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.48 | ||||
| Target Version | Fixed in Version | Daily / GIT | |||
| Summary | 0006510: The selected item appearance in lookup list of TJvDBLookupCombo is not themed | ||||
| Description | See attached screenshot obtained by setting the theme Amethyst Kamry in Project->Options->Application->Appearance->Default style | ||||
| Additional Information | I solved adding few lines in procedure TJvDBLookupList.Paint of file JvDBLookup.pas See attachments | ||||
| Tags | No tags attached. | ||||
|
2016-04-28 17:02
|
|
|
2016-04-28 17:03
|
Patch.txt (5,141 bytes)
procedure TJvDBLookupList.Paint;
var
I, J, TextHeight, TextMargin: Integer;
Image: TGraphic;
Bmp: TBitmap;
R, ImageRect: TRect;
Selected: Boolean;
begin
Bmp := TBitmap.Create;
try
Canvas.Font := Font;
TextHeight := GetTextHeight;
if ColorToRGB(Color) <> ColorToRGB(clBtnFace) then
Canvas.Pen.Color := clBtnFace
else
Canvas.Pen.Color := clBtnShadow;
for I := 0 to FRowCount - 1 do
begin
J := I - Ord(EmptyRowVisible);
Canvas.Font.Color := Font.Color;
Canvas.Brush.Color := Color;
Selected := not FKeySelected and (I = 0) and not EmptyRowVisible;
R.Top := I * TextHeight;
R.Bottom := R.Top + TextHeight;
if I < FRecordCount + Ord(EmptyRowVisible) then
begin
if (I = 0) and (J = -1) then
begin
if ValueIsEmpty(FValue) then
{$IFDEF JVCLStylesEnabled} //ADDED
if StyleServices.Enabled and TStyleManager.IsCustomStyleActive then //ADDED
begin //ADDED
Canvas.Font.Color := StyleServices.GetSystemColor(clHighlightText); //ADDED
Canvas.Brush.Color := StyleServices.GetSystemColor(clHighlight); //ADDED
Selected := True; //ADDED
end //ADDED
else //ADDED
{$ENDIF JVCLStylesEnabled} //ADDED
begin
Canvas.Font.Color := clHighlightText;
Canvas.Brush.Color := clHighlight;
Selected := True;
end
else
Canvas.Brush.Color := EmptyItemColor;
R.Left := 0;
R.Right := ClientWidth;
Image := GetPicture(False, True, TextMargin);
if TextMargin > 0 then
begin
Bmp.Canvas.Font := Canvas.Font;
Bmp.Canvas.Brush := Canvas.Brush;
Bmp.Canvas.Pen := Canvas.Pen;
Bmp.Width := RectWidth(R);
Bmp.Height := RectHeight(R);
ImageRect := Bounds(0, 0, TextMargin, RectHeight(R));
Bmp.Canvas.FillRect(ImageRect);
if Image <> nil then
DrawPicture(Bmp.Canvas, ImageRect, Image);
DrawItemText(Bmp.Canvas, Bounds(TextMargin, 0, RectWidth(R) - TextMargin,
RectHeight(R)), Selected, True);
Canvas.Draw(R.Left, R.Top, Bmp);
end
else
DrawItemText(Canvas, R, Selected, True);
end
else
begin
FLookupLink.ActiveRecord := J;
if not ValueIsEmpty(FValue) and (FKeyField.AsString = FValue) then
{$IFDEF JVCLStylesEnabled} //ADDED
if StyleServices.Enabled and TStyleManager.IsCustomStyleActive then //ADDED
begin //ADDED
Canvas.Font.Color := StyleServices.GetSystemColor(clHighlightText); //ADDED
Canvas.Brush.Color := StyleServices.GetSystemColor(clHighlight); //ADDED
Selected := True; //ADDED
end //ADDED
else //ADDED
{$ENDIF JVCLStylesEnabled} //ADDED
begin
Canvas.Font.Color := clHighlightText;
Canvas.Brush.Color := clHighlight;
Selected := True;
end;
R.Left := 0;
R.Right := ClientWidth;
Image := GetPicture(False, False, TextMargin);
if TextMargin > 0 then
begin
Bmp.Canvas.Font := Canvas.Font;
Bmp.Canvas.Brush := Canvas.Brush;
Bmp.Canvas.Pen := Canvas.Pen;
Bmp.Width := RectWidth(R);
Bmp.Height := RectHeight(R);
ImageRect := Bounds(0, 0, TextMargin, RectHeight(R));
Bmp.Canvas.FillRect(ImageRect);
if Image <> nil then
DrawPicture(Bmp.Canvas, ImageRect, Image);
DrawItemText(Bmp.Canvas, Bounds(TextMargin, 0, RectWidth(R) - TextMargin,
RectHeight(R)), Selected, False);
Canvas.Draw(R.Left, R.Top, Bmp);
end
else
DrawItemText(Canvas, R, Selected, False);
end;
end;
R.Left := 0;
R.Right := ClientWidth;
if J >= FRecordCount then
Canvas.FillRect(R);
if Selected and (FFocused or FPopup) then
Canvas.DrawFocusRect(R);
end;
finally
Bmp.Free;
end;
if FRecordCount <> 0 then
FLookupLink.ActiveRecord := FRecordIndex;
end; |
|
|
Added to master branch. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2016-04-28 17:02 | CDametto | New Issue | |
| 2016-04-28 17:02 | CDametto | File Added: CorrectAspect.jpg | |
| 2016-04-28 17:03 | CDametto | File Added: Patch.txt | |
| 2016-08-04 20:55 | AHUser | Note Added: 0021330 | |
| 2016-08-04 20:55 | AHUser | Status | new => resolved |
| 2016-08-04 20:55 | AHUser | Fixed in Version | => Daily / GIT |
| 2016-08-04 20:55 | AHUser | Resolution | open => fixed |
| 2016-08-04 20:55 | AHUser | Assigned To | => AHUser |