⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manager.h

📁 非常好用的可移植的多平台C/C++源代码编辑器
💻 H
📖 第 1 页 / 共 3 页
字号:
    }

    /** Returns number of children for the property. */
    inline size_t GetChildrenCount ( wxPGNameStr name ) { return GetChildrenCount( GetPropertyByName(name) ); }

    /** Returns id of first item (in target page), whether it is a category or a property. */
    inline wxPGId GetFirst () const
    {
        return m_targetState->GetFirst();
    }

    /** Returns id of first category (in target page). */
    inline wxPGId GetFirstCategory () const
    {
        return m_targetState->GetFirstCategory ();
    }

    /** Returns id of first property that is not a category (from target page). */
    inline wxPGId GetFirstProperty() const
    {
        return m_targetState->GetFirstProperty();
    }

    /** Returns pointer to the contained wxPropertyGrid. This does not change
        after wxPropertyGridManager has been created, so you can safely obtain
        pointer once and use it for the entire lifetime of the instance.
    */
    inline wxPropertyGrid* GetGrid()
    {
        // FIXME
        //wxASSERT( m_iFlags & wxPG_FL_INITIALIZED );
        return &m_propGrid;
    };

    /** Returns id of last child of given property.
        \remarks
        Returns even sub-properties.
    */
    inline wxPGId GetLastChild ( wxPGId parent )
    {
        wxASSERT ( wxPGIdIsOk(parent) );
        wxPGPropertyWithChildren& p = (wxPGPropertyWithChildren&)parent.GetProperty();
        if ( !p.GetParentingType() || !p.GetCount() ) return wxPGId();
        return wxPGId(p.Last());
    }
    inline wxPGId GetLastChild ( wxPGNameStr name ) { return GetLastChild ( GetPropertyByName(name) ); }
    
    /** Returns id of next category after a given property (which does not have to be category). */
    inline wxPGId GetNextCategory ( wxPGId id ) const
    {
        wxASSERT ( m_targetState );
        return m_targetState->GetNextCategory(id);
    }

    /** Returns id of next property (from target page). This does <b>not</b> iterate
        to sub-properties or categories.
    */
    inline wxPGId GetNextProperty ( wxPGId id ) const
    {
        wxASSERT ( m_targetState );
        return m_targetState->GetNextProperty(id);
    }

    /** Returns index for a page name. If no match is found, wxNOT_FOUND is returned. */
    int GetPageByName ( const wxChar* name ) const;

    /** Returns index for a relevant propertygrid state. If no match is found,
        wxNOT_FOUND is returned.
    */
    int GetPageByState( wxPropertyGridState* pstate ) const;

    /** Returns number of managed pages. */
    size_t GetPageCount () const { return m_arrPages.GetCount(); }

    /** Returns name of given page. */
    const wxString& GetPageName ( int index ) const;

    /** Returns id of previous property (in target page). */
    inline wxPGId GetPrevProperty ( wxPGId id ) const
    {
        return m_targetState->GetPrevProperty(id);
    }

    /** Returns id of previous item under the same parent. */
    inline wxPGId GetPrevSibling ( wxPGId id )
    {
        return wxPropertyGridState::GetPrevSibling(id);
    }
    inline wxPGId GetPrevSibling ( wxPGNameStr name )
    {
        return wxPropertyGridState::GetPrevSibling(GetPropertyByName(name));
    }

    /** Returns id of property with given label (case-sensitive). If there is no
        property with such label, returned property id is invalid ( i.e. it will return
        FALSE with IsOk method). If there are multiple properties with identical name,
        most recent added is returned.
    */
    wxPGId GetPropertyByLabel ( const wxString& name,
        wxPropertyGridState** ppState = (wxPropertyGridState**)NULL ) const;

    /** Returns id of property's nearest parent category. If no category
        found, returns invalid wxPGId.
    */
    inline wxPGId GetPropertyCategory ( wxPGId id ) const
    {
        return m_propGrid.GetPropertyCategory(id);
    }
    wxPGId GetPropertyCategory ( wxPGNameStr name ) const
    {
        return m_propGrid.GetPropertyCategory(GetPropertyByName(name));
    }

    /** Returns cell background colour of a property. */
    inline wxColour GetPropertyColour ( wxPGId id ) const
    {
        return m_propGrid.GetPropertyColour(id);
    }
    inline wxColour GetPropertyColour ( wxPGNameStr name ) const
    {
        return m_propGrid.GetPropertyColour(GetPropertyByName(name));
    }

    /** Returns help string associated with a property. */
    inline const wxString& GetPropertyHelpString ( wxPGId id ) const
    {
        wxASSERT ( wxPGIdIsOk(id) );
        return wxPGIdToPtr(id)->GetHelpString();
    }

    /** Returns help string associated with a property. */
    inline const wxString& GetPropertyHelpString ( wxPGNameStr name ) const
    {
        return GetPropertyHelpString(GetPropertyByNameWithAssert(name));
    }

#if wxPG_USE_VALIDATORS
    /** Returns validator of a property as a reference, which you
        can pass to any number of SetPropertyValidator.
    */
    inline wxPropertyValidator& GetPropertyValidator ( wxPGId id )
    {
        wxASSERT( wxPGIdIsOk(id) );
        return wxPGIdToPtr(id)->GetValidator();
    }
    inline wxPropertyValidator& GetPropertyValidator ( wxPGNameStr name )
    {
        return GetPropertyValidator(GetPropertyByName(name));
    }
