EhLib TitleButton SVisibleColumnsEh = '错误的列';

 

 

unit EhLibConsts;

interface

resourcestring
SClearSelectedCellsEh = '清除选择的单元?';
SInvalidTextFormatEh = '错误的文本格式';
SInvalidVCLDBIFFormatEh = '错误的 VCLDBIF 格式';
SErrorDuringInsertValueEh = '插入值过程中出错:';
SIgnoreErrorEh = '忽略错误?';
STabularInformationEh = '表格信息';
SPageOfPagesEh = '第 %d 页共 %d 页';
SPreviewEh = '预览';
SFieldNameNotFoundEh = '字段名 ''%s'' 没有找到';
SFindDialogStringNotFoundMessageEh = '字符串 "%s" 没有找到。';
SVisibleColumnsEh = '错误的列'; 应该是 显示的列或者可见的列

 

procedure TDBGridEhCenter.DefaultBuildIndicatorTitleMenu(Grid: TCustomDBGridEh; var PopupMenu: TPopupMenu);

var

  I: Integer;

  mi: TMenuItem;

  cmi: TColumnEhMenuItem;

//  gmi: TDBGridEhMenuItem;

begin

  if PopupMenu = nil then

  begin

    if DBGridEhIndicatorTitlePopupMenu = nil then

    begin

      DBGridEhIndicatorTitlePopupMenu := TPopupMenuEh.Create(Screen);

      DBGridEhIndicatorTitlePopupMenu.Name := 'DBGridEhIndicatorTitlePopupMenu';

    end;



    while DBGridEhIndicatorTitlePopupMenu.Items.Count > 0 do

    begin

      mi := DBGridEhIndicatorTitlePopupMenu.Items[0];

      DBGridEhIndicatorTitlePopupMenu.Items.Delete(0);

      if mi.Owner = DBGridEhIndicatorTitlePopupMenu then

        mi.Free;

    end;



    PopupMenu := DBGridEhIndicatorTitlePopupMenu;



  end else if PopupMenu.Items.Count > 0 then

  begin

    mi := TDBGridEhMenuItem.Create(PopupMenu);

    mi.Caption := '-';

    PopupMenu.Items.Add(mi);

  end;



  if Grid.IndicatorTitle.UseGlobalMenu and (itmVisibleColumnsEh in IndicatorTitleMenus) then

  begin

    if DBGridEhVisibleColumnsIndicatorMenuItem = nil then

      DBGridEhVisibleColumnsIndicatorMenuItem := TDBGridEhMenuItem.Create(Screen);

    if DBGridEhVisibleColumnsIndicatorMenuItem.Parent <> nil then

      DBGridEhVisibleColumnsIndicatorMenuItem.Parent.Remove(DBGridEhVisibleColumnsIndicatorMenuItem);

    DBGridEhVisibleColumnsIndicatorMenuItem.Clear;

    DBGridEhVisibleColumnsIndicatorMenuItem.Caption := SVisibleColumnsEh; //这里

    PopupMenu.Items.Add(DBGridEhVisibleColumnsIndicatorMenuItem);



    for I := 0 to Grid.Columns.Count - 1 do

    begin

      if Grid.Columns[i].Title.Caption <> '' then

      begin

//        mi := PopupMenu.CreateMenuItem;

        cmi := TColumnEhMenuItem.Create(PopupMenu);

        cmi.ColumnEh := Grid.Columns[i];

        cmi.Caption := Grid.Columns[i].Title.Caption;

        if Grid.TitleParams.MultiTitle then

          cmi.Caption := StringReplace(cmi.Caption, '|', ' - ', [rfReplaceAll]);

        cmi.Checked := Grid.Columns[i].Visible;

        cmi.OnClick := MenuVisibleColumnClick;

        cmi.CloseMenuOnClick := False;

        DBGridEhVisibleColumnsIndicatorMenuItem.Add(cmi);

      end;

    end;

  end;



// itmCut

  if Grid.IndicatorTitle.UseGlobalMenu and (itmCut in IndicatorTitleMenus) then

 

你可能感兴趣的:(visible)