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); varI: Integer;mi: TMenuItem;cmi: TColumnEhMenuItem; // gmi: TDBGridEhMenuItem; beginif PopupMenu = nil thenbeginif DBGridEhIndicatorTitlePopupMenu = nil thenbeginDBGridEhIndicatorTitlePopupMenu := TPopupMenuEh.Create(Screen);DBGridEhIndicatorTitlePopupMenu.Name := 'DBGridEhIndicatorTitlePopupMenu';end;while DBGridEhIndicatorTitlePopupMenu.Items.Count > 0 dobeginmi := DBGridEhIndicatorTitlePopupMenu.Items[0];DBGridEhIndicatorTitlePopupMenu.Items.Delete(0);if mi.Owner = DBGridEhIndicatorTitlePopupMenu thenmi.Free;end;PopupMenu := DBGridEhIndicatorTitlePopupMenu;end else if PopupMenu.Items.Count > 0 thenbeginmi := TDBGridEhMenuItem.Create(PopupMenu);mi.Caption := '-';PopupMenu.Items.Add(mi);end;if Grid.IndicatorTitle.UseGlobalMenu and (itmVisibleColumnsEh in IndicatorTitleMenus) thenbeginif DBGridEhVisibleColumnsIndicatorMenuItem = nil thenDBGridEhVisibleColumnsIndicatorMenuItem := TDBGridEhMenuItem.Create(Screen);if DBGridEhVisibleColumnsIndicatorMenuItem.Parent <> nil thenDBGridEhVisibleColumnsIndicatorMenuItem.Parent.Remove(DBGridEhVisibleColumnsIndicatorMenuItem);DBGridEhVisibleColumnsIndicatorMenuItem.Clear;DBGridEhVisibleColumnsIndicatorMenuItem.Caption := SVisibleColumnsEh; //这里PopupMenu.Items.Add(DBGridEhVisibleColumnsIndicatorMenuItem);for I := 0 to Grid.Columns.Count - 1 dobeginif Grid.Columns[i].Title.Caption <> '' thenbegin // mi := PopupMenu.CreateMenuItem;cmi := TColumnEhMenuItem.Create(PopupMenu);cmi.ColumnEh := Grid.Columns[i];cmi.Caption := Grid.Columns[i].Title.Caption;if Grid.TitleParams.MultiTitle thencmi.Caption := StringReplace(cmi.Caption, '|', ' - ', [rfReplaceAll]);cmi.Checked := Grid.Columns[i].Visible;cmi.OnClick := MenuVisibleColumnClick;cmi.CloseMenuOnClick := False;DBGridEhVisibleColumnsIndicatorMenuItem.Add(cmi);end;end;end;// itmCutif Grid.IndicatorTitle.UseGlobalMenu and (itmCut in IndicatorTitleMenus) then