parent
85d2f31e8d
commit
b64606ef50
|
|
@ -1394,7 +1394,9 @@ type TImageListWindow = class(TDVirutalWindow)
|
||||||
function Create(AOwner);override;
|
function Create(AOwner);override;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
WindowFileds := array("left","top","height","width");
|
width := 30;
|
||||||
|
height := 30;
|
||||||
|
WindowFileds := array("left","top");
|
||||||
BindComp := new TControlImageList(self);;
|
BindComp := new TControlImageList(self);;
|
||||||
end
|
end
|
||||||
function bitmapinfo();override;
|
function bitmapinfo();override;
|
||||||
|
|
|
||||||
|
|
@ -1371,7 +1371,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
end
|
end
|
||||||
function DoCaretPosChanged();virtual;//caretλÖøıä
|
function DoCaretPosChanged();virtual;//caretλÖøıä
|
||||||
begin
|
begin
|
||||||
if foncaretposchanged and fcaretcreated then
|
if foncaretposchanged and ( fcaretcreated or ReadOnly) then
|
||||||
begin
|
begin
|
||||||
e := new tuieventbase(0,0,0,0);
|
e := new tuieventbase(0,0,0,0);
|
||||||
CallMessgeFunction(foncaretposchanged,self(true),e);
|
CallMessgeFunction(foncaretposchanged,self(true),e);
|
||||||
|
|
@ -1386,8 +1386,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
begin
|
begin
|
||||||
fLines.text := "";
|
fLines.text := "";
|
||||||
FCaretX := FCaretY := 1;
|
FCaretX := FCaretY := 1;
|
||||||
FSelBegin := array(1,1);
|
fBlockBegin := array(1,1);
|
||||||
FSelEnd := array(1,1);
|
fBlockEnd := array(1,1);
|
||||||
ClearUndo();
|
ClearUndo();
|
||||||
memtextchanged(array(1,1));
|
memtextchanged(array(1,1));
|
||||||
end
|
end
|
||||||
|
|
@ -2193,6 +2193,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
if ifstring(s)and fCaretY>0 and fCaretY <= fLines.Length()then
|
if ifstring(s)and fCaretY>0 and fCaretY <= fLines.Length()then
|
||||||
begin
|
begin
|
||||||
fLines.SetValueByIndex(fCaretY-1,s);
|
fLines.SetValueByIndex(fCaretY-1,s);
|
||||||
|
memtextchanged(array(fcarety,1));
|
||||||
//InvalidateLines(fCaretY-1,fCaretY-1);
|
//InvalidateLines(fCaretY-1,fCaretY-1);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -896,16 +896,7 @@ type tnumindexarray = Class() //ջģ
|
||||||
{**
|
{**
|
||||||
@explan(说明) 在末尾追加元素,参数个数不定 %%
|
@explan(说明) 在末尾追加元素,参数个数不定 %%
|
||||||
**}
|
**}
|
||||||
r := fdlength;
|
return pushs(params);
|
||||||
r1 := r;
|
|
||||||
for i := 0 to ParamCount-1 do
|
|
||||||
begin
|
|
||||||
FData[r]:= Params[i+1];
|
|
||||||
r++;
|
|
||||||
end
|
|
||||||
fdlength := r;
|
|
||||||
if r1 <> r then LengthChanged(r1-r);
|
|
||||||
return r;
|
|
||||||
end
|
end
|
||||||
function Pop();
|
function Pop();
|
||||||
begin
|
begin
|
||||||
|
|
@ -961,33 +952,8 @@ type tnumindexarray = Class() //ջģ
|
||||||
end
|
end
|
||||||
function splice({startid,sellength,value1,valfue2,....});
|
function splice({startid,sellength,value1,valfue2,....});
|
||||||
begin
|
begin
|
||||||
{**
|
|
||||||
@explan(说明) 替换元素,第一个参数为开始位置,第二个为替换的个数,以后的参数为用来替换的值,返回被替换的值%%
|
|
||||||
**}
|
|
||||||
p := params;
|
p := params;
|
||||||
st := p[0];
|
return splices(p[0],p[1],p[2:]);
|
||||||
if not(st>=0) then st := 0;
|
|
||||||
sl := p[1];
|
|
||||||
sl := ifnil(sl)?inf:sl;
|
|
||||||
sl := (sl>=0)?sl:0;
|
|
||||||
len := fdlength;
|
|
||||||
st := st<0?0:st;
|
|
||||||
st := st >= len?(len):st;
|
|
||||||
et := st+sl;
|
|
||||||
et := et >= len?(len):et;
|
|
||||||
r := array();
|
|
||||||
{idx := 0;
|
|
||||||
for i := st to et-1 do
|
|
||||||
begin
|
|
||||||
r[idx++]:= FData[i];
|
|
||||||
end }
|
|
||||||
r := FData[st:(et-1)];
|
|
||||||
r1 := FData[0:st-1];
|
|
||||||
r2 := FData[et:len-1];
|
|
||||||
FData := r1 union p[2:] union r2;
|
|
||||||
fdlength := ::length(FData);
|
|
||||||
if len <> fdlength then LengthChanged(fdlength-len);
|
|
||||||
return r;
|
|
||||||
end
|
end
|
||||||
function shift();
|
function shift();
|
||||||
begin
|
begin
|
||||||
|
|
@ -1009,14 +975,7 @@ type tnumindexarray = Class() //ջģ
|
||||||
{**
|
{**
|
||||||
@explan(说明) 在数据头部加入元素,个数待定 %%
|
@explan(说明) 在数据头部加入元素,个数待定 %%
|
||||||
**}
|
**}
|
||||||
p := Params;
|
return unshifts(params);
|
||||||
if p then
|
|
||||||
begin
|
|
||||||
FData := p union FData;
|
|
||||||
fdlength := ::length(FData);
|
|
||||||
LengthChanged(1);
|
|
||||||
end
|
|
||||||
return fdlength;
|
|
||||||
end
|
end
|
||||||
function swap(i,j);
|
function swap(i,j);
|
||||||
begin
|
begin
|
||||||
|
|
@ -1036,16 +995,58 @@ type tnumindexarray = Class() //ջģ
|
||||||
end
|
end
|
||||||
function pushs(vs);
|
function pushs(vs);
|
||||||
begin
|
begin
|
||||||
return callinarray(thisfunction(push),vs);
|
if not(vs) and length(vs) then return r;
|
||||||
|
r := fdlength;
|
||||||
|
r1 := r;
|
||||||
|
for i := 0 to length(vs)-1 do
|
||||||
|
begin
|
||||||
|
FData[r]:= vs[i];
|
||||||
|
r++;
|
||||||
|
end
|
||||||
|
fdlength := r;
|
||||||
|
if r1 <> r then LengthChanged(r1-r);
|
||||||
|
return r;
|
||||||
end
|
end
|
||||||
function unshifts(vs);
|
function unshifts(vs);
|
||||||
begin
|
begin
|
||||||
return callinarray(thisfunction(unshift),vs);
|
if ifarray(vs) and vs then
|
||||||
|
begin
|
||||||
|
FData := vs union FData;
|
||||||
|
fdlength := ::length(FData);
|
||||||
|
LengthChanged(1);
|
||||||
|
end
|
||||||
|
return fdlength;
|
||||||
end
|
end
|
||||||
function splices(startid,sellength,vs);
|
function splices(startid,sellength,vs);
|
||||||
begin
|
begin
|
||||||
if ifarray(vs)then return callinarray(thisfunction(splice),array(startid,sellength) union vs);
|
{**
|
||||||
return array();
|
@explan(说明) 替换元素,第一个参数为开始位置,第二个为替换的个数,以后的参数为用来替换的值,返回被替换的值%%
|
||||||
|
**}
|
||||||
|
st := startid;
|
||||||
|
if not(st>=0) then st := 0;
|
||||||
|
sl := sellength;
|
||||||
|
sl := ifnil(sl)?inf:sl;
|
||||||
|
sl := (sl>=0)?sl:0;
|
||||||
|
len := fdlength;
|
||||||
|
st := st<0?0:st;
|
||||||
|
st := st >= len?(len):st;
|
||||||
|
et := st+sl;
|
||||||
|
et := et >= len?(len):et;
|
||||||
|
r := array();
|
||||||
|
r := FData[st:(et-1)];
|
||||||
|
r1 := FData[0:st-1];
|
||||||
|
r2 := FData[et:len-1];
|
||||||
|
if ifarray(vs) and vs then
|
||||||
|
begin
|
||||||
|
FData := r1 union vs union r2;
|
||||||
|
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FData := r1 union r2;
|
||||||
|
end
|
||||||
|
fdlength := ::length(FData);
|
||||||
|
if len <> fdlength then LengthChanged(fdlength-len);
|
||||||
|
return r;
|
||||||
end
|
end
|
||||||
function LengthChanged(n);virtual;
|
function LengthChanged(n);virtual;
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -2073,8 +2073,8 @@ type TCustomImageList=class(tcomponent)
|
||||||
property Handle read HandleNeeded write SetHandle;
|
property Handle read HandleNeeded write SetHandle;
|
||||||
property AutoDestroy read FAutoDestroy write FAutoDestroy;
|
property AutoDestroy read FAutoDestroy write FAutoDestroy;
|
||||||
property ImageCount read FimageCount;
|
property ImageCount read FimageCount;
|
||||||
property Height:integer read FHeight write Setheight;
|
property Height read FHeight write Setheight;
|
||||||
property Width:integer read FWidth write SetWidth;
|
property Width read FWidth write SetWidth;
|
||||||
property imgHeight:integer read FHeight write Setheight;
|
property imgHeight:integer read FHeight write Setheight;
|
||||||
property imgWidth:integer read FWidth write SetWidth;
|
property imgWidth:integer read FWidth write SetWidth;
|
||||||
property OnChange read FOnChange write FOnChange;
|
property OnChange read FOnChange write FOnChange;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue