Skip to content
Permalink
Browse files

Fix Python code generation for TimePickerCtrl

wxPhoenix's TimePickerCtrl is in wx.adv, so the control and all its
events and styles have to be taken from there

Fixes #450
  • Loading branch information...
patlkli committed Mar 27, 2019
1 parent a6e3f1d commit 968f575a5cfdba7552af4a9b4b78e7d0d7a3508f
Showing with 5 additions and 1 deletion.
  1. +2 −1 output/plugins/additional/xml/additional.pythoncode
  2. +3 −0 src/codegen/pythoncg.cpp
@@ -108,7 +108,8 @@ Python code generation written by

<templates class="wxTimePickerCtrl">
<template name="construction">self.$name = #class( #wxparent $name, $id, wx.DefaultDateTime, $pos, $size, $style #ifnotnull $window_style @{ |$window_style @} #ifnotnull $window_name @{, wx.DefaultValidator, $window_name @} )</template>
<template name="evt_connect_OnTimeChanged">self.$name.Bind( wx.EVT_TIME_CHANGED, #handler )</template>
<template name="include">import wx.adv</template>
<template name="evt_connect_OnTimeChanged">self.$name.Bind( wx.adv.EVT_TIME_CHANGED, #handler )</template>
</templates>


@@ -1746,6 +1746,7 @@ void PythonTemplateParser::SetupModulePrefixes()
ADD_PREDEFINED_PREFIX( wxGrid, wx.grid. );
ADD_PREDEFINED_PREFIX( wxAnimationCtrl, wx.adv. );
ADD_PREDEFINED_PREFIX( wxDatePickerCtrl, wx.adv. );
ADD_PREDEFINED_PREFIX( wxTimePickerCtrl, wx.adv. );
ADD_PREDEFINED_PREFIX( wxHyperlinkCtrl, wx.adv. );

// altered macros
@@ -1875,5 +1876,7 @@ void PythonTemplateParser::SetupModulePrefixes()
ADD_PREDEFINED_PREFIX( wxDP_SHOWCENTURY, wx.adv. );
ADD_PREDEFINED_PREFIX( wxDP_ALLOWNONE, wx.adv. );
ADD_PREDEFINED_PREFIX( wxDP_DEFAULT, wx.adv. );

ADD_PREDEFINED_PREFIX( wxTP_DEFAULT, wx.adv. );
}

0 comments on commit 968f575

Please sign in to comment.
You can’t perform that action at this time.