From 09011c68d771a08fda3847e704393937911b828a Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Fri, 18 Nov 2022 17:59:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新控件属性 --- funcext/tvclib/tslvcl.tsf | 2 +- funcext/tvclib/utslvclgrid.tsf | 11 ++++++++--- funcext/tvclib/utslvclpage.tsf | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index 2491ff6..4aa260b 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -2919,7 +2919,7 @@ type TGridCtl = class(TcustomGridCtl) begin return array("name","height","width","left","top","border","anchors","align","font","color","parentcolor","parentfont", "autoscroll","columncount","itemcount", - "itemheight","mousesizecell","fixedrows","fixedcolumns","mergeinfo", + "itemheight","variablerows","mousesizecell","fixedrows","fixedcolumns","mergeinfo", "ondrawcell","onhitcellsizer","onmousewheel","onmousemove", "onmousedown","onmouseup","ondblclick", "onkeyup","onkeydown","onkeypress","onnotification"); diff --git a/funcext/tvclib/utslvclgrid.tsf b/funcext/tvclib/utslvclgrid.tsf index b5fffcb..087471f 100644 --- a/funcext/tvclib/utslvclgrid.tsf +++ b/funcext/tvclib/utslvclgrid.tsf @@ -754,16 +754,19 @@ type TcustomGridCtl = class(tcustomscrollcontrol) // inherited; end //******************* + published property ItemCount:integer read GetItemCount write SetItemCount; property ItemHeight:integer read FRowHeight write SetRowHeigt; - property MouseSizeCell:bool read FMouseSizeColumnWidth write setmousesizetype; + property MouseSizeCell:tsl read FMouseSizeColumnWidth write setmousesizetype; property FixedRows:integer read FFixedRows write SetFixedRows; property FixedColumns:integer read FColumFixed write SetFixedColumns; property ColumnCount:integer read GetColumnCount write setcolumncount; - property VariableRows read FVariableRows write SetVariableRows; + property VariableRows:bool read FVariableRows write SetVariableRows; property ondrawcell:eventhandler read Fondrawcell write Fondrawcell; property onhitcellsizer:eventhandler read fonhitcellsizer write fonhitcellsizer; property mergeinfo:tsl read GetMergeInfo write setmergeinfo; + property ColumnWidth read GetColumnWidth write SetColumnWidth; + property rowheight read GetRowHeight write UpDateRowWidth; {** @param(ItemCount)(integer) ÐÐÊý %% @param(ColumnCount)(integer) ÁÐÊý %% @@ -774,6 +777,8 @@ type TcustomGridCtl = class(tcustomscrollcontrol) // @param(mergeinfo)(array) ºÏ²¢ÐÅÏ¢,¶þάÊý×é,ÿÐÐΪһ¸öºÏ²¢ÐÅÏ¢array(¿ªÊ¼ÐÐ,¿ªÊ¼ÁÐ,½ØÖ¹ÐÐ,½ØÖ¹ÁÐ) %% @param(onhitcellsizer)(function[o,e]) Êó±êÒÆ¶¯µ½±ßÏßʱºò»Øµ÷,e.wparam 1,2 ±íʾÐÐÁÐ,e.lparam ´ú±í¶ÔÓÚÐòºÅ,e.skipÊǵÄÖµ×÷Ϊ·µ»Ø±íʾÊÇ·ñºöÂÔµ÷Õû´óС %% @param(ondrawcell)(function[o,e]) »æÖƻص÷,e.row ÐкÅ,e.col ÁкÅ,e.rec »æÖÆÇøÓò,e.canvas »æ»­¶ÔÏó %% + @param(ColumnWidth)(integer) ͨ¹ýË÷ÒýºÅ»ñÈ¡ÉèÖÃÁпí %% + @param(rowheight)(integer) ͨ¹ýË÷ÒýºÅ»ñÈ¡ÉèÖÃÐиß,Ôڿɱä¸ß¶ÈÏÂÓÐÓà %% **} private function setmergeinfo(rcs); @@ -1017,7 +1022,7 @@ type TcustomGridCtl = class(tcustomscrollcontrol) // end function UpDateRowWidth(idx,value); begin - if FVariableRows and idx >= 0 and value>0 then + if FVariableRows and idx >= 0 and value>=0 then begin if FRowsHeight[idx]=value then return; FRowsHeight[idx]:= value; diff --git a/funcext/tvclib/utslvclpage.tsf b/funcext/tvclib/utslvclpage.tsf index 018ab5b..9ba2474 100644 --- a/funcext/tvclib/utslvclpage.tsf +++ b/funcext/tvclib/utslvclpage.tsf @@ -41,6 +41,7 @@ type tcustomtabsheet = class(TCustomControl) // end type tcustompagecontrol = class(TCustomControl) private + fclocker;//Ëø FirstViewIndex; //µÚÒ»¸öչʾµÄÐòºÅ FCurrentid; //µ±Ç° FPrevid; //ÉÏÒ»¸ö @@ -56,6 +57,16 @@ type tcustompagecontrol = class(TCustomControl) fnextrect; FTabRects; FClientarea; + private + function gettabesheet(idx); + begin + if idx>=0 then return FTabItems[idx]; + end + function getactivetabsheet(); + begin + id := FCurrentid; + if id>=0 then return FTabItems[id]; + end function SetTabPosition(v); begin if FTabPosition=v then exit; @@ -232,6 +243,8 @@ type tcustompagecontrol = class(TCustomControl) function setselidx(id); //Ñ¡ÔñÐòºÅ begin if FCurrentid= id then return ; + if fclocker.locked then return ; + lk := new tcountlocker(fclocker); if id>=0 and id-1 and fOnSelChanging then @@ -415,6 +428,7 @@ type tcustompagecontrol = class(TCustomControl) function AfterConstruction();override; begin inherited; + fclocker := new tcountkernel(); color := 0xffffff; height := 200; width := 200; @@ -605,16 +619,21 @@ type tcustompagecontrol = class(TCustomControl) end {** @param(cursel)(integer) µ±Ç°Ñ¡ÖÐÐòºÅ %% + @param(activetabsheet)(tcustomtabsheet) µ±Ç°Ñ¡ÖеÄÒ³Ãæ %% + @param(tabsheet)(tcustomtabsheet) ͨ¹ýϱê»ñµÃÒ³Ãæ %% @param(TabCount)(integer) pageÊýÁ¿ %% @param(OnSelChange)(function[tcustompagecontrol,tuieventbase]) ±êÇ©ÒѾ­Çл» %% @param(OnSelChanging)(function[tcustompagecontrol,tuieventbase]) ±êÇ©ÕýÔÚÇл» %% @param(Onrclcik)(function[tcustompagecontrol,tuieventbase]) ÓÒ¼üµã»÷ %% **} + published + property activetabsheet:tcustomtabsheet read getactivetabsheet write SetCurSel; property cursel:lazyinteger read FCurrentid write SetCurSel; property OnSelChanged:eventhandler read FOnSelChanged write FOnSelChanged; property OnSelChanging:eventhandler read FOnSelChanging write FOnSelChanging; property TabCount read GetTabCount; property TabPosition:tabalign read FTabPosition write SetTabPosition; + property tabsheet read gettabesheet ; end implementation type tcustomtabitem = class() //