简体   繁体   English

可堆叠面板Delphi组件

[英]Stackable Panel Delphi Component

does anyone know of a Delphi component that implements something similar to what jquery sortable does, but for a desktop application? 有没有人知道Delphi组件实现类似于jquery sortable的东西,但对于桌面应用程序?

ie 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). 即一个垂直控件,它包含许多可以重新排序的面板,也可以用作其他组件的容器(特别是包含不同文本位的TMemos)。

Thanks for any info, 谢谢你的任何信息,

Breandan. Breandan。

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. 虽然我是从代码而不是设计时间来做的,但我会使用包含一些框架或面板的TScrollbox或TPanel,它们都是顶部对齐的。 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. 如果我想要框架的折叠/展开,我只需在框架中放置一个按钮,允许您将框架折叠到最小高度,例如折叠时为20像素,以及展开时更高的高度。

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. 顶级控件可以在父面板或滚动框中重新排序。

TMS Has TAdvPanelGroup that can be collapsed/expanded. TMS具有可折叠/扩展的TAdvPanelGroup。 See screenshot in the lower-right: http://www.tmssoftware.com/site/advpanel.asp 请参阅右下方的屏幕截图: http//www.tmssoftware.com/site/advpanel.asp

Only one run, then I move and resize them from the running application. 只有一次运行,然后我从正在运行的应用程序中移动并调整它们的大小。

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

Here's the dfm: 这是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

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. 我没有找到在Delphi 2007中做你想要的标准控件,但是我会提供类似于Warren建议的自定义解决方案。 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. 主要区别在于我会在TFrame中创建它,以便您可以更轻松地维护代码,从而允许您操纵控件及其相互之间的交互。 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. 如果你做得对,它也可以毫无困难地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM