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
|
#############################################################################
## Name: ext/propgrid/XS/PGCell.xsp
## Purpose: XS++ for Wx::PGCell
## 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
#include <wx/propgrid/property.h>
%loadplugin{build::Wx::XSP::Overload};
%name{Wx::PGCell} class wxPGCell : public %name{Wx::Object} wxObject
{
%{
static void
wxPGCell::CLONE()
CODE:
wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}
public:
%name{newDefault} wxPGCell() %Overload;
%name{newCopy} wxPGCell(const wxPGCell& other) %Overload;
%name{newFull}wxPGCell( const wxString& text,
const wxBitmap& bitmap = wxNullBitmapPtr,
const wxColour& fgCol = wxNullColourPtr,
const wxColour& bgCol = wxNullColourPtr ) %Overload;
~wxPGCell()
%code%{ wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
delete THIS;
%};
/* NOT WRAP */
/* const wxPGCellData* GetData() const; */
bool HasText() const;
void MergeFrom( const wxPGCell& srcCell );
void SetText( const wxString& text );
void SetBitmap( const wxBitmap& bitmap );
void SetFgCol( const wxColour& col );
void SetFont( const wxFont& font );
void SetBgCol( const wxColour& col );
const wxString& GetText() const;
const wxBitmap& GetBitmap() const;
const wxColour& GetFgCol() const;
const wxFont& GetFont() const;
const wxColour& GetBgCol() const;
};
%name{Wx::PGChoices} class wxPGChoices
{
%{
static void
wxPGChoices::CLONE()
CODE:
wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}
public:
%name{newDefault} wxPGChoices() %Overload;
%name{newCopy} wxPGChoices( const wxPGChoices& a ) %Overload;
%name{newArrayString} wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ) %Overload;
%name{newChoicesData} wxPGChoices( wxPGChoicesData* data ) %Overload;
~wxPGChoices()
%code%{ wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
delete THIS;
%};
%name{AddArrayString} void Add( const wxArrayString& arr, const wxArrayInt& arrint ) %Overload;
/** Adds single item. */
%name{AddSingleItem} wxPGChoiceEntry& Add( const wxString& label, int value = wxPG_INVALID_VALUE ) %Overload;
/** Adds a single item, with bitmap. */
%name{AddSingleBitmapItem} wxPGChoiceEntry& Add( const wxString& label, const wxBitmap& bitmap,
int value = wxPG_INVALID_VALUE ) %Overload;
/** Adds a single item with full entry information. */
%name{AddCoiceEntry} wxPGChoiceEntry& Add( const wxPGChoiceEntry& entry ) %Overload;
/** Adds single item, sorted. */
wxPGChoiceEntry& AddAsSorted( const wxString& label, int value = wxPG_INVALID_VALUE );
void Assign( const wxPGChoices& a );
void AssignData( wxPGChoicesData* data );
void Clear();
wxPGChoices Copy() const;
const wxString& GetLabel( unsigned int ind ) const;
unsigned int GetCount() const;
int GetValue( unsigned int ind ) const;
wxArrayInt GetValuesForStrings( const wxArrayString& strings ) const;
/* TODO FIXME
wxArrayInt GetIndicesForStrings( const wxArrayString& strings, wxArrayString* unmatched ) const;
*/
/* wxPGProperty* GetItemAtY( unsigned int y ) const; */
/* bool HasValue( unsigned int i ) const; */
%name{IndexFromString} int Index( const wxString& label ) const %Overload;
%name{IndexFromInt} int Index( int val ) const %Overload;
%name{InsertStringLabel} wxPGChoiceEntry& Insert( const wxString& label, int index, int value = wxPG_INVALID_VALUE ) %Overload;
%name{InsertChoiceEntry} wxPGChoiceEntry& Insert( const wxPGChoiceEntry& entry, int index ) %Overload;
bool IsOk() const;
wxPGChoiceEntry& Item( unsigned int i );
void RemoveAt(size_t nIndex, size_t count = 1);
void Set( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() );
void AllocExclusive();
wxArrayString GetLabels() const;
/*void operator= (const wxPGChoices& a); */
/* wxPGChoiceEntry& operator[](unsigned int i); */
/* const wxPGChoiceEntry& operator[](unsigned int i) const; */
};
%name{Wx::PGChoicesData} class wxPGChoicesData : public wxObjectRefData
{
public:
wxPGChoicesData();
void CopyDataFrom( wxPGChoicesData* data );
wxPGChoiceEntry& Insert( int index, const wxPGChoiceEntry& item );
void Clear();
unsigned int GetCount() const;
wxPGChoiceEntry& Item( unsigned int i );
private:
~wxPGChoicesData()
%code%{ THIS->wxObjectRefData->DecRef();
%};
};
%name{Wx::PGChoiceEntry} class wxPGChoiceEntry : public %name{Wx::PGCell} wxPGCell
{
%{
static void
wxPGChoiceEntry::CLONE()
CODE:
wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}
public:
%name{newDefault} wxPGChoiceEntry() %Overload;
%name{newCopy} wxPGChoiceEntry(const wxPGChoiceEntry& other) %Overload;
%name{newValues} wxPGChoiceEntry( const wxString& label,
int value = wxPG_INVALID_VALUE ) %Overload;
~wxPGChoiceEntry()
%code%{ wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
delete THIS;
%};
void SetValue( int value );
int GetValue() const;
};
%name{Wx::PGValidationInfo} class wxPGValidationInfo
{
%{
static void
wxPGValidationInfo::CLONE()
CODE:
wxPli_thread_sv_clone( aTHX_ CLASS, (wxPliCloneSV)wxPli_detach_object );
%}
public:
wxPGValidationInfo();
~wxPGValidationInfo()
%code%{ wxPli_thread_sv_unregister( aTHX_ wxPli_get_class( aTHX_ ST(0) ), THIS, ST(0) );
delete THIS;
%};
wxByte GetFailureBehavior();
const wxString& GetFailureMessage() const;
wxVariant& GetValue();
void SetFailureBehavior(wxByte failureBehavior);
void SetFailureMessage(const wxString& message);
};
#endif
|