dialogs/ForceVariableDialog.py
branchpython3
changeset 3752 9f6f46dbe3ae
parent 3750 f62625418bff
equal deleted inserted replaced
3751:a80a66ba52d6 3752:9f6f46dbe3ae
    20 # You should have received a copy of the GNU General Public License
    20 # You should have received a copy of the GNU General Public License
    21 # along with this program; if not, write to the Free Software
    21 # along with this program; if not, write to the Free Software
    22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    23 
    23 
    24 
    24 
    25 
       
    26 import re
    25 import re
    27 import datetime
    26 import datetime
    28 from builtins import str as text
       
    29 
    27 
    30 import wx
    28 import wx
    31 
    29 
    32 # -------------------------------------------------------------------------------
    30 # -------------------------------------------------------------------------------
    33 #                                Helpers
    31 #                                Helpers
   222     def GetValueDefault(self):
   220     def GetValueDefault(self):
   223         """
   221         """
   224         Returns text representation for a variable value
   222         Returns text representation for a variable value
   225         @return: variable value as a string
   223         @return: variable value as a string
   226         """
   224         """
   227         return text(self.ValueCtrl.GetValue())
   225         return str(self.ValueCtrl.GetValue())
   228 
   226 
   229     # -----------------------------------------------
   227     # -----------------------------------------------
   230     # integer and floating point number type methods
   228     # integer and floating point number type methods
   231     # ----------------------------------------------
   229     # ----------------------------------------------
   232 
   230 
   245         """Increment/decrement variable value"""
   243         """Increment/decrement variable value"""
   246         value = self.GetValue()
   244         value = self.GetValue()
   247         if value is not None:
   245         if value is not None:
   248             up = evt.GetEventType() == wx.EVT_SPIN_UP._getEvtType()
   246             up = evt.GetEventType() == wx.EVT_SPIN_UP._getEvtType()
   249             value = value + 1 if up else value - 1
   247             value = value + 1 if up else value - 1
   250             self.ValueCtrl.SetValue(text(value))
   248             self.ValueCtrl.SetValue(str(value))
   251         evt.Skip()
   249         evt.Skip()
   252 
   250 
   253     # -----------------------------------------------
   251     # -----------------------------------------------
   254     # bool type related methods
   252     # bool type related methods
   255     # ----------------------------------------------
   253     # ----------------------------------------------