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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
|
#############################################################################
## Name: ext/propgrid/XS/PropertyGrid.xsp
## Purpose: XS++ for Wx::PropertyGrid
## 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::PropertyGridHitTestResult} class wxPropertyGridHitTestResult
{
%{
static void
wxPropertyGridHitTestResult::CLONE()
CODE:
wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}
public:
wxPropertyGridHitTestResult();
~wxPropertyGridHitTestResult()
%code%{ wxPli_thread_sv_unregister( aTHX_ "Wx::PropertyGridHitTestResult", THIS, ST(0) );
delete THIS;
%};
int GetColumn() const;
wxPGProperty__parsed_nodelete* GetProperty();
int GetSplitter() const;
int GetSplitterHitOffset() const;
};
%name{Wx::PropertyGrid} class wxPropertyGrid : public %name{Wx::Control} wxControl
{
public:
%name{newDefault} wxPropertyGrid() %Overload
%postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};
%name{newFull} wxPropertyGrid( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPG_DEFAULT_STYLE,
const wxString& name = wxPropertyGridNameStr ) %Overload
%postcall{% wxPli_create_evthandler( aTHX_ RETVAL, CLASS ); %};
void AddActionTrigger( int action, int keycode, int modifiers = 0 );
%name{AddToSelectionString} bool AddToSelection( wxString& id ) %Overload;
%name{AddToSelectionProperty} bool AddToSelection( wxPGProperty* id ) %Overload;
static void AutoGetTranslation( bool enable );
void BeginLabelEdit( unsigned int colIndex = 0 );
%name{ChangePropertyValueString} bool ChangePropertyValue( wxString& id, wxVariantArg newValue ) %Overload;
%name{ChangePropertyValueProperty} bool ChangePropertyValue( wxPGProperty* id, wxVariantArg newValue ) %Overload;
void CenterSplitter( bool enableAutoResizing = false );
virtual void Clear(); /* %Virtual; */
virtual wxPGVIterator GetVIterator( int flags ) const; /* %Virtual; */
%name{IsPropertySelectedString} virtual bool IsPropertySelected( wxString& id ) const %Overload; /* %Virtual; */
%name{IsPropertySelectedProperty} virtual bool IsPropertySelected( wxPGProperty* id ) const %Overload; /* %Virtual; */
void ClearActionTriggers( int action );
virtual bool CommitChangesFromEditor( wxUint32 flags = 0 ); /* %Virtual; */
bool Create( wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxPG_DEFAULT_STYLE,
const wxString& name = wxPropertyGridNameStr );
void DedicateKey( int keycode );
bool EnableCategories( bool enable );
void EndLabelEdit( bool commit = true );
%name{EnsureVisibleString} bool EnsureVisible( wxString& id ) %Overload;
%name{EnsureVisibleProperty} bool EnsureVisible( wxPGProperty* id ) %Overload;
wxSize FitColumns();
wxTextCtrl* GetLabelEditor() const;
wxWindow* GetPanel();
wxColour GetCaptionBackgroundColour() const;
wxFont& GetCaptionFont();
wxColour GetCaptionForegroundColour() const;
wxColour GetCellBackgroundColour() const;
wxColour GetCellDisabledTextColour() const;
wxColour GetCellTextColour() const;
unsigned int GetColumnCount() const;
wxColour GetEmptySpaceColour() const;
int GetFontHeight() const;
wxPropertyGrid* GetGrid();
wxRect GetImageRect( wxPGProperty* property, int item ) const;
wxSize GetImageSize( wxPGProperty* property = NULL, int item = -1 ) const;
wxPGProperty__parsed_nodelete* GetLastItem( int flags = wxPG_ITERATE_DEFAULT );
wxColour GetLineColour() const;
wxColour GetMarginColour() const;
%name{GetPropertyCategoryString} wxPropertyCategory__parsed_nodelete* GetPropertyCategory( wxString& id ) const %Overload;
%name{GetPropertyCategoryProperty} wxPropertyCategory__parsed_nodelete* GetPropertyCategory( wxPGProperty* id ) const %Overload;
wxPGProperty__parsed_nodelete* GetRoot() const;
int GetRowHeight() const;
wxPGProperty__parsed_nodelete* GetSelectedProperty() const;
wxPGProperty__parsed_nodelete* GetSelection() const;
wxColour GetSelectionBackgroundColour() const;
wxColour GetSelectionForegroundColour() const;
/* wxPGSortCallback GetSortFunction() const; */
int GetSplitterPosition( unsigned int splitterIndex = 0 ) const;
wxTextCtrl* GetEditorTextCtrl() const;
const wxPGCell& GetUnspecifiedValueAppearance() const;
wxString GetUnspecifiedValueText( int argFlags = 0 ) const;
int GetVerticalSpacing() const;
wxPropertyGridHitTestResult HitTest( const wxPoint& pt ) const;
bool IsAnyModified() const;
bool IsEditorFocused() const;
bool IsFrozen() const;
void MakeColumnEditable( unsigned int column, bool editable = true );
void OnTLPChanging( wxWindow* newTLP );
void RefreshEditor();
virtual void RefreshProperty( wxPGProperty* p ); /* %Virtual; */
static wxPGEditor__parsed_nodelete* RegisterEditorClass( wxPGEditor__parsed_nodelete* editor, bool noDefCheck = false );
static wxPGEditor__parsed_nodelete* DoRegisterEditorClass( wxPGEditor__parsed_nodelete* editor, const wxString& name, bool noDefCheck = false );
void ResetColours();
void ResetColumnSizes( bool enableAutoResizing = false );
%name{RemoveFromSelectionString} bool RemoveFromSelection( wxString& id ) %Overload;
%name{RemoveFromSelectionProperty} bool RemoveFromSelection( wxPGProperty* id ) %Overload;
%name{SelectPropertyString} bool SelectProperty( wxString& id, bool focus = false ) %Overload;
%name{SelectPropertyProperty} bool SelectProperty( wxPGProperty* id, bool focus = false ) %Overload;
void SetCaptionBackgroundColour(const wxColour& col);
void SetCaptionTextColour(const wxColour& col);
void SetCellBackgroundColour(const wxColour& col);
void SetCellDisabledTextColour(const wxColour& col);
void SetCellTextColour(const wxColour& col);
void SetColumnCount( int colCount );
%name{SetCurrentCategoryString} void SetCurrentCategory( wxString& id ) %Overload;
%name{SetCurrentCategoryProperty} void SetCurrentCategory( wxPGProperty* id ) %Overload;
void SetEmptySpaceColour(const wxColour& col);
void SetLineColour(const wxColour& col);
void SetMarginColour(const wxColour& col);
%{
void
wxPropertyGrid::SetSelection( selectarr = 0 )
SV* selectarr
PREINIT:
wxArrayPGProperty newSelections;
CODE:
AV* av;
if( !SvROK( selectarr ) ||
( SvTYPE( (SV*) ( av = (AV*) SvRV( selectarr ) ) ) != SVt_PVAV ) )
{
croak( "the value is not an array reference" );
return;
}
int n = av_len( av ) + 1;
for( int i = 0; i < n; ++i )
{
SV* t = *av_fetch( av, i, 0 );
newSelections.push_back( (wxPGProperty*)wxPli_sv_2_object( aTHX_ t, "Wx::PGProperty" ) );
}
THIS->SetSelection( newSelections );
%}
void SetSelectionBackgroundColour(const wxColour& col);
void SetSelectionTextColour(const wxColour& col);
/* void SetSortFunction( wxPGSortCallback sortFunction ); */
void SetSplitterPosition( int newxpos, int col = 0 );
void SetSplitterLeft( bool privateChildrenToo = false );
void SetUnspecifiedValueAppearance( const wxPGCell& cell );
void SetVerticalSpacing( int vspacing );
virtual void DoShowPropertyError( wxPGProperty* property,
const wxString& msg ); /* %Virtual; */
virtual void DoHidePropertyError( wxPGProperty* property );/* %Virtual; */
#if wxUSE_STATUSBAR
virtual wxStatusBar* GetStatusBar(); /* %Virtual; */
#endif
void EditorsValueWasModified();
void EditorsValueWasNotModified();
wxVariant GetUncommittedPropertyValue();
bool IsEditorsValueModified() const;
void ShowPropertyError( wxString& id, const wxString& msg );
bool WasValueChangedInEvent() const;
wxWindow* GetEditorControl() const;
wxWindow* GetPrimaryEditor() const;
wxWindow* GetEditorControlSecondary() const;
};
/**************************************************************************/
/* */
/* wxPropertyGridInterface */
/* */
/**************************************************************************/
#define WXPERL_IN_PROPERTYGRID
INCLUDE_COMMAND: $^X -I../.. -MExtUtils::XSpp::Cmd -e xspp -- -t typemap.xsp -t ../../typemap.xsp XS/PropertyGridInterface.xsp
INCLUDE_COMMAND: $^X -pe "s/PGPGridInterfaceBase/PropertyGrid/g" xspp/PropertyGridInterface.h
#undef WXPERL_IN_PROPERTYGRID
#endif
|