码迷,mamicode.com
首页 > 其他好文 > 详细

EhLib TitleButton SVisibleColumnsEh = '错误的列';

时间:2015-03-01 22:10:53      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

 

 

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

 

EhLib TitleButton SVisibleColumnsEh = '错误的列';

标签:

原文地址:http://www.cnblogs.com/CodeGear/p/4307596.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!