起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 355|回复: 11

【结贴】文档关联的界面如何实现

[复制链接]
发表于 2008-3-25 13:18:21 | 显示全部楼层 |阅读模式
文档关联面板的界面是如何实现的?是用的平坦上的控件吗?

文档关联.jpg

14.5 KB, 下载次数: 206

回复

使用道具 举报

 楼主| 发表于 2008-3-25 14:24:42 | 显示全部楼层
有人回复没?顶一下!
回复 支持 反对

使用道具 举报

发表于 2008-3-25 14:50:21 | 显示全部楼层
用的 TdxNavBar 控件
回复 支持 反对

使用道具 举报

发表于 2008-3-25 14:53:34 | 显示全部楼层
把以下内容复制到剪贴板中,到窗体上选中窗体,按Ctrl+V就可以看到效果了
object dxNavBar1: TdxNavBar
  Left = 112
  Top = 48
  Width = 169
  Height = 361
  ActiveGroupIndex = 0
  DragCopyCursor = -1119
  DragCursor = -1120
  DragDropFlags = [fAllowDragLink, fAllowDropLink, fAllowDragGroup, fAllowDropGroup]
  HotTrackedGroupCursor = crDefault
  HotTrackedLinkCursor = -1118
  View = 12
  object dxNavBar1Group1: TdxNavBarGroup
    Caption = 'dxNavBar1Group1'
    LinksUseSmallImages = True
    SelectedLinkIndex = -1
    ShowAsIconView = False
    ShowControl = False
    TopVisibleLinkIndex = 0
    UseControl = False
    UseSmallImages = True
    Visible = True
    Links = <
      item
        Item = dxNavBar1Item1
      end
      item
        Item = dxNavBar1Item3
      end
      item
        Item = dxNavBar1Item2
      end>
  end
  object dxNavBar1Group2: TdxNavBarGroup
    Caption = 'dxNavBar1Group2'
    LinksUseSmallImages = True
    SelectedLinkIndex = -1
    ShowAsIconView = False
    ShowControl = False
    TopVisibleLinkIndex = 0
    UseControl = False
    UseSmallImages = True
    Visible = True
    Links = <>
  end
  object dxNavBar1Group3: TdxNavBarGroup
    Caption = 'dxNavBar1Group3'
    LinksUseSmallImages = True
    SelectedLinkIndex = -1
    ShowAsIconView = False
    ShowControl = False
    TopVisibleLinkIndex = 0
    UseControl = False
    UseSmallImages = True
    Visible = True
    Links = <>
  end
  object dxNavBar1Item1: TdxNavBarItem
    Caption = 'dxNavBar1Item1'
    Enabled = True
    LargeImageIndex = -1
    SmallImageIndex = -1
    Visible = True
  end
  object dxNavBar1Item2: TdxNavBarItem
    Caption = 'dxNavBar1Item2'
    Enabled = True
    LargeImageIndex = -1
    SmallImageIndex = -1
    Visible = True
  end
  object dxNavBar1Item3: TdxNavBarItem
    Caption = 'dxNavBar1Item3'
    Enabled = True
    LargeImageIndex = -1
    SmallImageIndex = -1
    Visible = True
  end
end
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-25 15:26:53 | 显示全部楼层
代码运行出错

错误.jpg

15.49 KB, 下载次数: 194

回复 支持 反对

使用道具 举报

发表于 2008-3-25 15:40:49 | 显示全部楼层
不会啊,4楼就没有定义 dxNavBar1DocNewGroup 的控件
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-25 15:54:17 | 显示全部楼层
就是有这个错误 和名字没有关系  名字是我改的 如果不改 也是一样的错误 只是名字不一样

未命名.jpg

16.17 KB, 下载次数: 193

回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-25 16:24:48 | 显示全部楼层
有没有人解答一下啊
回复 支持 反对

使用道具 举报

发表于 2008-3-25 16:49:44 | 显示全部楼层
不用4楼,用代码实现是这样的
==============
unit CT1;

interface

uses
  Business.System, Business.Forms, Justep.Tools.ExpressNavBar;

