Commit cb477dcd authored by Martin Schreiber's avatar Martin Schreiber

* Use t*menu.checkboxframetemplate.frameo_* in order to adjust outer padding of frame.

parent 3dbdefe8
......@@ -1074,6 +1074,7 @@ type
function innerframedim: sizety;
procedure createfont;
property framei: framety read fi.ba.innerframe;
property frameo: framety read fi.ba.outerframe;
property clientsizeextend: sizety read fclientsizeextend
write fclientsizeextend;
published
......
{ MSEgui Copyright (c) 1999-2016 by Martin Schreiber
{ MSEgui Copyright (c) 1999-2018 by Martin Schreiber
See the file COPYING.MSE, included in this distribution,
for details about the copyright.
......
......@@ -1500,18 +1500,22 @@ var
co1: colorty;
framestates: framestateflagsty;
size1: sizety;
widthextend: int32;
begin
framestates:= [];
result:= [shs_checkbox,shs_radiobutton] * info.state <> [];
if result then begin
rect1:= arect;
rect1.cx:= menucheckboxwidth;
int1:= menucheckboxheight;
widthextend:= menucheckboxwidth;
if info.checkboxframe <> nil then begin
size1:= info.checkboxframe.innerframedim;
rect1.cx:= rect1.cx + size1.cx;
int1:= int1 + size1.cy;
with info.checkboxframe do begin
size1:= innerframedim;
widthextend:= widthextend + frameo_left + frameo_right + size1.cx;
int1:= int1 + size1.cy + frameo_top + frameo_bottom;
end;
end;
rect1.cx:= widthextend;
if int1 < arect.cy then begin
rect1.cy:= int1;
rect1.y:= rect1.y + (arect.cy - int1) div 2;
......@@ -1521,6 +1525,7 @@ begin
end;
if info.checkboxframe <> nil then begin
framestates:= combineframestateflags(info.state);
deflaterect1(rect1,info.checkboxframe.frameo);
info.checkboxframe.paintbackgroundframe(canvas,rect1,framestates);
rect2:= deflaterect(rect1,info.checkboxframe.innerframe);
end
......@@ -1532,9 +1537,9 @@ begin
draw3dframe(canvas,rect2,-1,defaultframecolors.edges,[]);
end;
if pos = ip_left then begin
inc(arect.x,menucheckboxwidth);
inc(arect.x,widthextend);
end;
dec(arect.cx,menucheckboxwidth);
dec(arect.cx,widthextend);
if shs_checked in info.state then begin
if shs_disabled in info.state then begin
align1:= [al_xcentered,al_ycentered,al_grayed];
......
{ MSEgui Copyright (c) 1999-2017 by Martin Schreiber
{ MSEgui Copyright (c) 1999-2018 by Martin Schreiber
See the file COPYING.MSE, included in this distribution,
for details about the copyright.
......@@ -407,7 +407,11 @@ begin
checkboxwidth:= menucheckboxwidth;
checkboxheight:= menucheckboxheight;
if checkboxframetemplate <> nil then begin
size1:= checkboxframetemplate.innerframedim();
with checkboxframetemplate do begin
size1:= innerframedim();
size1.cx:= size1.cx + frameo_left + frameo_right;
size1.cy:= size1.cy + frameo_top + frameo_bottom;
end;
checkboxwidth:= checkboxwidth + size1.cx;
checkboxheight:= checkboxheight + size1.cy;
end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment