View Issue Details

IDProjectCategoryView StatusLast Update
0005648JEDI VCL00 JVCL Componentspublic2012-06-11 17:08
ReporterGvindelenAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version3.40 
Target VersionFixed in Version 
Summary0005648: JvPanel Transparent borders troubles
DescriptionWhen I set
Tranparent=true
BorderWidth=10
Border is no transaparent
Additional Informationprocedure 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;
TagsNo tags attached.

Activities

2011-09-02 12:22

 

JvPanel.pas (44,748 bytes)

obones

2011-09-21 12:00

administrator   ~0018948

Please provide the zipped sources of a sample application showing this

2011-09-22 23:16

 

Projects.zip (371,705 bytes)

obones

2012-02-24 11:18

administrator   ~0019525

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