CDirectoryTree



Implements DirectoryTree control.

You can find more information in comments below. Overrided methods can be found in corresponding base classes and interfaces.

class CDirectoryTree :public virtual IDirectoryTree, public CControl
{
public:
    static const float ItemHeightAuto; // All items have individual height returned by getRequiredSize() 
    static const float ItemHeightText; // All items have same height equal to line height of text "Wy" 

    enum class State // Possible states 
    {
        Normal,
        Hovered,
        Focused,
        FocusedHovered,
        Disabled
    };

    enum class FolderState // Folder states 
    {
        Normal,
        Hovered
    };

    using FDirectoryCallback = void(*)(void *param, const String &path); // Function prototype called when enumerating directories 
public:
    void(*OnSelectDirectory)(IControl *sender, const String &path); // Event called when directory has been selected 
    void(*OnDeselectDirectory)(IControl *sender, const String &path); // Event called when directory has been unselected 
    void(*OnActivateDirectory)(IControl *sender, const String &path); // Event called when directory has been activated 
    void(*OnDeactivateDirectory)(IControl *sender, const String &path); // Event called when directory has been deactivated 

    // IControl methods 
    void Refresh(const bool refresh_children) override;

    RectF getClientRect() override;
    RectF getRenderRect() override;
    String getRootDirectory() override;
    String getDirectory() override;
    String getFilter() override;
    IFileList *getFileList() override;
    bool isShowArchieved() override;
    bool isShowCompressed() override;
    bool isShowEncrypted() override;
    bool isShowHidden() override;
    bool isShowNormal() override;
    bool isShowOffline() override;
    bool isShowReadOnly() override;
    bool isShowSystem() override;
    bool isShowTemporary() override;

    bool setDPI(const Point &value) override;
    bool setRootDirectory(const String &value) override;
    bool setFilter(const String &value) override;
    bool setFileList(IFileList *value) override;
    bool setShowArchieved(const bool value) override;
    bool setShowCompressed(const bool value) override;
    bool setShowEncrypted(const bool value) override;
    bool setShowHidden(const bool value) override;
    bool setShowNormal(const bool value) override;
    bool setShowOffline(const bool value) override;
    bool setShowReadOnly(const bool value) override;
    bool setShowSystem(const bool value) override;
    bool setShowTemporary(const bool value) override;

    bool Rescan() override;

    CDirectoryTree();
    CDirectoryTree(IForm *parent);
    CDirectoryTree(IControl *parent);

    State getState(); // Return curren state 
    // Return layout properties 
    RectF getBorderWidth() const;
    RectF getBorderRadius() const;
    RectF getPadding() const;
    BorderColor getBorderColor(const State state) const;
    Color getBackgroundColor(const State state) const;
    Gradient *getBackgroundGradient(const State state);
    Color getShadowColor(const State state) const;
    PointF getShadowShift(const State state) const;
    int getShadowRadius(const State state) const;
    Color getCornerColor(const State state) const;
    float getItemHeight() const;
    PointF getFolderSize() const;
    Color getFolderLinesColor() const;
    RectF getFolderBorderWidth(const FolderState state) const;
    RectF getFolderBorderRadius(const FolderState state) const;
    BorderColor getFolderBorderColor(const FolderState state) const;
    Color getFolderBackgroundColor(const FolderState state) const;
    Gradient *getFolderBackgroundGradient(const FolderState state);
    PointF getFolderSignSize(const FolderState state) const;
    Color getFolderSignColor(const FolderState state) const;
    bool isMultiselect() const; // Whether multiple items can be selected at the same time 
    ScrollVisibility getHScrollVisibility() const;
    ScrollVisibility getVScrollVisibility() const;
    float getScrollInterval() const;
    float getScrollDelta() const;

    // Set layout properties 
    bool setBorderWidth(const RectF &value);
    bool setBorderRadius(const RectF &value);
    bool setPadding(const RectF &value);
    bool setBorderColor(const State state, const BorderColor &value);
    bool setLeftBorderColor(const State state, const Color &value);
    bool setTopBorderColor(const State state, const Color &value);
    bool setRightBorderColor(const State state, const Color &value);
    bool setBottomBorderColor(const State state, const Color &value);
    bool setBackgroundColor(const State state, const Color &value);
    bool setShadowColor(const State state, const Color &value);
    bool setShadowShift(const State state, const PointF &value);
    bool setShadowRadius(const State state, const int value);
    bool setCornerColor(const State state, const Color &value);
    bool setItemHeight(const float value);
    bool setFolderSize(const PointF &value);
    bool setFolderLinesColor(const Color &value);
    bool setFolderBorderWidth(const FolderState state, const RectF &value);
    bool setFolderBorderRadius(const FolderState state, const RectF &value);
    bool setFolderBorderColor(const FolderState state, const BorderColor &value);
    bool setFolderBackgroundColor(const FolderState state, const Color &value);
    bool setFolderSignSize(const FolderState state, const PointF &value);
    bool setFolderSignColor(const FolderState state, const Color &value);
    bool setMultiselect(const bool value); // Set whether multiple items could be selected at the same time 
    bool setHScrollVisibility(const ScrollVisibility value);
    bool setVScrollVisibility(const ScrollVisibility value);
    bool setScrollInterval(const float value);
    bool setScrollDelta(const float value);
    bool setBorderColor(const BorderColor &value);
    bool setLeftBorderColor(const Color &value);
    bool setTopBorderColor(const Color &value);
    bool setRightBorderColor(const Color &value);
    bool setBottomBorderColor(const Color &value);
    bool setBackgroundColor(const Color &value);
    bool setShadowColor(const Color &value);
    bool setShadowShift(const PointF &value);
    bool setShadowRadius(const int value);
    bool setCornerColor(const Color &value);

    void LockUpdate(); // Lock update and repaint 
    void UnlockUpdate(); // Unlock update and repaint 
    void EnumSelectedDirectories(void *param, FDirectoryCallback callback); // Enumerate selected directories 
};
Namespace: nitisa::standard
Include: Standard/Controls/DirectoryTree/DirectoryTree.h