{ ------------------------------------------------------------- }
{ Purpose : NxInspector 6                                       }
{ By      : Bojan Nikolic                                       }
{ For     : BergSoft                                            }
{ ------------------------------------------------------------- }
{ Copyright (C) BergSoft.net 2011. All Rights Reserved.         }
{ ------------------------------------------------------------- }
unit NxInspectorNodeClasses6;

interface

uses
  Classes, Types, Graphics,
  { Controls }
  Controls, StdCtrls,
  { TypeInfo }
  TypInfo,
  { Next Standard 6 }
  NxIntf6, NxClasses6, NxTypes6, NxConsts6, NxEdit6,
  { NextInspector 6 }
  NxInspectorNode6;

resourcestring
  { Strings }
  stGrayed = 'Grayed';

const
  { Sizes }
  szToolButtonWidth = 17;
  szMinNodeHeight = 5;

  { Paddings }
  pdPicturePadding = 8;

  { Counts }
  cnFavoritesCount = 3;

const
  { Exceptions }
  exNegativeValue = 'Value must be larger than 0 (%g)';

type
  { TNxGraphicInspectorNode }

  TNxGraphicInspectorNode6 = class(TNxInspectorNode6)
  public
    function CanEdit: Boolean; override;
  end;

  { TNxBooleanInspectorNode6 }

  TNxBooleanInspectorNode6 = class(TNxGraphicInspectorNode6)
  private
    FBooleanValue: Boolean;
  protected
    function GetAsBoolean: Boolean; override;
    procedure SetAsBoolean(const Value: Boolean); override;
  public
    constructor Create(AOwner: TComponent); override;
  end;

  { TNxIntegerInspectorNode6 }

  INxIntegerInspectorItem = interface(INxBase)
    ['{B71CB71C-2207-482E-BE0C-D678C85A1C7A}']
    { Property Accessors }
    function GetMax: Integer;
    function GetMin: Integer;
    { Properties }
    property Max: Integer read GetMax;
    property Min: Integer read GetMin;
  end;

  TNxIntegerInspectorNode6 = class(TNxInspectorNode6, INxIntegerInspectorItem)
  private
    FMax: Integer;
    FMin: Integer;
    { Value Container }
    FIntegerValue: Integer;
    { Property Accessors }
    function GetMax: Integer;
    function GetMin: Integer;
    procedure SetMax(const Value: Integer);
    procedure SetMin(const Value: Integer);
  protected
    { INxBase }
    function GetAsInteger: Integer; override;
    procedure SetAsInteger(const Value: Integer); override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    constructor Create(AOwner: TComponent); override;
    function CheckRange: Boolean;
  published
    property Max: Integer read GetMax write SetMax default 0;
    property Min: Integer read GetMin write SetMin default 0;
  end;

  { TNxFloatInspectorNode6 }

  TNxFloatInspectorNode6 = class(TNxInspectorNode6)
  private
    FDoubleValue: Double;
    FFormatMask: string;
    FMax: Double;
    FMin: Double;
    FNumericEditOptions: TNxNumericEditOptions;
    FPrecision: Integer;
    function GetMax: Double;
    function GetMin: Double;
    function GetPrecision: Integer;
    procedure SetFormatMask(const Value: string);
    procedure SetMax(const Value: Double);
    procedure SetMin(const Value: Double);
    procedure SetPrecision(const Value: Integer);
  protected
    { INxInspectorItem }
    function GetDisplayText: WideString; override;
    { INxBase }
    function GetAsFloat: Double; override;
    function GetAsString: WideString; override;
    procedure SetAsFloat(const Value: Double); override;
    procedure SetAsString(const Value: WideString); override;
    procedure SetValue(const Value: WideString); override;
  public
    procedure Assign(Source: TPersistent); override;
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    procedure AssignProperty(TypeKind: TTypeKind); override;
    constructor Create(AOwner: TComponent); override;
    function CheckRange: Boolean;
    procedure FitInsideRange(var AValue: Double);
    function IsEmpty: Boolean; override;
  published
    property FormatMask: string read FFormatMask write SetFormatMask;
    property Max: Double read GetMax write SetMax;
    property Min: Double read GetMin write SetMin;
    property NumericEditOptions: TNxNumericEditOptions read FNumericEditOptions write FNumericEditOptions default [ednDecimals, ednSigns];
    property Precision: Integer read GetPrecision write SetPrecision default 2;
  end;

  TNxEditableFloatInspectorNode6 = class(TNxFloatInspectorNode6)
  private
    FEditable: Boolean;
    FShowHint: Boolean;
    FTextAfter: WideString;
    { Property Accessors }
    procedure SetEditable(const Value: Boolean);
    procedure SetShowHint(const Value: Boolean);
    procedure SetTextAfter(const Value: WideString);
  protected
    function GetDisplayText: WideString; override;
  public
    { Virtual Methods }
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    function BeginEdit: INxInplaceEdit; override;
    function CanEdit: Boolean; override;
    constructor Create(AOwner: TComponent); override;
    function EditWidth: Integer; override;
  published
    property AsInteger: Integer read GetAsInteger write SetAsInteger;
    property Editable: Boolean read FEditable write SetEditable default True;
    property Max;
    property Precision default 2;
    property ShowHint: Boolean read FShowHint write SetShowHint default True;
    property TextAfter: WideString read FTextAfter write SetTextAfter;
  end;

  { TNxEditableIntegerInspectorNode6 }

  TNxEditableIntegerInspectorNode6 = class(TNxIntegerInspectorNode6)
  private
    FEditable: Boolean;
    FShowHint: Boolean;
    FTextAfter: WideString;
    { Property Accessors }
    function GetEditable: Boolean;
    function GetShowHint: Boolean;
    procedure SetEditable(const Value: Boolean);
    procedure SetShowHint(const Value: Boolean);
    procedure SetTextAfter(const Value: WideString);
  protected
    function GetDisplayText: WideString; override;
    function GetTextAfter: WideString;
  public
    { Virtual Methods }
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    function BeginEdit: INxInplaceEdit; override;
    function CanEdit: Boolean; override;
    constructor Create(AOwner: TComponent); override;
    function EditWidth: Integer; override;
  published
    property AsInteger: Integer read GetAsInteger write SetAsInteger;
    property Editable: Boolean read GetEditable write SetEditable default True;
    property Max default 100;
    property ShowHint: Boolean read GetShowHint write SetShowHint default True;
    property TextAfter: WideString read GetTextAfter write SetTextAfter;
  end;

  { TNxButtonInspectorNode6 }

  TNxButtonInspectorNode6 = class(TNxInspectorNode6)
  private
    FButtonCaption: WideString;
    FButtonEdit: TNxButtonEdit6;
    FButtonGlyph: TPicture;
    FButtonWidth: Integer;
    FOnButtonClick: TNotifyEvent;
    procedure SetButtonGlyph(const Value: TPicture);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    { Virtual Methods }
    procedure Assign(Source: TPersistent); override;
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    function BeginEdit: INxInplaceEdit; override;
  published
    { Properties }
    property ButtonCaption: WideString read FButtonCaption write FButtonCaption;
    property ButtonGlyph: TPicture read FButtonGlyph write SetButtonGlyph;
    property ButtonWidth: Integer read FButtonWidth write FButtonWidth default szExecuteButton;
    { Events }
    property OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick;
  end;

  { TNxCheckBoxInspectorItem }

	TNxCheckBoxTextKind = (tkDefault, tkTrueFalse, tkYesNo, tkEnabledDisabled,
    tkUserDefined);

  INxCheckable = interface
    ['{8F1E3D76-1960-4516-B980-AB7FA1272B36}']
    { Property Accessors }
    function GetShowText: Boolean;
    function GetVerticalAlignment: TVerticalAlignment;
    { Properties }
    property ShowText: Boolean read GetShowText;
    property VerticalAlignment: TVerticalAlignment read GetVerticalAlignment;
    { Methods }
    procedure Toggle;
  end;

  { TNxCheckableInspectorNode6 }

  TNxCheckableInspectorNode6 = class(TNxBooleanInspectorNode6, INxCheckable)
  private
    { Property Fields }
    FFalseText: WideString;
    FOnCheck: TNxInspectorNodeNotifyEvent;
    FShowText: Boolean;
    FTextKind: TNxCheckBoxTextKind;
    FTrueText: WideString;
    FVerticalAlignment: TVerticalAlignment;
    { Property Accessors }
    function GetShowText: Boolean;
    function GetVerticalAlignment: TVerticalAlignment;
    procedure SetFalseText(const Value: WideString);
    procedure SetShowText(const Value: Boolean);
    procedure SetTextKind(const Value: TNxCheckBoxTextKind);
    procedure SetTrueText(const Value: WideString);
    procedure SetVerticalAlignment(const Value: TVerticalAlignment);
  protected
    procedure DoCheck; dynamic;
  public
    constructor Create(AOwnert: TComponent); override;
    procedure Assign(Source: TPersistent); override;
    procedure Toggle; virtual; abstract;
  published
    { Properties }
    property FalseText: WideString read FFalseText write SetFalseText;
    property ShowText: Boolean read GetShowText write SetShowText default False;
    property TextKind: TNxCheckBoxTextKind read FTextKind write SetTextKind default tkDefault;
    property TrueText: WideString read FTrueText write SetTrueText;
    property VerticalAlignment: TVerticalAlignment read FVerticalAlignment write SetVerticalAlignment default taVerticalCenter;
    { Events }
    property OnCheck: TNxInspectorNodeNotifyEvent read FOnCheck write FOnCheck;
  end;

  INxCheckBoxInspectorItem = interface(INxCheckable)
    ['{F991F9F5-0458-4344-86D1-94C4C2926C34}']
    { Property Accessors }
    function GetAllowGrayed: Boolean;
    function GetState: TCheckBoxState;
    { Methods }
    function GetStateText(AState: TCheckBoxState): WideString;
    procedure SetState(const Value: TCheckBoxState);
    { Properties }
    property AllowGrayed: Boolean read GetAllowGrayed;
    property State: TCheckBoxState read GetState write SetState;
  end;

  { TNxCheckBoxInspectorNode6 }

  TNxCheckBoxInspectorNode6 = class(TNxCheckableInspectorNode6, INxCheckBoxInspectorItem)
  private
    { Property Fields }
    FAllowGrayed: Boolean;
    FGrayedText: WideString;
    FState: TCheckBoxState;
    { Property Accessors }
    function GetAllowGrayed: Boolean;
    function GetState: TCheckBoxState;
    procedure SetAllowGrayed(const Value: Boolean);
    procedure SetGrayedText(const Value: WideString);
    procedure SetState(const Value: TCheckBoxState);
  protected
    { INxBase }
    function GetAsString: WideString; override;
    { Virtual Mathods }
    function GetNodeStyle: TNxInspectorNodeStyle; override;
    function GetViewClass: TNxInspectorNodeViewClass; override;
    { INxBase }
    procedure SetAsString(const Value: WideString); override;
  public
    constructor Create(AOwner: TComponent); override;
    procedure Assign(Source: TPersistent); override;
    { INxCheckBoxInspectorItem }
    function GetStateText(AState: TCheckBoxState): WideString;
    procedure SetAsBoolean(const Value: Boolean); override;
    { INxCheckableInspectorItem }
    procedure Toggle; override;
  published
    property AllowGrayed: Boolean read GetAllowGrayed write SetAllowGrayed default False;
    property GrayedText: WideString read FGrayedText write SetGrayedText;
    property State: TCheckBoxState read GetState write SetState default cbUnchecked;
  end;

  { TNxRadioInspectorNode6 }

  INxRadioInspectorItem = interface
    ['{80620580-3B1A-4677-A23C-5375CD787021}']
  end;

  TNxRadioInspectorNode6 = class(TNxCheckableInspectorNode6, INxRadioInspectorItem)
  private
    { Property Fields }
    FGroupIndex: Integer;
    { Property Accessors }
    procedure SetGroupIndex(const Value: Integer);
  protected
    { Methods }
    procedure DoCheck; override;
    { INxBase }
    function GetAsString: WideString; override;
    { Virtual Mathods }
    function GetViewClass: TNxInspectorNodeViewClass; override;
    { INxBase }
    procedure SetAsBoolean(const Value: Boolean); override;
  public
    constructor Create(AOwner: TComponent); override;
    procedure Assign(Source: TPersistent); override;
    { INxRadioInspectorNode }
    function GetValueText(AValue: Boolean): WideString;
    { INxCheckableInspectorNode }
    procedure Toggle; override;
  published
    property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0;
  end;

  { TNxSpinInspectorNode6 }

  TNxSpinInspectorNode6 = class(TNxFloatInspectorNode6)
  private
    FIncrement: Double;
  public
    constructor Create(AOwner: TComponent); override;
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    function BeginEdit: INxInplaceEdit; override;
  published
    property Increment: Double read FIncrement write FIncrement;
  end;

  { TNxProgressInspectorNode6 }

  TNxProgressInspectorNode6 = class(TNxEditableFloatInspectorNode6)
  private
    { Property Fields }
    FBorderColor: TColor;
    FOuterMargin: Integer;
    FProgressColor: TColor;
    FProgressHeight: Integer;
    FProgressMargin: Integer;
    FProgressStyle: TNxProgressBarStyle;
    FRoundCorners: Boolean;
    FTransparent: Boolean;
    { Property Accessors }
    procedure SetBorderColor(const Value: TColor);
    procedure SetOuterMargin(const Value: Integer);
    procedure SetProgressColor(const Value: TColor);
    procedure SetProgressHeight(const Value: Integer);
    procedure SetProgressMargin(const Value: Integer);
    procedure SetProgressStyle(const Value: TNxProgressBarStyle);
    procedure SetRoundCorners(const Value: Boolean);
    procedure SetTransparent(const Value: Boolean);
  protected
    function GetViewClass: TNxInspectorNodeViewClass; override;
  public
    constructor Create(AOwner: TComponent); override;
    procedure Assign(Source: TPersistent); override;
  published
    property BorderColor: TColor read FBorderColor write SetBorderColor default clGrayText;
    property OuterMargin: Integer read FOuterMargin write SetOuterMargin;
    property ProgressColor: TColor read FProgressColor write SetProgressColor default clHighlight;
    property ProgressHeight: Integer read FProgressHeight write SetProgressHeight default 0;
    property ProgressMargin: Integer read FProgressMargin write SetProgressMargin default 2;
    property ProgressStyle: TNxProgressBarStyle read FProgressStyle write SetProgressStyle default pbStyled;
    property RoundCorners: Boolean read FRoundCorners write SetRoundCorners default False;
    property Transparent: Boolean read FTransparent write SetTransparent default False;
  end;

  { TNxTrackBarInspectorNode6 }

  TNxTrackBarInspectorNode6 = class(TNxEditableIntegerInspectorNode6)
  protected
    function GetViewClass: TNxInspectorNodeViewClass; override;
  end;

  { TNxColorPaletteInspectorNode6 }

  TNxColorHintData = set of (hdWebName, hdWebCode, hdRGB);

  TNxColorPaletteInspectorNode6 = class(TNxGraphicInspectorNode6)
  private
    { Fields }
    FColorKind: TNxColorKind;
    FColors: TStrings;
    FFavorites: TStrings;
    FFavoritesCount: Integer;
    FFullSize: Boolean;
    FHintData: TNxColorHintData;
    FUseColorNames: Boolean;
    { Property Accessors }
    function GetAsColor: TColor;
    function GetFavorite(Index: Integer): TColor;
    procedure SetAsColor(const Value: TColor);
    procedure SetColorKind(const Value: TNxColorKind);
    procedure SetColors(const Value: TStrings);
    procedure SetFavorites(const Value: TStrings);
    procedure SetFavoritesCount(const Value: Integer);
    procedure SetFullSize(const Value: Boolean);
    procedure SetHintData(const Value: TNxColorHintData);
    procedure SetUseColorNames(const Value: Boolean);
  protected
    procedure DoColorsChange(Sender: TObject);
    { INxBase }
    function GetAsInteger: Integer; override;
    { Virtual Mathods }
    function GetFullSizeHeight: Integer; virtual;
    function GetViewClass: TNxInspectorNodeViewClass; override;
  public
    constructor Create(AOwner: TComponent); override;
    procedure Assign(Source: TPersistent); override;
    destructor Destroy; override;
    function HasFavorites: Boolean;
    function StrToColor(Value: string): TColor;
    { Properties }
    property Favorite[Index: Integer]: TColor read GetFavorite;
  published
    { Properties }
    property AsColor: TColor read GetAsColor write SetAsColor;
    property ColorKind: TNxColorKind read FColorKind write SetColorKind default ckDelphi;
    property Colors: TStrings read FColors write SetColors;
    property Favorites: TStrings read FFavorites write SetFavorites;
    property FavoritesCount: Integer read FFavoritesCount write SetFavoritesCount default cnFavoritesCount;
    property FullSize: Boolean read FFullSize write SetFullSize default False;
    property FullSizeHeight: Integer read GetFullSizeHeight;
    property HintData: TNxColorHintData read FHintData write SetHintData default [hdWebName, hdWebCode, hdRGB];
    property UseColorNames: Boolean read FUseColorNames write SetUseColorNames default False;
  end;

  { TNxPictureInspectorNode6 }

  TNxPictureInspectorNode6 = class(TNxGraphicInspectorNode6)
  private
    { Property Fields }
    FBorderPen: TPen;
    FEffects: TNxPaintEffects;
    FPicture: TPicture;
    { Property Accessors }
    procedure SetBorderPen(const Value: TPen);
    procedure SetEffects(const Value: TNxPaintEffects);
    procedure SetPicture(const Value: TPicture);
  protected
    procedure DoBorderPenChange(Sender: TObject); dynamic;
    procedure DoPictureChange(Sender: TObject); dynamic;
    procedure DoValueChanged; override;
    function GetViewClass: TNxInspectorNodeViewClass; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property BorderPen: TPen read FBorderPen write SetBorderPen;
    property Effects: TNxPaintEffects read FEffects write SetEffects default [];
    property Picture: TPicture read FPicture write SetPicture;
  end;

  { TNxMemoInspectorNode6 }

  TNxMemoInspectorNode6 = class(TNxInspectorNode6)
  protected
    function GetViewClass: TNxInspectorNodeViewClass; override;
  public
    function BeginEdit: INxInplaceEdit; override;
    constructor Create(AOwner: TComponent); override;
  end;

  { TNxToolbarInspectorNode6 }

  TNxToolbarInspectorNode6 = class;
  TNxToolbarNodeButtons = class;

  TNxToolButtonEvent = procedure (Sender: TNxToolbarInspectorNode6; const Index: Integer) of object;

  TNxToolbarNodeButton = class(TCollectionItem)
  private
    FAllowGrayed: Boolean;
    FAutoCheck: Boolean;
    FChecked: Boolean;
    FCollection: TNxToolbarNodeButtons;
    FDivider: Boolean;
    FGlyph: TBitmap;
    FHint: string;
    FIndeterminate: Boolean;
    FShowText: Boolean;
    FText: WideString;
    FTransparent: Boolean;
    FTransparentColor: TColor;
    function GetButtonHeight: Integer;
    function GetButtons: TNxToolbarNodeButtons;
    procedure SetChecked(const Value: Boolean);
    procedure SetDivider(const Value: Boolean);
    procedure SetGlyph(const Value: TBitmap);
    procedure SetHint(const Value: string);
    procedure SetIndeterminate(const Value: Boolean);
    procedure SetShowText(const Value: Boolean);
    procedure SetText(const Value: WideString);
    procedure SetTransparent(const Value: Boolean);
    procedure SetTransparentColor(const Value: TColor);
  protected
    procedure DoGlyphChange(Sender: TObject);
    procedure Refresh;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    property ButtonHeight: Integer read GetButtonHeight;
    property Buttons: TNxToolbarNodeButtons read GetButtons;
  published
    property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default False;
    property AutoCheck: Boolean read FAutoCheck write FAutoCheck default True;
    property Checked: Boolean read FChecked write SetChecked default False;
    property Divider: Boolean read FDivider write SetDivider default False;
    property Glyph: TBitmap read FGlyph write SetGlyph;
    property Hint: string read FHint write SetHint;
    property Indeterminate: Boolean read FIndeterminate write SetIndeterminate default False;
    property ShowText: Boolean read FShowText write SetShowText default False;
    property Text: WideString read FText write SetText;
    property Transparent: Boolean read FTransparent write SetTransparent default False;
    property TransparentColor: TColor read FTransparentColor write SetTransparentColor default clNone;
  end;

  TNxToolbarNodeButtons = class(TCollection)
  private
    FOwner: TNxToolbarInspectorNode6;
    procedure Check(Button: TNxToolbarNodeButton);
    function GetCheckedCount: Integer;
    function GetItem(Index: Integer): TNxToolbarNodeButton;
    procedure SetItem(Index: Integer; const Value: TNxToolbarNodeButton);
  protected
    function CanUncheck: Boolean;
    function GetOwner: TPersistent; override;
  public
    constructor Create(AOwner: TNxToolbarInspectorNode6);
    function Add: TNxToolbarNodeButton;
    property CheckedCount: Integer read GetCheckedCount;
    property Items[Index: Integer]: TNxToolbarNodeButton read GetItem write SetItem; default;
  end;

  TNxToolbarInspectorNode6 = class(TNxGraphicInspectorNode6)
  private
    FAllowAllUp: Boolean;
    FButtonHeight: Integer;
    FButtons: TNxToolbarNodeButtons;
    FButtonWidth: Integer;
    FGrouped: Boolean;
    FOnToolButtonChecked: TNxToolButtonEvent;
    FOnToolButtonClick: TNxToolButtonEvent;
    FSeparator: WideChar;
    FShowText: Boolean;
    FSpacing: Integer;
    { Property Accessors }
    procedure SetButtonHeight(const Value: Integer);
    procedure SetButtons(const Value: TNxToolbarNodeButtons);
    procedure SetButtonWidth(const Value: Integer);
    procedure SetSeparator(const Value: WideChar);
    procedure SetShowText(const Value: Boolean);
    procedure SetSpacing(const Value: Integer);
  protected
    { Virtual Methods }
    function GetAsString: WideString; override;
    function GetDisplayText: WideString; override;
    function GetValue: WideString; override;
    function GetViewClass: TNxInspectorNodeViewClass; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    { Event Handlers }
    procedure DoToolButtonChecked(const Index: Integer); dynamic;
    procedure DoToolButtonClick(const Index: Integer); dynamic;
    { Properties }
  published
    property AllowAllUp: Boolean read FAllowAllUp write FAllowAllUp default False;
    property ButtonHeight: Integer read FButtonHeight write SetButtonHeight default 0;
    property Buttons: TNxToolbarNodeButtons read FButtons write SetButtons;
    property ButtonWidth: Integer read FButtonWidth write SetButtonWidth default 0;
    property Grouped: Boolean read FGrouped write FGrouped default False;
    property OnToolButtonChecked: TNxToolButtonEvent read FOnToolButtonChecked write FOnToolButtonChecked;
    property OnToolButtonClick: TNxToolButtonEvent read FOnToolButtonClick write FOnToolButtonClick;
    property Separator: WideChar read FSeparator write SetSeparator;
    property ShowText: Boolean read FShowText write SetShowText default False;
    property Spacing: Integer read FSpacing write SetSpacing default 0;
  end;

  { TNxRateInspectorNode6 }

  TNxRateInspectorNode6 = class(TNxEditableIntegerInspectorNode6)
  private
    { Property Fields }
    FGlyph: TBitmap;
    FGlyphPlaceholder: TBitmap;
    { Property Accessors }
    procedure SetGlyph(const Value: TBitmap);
    procedure SetGlyphPlaceholder(const Value: TBitmap);
  protected
    { Event Handlers }
    procedure DoGlyphChange(Sender: TObject);
    { Virtual Methods }
    function GetViewClass: TNxInspectorNodeViewClass; override;
  public
    procedure BestFit(Entities: TNxInspectorNodeEntity = [etCaption, etValue]); override;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property Glyph: TBitmap read FGlyph write SetGlyph;
    property GlyphPlaceholder: TBitmap read FGlyphPlaceholder write SetGlyphPlaceholder;
    property Max default 5;
  end;

  { TNxStringsInspectorNode6 }

  TNxStringsInspectorNode6 = class(TNxInspectorNode6)
  private
    { Property Fields }
    FAutoDropDown: Boolean;
    FDisplayMode: TNxStringsDisplayMode;
    FDropDownCount: Integer;
    FLines: TStrings;
    FItemHeight: Integer;
    { Property Accessors }
    procedure SetDisplayMode(const Value: TNxStringsDisplayMode);
    procedure SetLines(const Value: TStrings);
  protected
    procedure DoLinesChange(Sender: TObject); dynamic;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    { Properties }
    property AutoDropDown: Boolean read FAutoDropDown write FAutoDropDown default False;
    property DisplayMode: TNxStringsDisplayMode read FDisplayMode write SetDisplayMode default dmDefault;
    property DropDownCount: Integer read FDropDownCount write FDropDownCount default 8;
    property ItemHeight: Integer read FItemHeight write FItemHeight default 13;
    property Lines: TStrings read FLines write SetLines;
  end;

  { TNxListInspectorNode6 }

  TNxListInspectorNode6 = class(TNxStringsInspectorNode6)
  private
    { Property Fields }
    FItemIndex: Integer;
    { Property Accessors }
    function GetItemIndex: Integer;
    procedure SetItemIndex(const Value: Integer);
  protected
    function GetNodeStyle: TNxInspectorNodeStyle; override;
    { INxBase }
    function GetAsString: WideString; override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    function BeginEdit: INxInplaceEdit; override;
    constructor Create(AOwner: TComponent); override;
  published
    property ItemIndex: Integer read GetItemIndex write SetItemIndex default -1;
  end;

  { TNxComboBoxInspectorNode6 }

  TNxComboBoxInspectorNode6 = class(TNxStringsInspectorNode6)
  private
    FAutoComplete: Boolean;
    FStyle: TNxDropDownStyle;
  public
    procedure AssignEdit(Edit: INxInplaceEdit); override;
    function BeginEdit: INxInplaceEdit; override;
    constructor Create(AOwner: TComponent); override;
  published
    property AutoComplete: Boolean read FAutoComplete write FAutoComplete default False;
    property Style: TNxDropDownStyle read FStyle write FStyle default dsDropDown;
  end;

  { TNxDateInspectorNode6 }

  TNxDateInspectorNode6 = class(TNxInspectorNode6)
  protected
    function GetAsFloat: Double; override;
    procedure SetAsFloat(const Value: Double); override;
  public
    { Virtual Methods }
    function BeginEdit: INxInplaceEdit; override;
  end;

  { TNxHTMLTextInspectorNode6 }

  TNxHTMLTextInspectorNode6 = class(TNxToolbarInspectorNode6)
  public
    function CanEdit: Boolean; override;
    constructor Create(AOwner: TComponent); override;
    { Virtual Methods }
    function BeginEdit: INxInplaceEdit; override;
  end;

