parent
b99970fa64
commit
b57770b81a
|
|
@ -109,7 +109,7 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
if not fownerdraw then
|
if not fownerdraw then
|
||||||
begin
|
begin
|
||||||
fh := ft.height;
|
fh := ft.height;
|
||||||
FTabHeight := fh+7;
|
FTabHeight := fh+8;
|
||||||
end
|
end
|
||||||
FTabItemswidth := array();
|
FTabItemswidth := array();
|
||||||
e := new tuieventbase(0,0,0,0);
|
e := new tuieventbase(0,0,0,0);
|
||||||
|
|
@ -126,14 +126,15 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
FMaxsize := 0;
|
FMaxsize := 0;
|
||||||
if FTabPosition in array(alLeft,alRight) then
|
{if FTabPosition in array(alLeft,alRight) then
|
||||||
begin
|
begin
|
||||||
FTabItemswidth := zeros(length(FTabItemswidth))+maxvalue(FTabItemswidth);
|
FTabItemswidth := zeros(length(FTabItemswidth))+maxvalue(FTabItemswidth);
|
||||||
FMaxsize := length(FTabItemswidth)*FTabHeight;
|
FMaxsize := length(FTabItemswidth)*FTabHeight;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
FMaxsize := sum(FTabItemswidth);
|
FMaxsize := sum(FTabItemswidth);
|
||||||
end
|
end }
|
||||||
|
FMaxsize := sum(FTabItemswidth);
|
||||||
FClientarea := rec;
|
FClientarea := rec;
|
||||||
FScrollBtnRect := 0;
|
FScrollBtnRect := 0;
|
||||||
Fprevrect := 0;
|
Fprevrect := 0;
|
||||||
|
|
@ -144,12 +145,12 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if FTabItemswidth then
|
if FTabItemswidth then
|
||||||
begin
|
begin
|
||||||
FClientarea[0] :=rec[0]+FTabItemswidth[0];
|
FClientarea[0] :=rec[0]+FTabHeight;//FTabItemswidth[0];
|
||||||
if length(FTabItemswidth)>1 and (FMaxsize>(rec[3]-rec[1])) then
|
if length(FTabItemswidth)>1 and (FMaxsize>(rec[3]-rec[1])) then
|
||||||
begin
|
begin
|
||||||
FScrollBtnRect := array(rec[0],rec[3]-FTabHeight*2,rec[0]+FTabItemswidth[0],rec[3]);
|
FScrollBtnRect := array(rec[0],rec[3]-FTabHeight*2,rec[0]+FTabHeight,rec[3]);
|
||||||
Fprevrect := array(rec[0],rec[3]-FTabHeight*2,rec[0]+FTabItemswidth[0],rec[3]-FTabHeight);
|
Fprevrect := array(rec[0],rec[3]-FTabHeight*2,rec[0]+FTabHeight,rec[3]-FTabHeight);
|
||||||
Fnextrect := array(rec[0],rec[3]-FTabHeight,rec[0]+FTabItemswidth[0],rec[3]);
|
Fnextrect := array(rec[0],rec[3]-FTabHeight,rec[0]+FTabHeight,rec[3]);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
FirstViewIndex := 0;
|
FirstViewIndex := 0;
|
||||||
|
|
@ -159,8 +160,8 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if i>=FirstViewIndex then
|
if i>=FirstViewIndex then
|
||||||
begin
|
begin
|
||||||
FTabRects[i] := array(0,ybase,FTabItemswidth[0],ybase+FTabHeight);
|
FTabRects[i] := array(0,ybase,FTabHeight,ybase+FTabItemswidth[i]-1);
|
||||||
ybase+=FTabHeight;
|
ybase+=FTabItemswidth[i];
|
||||||
if xbase>(rec[3]-FTabHeight-FTabHeight) then break;
|
if xbase>(rec[3]-FTabHeight-FTabHeight) then break;
|
||||||
end
|
end
|
||||||
else FTabRects[i] := nil;
|
else FTabRects[i] := nil;
|
||||||
|
|
@ -171,12 +172,12 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if FTabItemswidth then
|
if FTabItemswidth then
|
||||||
begin
|
begin
|
||||||
FClientarea[2] :=rec[2]-FTabItemswidth[0];
|
FClientarea[2] :=rec[2]-FTabHeight;
|
||||||
if length(FTabItemswidth)>1 and (FMaxsize>(rec[3]-rec[1])) then
|
if length(FTabItemswidth)>1 and (FMaxsize>(rec[3]-rec[1])) then
|
||||||
begin
|
begin
|
||||||
FScrollBtnRect := array(rec[2]-FTabItemswidth[0],rec[3]-FTabHeight*2,rec[2],rec[3]);
|
FScrollBtnRect := array(rec[2]-FTabHeight,rec[3]-FTabHeight*2,rec[2],rec[3]);
|
||||||
Fprevrect := array(rec[2]-FTabItemswidth[0],rec[3]-FTabHeight*2,rec[2],rec[3]-FTabHeight);
|
Fprevrect := array(rec[2]-FTabHeight,rec[3]-FTabHeight*2,rec[2],rec[3]-FTabHeight);
|
||||||
Fnextrect := array(rec[2]-FTabItemswidth[0],rec[3]-FTabHeight,rec[2],rec[3]);
|
Fnextrect := array(rec[2]-FTabHeight,rec[3]-FTabHeight,rec[2],rec[3]);
|
||||||
end else
|
end else
|
||||||
FirstViewIndex := 0;
|
FirstViewIndex := 0;
|
||||||
ybase := 0;
|
ybase := 0;
|
||||||
|
|
@ -184,8 +185,8 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if i>=FirstViewIndex then
|
if i>=FirstViewIndex then
|
||||||
begin
|
begin
|
||||||
FTabRects[i] := array(rec[2]-FTabItemswidth[0],ybase,rec[2],ybase+FTabHeight);
|
FTabRects[i] := array(rec[2]-FTabHeight,ybase,rec[2],ybase+FTabItemswidth[i]-1);
|
||||||
ybase+=FTabHeight;
|
ybase+=FTabItemswidth[i];
|
||||||
if xbase>(rec[3]-FTabHeight-FTabHeight) then break;
|
if xbase>(rec[3]-FTabHeight-FTabHeight) then break;
|
||||||
end
|
end
|
||||||
else FTabRects[i] := nil;
|
else FTabRects[i] := nil;
|
||||||
|
|
@ -215,7 +216,7 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if i>=FirstViewIndex then
|
if i>=FirstViewIndex then
|
||||||
begin
|
begin
|
||||||
FTabRects[i] := array(xbase,0,xbase+FTabItemswidth[i],FTabHeight);
|
FTabRects[i] := array(xbase,0,xbase+FTabItemswidth[i]-1,FTabHeight);
|
||||||
xbase+=FTabItemswidth[i];
|
xbase+=FTabItemswidth[i];
|
||||||
if xbase>(rec[2]-FTabHeight-FTabHeight) then break;
|
if xbase>(rec[2]-FTabHeight-FTabHeight) then break;
|
||||||
end else
|
end else
|
||||||
|
|
@ -239,7 +240,7 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if i>=FirstViewIndex then
|
if i>=FirstViewIndex then
|
||||||
begin
|
begin
|
||||||
FTabRects[i] := array(xbase,rec[3]-FTabHeight,xbase+FTabItemswidth[i],rec[3]);
|
FTabRects[i] := array(xbase,rec[3]-FTabHeight,xbase+FTabItemswidth[i]-1,rec[3]);
|
||||||
xbase+=FTabItemswidth[i];
|
xbase+=FTabItemswidth[i];
|
||||||
if xbase>(rec[2]-FTabHeight-FTabHeight) then break;
|
if xbase>(rec[2]-FTabHeight-FTabHeight) then break;
|
||||||
end else
|
end else
|
||||||
|
|
@ -326,12 +327,20 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
dc.pen.color := 13158600;//rgb(200,200,200);
|
dc.pen.color := 13158600;//rgb(200,200,200);
|
||||||
if FCurrentid=i then
|
if FCurrentid=i then
|
||||||
begin
|
begin
|
||||||
dc.brush.color := 0xf0f0f0;//rgb(100,192,250);//rgb(230,240,250);//rgb(200,200,200);
|
dc.brush.color := 0xc0b0a0;//rgb(100,192,250);//rgb(230,240,250);//rgb(200,200,200);
|
||||||
end else dc.brush.color := 16711422;//rgb(254,254,254);
|
end else dc.brush.color := 16711422;//rgb(254,254,254);
|
||||||
dc.draw("roundrect",array(rec[0:1],rec[2:3],array(2,2)));
|
dc.draw("roundrect",array(rec[0:1],rec[2:3],array(2,2)));
|
||||||
rec[1]+=2;
|
rec[1]+=2;
|
||||||
it := FTabItems[i];
|
it := FTabItems[i];
|
||||||
dc.drawtext(it.caption,rec,DT_CENTER .|DT_VCENTER);
|
if fTabPosition in array(alLeft,alRight) then
|
||||||
|
begin
|
||||||
|
dc.SaveDC();
|
||||||
|
dc.trans(pi()/2,rec[0],rec[3]);
|
||||||
|
dc.textout(it.Caption,array(4,3));
|
||||||
|
//dc.drawtext(it.caption,array(0,0,rec[3]-rec[1],rec[2]-rec[0]),DT_CENTER .|DT_VCENTER);
|
||||||
|
dc.RestoreDC();
|
||||||
|
end else
|
||||||
|
dc.drawtext(it.caption,rec,DT_CENTER .|DT_VCENTER);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue