Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002723 [JEDI VCL] 00 JVCL Components minor always 2005-03-07 07:13 2006-04-07 07:37
Reporter marcgeldon View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 2.10
Summary 0002723: TJvDBLookupTreeViewCombo does not paint correctly
Description Hello!

Just let me explain how I find the "error". We "highlight" the focused component with a special color in our apps. For example: on the "OnEnter" event we set the highlight color, on the "OnExit" event we set the normal color.

After we set the color back to normal color, there was a 1 pixel border in the component with the old highlight color.

For this, I wrote a bug fix. You have to "fill" the component with the new color.

Best wishes from Germany,

Marc Geldon
(PRO IT SYSTEMS -> www.proitsystems.de)
Additional Information +++ NEW PAINT PROCEDURE +++

procedure TJvDBLookupTreeViewCombo.Paint;
var
  W, X, Flags: Integer;
  Text: string;
  Alignment: TAlignment;
  Selected: Boolean;
  R: TRect;
begin
  Canvas.Font := Font;
  Canvas.Brush.Color := Color;
  Selected := FFocused and not FListVisible and
    not (csPaintCopy in ControlState);
  if Selected then
  begin
    Canvas.Font.Color := clHighlightText;
    Canvas.Brush.Color := clHighlight;
  end;
  if (csPaintCopy in ControlState) and (FDataField <> nil) then
  begin
    Text := FDataField.DisplayText;
    Alignment := FDataField.Alignment;
  end
  else
  begin
    Text := FText;
    Alignment := FAlignment;
  end;
  W := ClientWidth - FButtonWidth;
  X := 2;
  case Alignment of
    taRightJustify: X := W - Canvas.TextWidth(Text) - 3;
    taCenter: X := (W - Canvas.TextWidth(Text)) div 2;
  end;

  // fill the component with the new color!
  SetRect(R, 0, 0, W, ClientHeight);
  Canvas.FillRect(R);

  SetRect(R, 1, 1, W - 1, ClientHeight - 1);
  Canvas.TextRect(R, X, 2, Text);
  if Selected then
    Canvas.DrawFocusRect(R);
  SetRect(R, W, 0, ClientWidth, ClientHeight);
  if not FListActive then
    Flags := DFCS_SCROLLCOMBOBOX or DFCS_INACTIVE
  else
    if FPressed then
    Flags := DFCS_SCROLLCOMBOBOX or DFCS_FLAT or DFCS_PUSHED
  else
    Flags := DFCS_SCROLLCOMBOBOX;
  DrawFrameControl(Canvas.Handle, R, DFC_SCROLL, Flags);
end;
Tags No tags attached.
Attached Files ? file icon JvDBLookupTreeView.pas [^] (47,920 bytes) 2005-03-07 07:13

- Relationships

-  Notes
(0008710)
marcgeldon (reporter)
2006-03-21 06:47

Can someone merge this with the current version of TJvDBLookupTreeViewCombo.Paint and add it to CVS?
(0009033)
obones (administrator)
2006-04-07 07:37

This is now in CVS. Sorry for the delay, but as you have seen, there is a huge backlog of issues, and not many time for us to look at them.

- Issue History
Date Modified Username Field Change
2005-03-07 07:13 marcgeldon New Issue
2005-03-07 07:13 marcgeldon File Added: JvDBLookupTreeView.pas
2005-12-12 15:27 marcgeldon Note Added: 0008208
2006-03-21 06:45 marcgeldon Note Added: 0008709
2006-03-21 06:46 marcgeldon Note Deleted: 0008709
2006-03-21 06:47 marcgeldon Note Deleted: 0008208
2006-03-21 06:47 marcgeldon Note Added: 0008710
2006-04-07 07:37 obones Status new => resolved
2006-04-07 07:37 obones Resolution open => fixed
2006-04-07 07:37 obones Assigned To => obones
2006-04-07 07:37 obones Note Added: 0009033


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker