A splitter inside a Panel, good idea isn't it ?


A splitter inside a Panel, good idea isn't it ?

http://lookinside.free.fr/delphi.php?TSplitPanel+pour+Seattle

Comments

  1. Very nice component. Compatibility with older versions of Delphi may be great, I guess. Thanks for sharing!

    ReplyDelete
  2. A. Bouchez except the doted unit names and TRect helper I think it can compile with very old Delphi version :)

    ReplyDelete
  3. going to try it with Delphi 2007 and tell you what happens

    ReplyDelete
  4. This looks very useful.  I'll have a go with it in XE6.  Thanks.

    ReplyDelete
  5. Hi Paul,
    excellent component!
    Currently the splitter is not drawn with the theme colors. I felt free to enhance your code with calls to GetSystemColor() to respect that as well:

    procedure TSplitPanel.Paint;
    var
      R: TRect;
    begin
      inherited;
      if (FSplitter > 0) and (Align in [alTop, alLeft, alRight, alBottom]) then
      begin
        R := ButtonRect(True);
        Canvas.Brush.Color := StyleServices.GetSystemColor(Self.Color);
        Canvas.FillRect(R);
        R := ButtonRect(False);
        Frame3D(Canvas, R, StyleServices.GetSystemColor(clBtnHighlight), StyleServices.GetSystemColor(clBtnShadow), 1);
      end;
    end;

    ReplyDelete
  6. The lack of properties and methods in TRect record from Delphi 2007, made it a bit complicated to implement, but I manage to have a semi working component. When done, I'll post again.

    ReplyDelete

Post a Comment