home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 September
/
Chip_2001-09_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
RMCTL.ZIP
/
rmInspectorEdit2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-06-22
|
2KB
|
81 lines
{================================================================================
Copyright (C) 1997-2001 Mills Enterprise
Unit : rmInspectorItems
Purpose : This is a designtime unit to help with selecting and creating
rmInspectorItems.
Date : 01-18-2001
Author : Ryan J. Mills
Version : 1.80
================================================================================}
unit rmInspectorEdit2;
interface
{$I CompilerDefines.INC}
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, rmInspector;
type
TfrmInspectorItemTypes = class(TForm)
ComboBox1: TComboBox;
Label1: TLabel;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
private
function GetItemType: TrmCustomInspectorItemClass;
procedure SetItemType(const Value: TrmCustomInspectorItemClass);
{ Private declarations }
public
{ Public declarations }
property ChosenType:TrmCustomInspectorItemClass read GetItemType write SetItemType;
end;
implementation
{$R *.DFM}
uses rmInspectorItems;
procedure TfrmInspectorItemTypes.FormCreate(Sender: TObject);
begin
ComboBox1.ItemIndex := 0;
end;
function TfrmInspectorItemTypes.GetItemType: TrmCustomInspectorItemClass;
begin
case ComboBox1.itemindex of
0:result := TrmCheckboxInspectorItem;
1:result := TrmComboInspectorItem;
2:result := TrmComplexInspectorItem;
3:result := TrmDateInspectorItem;
4:result := TrmIntegerInspectorItem;
5:result := TrmStringInspectorItem;
else
raise exception.create('Unknown item index');
end
end;
procedure TfrmInspectorItemTypes.SetItemType(
const Value: TrmCustomInspectorItemClass);
begin
if Value = TrmComboInspectorItem then
ComboBox1.itemindex := 0
else if Value = TrmComplexInspectorItem then
ComboBox1.itemindex := 1
else if Value = TrmDateInspectorItem then
ComboBox1.itemindex := 2
else if Value = TrmIntegerInspectorItem then
ComboBox1.itemindex := 3
else if Value = TrmStringInspectorItem then
ComboBox1.itemindex := 4
else
raise exception.create('Unknown Item Class')
end;
end.