可堆叠面板Delphi组件

发布于 2024-12-03 14:55:22 字数 157 浏览 1 评论 0原文

有谁知道 Delphi 组件实现了与 jquery sortable 类似的功能,但适用于桌面应用程序?

即包含多个面板的垂直控件,这些面板可以重新排序,也可以用作其他组件的容器(特别是包含不同文本位的 TMemos)。

感谢您提供任何信息,

布里丹。

does anyone know of a Delphi component that implements something similar to what jquery sortable does, but for a desktop application?

i.e. a vertical control that contains a number of panels that can be reordered and also used as containers for other components (specifically TMemos containing different bits of text).

Thanks for any info,

Breandan.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

花开柳相依 2024-12-10 14:55:22

虽然我是通过代码而不是设计时完成的,但这就是我使用包含一些框架或面板的 TScrollbox 或 TPanel 的目的,这些框架或面板全部顶部对齐。如果我想要框架折叠/展开,我只需在框架中放置一个按钮,即可将框架折叠到最小高度,例如折叠时为 20 像素,展开时更高。

里面的框架实际上可以是您想要的任何控件,甚至是包含一些其他控件的面板。顶级控件可以在父面板或滚动框中重新排序。

While I do it from code, and not designtime, this is what I would use a TScrollbox or TPanel containing some Frames or Panels, which are all aligned top, for. If I want a collapse/expand for the frames, I just put a button in the frame that allows you to collapse the frame to a minimal height such as 20 pixels when collapsed, and something taller when expanded.

the frames inside could really be any control you want, even Panels containing a few other controls. The top level controls can be reordered within the parent panel or scrollbox.

贱人配狗天长地久 2024-12-10 14:55:22

TMS 具有可以折叠/展开的 TAdvPanelGroup。请参阅右下角的屏幕截图:
http://www.tmssoftware.com/site/advpanel.asp

TMS Has TAdvPanelGroup that can be collapsed/expanded. See screenshot in the lower-right:
http://www.tmssoftware.com/site/advpanel.asp

暖伴 2024-12-10 14:55:22

仅运行一次,然后我从正在运行的应用程序中移动它们并调整它们的大小。

在此处输入图像描述
在此处输入图像描述
在此处输入图像描述

这是 dfm:

object Form2: TForm2
  Left = 0
  Top = 0
  Caption = 'Form2'
  ClientHeight = 337
  ClientWidth = 635
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object clbr1: TCoolBar
    Left = 0
    Top = 0
    Width = 635
    Height = 313
    Bands = <
      item
        Control = gb1
        ImageIndex = -1
        MinHeight = 123
        Width = 629
      end
      item
        Control = pnl1
        ImageIndex = -1
        MinHeight = 112
        Width = 629
      end>
    object gb1: TGroupBox
      Left = 11
      Top = 0
      Width = 620
      Height = 123
      Caption = 'gb1'
      TabOrder = 0
      object lbledt1: TLabeledEdit
        Left = 112
        Top = 40
        Width = 121
        Height = 21
        EditLabel.Width = 32
        EditLabel.Height = 13
        EditLabel.Caption = 'lbledt1'
        TabOrder = 0
      end
    end
    object pnl1: TPanel
      Left = 11
      Top = 125
      Width = 620
      Height = 112
      Caption = 'pnl1'
      TabOrder = 1
      object rg1: TRadioGroup
        Left = 128
        Top = 4
        Width = 185
        Height = 105
        Caption = 'rg1'
        Items.Strings = (
          'dsfsdf'
          'sdfsdfsd')
        TabOrder = 0
      end
    end
  end
end

Only one run, then I move and resize them from the running application.

enter image description here
enter image description here
enter image description here

Here's the dfm:

object Form2: TForm2
  Left = 0
  Top = 0
  Caption = 'Form2'
  ClientHeight = 337
  ClientWidth = 635
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object clbr1: TCoolBar
    Left = 0
    Top = 0
    Width = 635
    Height = 313
    Bands = <
      item
        Control = gb1
        ImageIndex = -1
        MinHeight = 123
        Width = 629
      end
      item
        Control = pnl1
        ImageIndex = -1
        MinHeight = 112
        Width = 629
      end>
    object gb1: TGroupBox
      Left = 11
      Top = 0
      Width = 620
      Height = 123
      Caption = 'gb1'
      TabOrder = 0
      object lbledt1: TLabeledEdit
        Left = 112
        Top = 40
        Width = 121
        Height = 21
        EditLabel.Width = 32
        EditLabel.Height = 13
        EditLabel.Caption = 'lbledt1'
        TabOrder = 0
      end
    end
    object pnl1: TPanel
      Left = 11
      Top = 125
      Width = 620
      Height = 112
      Caption = 'pnl1'
      TabOrder = 1
      object rg1: TRadioGroup
        Left = 128
        Top = 4
        Width = 185
        Height = 105
        Caption = 'rg1'
        Items.Strings = (
          'dsfsdf'
          'sdfsdfsd')
        TabOrder = 0
      end
    end
  end
end
漫漫岁月 2024-12-10 14:55:22

我还没有在 Delphi 2007 中找到可以实现您想要的功能的标准控件,但我会提供一种类似于 Warren 建议的自定义解决方案。主要区别在于,我将在 TFrame 中创建它,以便您可以更轻松地维护允许您操纵控件及其相互交互的代码。您还可以在框架内创建方法来添加新面板(带有备忘录和要显示的文本)、移动它们等。

这是一项工作,但也可以是一次很好的学习体验。最好的部分是,一旦完成,您可以在任何表单上或在另一个框架内的任何地方重复使用该框架。如果你做得正确,它也会毫无麻烦地工作。

I haven't found a standard control that does what you want in Delphi 2007, but I would offer a custom solution similar to the one Warren suggested. The main difference is that I would create it within a TFrame so you could more easily maintain the code that allows you to manipulate the controls and their interaction with each other. You could also create methods within the frame for adding new panels (with memos and the text to display), move them around, etc.

It's a bit of work but it can also be a great learning experience. The best part is once you are done you can reuse that frame anywhere you want on any form or within another frame. If you do it right it will work without hassle as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文