📄 manager.h
字号:
}
/** Sets the current category - Append will add non-categories under this one.
*/
inline void SetCurrentCategory( wxPGPropNameStr name )
{
wxPG_PROP_NAME_CALL_PROLOG()
SetCurrentCategory(wxPGIdGen(p));
}
/** 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_pPropGrid->SetDefaultPriority(priority);
}
/** Same as SetDefaultPriority(wxPG_HIGH). */
inline void ResetDefaultPriority()
{
m_pPropGrid->ResetDefaultPriority();
}
/** Sets property attribute for all applicapple properties.
Be sure to use this method after all properties have been
added to the grid.
*/
void SetPropertyAttributeAll( int attrid, wxVariant value );
/** Sets label of a property.
*/
void SetPropertyLabel( wxPGId id, const wxString& newlabel );
void SetPropertyLabel( wxPGPropNameStr name, const wxString& newlabel );
/** Sets background colour of property and all its children. Colours of
captions are not affected. Background brush cache is optimized for often
set colours to be set last.
NOTE: This function is deprecated. Use SetPropertyBackgroundColour.
*/
inline void SetPropertyColour( wxPGId id, const wxColour& col )
{
m_pPropGrid->SetPropertyBackgroundColour( id, col );
}
inline void SetPropertyColour( wxPGPropNameStr name, const wxColour& col )
{
m_pPropGrid->SetPropertyBackgroundColour( name, col );
}
/** Sets background colour of property and all its children. Colours of
captions are not affected. Background brush cache is optimized for often
set colours to be set last.
*/
inline void SetPropertyBackgroundColour( wxPGId id, const wxColour& col )
{
m_pPropGrid->SetPropertyBackgroundColour( id, col );
}
inline void SetPropertyBackgroundColour( wxPGPropNameStr name, const wxColour& col )
{
m_pPropGrid->SetPropertyBackgroundColour( name, col );
}
/** Sets text colour of property and all its children.
*/
inline void SetPropertyTextColour( wxPGId id, const wxColour& col )
{
m_pPropGrid->SetPropertyTextColour( id, col );
}
inline void SetPropertyTextColour( wxPGPropNameStr name, const wxColour& col )
{
m_pPropGrid->SetPropertyTextColour( name, col );
}
/** Sets background and text colour of property and all its children to the default. */
inline void SetPropertyColourToDefault( wxPGId id )
{
m_pPropGrid->SetPropertyColourToDefault(id);
}
inline void SetPropertyColourToDefault ( wxPGPropNameStr name )
{
m_pPropGrid->SetPropertyColourToDefault(name);
}
/** Sets property value.
\remarks
Actual name of this method is <b>SetPropertyValue</b>. It may be shown incorrectly
due to limitations in Doxygen C preprocessor. */
void SetPropertyValueLong( wxPGId id, long value );
#ifndef __WXPYTHON__
void SetPropertyValue( wxPGId id, int value );
#endif
void SetPropertyValueDouble( wxPGId id, double value );
void SetPropertyValueBool( wxPGId id, bool value );
void SetPropertyValueString( wxPGId id, const wxString& value );
void SetPropertyValueArrstr2( wxPGId id, const wxArrayString& value );
void SetPropertyValueWxObjectPtr( wxPGId id, wxObject* value );
#ifndef __WXPYTHON__
void SetPropertyValue( wxPGId id, void* value );
void SetPropertyValue( wxPGId id, wxVariant& value );
#endif
void SetPropertyValueLong( wxPGPropNameStr name, long value );
#ifndef __WXPYTHON__
void SetPropertyValue( wxPGPropNameStr name, int value );
#endif
void SetPropertyValueDouble( wxPGPropNameStr name, double value );
void SetPropertyValueBool( wxPGPropNameStr name, bool value );
void SetPropertyValueString( wxPGPropNameStr name, const wxString& value );
void SetPropertyValueWxObjectPtr( wxPGPropNameStr name, wxObject* value );
#ifndef __WXPYTHON__
void SetPropertyValue( wxPGPropNameStr name, void* value );
void SetPropertyValue( wxPGPropNameStr name, wxVariant& value );
void SetPropertyValueArrstr2( wxPGPropNameStr name, const wxArrayString& value );
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueArrint2,const wxArrayInt&)
#else
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_P1_INBODY(SetPropertyValueArrint2,const wxArrayInt&)
#endif
#if wxUSE_DATETIME
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueDatetime,wxDateTime)
#endif
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValuePoint,const wxPoint&)
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueSize,const wxSize&)
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueLongLong,const wxLongLong&)
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValueULongLong,const wxULongLong&)
#ifdef __WXPYTHON__
wxPG_IMPLEMENT_PGMAN_METHOD_NORET1_INBODY(SetPropertyValuePyObject,PyObject*)
#endif
#ifndef __WXPYTHON__
inline void SetPropertyValue( wxPGId id, wxObject& value )
{
SetPropertyValue(id,&value);
}
inline void SetPropertyValue( wxPGPropNameStr name, wxObject& value )
{
SetPropertyValue(name,&value);
}
inline void SetPropertyValue( wxPGId id, const wxChar* value )
{
SetPropertyValue(id,wxString(value));
}
inline void SetPropertyValue( wxPGPropNameStr name, const wxChar* value )
{
SetPropertyValue(name,wxString(value));
}
/** Sets various property values from a list of wxVariants. If property with
name is missing from the grid, new property is created under given default
category (or root if omitted). Works on target page.
*/
void SetPropertyValues( const wxList& list, wxPGId defaultCategory )
{
m_targetState->SetPropertyValues(list,defaultCategory);
}
inline void SetPropertyValues( const wxVariant& list, wxPGId defaultCategory )
{
SetPropertyValues(list.GetList(),defaultCategory);
}
inline void SetPropertyValues( const wxList& list, const wxString& defaultCategory = wxEmptyString )
{
SetPropertyValues(list,GetPropertyByName(defaultCategory));
}
inline void SetPropertyValues( const wxVariant& list, const wxString& defaultCategory = wxEmptyString )
{
SetPropertyValues(list.GetList(),GetPropertyByName(defaultCategory));
}
#endif
/** Sets property's value to unspecified. If it has children (it may be category),
then the same thing is done to them.
*/
#ifdef wxPG_COMPATIBILITY_1_0_0
void SetPropertyValueUnspecified( wxPGId id );
void SetPropertyValueUnspecified( wxPGPropNameStr name );
#else
void SetPropertyUnspecified( wxPGId id );
void SetPropertyUnspecified( wxPGPropNameStr name );
#endif
/** Moves splitter as left as possible, while still allowing all
labels to be shown in full.
\param subProps
If false, will still allow sub-properties (ie. properties which
parent is not root or category) to be cropped.
\param allPages
If true, takes labels on all pages into account.
*/
void SetSplitterLeft( bool subProps = false, bool allPages = true );
inline void SetSplitterPosition( int newx, bool refresh = true )
{
m_pPropGrid->SetSplitterPosition(newx,refresh);
}
/** Synonyme for SelectPage(name). */
inline void SetStringSelection( const wxChar* name )
{
SelectPage( GetPageByName(name) );
}
/** Sets page to which append, insert, etc. will add items.
Every time a page is changed, target page is automatically
switched to that.
*/
void SetTargetPage( int index );
/** Sets page to which append, insert, etc. will add items.
Every time a page is changed, target page is automatically
switched to that.
*/
inline void SetTargetPage( const wxChar* name )
{
SetTargetPage( GetPageByName(name) );
}
/** Sorts all items at all levels of the target page (except sub-properties). */
inline void Sort()
{
m_pPropGrid->Sort(wxPGIdGen(m_targetState->m_properties));
}
/** Sorts children of a category.
*/
inline void Sort( wxPGId id )
{
m_pPropGrid->Sort(id);
}
/** Sorts children of a category.
*/
inline void Sort( wxPGPropNameStr name )
{
m_pPropGrid->Sort( GetPropertyByNameI(name) );
}
/** Deselect current selection, if any (from current page).
\retval
false if editor could not be closed.
*/
inline bool ClearSelection()
{
return m_pPropGrid->ClearSelection();
}
#ifdef SWIG
// O.C.: %pythoncode { ... }
#endif
protected:
//
// Subclassing helpers
//
/** Creates property grid for the manager. Override to use subclassed
wxPropertyGrid.
*/
virtual wxPropertyGrid* CreatePropertyGrid() const;
public:
#ifndef DOXYGEN
//
// Overridden functions - no documentation required.
//
virtual wxSize DoGetBestSize() const;
void SetId( wxWindowID winid );
virtual void Freeze();
virtual void Thaw();
virtual void SetExtraStyle ( long exStyle );
virtual bool SetFont ( const wxFont& font );
virtual void SetWindowStyleFlag ( long style );
#ifndef SWIG
//
// Event handlers
//
void OnMouseMove( wxMouseEvent &event );
void OnMouseClick( wxMouseEvent &event );
void OnMouseUp( wxMouseEvent &event );
void OnMouseEntry( wxMouseEvent &event );
void OnPaint( wxPaintEvent &event );
void OnToolbarClick( wxCommandEvent &event );
void OnResize( wxSizeEvent& event );
void OnCompactorClick( wxCommandEvent& event );
void OnPropertyGridSelect( wxPropertyGridEvent& event );
protected:
wxPropertyGrid* m_pPropGrid;
wxArrayPtrVoid m_arrPages;
#if wxUSE_TOOLBAR
wxToolBar* m_pToolbar;
#endif
wxStaticText* m_pTxtHelpCaption;
wxStaticText* m_pTxtHelpContent;
wxButton* m_pButCompactor;
wxPropertyGridState* m_targetState;
wxPropertyGridPage* m_emptyPage;
long m_iFlags;
// Selected page index.
int m_selPage;
int m_width;
int m_height;
int m_extraHeight;
int m_splitterY;
int m_splitterHeight;
int m_nextTbInd;
int m_dragOffset;
wxCursor m_cursorSizeNS;
int m_nextDescBoxSize;
int m_targetPage;
unsigned char m_dragStatus;
unsigned char m_onSplitter;
virtual wxPGId DoGetPropertyByName( wxPGPropNameStr name ) const;
/** Select and displays a given page. */
virtual bool DoSelectPage( int index );
virtual void RefreshProperty( wxPGProperty* p );
// Sets some members to defaults.
void Init1();
// Initializes some members.
void Init2( int style );
/*#ifdef __WXMSW__
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const;
#endif*/
/** Recalculates new positions for components, according to the
given size.
*/
void RecalculatePositions( int width, int height );
/** (Re)creates/destroys controls, according to the window style bits. */
void RecreateControls();
void RefreshHelpBox( int new_splittery, int new_width, int new_height );
void RepaintSplitter( wxDC& dc, int new_splittery, int new_width, int new_height, bool desc_too );
void SetDescribedProperty( wxPGProperty* p );
virtual bool ProcessEvent( wxEvent& event );
private:
DECLARE_EVENT_TABLE()
#endif // #ifndef SWIG
#endif // #ifndef DOXYGEN
};
// -----------------------------------------------------------------------
#ifndef __wxPG_SOURCE_FILE__
#undef wxPG_IPAM_DECL
#undef wxPG_IMPLEMENT_PGMAN_METHOD_NORET1
#endif
// -----------------------------------------------------------------------
#endif // _WX_PROPGRID_MANAGER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -