1
0
mirror of synced 2024-11-21 17:43:51 +00:00

Added: design-time dialog for Container's Graphics

This commit is contained in:
Mark van Renswoude 2004-09-02 10:36:24 +00:00
parent aee4dc4bb4
commit 279db4d12b
13 changed files with 1022 additions and 18 deletions

View File

@ -85,9 +85,6 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Excluded Packages]
C:\Program Files\Borland\Delphi6\Bin\dcldb60.bpl=Borland Database Components
c:\program files\borland\delphi6\Projects\Bpl\VirtualTreesD6D.bpl=Virtual Treeview
@ -196,15 +193,6 @@ H:\Downloads\commentexpert.bpl=Comment Expert v1.0 Alpha
c:\program files\borland\delphi6\Projects\Bpl\dclIndy60.bpl=Internet Direct (Indy) for D6 Property and Component Editors
C:\WINDOWS\System32\ibevnt60.bpl=Borland Interbase Event Alerter Component
c:\program files\borland\delphi6\Projects\Bpl\PngComponentsDesigntime.bpl=Png components designtime
[Included Packages]
C:\Program Files\Borland\Delphi6\Bin\dclstd60.bpl=Borland Standard Components
F:\Delphi\Components\madCollection\madBasic\Delphi 6\madBasic_.bpl=madBasic 1.1f · www.madshi.net
F:\Delphi\Components\madCollection\madDisAsm\Delphi 6\madDisAsm_.bpl=madDisAsm 2.0a · www.madshi.net
F:\Delphi\Components\madCollection\madExcept\Delphi 6\madExcept_.bpl=madExcept 2.6a · www.madshi.net
F:\Delphi\Components\madCollection\madExcept\Delphi 6\madExceptWizard_.bpl=madExceptWizard 2.6 · www.madshi.net
c:\program files\borland\delphi6\Bin\dclsmpedit60.bpl=Borland Editor Script Enhancements
C:\PROGRA~1\Borland\Delphi6\Projects\Bpl\ThemeManager6.bpl=Windows XP Theme Manager
c:\program files\borland\delphi6\Projects\Bpl\X2CLGLD.bpl=X²CL GraphicList (Designtime)
c:\program files\borland\delphi6\Bin\dclnet60.bpl=Borland Internet Components
F:\Delphi\Components\madCollection\madExcept\Delphi 6\madExceptIde_.bpl=madExceptIde 1.0b · www.madshi.net
c:\program files\borland\delphi6\Bin\dclemacsedit60.bpl=Borland Editor Emacs Enhancements
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;

View File

@ -33,6 +33,7 @@ requires
contains
X2CLGLReg in '..\X2CLGLReg.pas',
X2CLGLEditors in '..\X2CLGLEditors.pas';
X2CLGLEditors in '..\X2CLGLEditors.pas',
X2CLGraphicsEditor in '..\X2CLGraphicsEditor.pas' {frmGraphicsEditor};
end.

View File

