View Issue Details

IDProjectCategoryView StatusLast Update
0002723JEDI VCL00 JVCL Componentspublic2006-04-07 07:37
ReportermarcgeldonAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10 
Target VersionFixed in Version3.30 
Summary0002723: TJvDBLookupTreeViewCombo does not paint correctly
DescriptionHello!

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;
TagsNo tags attached.

Activities

2005-03-07 07:13

 

JvDBLookupTreeView.pas (47,920 bytes)

marcgeldon

2006-03-21 06:47

reporter   ~0008710

Can someone merge this with the current version of TJvDBLookupTreeViewCombo.Paint and add it to CVS?

obones

2006-04-07 07:37

administrator   ~0009033

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
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