zoukankan      html  css  js  c++  java
  • ehlib 如何用代码,选中checkbox呢?

      TDBGridEh = class(TCustomDBGridEh)
      public
        property Col;
        property Row;
        property Canvas;
    //    property GridHeight;
        property RowCount;
        property SelectedRows;  //这里
    
    
    
    
    TBookmarkListEh = class(TBMListEh)
      private
        FGrid: TCustomDBGridEh;
        FRowsRef: TObjectList;
      protected
        function GetDataSet: TDataSet; override;
        procedure Invalidate; override;
        procedure SetCurrentRowSelected(Value: Boolean); override;// 这里
    
    
    procedure TBookmarkListEh.SetCurrentRowSelected(Value: Boolean);
    begin
      if Value and FGrid.DataSource.DataSet.IsEmpty then Exit;
      inherited SetCurrentRowSelected(Value); //这里
      FGrid.InvalidateRow(FGrid.Row);
    end;
    
    
    procedure TBMListEh.SetCurrentRowSelected(Value: Boolean);
    var
      Index: Integer;
      Current: TUniBookmarkEh;
    begin
      Current := CurrentRow;//这里
      if Find(Current, Index) = Value
        then Exit;
      if Value
        then InsertItem(Index, Current)
        else DeleteItem(Index);
    end;


    function TBMListEh.CurrentRow: TUniBookmarkEh;
    begin
      {$IFDEF FPC}
      if not FLinkActive then RaiseBMListError(SInactiveDataset);
      {$ELSE}
      if not FLinkActive then RaiseBMListError(sDataSetClosed);
      {$ENDIF}
      Result := Dataset.Bookmark;
    end;
  • 相关阅读:
    Django之模板
    Django之视图
    Django之web框架和url路由
    SpringBoot整合Druid数据源
    SpringBoot整合定时任务异步任务
    逐行解读HashMap源码
    SpringBoot通过RedisTemplate执行Lua脚本
    SpringBoot使用H2内嵌数据库
    SpringBoot如何使用拦截器
    SpringBoot热部署的实现方式
  • 原文地址:https://www.cnblogs.com/CodeGear/p/4513067.html
Copyright © 2011-2022 走看看