@ -13,11 +13,21 @@ uses
DesignIntf;
type
TX2GraphicsProperty = class(TClassProperty)
public
function AllEqual(): Boolean; override;
procedure Edit(); override;
function GetAttributes(): TPropertyAttributes; override;
end;
TX2GraphicContainerEditor = class(TComponentEditor)
private
procedure FindGraphics(const Prop: IProperty);
public
procedure Edit(); override;
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): String; override;
function GetVerbCount(): Integer; override;
end;
TX2GraphicListEditor = class(TComponentEditor)
@ -27,10 +37,31 @@ type
implementation
uses
Classes,
SysUtils,
TypInfo,
Dialogs,
X2CLGraphicList;
X2CLGraphicList,
X2CLGraphicsEditor;
{==================== TX2GraphicsProperty
Editor
========================================}
function TX2GraphicsProperty.AllEqual;
begin
Result := (PropCount = 1);
end;
procedure TX2GraphicsProperty.Edit;
begin
TfrmGraphicsEditor.Execute(TComponent(GetComponent(0)));
end;
function TX2GraphicsProperty.GetAttributes;
begin
Result := [paDialog, paReadOnly];
end;
{============== TX2GraphicContainerEditor
@ -56,6 +87,21 @@ begin
end;
end;
procedure TX2GraphicContainerEditor.ExecuteVerb;
begin
Edit();
end;
function TX2GraphicContainerEditor.GetVerb;
begin
Result := 'Graphics Editor...';
end;
function TX2GraphicContainerEditor.GetVerbCount;
begin
Result := 1;
end;
{=================== TX2GraphicListEditor
Editor

View File

@ -22,6 +22,7 @@ uses
procedure Register;
begin
RegisterComponents('X²Software', [TX2GraphicContainer, TX2GraphicList]);
RegisterPropertyEditor(TypeInfo(TX2GraphicCollection), TX2GraphicContainer, 'Graphics', TX2GraphicsProperty);
RegisterComponentEditor(TX2GraphicContainer, TX2GraphicContainerEditor);
RegisterComponentEditor(TX2GraphicList, TX2GraphicListEditor);
end;

View File

@ -0,0 +1,636 @@
object frmGraphicsEditor: TfrmGraphicsEditor
Left = 325
Top = 363
Width = 534
Height = 451
BorderIcons = [biSystemMenu]
Caption = '<runtime>'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poDefaultPosOnly
OnClose = FormClose
PixelsPerInch = 96
TextHeight = 13
object spltGraphics: TSplitter
Left = 189
Top = 0
Width = 4
Height = 424
Cursor = crHSplit
end
object pnlImage: TPanel
Left = 193
Top = 0
Width = 333
Height = 424
Align = alClient
BevelOuter = bvNone
TabOrder = 1
object tbImage: TToolBar
Left = 0
Top = 0
Width = 333
Height = 26
AutoSize = True
EdgeBorders = [ebTop, ebBottom]
Flat = True
Images = ilsIcons
TabOrder = 0
object tbOpen: TToolButton
Left = 0
Top = 0
Action = actOpen
end
object tbSave: TToolButton
Left = 23
Top = 0
Action = actSave
end
object tbClear: TToolButton
Left = 46
Top = 0
Action = actClear
end
end
object sbImage: TScrollBox
Left = 0
Top = 26
Width = 333
Height = 370
Align = alClient
BevelInner = bvNone
BevelKind = bkTile
BorderStyle = bsNone
Color = clBtnFace
ParentColor = False
TabOrder = 1
object imgPreview: TImage
Left = 0
Top = 0
Width = 32
Height = 32
AutoSize = True
end
end
object pnlProperties: TPanel
Left = 0
Top = 396
Width = 333
Height = 28
Align = alBottom
BevelOuter = bvNone
Caption = 'pnlProperties'
TabOrder = 2
DesignSize = (
333
28)
object lblName: TLabel
Left = 8
Top = 8
Width = 31
Height = 13
Caption = 'Name:'
end
object txtName: TEdit
Left = 52
Top = 4
Width = 277
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 0
OnChange = txtNameChange
end
end
end
object pnlGraphics: TPanel
Left = 0
Top = 0
Width = 189
Height = 424
Align = alLeft
BevelOuter = bvNone
TabOrder = 0
object lstGraphics: TListBox
Left = 0
Top = 26
Width = 189
Height = 398
Align = alClient
ItemHeight = 13
TabOrder = 1
OnClick = lstGraphicsClick
end
object tbGraphics: TToolBar
Left = 0
Top = 0
Width = 189
Height = 26
AutoSize = True
EdgeBorders = [ebTop, ebBottom]
Flat = True
Images = ilsIcons
TabOrder = 0
object tbNew: TToolButton
Left = 0
Top = 0
Action = actAdd
end
object tbDelete: TToolButton
Left = 23
Top = 0
Action = actDelete
end
object tbSep1: TToolButton
Left = 46
Top = 0
Width = 8
ImageIndex = 4
Style = tbsSeparator
end
object tbUp: TToolButton
Left = 54
Top = 0
Action = actUp
end
object tbDown: TToolButton
Left = 77
Top = 0
Action = actDown
end
end
end
object ilsIcons: TImageList
Left = 8
Top = 388
Bitmap = {
494C010107000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000003000000001002000000000000030
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000808000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000008080000080800000808000008080000080800000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000808000008080000080800000808000008080000080800000808000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000808000008080000080800000808000008080000080800000808000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000008080000080800000808000008080000080800000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000808000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000080800000808000008080000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000808080008080
8000808080008080800080808000808080008080800080808000808080008080
8000808080008080800080808000808080000000000000000000808080008080
8000808080008080800080808000808080008080800080808000808080008080
8000808080008080800080808000808080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000808080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000808080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000008080000080
8000000000000000000000000000000000000000000000000000000000000000
0000000000000080800000000000000000000000000000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000
0000FFFFFF0000FFFF0000000000808080000000000000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000
0000FFFFFF0000FFFF0000000000808080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000008080000080
8000000000000000000000000000000000000000000000000000000000000000
000000000000008080000000000000000000000000000000000000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C0C0
C00000000000FFFFFF000000000080808000808080000000000000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C0C0
C00000000000FFFFFF0000000000808080000000000000000000008080000080
8000008080000080800000808000008080000080800000808000008080000000
0000000000000000000000000000000000000000000000000000008080000080
8000000000000000000000000000000000000000000000000000000000000000
0000000000000080800000000000000000000000000000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF
FF00C0C0C0000000000000000000808080000000800000000000FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF
FF00C0C0C00000000000000000008080800000000000FFFFFF00000000000080
8000008080000080800000808000008080000080800000808000008080000080
8000000000000000000000000000000000000000000000000000008080000080
8000000000000000000000000000000000000000000000000000000000000000
000000000000008080000000000000000000000000000000000000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000
000000000000000000000000000080808000000080000000800000FFFF00FFFF
FF0000FFFF00FFFFFF00808080000000800000FFFF00FFFFFF00000000000000
0000000000000000000000000000808080000000000000FFFF00FFFFFF000000
0000008080000080800000808000008080000080800000808000008080000080
8000008080000000000000000000000000000000000000000000008080000080
8000008080000080800000808000008080000080800000808000008080000080
8000008080000080800000000000000000000000000000000000FFFFFF008080
800000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF00000000008080800080808000000080008080800000FF
FF00FFFFFF00808080000000800080808000FFFFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF00000000008080800000000000FFFFFF0000FFFF00FFFF
FF00000000000080800000808000008080000080800000808000008080000080
8000008080000080800000000000000000000000000000000000008080000080
8000000000000000000000000000000000000000000000000000000000000000
0000008080000080800000000000000000008080800000FFFF0000FFFF008080
8000FFFFFF0000FFFF008080800000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000808080000000000000008000000080008080
800000FFFF000000800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000808080000000000000FFFF00FFFFFF0000FF
FF00FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000008080000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000080800000000000000000000000000080808000FFFFFF008080
800000FFFF008080800000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF0000000000808080000000000080808000000080000000
80000000800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF00000000008080800000000000FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000
0000000000000000000000000000000000000000000000000000008080000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000008080000000000000000000808080008080800080808000FFFF
FF0080808000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000808080000000000080808000000080000000
800000008000FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF
FF0000FFFF00FFFFFF0000000000808080000000000000FFFF00FFFFFF0000FF
FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000
0000000000000000000000000000000000000000000000000000008080000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000080800000000000000000000000000000FFFF008080800000FF
FF00FFFFFF008080800080808000808080008080800000000000000000000000
0000000000000000000000000000000000008080800000008000000080000000
8000000080008080800000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF
FF00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000008080000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000008080000000000000000000000000008080800000FFFF008080
800000FFFF008080800000FFFF00000000000000000000000000000000000000
0000000000000000000000000000000000000000800000008000808080000000
0000000080000000800080808000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000008080000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000008080800000FFFF00000000008080
800000000000000000008080800000FFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000800000008000808080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000008080000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000FFFF0000000000000000008080
800000FFFF000000000000000000808080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000008000000080008080800000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008080
8000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000300000000100010000000000800100000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000FFFFFFFFFFFF0000EFFDFFFFFFFF0000
C7FFFFFFFFFF0000C3FBF83FFEFF0000E3F7F83FFC7F0000F1E7F83FF83F0000
F8CFF83FF01F0000FC1FC007E00F0000FE3FE00FC0070000FC1FF01FF83F0000
F8CFF83FF83F0000E1E7FC7FF83F0000C3F3FEFFF83F0000C7FDFFFFFFFF0000
FFFFFFFFFFFF0000FFFFFFFFFFFF0000FFFFFFFFFFFFFFFFC000C000FFFFC001
80008000FFFF803180008000001F803180000000000F80318000000000078001
800000000003800180000000000180010000800000018FF180008000001F8FF1
00008000001F8FF180010001001F8FF181FF11FF8FF18FF12CFFF8FFFFF98FF5
66FFFC7FFF758001EFFFFFFFFF8FFFFF00000000000000000000000000000000
000000000000}
end
object alGraphics: TActionList
Images = ilsIcons
Left = 36
Top = 388
object actAdd: TAction
Caption = '&New'
Hint = 'New Graphic'
ImageIndex = 0
ShortCut = 16462
OnExecute = actAddExecute
end
object actDelete: TAction
Caption = '&Delete'
Hint = 'Delete Graphic'
ImageIndex = 1
ShortCut = 46
OnExecute = actDeleteExecute
end
object actOpen: TAction
Caption = '&Open'
Hint = 'Open Graphic'
ImageIndex = 2
ShortCut = 16463
OnExecute = actOpenExecute
end
object actSave: TAction
Caption = '&Save'
Hint = 'Save Graphic'
ImageIndex = 3
ShortCut = 16467
OnExecute = actSaveExecute
end
object actClear: TAction
Caption = '&Clear'
Hint = 'Clear Graphic'
ImageIndex = 4
ShortCut = 16430
OnExecute = actClearExecute
end
object actUp: TAction
Caption = 'Move &Up'
Hint = 'Move Up'
ImageIndex = 5
ShortCut = 16422
OnExecute = actUpExecute
end
object actDown: TAction
Caption = '&Move Down'
Hint = 'Move Down'
ImageIndex = 6
ShortCut = 16424
OnExecute = actDownExecute
end
end
object dlgOpen: TOpenPictureDialog
Left = 8
Top = 360
end
object dlgSave: TSavePictureDialog
Left = 36
Top = 360
end
end

View File

@ -0,0 +1,332 @@
{
:: Contains the dialog presented for the Container's Graphics property
::
:: Last changed: $Date$
:: Revision: $Rev$
:: Author: $Author$
}
unit X2CLGraphicsEditor;
interface
uses
ActnList,
Classes,
ComCtrls,
Controls,
Dialogs,
ExtCtrls,
ExtDlgs,
Forms,
ImgList,
StdCtrls,
ToolWin,
X2CLGraphicList;
type
TfrmGraphicsEditor = class(TForm)
actAdd: TAction;
actClear: TAction;
actDelete: TAction;
actDown: TAction;
actOpen: TAction;
actSave: TAction;
actUp: TAction;
alGraphics: TActionList;
dlgOpen: TOpenPictureDialog;
dlgSave: TSavePictureDialog;
ilsIcons: TImageList;
imgPreview: TImage;
lblName: TLabel;
lstGraphics: TListBox;
pnlGraphics: TPanel;
pnlImage: TPanel;
pnlProperties: TPanel;
sbImage: TScrollBox;
spltGraphics: TSplitter;
tbClear: TToolButton;
tbDelete: TToolButton;
tbDown: TToolButton;
tbGraphics: TToolBar;
tbImage: TToolBar;
tbNew: TToolButton;
tbOpen: TToolButton;
tbSave: TToolButton;
tbSep1: TToolButton;
tbUp: TToolButton;
txtName: TEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure lstGraphicsClick(Sender: TObject);
procedure txtNameChange(Sender: TObject);
procedure actAddExecute(Sender: TObject);
procedure actDeleteExecute(Sender: TObject);
procedure actUpExecute(Sender: TObject);
procedure actDownExecute(Sender: TObject);
procedure actOpenExecute(Sender: TObject);
procedure actSaveExecute(Sender: TObject);
procedure actClearExecute(Sender: TObject);
private
FComponent: TX2GraphicContainer;
procedure InternalExecute(const AComponent: TComponent);
procedure Administrate();
procedure UpdatePreview();
function Active(out AIndex: Integer;
out AGraphic: TX2GraphicCollectionItem): Boolean;
public
class procedure Execute(const AComponent: TComponent);
end;
implementation
uses
Graphics,
SysUtils;
var
GEditor: TfrmGraphicsEditor;
{$R *.dfm}
{===================== TfrmGraphicsEditor
Initialization
========================================}
class procedure TfrmGraphicsEditor.Execute;
begin
if not Assigned(GEditor) then
GEditor := TfrmGraphicsEditor.Create(Application);
GEditor.InternalExecute(AComponent);
end;
procedure TfrmGraphicsEditor.InternalExecute;
var
iGraphic: Integer;
begin
FComponent := TX2GraphicContainer(AComponent);
Caption := Format('%s.Graphics', [FComponent.Name]);
// Fill graphics list
with lstGraphics.Items do
begin
BeginUpdate();
try
Clear();
for iGraphic := 0 to FComponent.Graphics.Count - 1 do
AddObject(FComponent.Graphics[iGraphic].DisplayName,
FComponent.Graphics[iGraphic]);
finally
EndUpdate();
end;
lstGraphics.ItemIndex := 0;
UpdatePreview();
end;
Administrate();
Show();
end;
procedure TfrmGraphicsEditor.FormClose;
begin
Action := caFree;
GEditor := nil;
end;
procedure TfrmGraphicsEditor.Administrate;
var
bEnabled: Boolean;
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
bEnabled := Active(iIndex, pGraphic);
actDelete.Enabled := bEnabled;
actOpen.Enabled := bEnabled;
if bEnabled then
bEnabled := Assigned(pGraphic.Picture.Graphic)
else
bEnabled := False;
actSave.Enabled := bEnabled;
actClear.Enabled := bEnabled;
actUp.Enabled := bEnabled and (iIndex > 0);
actDown.Enabled := bEnabled and (iIndex < lstGraphics.Items.Count - 1);
end;
procedure TfrmGraphicsEditor.UpdatePreview;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
begin
imgPreview.Picture.Assign(pGraphic.Picture);
txtName.Text := pGraphic.Name;
Administrate();
end;
end;
{===================== TfrmGraphicsEditor
Graphic Management
========================================}
function TfrmGraphicsEditor.Active;
begin
Result := False;
AIndex := lstGraphics.ItemIndex;
if AIndex = -1 then
exit;
AGraphic := TX2GraphicCollectionItem(lstGraphics.Items.Objects[AIndex]);
Result := Assigned(AGraphic);
end;
procedure TfrmGraphicsEditor.lstGraphicsClick;
begin
UpdatePreview();
end;
procedure TfrmGraphicsEditor.txtNameChange;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
begin
pGraphic.Name := txtName.Text;
lstGraphics.Items[iIndex] := pGraphic.DisplayName;
end;
end;
procedure TfrmGraphicsEditor.actAddExecute;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
pGraphic := FComponent.Graphics.Add();
iIndex := lstGraphics.Items.AddObject(pGraphic.DisplayName,
pGraphic);
lstGraphics.ItemIndex := iIndex;
UpdatePreview();
end;
procedure TfrmGraphicsEditor.actDeleteExecute;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
begin
lstGraphics.Items.Delete(iIndex);
FComponent.Graphics.Delete(pGraphic.Index);
if iIndex > lstGraphics.Items.Count - 1 then
iIndex := lstGraphics.Items.Count - 1;
lstGraphics.ItemIndex := iIndex;
UpdatePreview();
end;
end;
procedure TfrmGraphicsEditor.actUpExecute;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
if iIndex > 0 then
begin
lstGraphics.Items.Move(iIndex, iIndex - 1);
pGraphic.Index := iIndex - 1;
lstGraphics.ItemIndex := iIndex - 1;
Administrate();
end;
end;
procedure TfrmGraphicsEditor.actDownExecute;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
if iIndex < lstGraphics.Items.Count - 1 then
begin
lstGraphics.Items.Move(iIndex, iIndex + 1);
pGraphic.Index := iIndex + 1;
lstGraphics.ItemIndex := iIndex + 1;
Administrate();
end;
end;
procedure TfrmGraphicsEditor.actOpenExecute;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
begin
dlgOpen.Filter := GraphicFilter(TGraphic);
if dlgOpen.Execute() then
begin
pGraphic.Picture.LoadFromFile(dlgOpen.FileName);
if Length(pGraphic.Name) = 0 then
pGraphic.Name := ExtractFileName(dlgOpen.FileName);
UpdatePreview();
end;
end;
end;
procedure TfrmGraphicsEditor.actSaveExecute;
var
iIndex: Integer;
pClass: TGraphicClass;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
if Assigned(pGraphic.Picture.Graphic) then begin
pClass := TGraphicClass(pGraphic.Picture.Graphic.ClassType);
dlgSave.Filter := GraphicFilter(pClass);
dlgSave.FileName := ChangeFileExt(pGraphic.Name, '.' + GraphicExtension(pClass));
if dlgSave.Execute() then
pGraphic.Picture.SaveToFile(dlgSave.FileName);
end;
end;
procedure TfrmGraphicsEditor.actClearExecute;
var
iIndex: Integer;
pGraphic: TX2GraphicCollectionItem;
begin
if Active(iIndex, pGraphic) then
begin
pGraphic.Picture.Assign(nil);
UpdatePreview();
end;
end;
end.

BIN
Resources/Icons/Add.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Resources/Icons/Clear.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Resources/Icons/Down.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Resources/Icons/Open.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Resources/Icons/Remove.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Resources/Icons/Save.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
Resources/Icons/Up.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B