2008-09-12 16:57:41 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: manager.h
|
|
|
|
// Purpose: interface of wxPropertyGridManager
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id:
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/** @class wxPropertyGridPage
|
|
|
|
|
|
|
|
Holder of property grid page information. You can subclass this and
|
|
|
|
give instance in wxPropertyGridManager::AddPage. It inherits from
|
|
|
|
wxEvtHandler and can be used to process events specific to this
|
|
|
|
page (id of events will still be same as manager's). If you don't
|
|
|
|
want to use it to process all events of the page, you need to
|
|
|
|
return false in the derived wxPropertyGridPage::IsHandlingAllEvents.
|
|
|
|
|
|
|
|
Please note that wxPropertyGridPage lacks many non-const property
|
|
|
|
manipulation functions found in wxPropertyGridManager. Please use
|
|
|
|
parent manager (m_manager member variable) when needed.
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
Please note that most member functions are inherited and as such not
|
|
|
|
documented on this page. This means you will probably also want to read
|
|
|
|
wxPropertyGridInterface class reference.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
@section propgridpage_event_handling Event Handling
|
|
|
|
|
|
|
|
wxPropertyGridPage receives events emitted by its wxPropertyGridManager, but
|
2008-09-23 13:37:27 -04:00
|
|
|
only those events that are specific to that page. If wxPropertyGridPage::
|
|
|
|
IsHandlingAllEvents returns false, then unhandled events are sent to the
|
|
|
|
manager's parent, as usual.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
See @ref propgrid_event_handling "wxPropertyGrid Event Handling"
|
|
|
|
for more information.
|
|
|
|
|
|
|
|
@library{wxpropgrid}
|
|
|
|
@category{propgrid}
|
|
|
|
*/
|
|
|
|
class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler,
|
|
|
|
public wxPropertyGridInterface
|
|
|
|
{
|
|
|
|
friend class wxPropertyGridManager;
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxPropertyGridPage();
|
|
|
|
virtual ~wxPropertyGridPage();
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Deletes all properties on page.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual void Clear();
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Reduces column sizes to minimum possible that contents are still visibly
|
|
|
|
(naturally some margin space will be applied as well).
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
@return Returns minimum size for the page to still display everything.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
@remarks This function only works properly if size of containing grid was
|
|
|
|
already fairly large.
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
Note that you can also get calculated column widths by calling
|
|
|
|
GetColumnWidth() immediately after this function returns.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxSize FitColumns();
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns page index in manager;
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
inline int GetIndex() const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns "root property". It does not have name, etc. and it is not
|
|
|
|
visible. It is only useful for accessing its children.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-23 13:37:27 -04:00
|
|
|
wxPGProperty* GetRoot() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns x-coordinate position of splitter on a page.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-23 13:37:27 -04:00
|
|
|
int GetSplitterPosition( int col = 0 ) const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns id of the tool bar item that represents this page on
|
|
|
|
wxPropertyGridManager's wxToolBar.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
int GetToolId() const
|
|
|
|
{
|
|
|
|
return m_id;
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Do any member initialization in this method.
|
|
|
|
|
|
|
|
@remarks - Called every time the page is added into a manager.
|
|
|
|
- You can add properties to the page here.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual void Init() {}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Return false here to indicate unhandled events should be
|
2008-09-12 16:57:41 -04:00
|
|
|
propagated to manager's parent, as normal.
|
|
|
|
*/
|
|
|
|
virtual bool IsHandlingAllEvents() const { return true; }
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Called every time page is about to be shown.
|
2008-09-12 16:57:41 -04:00
|
|
|
Useful, for instance, creating properties just-in-time.
|
|
|
|
*/
|
|
|
|
virtual void OnShow();
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Refreshes given property on page.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
virtual void RefreshProperty( wxPGProperty* p );
|
|
|
|
|
|
|
|
/** Sets splitter position on page.
|
|
|
|
@remarks
|
2008-09-23 13:37:27 -04:00
|
|
|
Splitter position cannot exceed grid size, and therefore setting it
|
|
|
|
during form creation may fail as initial grid size is often smaller than
|
|
|
|
desired splitter position, especially when sizers are being used.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetSplitterPosition( int splitterPos, int col = 0 );
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
/** @class wxPropertyGridManager
|
|
|
|
|
|
|
|
wxPropertyGridManager is an efficient multi-page version of wxPropertyGrid,
|
2008-09-21 10:13:32 -04:00
|
|
|
which can optionally have toolbar for mode and page selection, and a help text
|
|
|
|
box.
|
|
|
|
|
|
|
|
wxPropertyGridManager inherits from wxPropertyGridInterface, and as such
|
|
|
|
it has most property manipulation functions. However, only some of them affect
|
|
|
|
properties on all pages (eg. GetPropertyByName() and ExpandAll()), while some
|
|
|
|
(eg. Append()) only apply to the currently selected page.
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
To operate explicitly on properties on specific page, use
|
|
|
|
wxPropertyGridManager::GetPage() to obtain pointer to page's
|
|
|
|
wxPropertyGridPage object.
|
2008-09-21 10:13:32 -04:00
|
|
|
|
|
|
|
Visual methods, such as SetCellBackgroundColour() are only available in
|
|
|
|
wxPropertyGrid. Use wxPropertyGridManager::GetGrid() to obtain pointer to it.
|
|
|
|
|
|
|
|
Non-virtual iterators will not work in wxPropertyGridManager. Instead, you must
|
|
|
|
acquire the internal grid (GetGrid()) or wxPropertyGridPage object (GetPage()).
|
|
|
|
|
|
|
|
wxPropertyGridManager constructor has exact same format as wxPropertyGrid
|
|
|
|
constructor, and basicly accepts same extra window style flags (albeit also
|
|
|
|
has some extra ones).
|
|
|
|
|
|
|
|
Here's some example code for creating and populating a wxPropertyGridManager:
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
|
|
|
wxPropertyGridManager* pgMan = new wxPropertyGridManager(this, PGID,
|
|
|
|
wxDefaultPosition, wxDefaultSize,
|
|
|
|
// These and other similar styles are automatically
|
|
|
|
// passed to the embedded wxPropertyGrid.
|
|
|
|
wxPG_BOLD_MODIFIED|wxPG_SPLITTER_AUTO_CENTER|
|
|
|
|
// Include toolbar.
|
|
|
|
wxPG_TOOLBAR |
|
|
|
|
// Include description box.
|
|
|
|
wxPG_DESCRIPTION |
|
|
|
|
// Include compactor.
|
|
|
|
wxPG_COMPACTOR |
|
|
|
|
// Plus defaults.
|
|
|
|
wxPGMAN_DEFAULT_STYLE
|
|
|
|
);
|
|
|
|
|
|
|
|
wxPropertyGridPage* page;
|
|
|
|
|
2008-09-25 13:19:49 -04:00
|
|
|
page = pgMan->AddPage(wxT("First Page"));
|
2008-09-21 10:13:32 -04:00
|
|
|
|
|
|
|
page->Append( new wxPropertyCategory(wxT("Category A1")) );
|
|
|
|
|
|
|
|
page->Append( new wxIntProperty(wxT("Number"),wxPG_LABEL,1) );
|
|
|
|
|
|
|
|
page->Append( new wxColourProperty(wxT("Colour"),wxPG_LABEL,*wxWHITE) );
|
|
|
|
|
2008-09-25 13:19:49 -04:00
|
|
|
page = pgMan->AddPage(wxT("Second Page"));
|
2008-09-21 10:13:32 -04:00
|
|
|
|
|
|
|
page->Append( wxT("Text"),wxPG_LABEL,wxT("(no text)") );
|
|
|
|
|
|
|
|
page->Append( new wxFontProperty(wxT("Font"),wxPG_LABEL) );
|
|
|
|
|
|
|
|
@endcode
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
@section propgridmanager_window_styles_ Window Styles
|
|
|
|
|
|
|
|
See @ref propgrid_window_styles.
|
|
|
|
|
|
|
|
@section propgridmanager_event_handling Event Handling
|
|
|
|
|
|
|
|
See @ref propgrid_event_handling "wxPropertyGrid Event Handling"
|
|
|
|
for more information.
|
|
|
|
|
|
|
|
@library{wxpropgrid}
|
|
|
|
@category{propgrid}
|
|
|
|
*/
|
|
|
|
class wxPropertyGridManager : public wxPanel, public wxPropertyGridInterface
|
|
|
|
{
|
|
|
|
public:
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Creates new property page. Note that the first page is not created
|
2008-09-12 16:57:41 -04:00
|
|
|
automatically.
|
2008-09-23 13:37:27 -04:00
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param label
|
2008-09-23 13:37:27 -04:00
|
|
|
A label for the page. This may be shown as a toolbar tooltip etc.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param bmp
|
2008-09-23 13:37:27 -04:00
|
|
|
Bitmap image for toolbar. If wxNullBitmap is used, then a built-in
|
|
|
|
default image is used.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param pageObj
|
2008-09-23 13:37:27 -04:00
|
|
|
wxPropertyGridPage instance. Manager will take ownership of this
|
|
|
|
object. NULL indicates that a default page instance should be created.
|
|
|
|
|
2008-09-25 13:19:49 -04:00
|
|
|
@return Returns pointer to created property grid page.
|
2008-09-23 13:37:27 -04:00
|
|
|
|
|
|
|
@remarks If toolbar is used, it is highly recommended that the pages are
|
|
|
|
added when the toolbar is not turned off using window style flag
|
|
|
|
switching. Otherwise toolbar buttons might not be added properly.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-25 13:19:49 -04:00
|
|
|
wxPropertyGridPage* AddPage( const wxString& label = wxEmptyString,
|
|
|
|
const wxBitmap& bmp = wxPG_NULL_BITMAP,
|
|
|
|
wxPropertyGridPage* pageObj = NULL );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Deletes all properties and all pages.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual void Clear();
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Deletes all properties on given page.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void ClearPage( int page );
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Forces updating the value of property from the editor control.
|
|
|
|
|
|
|
|
@return Returns @true if value was actually updated.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool CommitChangesFromEditor( wxUint32 flags = 0 )
|
|
|
|
{
|
|
|
|
return m_pPropGrid->CommitChangesFromEditor(flags);
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Two step creation. Whenever the control is created without any parameters,
|
2008-09-12 16:57:41 -04:00
|
|
|
use Create to actually create it. Don't access the control's public methods
|
|
|
|
before this is called.
|
2008-09-23 13:37:27 -04:00
|
|
|
|
|
|
|
@see @ref propgrid_window_styles
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxPGMAN_DEFAULT_STYLE,
|
|
|
|
const wxChar* name = wxPropertyGridManagerNameStr );
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Enables or disables (shows/hides) categories according to parameter enable.
|
|
|
|
|
|
|
|
@remarks
|
|
|
|
Calling his may not properly update toolbar buttons.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool EnableCategories( bool enable )
|
|
|
|
{
|
|
|
|
long fl = m_windowStyle | wxPG_HIDE_CATEGORIES;
|
|
|
|
if ( enable ) fl = m_windowStyle & ~(wxPG_HIDE_CATEGORIES);
|
|
|
|
SetWindowStyleFlag(fl);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Selects page, scrolls and/or expands items to ensure that the
|
|
|
|
given item is visible.
|
|
|
|
|
|
|
|
@return Returns @true if something was actually done.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
bool EnsureVisible( wxPGPropArg id );
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns number of columns on given page. By the default,
|
|
|
|
returns number of columns on current page.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
int GetColumnCount( int page = -1 ) const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns height of the description text box.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
int GetDescBoxHeight() const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns pointer to the contained wxPropertyGrid. This does not change
|
2008-09-12 16:57:41 -04:00
|
|
|
after wxPropertyGridManager has been created, so you can safely obtain
|
2008-09-23 13:37:27 -04:00
|
|
|
pointer once and use it for the entire lifetime of the manager
|
|
|
|
instance.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-23 13:37:27 -04:00
|
|
|
wxPropertyGrid* GetGrid();
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Similar to GetIterator, but instead returns wxPGVIterator instance,
|
2008-09-12 16:57:41 -04:00
|
|
|
which can be useful for forward-iterating through arbitrary property
|
|
|
|
containers.
|
|
|
|
*/
|
|
|
|
virtual wxPGVIterator GetVIterator( int flags ) const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns currently selected page.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-23 13:37:27 -04:00
|
|
|
wxPropertyGridPage* GetCurrentPage() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns page object for given page index.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPropertyGridPage* GetPage( unsigned int ind ) const
|
|
|
|
{
|
|
|
|
return (wxPropertyGridPage*)m_arrPages.Item(ind);
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns page object for given page name.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
wxPropertyGridPage* GetPage( const wxString& name ) const
|
|
|
|
{
|
|
|
|
return GetPage(GetPageByName(name));
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns index for a page name. If no match is found, wxNOT_FOUND is
|
|
|
|
returned.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
int GetPageByName( const wxString& name ) const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns number of managed pages.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
size_t GetPageCount() const;
|
|
|
|
|
|
|
|
/** Returns name of given page. */
|
|
|
|
const wxString& GetPageName( int index ) const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns "root property" of the given page. It does not have name, etc.
|
2008-09-12 16:57:41 -04:00
|
|
|
and it is not visible. It is only useful for accessing its children.
|
|
|
|
*/
|
|
|
|
wxPGProperty* GetPageRoot( int index ) const;
|
|
|
|
|
|
|
|
/** Returns index to currently selected page. */
|
|
|
|
int GetSelectedPage() const { return m_selPage; }
|
|
|
|
|
|
|
|
/** Shortcut for GetGrid()->GetSelection(). */
|
|
|
|
wxPGProperty* GetSelectedProperty() const
|
|
|
|
{
|
|
|
|
return m_pPropGrid->GetSelection();
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Synonyme for GetSelectedPage. */
|
|
|
|
int GetSelection() const { return m_selPage; }
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns a pointer to the toolbar currently associated with the
|
|
|
|
wxPropertyGridManager (if any).
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
wxToolBar* GetToolBar() const { return m_pToolbar; }
|
|
|
|
|
|
|
|
/** Creates new property page. Note that the first page is not created
|
|
|
|
automatically.
|
2008-09-23 13:37:27 -04:00
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param index
|
2008-09-23 13:37:27 -04:00
|
|
|
Add to this position. -1 will add as the last item.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param label
|
2008-09-23 13:37:27 -04:00
|
|
|
A label for the page. This may be shown as a toolbar tooltip etc.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param bmp
|
2008-09-23 13:37:27 -04:00
|
|
|
Bitmap image for toolbar. If wxNullBitmap is used, then a built-in
|
|
|
|
default image is used.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param pageObj
|
2008-09-23 13:37:27 -04:00
|
|
|
wxPropertyGridPage instance. Manager will take ownership of this
|
|
|
|
object. If NULL, default page object is constructed.
|
|
|
|
|
2008-09-25 13:19:49 -04:00
|
|
|
@return Returns pointer to created page.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
2008-09-25 13:19:49 -04:00
|
|
|
virtual wxPropertyGridPage* InsertPage( int index, const wxString& label,
|
|
|
|
const wxBitmap& bmp = wxNullBitmap,
|
|
|
|
wxPropertyGridPage* pageObj = NULL );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns @true if any property on any page has been modified by the user.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
bool IsAnyModified() const;
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns @true if updating is frozen (ie. Freeze() called but not yet
|
|
|
|
Thaw() ).
|
|
|
|
*/
|
|
|
|
bool IsFrozen() const;
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Returns @true if any property on given page has been modified by the user.
|
|
|
|
*/
|
2008-09-12 16:57:41 -04:00
|
|
|
bool IsPageModified( size_t index ) const;
|
|
|
|
|
|
|
|
/** Removes a page.
|
2008-09-23 13:37:27 -04:00
|
|
|
|
|
|
|
@return Returns @false if it was not possible to remove page in question.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
virtual bool RemovePage( int page );
|
|
|
|
|
2008-09-23 11:38:49 -04:00
|
|
|
/** Select and displays a given page.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param index
|
2008-09-23 11:38:49 -04:00
|
|
|
Index of page being seleced. Can be -1 to select nothing.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SelectPage( int index );
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Select and displays a given page (by label).
|
|
|
|
*/
|
|
|
|
void SelectPage( const wxString& label );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
/** Select and displays a given page. */
|
2008-09-23 13:37:27 -04:00
|
|
|
void SelectPage( wxPropertyGridPage* page );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
|
|
|
/** Select a property. */
|
2008-09-23 13:37:27 -04:00
|
|
|
bool SelectProperty( wxPGPropArg id, bool focus = false );
|
2008-09-12 16:57:41 -04:00
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Sets number of columns on given page (default is current page).
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetColumnCount( int colCount, int page = -1 );
|
|
|
|
|
|
|
|
/** Sets label and text in description box.
|
|
|
|
*/
|
|
|
|
void SetDescription( const wxString& label, const wxString& content );
|
|
|
|
|
|
|
|
/** Sets y coordinate of the description box splitter. */
|
|
|
|
void SetDescBoxHeight( int ht, bool refresh = true );
|
|
|
|
|
|
|
|
/** Moves splitter as left as possible, while still allowing all
|
|
|
|
labels to be shown in full.
|
2008-09-23 13:37:27 -04:00
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param subProps
|
2008-09-23 13:37:27 -04:00
|
|
|
If @false, will still allow sub-properties (ie. properties which
|
|
|
|
parent is not root or category) to be cropped.
|
|
|
|
|
2008-09-12 16:57:41 -04:00
|
|
|
@param allPages
|
2008-09-23 13:37:27 -04:00
|
|
|
If @true, takes labels on all pages into account.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetSplitterLeft( bool subProps = false, bool allPages = true );
|
|
|
|
|
|
|
|
/** Sets splitter position on individual page. */
|
|
|
|
void SetPageSplitterPosition( int page, int pos, int column = 0 )
|
|
|
|
{
|
|
|
|
GetPage(page)->DoSetSplitterPosition( pos, column );
|
|
|
|
}
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Sets splitter position for all pages.
|
|
|
|
|
|
|
|
@remarks Splitter position cannot exceed grid size, and therefore setting
|
|
|
|
it during form creation may fail as initial grid size is often
|
|
|
|
smaller than desired splitter position, especially when sizers
|
|
|
|
are being used.
|
2008-09-12 16:57:41 -04:00
|
|
|
*/
|
|
|
|
void SetSplitterPosition( int pos, int column = 0 );
|
|
|
|
|
|
|
|
/** Synonyme for SelectPage(name). */
|
|
|
|
void SetStringSelection( const wxChar* name )
|
|
|
|
{
|
|
|
|
SelectPage( GetPageByName(name) );
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
//
|
|
|
|
// Subclassing helpers
|
|
|
|
//
|
|
|
|
|
2008-09-23 13:37:27 -04:00
|
|
|
/**
|
|
|
|
Creates property grid for the manager. Override to use subclassed
|
2008-09-12 16:57:41 -04:00
|
|
|
wxPropertyGrid.
|
|
|
|
*/
|
|
|
|
virtual wxPropertyGrid* CreatePropertyGrid() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|