implementation

uses
  { Standard }
  SysUtils, StrUtils, Dialogs, Math,
  { Next Standard 6 }
  NxGraphics6,
  { NextInspector 6 }
  NxInspectorNodeViewClasses6;

{ TNxGraphicInspectorNode6 }

function TNxGraphicInspectorNode6.CanEdit: Boolean;
begin
  { This kind of Items don't have InplaceEdit }
  Result := False;
end;

{ TNxBooleanInspectorItem }

constructor TNxBooleanInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FBooleanValue := False;
end;

function TNxBooleanInspectorNode6.GetAsBoolean: Boolean;
begin
  Result := FBooleanValue;
end;

procedure TNxBooleanInspectorNode6.SetAsBoolean(const Value: Boolean);
begin
  FBooleanValue := Value;
  inherited; { Set `Value` (AsString) }
end;

{ TNxIntegerInspectorItem }

procedure TNxIntegerInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxNumberEdit).NumericEditOptions := [ednSigns];
end;

function TNxIntegerInspectorNode6.CheckRange: Boolean;
begin
  Result := (FMin <> 0) and (FMax <> 0);
end;

constructor TNxIntegerInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FIntegerValue := Min;

  { Set Value Prop. }
  FValue := IntToStr(FIntegerValue);
end;

function TNxIntegerInspectorNode6.GetAsInteger: Integer;
begin
  Result := FIntegerValue;
end;

function TNxIntegerInspectorNode6.GetMax: Integer;
begin
  Result := FMax;
end;

function TNxIntegerInspectorNode6.GetMin: Integer;
begin
  Result := FMin;
end;

procedure TNxIntegerInspectorNode6.SetAsInteger(const Value: Integer);
var
  FNewValue: Integer;
begin
  FNewValue := Value;

  if CheckRange then
  begin
    if FNewValue > FMax then FNewValue := FMax;
    if FNewValue < FMin then FNewValue := FMin;
  end;

  if FNewValue <> FIntegerValue then
  begin
    FIntegerValue := FNewValue;

    { Set Value Prop. }
    inherited SetAsInteger(FIntegerValue);
  end;
end;

procedure TNxIntegerInspectorNode6.SetAsString(const Value: WideString);
begin
  AsInteger := StrToIntDef(Value, 0);
  { 11/15/11: Will not cause a recursion since
              there is a checking for same value }
  inherited;
end;

procedure TNxIntegerInspectorNode6.SetMax(const Value: Integer);
begin
  FMax := Value;
end;

procedure TNxIntegerInspectorNode6.SetMin(const Value: Integer);
begin
  FMin := Value;
end;

{ TNxFloatInspectorItem }

procedure TNxFloatInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxFloatInspectorNode6 then
  begin
    FormatMask := TNxFloatInspectorNode6(Source).FormatMask;
    Max := TNxFloatInspectorNode6(Source).Max;
    Min := TNxFloatInspectorNode6(Source).Min;
    NumericEditOptions := TNxFloatInspectorNode6(Source).NumericEditOptions;
    Precision := TNxFloatInspectorNode6(Source).Precision;
  end;
end;

procedure TNxFloatInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxNumberEdit).NumericEditOptions := FNumericEditOptions;
  (Edit as INxNumberEdit).Precision := FPrecision;
end;

procedure TNxFloatInspectorNode6.AssignProperty(TypeKind: TTypeKind);
begin
  case TypeKind of
    tkInteger, tkInt64: Precision := 0;
  end;
end;

function TNxFloatInspectorNode6.CheckRange: Boolean;
begin
  Result := (FMin <> 0) and (FMax <> 0);
end;

constructor TNxFloatInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FDoubleValue := 0;
  FFormatMask := '';
  FMin := 0;
  FMax := 0;
  FNumericEditOptions := [ednDecimals, ednSigns];
  FPrecision := 2;
end;

procedure TNxFloatInspectorNode6.FitInsideRange(var AValue: Double);
begin
  if CheckRange then
  begin
    if AValue > FMax then AValue := FMax;
    if AValue < FMin then AValue := FMin;
  end;
end;

function TNxFloatInspectorNode6.GetAsFloat: Double;
begin
  Result := FDoubleValue;
end;

function TNxFloatInspectorNode6.GetAsString: WideString;
begin
  if FPrecision > 0 then
    Result := FloatToStrF(FDoubleValue, ffFixed, 18, FPrecision)
      else Result := FloatToStr(FDoubleValue);
  DoGetValue(Result);
end;

function TNxFloatInspectorNode6.GetDisplayText: WideString;
begin
  if FFormatMask <> EmptyStr
    then Result := FormatFloat(FFormatMask, FDoubleValue)
      else Result := inherited GetDisplayText;
end;

function TNxFloatInspectorNode6.GetMax: Double;
begin
  Result := FMax;
end;

function TNxFloatInspectorNode6.GetMin: Double;
begin
  Result := FMin;
end;

function TNxFloatInspectorNode6.GetPrecision: Integer;
begin
  Result := FPrecision;
end;

function TNxFloatInspectorNode6.IsEmpty: Boolean;
begin
  Result := FDoubleValue = 0;
end;

procedure TNxFloatInspectorNode6.SetAsFloat(const Value: Double);
var
  AValue: Double;
begin
  AValue := Value;

  FitInsideRange(AValue);

  if AValue <> FDoubleValue then
  begin
    FDoubleValue := AValue;

    { Set Value Prop. }
    inherited SetAsFloat(FDoubleValue);
  end;
end;

procedure TNxFloatInspectorNode6.SetAsString(const Value: WideString);
begin
  inherited;
  AsFloat := StrToFloatDef(Value, 0);
end;

procedure TNxFloatInspectorNode6.SetFormatMask(const Value: string);
begin
  if Value <> FFormatMask then
  begin
    FFormatMask := Value;
    Refresh;
  end;
end;

procedure TNxFloatInspectorNode6.SetMax(const Value: Double);
begin
  if Value <> FMax then
  begin
    FMax := Value;
    FitInsideRange(FDoubleValue);
  end;
end;

procedure TNxFloatInspectorNode6.SetMin(const Value: Double);
begin
  if Value <> FMin then
  begin
    FMin := Value;
    FitInsideRange(FDoubleValue);
  end;
end;

procedure TNxFloatInspectorNode6.SetPrecision(const Value: Integer);
begin
  if Value <> FPrecision then
  begin
    FPrecision := Value;
    Refresh;
  end;
end;

procedure TNxFloatInspectorNode6.SetValue(const Value: WideString);
begin
  if Value <> EmptyStr then
  begin
    FDoubleValue := StrToFloat(Value);
  end
  else FDoubleValue := 0;
  inherited SetValue(FloatToStr(FDoubleValue));
end;

{ TNxEditableFloatInspectorItem }

procedure TNxEditableFloatInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxNumberEdit).Max := Max;
  (Edit as INxNumberEdit).Min := Min;
  (Edit as INxNumberEdit).Precision := Precision;
  (Edit as INxNumberEdit).TextAfter := TextAfter;
  (Edit as INxNumberEdit).NumericEditOptions := NumericEditOptions;
end;

function TNxEditableFloatInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxSpinEdit6.Create(Self);
end;

function TNxEditableFloatInspectorNode6.CanEdit: Boolean;
begin
  Result := inherited CanEdit and Editable;
end;

constructor TNxEditableFloatInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FEditable := True;
  FShowHint := True;
  FPrecision := 2;
  FTextAfter := '%';

  { Inherited Properties }
  FMax := 100;
  FMin := 0;

  FNumericEditOptions := [ednDecimals];

  { Set Properties }
  Padding.SetBounds(pdStandard, 0, pdStandard, 0);
end;

function TNxEditableFloatInspectorNode6.EditWidth: Integer;
begin
  Result := inherited EditWidth;
  if Editable then Result := 60;
end;

function TNxEditableFloatInspectorNode6.GetDisplayText: WideString;
begin
  Result := inherited GetDisplayText + TextAfter;
end;

procedure TNxEditableFloatInspectorNode6.SetEditable(const Value: Boolean);
begin
  FEditable := Value;
end;

procedure TNxEditableFloatInspectorNode6.SetShowHint(const Value: Boolean);
begin
  FShowHint := Value;
end;

procedure TNxEditableFloatInspectorNode6.SetTextAfter(const Value: WideString);
begin
  if Value <> FTextAfter then
  begin
    FTextAfter := Value;

    Changed; { Notify }
  end;
end;

{ TNxEditableItntegerInspectorItem }

procedure TNxEditableIntegerInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxNumberEdit).Max := Max;
  (Edit as INxNumberEdit).Min := Min;
  (Edit as INxNumberEdit).Precision := 0;
  (Edit as INxNumberEdit).TextAfter := TextAfter;
end;

function TNxEditableIntegerInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxSpinEdit6.Create(Self);
end;

function TNxEditableIntegerInspectorNode6.CanEdit: Boolean;
begin
  Result := inherited CanEdit and Editable;
end;

constructor TNxEditableIntegerInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FEditable := True;
  FShowHint := True;
  FTextAfter := '%';

  { Inherited Properties }
  FMax := 100;
  FMin := 0;

  { Set Properties }
  Padding.SetBounds(pdStandard, 0, pdStandard, 0);
end;

function TNxEditableIntegerInspectorNode6.EditWidth: Integer;
begin
  Result := inherited EditWidth;
  if Editable then Result := 60;
end;

function TNxEditableIntegerInspectorNode6.GetDisplayText: WideString;
begin
  Result := inherited GetDisplayText + TextAfter;
end;

function TNxEditableIntegerInspectorNode6.GetEditable: Boolean;
begin
  Result := FEditable;
end;

function TNxEditableIntegerInspectorNode6.GetShowHint: Boolean;
begin
  Result := FShowHint;
end;

function TNxEditableIntegerInspectorNode6.GetTextAfter: WideString;
begin
  Result := FTextAfter;
end;

procedure TNxEditableIntegerInspectorNode6.SetEditable(const Value: Boolean);
begin
  FEditable := Value;
end;

procedure TNxEditableIntegerInspectorNode6.SetShowHint(const Value: Boolean);
begin
  FShowHint := Value;
end;

procedure TNxEditableIntegerInspectorNode6.SetTextAfter(const Value: WideString);
begin
  if Value <> FTextAfter then
  begin
    FTextAfter := Value;

    Changed; { Notify }
  end;
end;

{ TNxButtonInspectorItem }

procedure TNxButtonInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxButtonInspectorNode6 then
  begin
    ButtonCaption := TNxButtonInspectorNode6(Source).ButtonCaption;
    ButtonGlyph.Assign(TNxButtonInspectorNode6(Source).ButtonGlyph);
    ButtonWidth := TNxButtonInspectorNode6(Source).ButtonWidth;
    OnButtonClick := TNxButtonInspectorNode6(Source).OnButtonClick;
  end;
end;

procedure TNxButtonInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  FButtonEdit.ButtonCaption := ButtonCaption;
  FButtonEdit.ButtonGlyph := ButtonGlyph;
  FButtonEdit.ButtonWidth := ButtonWidth;
  (Edit as INxButtonEdit).SetOnButtonClick(FOnButtonClick);
end;

function TNxButtonInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  FButtonEdit := TNxButtonEdit6.Create(Self);
  Result := FButtonEdit;
end;

constructor TNxButtonInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FButtonCaption := '';
  FButtonGlyph := TPicture.Create;
  FButtonWidth := szExecuteButton;
end;

destructor TNxButtonInspectorNode6.Destroy;
begin
  FreeAndNil(FButtonGlyph);
  inherited;
end;

procedure TNxButtonInspectorNode6.SetButtonGlyph(const Value: TPicture);
begin
  FButtonGlyph.Assign(Value);
end;

{ TNxCustomCheckBoxInspectorItem }

procedure TNxCheckableInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxCheckableInspectorNode6 then
  begin
    FalseText := TNxCheckableInspectorNode6(Source).FalseText;
    ShowText := TNxCheckableInspectorNode6(Source).ShowText;
    TextKind := TNxCheckableInspectorNode6(Source).TextKind;
    TrueText := TNxCheckableInspectorNode6(Source).TrueText;
    VerticalAlignment := TNxCheckableInspectorNode6(Source).VerticalAlignment;
  end;
end;

constructor TNxCheckableInspectorNode6.Create(AOwnert: TComponent);
begin
  inherited;
  FFalseText := '';
  FShowText := False;
  FTextKind := tkDefault;
  FTrueText := '';
  FVerticalAlignment := taVerticalCenter;
end;

procedure TNxCheckableInspectorNode6.DoCheck;
begin
  if Assigned(FOnCheck) then FOnCheck(Self);
end;

function TNxCheckableInspectorNode6.GetShowText: Boolean;
begin
  Result := FShowText;
end;

function TNxCheckableInspectorNode6.GetVerticalAlignment: TVerticalAlignment;
begin
  Result := FVerticalAlignment;
end;

procedure TNxCheckableInspectorNode6.SetFalseText(const Value: WideString);
begin
  if Value <> FFalseText then
  begin
    FFalseText := Value;
    Refresh;
  end;
end;

procedure TNxCheckableInspectorNode6.SetShowText(const Value: Boolean);
begin
  if Value <> FShowText then
  begin
    FShowText := Value;
    Refresh;
  end;
end;

procedure TNxCheckableInspectorNode6.SetTextKind(const Value: TNxCheckBoxTextKind);
begin
  if Value <> FTextKind then
  begin
    FTextKind := Value;
    Refresh;
  end;
end;

procedure TNxCheckableInspectorNode6.SetTrueText(const Value: WideString);
begin
  if Value <> FTrueText then
  begin
    FTrueText := Value;
    Refresh;
  end;
end;

procedure TNxCheckableInspectorNode6.SetVerticalAlignment(const Value: TVerticalAlignment);
begin
  if Value <> FVerticalAlignment then
  begin
    FVerticalAlignment := Value;
    Refresh;
  end;
end;

{ TNxCheckBoxInspectorItem }

procedure TNxCheckBoxInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxCheckBoxInspectorNode6 then
  begin
    AllowGrayed := TNxCheckBoxInspectorNode6(Source).AllowGrayed;
    GrayedText := TNxCheckBoxInspectorNode6(Source).GrayedText;
    State := TNxCheckBoxInspectorNode6(Source).State;
  end;
end;

constructor TNxCheckBoxInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FAllowGrayed := False;
  FFalseText := 'False';
  FShowText := False;
  FState := cbUnchecked;
  FTextKind := tkDefault;
  FTrueText := 'True';

  { Value }
  FBooleanValue := False;
end;

function TNxCheckBoxInspectorNode6.GetAllowGrayed: Boolean;
begin
  Result := FAllowGrayed;
end;

function TNxCheckBoxInspectorNode6.GetAsString: WideString;
begin
  Result := GetStateText(State);
end;

function TNxCheckBoxInspectorNode6.GetNodeStyle: TNxInspectorNodeStyle;
begin
  Result := [itExplicitChange];
end;

function TNxCheckBoxInspectorNode6.GetState: TCheckBoxState;
begin
  Result := FState;
end;

function TNxCheckBoxInspectorNode6.GetStateText(AState: TCheckBoxState): WideString;
begin
  case TextKind of
    tkDefault:
      case AState of
        cbUnchecked:  Result := BoolToStr(False, True);
        cbChecked:    Result := BoolToStr(True, True);
        cbGrayed:     Result := stGrayed;
      end;
    tkTrueFalse:
      case AState of
        cbUnchecked:  Result := 'False';
        cbChecked:    Result := 'True';
        cbGrayed:     Result := 'Grayed';
      end;
    tkYesNo:
      case AState of
        cbUnchecked:  Result := 'No';
        cbChecked:    Result := 'Yes';
        cbGrayed:     Result := 'Indeterminate';
      end;
    tkEnabledDisabled:
      case AState of
        cbUnchecked:  Result := 'Disabled';
        cbChecked:    Result := 'Enabled';
        cbGrayed:     Result := 'Grayed';
      end;
    tkUserDefined:
      case AState of
        cbUnchecked:  Result := IfThen(FFalseText <> EmptyStr, FFalseText, 'false');
        cbChecked:    Result := IfThen(FTrueText <> EmptyStr, FTrueText, 'true');
        cbGrayed:     Result := IfThen(FGrayedText <> EmptyStr, FGrayedText, 'grayed');
      end;
  end;
end;

function TNxCheckBoxInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxCheckBoxNodeView;
end;

procedure TNxCheckBoxInspectorNode6.SetAllowGrayed(const Value: Boolean);
begin
  FAllowGrayed := Value;
end;

procedure TNxCheckBoxInspectorNode6.SetAsBoolean(const Value: Boolean);
begin
  { Set BooleanNode `AsBoolean` (`FValue`) }
  inherited;
  if Value then State := cbChecked else State := cbUnchecked;
end;

procedure TNxCheckBoxInspectorNode6.SetAsString(const Value: WideString);
begin
  inherited;
  case TextKind of
    tkDefault:
      if LowerCase(Value) = 'grayed' then State := cbGrayed
      else
        case StrToBoolEx(Value) of
          True: State := cbChecked;
          else State := cbUnchecked;
        end;

    tkEnabledDisabled:
      if LowerCase(Value) = 'grayed' then State := cbGrayed
      else if LowerCase(Value) = 'enabled' then State := cbChecked
      else State := cbUnchecked;

    tkYesNo:
      if LowerCase(Value) = 'indeterminate' then State := cbGrayed
      else if LowerCase(Value) = 'yes' then State := cbChecked
      else State := cbUnchecked;

    tkTrueFalse:
      if LowerCase(Value) = 'grayed' then State := cbGrayed
      else if LowerCase(Value) = 'true' then State := cbChecked
      else State := cbUnchecked;

    tkUserDefined:
      if LowerCase(Value) = LowerCase(GrayedText) then State := cbGrayed
      else if LowerCase(Value) = LowerCase(TrueText) then State := cbChecked
      else State := cbUnchecked;
  end;
