<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!--
wxFormBuilder - A Visual Dialog Editor for wxWidgets.
Copyright (C) 2005 José Antonio Hurtado

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Written by
  José Antonio Hurtado - joseantonio.hurtado@gmail.com
  Juan Antonio Ortega  - jortegalalmolda@gmail.com

Python code generation written by
  Michal Bližňák - michal.bliznak@gmail.com
-->
<codegen language="Python">

	<templates class="wxPanel">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $window_style #ifnotnull $window_name @{, $window_name @} )</template>
	</templates>

	<templates class="wxCollapsiblePane">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $label, $pos, $size, $style #ifnotnull $window_style @{|$window_style @} #ifnotnull $window_name @{, wx.DefaultValidator, $window_name @} )</template>
		<template name="settings">#ifnotnull $collapsed @{ self.$name.Collapse( $collapsed ) #nl @}</template>
		<template name="evt_connect_OnCollapsiblePaneChanged">self.$name.Bind( wx.EVT_COLLAPSIBLEPANE_CHANGED, #handler )</template>
	</templates>

	<templates class="wxSplitterWindow">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} #ifnotnull $window_name @{, $window_name @} )</template>
		<!--<template name="settings">
			#ifnotnull $sashgravity
			@{
				#ifnotequal $sashgravity "0.0"
			@{ self.$name.SetSashGravity( $sashgravity ) #nl @}
			@}
			#ifnotnull $sashsize
			@{
				#ifnotequal $sashsize "-1"
			@{	self.$name.SetSashSize( $sashsize ) #nl @}
			@}
			#ifnotnull $min_pane_size
			@{
				#ifnotequal $min_pane_size "0"
			@{	self.$name.SetMinimumPaneSize( $min_pane_size ) #nl @}
			@}
			#ifnotnull $sashpos
			@{
			self.$name.SetSashPosition( $sashpos ) #nl
			@}
		</template>-->
		<template name="settings">
			#ifnotnull $sashgravity
			@{
				#ifnotequal $sashgravity "0.0"
			@{ self.$name.SetSashGravity( $sashgravity ) #nl @}
			@}
			#ifnotnull $sashsize
			@{
				#ifnotequal $sashsize "-1"
			@{	self.$name.SetSashSize( $sashsize ) #nl @}
			@}
			#ifnotnull $sashpos
			@{
				#ifnotequal $sashpos "-1"
			@{	self.$name.Bind( wx.EVT_IDLE, self.$name #append OnIdle ) #nl @}
			@}
			#ifnotnull $min_pane_size
			@{
				#ifnotequal $min_pane_size "0"
			@{	self.$name.SetMinimumPaneSize( $min_pane_size ) #nl @}
			@}
		</template>
		<template name="generated_event_handlers">
			#ifnotnull $sashpos
			@{
				#ifnotequal $sashpos "-1"
				@{
					def $name #append OnIdle( self, event ): #indent #nl
						self.$name.SetSashPosition( $sashpos ) #nl
						self.$name.Unbind( wx.EVT_IDLE ) #unindent #nl
				@}
			@}
		</template>
		<template name="evt_connect_OnSplitterSashPosChanging">self.$name.Bind( wx.EVT_SPLITTER_SASH_POS_CHANGING, #handler )</template>
		<template name="evt_connect_OnSplitterSashPosChanged">self.$name.Bind( wx.EVT_SPLITTER_SASH_POS_CHANGED, #handler )</template>
		<template name="evt_connect_OnSplitterUnsplit">self.$name.Bind( wx.EVT_SPLITTER_UNSPLIT, #handler )</template>
		<template name="evt_connect_OnSplitterDClick">self.$name.Bind( wx.EVT_SPLITTER_DCLICK, #handler )</template>
	</templates>


	<templates class="wxNotebook">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} #ifnotnull $window_name @{, $window_name @} )</template>
		<template name="settings">
			#ifnotnull $bitmapsize
			@{
				$name #append ImageSize = $bitmapsize #nl
				$name #append Index = 0 #nl
				$name #append Images = wx.ImageList( $name #append ImageSize.GetWidth(), $name #append ImageSize.GetHeight() ) #nl
				self.$name.AssignImageList( $name #append Images )
			@}
		</template>
		<template name="evt_connect_OnNotebookPageChanged">self.$name.Bind( wx.EVT_NOTEBOOK_PAGE_CHANGED, #handler )</template>
		<template name="evt_connect_OnNotebookPageChanging">self.$name.Bind( wx.EVT_NOTEBOOK_PAGE_CHANGING, #handler )</template>
	</templates>

	<templates class="notebookpage">
		<template name="page_add">self.#parent $name.AddPage( self.#child $name, $label, $select )</template>
		<template name="settings">
			#ifnotnull #parent $bitmapsize
			@{
				#ifnotnull $bitmap
				@{
					#parent $name #append Bitmap = $bitmap #nl
					if ( #parent $name #append Bitmap.IsOk() ): #indent #nl
						#parent $name #append Images.Add( #parent $name #append Bitmap ) #nl
						self.#parent $name.SetPageImage( #parent $name #append Index, #parent $name #append Index ) #nl
						#parent $name #append Index += 1 #unindent #nl
				@}
			@}
		</template>
	</templates>

	<templates class="wxListbook">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} #ifnotnull $window_name @{, $window_name @} )</template>
		<template name="settings">
			#ifnotnull $bitmapsize
			@{
				$name #append ImageSize = $bitmapsize #nl
				$name #append Index = 0 #nl
				$name #append Images = wx.ImageList( $name #append ImageSize.GetWidth(), $name #append ImageSize.GetHeight() ) #nl
				self.$name.AssignImageList( $name #append Images )
			@}
		</template>
		<!-- <template name="after_addchild">
			#ifnull $bitmapsize
			@{
				$name #append ListView = self.$name.GetListView() #nl
				$name #append Flags = $name #append ListView.GetWindowStyleFlag() #nl
				$name #append Flags = ( $name #append Flags &amp; ~wx.LC_ICON ) | wx.LC_SMALL_ICON #nl
				$name #append ListView.SetWindowStyleFlag( $name #append Flags ) #nl
			@}
		</template> -->
		<template name="evt_connect_OnListbookPageChanged">self.$name.Bind( wx.EVT_LISTBOOK_PAGE_CHANGED, #handler )</template>
		<template name="evt_connect_OnListbookPageChanging">self.$name.Bind( wx.EVT_LISTBOOK_PAGE_CHANGING, #handler )</template>
	</templates>

	<templates class="listbookpage">
		<template name="page_add">self.#parent $name.AddPage( self.#child $name, $label, $select )</template>
		<template name="settings">
			#ifnotnull #parent $bitmapsize
			@{
				#ifnotnull $bitmap
				@{
					#parent $name #append Bitmap = $bitmap #nl
					if ( #parent $name #append Bitmap.IsOk() ): #indent #nl
						#parent $name #append Images.Add( #parent $name #append Bitmap ) #nl
						self.#parent $name.SetPageImage( #parent $name #append Index, #parent $name #append Index ) #nl
						#parent $name #append Index += 1 #unindent #nl
				@}
			@}
		</template>
	</templates>

	<templates class="wxChoicebook">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} #ifnotnull $window_name @{, $window_name @} )</template>
		<template name="evt_connect_OnChoicebookPageChanged">self.$name.Bind( wx.EVT_CHOICEBOOK_PAGE_CHANGED, #handler )</template>
		<template name="evt_connect_OnChoicebookPageChanging">self.$name.Bind( wx.EVT_CHOICEBOOK_PAGE_CHANGING, #handler )</template>
	</templates>

	<templates class="choicebookpage">
		<template name="page_add">self.#parent $name.AddPage( self.#child $name, $label, $select )</template>
	</templates>

	<templates class="wxSimplebook">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $window_style #ifnotnull $window_name @{, $window_name @} )</template>
		<template name="evt_connect_OnSimplebookPageChanged">self.$name.Bind( wx.EVT_COMMAND_BOOKCTRL_PAGE_CHANGED, #handler )</template>
		<template name="evt_connect_OnSimplebookPageChanging">self.$name.Bind( wx.EVT_COMMAND_BOOKCTRL_PAGE_CHANGING, #handler )</template>
	</templates>

	<templates class="simplebookpage">
		<template name="page_add">self.#parent $name.AddPage( self.#child $name, $label, $select )</template>
	</templates>

	<templates class="wxAuiNotebook">
		<template name="construction">self.$name = #class( #wxparent $name, $id, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} )</template>
		<template name="include">import wx.aui</template>
		<template name="evt_connect_OnAuiNotebookPageClose">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, #handler )</template>
		<template name="evt_connect_OnAuiNotebookPageClosed">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSED, #handler )</template>
		<template name="evt_connect_OnAuiNotebookPageChanged">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, #handler )</template>
		<template name="evt_connect_OnAuiNotebookPageChanging">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGING, #handler )</template>
		<template name="evt_connect_OnAuiNotebookButton">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_BUTTON, #handler )</template>
		<template name="evt_connect_OnAuiNotebookBeginDrag">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_BEGIN_DRAG, #handler )</template>
		<template name="evt_connect_OnAuiNotebookEndDrag">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_END_DRAG, #handler )</template>
		<template name="evt_connect_OnAuiNotebookDragMotion">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_DRAG_MOTION, #handler )</template>
		<template name="evt_connect_OnAuiNotebookAllowDND">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_ALLOW_DND, #handler )</template>
		<template name="evt_connect_OnAuiNotebookDragDone">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_DRAG_DONE, #handler )</template>
		<template name="evt_connect_OnAuiNotebookTabMiddleDown">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN, #handler )</template>
		<template name="evt_connect_OnAuiNotebookTabMiddleUp">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_TAB_MIDDLE_UP, #handler )</template>
		<template name="evt_connect_OnAuiNotebookTabRightDown">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_TAB_RIGHT_DOWN, #handler )</template>
		<template name="evt_connect_OnAuiNotebookTabRightUp">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_TAB_RIGHT_UP, #handler )</template>
		<template name="evt_connect_OnAuiNotebookBGDClick">self.$name.Bind( wx.aui.EVT_AUINOTEBOOK_BG_DCLICK, #handler )</template>
	</templates>

	<templates class="auinotebookpage">
		<template name="page_add">self.#parent $name.AddPage( self.#child $name, $label, $select, $bitmap )</template>
	</templates>

	<templates class="wxScrolledWindow">
		<template name="construction">
			  self.$name = #class( #wxparent $name, $id, $pos, $size, $window_style #ifnotnull $window_name @{, $window_name @} ) #nl
			  self.$name.SetScrollRate( $scroll_rate_x, $scroll_rate_y )
		</template>
	</templates>


</codegen>
