界面库
整理代码
This commit is contained in:
@@ -1008,7 +1008,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||
function Create(AOwner);override;
|
||||
begin
|
||||
inherited;
|
||||
ftmemlockv := new tmemlockv();
|
||||
ftmemlockv := new tcountkernel();
|
||||
FGutterColor := rgb(228,228,228);
|
||||
fcurrentLineColor := rgb(232,232,255);
|
||||
fselectbkcolor := rgb(192,192,192);
|
||||
@@ -1109,7 +1109,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||
end
|
||||
function MouseDown(o,e);override; //按下鼠标
|
||||
begin
|
||||
if ftmemlockv.haslocker then return ;
|
||||
if ftmemlockv.locked then return ;
|
||||
inherited;
|
||||
if e.skip then return ;
|
||||
IncPaintLock();
|
||||
@@ -1169,7 +1169,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||
end
|
||||
function MouseUp(o,e);override;
|
||||
begin
|
||||
if ftmemlockv.haslocker then return ;
|
||||
if ftmemlockv.locked then return ;
|
||||
inherited;
|
||||
if e.skip then return;
|
||||
UnClipCursor();
|
||||
@@ -1196,7 +1196,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||
end
|
||||
function keypress(o,e);override; //输入字符
|
||||
begin
|
||||
if ftmemlockv.haslocker then return ;
|
||||
if ftmemlockv.locked then return ;
|
||||
if e.skip then return;
|
||||
c := e.wparam;
|
||||
if ReadOnly then return;
|
||||
@@ -1264,7 +1264,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||
begin
|
||||
if fUndoList.CanUndo then
|
||||
begin
|
||||
lk := new tmemlocker(ftmemlockv);
|
||||
lk := new tcountlocker(ftmemlockv);
|
||||
UndoItem();
|
||||
end
|
||||
end
|
||||
@@ -1272,7 +1272,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||
begin
|
||||
if fRedoList.CanUndo then
|
||||
begin
|
||||
lk := new tmemlocker(ftmemlockv);
|
||||
lk := new tcountlocker(ftmemlockv);
|
||||
RedoItem();
|
||||
end
|
||||
end
|
||||
@@ -4117,33 +4117,6 @@ type TSynMemoNorm = class(TsynCustomMemo) //
|
||||
FSheetTabFlage;
|
||||
end
|
||||
Implementation
|
||||
type tmemlockv = class()
|
||||
haslocker;
|
||||
function create();
|
||||
begin
|
||||
haslocker := 0;
|
||||
end
|
||||
function add();
|
||||
begin
|
||||
haslocker++;
|
||||
end
|
||||
function del();
|
||||
begin
|
||||
haslocker--;
|
||||
end
|
||||
end
|
||||
type tmemlocker = class() //锁定对象
|
||||
function create(v);
|
||||
begin
|
||||
flk := v;
|
||||
flk.add();
|
||||
end
|
||||
function destroy();
|
||||
begin
|
||||
flk.del();
|
||||
end
|
||||
flk;
|
||||
end
|
||||
function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode);
|
||||
begin
|
||||
return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode);
|
||||
|
||||
@@ -2117,6 +2117,39 @@ type TCanvsRgnClipAutoSave=class
|
||||
FCvsHandle;
|
||||
FW32api;
|
||||
end
|
||||
type tcountkernel = class() //锁定对象
|
||||
function create();
|
||||
begin
|
||||
Flocked := 0;
|
||||
end
|
||||
function add();
|
||||
begin
|
||||
Flocked++;
|
||||
end
|
||||
function del();
|
||||
begin
|
||||
Flocked--;
|
||||
end
|
||||
property locked read Flocked;
|
||||
private
|
||||
Flocked;
|
||||
end
|
||||
type tcountlocker = class() //锁
|
||||
function create(v);
|
||||
begin
|
||||
if v is class(tcountkernel) then
|
||||
begin
|
||||
fkernel := v;
|
||||
fkernel.add();
|
||||
end
|
||||
end
|
||||
function destroy();
|
||||
begin
|
||||
if fkernel then fkernel.del();
|
||||
end
|
||||
private
|
||||
fkernel;
|
||||
end
|
||||
implementation
|
||||
function includestate(u,s);
|
||||
begin
|
||||
|
||||
@@ -1641,6 +1641,7 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||
function Create(AOwner);override;
|
||||
begin
|
||||
inherited;
|
||||
fcountlocker := new tcountkernel();
|
||||
FSingleExpand := false;
|
||||
FCheckBox := false;
|
||||
FHasLine := false;
|
||||
@@ -1705,12 +1706,11 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||
@explan(说明) 设置选中节点 %%
|
||||
@param(it)(TcustomTreeCtlNode) 节点 %%
|
||||
**}
|
||||
if flockchangedcall then
|
||||
begin
|
||||
return ;//
|
||||
end
|
||||
if fcountlocker.locked then return ;
|
||||
if it=FCurrentNode then return ;
|
||||
lk := new tcountlocker(fcountlocker);
|
||||
if ifnil(it) or ( (it is class(TcustomTreeCtlNode))and (it.Owner=self)) then
|
||||
begin
|
||||
begin
|
||||
r := CallSelChange(it);
|
||||
if r then return;
|
||||
if it=RootNode then return ;
|
||||
@@ -1719,7 +1719,6 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||
GoToNode(it);
|
||||
end
|
||||
if not r then InValidateRect(nil,false);
|
||||
//CallSelChange(it);
|
||||
end
|
||||
end
|
||||
function GoToNode(it);
|
||||
@@ -1831,9 +1830,8 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||
end
|
||||
function Recycling();override;
|
||||
begin
|
||||
flockchangedcall := true;
|
||||
lk := new tcountlocker(fcountlocker);
|
||||
if FRootItem then FRootItem.Recycling();
|
||||
flockchangedcall := false;
|
||||
FRootItem := nil;
|
||||
FCurrentNode := nil;
|
||||
FOnSelChanging := nil;
|
||||
@@ -1863,12 +1861,11 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||
begin
|
||||
if FRootItem then
|
||||
begin
|
||||
flockchangedcall := true;
|
||||
lk := new tcountlocker(fcountlocker);
|
||||
FRootItem.DeleteChildren();
|
||||
flockchangedcall := false;
|
||||
end
|
||||
end
|
||||
property CurrentNode read FCurrentNode;
|
||||
property CurrentNode read FCurrentNode write setcurrentnode; //20221118 加上写
|
||||
property CheckBox:bool read FCheckBox write SetCheckBox;
|
||||
property HasLine:bool read FHasLine write SetHasLine;
|
||||
property OnlyLeafNodeCheckMark read FOnlyLeafNodeCheckMark write FOnlyLeafNodeCheckMark;
|
||||
@@ -1891,12 +1888,16 @@ type TcustomTreeCtl = class(TVirtualList)
|
||||
return FRootItem;
|
||||
end
|
||||
private
|
||||
fcountlocker; //锁定changed回调
|
||||
fnodecreator;
|
||||
flockchangedcall;//
|
||||
FOnlyLeafNodeCheckMark;
|
||||
FNodeHierarchyWidth;
|
||||
FMulSelected;
|
||||
FMulSelects;
|
||||
function setcurrentnode(nd);
|
||||
begin
|
||||
setsel(nd);
|
||||
end
|
||||
function setnodecreator(nd);
|
||||
begin
|
||||
if (fnodecreator<>nd) and (nd is class(TcustomTreeCtlNode)) then
|
||||
|
||||
Reference in New Issue
Block a user