end;

procedure TNxCheckBoxInspectorNode6.SetGrayedText(const Value: WideString);
begin
  FGrayedText := Value;
  if ShowText and (State = cbGrayed) then Refresh;
end;

procedure TNxCheckBoxInspectorNode6.SetState(const Value: TCheckBoxState);
begin
  if Value <> FState then
  begin
    FState := Value;

    { Set `AsBoolean` }
    FBooleanValue := FState = cbChecked;

    { Set `Value` & repaint }
    AsString := GetStateText(FState);

    DoCheck; { `OnCheck` Event }
  end;
end;

procedure TNxCheckBoxInspectorNode6.Toggle;
begin
  if AllowGrayed then
  begin

    if State = cbGrayed then State := cbChecked else
    begin
      { note: Button may be Grayed,
              only if is not checked (!) }
      if State = cbChecked then State := cbUnchecked else State := cbGrayed;
    end;

  end
  else if State = cbChecked then State := cbUnchecked else State := cbChecked; { Normal }
end;

{ TNxRadioInspectorItem }

procedure TNxRadioInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxRadioInspectorNode6 then
  begin
    GroupIndex := TNxRadioInspectorNode6(Source).GroupIndex;
  end;
end;

constructor TNxRadioInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FGroupIndex := 0;
end;

procedure TNxRadioInspectorNode6.DoCheck;
var
  i: Integer;
begin
  inherited;
  if AsBoolean then
    for i := 0 to Pred(ParentNode.Count) do
      if ParentNode.Node[i] <> Self then
      begin
        if ParentNode.Node[i] is TNxRadioInspectorNode6
          and (GroupIndex = TNxRadioInspectorNode6(ParentNode.Node[i]).GroupIndex) then
            ParentNode.Node[i].AsBoolean := False;
      end;
end;

function TNxRadioInspectorNode6.GetAsString: WideString;
begin
  Result := GetValueText(AsBoolean);
end;

function TNxRadioInspectorNode6.GetValueText(AValue: Boolean): WideString;
begin
  case TextKind of
    tkDefault: Result := BoolToStr(AValue, True);
    tkTrueFalse: Result := IfThen(AValue, 'True', 'False');
    tkYesNo: Result := IfThen(AValue, 'Yes', 'No');
    tkEnabledDisabled: Result := IfThen(AValue, 'Enabled', 'Disabled');
    tkUserDefined:
      case AValue of
        True: Result := IfThen(FFalseText <> EmptyStr, FFalseText, 'true');
        else Result := IfThen(FTrueText <> EmptyStr, FTrueText, 'false');
      end;
  end;
end;

function TNxRadioInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxRadioButtonNodeView;
end;

procedure TNxRadioInspectorNode6.SetAsBoolean(const Value: Boolean);
begin
  inherited;
  DoCheck; { Trigger Event & Uncheck others }
end;

procedure TNxRadioInspectorNode6.SetGroupIndex(const Value: Integer);
begin
  FGroupIndex := Value;
end;

procedure TNxRadioInspectorNode6.Toggle;
begin
  AsBoolean := not AsBoolean;
end;

{ TNxSpinInspectorNode6 }

procedure TNxSpinInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxNumberEdit).Max := Max;
  (Edit as INxNumberEdit).Min := Min;
  (Edit as INxSpinEdit).Increment := Increment;
end;

function TNxSpinInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxSpinEdit6.Create(Self);
end;

constructor TNxSpinInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FIncrement := 1;
end;

{ TNxColorPaletteItem }

procedure TNxColorPaletteInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxColorPaletteInspectorNode6 then
  begin
    ColorKind := TNxColorPaletteInspectorNode6(Source).ColorKind;
    Colors.Assign(TNxColorPaletteInspectorNode6(Source).Colors);
    FavoritesCount := TNxColorPaletteInspectorNode6(Source).FavoritesCount;
    FullSize := TNxColorPaletteInspectorNode6(Source).FullSize;
    HintData := TNxColorPaletteInspectorNode6(Source).HintData;
    UseColorNames := TNxColorPaletteInspectorNode6(Source).UseColorNames;
  end;
end;

constructor TNxColorPaletteInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FColorKind := ckDelphi;
  FColors := TNxStringList.Create;
  TNxStringList(FColors).OnChange := DoColorsChange;
  FFavorites := TNxStringList.Create;
  TNxStringList(FFavorites).OnChange := DoColorsChange;
  FFavorites.Add('clBlue');
  FFavorites.Add('clRed');
  FFavorites.Add('clGreen');
  FFavoritesCount := cnFavoritesCount;
  FFullSize := False;
  FHintData := [hdWebName, hdWebCode, hdRGB];
  FUseColorNames := False;
  Padding.SetBounds(1, 1, 1, 1);
end;

destructor TNxColorPaletteInspectorNode6.Destroy;
begin
  FFavorites.Free;
  FColors.Free;
  inherited;
end;

procedure TNxColorPaletteInspectorNode6.DoColorsChange(Sender: TObject);
begin
  Refresh;
end;

function TNxColorPaletteInspectorNode6.GetAsColor: TColor;
begin
  Result := StrToColor(AsString);
end;

function TNxColorPaletteInspectorNode6.GetAsInteger: Integer;
begin
  Result := Integer(AsColor);
end;

function TNxColorPaletteInspectorNode6.GetFavorite(Index: Integer): TColor;
begin
  if InRange(Index, 0, Pred(FFavorites.Count))
    then Result := StrToColor(FFavorites[Index])
      else Result := clNone;
end;

function TNxColorPaletteInspectorNode6.GetFullSizeHeight: Integer;
begin
  Result := TNxColorPaletteNodeView(View).FullSizeHeight;
end;

function TNxColorPaletteInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxColorPaletteNodeView;
end;

function TNxColorPaletteInspectorNode6.HasFavorites: Boolean;
begin
  Result := FavoritesCount > 0;
end;

procedure TNxColorPaletteInspectorNode6.SetAsColor(const Value: TColor);
var
  S: string;
begin
  case FColorKind of

    ckDelphi:
    begin
      if UseColorNames and ColorToIdent(Integer(Value), S) then
      begin
        AsString := S;

        Exit; { Done }
      end;

      AsString := IntToStr(Value);
    end;

    ckWeb: AsString := ColorToWebColor(Value);
  end;
end;

procedure TNxColorPaletteInspectorNode6.SetColorKind(const Value: TNxColorKind);
begin
  if Value <> FColorKind then
  begin
    FColorKind := Value;

    Changed; { Note: AsString Changed ? }
  end;
end;

procedure TNxColorPaletteInspectorNode6.SetColors(const Value: TStrings);
begin
  FColors.Assign(Value);
  TNxStringList(FColors).OnChange := DoColorsChange;
  Changed;
end;

procedure TNxColorPaletteInspectorNode6.SetFavorites(const Value: TStrings);
begin
  FFavorites.Assign(Value);
  TNxStringList(FFavorites).OnChange := DoColorsChange;
  Changed;
end;

procedure TNxColorPaletteInspectorNode6.SetFavoritesCount(const Value: Integer);
begin
  FFavoritesCount := Value;
end;

procedure TNxColorPaletteInspectorNode6.SetFullSize(const Value: Boolean);
begin
  FFullSize := Value;

  { Notify }
  Notify(ntResized);
end;

procedure TNxColorPaletteInspectorNode6.SetHintData(
  const Value: TNxColorHintData);
begin
  FHintData := Value;
end;

procedure TNxColorPaletteInspectorNode6.SetUseColorNames(const Value: Boolean);
begin
  if Value <> FUseColorNames then
  begin
    FUseColorNames := Value;

    Changed; { Note: AsString Changed ? }
  end;
end;

function TNxColorPaletteInspectorNode6.StrToColor(Value: string): TColor;
begin
  Result := clNone;
  if Value <> '' then
  begin
    case FColorKind of
      ckDelphi:
      begin
        if UseColorNames and IdentToColor(Value, Integer(Result))
          then Exit;

        { Not a Identifier Color }
        Result := StringToColor(Value);
      end;

      ckWeb: Result := WebColorToColor(Value);
    end;
  end;
end;

{ TNxImageInspectorItem }

constructor TNxPictureInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FBorderPen := TPen.Create;
  FBorderPen.OnChange := DoBorderPenChange;
  FEffects := [];
  FPicture := TPicture.Create;
  FPicture.OnChange := DoPictureChange;
  Padding.SetBounds(pdPicturePadding, pdPicturePadding, pdPicturePadding, pdPicturePadding);
end;

destructor TNxPictureInspectorNode6.Destroy;
begin
  FreeAndNil(FBorderPen);
  FreeAndNil(FPicture);
  inherited;
end;

procedure TNxPictureInspectorNode6.DoBorderPenChange(Sender: TObject);
begin
  Changed;
end;

procedure TNxPictureInspectorNode6.DoPictureChange(Sender: TObject);
begin
  Changed;
  Refresh;
end;

