文件名称:cxGrid右键菜单
文件大小:2.49MB
文件格式:RAR
更新时间:2018-10-28 03:38:12
右键菜单 cxgrod
cxGrid右键菜单源码 含源码 //CXVIEW的右键菜单 { Tag=19003 //TableView.Columns[i].Tag=19003 表示此列是计算列; } unit ABcxGridPopupMenuU; interface // 关闭RTTI反射机制减少EXE文件尺寸 {$IF CompilerVersion >= 21.0} {$WEAKLINKRTTI ON} {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} {$IFEND} uses ABPubListBoxItemU,ABPubMemoItemU, ABcxGridPopupMenu_FuncU, ABcxGridAndcxTreeViewSearchU, ABcxGridPopupMenu_FigureU, ABcxGridPopupMenu_ColorSetupU, ABcxGridPopupMenu_AddColumU, Types, Windows, Messages, SysUtils, Variants, Classes, Graphics,Forms,Menus,TypInfo, Dialogs,Controls,ShellAPI , db, cxGridTableView,cxGridDBTableView,cxGridCustomTableView,cxGridBandedTableView,cxGridDBBandedTableView, cxgrid ,cxCustomData,cxGraphics, cxStyles,cxGridCustomView,cxGridExportLink, cxGridDBDataDefinitions,cxTextEdit,cxEdit,cxDBPivotGrid,cxExportPivotGridLink; type //获取列显示时的事件,如计算字段,翻译CXGRID显示内容时会用到 TColumnGetDataTextEvent = record ColumnName:string; FOldColumnGetDataText: TcxGridGetDataTextEvent; SQL:string; Self:TcxGridColumn; end; PColumnGetDataTextEvent = ^TColumnGetDataTextEvent; //序号重画的事件 TIndicatorCellCustomDrawEvent = record TableViewName:string; FOldIndicatorCellCustomDraw : TcxGridIndicatorCellCustomDrawEvent; Self:TcxGridTableView ; end; PIndicatorCellCustomDrawEvent = ^TIndicatorCellCustomDrawEvent; //CELL单元格重画的事件,如依数据控制行列的颜色会用到 TCellCustomDrawEvent = record TableViewName:string; FOldCellCustomDraw : TcxGridTableDataCellCustomDrawEvent; FOldStylesGetContentStyle:TcxGridGetCellStyleEvent; FOldSummary:TcxSummaryEvent; FOldGroupSummary:TcxSummaryEvent; Text:string; Self:TcxGridTableView; end; PCellCustomDrawEvent = ^TCellCustomDrawEvent; TABcxGridPopupMenuVisableItem= ( viAscDesc, viAggregtes, viAlign, viOutFile, viShowGroup,viShowHintCloum,viBestColumWidth,viAutoRowHeight,viAutoColumWidth,viShowFilter, viBand, viColum, viFigure,viColorSetup,viPrint,viSaveSetup,viSaveSetupAndToDatabase,viClearSetup,viRefreshLoad ); TABcxGridPopupMenuVisableItems = set of TABcxGridPopupMenuVisableItem; TABcxGridPopupMenuVisableOtherItem= ( viOtherSelect, viOtherCreateAllItems, viOtherAutoSumNum, viOtherShowConfluence, viOtherShowHeader, viOtherFocusCellOnTab, viOtherGoToNextCellOnEnter, viOtherDirectionKeyMoveColumn, viOtherColumnsQuickCustomization, viOtherColumnFiltering, viOtherColumnHorzSizing, viOtherDataRowSizing, viOtherIndicator, viOtherAutoDataSetFilter, viOtherDisplayFormat , viOtherControlFields , viOtherTableViewCanEdit , viOtherFullExpand, viOtherFullCollapse ); TABcxGridPopupMenuVisableOtherItems = set of TABcxGridPopupMenuVisableOtherItem; //CXVIEW的右键菜单 TABcxGridPopupMenu= class(TPopupMenu ) private FLinkTableView: TcxGridTableView; //计算列用的事件 FColumnsOnGetDataText: TStringList; //序号显示所用的事件 FIndicatorCellCustomDraw: TStringList; //颜色,计算等所用 FCellCustomDraw: TStringList; //颜色所用的 FStyleRepository:TcxStyleRepository; FStyleList:TStringList; //颜色设置窗体 ColorSetupForm:TForm; FCurSetColorStr:string; FVisableItem: TABcxGridPopupMenuVisableItems; FAutoApplyBestFit: Boolean; FAutoCreateAllItem: Boolean; FSaveFlagStr: string; FVisableOtherItem: TABcxGridPopupMenuVisableOtherItems; FIsLoadViewProperty: boolean; FIsLoadViewStyleSheets: boolean; FIsLoadViewOtherSet: boolean; FIsLoadViewSetColor: boolean; FSaveLongFlagStr: string; FHide: Boolean; //排序 procedure PopupMenu_Asc(Sender: TObject); procedure PopupMenu_Desc(Sender: TObject); procedure PopupMenu_DelAscORDesc(Sender: TObject); //聚合 procedure PopupMenu_Sum(Sender: TObject); procedure PopupMenu_Count(Sender: TObject); procedure PopupMenu_Max(Sender: TObject); procedure PopupMenu_Min(Sender: TObject); procedure PopupMenu_Avg(Sender: TObject); procedure PopupMenu_empty(Sender: TObject); procedure SetColumnFoot(akind: TcxSummaryKind); //输出 procedure PopupMenu_OutExcel(Sender: TObject); procedure PopupMenu_OutXML(Sender: TObject); procedure PopupMenu_OutText(Sender: TObject); procedure PopupMenu_OutHtml(Sender: TObject); procedure OutFile(aOutFileType: TABOutFileType); //对齐 procedure PopupMenu_AlignLeft(Sender: TObject); procedure PopupMenu_AlignRight(Sender: TObject); procedure PopupMenu_AlignCenter(Sender: TObject); procedure SetColumnAlign(aAlignment: TAlignment); //固定列 procedure PopupMenu_AddBand(Sender: TObject); procedure PopupMenu_DelBand(Sender: TObject); procedure PopupMenu_EditBand(Sender: TObject); procedure PopupMenu_SetBandPositionfkLeft(Sender: TObject); procedure PopupMenu_SetBandPositionfkRight(Sender: TObject); procedure PopupMenu_SetBandPositionfkNone(Sender: TObject); procedure PopupMenu_ShowBandHeaders(Sender: TObject); //计算列 procedure PopupMenu_AddColum(Sender: TObject); procedure PopupMenu_DelColum(Sender: TObject); procedure PopupMenu_EditColum(Sender: TObject); procedure PopupMenu_OtherShowHeader(Sender: TObject); //颜色控制 procedure PopupMenu_ColorSetup(Sender: TObject); //数据选择方式 procedure PopupMenu_OtherSelectCellSelect(Sender: TObject); procedure PopupMenu_OtherSelectCellsSelect(Sender: TObject); procedure PopupMenu_OtherSelectMultiRowSelect(Sender: TObject); procedure PopupMenu_OtherSelectRowSelect(Sender: TObject); //控制 procedure PopupMenu_AllFilter(Sender: TObject); procedure PopupMenu_ShowFilter(Sender: TObject); procedure PopupMenu_FilterRow(Sender: TObject); procedure PopupMenu_ShowFilter_fvAlways(Sender: TObject); procedure PopupMenu_ShowFilter_fvNever(Sender: TObject); procedure PopupMenu_ShowFilter_fvNonEmpty(Sender: TObject); procedure PopupMenu_ShowGroup(Sender: TObject); procedure PopupMenu_OtherShowConfluence(Sender: TObject); procedure PopupMenu_ShowHintCloum(Sender: TObject); procedure PopupMenu_AutoColumWidth(Sender: TObject); procedure PopupMenu_Figure(Sender: TObject); procedure PopupMenu_OtherAutoSumNum(Sender: TObject); procedure PopupMenu_OtherFocusCellOnTab(Sender: TObject); procedure PopupMenu_OtherGoToNextCellOnEnter(Sender: TObject); //AlwaysShowEditor(即可自动进入编辑模式)为TRUE时虽然方向键可移动单元格,但列的CELL的单双击将会失效 procedure PopupMenu_OtherDirectionKeyMoveColumn(Sender: TObject); procedure PopupMenu_OtherColumnsQuickCustomization(Sender: TObject); procedure PopupMenu_OtherColumnHorzSizing(Sender: TObject); procedure PopupMenu_OtherDataRowSizing(Sender: TObject); procedure PopupMenu_OtherColumnFiltering(Sender: TObject); procedure PopupMenu_OtherIndicator(Sender: TObject); procedure PopupMenu_OtherAutoDataSetFilter(Sender: TObject); procedure PopupMenu_OtherDisplayFormat(Sender: TObject); procedure PopupMenu_OtherTableViewCanEdit(Sender: TObject); procedure FreeOldEVent_FCellCustomDraw; procedure FreeOldEVent_FColumnsOnGetDataText; procedure FreeOldEVent_FIndicatorCellCustomDraw; procedure PopupMenu_SaveSetup(Sender: TObject); procedure PopupMenu_ClearSetup(Sender: TObject); procedure PopupMenu_Down(Sender: TObject); procedure PopupMenu_DoBitWidth_AutoWidth_Sum_Save(Sender: TObject); procedure FreeStyleList; function GetStyleByColor(aColor: string): TcxStyle; procedure NewColumnsGetDataText(Sender: TcxCustomGridTableItem; ARecordIndex: Integer; var AText: String); procedure NewStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); procedure NewSummary( ASender: TcxDataSummaryItems; Arguments: TcxSummaryEventArguments; var OutArguments: TcxSummaryEventOutArguments); procedure NewGroupSummary(ASender: TcxDataSummaryItems; Arguments: TcxSummaryEventArguments; var OutArguments: TcxSummaryEventOutArguments); procedure NewCustomDrawIndicatorCell( Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); procedure Refresh; procedure SetLinkTableView(const Value: TcxGridTableView); function GetLinkGrid: TcxGrid; procedure SetMenuVisible_FalseByVisableItem; procedure SetIndicator(aActive: boolean); function GetFilename(aStrFlag:string): string; procedure PopupMenu_OtherControlField_ABUseDBlClick(Sender: TObject); procedure PopupMenu_DoBitWidth_AutoWidth_Save(Sender: TObject); procedure PopupMenu_SaveSetupAndToDatabase(Sender: TObject); procedure PopupMenu_OtherFullCollapse(Sender: TObject); procedure PopupMenu_OtherFullExpand(Sender: TObject); procedure PopupMenu_DoBitWidth_AutoWidth_Sum_SaveAndToDatabase( Sender: TObject); protected procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure DoPopup(Sender: TObject); override; procedure CreatePopupMenu; procedure DestroyPopupMenu; procedure LoadViewProperty; procedure LoadViewStyleSheets; procedure LoadViewSetColor(aInit:boolean=false); procedure LoadViewOtherSet; procedure SaveViewProperty; procedure SaveViewSetColor; procedure SaveViewStyleSheets; procedure SaveViewOtherSet; procedure PopupMenu_OtherCreateAllItems(Sender: TObject); procedure PopupMenu_BestColumWidth(Sender: TObject); procedure PopupMenu_AutoRowHeight(Sender: TObject); procedure PopupMenu_ExecOtherIndicator; { Protected declarations } public //通过FileStr来修改相关配制名称 procedure ChangeFileNameBySaveFlagStr(aOldFileStr,aNewFileStr:string); procedure OpreatorFile(aClear, aUpToDatabase, aDownFromDatabase, aSetToTempPath: boolean; aTempPathFileNameStrings: TStrings=nil); procedure Load; procedure Save; procedure FreeOldEVent; constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure CreateAllItems; procedure ClearAllItems; procedure OpenRowNum; procedure CloseRowNum; property LinkGrid: TcxGrid read GetLinkGrid; property IsLoadViewProperty :boolean read FIsLoadViewProperty ; property IsLoadViewStyleSheets :boolean read FIsLoadViewStyleSheets ; property IsLoadViewSetColor :boolean read FIsLoadViewSetColor ; property IsLoadViewOtherSet :boolean read FIsLoadViewOtherSet ; procedure PubColumnGetCellHint( Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint; var AHintText: TCaption; var AIsHintMultiLine: Boolean; var AHintTextRect: TRect); { Public declarations } published property Hide: Boolean read FHide write FHide; property LinkTableView: TcxGridTableView read FLinkTableView write SetLinkTableView; property VisableItem: TABcxGridPopupMenuVisableItems read FVisableItem write FVisableItem; property VisableOtherItem: TABcxGridPopupMenuVisableOtherItems read FVisableOtherItem write FVisableOtherItem; property AutoApplyBestFit: Boolean read FAutoApplyBestFit write FAutoApplyBestFit; property AutoCreateAllItem: Boolean read FAutoCreateAllItem write FAutoCreateAllItem; property SaveFlagStr: string read FSaveFlagStr write FSaveFlagStr; property SaveLongFlagStr: string read FSaveLongFlagStr write FSaveLongFlagStr; { Published declarations } end; //cxDBPivotGrid 交叉表的右键菜单 TABcxDBPivotGridPopupMenu= class(TPopupMenu ) private FLinkcxDBPivotGrid: TcxDBPivotGrid; FSaveFlagStr: string; FIsLoadViewProperty: boolean; FSaveLongFlagStr: string; procedure PopupMenu_OpenDesign(Sender: TObject); procedure PopupMenu_CloseDesign(Sender: TObject); procedure PopupMenu_CloseDesignAndSaveSetup(Sender: TObject); procedure PopupMenu_SaveSetup(Sender: TObject); //输出 procedure PopupMenu_OutExcel(Sender: TObject); procedure PopupMenu_OutXML(Sender: TObject); procedure PopupMenu_OutText(Sender: TObject); procedure PopupMenu_OutHtml(Sender: TObject); procedure OutFile(aOutFileType: TABOutFileType); function GetFilename(aStrFlag:string): string; procedure PopupMenu_ClearSetup(Sender: TObject); procedure SetLinkcxDBPivotGrid(const Value: TcxDBPivotGrid); procedure PopupMenu_SaveSetupAndToDatabase(Sender: TObject); procedure PopupMenu_Down(Sender: TObject); protected procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure DoPopup(Sender: TObject); override; procedure CreatePopupMenu; procedure DestroyPopupMenu; procedure LoadViewProperty; procedure SaveViewProperty; { Protected declarations } public //通过FileStr来修改相关配制名称 procedure ChangeFileNameBySaveFlagStr(aOldFileStr,aNewFileStr:string); procedure OpreatorFile(aClear, aUpToDatabase, aDownFromDatabase, aSetToTempPath: boolean; aTempPathFileNameStrings: TStrings=nil); procedure Load; procedure Save; constructor Create(AOwner: TComponent); override; destructor Destroy; override; property IsLoadViewProperty :boolean read FIsLoadViewProperty ; { Public declarations } published property LinkcxDBPivotGrid: TcxDBPivotGrid read FLinkcxDBPivotGrid write SetLinkcxDBPivotGrid; property SaveFlagStr: string read FSaveFlagStr write FSaveFlagStr; property SaveLongFlagStr: string read FSaveLongFlagStr write FSaveLongFlagStr; { Published declarations } end; procedure Register; implementation var FLoadViewOtherSetStrings1, FLoadViewOtherSetStrings2 :TStrings; FSaveFileNames:array[0..4] of string=('_StyleSheets.ini','_ColorSet.ini','_Property.ini','_OtherSet.ini','_CaleColumnSQL.ini'); { TABcxGridPopupMenu } procedure TABcxGridPopupMenu.CloseRowNum; begin SetIndicator(false); end; constructor TABcxGridPopupMenu.Create(AOwner: TComponent); begin inherited; FAutoApplyBestFit:=true; FAutoCreateAllItem:=true; FSaveFlagStr:=emptystr; FSaveLongFlagStr:=emptystr; FVisableItem:= [ viAscDesc, viAggregtes, viAlign, viOutFile, viShowGroup,viShowHintCloum,viBestColumWidth,viAutoRowHeight,viAutoColumWidth,viShowFilter, viBand, viColum, viFigure,viColorSetup,viPrint,viSaveSetup,viSaveSetupAndToDatabase,viClearSetup,viRefreshLoad]; FVisableOtherItem:= [ viOtherSelect, viOtherCreateAllItems, viOtherAutoSumNum, viOtherShowConfluence, viOtherShowHeader, viOtherFocusCellOnTab, viOtherGoToNextCellOnEnter, viOtherDirectionKeyMoveColumn, viOtherColumnsQuickCustomization, viOtherColumnFiltering, viOtherColumnHorzSizing, viOtherDataRowSizing, viOtherIndicator, viOtherAutoDataSetFilter, viOtherDisplayFormat , viOtherControlFields , viOtherTableViewCanEdit, viOtherFullExpand, viOtherFullCollapse ]; AutoHotkeys:=maManual; FStyleList:=TStringList.Create; FColumnsOnGetDataText:=TStringList.Create; FIndicatorCellCustomDraw:=TStringList.Create; FCellCustomDraw:=TStringList.Create; FStyleRepository:=TcxStyleRepository.Create(nil); if (AOwner is TcxGridTableView) then LinkTableView:=TcxGridTableView(AOwner); end; procedure TABcxGridPopupMenu.CreatePopupMenu; var tempMenuItem:TMenuItem; begin if (Assigned(items)) and (items.Count<=0) then begin //**********************排序************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Asc'; tempMenuItem.Caption:=('升序'); tempMenuItem.GroupIndex:=1; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Asc; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Desc'; tempMenuItem.Caption:=('降序'); tempMenuItem.GroupIndex:=1; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Desc; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_DelAscORDesc'; tempMenuItem.Caption:=('不排序'); tempMenuItem.GroupIndex:=1; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_DelAscORDesc; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); //**********************根据本列************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('根据本列'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Count'; tempMenuItem.Caption:=('记录条数'); tempMenuItem.GroupIndex:=2; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Count; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Sum'; tempMenuItem.Caption:=('总计'); tempMenuItem.GroupIndex:=2; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Sum; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Max'; tempMenuItem.Caption:=('最大值'); tempMenuItem.GroupIndex:=2; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Max; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Min'; tempMenuItem.Caption:=('最小值'); tempMenuItem.GroupIndex:=2; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Min; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Avg'; tempMenuItem.Caption:=('平均值'); tempMenuItem.GroupIndex:=2; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_Avg; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_empty'; tempMenuItem.Caption:=('无'); tempMenuItem.GroupIndex:=2; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_empty; Items[Items.Count-1].Add(tempMenuItem); //**********************对齐************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('数据对齐'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AlignLeft'; tempMenuItem.Caption:=('左对齐'); tempMenuItem.GroupIndex:=3; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_AlignLeft; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AlignRight'; tempMenuItem.Caption:=('右对齐'); tempMenuItem.GroupIndex:=3; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_AlignRight; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AlignCenter'; tempMenuItem.Caption:=('居中对齐'); tempMenuItem.GroupIndex:=3; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_AlignCenter; Items[Items.Count-1].Add(tempMenuItem); //**********************输出到文件************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('输出到文件'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Excel'; tempMenuItem.Caption:='Excel'; tempMenuItem.OnClick:=PopupMenu_OutExcel; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_XML'; tempMenuItem.Caption:='XML'; tempMenuItem.OnClick:=PopupMenu_OutXML; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Text'; tempMenuItem.Caption:='Text'; tempMenuItem.OnClick:=PopupMenu_OutText; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Html'; tempMenuItem.Caption:='Html'; tempMenuItem.OnClick:=PopupMenu_OutHtml; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); //**********************显示分组框************************** //**********************选择列************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowHintCloum'; tempMenuItem.Caption:=('选择列'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_ShowHintCloum; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowGroup'; tempMenuItem.Caption:=('显示分组框'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_ShowGroup; Items.Add(tempMenuItem); //**********************最佳列宽************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_BestColumWidth'; tempMenuItem.Caption:=('最佳列宽'); tempMenuItem.OnClick:=PopupMenu_BestColumWidth; Items.Add(tempMenuItem); //***********************整页显示************************* tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AutoColumWidth'; tempMenuItem.Caption:=('整页显示'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_AutoColumWidth; Items.Add(tempMenuItem); //**********************自动行高************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AutoRowHeight'; tempMenuItem.Caption:=('自动行高'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_AutoRowHeight; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); //**********************过滤************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AllFilter'; tempMenuItem.Caption:=('全文检索'); tempMenuItem.OnClick:=PopupMenu_AllFilter; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_FilterRow'; tempMenuItem.Caption:=('显示过滤行'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_FilterRow; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowFilter'; tempMenuItem.Caption:=('显示过滤视窗'); tempMenuItem.OnClick:=PopupMenu_ShowFilter; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('过滤栏显示方式'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowFilter_fvAlways'; tempMenuItem.Caption:= '总是显示' ; tempMenuItem.GroupIndex:=6 ; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_ShowFilter_fvAlways; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowFilter_fvNever'; tempMenuItem.Caption:= '总是不显示' ; tempMenuItem.GroupIndex:=6 ; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_ShowFilter_fvNever; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowFilter_fvNonEmpty'; tempMenuItem.Caption:= '有过滤时显示' ; tempMenuItem.GroupIndex:=6 ; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_ShowFilter_fvNonEmpty; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); //**********************Band操作************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('表头'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AddBand'; tempMenuItem.Caption:=('增加表头'); tempMenuItem.OnClick:=PopupMenu_AddBand; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_DelBand'; tempMenuItem.Caption:=('删除表头'); tempMenuItem.OnClick:=PopupMenu_DelBand; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_EditBand'; tempMenuItem.Caption:=('修改表头'); tempMenuItem.OnClick:=PopupMenu_EditBand; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('设置位置'); Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_SetBandPositionfkLeft'; tempMenuItem.Caption:='fkLeft'; tempMenuItem.GroupIndex:=5; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_SetBandPositionfkLeft; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_SetBandPositionfkRight'; tempMenuItem.Caption:='fkRight'; tempMenuItem.GroupIndex:=5; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_SetBandPositionfkRight; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_SetBandPositionfkNone'; tempMenuItem.Caption:='fkNone'; tempMenuItem.GroupIndex:=5; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_SetBandPositionfkNone; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ShowBandHeaders'; tempMenuItem.Caption:=('显示表头'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_ShowBandHeaders; Items[Items.Count-1].Add(tempMenuItem); //**********************计算列操作************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('计算列'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_AddColum'; tempMenuItem.Caption:=('新增计算列'); tempMenuItem.OnClick:=PopupMenu_AddColum; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_DelColum'; tempMenuItem.Caption:=('删除计算列'); tempMenuItem.OnClick:=PopupMenu_DelColum; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_EditColum'; tempMenuItem.Caption:=('修改计算列'); tempMenuItem.OnClick:=PopupMenu_EditColum; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); //**********************图形分析************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Figure'; tempMenuItem.Caption:=('图形分析'); tempMenuItem.OnClick:=PopupMenu_Figure; Items.Add(tempMenuItem); //**********************配色与打印设置************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ColorSetup'; tempMenuItem.Caption:=('配色设置'); tempMenuItem.OnClick:=PopupMenu_ColorSetup; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_SaveSetup'; tempMenuItem.Caption:=('在本机保存所有设置'); tempMenuItem.OnClick:=PopupMenu_SaveSetup; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_DoBitWidth_AutoWidth_Save'; tempMenuItem.Caption:=('1.最佳列宽 2.整页显示 3.保存设置'); tempMenuItem.OnClick:=PopupMenu_DoBitWidth_AutoWidth_Save; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_DoBitWidth_AutoWidth_Sum_Save'; tempMenuItem.Caption:=('1.最佳列宽 2.整页显示 3.汇总 4.保存设置'); tempMenuItem.OnClick:=PopupMenu_DoBitWidth_AutoWidth_Sum_Save; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_SaveSetupAndToDatabase'; tempMenuItem.Caption:=('1.保存设置 2.上传到服务器'); tempMenuItem.OnClick:=PopupMenu_SaveSetupAndToDatabase; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_DoBitWidth_AutoWidth_Sum_SaveAndToDatabase'; tempMenuItem.Caption:=('1.最佳列宽 2.整页显示 3.汇总 4.保存设置 5.上传到服务器'); tempMenuItem.OnClick:=PopupMenu_DoBitWidth_AutoWidth_Sum_SaveAndToDatabase; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_ClearSetup'; tempMenuItem.Caption:=('删除设置文件(重加载时有效)'); tempMenuItem.OnClick:=PopupMenu_ClearSetup; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Down'; tempMenuItem.Caption:=('重新下载设置文件(重加载时有效)'); tempMenuItem.OnClick:=PopupMenu_Down; Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items.Add(tempMenuItem); //**********************其它************************** tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_Other'; tempMenuItem.Caption:=('其它'); Items.Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('选择'); Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherSelectCellSelect'; tempMenuItem.Caption:=('可单元格选择'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherSelectCellSelect; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherSelectRowSelect'; tempMenuItem.Caption:=('单行选择'); tempMenuItem.GroupIndex:=4; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherSelectRowSelect; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherSelectMultiRowSelect'; tempMenuItem.Caption:=('多行选择'); tempMenuItem.GroupIndex:=4; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherSelectMultiRowSelect; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherSelectCellsSelect'; tempMenuItem.Caption:=('多行单元格选择'); tempMenuItem.GroupIndex:=4; tempMenuItem.RadioItem:=true; tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherSelectCellsSelect; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherCreateAllItems'; tempMenuItem.Caption:=('重建所有列'); tempMenuItem.OnClick:=PopupMenu_OtherCreateAllItems; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherAutoSumNum'; tempMenuItem.Caption:=('自动汇总数值'); tempMenuItem.OnClick:=PopupMenu_OtherAutoSumNum; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherShowConfluence'; tempMenuItem.Caption:=('显示汇总栏'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherShowConfluence; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherShowHeader'; tempMenuItem.Caption:=('显示标题栏'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherShowHeader; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherFocusCellOnTab'; tempMenuItem.Caption:=('Tab键移动单元格'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherFocusCellOnTab; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherGoToNextCellOnEnter'; tempMenuItem.Caption:=('Enter键移动单元格'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherGoToNextCellOnEnter; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherDirectionKeyMoveColumn'; tempMenuItem.Caption:=('方向键移动单元格'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherDirectionKeyMoveColumn; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherColumnsQuickCustomization'; tempMenuItem.Caption:=('快速选择/隐藏列'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherColumnsQuickCustomization; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherColumnFiltering'; tempMenuItem.Caption:=('打开列过滤'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherColumnFiltering; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherColumnHorzSizing'; tempMenuItem.Caption:=('列宽可更改'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherColumnHorzSizing; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherDataRowSizing'; tempMenuItem.Caption:=('行高可更改'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherDataRowSizing; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherIndicator'; tempMenuItem.Caption:=('自动行号'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherIndicator; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherAutoDataSetFilter'; tempMenuItem.Caption:=('过滤时与数据集同步'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherAutoDataSetFilter; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherDisplayFormat'; tempMenuItem.Caption:=('显示格式'); tempMenuItem.OnClick:=PopupMenu_OtherDisplayFormat; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherFullExpand'; tempMenuItem.Caption:=('全部展开分组'); tempMenuItem.OnClick:=PopupMenu_OtherFullExpand ; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherFullCollapse'; tempMenuItem.Caption:=('全部收缩分组'); tempMenuItem.OnClick:=PopupMenu_OtherFullCollapse; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:=('框架控制(重加载时有效)'); Items[Items.Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Caption:='-'; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherControlField_ABUseDBlClick'; tempMenuItem.AutoCheck:=true; tempMenuItem.Caption:=('双击时显示DBPanel'); tempMenuItem.OnClick:=PopupMenu_OtherControlField_ABUseDBlClick; Items[Items.Count-1].Items[Items[Items.Count-1].Count-1].Add(tempMenuItem); tempMenuItem:=TMenuItem.Create(self); tempMenuItem.Name:='PopupMenu_OtherTableViewCanEdit'; tempMenuItem.Caption:=('表格能编辑'); tempMenuItem.AutoCheck:=true; tempMenuItem.OnClick:=PopupMenu_OtherTableViewCanEdit; Items[Items.Count-1].Add(tempMenuItem); end; end; procedure TABcxGridPopupMenu.SetLinkTableView(const Value: TcxGridTableView); begin FLinkTableView := Value; if Assigned(FLinkTableView) then FLinkTableView.PopupMenu:=self; end; destructor TABcxGridPopupMenu.Destroy; begin FreeOldEVent; FreeStyleList; FColumnsOnGetDataText.Free; FIndicatorCellCustomDraw.Free; FCellCustomDraw.Free; DestroyPopupMenu; FStyleRepository.Free; if Assigned(ColorSetupForm) then ColorSetupForm.free; inherited; end; procedure TABcxGridPopupMenu.FreeOldEVent; begin FreeOldEVent_FColumnsOnGetDataText; FreeOldEVent_FIndicatorCellCustomDraw; FreeOldEVent_FCellCustomDraw; end; procedure TABcxGridPopupMenu.FreeOldEVent_FColumnsOnGetDataText; var i:LongInt; tempColumnName:string; begin if (Assigned(FLinkTableView)) and (Assigned(FColumnsOnGetDataText)) then begin for i := (FColumnsOnGetDataText.Count - 1) downto 0 do begin tempColumnName:=PColumnGetDataTextEvent(FColumnsOnGetDataText.Objects[i]).ColumnName; if (tempColumnName<>EmptyStr) and (Assigned(ABGetColumnByName(tempColumnName,FLinkTableView))) then begin PColumnGetDataTextEvent(FColumnsOnGetDataText.Objects[i]).Self.OnGetDataText:= PColumnGetDataTextEvent(FColumnsOnGetDataText.Objects[i]).FOldColumnGetDataText; end; Dispose(Pointer(FColumnsOnGetDataText.Objects[i])); end; FColumnsOnGetDataText.Clear; end; end; procedure TABcxGridPopupMenu.FreeStyleList; var i:LongInt; begin for i := (FStyleList.Count - 1) downto 0 do begin if Assigned(FStyleList.Objects[i]) then begin TcxStyle(FStyleList.Objects[i]).Free; end; end; FStyleList.Clear; FStyleList.Free; end; function TABcxGridPopupMenu.GetLinkGrid: TcxGrid; begin result:= nil; if (Assigned(FLinkTableView)) and (Assigned(FLinkTableView.Control)) then result:= TcxGrid(FLinkTableView.Control); end; function TABcxGridPopupMenu.GetStyleByColor(aColor:string):TcxStyle; var i:LongInt; begin Result:=nil; i:=FStyleList.IndexOf(aColor); if i>=0 then Result:= TcxStyle(FStyleList.Objects[i]); if not Assigned(Result) then begin Result := TcxStyle.Create(Self); Result.TextColor :=StrToIntDef(aColor,0); FStyleList.AddObject(aColor,Result); end; end; procedure TABcxGridPopupMenu.FreeOldEVent_FIndicatorCellCustomDraw; var i:LongInt; begin if (Assigned(FLinkTableView)) and (Assigned(FIndicatorCellCustomDraw)) then begin for i := (FIndicatorCellCustomDraw.Count - 1) downto 0 do begin PIndicatorCellCustomDrawEvent(FIndicatorCellCustomDraw.Objects[i]).Self.OnCustomDrawIndicatorCell:= PIndicatorCellCustomDrawEvent(FIndicatorCellCustomDraw.Objects[i]).FOldIndicatorCellCustomDraw; Dispose(Pointer(FIndicatorCellCustomDraw.Objects[i])); end; FIndicatorCellCustomDraw.Clear; end; end; procedure TABcxGridPopupMenu.FreeOldEVent_FCellCustomDraw; var i:LongInt; begin if (Assigned(FLinkTableView)) and (Assigned(FCellCustomDraw)) then begin for i := (FCellCustomDraw.Count - 1) downto 0 do begin PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.OnCustomDrawCell:= PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).FOldCellCustomDraw; if Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.Styles) then PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.Styles.OnGetContentStyle:= PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).FOldStylesGetContentStyle; if (Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController)) and (Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController.Summary)) and (Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController.Summary.FooterSummaryItems)) then PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController.Summary.FooterSummaryItems.OnSummary:= PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).FOldSummary; if (Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController)) and (Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController.Summary)) and (Assigned(PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController.Summary.DefaultGroupSummaryItems)) then PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).Self.DataController.Summary.DefaultGroupSummaryItems.OnSummary:= PCellCustomDrawEvent(FCellCustomDraw.Objects[i]).FOldGroupSummary; Dispose(Pointer(FCellCustomDraw.Objects[i])); end; FCellCustomDraw.Clear; end; end; procedure TABcxGridPopupMenu.DestroyPopupMenu; var i:longint; begin for i := Items.Count-1 downto 0 do begin Items[0].Clear; end; end; procedure TABcxGridPopupMenu.SetMenuVisible_FalseByVisableItem; begin if not (viAscDesc in FVisableItem) then begin Items.Find(('升序') ).Visible:=false; Items.Find(('降序') ).Visible:=false; Items.Find(('不排序') ).Visible:=false; end; if not (viAggregtes in FVisableItem) then begin Items.Find(('根据本列') ).Visible:=false; end; if not (viAlign in FVisableItem) then begin Items.Find(('数据对齐') ).Visible:=false; end; if not (viOutFile in FVisableItem) then begin Items.Find(('输出到文件') ).Visible:=false; end; if not (viShowGroup in FVisableItem) then begin Items.Find(('显示分组框')).Visible:=false; end; if not (viShowHintCloum in FVisableItem) then begin Items.Find(('选择列')).Visible:=false; end; if not (viBestColumWidth in FVisableItem) then begin Items.Find(('最佳列宽')).Visible:=false; end; if not (viAutoRowHeight in FVisableItem) then begin Items.Find(('自动行高')).Visible:=false; end; if not (viAutoColumWidth in FVisableItem) then begin Items.Find(('整页显示')).Visible:=false; end; if not (viShowFilter in FVisableItem) then begin Items.Find(('全文检索')).Visible:=false; Items.Find(('显示过滤行')).Visible:=false; Items.Find(('显示过滤视窗')).Visible:=false; Items.Find(('过滤栏显示方式')).Visible:=false; end; if not (viBand in FVisableItem) then begin Items.Find(('表头') ).Visible:=false; end; if not (viColum in FVisableItem) then begin Items.Find(('计算列')).Visible:=false; end; if not (viFigure in FVisableItem) then begin Items.Find(('图形分析')).Visible:=false; end; if not (viColorSetup in FVisableItem) then begin Items.Find(('配色设置')).Visible:=false; end; if not (viSaveSetup in FVisableItem) then begin Items.Find(('保存所有设置')).Visible:=false; Items.Find(('1.最佳列宽 2.整页显示 3.汇总 4.保存设置')).Visible:=false; end; if (not (viSaveSetupAndToDatabase in FVisableItem)) then begin Items.Find(('1.保存设置 2.上传到服务器')).Visible:=false; Items.Find(('1.最佳列宽 2.整页显示 3.汇总 4.保存设置 5.上传到服务器')).Visible:=false; end; if not (viClearSetup in FVisableItem) then begin Items.Find(('删除设置文件(重加载时有效)')).Visible:=false; Items.Find(('重新下载设置文件(重加载时有效)')).Visible:=false; end; if not (viOtherSelect in FVisableOtherItem) then begin Items.Find(('其它')).Find(('选择')).Visible:=false; end; if not (viOtherCreateAllItems in FVisableOtherItem) then begin Items.Find(('其它')).Find(('重建所有列')).Visible:=false; end; if not (viOtherAutoSumNum in FVisableOtherItem) then begin Items.Find(('其它')).Find(('自动汇总数值')).Visible:=false; end; if not (viOtherShowConfluence in FVisableOtherItem) then begin Items.Find(('其它')).Find(('显示汇总栏')).Visible:=false; end; if not (viOtherShowHeader in FVisableOtherItem) then begin Items.Find(('其它')).Find(('显示标题栏')).Visible:=false; end; if not (viOtherFocusCellOnTab in FVisableOtherItem) then begin Items.Find(('其它')).Find(('Tab键移动单元格')).Visible:=false; end; if not (viOtherGoToNextCellOnEnter in FVisableOtherItem) then begin Items.Find(('其它')).Find(('Enter键移动单元格')).Visible:=false; end; if not (viOtherDirectionKeyMoveColumn in FVisableOtherItem) then begin Items.Find(('其它')).Find(('方向键移动单元格')).Visible:=false; end; if not (viOtherColumnsQuickCustomization in FVisableOtherItem) then begin Items.Find(('其它')).Find(('快速选择/隐藏列')).Visible:=false; end; if not (viOtherColumnFiltering in FVisableOtherItem) then begin Items.Find(('其它')).Find(('打开列过滤')).Visible:=false; end; if not (viOtherColumnHorzSizing in FVisableOtherItem) then begin Items.Find(('其它')).Find(('列宽可更改')).Visible:=false; end; if not (viOtherDataRowSizing in FVisableOtherItem) then begin Items.Find(('其它')).Find(('行高可更改')).Visible:=false; end; if not (viOtherIndicator in FVisableOtherItem) then begin Items.Find(('其它')).Find(('自动行号')).Visible:=false; end; if not (viOtherAutoDataSetFilter in FVisableOtherItem) then begin Items.Find(('其它')).Find(('过滤时与数据集同步')).Visible:=false; end; if not (viOtherDisplayFormat in FVisableOtherItem) then begin Items.Find(('其它')).Find(('显示格式')).Visible:=false; end; if not (viOtherFullExpand in FVisableOtherItem) then begin Items.Find(('其它')).Find(('全部展开分组')).Visible:=false; end; if not (viOtherFullCollapse in FVisableOtherItem) then begin Items.Find(('其它')).Find(('全部收缩分组')).Visible:=false; end; Items.Find(('其它')).Find(('框架控制(重加载时有效)')).Visible:=false; Items.Find(('其它')).Find(('表格能编辑')).Visible:=false; end; procedure TABcxGridPopupMenu.DoPopup(Sender: TObject); var tempSummaryItem:TcxGridTableSummaryItem; tempField:Tfield; tempProperties:TcxCustomEditProperties; begin inherited; if (not Assigned(FLinkTableView)) then exit; CreatePopupMenu; if not (FLinkTableView is TcxGridTableView) then begin SetMenuProperty(Self,'Visible','false'); exit; end; SetMenuProperty(Self,'Enabled','true'); SetMenuProperty(Self,'Visible','true'); SetMenuVisible_FalseByVisableItem; if (Assigned(FLinkTableView)) and (Assigned(FLinkTableView.Controller)) then begin if (Assigned(FLinkTableView.Controller.FocusedColumn)) then begin Items.Find(('升序') ).Checked:=FLinkTableView.Controller.FocusedColumn.SortOrder=cxCustomData.soascending; Items.Find(('降序') ).Checked:=FLinkTableView.Controller.FocusedColumn.SortOrder=cxCustomData.soDescending; Items.Find(('不排序') ).Checked:=FLinkTableView.Controller.FocusedColumn.SortOrder=cxCustomData.soNone; tempSummaryItem:=TcxGridTableSummaryItem(FLinkTableView.DataController.Summary.FooterSummaryItems.ItemOfItemLink(FLinkTableView.Controller.FocusedColumn)); Items.Find(('根据本列') ).Find(('记录条数')).Checked :=(Assigned(tempSummaryItem)) and (tempSummaryItem.Kind=skCount); Items.Find(('根据本列') ).Find(('总计') ).Checked :=(Assigned(tempSummaryItem)) and (tempSummaryItem.Kind=skSum); Items.Find(('根据本列') ).Find(('最大值')).Checked :=(Assigned(tempSummaryItem)) and (tempSummaryItem.Kind=skMax); Items.Find(('根据本列') ).Find(('最小值')).Checked :=(Assigned(tempSummaryItem)) and (tempSummaryItem.Kind=skMin); Items.Find(('根据本列') ).Find(('平均值')).Checked :=(Assigned(tempSummaryItem)) and (tempSummaryItem.Kind=skAverage); Items.Find(('根据本列') ).Find(('无') ).Checked :=(not (Assigned(tempSummaryItem))) or ((Assigned(tempSummaryItem)) and (tempSummaryItem.Kind=skNone)); tempField:=ABGetFocusedColumnField(FLinkTableView); if (not assigned(tempField)) or (not (tempField.DataType in ABNumDataType)) then begin Items.Find(('根据本列') ).Find(('总计' )).Enabled:=false; Items.Find(('根据本列') ).Find(('最大值')).Enabled:=false; Items.Find(('根据本列') ).Find(('最小值')).Enabled:=false; Items.Find(('根据本列') ).Find(('平均值')).Enabled:=false; end; if (FLinkTableView is TcxGridDBBandedTableView) then begin Items.Find(('表头') ).Find(('显示表头')).Checked:=TcxGridDBBandedTableView(FLinkTableView).OptionsView.BandHeaders; Items.Find(('表头') ).Find(('设置位置')).Find('fkLeft').Checked:=TcxGridDBBandedColumn (FLinkTableView.Controller.FocusedColumn).Position.Band.FixedKind =fkLeft ; Items.Find(('表头') ).Find(('设置位置')).Find('fkRight').Checked:=TcxGridDBBandedColumn (FLinkTableView.Controller.FocusedColumn).Position.Band.FixedKind=fkRight; Items.Find(('表头') ).Find(('设置位置')).Find('fkNone').Checked:=TcxGridDBBandedColumn (FLinkTableView.Controller.FocusedColumn).Position.Band.FixedKind=fkNone; end else begin Items.Find(('表头') ).Find(('增加表头')).Enabled:=false; Items.Find(('表头') ).Find(('修改表头')).Enabled:=false; Items.Find(('表头') ).Find(('删除表头')).Enabled:=false; Items.Find(('表头') ).Find(('设置位置')).Find('fkLeft').Enabled:=false; Items.Find(('表头') ).Find(('设置位置')).Find('fkRight').Enabled:=false; Items.Find(('表头') ).Find(('设置位置')).Find('fkNone').Enabled:=false; Items.Find(('表头') ).Find(('显示表头')).Enabled:=false; end; Items.Find(('计算列') ).Find(('修改计算列' )).Enabled:=ABIsCaleColumn(FLinkTableView.Controller.FocusedColumn); tempProperties:=FLinkTableView.Controller.FocusedColumn.Properties; if (Assigned(tempProperties)) then begin Items.Find(('其它')).Find(('显示格式')).Enabled:=True; Items.Find(('数据对齐') ).Find(('左对齐' )).Checked:=FLinkTableView.Controller.FocusedColumn.Properties.Alignment.Horz=taLeftJustify; Items.Find(('数据对齐') ).Find(('右对齐' )).Checked:=FLinkTableView.Controller.FocusedColumn.Properties.Alignment.Horz=taRightJustify; Items.Find(('数据对齐') ).Find(('居中对齐' )).Checked:=FLinkTableView.Controller.FocusedColumn.Properties.Alignment.Horz=taCenter; if ((tempProperties is TcxCustomTextEditProperties)) then begin Items.Find(('其它')).Find(('显示格式')).Checked:=TcxCustomTextEditProperties(tempProperties).DisplayFormat<>emptystr; end else begin Items.Find(('其它')).Find(('显示格式')).Enabled:=false; end; end else begin Items.Find(('数据对齐') ).Find(('左对齐' )).Enabled:=False; Items.Find(('数据对齐') ).Find(('右对齐' )).Enabled:=False; Items.Find(('数据对齐') ).Find(('居中对齐' )).Enabled:=False; Items.Find(('其它')).Find(('显示格式')).Enabled:=false; end; end else begin Items.Find(('升序' )).Enabled:=false; Items.Find(('降序' )).Enabled:=false; Items.Find(('不排序' )).Enabled:=false; Items.Find(('根据本列')).Enabled:=false; Items.Find(('数据对齐')).Enabled:=false; Items.Find(('表头')).Enabled:=false; Items.Find(('计算列')).Enabled:=false; end; Items.Find(('显示过滤行')).Checked:=FLinkTableView.FilterRow.Visible; Items.Find(('过滤栏显示方式') ).Find('总是不显示' ).Checked:=FLinkTableView.FilterBox.Visible=fvNever ; Items.Find(('过滤栏显示方式') ).Find('有过滤时显示' ).Checked:=FLinkTableView.FilterBox.Visible=fvNonEmpty; Items.Find(('过滤栏显示方式') ).Find('总是显示' ).Checked:=FLinkTableView.FilterBox.Visible=fvAlways ; Items.Find(('显示分组框')).Checked:=FLinkTableView.OptionsView.GroupByBox; Items.Find(('选择列')).Checked:=FLinkTableView.Controller.Customization; Items.Find(('整页显示')).Checked:=FLinkTableView.OptionsView.ColumnAutoWidth; Items.Find(('自动行高')).Checked:=(FLinkTableView.OptionsView.CellAutoHeight) and (FLinkTableView.OptionsView.DataRowHeight=0); Items.Find(('其它')).Find(('显示汇总栏')).Checked :=FLinkTableView.OptionsView.Footer; Items.Find(('其它')).Find(('显示标题栏')).Checked :=FLinkTableView.OptionsView.Header; Items.Find(('其它')).Find(('选择')).Find(('可单元格选择')).Checked :=FLinkTableView.OptionsSelection.CellSelect; Items.Find(('其它')).Find(('选择')).Find(('单行选择' )).Checked :=not FLinkTableView.OptionsSelection.MultiSelect; Items.Find(('其它')).Find(('选择')).Find(('多行选择' )).Checked :=FLinkTableView.OptionsSelection.MultiSelect and (not FLinkTableView.OptionsSelection.CellMultiSelect); Items.Find(('其它')).Find(('选择')).Find(('多行单元格选择' )).Checked:=FLinkTableView.OptionsSelection.CellMultiSelect; Items.Find(('其它')).Find(('Tab键移动单元格')).Checked :=FLinkTableView.OptionsBehavior.FocusCellOnTab; Items.Find(('其它')).Find(('Enter键移动单元格')).Checked :=FLinkTableView.OptionsBehavior.GoToNextCellOnEnter; Items.Find(('其它')).Find(('方向键移动单元格')).Checked :=FLinkTableView.OptionsBehavior.AlwaysShowEditor; Items.Find(('其它')).Find(('快速选择/隐藏列')).Checked :=FLinkTableView.OptionsCustomize.ColumnsQuickCustomization; Items.Find(('其它')).Find(('列宽可更改')).Checked :=FLinkTableView.OptionsCustomize.ColumnHorzSizing; Items.Find(('其它')).Find(('行高可更改')).Checked :=FLinkTableView.OptionsCustomize.DataRowSizing; Items.Find(('其它')).Find(('打开列过滤')).Checked :=FLinkTableView.OptionsCustomize.ColumnFiltering; Items.Find(('其它')).Find(('自动行号')).Checked :=Assigned(FLinkTableView.OnCustomDrawIndicatorCell); Items.Find(('其它')).Find(('过滤时与数据集同步')).Checked :=ABGetPropValue(FLinkTableView.DataController.Filter,'AutoDataSetFilter',False); Items.Find(('其它')).Find(('表格能编辑')).Checked :=FLinkTableView.OptionsData.Editing; Items.Find(('其它')).Find(('框架控制(重加载时有效)')). Find(('双击时显示DBPanel')).Checked:=ABStrToBool(VarToStrDef(ABGetPropValue(FLinkTableView,'ABUseDBlClick'),'')); end else begin SetMenuProperty(Self,'Enabled','false'); end; end; procedure TABcxGridPopupMenu.PopupMenu_AutoColumWidth(Sender: TObject); begin FLinkTableView.OptionsView.ColumnAutoWidth:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_AutoRowHeight(Sender: TObject); begin if TMenuItem(Sender).Checked then begin FLinkTableView.OptionsView.CellAutoHeight:=true; FLinkTableView.OptionsView.DataRowHeight:=0; end else begin FLinkTableView.OptionsView.CellAutoHeight:=false; FLinkTableView.OptionsView.DataRowHeight:=18; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherSelectRowSelect(Sender: TObject); begin if TMenuItem(Sender).Checked then begin FLinkTableView.OptionsSelection.CellMultiSelect:=false; FLinkTableView.OptionsSelection.MultiSelect:=false; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherSelectMultiRowSelect(Sender: TObject); begin if TMenuItem(Sender).Checked then begin FLinkTableView.OptionsSelection.CellMultiSelect:=false; FLinkTableView.OptionsSelection.MultiSelect:=true; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherSelectCellSelect(Sender: TObject); begin if TMenuItem(Sender).Checked then FLinkTableView.OptionsSelection.CellMultiSelect:=false; FLinkTableView.OptionsSelection.CellSelect:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherSelectCellsSelect(Sender: TObject); begin if TMenuItem(Sender).Checked then begin FLinkTableView.OptionsSelection.CellMultiSelect:=true; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherColumnFiltering(Sender: TObject); begin FLinkTableView.OptionsCustomize.ColumnFiltering:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherColumnHorzSizing(Sender: TObject); begin FLinkTableView.OptionsCustomize.ColumnHorzSizing:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherColumnsQuickCustomization( Sender: TObject); begin FLinkTableView.OptionsCustomize.ColumnsQuickCustomization:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherControlField_ABUseDBlClick(Sender: TObject); var tempDatasource:TDataSource; begin if (not Assigned(FLinkTableView)) then exit; if AnsiCompareText(FLinkTableView.ClassName,'TABcxGridDBBandedTableView')<>0 then exit; tempDatasource:=ABGetTableViewDataSource(FLinkTableView); if (not Assigned(tempDatasource)) or (not Assigned(tempDatasource.DataSet)) then exit; ABSetPropValue(FLinkTableView,'ABUseDBlClick',TMenuItem(Sender).Checked); end; procedure TABcxGridPopupMenu.PopupMenu_OtherDataRowSizing(Sender: TObject); begin FLinkTableView.OptionsCustomize.DataRowSizing:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherFocusCellOnTab(Sender: TObject); begin FLinkTableView.OptionsBehavior.FocusCellOnTab:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherGoToNextCellOnEnter( Sender: TObject); begin FLinkTableView.OptionsBehavior.GoToNextCellOnEnter:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherDirectionKeyMoveColumn( Sender: TObject); begin FLinkTableView.OptionsBehavior.AlwaysShowEditor:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherDisplayFormat(Sender: TObject); var tempstr:string; tempProperties:TcxCustomEditProperties; begin if (Assigned(FLinkTableView.Controller.FocusedColumn)) then begin tempProperties:=FLinkTableView.Controller.FocusedColumn.Properties; if (Assigned(tempProperties)) and (tempProperties is TcxCustomTextEditProperties) then begin tempstr:=TcxCustomTextEditProperties(tempProperties).DisplayFormat; if InputQuery('设置显示格式','显示格式',tempstr) then begin try TcxCustomTextEditProperties(tempProperties).DisplayFormat:=tempstr; except ShowMessage('格式设置出错['+tempstr+']'); end; end; end; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherFullCollapse(Sender: TObject); begin if (Assigned(FLinkTableView.DataController.Groups)) then begin //FLinkTableView.ViewData.Expand(False); if (FLinkTableView is TcxGridDBBandedTableView) then TcxGridDBBandedTableView(FLinkTableView).DataController.Groups.FullCollapse else if (FLinkTableView is TcxGridDBTableView) then TcxGriddbTableView(FLinkTableView).DataController.Groups.FullCollapse; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherFullExpand(Sender: TObject); begin if (Assigned(FLinkTableView.DataController.Groups)) then begin //FLinkTableView.ViewData.Expand(true); if (FLinkTableView is TcxGridDBBandedTableView) then TcxGridDBBandedTableView(FLinkTableView).DataController.Groups.FullExpand else if (FLinkTableView is TcxGridDBTableView) then TcxGriddbTableView(FLinkTableView).DataController.Groups.FullExpand; end; end; procedure TABcxGridPopupMenu.PopupMenu_OtherIndicator(Sender: TObject); begin SetIndicator(TMenuItem(Sender).Checked); end; procedure TABcxGridPopupMenu.SetIndicator(aActive: boolean); begin if aActive then PopupMenu_ExecOtherIndicator else begin FLinkTableView.OptionsView.Indicator:=false; FreeOldEVent_FIndicatorCellCustomDraw; end; end; procedure TABcxGridPopupMenu.PopupMenu_ExecOtherIndicator; var tempEvent:PIndicatorCellCustomDrawEvent; begin if FIndicatorCellCustomDraw.IndexOf(FLinkTableView.Name)<0 then begin New(tempEvent); tempEvent.Self:=FLinkTableView; tempEvent.FOldIndicatorCellCustomDraw:=FLinkTableView.OnCustomDrawIndicatorCell; FIndicatorCellCustomDraw.AddObject(FLinkTableView.Name,TObject(tempEvent)); FLinkTableView.OnCustomDrawIndicatorCell:=NewCustomDrawIndicatorCell; end; FLinkTableView.OptionsView.Indicator:=false; FLinkTableView.OptionsView.Indicator:=true; ABAutoIndicatorWidth(FLinkTableView); end; procedure TABcxGridPopupMenu.PopupMenu_OtherAutoDataSetFilter(Sender: TObject); begin if (FLinkTableView is TcxGridDBBandedTableView) then TcxGridDBBandedTableView(FLinkTableView).DataController.Filter.AutoDataSetFilter:=TMenuItem(Sender).Checked else if (FLinkTableView is TcxGridDBTableView) then TcxGriddbTableView(FLinkTableView).DataController.Filter.AutoDataSetFilter:=TMenuItem(Sender).Checked; FLinkTableView.DataController.Filter.TranslateBetween:=TMenuItem(Sender).Checked; FLinkTableView.DataController.Filter.TranslateIn:=TMenuItem(Sender).Checked; FLinkTableView.DataController.Filter.TranslateLike:=TMenuItem(Sender).Checked; end; procedure TABcxGridPopupMenu.PopupMenu_OtherCreateAllItems(Sender: TObject); begin CreateAllItems; end; procedure TABcxGridPopupMenu.ClearAllItems; begin if Assigned(FLinkTableView) then begin FreeOldEVent; FLinkTableView.BeginUpdate; try if (FLinkTableView.ColumnCount>0) then FLinkTableView.ClearItems; finally FLinkTableView.EndUpdate; end; end; end; procedure TABcxGridPopupMenu.PubColumnGetCellHint( Sender: TcxCustomGridTableItem; ARecord: TcxCustomGridRecord; ACellViewInfo: TcxGridTableDataCellViewInfo; const AMousePos: TPoint; var AHintText: TCaption; var AIsHintMultiLine: Boolean; var AHintTextRect: TRect); begin // end; procedure TABcxGridPopupMenu.CreateAllItems; begin if Assigned(FLinkTableView) then begin FreeOldEVent; FLinkTableView.BeginUpdate; try if (FLinkTableView.ColumnCount>0) then FLinkTab
【文件预览】:
cxGrid右键菜单
----ABcxGridPopupMenuG_D16.dproj.local(19KB)
----ABcxGridPopupMenuTestForm_cxGrid1DBBandedTableView1_Property.ini(2KB)
----ABcxGridPopupMenuDemoP.dproj.local(768B)
----ABcxGridPopupMenu_ColorSetupU.dfm(437KB)
----ABcxGridPopupMenu_FigureU.dfm(7KB)
----ABcxGridPopupMenuDemoU.pas(2KB)
----ABcxGridPopupMenuG_D16.identcache(785B)
----ABPubListBoxItemU.pas(2KB)
----ABcxGridPopupMenu_ColorSetupU.pas(58KB)
----ABcxGridPopupMenu_FuncU.pas(48KB)
----ABPubMemoItemU.dfm(1KB)
----ABcxGridPopupMenuDemoP.exe(8.04MB)
----ABcxGridPopupMenuU.pas(132KB)
----ABcxGridPopupMenu_AddColumU.pas(3KB)
----ABcxGridPopupMenuDemoP.res(5KB)
----ABcxGridPopupMenuTestForm_cxGrid1DBBandedTableView1_StyleSheets.ini(749B)
----ABcxGridPopupMenuDemoP.dpr(296B)
----ABcxGridPopupMenuDemoU.dfm(5KB)
----ABClientP_Set()
--------ABLocalParams.ini(226B)
--------Config()
--------temp()
--------SaveLocalTable()
--------BackLog()
--------DefaultValue()
--------AllUser()
----ABcxGridPopupMenu_FigureU.pas(12KB)
----ABPubMemoItemU.pas(1KB)
----ProjectGroup XE2.groupproj.local(501B)
----ABcxGridAndcxTreeViewSearchU.dfm(6KB)
----ABPubListBoxItemU.dfm(1KB)
----ABcxGridPopupMenuDemoP.dproj(8KB)
----ABcxGridPopupMenuG_D16.dproj(13KB)
----ABcxGridPopupMenuDemoP.identcache(174B)
----ABcxGridAndcxTreeViewSearchU.pas(5KB)
----ABcxGridPopupMenuG_D16.res(5KB)
----ABcxGridPopupMenu_AddColumU.dfm(5KB)
----ABcxGridPopupMenuDemoP_Set()
----ProjectGroup XE2.groupproj(2KB)
----ABcxGridPopupMenuG_Icon.ico(4KB)
----ABcxGridPopupMenuG_D16.dpk(2KB)
----DockForm.pas(288B)
----Data.mdb(136KB)
----ABcxGridPopupMenuTestP_Icon.ico(4KB)
----ProjectGroup XE2.dsk(13KB)