dialogs/DurationEditorDialog.py
changeset 1696 8043f32de7b8
parent 1571 486f94a8032c
child 1702 bbb2c38969ca
equal deleted inserted replaced
1695:a63bb4025852 1696:8043f32de7b8
     3 
     3 
     4 # This file is part of Beremiz, a Integrated Development Environment for
     4 # This file is part of Beremiz, a Integrated Development Environment for
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
     6 #
     6 #
     7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
     7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
       
     8 # Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
     8 #
     9 #
     9 # See COPYING file for copyrights details.
    10 # See COPYING file for copyrights details.
    10 #
    11 #
    11 # This program is free software; you can redistribute it and/or
    12 # This program is free software; you can redistribute it and/or
    12 # modify it under the terms of the GNU General Public License
    13 # modify it under the terms of the GNU General Public License
    53 #-------------------------------------------------------------------------------
    54 #-------------------------------------------------------------------------------
    54 
    55 
    55 class DurationEditorDialog(wx.Dialog):
    56 class DurationEditorDialog(wx.Dialog):
    56 
    57 
    57     def __init__(self, parent):
    58     def __init__(self, parent):
    58         wx.Dialog.__init__(self, parent, 
    59         wx.Dialog.__init__(self, parent, title=_('Edit Duration'))
    59               size=wx.Size(700, 200), title=_('Edit Duration'))
       
    60         
    60         
    61         main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
    61         main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
    62         main_sizer.AddGrowableCol(0)
    62         main_sizer.AddGrowableCol(0)
    63         main_sizer.AddGrowableRow(0)
    63         main_sizer.AddGrowableRow(0)
    64         
    64         
    89         self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
    89         self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
    90         main_sizer.AddSizer(button_sizer, border=20, 
    90         main_sizer.AddSizer(button_sizer, border=20, 
    91               flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
    91               flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
    92         
    92         
    93         self.SetSizer(main_sizer)
    93         self.SetSizer(main_sizer)
    94         
    94         self.Fit()
    95         self.Days.SetFocus()
    95         self.Days.SetFocus()
    96         
    96         
    97     def SetDuration(self, value):
    97     def SetDuration(self, value):
    98         result = IEC_TIME_MODEL.match(value.upper())
    98         result = IEC_TIME_MODEL.match(value.upper())
    99         if result is not None:
    99         if result is not None: