Delphi 2009之TCategoryPanelGroup[2]: HeaderAlignment、GradientDirection

本例效果图:

代码文件:unit Unit1;
interface
uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, ExtCtrls, StdCtrls;
type
 TForm1 = class(TForm)
  CategoryPanelGroup1: TCategoryPanelGroup;
  CategoryPanel1: TCategoryPanel;
  CategoryPanel2: TCategoryPanel;
  CategoryPanel3: TCategoryPanel;
  RadioGroup1: TRadioGroup;
  RadioGroup2: TRadioGroup;
  procedure FormCreate(Sender: TObject);
  procedure RadioGroup1Click(Sender: TObject);
  procedure RadioGroup2Click(Sender: TObject);
 end;
var
 Form1: TForm1;
implementation
{$R *.dfm}
uses TypInfo, GraphUtil;
procedure TForm1.FormCreate(Sender: TObject);
var
 i: Integer;
begin
 CategoryPanel1.Height := ClientHeight div 2;
 CategoryPanel2.Height := CategoryPanel1.Height;
 CategoryPanel3.Height := CategoryPanel1.Height;
 CategoryPanel1.Caption := 'CPanel1';
 CategoryPanel2.Caption := 'CPanel2';
 CategoryPanel3.Caption := 'CPanel3';
 RadioGroup1.Caption := 'HeaderAlignment';
 for i := 0 to 2 do
  RadioGroup1.Items.Add(GetEnumName(TypeInfo(TAlignment), i));
 RadioGroup1.ItemIndex := 0;
 RadioGroup2.Caption := 'GradientDirection';
 for i := 0 to 1 do
  RadioGroup2.Items.Add(GetEnumName(TypeInfo(TGradientDirection), i));
 RadioGroup2.ItemIndex := 1;
end;
procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
 CategoryPanelGroup1.HeaderAlignment := TAlignment(RadioGroup1.ItemIndex);
end;
procedure TForm1.RadioGroup2Click(Sender: TObject);
begin
 CategoryPanelGroup1.GradientDirection := TGradientDirection(RadioGroup2.ItemIndex);
end;
end.

时间: 2024-09-08 16:58:17

Delphi 2009之TCategoryPanelGroup[2]: HeaderAlignment、GradientDirection的相关文章

Delphi 2009之TCategoryPanelGroup[5]: HeaderStyle

本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls; type TForm1 = class(TForm) CategoryPanelGroup1: TCategoryPanelGroup; CategoryPanel1: TCategoryPan

Delphi 2009之TCategoryPanelGroup[4] Height

本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls; type TForm1 = class(TForm) CategoryPanelGroup1: TCategoryPanelGroup; CategoryPanel1: TCategoryPan

Delphi 2009之TCategoryPanelGroup[3]: Color

本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ColorGrd; type TForm1 = class(TForm) CategoryPanelGroup1: TCategoryPanelGroup; CategoryPanel1: TCategoryPan

Delphi 2009之TCategoryPanelGroup[1]: ChevronAlignment等

制作过程: 先添加一个 TCategoryPanelGroup, 再从其右键菜单 -> New Panel, 反复添加三个 TCategoryPanel. 本例测试了: TCategoryPanelGroup 的 ChevronAlignment 属性.CollapseAll 和 ExpandAll 方法; 还有 TCategoryPanel 的 Collapsed 属性. 本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, Sys

Delphi 2009的反射单元(ObjAuto)

ObjAuto 单元应该算是对 TypInfo 单元的功能扩展吧? 它提供了 5 个方法: GetMethods.GetMethodInfo.CreateMethodPointer.ReleaseMethodPointer.ObjectInvoke 通过 GetMethods.GetMethodInfo 可以获取类公用成员的详细信息. 通过 TypInfo 只能获取 published 区中成员的信息(例子); 通过 ObjAuto 也能获取 public 区的成员信息. 本例效果图: 本例有两

Delphi 2009泛型容器单元(Generics.Collections)[4]: TDictionary<T>

TDictionary 类似哈希表. 本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2: TB

Delphi 2009泛型容器单元(Generics.Collections)[3]: TStack<T>

TQueue 和 TStack, 一个是队列列表, 一个是堆栈列表; 一个是先进先出, 一个是先进后出. TStack 主要有三个方法.一个属性: Push(压栈).Pop(出栈).Peek(查看下一个要出栈的元素); Count(元素总数). 本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdC

Delphi 2009泛型容器单元(Generics.Collections)[2]: TQueue<T>

TQueue 和 TStack, 一个是队列列表, 一个是堆栈列表; 一个是先进先出, 一个是先进后出. TQueue 主要有三个方法.一个属性: Enqueue(入列).Dequeue(出列).Peek(查看下一个要出列的元素); Count(元素总数). 本例效果图: 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialog

Delphi 2009泛型容器单元(Generics.Collections)[1]: TList

Delphi 2009 新增了泛型容器单元: Generics.Collections, 同时还有一个 Generics.Defaults 单元做支持. Generics.Collections 包含了以下实用类: TList<T> TQueue<T> TStack<T> TDictionary<TKey,TValue> TObjectList<T> TObjectQueue<T> TObjectStack<T> TObj