1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
#############################################################################
## Name: ext/propgrid/XS/PropertyGridManager.xsp
## Purpose: XS++ for Wx::PropertyGridManager
## Author: Mark Dootson
## Modified by:
## Created: 04/03/2012
## RCS-ID: $Id: $
## Copyright: (c) 2012 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
#############################################################################
%module{Wx};
#if WXPERL_W_VERSION_GE( 2, 9, 3 ) && wxUSE_PROPGRID
%loadplugin{build::Wx::XSP::Overload};
%name{Wx::PropertyGridManager} class wxPropertyGridManager : public %name{Wx::Panel} wxPanel
{
public:
%name{newDefault} wxPropertyGridManager() %Overload
%postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};
%name{newFull} wxPropertyGridManager( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPGMAN_DEFAULT_STYLE,
const wxString& name = wxPropertyGridManagerNameStr ) %Overload
%postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};
/* Virtual wxPropertyGridInterface */
virtual void Clear(); /* %Virtual; */
virtual wxPGVIterator GetVIterator( int flags ) const; /* %Virtual; */
virtual bool IsPropertySelected( wxString& id ) const; /* %Virtual; */
/* Virtual wxPropertyGridInterface End*/
wxPropertyGridPage* AddPage( const wxString& label = wxEmptyString,
const wxBitmap& bmp = wxNullBitmapPtr,
wxPropertyGridPage* pageObj = NULL );
wxPropertyGridPage* AddPageDefaultBitmap( const wxString& label = wxEmptyString, wxPropertyGridPage* pageObj = NULL )
%code{% RETVAL = THIS->AddPage( label, wxNullBitmap, pageObj ); %};
void ClearPage( int page );
bool CommitChangesFromEditor( wxUint32 flags = 0 );
bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPGMAN_DEFAULT_STYLE,
const wxString& name = wxPropertyGridManagerNameStr );
bool EnableCategories( bool enable );
bool EnsureVisible( wxString& id );
int GetColumnCount( int page = -1 ) const;
/**
Returns height of the description text box.
*/
int GetDescBoxHeight() const;
wxPropertyGrid* GetGrid();
wxPropertyGridPage* GetCurrentPage() const;
wxPropertyGridPage* GetPage( unsigned int ind ) const;
wxPropertyGridPage* GetPage( const wxString& name ) const;
int GetPageByName( const wxString& name ) const;
size_t GetPageCount() const;
const wxString& GetPageName( int index ) const;
wxPGProperty__parsed_nodelete* GetPageRoot( int index ) const;
%name{GetPropertyCategoryString} wxPropertyCategory__parsed_nodelete* GetPropertyCategory( wxString& id ) const %Overload;
%name{GetPropertyCategoryProperty} wxPropertyCategory__parsed_nodelete* GetPropertyCategory( wxPGProperty* id ) const %Overload;
/** Returns index to currently selected page. */
int GetSelectedPage() const;
/** Shortcut for GetGrid()->GetSelection(). */
wxPGProperty__parsed_nodelete* GetSelectedProperty() const;
/** Synonyme for GetSelectedPage. */
wxPGProperty__parsed_nodelete* GetSelection() const;
virtual wxPropertyGridPage* InsertPage( int index, const wxString& label,
const wxBitmap& bmp = wxNullBitmapPtr,
wxPropertyGridPage* pageObj = NULL );
bool IsAnyModified() const;
bool IsFrozen() const;
bool IsPageModified( size_t index ) const;
virtual bool RemovePage( int page ); /* %Virtual; */
%name{SelectPageOLInt} void SelectPage( int index ) %Overload;
%name{SelectPageOLString} void SelectPage( const wxString& label ) %Overload;
%name{SelectPageOLGridPage} void SelectPage( wxPropertyGridPage* page ) %Overload;
bool SelectProperty( wxString& id, bool focus = false );
void SetColumnCount( int colCount, int page = -1 );
void SetColumnTitle( int idx, const wxString& title );
void SetDescription( const wxString& label, const wxString& content );
/** Sets y coordinate of the description box splitter. */
void SetDescBoxHeight( int ht, bool refresh = true );
void SetSplitterLeft( bool subProps = false, bool allPages = true );
void SetPageSplitterPosition( int page, int pos, int column = 0 );
void SetSplitterPosition( int pos, int column = 0 );
/** Synonyme for SelectPage(name). */
/* void SetStringSelection( const wxChar* name ); */
void ShowHeader(bool show = true);
//
// Subclassing helpers
//
/**
Creates property grid for the manager. Reimplement in derived class to
use subclassed wxPropertyGrid. However, if you do this then you
must also use the two-step construction (ie. default constructor and
Create() instead of constructor with arguments) when creating the
manager.
*/
protected:
virtual wxPropertyGrid* CreatePropertyGrid() const; /* %Virtual; */
};
/**************************************************************************/
/* */
/* wxPropertyGridInterface */
/* */
/**************************************************************************/
#define WXPERL_IN_PROPERTYGRIDMANAGER
INCLUDE_COMMAND: $^X -I../.. -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp -t ../../typemap.xsp XS/PropertyGridInterface.xsp
INCLUDE_COMMAND: $^X -pe "s/PGPGridInterfaceBase/PropertyGridManager/g" xspp/PropertyGridInterface.h
#unded WXPERL_IN_PROPERTYGRIDMANAGER
#endif
|