Changeset a208464 in sasview
- Timestamp:
- Dec 18, 2009 10:30:40 AM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- db27a2c
- Parents:
- 0957dbdb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/utils.py
r7ab35154 ra208464 23 23 def check_float(item): 24 24 """ 25 @param item 2: txtcrtl containing the maximumvalue25 @param item: txtcrtl containing a value 26 26 """ 27 27 flag= True … … 35 35 item.Refresh() 36 36 return flag 37 def check_value( item1, item2): 37 38 39 def check_value(item1, item2): 38 40 """ 39 Check 2 txtcrtl value 40 @param item1: txtcrtl containing the minimum value 41 @param item2: txtcrtl containing the maximum value 41 Check 2 txtcrtl item values if they are in order 42 @param item1: txtcrtl containing value1 43 @param item2: txtcrtl containing value2 44 @return flag=True when value1<value2 45 Note: item1 backgroundcolour="white" when value1<value2 otherwise "pink" 42 46 """ 43 flag= False 44 try: 45 mini = float(format_number(item1.GetValue())) 46 item1.SetBackgroundColour(wx.WHITE) 47 item1.Refresh() 48 except: 47 flag= True 48 flag_item1 = check_float(item1) 49 flag_item2 = check_float(item2) 50 if flag_item1 == False or flag_item2 == False: 49 51 flag = False 50 item1.SetBackgroundColour("pink")51 item1.Refresh()52 return flag53 try:54 maxi = float(format_number(item2.GetValue()))55 item2.SetBackgroundColour(wx.WHITE)56 item2.Refresh()57 except:58 flag = False59 item2.SetBackgroundColour("pink")60 item2.Refresh()61 return flag62 63 if mini < maxi:64 item1.SetBackgroundColour(wx.WHITE)65 item1.Refresh()66 item2.SetBackgroundColour(wx.WHITE)67 item2.Refresh()68 flag = True69 52 else: 70 flag = False 71 item1.SetBackgroundColour("pink") 72 item1.Refresh() 73 53 value_item1 = float(item1.GetValue()) 54 value_item2 = float(item2.GetValue()) 55 if value_item1 < value_item2: 56 #Make sure to set both colours white. 57 item1.SetBackgroundColour(wx.WHITE) 58 item1.Refresh() 59 item2.SetBackgroundColour(wx.WHITE) 60 item2.Refresh() 61 else: 62 flag = False 63 item1.SetBackgroundColour("pink") 64 item1.Refresh() 74 65 return flag 75 76 77 66 78 67
Note: See TracChangeset
for help on using the changeset viewer.