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() //