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
0005648 [JEDI VCL] 00 JVCL Components major always 2011-09-02 12:22 2012-06-11 17:08
Reporter Gvindelen View Status public  
Assigned To obones
Priority normal Resolution won't fix  
Status resolved   Product Version 3.40
Summary 0005648: JvPanel Transparent borders troubles
Description When I set
Tranparent=true
BorderWidth=10
Border is no transaparent
Additional Information procedure TJvCustomArrangePanel.Paint;
var
  X, Y: Integer;
  R: TRect;
  OldPenColor:TColor;
  OldPenWidth: Integer;
begin
  if Assigned(FOnPaint) then
  begin
    FOnPaint(Self);
    Exit;
  end;

  if MouseOver and HotTrack then
  begin
    Canvas.Font := Self.HotTrackFont;
    if HotTrackOptions.Enabled then
    begin
      Canvas.Brush.Color := HotTrackOptions.Color;
      if HotTrackOptions.FrameVisible then
      begin
        Canvas.Brush.Style := bsSolid;
        OldPenColor := Canvas.Pen.Color;
        Canvas.Pen.Color := HotTrackOptions.FrameColor;
        Canvas.Rectangle(0, 0, Width, Height);
        Canvas.Pen.Color := OldPenColor;
      end
      else
      begin
        R := ClientRect;
        InflateRect(R, -BevelWidth, -BevelWidth);
        Canvas.FillRect(R);
      end;
    end;
  end
  else
  begin
    Canvas.Font := Self.Font;
    Canvas.Brush.Color := Color;
// Replace 1: Start;
    if Transparent then
      Canvas.Brush.Style := bsClear
    else
    begin
// Replace 1: End
      DrawThemedBackground(Self, Canvas, ClientRect);
      if FFlatBorder then
      begin
        if BorderWidth > 0 then
        begin
          OldPenWidth:= Canvas.Pen.Width;
          OldPenColor := Canvas.Pen.Color;
          Canvas.Pen.Width := BorderWidth;
          Canvas.Pen.Color := FFlatBorderColor;
          Canvas.Brush.Style := bsClear;

          R := ClientRect;
          X := (BorderWidth div 2);
          if Odd(BorderWidth) then
            Y := X
          else
            Y := X -1;

          Inc(R.Left,X);
          Inc(R.Top,X);
          Dec(R.Bottom,Y);
          Dec(R.Right,Y);

          Canvas.Rectangle(R);

          Canvas.Pen.Width := OldPenWidth;
          Canvas.Pen.Color := OldPenColor;
       end;
      end
      else
        DrawBorders;
// Added2: Start
    end;
// Added2: End
  end;

  DrawCaption;
  if Sizeable then
  begin
    {$IFDEF JVCLThemesEnabled}
    if ThemeServices.ThemesEnabled then
      ThemeServices.DrawElement(Canvas.Handle, ThemeServices.GetElementDetails(tsGripper),
        Rect(ClientWidth - GetSystemMetrics(SM_CXVSCROLL) - BevelWidth - 2,
          ClientHeight - GetSystemMetrics(SM_CYHSCROLL) - BevelWidth - 2,
          ClientWidth - BevelWidth - 2, ClientHeight - BevelWidth - 2))
    else
    {$ENDIF JVCLThemesEnabled}
    begin
      Canvas.Font.Name := 'Marlett';
      Canvas.Font.Charset := DEFAULT_CHARSET;
      Canvas.Font.Size := 12;
      Canvas.Font.Style := [];
      Canvas.Brush.Style := bsClear;
      X := ClientWidth - GetSystemMetrics(SM_CXVSCROLL) - BevelWidth - 2;
      Y := ClientHeight - GetSystemMetrics(SM_CYHSCROLL) - BevelWidth - 2;
      // (rom) bsClear takes care of that already
      //if Transparent then
      // SetBkMode(Handle, BkModeTransparent);
      Canvas.Font.Color := clBtnHighlight;
      Canvas.TextOut(X, Y, 'o');
      Canvas.Font.Color := clBtnShadow;
      Canvas.TextOut(X, Y, 'p');
    end;
  end;
end;
Tags No tags attached.
Attached Files ? file icon JvPanel.pas [^] (44,748 bytes) 2011-09-02 12:22
zip file icon Projects.zip [^] (371,705 bytes) 2011-09-22 23:16

- Relationships

-  Notes
(0018948)
obones (administrator)
2011-09-21 12:00

Please provide the zipped sources of a sample application showing this
(0019525)
obones (administrator)
2012-02-24 11:18

Hello,

I don't understand why you want the border to be transparent as well. I mean, if you don't want the border, give it zero width.

- Issue History
Date Modified Username Field Change
2011-09-02 12:22 Gvindelen New Issue
2011-09-02 12:22 Gvindelen File Added: JvPanel.pas
2011-09-21 12:00 obones Note Added: 0018948
2011-09-21 12:00 obones Status new => feedback
2011-09-22 23:16 Gvindelen File Added: Projects.zip
2011-10-07 16:11 obones Status feedback => acknowledged
2012-02-24 11:18 obones Note Added: 0019525
2012-02-24 11:18 obones Status acknowledged => feedback
2012-06-11 17:08 obones Status feedback => resolved
2012-06-11 17:08 obones Resolution open => won't fix
2012-06-11 17:08 obones Assigned To => obones


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