{*************************************************************************
                Copyright (c) PilotLogic Software House

  Package pl_ORCA
  This file is part of CodeTyphon Studio (https://www.pilotlogic.com/)

 ***** BEGIN LICENSE BLOCK *****
 * Version: LGPL-2.1 with link exception (Modified LGPL)
 *
 * The contents of this file are subject to the 
 * GNU LIBRARY GENERAL PUBLIC LICENSE Version 2.1 (the "License")
 * with the following modification:
 * 
 * As a special exception, the copyright holders of this library give you
 * permission to link this library with independent modules to produce an
 * executable, regardless of the license terms of these independent modules,
 * and to copy and distribute the resulting executable under terms of your choice,
 * provided that you also meet, for each linked independent module, the terms
 * and conditions of the license of that module. An independent module is a
 * module which is not derived from or based on this library. If you modify this
 * library, you may extend this exception to your version of the library, but
 * you are not obligated to do so. If you do not wish to do so, delete this
 * exception statement from your version.
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * ***** END LICENSE BLOCK *****
 
***************************************************************************}

Unit AllOrcaRegister;

{$mode objfpc}{$H+}

{$I orca_define.inc}
{$H+}
{$ALIGN ON}
{$MINENUMSIZE 4}

Interface

Uses
   LCLProc, LCLType, LMessages, LResources, TypInfo,
   LazIDEIntf, ObjectInspector,
   PropEdits, ComponentEditors, Graphics,
   Classes, Controls, Dialogs, ExtDlgs, SysUtils, Forms,
   orca_scene2d,
   orca_editor_brush,
   orca_editor_imagelist,
   orca_editor_lang,
   orca_editor_style,
   orca_editor_bitmap,
   orca_editor_pathdata;

Type


   TD2BrushProperty = Class(TClassProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure Edit; Override;
   End;

   TD2BitmapProperty = Class(TClassProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure Edit; Override;
   End;

   TD2PathDataProperty = Class(TClassProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure Edit; Override;
   End;

   TD2ResourceProperty = Class(TClassProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure Edit; Override;
   End;

   TD2WideStringsProperty = Class(TClassProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure Edit; Override;
   End;

   TD2FontProperty = Class(TClassProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure Edit; Override;
   End;

   TD2TriggerProperty = Class(TStringProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure GetValues(Proc: TGetStrProc); Override;
      Procedure SetValue(Const Value: String); Override;
   End;

   TD2LangProperty = Class(TStringProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Procedure Edit; Override;
   End;

   TD2LangEditor = Class(TComponentEditor)
   Private
   Public
      Procedure Edit; Override;
   End;

   TD2ImgListEditor = Class(TComponentEditor)
   Private
   Public
      Procedure Edit; Override;
   End;

   TD2GradientProperty = Class(TStringProperty)
   Private
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
      Procedure SetValue(Const Value: String); Override;
      Procedure Edit; Override;
   End;

   TD2ObjectParentProperty = Class(TComponentPropertyEditor)
   Private
   Public
      Procedure GetValues(Proc: TGetStrProc); Override;
      Procedure SetValue(Const NewValue: Ansistring); Override;
   End;

   TD2IDEDesigner = Class(TD2Designer)
   Private
      FAddedHandler: Boolean;
      Procedure AddHandlers;
      Procedure DoOnBeforeOjcInspMenuUpup(Sender: TObject);
      Procedure DoOnSetSelection(Const ASelection: TPersistentSelectionList);
      Procedure SetObjectInspector(APersistent: TPersistent);
   Public
      Constructor Create(AOwner: TComponent); Override;
      Destructor Destroy; Override;
      Procedure SelectObject(ADesignerForm: TComponent; AObject: TD2Object; MultiSelection: Array Of TD2Object); Override;
      Procedure Modified(ADesignerForm: TComponent); Override;
      Function UniqueName(ADesignerForm: TComponent; Const aClassName: String): String; Override;
      Function IsSelected(ADesignerForm: TComponent; AObject: TObject): Boolean; Override;
      Procedure EditStyle(Res: TD2Resources; Const ASelected: String); Override;
      Procedure AddObject(APersistent: TPersistent); Override;
      Procedure Add2DObject(AObject: TD2Object); Override;
      Procedure Delete2DObject(AObject: TD2Object); Override;
   End;

   TD2PositionProperty = Class(TClassProperty)
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
   End;

   TD2BoundsProperty = Class(TClassProperty)
   Public
      Function GetAttributes: TPropertyAttributes; Override;
      Function GetValue: String; Override;
   End;

Procedure Register;

Implementation

{$R *.res}

//================= TD2IDEDesigner ========================
// For 2D Objects Editors

Procedure TD2IDEDesigner.AddHandlers;
Begin
   //If Assigned(VarObjectInspector) Then
   //Begin
   //   VarObjectInspector.PupupMenuBeforeExec := @DoOnBeforeOjcInspMenuUpup;
   //End;

   If FAddedHandler = True Then
      Exit;

   If Assigned(GlobalDesignHook) Then
   Begin
      GlobalDesignHook.AddHandlerSetSelection(@DoOnSetSelection);
      FAddedHandler := True;
   End;
End;

Procedure TD2IDEDesigner.DoOnSetSelection(Const ASelection: TPersistentSelectionList);
Var
   xSel: TComponent;
Begin
   AddHandlers;

   If ASelection = nil Then
      Exit;
   If ASelection.Count = 0 Then
      Exit;

   xSel := TComponent(ASelection.Items[0]);
   If xSel = nil Then
      Exit;

   //..... For 2D ..................
   If (xSel Is TD2VisualObject) Then
      If TD2VisualObject(xSel).Scene <> nil Then
      Begin
         TD2VisualObject(xSel).Scene.SetSelected(TD2VisualObject(xSel));
      End;

   SetObjectInspector(xSel);
End;

Procedure TD2IDEDesigner.DoOnBeforeOjcInspMenuUpup(Sender: TObject);
Var
   XSelList: TPersistentSelectionList;
   xsel: TPersistent;
Begin
   //If VarObjectInspector = nil Then
   //   Exit;
   //
   //XSelList := VarObjectInspector.Selection;
   //
   //If XSelList = nil Then
   //   Exit;
   //If XSelList.Count < 1 Then
   //   Exit;
   //
   //xSel := XSelList.Items[0];
   //If xSel = nil Then
   //   Exit;
   //
   //SetObjectInspector(xSel);
End;

Procedure TD2IDEDesigner.SetObjectInspector(APersistent: TPersistent);
Begin
   //If VarObjectInspector = nil Then
   //   Exit;
   //
   //If (APersistent Is TD2VisualObject) Then
   //Begin
   //   VarObjectInspector.PupupMenuClone.Enabled := False;
   //   VarObjectInspector.PupupMenuCopy.Enabled := False;
   //   VarObjectInspector.PupupMenuCut.Enabled := False;
   //   VarObjectInspector.PupupMenuPaste.Enabled := False;
   //   VarObjectInspector.PupupMenuDelete.Enabled := False;
   //End Else
   //If (APersistent Is TD2Object) Then
   //Begin
   //   VarObjectInspector.PupupMenuClone.Enabled := False;
   //   VarObjectInspector.PupupMenuCopy.Enabled := False;
   //   VarObjectInspector.PupupMenuCut.Enabled := False;
   //   VarObjectInspector.PupupMenuPaste.Enabled := False;
   //   VarObjectInspector.PupupMenuDelete.Enabled := True;
   //End Else Begin
   //   VarObjectInspector.PupupMenuSetDefaultValues;
   //End;
End;

Constructor TD2IDEDesigner.Create(AOwner: TComponent);
Begin
   Inherited;
   FAddedHandler := False;
   AddHandlers;
End;

Destructor TD2IDEDesigner.Destroy;
Begin
   SetObjectInspector(nil);

   If GlobalDesignHook <> nil Then
      GlobalDesignHook.RemoveHandlerSetSelection(@DoOnSetSelection);

   //If VarObjectInspector <> nil Then
   //   VarObjectInspector.PupupMenuBeforeExec := nil;

   Inherited;
End;

Procedure TD2IDEDesigner.AddObject(APersistent: TPersistent);
Begin
   AddHandlers;

   If APersistent = nil Then
      exit;
   If GlobalDesignHook = nil Then
      exit;

   GlobalDesignHook.PersistentAdded(APersistent, False);
End;

Procedure TD2IDEDesigner.Add2DObject(AObject: TD2Object);
Begin
   AddHandlers;

   If AObject = nil Then
      exit;
   If GlobalDesignHook = nil Then
      exit;

   GlobalDesignHook.PersistentAdded(AObject, False);
End;

Procedure TD2IDEDesigner.Delete2DObject(AObject: TD2Object);
Begin
   AddHandlers;

   If AObject = nil Then
      exit;
   If GlobalDesignHook = nil Then
      exit;

   GlobalDesignHook.PersistentDeleted(AObject);
End;

Procedure TD2IDEDesigner.Modified(ADesignerForm: TComponent);
Begin
   AddHandlers;

   If ADesignerForm <> nil Then
      If (ADesignerForm Is TCustomForm) Then
         If TCustomForm(ADesignerForm).Designer <> nil Then
         Begin
            TCustomForm(ADesignerForm).Designer.Modified;
         End;

   If GlobalDesignHook <> nil Then
      GlobalDesignHook.Modified(ADesignerForm);
End;

Procedure TD2IDEDesigner.SelectObject(ADesignerForm: TComponent; AObject: TD2Object; MultiSelection: Array Of TD2Object);
Begin
   AddHandlers;

   If (ADesignerForm Is TCustomForm) Then
      If TCustomForm(ADesignerForm).Designer <> nil Then
      Begin
         TComponentEditorDesigner(TCustomForm(ADesignerForm).Designer).ClearSelection;
         TCustomForm(ADesignerForm).Designer.SelectOnlyThisComponent(AObject);
      End;

   If GlobalDesignHook <> nil Then
      GlobalDesignHook.SelectOnlyThis(AObject);

   SetObjectInspector(AObject);
End;

Function TD2IDEDesigner.IsSelected(ADesignerForm: TComponent; AObject: TObject): Boolean;
Begin
   Result := False;
End;

Function TD2IDEDesigner.UniqueName(ADesignerForm: TComponent; Const aClassName: String): String;
Var
   xss: String;
Begin
   Result := '';
   xss := aClassName;

   If (ADesignerForm Is TCustomForm) Then
      If (TCustomform(ADesignerForm).Designer <> nil) Then
      Begin
         If (xss <> '') Then
            If (Pos('TD2', xss) = 1) Then
               Delete(xss, 1, 3);

         Result := TCustomForm(ADesignerForm).Designer.UniqueName('T' + xss);
      End;
End;

Procedure TD2IDEDesigner.EditStyle(Res: TD2Resources; Const ASelected: String);
Begin
   Inherited;
   DesignResources(Res, ASelected);
End;

//-------------- TD2ObjectParentProperty -----------------------------

Procedure TD2ObjectParentProperty.GetValues(Proc: TGetStrProc);
Begin
   If Assigned(PropertyHook) Then
      PropertyHook.GetComponentNames(GetTypeData(TD2VisualObject.ClassInfo), Proc);
End;

Procedure TD2ObjectParentProperty.SetValue(Const NewValue: Ansistring);
Begin
   Inherited;
   If GlobalDesignHook <> nil Then
      GlobalDesignHook.Modified(nil);
End;

//-------------- TD2BrushProperty -----------------------------
Function TD2BrushProperty.GetValue: String;
Begin
   Result := '(TD2Brush)';
End;

Procedure TD2BrushProperty.Edit;
Begin
   selectInDesign(TD2Brush(GetObjectValue), GetComponent(0));
End;

Function TD2BrushProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
End;

//----------------- TD2BitmapProperty -----------------------------
Function TD2BitmapProperty.GetValue: String;
Begin
   Result := '(TD2Bitmap)';
End;

Procedure TD2BitmapProperty.Edit;
Var
   bm: TD2Bitmap;
Begin
   GvarD2BitmapEditor := TD2BitmapEditor.Create(nil);

   bm := TD2Bitmap(GetObjectValue);

   GvarD2BitmapEditor.AssignFromBitmap(bm);

   If GvarD2BitmapEditor.ShowModal = mrOk Then
   Begin
      GvarD2BitmapEditor.AssignToBitmap(bm);
      Modified;
   End;
   GvarD2BitmapEditor.Free;
End;


Function TD2BitmapProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paDialog, paReadOnly];
End;

//----------------- TD2PathDataProperty -----------------------------
Function TD2PathDataProperty.GetValue: String;
Begin
   Result := '(TD2PathData)';
End;

Procedure TD2PathDataProperty.Edit;
Var
   EditDlg: TD2PathDataDesigner;
   pd: TD2PathData;
Begin
   EditDlg := TD2PathDataDesigner.Create(nil);

   pd := TD2PathData(GetObjectValue);

   EditDlg.Lines.Text := pd.Data;


   If EditDlg.ShowModal = mrOk Then
   Begin
      pd.Data := EditDlg.Lines.Text;
      If GetComponent(0) Is TD2VisualObject Then
         TD2VisualObject(GetComponent(0)).Repaint;
      Modified;
   End;
   EditDlg.Free;
End;

Function TD2PathDataProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paDialog, paReadOnly];
End;

//----------------- TD2ResourceProperty -----------------------------
Function TD2ResourceProperty.GetValue: String;
Begin
   Result := '(TD2Resources)';
End;

Procedure TD2ResourceProperty.Edit;
Begin
   If DesignResources(TD2Resources(GetComponent(0)), '') Then
      Modified;
End;

Function TD2ResourceProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paDialog, paReadOnly];
End;

//------------------ TD2WideStringsProperty----------------------

Function TD2WideStringsProperty.GetValue: String;
Begin
   Result := '(TD2WideStrings)';
End;

Procedure TD2WideStringsProperty.Edit;
Var
   EditDlg: TD2PathDataDesigner;
   SaveWrap: Boolean;
Begin
   EditDlg := TD2PathDataDesigner.Create(nil);
   EditDlg.cnMemo.WordWrap := False;
   EditDlg.Caption := 'WideStrings Editor';

   If GetComponent(0) Is TD2Memo Then
   Begin
      EditDlg.cnMemo.WordWrap := False;
      SaveWrap := TD2Memo(GetComponent(0)).WordWrap;
      TD2Memo(GetComponent(0)).WordWrap := False;
      EditDlg.cnMemo.Lines.Assign(TD2WideStrings(GetObjectValue));
      TD2Memo(GetComponent(0)).WordWrap := SaveWrap;
   End Else Begin
      EditDlg.cnMemo.WordWrap := True;
      EditDlg.cnMemo.Lines.Assign(TD2WideStrings(GetObjectValue));
   End;

   EditDlg.previewLayout.Visible := False;
   // EditDlg.cnMemo.Text := 'Type items:';

   If EditDlg.ShowModal = mrOk Then
   Begin
      TD2WideStrings(GetObjectValue).Text := EditDlg.cnMemo.Lines.Text;
      If GetComponent(0) Is TD2VisualObject Then
         TD2VisualObject(GetComponent(0)).Repaint;

      Modified;
   End;
   EditDlg.Free;
End;

Function TD2WideStringsProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paDialog, paReadOnly];
End;

//----------------- TD2FontProperty -----------------------------
Function TD2FontProperty.GetValue: String;
Begin
   Result := '(TD2Font)';
End;

Procedure TD2FontProperty.Edit;
Var
   F: TFontDialog;
   TF: TD2Font;
Begin
   F := TFontDialog.Create(nil);
   TF := TD2Font(GetObjectValue);
   If TF = nil Then
      exit;
   TF.AssignTo(F.Font);

   If F.Execute Then
   Begin
      TF.Assign(F.Font);
      Modified;
   End;
   F.Free;
End;

Function TD2FontProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
End;

//----------------- TD2TriggerProperty -----------------------------

Function TD2TriggerProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paMultiSelect, paValueList, paRevertable];
End;

Procedure TD2TriggerProperty.GetValues(Proc: TGetStrProc);
Begin
   Try
      Proc('IsMouseOver=true');
      Proc('IsMouseOver=false');
      Proc('IsFocused=true');
      Proc('IsFocused=false');
      Proc('IsVisible=true');
      Proc('IsVisible=false');
      Proc('IsDragOver=true');
      Proc('IsDragOver=false');
      Proc('IsOpen=true');
      Proc('IsOpen=false');
   Except
      on E: Exception Do
         ShowMessage(E.Message);
   End;
End;

Function TD2TriggerProperty.GetValue: String;
Begin
   Try
      Result := GetStrValue;
   Except
      on E: Exception Do
         ShowMessage(E.Message);
   End;
End;

Procedure TD2TriggerProperty.SetValue(Const Value: String);
Begin
   Try
      SetStrValue(Value);
      Modified;
   Except
      on E: Exception Do
         ShowMessage(E.Message);
   End;
End;

//----------------- TD2LangProperty -----------------------------

Function TD2LangProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paDialog, paRevertable];
End;

Procedure TD2LangProperty.Edit;
Begin
   ShowDsgnLang(TD2Lang(GetComponent(0)));
End;

//----------------- TD2LangEditor -----------------------------

Procedure TD2LangEditor.Edit;
Begin
   ShowDsgnLang(TD2Lang(Component));
End;

//----------------- TD2ImgListEditor -----------------------------

Procedure TD2ImgListEditor.Edit;
Begin
   ShowDsgnImageList(TD2ImageList(Component));
End;

//----------------- TD2GradientProperty -----------------------------
Function TD2GradientProperty.GetValue: String;
Begin
   Result := '(TD2Gradient)';
End;

Procedure TD2GradientProperty.Edit;
Var
   D: TD2BrushDialog;
Begin
   D := TD2BrushDialog.Create(Application);
   D.ShowStyles := [d2BrushGradient];
   D.ShowBrushList := False;
   D.Brush.Style := d2BrushGradient;
   D.Brush.Gradient.Assign(TD2Gradient(GetObjectValue));
   If D.Execute Then
   Begin
      TD2Gradient(GetObjectValue).Assign(D.Brush.Gradient);
   End;
   D.Free;
End;

Function TD2GradientProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paDialog, paReadOnly];
End;

Procedure TD2GradientProperty.SetValue(Const Value: String);
Begin
   Try
      SetStrValue(Value);
      Modified;
   Except
      on E: Exception Do
         ShowMessage(E.Message);
   End;
End;

//----------------- TD2PositionProperty -------------------

Function TD2PositionProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paSubProperties];
End;

Function TD2PositionProperty.GetValue: String;
Var
   col: TD2Position;
Begin
   col := TD2Position(GetObjectValue);

   Result := Format('(%g; %g)', [col.X, col.Y]);
End;

//----------------- TD2PositionProperty -------------------

Function TD2BoundsProperty.GetAttributes: TPropertyAttributes;
Begin
   Result := [paSubProperties];
End;

Function TD2BoundsProperty.GetValue: String;
Var
   col: TD2Bounds;
Begin
   col := TD2Bounds(GetObjectValue);

   Result := Format('(%g; %g; %g; %g)', [col.Bottom, col.Left, col.Right, col.Top]);
End;

//================== Register Routines ===============

Procedure Register;
Begin
   //------ Visible Components -----------------------

   RegisterComponents('ORCA', [TD2Scene, TD2BrushDialog, TD2Resources, TD2Lang,
      TD2ImageList]);
   //-- 2D Components ---------------------------------

   RegisterNoIcon([TD2ColorAnimation, TD2GradientAnimation, TD2FloatAnimation, TD2RectAnimation, TD2BitmapAnimation,
      TD2BitmapListAnimation, TD2ColorKeyAnimation, TD2FloatKeyAnimation, TD2PathAnimation, TD2PathSwitcher,
      TD2ShadowEffect, TD2BlurEffect, TD2GlowEffect, TD2InnerGlowEffect, TD2BevelEffect, TD2ReflectionEffect,
      TD2CalendarBox, TD2GroupBox, TD2PathCheckBox, TD2Content, TD2ScrollContent, TD2TextControl, TD2CheckBox, TD2RadioButton, TD2PopupBox, TD2PopupButton, TD2CornerButton, TD2CircleButton,
      TD2AngleButton, TD2Button, TD2PathButton, TD2ColorButton, TD2BitmapStateButton, TD2SpeedButton, TD2RoundButton, TD2BitmapButton, TD2ColorPanel, TD2ComboColorBox, TD2ColorQuad,
      TD2GradientEdit, TD2AlphaTrackBar, TD2BWTrackBar, TD2HueTrackBar, TD2ColorBox, TD2ColorPicker, TD2CompoundTrackBar, TD2Calendar, TD2CompoundNumberBox, TD2CompoundTextBox, TD2CompoundPopupBox,
      TD2CompoundImage, TD2CompoundMemo, TD2CompoundColorButton, TD2CompoundAngleBar, TD2ProgressBar, TD2CalloutPanel, TD2VertScrollBox, TD2TrackBar, TD2FramedScrollBox, TD2ScrollBar,
      TD2ScrollBox, TD2ValueLabel, TD2AniIndicator, TD2Track, TD2Splitter, TD2Expander, TD2ImageControl, TD2Label, TD2FramedVertScrollBox, TD2SmallScrollBar, TD2Panel, TD2TabControl,
      TD2DBLabel, TD2DBTextBox, TD2DBNavigator, TD2DBMemo, TD2DBImage, TD2DBGrid, TD2DesignFrame, TD2Selection, TD2SelectionPoint, TD2Inspector, TD2ImageViewer, TD2DropTarget, TD2IPhoneButton,
      TD2Header, TD2StringGrid, TD2Grid, TD2ProgressColumn, TD2ImageColumn, TD2Column, TD2PopupColumn, TD2CheckColumn, TD2HudNumberBox, TD2HudScrollBar, TD2HudStringComboBox, TD2HudAlphaTrackBar,
      TD2HudCloseButton, TD2HudCornerButton, TD2HudSizeGrip, TD2HudRadioButton, TD2HudComboColorBox, TD2HudMemo, TD2HudStringListBox, TD2HudTrack, TD2HudHorzImageListBox, TD2HudSpeedButton,
      TD2HudWindow, TD2HudListBox, TD2HudHorzListBox, TD2HudRoundTextBox, TD2HudLabel, TD2HudCircleButton, TD2HudGroupBox, TD2HudStatusBar, TD2HudPanel, TD2HudBWTrackBar, TD2HudHueTrackBar,
      TD2HudComboTrackBar, TD2HudImageListBox, TD2HudSpinBox, TD2HudComboBox, TD2HudAngleButton, TD2HudButton, TD2HudRoundButton, TD2HudCheckBox, TD2HudPopupBox, TD2HudTextBox, TD2HudComboTextBox,
      TD2HudTrackBar, TD2HudTabControl, TD2HeaderItem, TD2ImageListBoxItem, TD2HudTabItem, TD2TabItem, TD2TreeViewItem, TD2ListBoxItem, TD2GridLayout, TD2Frame, TD2Layout, TD2SplitLayout,
      TD2ScaledLayout, TD2Nond2Layout, TD2StringComboBox, TD2HorzImageListBox, TD2StringListBox, TD2ComboBox, TD2HorzListBox, TD2ImageListBox, TD2ListBox, TD2PlotGrid, TD2Popup, TD2MessagePopup,
      TD2BitmapObject, TD2PathObject, TD2BrushObject, TD2Pie, TD2ScrollArrowRight, TD2Arc, TD2Path, TD2PaintBox, TD2Circle, TD2BlurRoundRect, TD2BlurRectangle, TD2Rectangle, TD2ScrollArrowLeft,
      TD2Line, TD2CalloutRectangle, TD2Text, TD2Image, TD2SidesRectangle, TD2Ellipse, TD2RoundRect, TD2TextBoxClearBtn, TD2TextBox, TD2ComboTextBox, TD2NumberBox, TD2RoundTextBox, TD2Memo,
      TD2CalendarTextBox, TD2SpinBox, TD2ComboTrackBar, TD2StatusBar, TD2ToolButton, TD2ToolPathButton, TD2ToolBar, TD2TreeView, TD2SizeGrip, TD2Background, TD2CloseButton]);

   RegisterComponentEditor(TD2ImageList, TD2ImgListEditor);
   RegisterComponentEditor(TD2Lang, TD2LangEditor);

   RegisterPropertyEditor(TypeInfo(String), TD2Lang, 'Lang', TD2LangProperty);
   RegisterPropertyEditor(TypeInfo(String), TD2Effect, 'Trigger', TD2TriggerProperty);
   RegisterPropertyEditor(TypeInfo(String), TD2Animation, 'Trigger', TD2TriggerProperty);
   RegisterPropertyEditor(TypeInfo(String), TD2Animation, 'TriggerInverse', TD2TriggerProperty);
   RegisterPropertyEditor(TypeInfo(TStrings), TD2Resources, 'Resource', TD2ResourceProperty);
   RegisterPropertyEditor(TypeInfo(TD2Object), TD2Object, 'Parent', TD2ObjectParentProperty);
   RegisterPropertyEditor(TypeInfo(TD2Gradient), nil, '', TD2GradientProperty);
   RegisterPropertyEditor(TypeInfo(TD2Brush), nil, '', TD2BrushProperty);
   RegisterPropertyEditor(TypeInfo(TD2Bitmap), nil, '', TD2BitmapProperty);
   RegisterPropertyEditor(TypeInfo(TD2PathData), nil, '', TD2PathDataProperty);
   RegisterPropertyEditor(TypeInfo(TD2WideStrings), nil, '', TD2WideStringsProperty);
   RegisterPropertyEditor(TypeInfo(TD2Font), nil, '', TD2FontProperty);

   RegisterPropertyEditor(TypeInfo(TD2Position), nil, '', TD2PositionProperty);
   RegisterPropertyEditor(TypeInfo(TD2Bounds), nil, '', TD2BoundsProperty);
End;

//=======================================================

Initialization
   GvarD2Designer := TD2IDEDesigner.Create(nil);

Finalization
   GvarD2Designer.Free;
   GvarD2Designer := nil;
End.
