zoukankan      html  css  js  c++  java
  • ehlib 用法记录

    点列头排序

    1.add  ehlibado.pas  to project.

    2.grideh>ColumnDefValues>Title>TitleButton=true;

    3.grideh>SortLocal=true;

    4.grideh>optionsEh>dghAutoSortMarking=true;

    install component

    open ehlib.dpk,replace ,then install ok!

    in '    replace to  in '..Common

    grideh隔行变色:EvenRowColor/OddRowColor

    grid的title:渐变色,TitleParams.FillStyle=cfstGradientEh

    动态创建Grid列

      var
        column : TColumnEh;
      begin
        self.DBGridEh1.Columns.AddAllColumns( true );
        column := self.DBGridEh1.Columns.Add;
        column.Title.Caption := '姓名';
        column.Width := 70;
        column.FieldName := 'name';
         TColumnEh * column;
        column = DBGridEh1->Columns->Add( );
        column->FieldName = "name";
        column->Title->Caption = "姓名";
        column->Width = 70;

    这个父容器释放的时候会自动释放,所以不存在内存泄漏。

    尾行合计

    方法:双击grideh打开字段列表;选择需要求和的字段,有个属性Footer

     https://blog.csdn.net/yanjinrong/article/details/43816369

    GridEH编辑框当前单元格的值,正在编辑的值,正在输入的值,当前输入的值

       self.DBGridEh1.InplaceEditor.Text

    if Grid.InplaceEditorVisible then
        Result := Grid.InplaceEditor.Text


        Result := Grid.InplaceEditor.top

    让进入编辑模式

      DBGridEh1.EditorMode:=True;

    InplaceEditor本质上是MaskEdit

    TInplaceEdit = class(TCustomMaskEdit)

     procedure TCustomDBGridEh.ShowEditor;

    procedure TCustomDBGridEh.UpdateEdit; //计算位置

    function TCustomDBGridEh.CellEditRect(ACol, ARow: Longint): TRect;

    DBGridEh.pas

    function TCustomDBGridEh.CellEditRect(ACol, ARow: Longint): TRect;

    // abscrect.top :=abscrect.top+ 20;
        Result.top:= abscrect.top;

    grideh编辑框垂直居中

    procedure TForm12.DBGridEh1DrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
    var
    acol,arow:Integer;
    arect:TRect;
    begin
    if self.DBGridEh1.TitleHeight<5 then Caption:='0';
    
    if (self.DBGridEh1.InplaceEditor<>nil) and(self.DBGridEh1.InplaceEditor.Visible) then //and (self.DBGridEh1.InplaceEditor.Top<=(25+ (self.FDMemTable1.RecNo-1)*(self.DBGridEh1.RowHeight+1)  ) then
    begin
    
       arect:= self.DBGridEh2.CellRectAbs(DataCol,DBGridEh1.Row,true);
       self.Caption := Format('%d,%d,%d,%d',[DBGridEh1.Row,  arect.Top,DBGridEh1.InplaceEditor.Top,DBGridEh1.InplaceEditor.Height]);
       DBGridEh1.InplaceEditor.Alignment := taCenter;
       if(  DBGridEh1.InplaceEditor.Top <= 25+ 41*(DBGridEh1.Row-1) )  then
        self.DBGridEh1.InplaceEditor.Top := self.DBGridEh1.InplaceEditor.Top+10 ;
    end;
    
    // self.Caption:='cc';
    end;
  • 相关阅读:
    【新特性速递】数字输入框的前缀和后缀(位于输入框内部)
    【新特性速递】进度条,进度条,进度条
    【新特性速递】当法语遇上FineUI(Bonjour)!
    【新特性速递】自定义数字输入框的小数分隔符和千分位分隔符
    【经验分享】FineUICore中如何处理文件导出异常?
    【网友作品】服装分销系统架构与界面分享(基于FineUICore基础版)
    FineUIPro/Mvc/Core v6.3.0 正式发布了!
    星球居民突破 1700 人!
    【新特性速递】开关样式复选框增强!
    【新特性速递】为RenderField新增QuickSortField属性!
  • 原文地址:https://www.cnblogs.com/cb168/p/5241917.html
Copyright © 2011-2022 走看看