#endif

    /** Returns a wxVariant list containing wxVariant versions of all
        property values. Order is not guaranteed, but generally it should
        match the visible order in the grid.
        \param flags
        Use wxKEEP_STRUCTURE to retain category structure; each sub
        category will be its own wxList of wxVariant.
        \remarks
        This works on the target page.
    */
    wxVariant GetPropertyValues ( const wxString& listname = wxEmptyString,
        wxPGId baseparent = wxPGId(), long flags = 0 ) const
    {
        return m_targetState->GetPropertyValues(listname,baseparent,flags);
    }

    /** Returns "root property" of the target page. It does not have name, etc.
        and it is not visible. It is only useful for accessing its children.
    */
    wxPGId GetRoot () const { return wxPGIdGen(m_targetState->m_properties); }

    /** Returns index to currently selected page. */
    inline int GetSelectedPage () const { return m_selPage; }

    /** Shortcut for GetGrid()->GetSelection(). */
    inline wxPGId GetSelectedProperty () const
    {
        return m_propGrid.GetSelection();
    }

    /** Synonyme for GetSelectedPage. */
    inline int GetSelection () const { return m_selPage; }

    /** Returns a pointer to the toolbar currently associated with the
        wxPropertyGridManager (if any). */
    inline wxToolBar* GetToolBar() const { return m_pToolbar; }

    inline void InitAllTypeHandlers ()
    {
        wxPropertyGrid::InitAllTypeHandlers();
    }

    /** See wxPropertyGrid::Insert. */
    inline wxPGId Insert ( wxPGId id, int index, wxPGProperty* property )
    {
        wxASSERT ( m_targetState );
        wxPGId res_id = m_targetState->Insert((wxPGPropertyWithChildren*)wxPGIdToPtr(id),index,property);
        if ( m_targetState == m_propGrid.m_pState )
            m_propGrid.DrawItems ( property, (wxPGProperty*) NULL );
        return res_id;
    }

    /** See wxPropertyGrid::Insert. */
    inline wxPGId Insert ( wxPGNameStr name, int index, wxPGProperty* property )
    {
        wxASSERT ( m_targetState );
        wxPGId res_id = m_targetState->Insert((wxPGPropertyWithChildren*)wxPGIdToPtr(m_targetState->BaseGetPropertyByName(name)),index,property);
        if ( m_targetState == m_propGrid.m_pState )
            m_propGrid.DrawItems ( property, (wxPGProperty*) NULL );
        return res_id;
    }

    /** Creates new property page. Note that the first page is not created
        automatically, and before you have created any pages you are basicly
        in a non-paged mode. When you create the first page, contents
        of the underlying propertygrid is added into it (or this is how it
        will seem to to the user).
        \param index
        Add to this position. -1 will add as the last item.
        \param label
        A label for the page. This may be shown as a toolbar tooltip etc.
        \param bmp
        Bitmap image for toolbar. If wxNullBitmap is used, then a built-in
        default image is used.
        \retval
        Returns index to the page created.
    */
    int InsertPage ( int index, const wxString& label, const wxBitmap& bmp = wxNullBitmap );

    /** Returns TRUE if any property on any page has been modified by the user. */
    bool IsAnyModified () const;

    /** Returns TRUE if updating is frozen (ie. Freeze() called but not yet Thaw() ). */
    inline bool IsFrozen () const { return (m_propGrid.m_frozen>0)?TRUE:FALSE; }

    /** Returns TRUE if any property on given page has been modified by the user. */
    bool IsPageModified ( size_t index ) const;

    /** Returns true if property is a category. */
    inline bool IsPropertyCategory ( wxPGId id ) const
    {
        return (wxPGIdToPtr(id)->GetParentingType()>0)?TRUE:FALSE;
    }
    inline bool IsPropertyCategory ( wxPGNameStr name ) { return IsPropertyCategory(GetPropertyByName(name)); }

    /** Disables item's textctrl if other way of editing is available. */
    void LimitPropertyEditing ( wxPGId id, bool limit = TRUE );
    void LimitPropertyEditing ( wxPGNameStr name, bool limit = TRUE );

    virtual void Refresh (bool eraseBackground = true,
                          const wxRect* rect = (const wxRect*) NULL);

    /** Select and displays a given page. */
    void SelectPage ( int index );

    /** Select and displays a given page. */
    inline void SelectPage ( const wxChar* name )
    {
        SelectPage ( GetPageByName(name) );
    }

    /** Select a property. */
    void SelectProperty ( wxPGId id, bool focus = FALSE );
    inline void SelectProperty ( wxPGNameStr name, bool focus = FALSE )
    {
        SelectProperty(GetPropertyByName(name),focus);
    }

    /** Sets label and text in description box.
    */
    void SetDescription ( const wxString& label, const wxString& content );

    /** Sets the current category - Append will add non-categories under this one.
    */
    inline void SetCurrentCategory ( wxPGId id )
    {
        wxPropertyCategoryClass* pc = (wxPropertyCategoryClass*)wxPGIdToPtr(id);
#ifdef __WXDEBUG__
        if ( pc ) wxASSERT ( pc->GetParentingType() > 0 );
#endif
        m_targetState->m_currentCategory = pc;
    }

    /** Sets the current category - Append will add non-categories under this one.
    */
    inline void SetCurrentCategory ( wxPGNameStr name )
    {
        SetCurrentCategory(GetPropertyByName(name));
    }

    /** Sets y coordinate of the description box splitter. */
    void SetDescBoxHeight ( int ht, bool refresh = TRUE );

    /** All properties added/inserted will have given priority by default. 
        \param
        priority can be wxPG_HIGH (default) or wxPG_LOW.
    */
    inline void SetDefaultPriority( int priority )
    {
        m_propGrid.SetDefaultPriority(priority);
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -