Commit be14fc69 authored by Martin Schreiber's avatar Martin Schreiber

+ twidget.widgettopaintsize().

* twidget.getautopaintsize() calls checkwidgetsize().
* tcustombutton.getautopaintsize() calls inherited.
parent e3cca74e
......@@ -20,6 +20,7 @@ object stringenterfo: tstringenterfo
70
)
options = [fo_screencentered, fo_closeonesc, fo_localshortcuts, fo_autoreadstat, fo_autowritestat]
windowopacity = -Inf
onlayout = layoutexe
moduleclassname = 'tmseform'
object lab: tlabel
......@@ -29,24 +30,22 @@ object stringenterfo: tstringenterfo
bounds_x = 7
bounds_y = 12
bounds_cx = 384
bounds_cy = 14
bounds_cy = 16
anchors = [an_left, an_top, an_right]
caption = 'lab'
textflags = [tf_ycentered, tf_wordbreak]
end
object tlayouter1: tlayouter
optionswidget = [ow_tabfocus, ow_parenttabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_subfocus, ow_destroywidgets]
bounds_x = 8
bounds_y = 34
bounds_y = 36
bounds_cx = 383
bounds_cy = 20
bounds_cy = 22
anchors = [an_left, an_top, an_right]
optionsscale = [osc_expandy, osc_shrinky, osc_expandshrinkx, osc_expandshrinky]
optionslayout = [lao_placex, lao_aligny]
align_glue = wam_start
place_mindist = 8
place_maxdist = 8
place_mode = wam_end
place_options = [plo_endmargin]
linktop = lab
dist_top = 8
......@@ -54,29 +53,29 @@ object stringenterfo: tstringenterfo
optionswidget1 = [ow1_fontglyphheight, ow1_autoscale, ow1_autowidth, ow1_autosizeanright]
optionswidget = [ow_tabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_destroywidgets]
taborder = 2
bounds_x = 331
bounds_x = 333
bounds_y = 0
bounds_cx = 52
bounds_cy = 20
bounds_cx = 50
bounds_cy = 22
bounds_cxmin = 50
state = [as_localcaption]
caption = '&Cancel'
modalresult = mr_cancel
reffontheight = 14
reffontheight = 16
end
object ok: tbutton
optionswidget1 = [ow1_fontglyphheight, ow1_autoscale, ow1_autowidth]
optionswidget = [ow_tabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_destroywidgets]
taborder = 1
bounds_x = 273
bounds_x = 275
bounds_y = 0
bounds_cx = 50
bounds_cy = 20
bounds_cy = 22
bounds_cxmin = 50
state = [as_default, as_localdefault, as_localcaption]
caption = '&OK'
modalresult = mr_ok
reffontheight = 14
reffontheight = 16
end
object value: tstringedit
optionswidget = [ow_mousefocus, ow_tabfocus, ow_arrowfocus, ow_arrowfocusin, ow_arrowfocusout, ow_destroywidgets]
......@@ -84,11 +83,12 @@ object stringenterfo: tstringenterfo
frame.localprops1 = []
bounds_x = 0
bounds_y = 0
bounds_cx = 265
bounds_cx = 267
bounds_cy = 22
anchors = [an_left, an_top, an_right]
optionsedit1 = [oe1_autopopupmenu, oe1_keyexecute, oe1_savevalue, oe1_savestate]
optionsedit = [oe_undoonesc, oe_closequery, oe_checkmrcancel, oe_shiftreturn, oe_resetselectonexit, oe_exitoncursor, oe_endonenter, oe_autoselect, oe_autoselectonfirstclick]
reffontheight = 14
reffontheight = 16
end
end
end
This diff is collapsed.
......@@ -2384,6 +2384,7 @@ type
procedure innertopaintsize(var asize: sizety);
procedure outertopaintsize(var asize: sizety);
procedure painttowidgetsize(var asize: sizety);
procedure widgettopaintsize(var asize: sizety);
property frame: tcustomframe read getframe write setframe;
property face: tcustomface read getface write setface;
......@@ -8716,7 +8717,7 @@ begin
bounds_cx:= int1;
end;
end;
procedure twidget.placexorder(const startx: integer; const dist: array of integer;
const awidgets: array of twidget; const endmargin: integer = minint);
//origin = clientpos, endmargin by size adjust of widgets
......@@ -8728,6 +8729,9 @@ var
ar1: integerarty;
bo1: boolean;
begin
{$ifdef mse_debuglayout}
debugwriteln('**placexorder '+inttostr(bounds_cx)+' '+name);
{$endif}
if (high(awidgets) >= 0) then begin
widget1:= awidgets[0].fparentwidget;
if widget1 <> nil then begin
......@@ -8747,6 +8751,12 @@ begin
end;
end;
int2:= int2 + int5 + awidgets[int1].fwidgetrect.cx;
{$ifdef mse_debuglayout}
debugwriteln(' '+inttostr(ar1[int1])+' '+
inttostr(awidgets[int1].bounds_cx)+' '+
inttostr(ar1[int1]+awidgets[int1].bounds_cx)+' '+
awidgets[int1].name);
{$endif}
end;
if endmargin <> minint then begin
int2:= ar1[high(awidgets)] + awidgets[high(awidgets)].fwidgetrect.cx +
......@@ -8757,10 +8767,17 @@ begin
end;
int4:= 0;
size1.cy:= 0;
{$ifdef mse_debuglayout}
debugwriteln(' marginsaldo '+inttostr(int2));
{$endif}
for int1:= 0 to high(awidgets) do begin
with awidgets[int1] do begin
bo1:= ws1_layoutplacing in fwidgetstate1;
try
{$ifdef mse_debuglayout}
debugwriteln(' a '+inttostr(bounds_x)+' '+inttostr(bounds_cx)+' '+
inttostr(bounds_x+bounds_cx)+' '+name);
{$endif}
include(fwidgetstate1,ws1_layoutplacing);
bounds_x:= ar1[int1] + int4;
if anchors * [an_left,an_right] = [an_left,an_right] then begin
......@@ -8774,6 +8791,10 @@ begin
int2:= int2 + int3;
int4:= int4 + int3;
end;
{$ifdef mse_debuglayout}
debugwriteln(' b '+inttostr(bounds_x)+' '+inttostr(bounds_cx)+' '+
inttostr(bounds_x+bounds_cx)+' '+name);
{$endif}
finally
if not bo1 then begin
exclude(fwidgetstate1,ws1_layoutplacing);
......@@ -12163,6 +12184,17 @@ begin
end;
end;
procedure twidget.widgettopaintsize(var asize: sizety);
begin
if fframe <> nil then begin
with fframe do begin
checkstate;
asize.cx:= asize.cx - (fpaintframe.left + fpaintframe.right);
asize.cy:= asize.cy - (fpaintframe.top + fpaintframe.bottom);
end;
end;
end;
function twidget.clientparentpos: pointty;
//origin = parentwidget.pos
begin
......@@ -15488,7 +15520,9 @@ end;
procedure twidget.getautopaintsize(var asize: sizety);
begin
//default
painttowidgetsize(asize);
checkwidgetsize(asize);
widgettopaintsize(asize);
end;
procedure twidget.getautocellsize(const acanvas: tcanvas;
......
......@@ -1520,6 +1520,7 @@ begin
outertopaintsize(asize);
// innertopaintsize(asize);
end;
inherited; //check min/max size
end;
procedure tcustombutton.clientrectchanged;
......
{ 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.
......
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