Download Now

    Reference TExplorerEdit

    Declared in Codebot.Windows.Explorer.pas on line 513

    TExplorerEdit shows the path of a folder the way the address bar of Windows Explorer does. In emEdit mode the path is typed with the autocomplete of Windows, in emBreadcrumb mode each parent folder is a button with a menu of its subfolders, and in emDropDown mode a button opens a tree of folders. Typed paths can be file system paths, shell parsing names, environment variables, or the names the edit shows such as This PC\Documents
      TExplorerEdit = class(TCustomControl, IComponentBindingClient)
      protected
        procedure CreateWnd; override;
        procedure FontChanged(Sender: TObject); override;
        procedure KeyDown(var Key: Word; Shift: TShiftState); override;
        procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
        procedure MouseLeave; override;
        procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
        procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
        procedure Paint; override;
        procedure Resize; override;
      public
        { Create a new explorer edit }
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        { Focus the edit and select its text. In emBreadcrumb mode the edit replaces
          the breadcrumb until it loses focus }
        procedure BeginEdit;
        { Open the drop down tree in emDropDown mode }
        procedure DropDown;
        { Close the drop down tree, moving to its selected folder if Accept is true }
        procedure CloseUp(Accept: Boolean = False);
        { Move to the parent folder }
        procedure GoUp;
        { The drop down tree is open }
        property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown;
        { The edit which holds the typed path }
        property Edit: TCustomEdit read FEdit;
      published
        { Suggest folders while a path is typed }
        property AutoComplete: Boolean read FAutoComplete write SetAutoComplete default True;
        { The height in pixels of the drop down tree }
        property DropDownHeight: Integer read FDropDownHeight write FDropDownHeight default 300;
        { How the folder is shown }
        property Mode: TExplorerEditMode read FMode write SetMode default emEdit;
        { The folder shown }
        property Path: string read GetPath write SetPath;
        { Invoked after the folder changes }
        property OnChange: TNotifyEvent read FOnChange write FOnChange;
        { Invoked after the drop down tree is closed }
        property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp;
        { Invoked after the drop down tree is opened }
        property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown;
        { Invoked before the user moves to a folder. Set Allow to false to stay in
          the current folder }
        property OnNavigate: TExplorerPathEvent read FOnNavigate write FOnNavigate;
        { Invoked when typed text is not a folder. The text is restored to the
          current folder }
        property OnNavigationFailed: TExplorerFolderEvent read FOnNavigationFailed write FOnNavigationFailed;
        property Align;
        property Anchors;
        property BorderSpacing;
        property BorderStyle default bsSingle;
        property Color default clWindow;
        property Constraints;
        property DragCursor;
        property Enabled;
        property Font;
        property Hint;
        property ParentColor default False;
        property ParentFont;
        property ParentShowHint;
        property PopupMenu;
        property ShowHint;
        property TabOrder;
        property TabStop default True;
        property Visible;
        property OnChangeBounds;
        property OnClick;
        property OnContextPopup;
        property OnDblClick;
        property OnDragDrop;
        property OnDragOver;
        property OnEnter;
        property OnExit;
        property OnKeyDown;
        property OnKeyPress;
        property OnKeyUp;
        property OnMouseDown;
        property OnMouseMove;
        property OnMouseUp;
        property OnMouseWheel;
        property OnMouseWheelDown;
        property OnMouseWheelUp;
        property OnResize;
        property OnShowHint;
        property OnUTF8KeyPress;
      end;

    See also

    IComponentBindingClient in Codebot.Binding.pas