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;
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.
Raize Splitpannel?
ReplyDeleteVery nice component. Compatibility with older versions of Delphi may be great, I guess. Thanks for sharing!
ReplyDeleteThank you Paul.
ReplyDeleteA. Bouchez except the doted unit names and TRect helper I think it can compile with very old Delphi version :)
ReplyDeletegoing to try it with Delphi 2007 and tell you what happens
ReplyDeleteThis looks very useful. I'll have a go with it in XE6. Thanks.
ReplyDeleteHi Paul,
ReplyDeleteexcellent 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;
Stefan Grube Updated, thanks ;)
ReplyDeleteThe 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