type
  TCT1 = class(TForm)
    procedure BizFormShow(Sender: TObject);
  private
    {private declarations}
    dxNavBar1: TdxNavBar;
    dxNavBar1Group1: TdxNavBarGroup;
    dxNavBar1Group2: TdxNavBarGroup;
    dxNavBar1Group3: TdxNavBarGroup;
    dxNavBar1Item1: TdxNavBarItem;
    dxNavBar1Item2: TdxNavBarItem;
    dxNavBar1Item3: TdxNavBarItem;
  public
    {public declarations}
    procedure MyClick(Sender: TObject);
  end;

implementation

procedure TCT1.MyClick(Sender: TObject);
begin
  Dialogs.Showmessage((Sender as TdxNavBarItem).Caption);
end;

procedure TCT1.BizFormShow(Sender: TObject);
begin
  dxNavBar1 := TdxNavBar.Create(Self);
  with dxNavBar1 do
  begin
    Parent := Self;
    Left := 80;
    Top := 16;
    Width := 169;
    Height := 361;
    ActiveGroupIndex := 0;
    DragCopyCursor := -1119;
    DragCursor := -1120;
    DragDropFlags := [TdxNavBarDragDropFlag.fAllowDragLink, TdxNavBarDragDropFlag.fAllowDropLink, TdxNavBarDragDropFlag.fAllowDragGroup, TdxNavBarDragDropFlag.fAllowDropGroup];
    HotTrackedGroupCursor := Business.Forms.Controls.crDefault;
    HotTrackedLinkCursor := -1118;
    View := 12;
  end;

  dxNavBar1Group1 := dxNavBar1.Groups.Add;
  with dxNavBar1Group1 do
  begin
    Caption := 'dxNavBar1Group1';
    LinksUseSmallImages := True;
    SelectedLinkIndex := -1;
    ShowAsIconView := False;
    ShowControl := False;
    TopVisibleLinkIndex := 0;
    UseControl := False;
    UseSmallImages := True;
    Visible := True;
  end;
  dxNavBar1Group2 := dxNavBar1.Groups.Add;
  with dxNavBar1Group2 do
  begin
    Caption := 'dxNavBar1Group2';
    LinksUseSmallImages := True;
    SelectedLinkIndex := -1;
    ShowAsIconView := False;
    ShowControl := False;
    TopVisibleLinkIndex := 0;
    UseControl := False;
    UseSmallImages := True;
    Visible := True;
  end;
  dxNavBar1Group3 := dxNavBar1.Groups.Add;
  with dxNavBar1Group3 do
  begin
    Caption := 'dxNavBar1Group3';
    LinksUseSmallImages := True;
    SelectedLinkIndex := -1;
    ShowAsIconView := False;
    ShowControl := False;
    TopVisibleLinkIndex := 0;
    UseControl := False;
    UseSmallImages := True;
    Visible := True;
  end;
  dxNavBar1Item1 := dxNavBar1.Items.Add;
  with dxNavBar1Item1 do
  begin
    Caption := 'dxNavBar1Item1';
    Enabled := True;
    LargeImageIndex := -1;
    SmallImageIndex := -1;
    Visible := True;
    OnClick := MyClick;
  end;
  dxNavBar1Item2 := dxNavBar1.Items.Add;
  with dxNavBar1Item2 do
  begin
    Caption := 'dxNavBar1Item2';
    Enabled := True;
    LargeImageIndex := -1;
    SmallImageIndex := -1;
    Visible := True;
    OnClick := MyClick;
  end;
  dxNavBar1Item3 := dxNavBar1.Items.Add;
  with dxNavBar1Item3 do
  begin
    Caption := 'dxNavBar1Item3';
    Enabled := True;
    LargeImageIndex := -1;
    SmallImageIndex := -1;
    Visible := True;
    OnClick := MyClick;
  end;
  dxNavBar1Group1.CreateLink(dxNavBar1Item1);
  dxNavBar1Group1.CreateLink(dxNavBar1Item2);
  dxNavBar1Group1.CreateLink(dxNavBar1Item3);
end;

end.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-25 17:00:07 | 显示全部楼层
这样做的话 布局和样式设计就只能全部用代码做了啊?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-13 19:08 , Processed in 0.047936 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表