⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rm_dsggridreport.pas

📁 这是一个功能强大
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    ToolbarBorder := TRMToolbarBorder.CreateAndDock(Self, FDesignerForm.Dock971);
    ToolbarGrid := TRMToolbarGrid.CreateAndDock(Self, FDesignerForm.Dock971);
    ToolbarCellEdit := TRMToolbarCellEdit.CreateAndDock(Self, FDesignerForm.Dock971);
  end;

  procedure _CreateMainMenu;
  begin
{$IFDEF USE_TB2K}
    FMainMenu := FDesignerForm.MainMenu;
{$ELSE}
    FMainMenu := TRMMenuBar.Create(Self);
    with FMainMenu do
    begin
      Name := 'MenuBar';
      AutoHotkeys := maManual;
    end;
{$ENDIF}

    MenuEdit := TRMSubmenuItem.Create(Self);
    with MenuEdit do
    begin
      Caption := 'Edit';
{$IFDEF USE_TB2K}
      FDesignerForm.MainMenu.Items.Insert(1, MenuEdit);
{$ELSE}
      AddToMenu(FMainMenu);
{$ENDIF}
      GroupIndex := 2;
    end;
    MenuEditUndo := TRMMenuItem.Create(Self);
    with MenuEditUndo do
    begin
      ImageIndex := 8;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Undo';
      ShortCut := Menus.ShortCut(Ord('Z'), [ssCtrl]);
      OnClick := Editor_BtnUndoClick;
      AddToMenu(MenuEdit);
    end;
    MenuEditRedo := TRMMenuItem.Create(Self);
    with MenuEditRedo do
    begin
      ImageIndex := 9;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Redo';
      ShortCut := Menus.ShortCut(Ord('Z'), [ssShift, ssCtrl]);
      OnClick := Editor_BtnRedoClick;
      AddToMenu(MenuEdit);
    end;
    N12 := TRMSeparatorMenuItem.Create(Self);
    N12.AddToMenu(MenuEdit);
    MenuEditCut := TRMMenuItem.Create(Self);
    with MenuEditCut do
    begin
      ImageIndex := 5;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Cut';
      ShortCut := Menus.ShortCut(Word('X'), [ssCtrl]);
      OnClick := Editor_BtnCutClick;
      AddToMenu(MenuEdit);
    end;
    MenuEditCopy := TRMMenuItem.Create(Self);
    with MenuEditCopy do
    begin
      ImageIndex := 6;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Copy';
      ShortCut := Menus.ShortCut(Word('C'), [ssCtrl]);
      OnClick := Editor_BtnCopyClick;
      AddToMenu(MenuEdit);
    end;
    MenuEditPaste := TRMMenuItem.Create(Self);
    with MenuEditPaste do
    begin
      ImageIndex := 7;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Paste';
      ShortCut := Menus.ShortCut(Word('V'), [ssCtrl]);
      OnClick := Editor_BtnPasteClick;
      AddToMenu(MenuEdit);
    end;
    MenuEditDelete := TRMMenuItem.Create(Self);
    with MenuEditDelete do
    begin
      ImageIndex := 22;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Delete';
      ShortCut := Menus.ShortCut(VK_DELETE, [ssCtrl]);
      OnClick := MenuEditDeleteClick;
      AddToMenu(MenuEdit);
    end;
    MenuEditSelectAll := TRMMenuItem.Create(Self);
    with MenuEditSelectAll do
    begin
      ImageIndex := 12;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Select All';
      ShortCut := Menus.ShortCut(Word('A'), [ssCtrl]);
      OnClick := MenuEditSelectAllClick;
      AddToMenu(MenuEdit);
    end;
    N11 := TRMSeparatorMenuItem.Create(Self);
    N11.AddToMenu(MenuEdit);
    MenuEditCopyPage := TRMMenuItem.Create(Self);
    with MenuEditCopyPage do
    begin
      Caption := 'Copy Page';
      OnClick := MenuEditCopyPageClick;
      AddToMenu(MenuEdit);
    end;
    MenuEditPastePage := TRMMenuItem.Create(Self);
    with MenuEditPastePage do
    begin
      Caption := 'Paste Page';
      OnClick := MenuEditPastePageClick;
      AddToMenu(MenuEdit);
    end;

    MenuCell := TRMSubmenuItem.Create(Self);
    with MenuCell do
    begin
      Caption := 'Cell';
{$IFDEF USE_TB2K}
      FDesignerForm.MainMenu.Items.Insert(2, MenuCell);
{$ELSE}
      AddToMenu(FMainMenu);
{$ENDIF}
      GroupIndex := 3;
    end;
    MenuCellProperty := TRMMenuItem.Create(Self);
    with MenuCellProperty do
    begin
      ImageIndex := 27;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Prop...';
      OnClick := MenuCellPropertyClick;
      AddToMenu(MenuCell);
    end;
    MenuCellTableSize := TRMMenuItem.Create(Self);
    with MenuCellTableSize do
    begin
      ImageIndex := 10;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Column & Row...';
      OnClick := MenuCellTableSizeClick;
      AddToMenu(MenuCell);
    end;
    MenuCellRow := TRMSubmenuItem.Create(Self);
    with MenuCellRow do
    begin
      Caption := 'Row';
      AddToMenu(MenuCell);
    end;
    itmRowHeight := TRMMenuItem.Create(Self);
    with itmRowHeight do
    begin
      Caption := 'Row Height...';
      OnClick := itmRowHeightClick;
      AddToMenu(MenuCellRow);
    end;
    itmAverageRowHeight := TRMMenuItem.Create(Self);
    with itmAverageRowHeight do
    begin
      Caption := 'Average Row Height';
      OnClick := itmAverageRowHeightClick;
      AddToMenu(MenuCellRow);
    end;
    MenuCellColumn := TRMSubmenuItem.Create(Self);
    with MenuCellColumn do
    begin
      Caption := 'Column';
      AddToMenu(MenuCell);
    end;
    itmColumnHeight := TRMMenuItem.Create(Self);
    with itmColumnHeight do
    begin
      Caption := 'Column Width...';
      OnClick := itmColumnHeightClick;
      AddToMenu(MenuCellColumn);
    end;
    itmAverageColumnWidth := TRMMenuItem.Create(Self);
    with itmAverageColumnWidth do
    begin
      Caption := 'Average Column Width';
      OnClick := itmAverageColumnWidthClick;
      AddToMenu(MenuCellColumn);
    end;
    N8 := TRMSeparatorMenuItem.Create(Self);
    N8.AddToMenu(MenuCell);
    MenuCellInsertCell := TRMSubmenuItem.Create(Self);
    with MenuCellInsertCell do
    begin
      Caption := 'Insert Cell';
      AddToMenu(MenuCell);
    end;
    itmInsertCellLeft := TRMMenuItem.Create(Self);
    with itmInsertCellLeft do
    begin
      Caption := 'Left';
      AddToMenu(MenuCellInsertCell);
    end;
    itmInsertCellTop := TRMMenuItem.Create(Self);
    with itmInsertCellTop do
    begin
      Caption := 'Top';
      AddToMenu(MenuCellInsertCell);
    end;
    MenuCellInsertColumn := TRMMenuItem.Create(Self);
    with MenuCellInsertColumn do
    begin
      ImageIndex := 0;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Insert Column';
      OnClick := itmInsertLeftColumnClick;
      AddToMenu(MenuCell);
    end;
    MenuCellInsertRow := TRMMenuItem.Create(Self);
    with MenuCellInsertRow do
    begin
      ImageIndex := 1;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Insert Row';
      OnClick := itmInsertTopRowClick;
      AddToMenu(MenuCell);
    end;
    MenuCellDeleteColumn := TRMMenuItem.Create(Self);
    with MenuCellDeleteColumn do
    begin
      ImageIndex := 4;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Delete Column';
      OnClick := itmDeleteColumnClick;
      AddToMenu(MenuCell);
    end;
    MenuCellDeleteRow := TRMMenuItem.Create(Self);
    with MenuCellDeleteRow do
    begin
      ImageIndex := 5;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Delete Row';
      OnClick := itmDeleteRowClick;
      AddToMenu(MenuCell);
    end;
    N18 := TRMSeparatorMenuItem.Create(Self);
    N18.AddToMenu(MenuCell);
    MenuCellMerge := TRMMenuItem.Create(Self);
    with MenuCellMerge do
    begin
      ImageIndex := 6;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Merge';
      OnClick := btnMergeClick;
      AddToMenu(MenuCell);
    end;
    MenuCellReverse := TRMMenuItem.Create(Self);
    with MenuCellReverse do
    begin
      ImageIndex := 7;
      Images := FDesignerForm.ImageListStand;
      Caption := 'Reverse';
      OnClick := btnSplitClick;
      AddToMenu(MenuCell);
    end;

{    MenuInsertObject := TRMSubmenuItem.Create(Self);
    with MenuInsertObject do
    begin
   Caption := 'Insert';
     AddToMenu(MenuBar);
    end;}

    MenuEditToolbar := TRMSubmenuItem.Create(Self);
    with MenuEditToolbar do
    begin
      Caption := 'Tools bar';
{$IFDEF USE_TB2K}
      FDesignerForm.MainMenu.Items.Insert(4, MenuEditToolbar);
{$ELSE}
      AddToMenu(FMainMenu);
{$ENDIF}
      GroupIndex := 21;
    end;
    padSetToolbar := TRMSubmenuItem.Create(Self);
    with padSetToolbar do
    begin
      Caption := 'Tools bar';
      OnClick := MenuEditToolbarClick;
      AddToMenu(MenuEditToolbar);
    end;
    itmToolbarStandard := TRMMenuItem.Create(Self);
    with itmToolbarStandard do
    begin
      Caption := 'Standard';
      Tag := 0;
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    itmToolbarText := TRMMenuItem.Create(Self);
    with itmToolbarText do
    begin
      Tag := 1;
      Caption := 'Text';
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    itmToolbarBorder := TRMMenuItem.Create(Self);
    with itmToolbarBorder do
    begin
      Tag := 2;
      Caption := 'Border';
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    itmToolbarGrid := TRMMenuItem.Create(Self);
    with itmToolbarGrid do
    begin
      Tag := 5;
      Caption := 'Grid';
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    itmToolbarInspector := TRMMenuItem.Create(Self);
    with itmToolbarInspector do
    begin
      Tag := 3;
      Caption := 'Object Inspector';
      ShortCut := 122;
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    itmToolbarInsField := TRMMenuItem.Create(Self);
    with itmToolbarInsField do
    begin
      Tag := 4;
      Caption := 'Insert DB fields';
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    itmToolbarCellEdit := TRMMenuItem.Create(Self);
    with itmToolbarCellEdit do
    begin
      Tag := 6;
      Caption := 'Cell Edit';
      OnClick := itmToolbarStandardClick;
      AddToMenu(padSetToolbar);
    end;
    padAddTools := TRMmenuItem.Create(Self);
    with padAddTools do
    begin
      Caption := 'Extra tools';
      Enabled := False;
      AddToMenu(MenuEditToolbar);
    end;
    MenuEditOptions := TRMMenuItem.Create(Self);
    with MenuEditOptions do
    begin
      Caption := 'Options...';
      OnClick := MenuEditOptionsClick;
      AddToMenu(MenuEditToolbar);
    end;

    FDesignerForm.AddLanguageMenu(MenuEditToolbar);
  end;

  procedure _CreateGridPopupMenu;
  begin
    // Grid右键菜单
    FSelectionMenu := TRMPopupMenu.Create(Self);
    with FSelectionMenu do
    begin
      OnPopup := SelectionMenuPopup;
      AutoHotKeys := maManual;
      Images := FDesignerForm.ImageListStand;
    end;
    itmGridMenuBandProp := TRMMenuItem.Create(Self);
    with itmGridMenuBandProp do
    begin
      Caption := 'Band DataSet...';
      OnClick := OnGridRowHeaderDblClick;
      AddToMenu(FSelectionMenu);
    end;

    SelectionMenu_popCut := TRMMenuItem.Create(Self);
    with SelectionMenu_popCut do
    begin
      Caption := 'Cut';
      ImageIndex := 12;
      OnClick := Editor_BtnCutClick;
      AddToMenu(FSelectionMenu);
    end;
    SelectionMenu_popCopy := TRMMenuItem.Create(Self);
    with SelectionMenu_popCopy do
    begin
      Caption := 'Copy';
      ImageIndex := 13;
      OnClick := Editor_BtnCopyClick;
      AddToMenu(FSelectionMenu);
    end;
    SelectionMenu_popPaste := TRMMenuItem.Create(Self);
    with SelectionMenu_popPaste do
    begin
      Caption := 'Paste';
      ImageIndex := 14;
      OnClick := Editor_BtnPasteClick;
      AddToMenu(FSelectionMenu);
    end;
    N102 := TRMSeparatorMenuItem.Create(Self);
    N102.AddToMenu(FSelectionMenu);

    itmCellProp := TRMMenuItem.Create(Self);
    with itmCellProp do
    begin
      ImageIndex := 40;
      Caption := 'Prop...';
      OnClick := MenuCellPropertyClick;
      AddToMenu(FSelectionMenu);
    end;
//    itmSplit1 := TRMSeparatorMenuItem.Create(Self);
//    itmSplit1.AddToMenu(FSelectionMenu);
    itmMergeCells := TRMMenuItem.Create(Self);
    with itmMergeCells do
    begin
      ImageIndex := 35;
      Caption := 'Merge Cells';
      OnClick := btnMergeClick;
      AddToMenu(FSelectionMenu);
    end;
    itmSplitCells := TRMMenuItem.Create(Self);
    with itmSplitCells do
    begin
      ImageIndex := 36;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -