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 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575
|
#############################################################################
## Name: XS/Sizer.xsp
## Purpose: XS for Wx::Sizer and derived classes
## Author: Mattia Barbon
## Modified by:
## Created: 31/10/2000
## RCS-ID: $Id: Sizer.xsp 3173 2012-03-08 02:50:45Z mdootson $
## Copyright: (c) 2000-2003, 2005-2008, 2010 Mattia Barbon
## Licence: This program is free software; you can redistribute it and/or
## modify it under the same terms as Perl itself
#############################################################################
%{
#include <wx/sizer.h>
#include <wx/statbox.h>
#include "cpp/sizer.h"
%}
%module{Wx};
%loadplugin{build::Wx::XSP::Overload};
%typemap{wxFlexSizerGrowMode}{simple};
%typemap{wxSizerItem*}{simple};
%typemap{Wx_UserDataO*}{simple};
%typemap{wxStdDialogButtonSizer*}{simple};
%typemap{wxWrapSizer*}{simple};
%typemap{wxButton*}{simple};
%name{Wx::Sizer} class wxSizer
{
#if WXPERL_W_VERSION_GE( 2, 5, 4 )
%name{AddWindow} wxSizerItem* Add( wxWindow* window, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{AddSizer} wxSizerItem* Add( wxSizer* sizer, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{AddSpace} wxSizerItem* Add( int width, int height, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{PrependWindow} wxSizerItem* Prepend( wxWindow* window,
int option = 0, int flag = 0,
int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{PrependSizer} wxSizerItem* Prepend( wxSizer* sizer, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{PrependSpace} wxSizerItem* Prepend( int width, int height,
int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{InsertWindow} wxSizerItem* Insert( int pos, wxWindow* window,
int option = 0, int flag = 0,
int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{InsertSizer} wxSizerItem* Insert( int pos, wxSizer* sizer,
int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{InsertSpace} wxSizerItem* Insert( int pos, int width, int height,
int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
#else
%name{AddWindow} void Add( wxWindow* window, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{AddSizer} void Add( wxSizer* sizer, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{AddSpace} void Add( int width, int height, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{PrependWindow} void Prepend( wxWindow* window,
int option = 0, int flag = 0,
int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{PrependSizer} void Prepend( wxSizer* sizer, int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{PrependSpace} void Prepend( int width, int height,
int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{InsertWindow} void Insert( int pos, wxWindow* window,
int option = 0, int flag = 0,
int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{InsertSizer} void Insert( int pos, wxSizer* sizer,
int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
%name{InsertSpace} void Insert( int pos, int width, int height,
int option = 0,
int flag = 0, int border = 0,
Wx_UserDataO* data = NULL ) %Overload;
#endif
#if WXPERL_W_VERSION_GE( 2, 5, 4 )
%name{GetItemWindow} wxSizerItem* GetItem( wxWindow* window,
bool recursive = false ) %Overload;
%name{GetItemSizer} wxSizerItem* GetItem( wxSizer* sizer,
bool recursive = false ) %Overload;
%name{GetItemNth} wxSizerItem* GetItem( size_t index ) %Overload;
#else
%{
wxSizerItem*
wxSizer::GetItemNth( index )
size_t index
CODE:
RETVAL = index >= THIS->GetChildren().GetCount() ? NULL :
THIS->GetChildren().Item( index )->GetData();
OUTPUT: RETVAL
%}
#endif
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
wxSizerItem* GetItemById( int id, bool recursive = false );
#endif
%name{HideSizer} bool Hide( wxSizer *sizer, bool recursive = false ) %Overload;
%name{HideWindow} bool Hide( wxWindow *window, bool recursive = false ) %Overload;
%name{HideIndex} bool Hide( size_t index ) %Overload;
%name{IsShownWindow} bool IsShown( wxWindow *window ) const %Overload;
%name{IsShownSizer} bool IsShown( wxSizer *sizer ) const %Overload;
%name{IsShownIndex} bool IsShown( size_t index ) const %Overload;
# DECLARE_OVERLOAD( wszi, Wx::SizerItem )
#if WXPERL_W_VERSION_GE( 2, 7, 2 )
%name{ReplaceWindow} bool Replace( wxWindow *oldwin, wxWindow *newwin,
bool recursive = false ) %Overload;
%name{ReplaceSizer} bool Replace( wxSizer *oldsz, wxSizer *newsz,
bool recursive = false ) %Overload;
%name{ReplaceIndex} bool Replace( size_t index, wxSizerItem *newitem ) %Overload;
#endif
void RecalcSizes();
void Clear( bool deleteWindows = false );
void DeleteWindows();
wxSize CalcMin();
wxSize Fit( wxWindow* window );
void FitInside( wxWindow* window );
wxSize GetSize();
wxPoint GetPosition();
wxSize GetMinSize();
void Layout();
#if WXPERL_W_VERSION_LT( 2, 7, 0 ) || WXWIN_COMPATIBILITY_2_6
%name{RemoveWindow} bool Remove( wxWindow* window ) %Overload;
#endif
%name{RemoveSizer} bool Remove( wxSizer* window ) %Overload;
%name{RemoveNth} bool Remove( int nth ) %Overload;
#if WXPERL_W_VERSION_GE( 2, 5, 3 )
%name{DetachWindow} bool Detach( wxWindow* window ) %Overload;
%name{DetachSizer} bool Detach( wxSizer* window ) %Overload;
%name{DetachNth} bool Detach( int nth ) %Overload;
#endif
#if WXPERL_W_VERSION_GE( 2, 7, 1 )
wxWindow* GetContainingWindow();
void SetContainingWindow( wxWindow* window );
#endif
void SetDimension( int x, int y, int width, int height );
%name{SetItemMinSizeWindow}
void SetItemMinSize( wxWindow* window, int width, int height ) %Overload;
%name{SetItemMinSizeSizer}
void SetItemMinSize( wxSizer* window, int width, int height ) %Overload;
%name{SetItemMinSizeNth}
void SetItemMinSize( int pos, int width, int height ) %Overload;
%name{SetMinSizeSize} void SetMinSize( wxSize size ) %Overload;
%name{SetMinSizeXY} void SetMinSize( int x, int y ) %Overload;
void SetSizeHints( wxWindow* window );
#if WXPERL_W_VERSION_LT( 2, 9, 0 )
void SetVirtualSizeHints( wxWindow* window );
#endif
#if WXPERL_W_VERSION_GE( 2, 6, 2 )
%name{ShowWindow} bool Show( wxWindow* window, bool show = true, bool recursive = false ) %Overload;
%name{ShowSizer} bool Show( wxSizer* sizer, bool show = true, bool recursive = false ) %Overload;
%name{ShowIndex} bool Show( size_t index, bool show = true ) %Overload;
#else
#if WXPERL_W_VERSION_GE( 2, 5, 3 )
%name{ShowWindow} bool Show( wxWindow* window, bool show = true ) %Overload;
%name{ShowSizer} bool Show( wxSizer* sizer, bool show = true ) %Overload;
%name{ShowIndex} bool Show( size_t index, bool show = true ) %Overload;
#else
%name{ShowWindow} void Show( wxWindow* window, bool show = true ) %Overload;
%name{ShowSizer} void Show( wxSizer* sizer, bool show = true ) %Overload;
#endif
#endif
#if WXPERL_W_VERSION_GE( 2, 5, 4 )
wxSizerItem* AddSpacer( int size );
wxSizerItem* AddStretchSpacer( int prop = 1 );
wxSizerItem* InsertSpacer( size_t index, int size );
wxSizerItem* InsertStretchSpacer( size_t index, int prop = 1 );
wxSizerItem* PrependSpacer( int size );
wxSizerItem* PrependStretchSpacer( int prop = 1 );
#else // for xsubpp
#if WXPERL_W_VERSION_GE( 2, 5, 3 )
void AddSpacer( int size );
void AddStretchSpacer( int prop = 1 );
void InsertSpacer( size_t index, int size );
void InsertStretchSpacer( size_t index, int prop = 1 );
void PrependSpacer( int size );
void PrependStretchSpacer( int prop = 1 );
#endif
#endif
};
%name{Wx::FlexGridSizer} class wxFlexGridSizer
{
#if WXPERL_W_VERSION_GE( 2, 5, 1 )
void AddGrowableCol( size_t index, int proportion = 0 );
void AddGrowableRow( size_t index, int proportion = 0 );
void SetFlexibleDirection( int direction );
int GetFlexibleDirection();
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode);
wxFlexSizerGrowMode GetNonFlexibleGrowMode();
#else
void AddGrowableCol( size_t index );
void AddGrowableRow( size_t index );
#endif
};
%name{Wx::SizerItem} class wxSizerItem
{
%name{SetRatioWH} void SetRatio( int width, int height ) %Overload;
%name{SetRatioSize} void SetRatio( wxSize size ) %Overload;
%name{SetRatioFloat} void SetRatio( float ratio ) %Overload;
#if WXPERL_W_VERSION_GE( 2, 5, 1 )
%name{GetOption} int GetProportion();
%name{SetOption} void SetProportion( int option );
int GetProportion();
void SetProportion( int proportion );
#else
%name{GetProportion} int GetOption();
%name{SetProportion} void SetOption( int proportion );
int GetOption();
void SetOption( int option );
#endif
#if WXPERL_W_VERSION_GE( 2, 5, 3 )
%name{SetMinSizeWH} void SetMinSize( int x, int y ) %Overload;
%name{SetMinSizeSize} void SetMinSize( wxSize size ) %Overload;
#endif
void DeleteWindows();
void DetachSizer();
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
void SetId( int id );
int GetId() const;
#endif
#if WXPERL_W_VERSION_GE( 2, 6, 0 )
const wxRect& GetRect();
#endif
void Show( bool show );
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
void AssignSpacer( int width, int height );
#else
#if WXPERL_W_VERSION_GE( 2, 6, 0 )
void SetSpacer( int width, int height );
#endif
#endif
wxSize GetSpacer() const;
};
#if WXPERL_W_VERSION_GE( 2, 6, 1 )
#include <wx/button.h>
%name{Wx::StdDialogButtonSizer} class wxStdDialogButtonSizer
{
wxStdDialogButtonSizer();
void AddButton( wxButton* button );
void SetAffirmativeButton( wxButton* button );
void SetNegativeButton( wxButton* button );
void SetCancelButton( wxButton* button );
void Realize();
wxButton *GetAffirmativeButton() const;
wxButton *GetApplyButton() const;
wxButton *GetNegativeButton() const;
wxButton *GetCancelButton() const;
wxButton *GetHelpButton() const;
};
#endif
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
#include <wx/wrapsizer.h>
%name{Wx::WrapSizer} class wxWrapSizer
{
wxWrapSizer( int orient = wxHORIZONTAL,
int flags = wxEXTEND_LAST_ON_EACH_LINE );
bool InformFirstDirection( int direction, int size,
int availableOtherDir );
};
#endif
%{
MODULE=Wx PACKAGE=Wx::Sizer
void
wxSizer::Destroy()
CODE:
delete THIS;
void
wxSizer::GetChildren()
PPCODE:
#if WXPERL_W_VERSION_GE( 2, 5, 1 )
wxSizerItemList::compatibility_iterator node;
const wxSizerItemList& list
#else
wxList::compatibility_iterator node;
const wxList& list
#endif
= THIS->GetChildren();
EXTEND( SP, (IV) list.GetCount() );
for( node = list.GetFirst(); node; node = node->GetNext() )
PUSHs( wxPli_object_2_sv( aTHX_ sv_newmortal(), node->GetData() ) );
MODULE=Wx PACKAGE=Wx::BoxSizer
wxBoxSizer*
wxBoxSizer::new( orientation )
int orientation
int
wxBoxSizer::GetOrientation()
#if WXPERL_W_VERSION_GE( 2, 8, 0 )
void
wxBoxSizer::SetOrientation( orientation )
int orientation
#endif
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
bool
wxBoxSizer::IsVertical()
#endif
MODULE=Wx PACKAGE=Wx::StaticBoxSizer
wxStaticBoxSizer*
wxStaticBoxSizer::new( box, orient )
wxStaticBox* box
int orient
wxStaticBox*
wxStaticBoxSizer::GetStaticBox()
MODULE=Wx PACKAGE=Wx::NotebookSizer
#include <wx/notebook.h>
wxNotebookSizer*
wxNotebookSizer::new( notebook )
wxNotebook* notebook
wxNotebook*
wxNotebookSizer::GetNotebook()
MODULE=Wx PACKAGE=Wx::GridSizer
wxGridSizer*
wxGridSizer::new( rows, cols, vgap = 0, hgap = 0 )
int rows
int cols
int vgap
int hgap
int
wxGridSizer::GetCols()
int
wxGridSizer::GetHGap()
int
wxGridSizer::GetRows()
int
wxGridSizer::GetVGap()
void
wxGridSizer::SetCols( cols )
int cols
void
wxGridSizer::SetHGap( gap )
int gap
void
wxGridSizer::SetRows( rows )
int rows
void
wxGridSizer::SetVGap( gap )
int gap
MODULE=Wx PACKAGE=Wx::FlexGridSizer
wxFlexGridSizer*
wxFlexGridSizer::new( rows, cols, vgap = 0, hgap = 0 )
int rows
int cols
int vgap
int hgap
void
wxFlexGridSizer::RemoveGrowableCol( index )
size_t index
void
wxFlexGridSizer::RemoveGrowableRow( index )
int index
MODULE=Wx PACKAGE=Wx::SizerItem
wxSize*
wxSizerItem::GetSize()
CODE:
RETVAL = new wxSize( THIS->GetSize() );
OUTPUT:
RETVAL
wxSize*
wxSizerItem::CalcMin()
CODE:
RETVAL = new wxSize( THIS->GetSize() );
OUTPUT:
RETVAL
void
wxSizerItem::SetDimension( pos, size )
wxPoint pos
wxSize size
wxSize*
wxSizerItem::GetMinSize()
CODE:
RETVAL = new wxSize( THIS->GetMinSize() );
OUTPUT:
RETVAL
float
wxSizerItem::GetRatio()
bool
wxSizerItem::IsWindow()
bool
wxSizerItem::IsShown()
bool
wxSizerItem::IsSizer()
bool
wxSizerItem::IsSpacer()
void
wxSizerItem::SetInitSize( x, y )
int x
int y
void
wxSizerItem::SetFlag( flag )
int flag
void
wxSizerItem::SetBorder( border )
int border
wxWindow*
wxSizerItem::GetWindow()
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
void
wxSizerItem::AssignWindow( window )
wxWindow* window
#else
void
wxSizerItem::SetWindow( window )
wxWindow* window
#endif
wxSizer*
wxSizerItem::GetSizer()
#if WXPERL_W_VERSION_GE( 2, 9, 0 )
void
wxSizerItem::AssignSizer( sizer )
wxSizer* sizer
#else
void
wxSizerItem::SetSizer( sizer )
wxSizer* sizer
#endif
int
wxSizerItem::GetFlag()
int
wxSizerItem::GetBorder()
wxPoint*
wxSizerItem::GetPosition()
CODE:
RETVAL = new wxPoint( THIS->GetPosition() );
OUTPUT:
RETVAL
Wx_UserDataO*
wxSizerItem::GetUserData()
CODE:
RETVAL = (Wx_UserDataO*) THIS->GetUserData();
OUTPUT:
RETVAL
#if WXPERL_W_VERSION_GE( 2, 6, 3 )
void
wxSizerItem::SetUserData( data )
Wx_UserDataO* data
#endif
MODULE=Wx PACKAGE=Wx::PlSizer
wxPlSizer*
wxPlSizer::new()
CODE:
RETVAL = new wxPlSizer( CLASS );
OUTPUT:
RETVAL
%}
|