procedure TNxPictureInspectorNode6.DoValueChanged;
begin
  inherited;
  if FileExists(AsString) then
  begin
    FPicture.LoadFromFile(AsString);
  end else
  begin
    FreeAndNil(FPicture);
    FPicture := TPicture.Create;
    FPicture.OnChange := DoPictureChange;
  end;
end;

function TNxPictureInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxPictureInspectorNodeView;
end;

procedure TNxPictureInspectorNode6.SetBorderPen(const Value: TPen);
begin
  FBorderPen.Assign(Value);
  FBorderPen.OnChange := DoBorderPenChange;
end;

procedure TNxPictureInspectorNode6.SetEffects(const Value: TNxPaintEffects);
begin
  FEffects := Value;
  Refresh;
  Changed;
end;

procedure TNxPictureInspectorNode6.SetPicture(const Value: TPicture);
begin
  FPicture.Assign(Value);
  FPicture.OnChange := DoPictureChange;
end;

{ TNxMemoInspectorItem }

function TNxMemoInspectorNode6.BeginEdit: INxInplaceEdit;
var
  Memo: TNxMemo6;
begin
  Memo := TNxMemo6.Create(Self);

  { Set Prop. }
  with Memo do
  begin
    WantArrows := wkArrows in WantKeys;
    WantReturns := wkReturns in WantKeys;
    WantTabs := wkTabs in WantKeys;
  end;

  Result := Memo;
end;

constructor TNxMemoInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;

end;

function TNxMemoInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxMemoItemView;
end;

{ TNxToolbarNodeButtons }

procedure TNxToolbarNodeButton.Assign(Source: TPersistent);
begin
  if Source is TNxToolbarNodeButton then
  begin
    AllowGrayed := TNxToolbarNodeButton(Source).AllowGrayed;
    AutoCheck := TNxToolbarNodeButton(Source).AutoCheck;
    Checked := TNxToolbarNodeButton(Source).Checked;
    Divider := TNxToolbarNodeButton(Source).Divider;
    Glyph := TNxToolbarNodeButton(Source).Glyph;
    Indeterminate := TNxToolbarNodeButton(Source).Indeterminate;
    ShowText := TNxToolbarNodeButton(Source).ShowText;
    Text := TNxToolbarNodeButton(Source).Text;
    Transparent := TNxToolbarNodeButton(Source).Transparent;
    TransparentColor := TNxToolbarNodeButton(Source).TransparentColor;
  end;
end;

constructor TNxToolbarNodeButton.Create(Collection: TCollection);
begin
  inherited;
  FAllowGrayed := False;
  FAutoCheck := True;
  FChecked := False;
  FCollection := TNxToolbarNodeButtons(Collection);
  FDivider := False;
  FGlyph := TBitmap.Create;
  FGlyph.OnChange := DoGlyphChange;
  FIndeterminate := False;
  FShowText := False;
  FTransparent := False;
  FTransparentColor := clNone;
  FText := '';
end;

destructor TNxToolbarNodeButton.Destroy;
begin
  FGlyph.Free;
  inherited;
end;

procedure TNxToolbarNodeButton.DoGlyphChange(Sender: TObject);
begin
  FGlyph.Transparent := FTransparent;
  FGlyph.TransparentColor := FTransparentColor;
end;

function TNxToolbarNodeButton.GetButtonHeight: Integer;
begin
  Result := 0;
  if not Glyph.Empty then Result := Glyph.Height;
  Up(Buttons.FOwner.View.Canvas.TextHeight(Text), Result);
end;

function TNxToolbarNodeButton.GetButtons: TNxToolbarNodeButtons;
begin
  Result := TNxToolbarNodeButtons(Collection);
end;

procedure TNxToolbarNodeButton.Refresh;
var
  Ref: INxToolbarItemView;
begin
  if Supports(Buttons.FOwner.View, INxToolbarItemView, Ref) then
  begin
    Ref.RefreshButton(Self);
  end;
end;

procedure TNxToolbarNodeButton.SetChecked(const Value: Boolean);
begin
  if Value <> FChecked then
    if Value or Buttons.CanUncheck then
    begin
      FChecked := Value;
      Buttons.Check(Self); { Uncheck other buttons & trigger event }
      Refresh;
    end;
end;

procedure TNxToolbarNodeButton.SetDivider(const Value: Boolean);
begin
  if Value <> FDivider then
  begin
    FDivider := Value;
    { ToDo: Refresh Button }
  end;
end;

procedure TNxToolbarNodeButton.SetGlyph(const Value: TBitmap);
begin
  FGlyph.Assign(Value);
  { ToDo: Refresh Button }
end;

procedure TNxToolbarNodeButton.SetHint(const Value: string);
begin
  FHint := Value;
end;

procedure TNxToolbarNodeButton.SetIndeterminate(const Value: Boolean);
begin
  FIndeterminate := Value;
  { ToDo: Refresh Button }
end;

procedure TNxToolbarNodeButton.SetShowText(const Value: Boolean);
begin
  FShowText := Value;
  { ToDo: Refresh Item }
end;

procedure TNxToolbarNodeButton.SetText(const Value: WideString);
begin
  if Value <> FText then
  begin
    FText := Value;
    Refresh;
  end;
end;

procedure TNxToolbarNodeButton.SetTransparent(const Value: Boolean);
begin
  if Value <> FTransparent then
  begin
    FTransparent := Value;
    FGlyph.Transparent := FTransparent;
    Refresh;
  end;
end;

procedure TNxToolbarNodeButton.SetTransparentColor(const Value: TColor);
begin
  if Value <> FTransparentColor then
  begin
    FTransparentColor := Value;
    FGlyph.TransparentColor := FTransparentColor;
    Refresh;
  end;
end;

{ TNxToolbarNodeButtons }

function TNxToolbarNodeButtons.Add: TNxToolbarNodeButton;
begin
  Result := TNxToolbarNodeButton(inherited Add);
end;

function TNxToolbarNodeButtons.CanUncheck: Boolean;
begin
  Result := (CheckedCount > 1) or FOwner.AllowAllUp;
end;

procedure TNxToolbarNodeButtons.Check(Button: TNxToolbarNodeButton);
var
  i: Integer;
begin
  { Uncheck other if in Group }
  if Button.Checked and FOwner.Grouped then
    for i := 0 to Pred(Count) do
      if Items[i].Checked and (Items[i] <> Button) then
        Items[i].Checked := False;

  { Trigger event }
  FOwner.DoToolButtonChecked(Button.Index);
end;

constructor TNxToolbarNodeButtons.Create(AOwner: TNxToolbarInspectorNode6);
begin
  inherited Create(TNxToolbarNodeButton);
  FOwner := AOwner;
end;

function TNxToolbarNodeButtons.GetCheckedCount: Integer;
var
  i: Integer;
begin
  Result := 0;
  for i := 0 to Pred(Count) do if Items[i].Checked then Inc(Result);
end;

function TNxToolbarNodeButtons.GetItem(Index: Integer): TNxToolbarNodeButton;
begin
  Result := TNxToolbarNodeButton(inherited GetItem(Index));
end;

function TNxToolbarNodeButtons.GetOwner: TPersistent;
begin
  Result := FOwner;
end;

procedure TNxToolbarNodeButtons.SetItem(Index: Integer; const Value: TNxToolbarNodeButton);
begin

end;

{ TNxToolbarInspectorItem }

procedure TNxToolbarInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxToolbarInspectorNode6 then
  begin
    AllowAllUp := TNxToolbarInspectorNode6(Source).AllowAllUp;
    ButtonHeight := TNxToolbarInspectorNode6(Source).ButtonHeight;
    Buttons.Assign(TNxToolbarInspectorNode6(Source).Buttons);
    ButtonWidth := TNxToolbarInspectorNode6(Source).ButtonWidth;
    Grouped := TNxToolbarInspectorNode6(Source).Grouped;
    Separator := TNxToolbarInspectorNode6(Source).Separator;
    Spacing := TNxToolbarInspectorNode6(Source).Spacing;
  end;
end;

constructor TNxToolbarInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FAllowAllUp := False;
  FButtonHeight := 0;
  FButtons := TNxToolbarNodeButtons.Create(Self);
  FButtonWidth := 0;
  FGrouped := False;
  FSeparator := ',';
  FSpacing := 0;
  Padding.SetBounds(0, 0, 0, 0);
end;

destructor TNxToolbarInspectorNode6.Destroy;
begin
  FreeAndNil(FButtons);
  inherited;
end;

procedure TNxToolbarInspectorNode6.DoToolButtonChecked(const Index: Integer);
var
  Ref: INxToolbarItemView;
begin
  if Assigned(FOnToolButtonChecked) then FOnToolButtonChecked(Self, Index);

//  View.Canvas :=

  if Supports(View, INxToolbarItemView, Ref) then
  begin
    Ref.RefreshText;
  end;

  AsString := AsString;
end;

procedure TNxToolbarInspectorNode6.DoToolButtonClick(const Index: Integer);
begin
  if Assigned(FOnToolButtonClick) then FOnToolButtonClick(Self, Index);
end;

function TNxToolbarInspectorNode6.GetAsString: WideString;
var
  i: Integer;
begin
  { Default }
  Result := EmptyStr;
  
  for i := 0 to Pred(FButtons.Count) do
    if Buttons[i].Checked then
    begin
      if Result <> EmptyStr then Result := Result + Separator;

      { Add }
      Result := Result + Buttons[i].Text;
    end;
end;

function TNxToolbarInspectorNode6.GetDisplayText: WideString;
begin
  Result := AsString;
end;

function TNxToolbarInspectorNode6.GetValue: WideString;
begin
  Result := AsString;
  DoGetValue(Result); { Trigger Event }
end;

function TNxToolbarInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxToolbarItemView;
end;

procedure TNxToolbarInspectorNode6.SetButtonHeight(const Value: Integer);
begin
  FButtonHeight := Value;
  Changed;
end;

procedure TNxToolbarInspectorNode6.SetButtons(const Value: TNxToolbarNodeButtons);
begin
  FButtons := Value;
end;

procedure TNxToolbarInspectorNode6.SetButtonWidth(const Value: Integer);
begin
  FButtonWidth := Value;
  Changed;
end;

procedure TNxToolbarInspectorNode6.SetSeparator(const Value: WideChar);
begin
  FSeparator := Value;
  Changed;
end;

procedure TNxToolbarInspectorNode6.SetShowText(const Value: Boolean);
begin
  FShowText := Value;
  Changed;
end;

procedure TNxToolbarInspectorNode6.SetSpacing(const Value: Integer);
begin
  FSpacing := Value;
  Changed;
end;

{ TNxProgressInspectorItem }

procedure TNxProgressInspectorNode6.Assign(Source: TPersistent);
begin
  inherited;
  if Source is TNxProgressInspectorNode6 then
  begin
    BorderColor := TNxProgressInspectorNode6(Source).BorderColor;
    OuterMargin := TNxProgressInspectorNode6(Source).OuterMargin;
    ProgressColor := TNxProgressInspectorNode6(Source).ProgressColor;
    ProgressHeight := TNxProgressInspectorNode6(Source).ProgressHeight;
    ProgressMargin := TNxProgressInspectorNode6(Source).ProgressMargin;
    ProgressStyle := TNxProgressInspectorNode6(Source).ProgressStyle;
    RoundCorners := TNxProgressInspectorNode6(Source).RoundCorners;
    Transparent := TNxProgressInspectorNode6(Source).Transparent;
  end;
end;

constructor TNxProgressInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FBorderColor := clSilver;
  FOuterMargin := 2;
  FProgressColor := clHighlight;
  FProgressHeight := 0;
  { Space between ProgressBar & ContentRect }
  FProgressMargin := 0;
  { Painted by INxInspectorStyle }
  FProgressStyle := pbStyled;
  FRoundCorners := False;
  FTransparent := False;
end;

function TNxProgressInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxProgressInspectorNodeView;
end;

procedure TNxProgressInspectorNode6.SetBorderColor(const Value: TColor);
begin
  FBorderColor := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetOuterMargin(const Value: Integer);
begin
  FOuterMargin := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetProgressColor(const Value: TColor);
begin
  FProgressColor := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetProgressHeight(const Value: Integer);
begin
  FProgressHeight := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetProgressMargin(const Value: Integer);
begin
  FProgressMargin := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetProgressStyle(const Value: TNxProgressBarStyle);
begin
  FProgressStyle := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetRoundCorners(const Value: Boolean);
begin
  FRoundCorners := Value;
  Changed;
end;

procedure TNxProgressInspectorNode6.SetTransparent(const Value: Boolean);
begin
  FTransparent := Value;
  Changed;
end;

{ TNxTrackBarInspectorItem }

function TNxTrackBarInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxTrackbarInspectorNodeView;
end;

{ TNxRateInspectorNode6 }

procedure TNxRateInspectorNode6.BestFit;
var
  NewHeight: Integer;
begin
  NewHeight := szMinNodeHeight; { Can't be smaller }

  { TBitmap.Height }
  Up(FGlyph.Height, NewHeight);

  NodeHeight := NewHeight;

  { Add Padding & Etc. }
  inherited BestFit;
end;

constructor TNxRateInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;

  FGlyph := TBitmap.Create;
  FGlyphPlaceholder := TBitmap.Create;

  { Event Handlers }
  FGlyph.OnChange := DoGlyphChange;
  FGlyphPlaceholder.OnChange := DoGlyphChange;

  { Inherited Properties }
  FMax := 5;
  FMin := 0;

  FTextAfter := ' stars';
end;

destructor TNxRateInspectorNode6.Destroy;
begin
  FreeAndNil(FGlyph);
  FreeAndNil(FGlyphPlaceholder);
  inherited;
end;

procedure TNxRateInspectorNode6.DoGlyphChange(Sender: TObject);
begin
  Changed;
end;

function TNxRateInspectorNode6.GetViewClass: TNxInspectorNodeViewClass;
begin
  Result := TNxRateInspectorNodeView;
end;

procedure TNxRateInspectorNode6.SetGlyph(const Value: TBitmap);
begin
  FGlyph.Assign(Value);
end;

procedure TNxRateInspectorNode6.SetGlyphPlaceholder(const Value: TBitmap);
begin
  FGlyphPlaceholder.Assign(Value);
end;

{ TNxStringsInspectorItem }

constructor TNxStringsInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FAutoDropDown := False;
  FDisplayMode := dmDefault;
  FDropDownCount := 8;
  FItemHeight := 13;
  FLines := TNxStringList.Create;
  TNxStringList(FLines).OnChange := DoLinesChange;
end;

destructor TNxStringsInspectorNode6.Destroy;
begin
  FreeAndNil(FLines);
  inherited;
end;

procedure TNxStringsInspectorNode6.DoLinesChange(Sender: TObject);
begin
  Refresh;
end;

procedure TNxStringsInspectorNode6.SetDisplayMode(const Value: TNxStringsDisplayMode);
begin
  FDisplayMode := Value;
  Refresh;
end;

procedure TNxStringsInspectorNode6.SetLines(const Value: TStrings);
begin
  FLines.Assign(Value);
end;

{ TNxListInspectorNode6 }

procedure TNxListInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxStyledDropDown).SetStyle(dsDropDownList);
  (Edit as INxStringsControl).DropDownCount := DropDownCount;
  (Edit as INxStringsControl).ItemHeight := ItemHeight;
  (Edit as INxStringsControl).Items.Assign(Lines);
end;

function TNxListInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxComboBox6.Create(Self);
end;

constructor TNxListInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FItemIndex := -1;
end;

function TNxListInspectorNode6.GetAsString: WideString;
begin
  if InRange(FItemIndex, 0, Pred(FLines.Count)) then Result := FLines[FItemIndex];
end;

function TNxListInspectorNode6.GetItemIndex: Integer;
begin
  Result := FItemIndex;
end;

function TNxListInspectorNode6.GetNodeStyle: TNxInspectorNodeStyle;
begin
  Result := [itExplicitChange];
end;

procedure TNxListInspectorNode6.SetAsString(const Value: WideString);
begin
  ItemIndex := FLines.IndexOf(Value);
  inherited;
end;

procedure TNxListInspectorNode6.SetItemIndex(const Value: Integer);
begin
  FItemIndex := Value;
  Refresh;
end;

{ TNxComboBoxInspectorNode6 }

procedure TNxComboBoxInspectorNode6.AssignEdit(Edit: INxInplaceEdit);
begin
  inherited;
  (Edit as INxStyledDropDown).SetStyle(Style);
  (Edit as INxStringsControl).AutoComplete := AutoComplete;
  (Edit as INxStringsControl).DropDownCount := DropDownCount;
  (Edit as INxStringsControl).ItemHeight := ItemHeight;
  (Edit as INxStringsControl).Items.Assign(Lines);
end;

function TNxComboBoxInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxComboBox6.Create(Self);
end;

constructor TNxComboBoxInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;
  FAutoComplete := False;
  FStyle := dsDropDown;
end;

{ TNxDateInspectorNode6 }

function TNxDateInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxDatePicker6.Create(Self);
end;

{ TNxRichTextInspectorItem }

function TNxHTMLTextInspectorNode6.BeginEdit: INxInplaceEdit;
begin
  Result := TNxRichEdit6.Create(Self);
end;

function TNxHTMLTextInspectorNode6.CanEdit: Boolean;
begin
  Result := True;
end;

constructor TNxHTMLTextInspectorNode6.Create(AOwner: TComponent);
begin
  inherited;

  { Set Prop. }
  AllowAllUp := True;

  { Add Buttons }
  Buttons.Add.Text := 'Bold';
  Buttons.Add.Text := 'Italic';
  Buttons.Add.Text := 'Underline';
end;

{ TNxDateInspectorNode6 }

function TNxDateInspectorNode6.GetAsFloat: Double;
begin
  Result := StrToDateTimeDef(Value, 0);
end;

procedure TNxDateInspectorNode6.SetAsFloat(const Value: Double);
begin
  Self.Value := DateToStr(Value);
end;

end.
