Changeset 26b0a7c in sasview for plottools/src/danse/common
- Timestamp:
- Jan 11, 2012 7:12:24 PM (13 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:
- 2a09236
- Parents:
- d6202e30
- Location:
- plottools/src/danse/common/plottools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plottools/src/danse/common/plottools/PlotPanel.py
r7053d08 r26b0a7c 258 258 self.xaxis_unit = None 259 259 self.xaxis_color = 'black' 260 self.xaxis_tick = False 260 261 self.yaxis_font = None 261 262 self.yaxis_label = None 262 263 self.yaxis_unit = None 263 264 self.yaxis_color = 'black' 265 self.yaxis_tick = False 264 266 265 267 # check if zoomed. … … 1059 1061 """ 1060 1062 xaxis_label, xaxis_unit, xaxis_font, xaxis_color,\ 1061 is_ok = self._on_axis_label(axis='x')1063 is_ok, xaxis_tick = self._on_axis_label(axis='x') 1062 1064 if not is_ok: 1063 1065 return … … 1067 1069 self.xaxis_font = xaxis_font 1068 1070 self.xaxis_color = xaxis_color 1071 self.xaxis_tick = xaxis_tick 1069 1072 1070 1073 if self.data != None: 1071 1074 # 2D 1072 1075 self.xaxis(self.xaxis_label, self.xaxis_unit,\ 1073 self.xaxis_font, self.xaxis_color )1076 self.xaxis_font, self.xaxis_color, self.xaxis_tick) 1074 1077 self.subplot.figure.canvas.draw_idle() 1075 1078 else: … … 1097 1100 """ 1098 1101 yaxis_label, yaxis_unit, yaxis_font, yaxis_color,\ 1099 is_ok = self._on_axis_label(axis='y')1102 is_ok, yaxis_tick = self._on_axis_label(axis='y') 1100 1103 if not is_ok: 1101 1104 return … … 1105 1108 self.yaxis_font = yaxis_font 1106 1109 self.yaxis_color = yaxis_color 1110 self.yaxis_tick = yaxis_tick 1107 1111 1108 1112 if self.data != None: 1109 1113 # 2D 1110 1114 self.yaxis(self.yaxis_label, self.yaxis_unit,\ 1111 self.yaxis_font, self.yaxis_color )1115 self.yaxis_font, self.yaxis_color, self.yaxis_tick) 1112 1116 self.subplot.figure.canvas.draw_idle() 1113 1117 else: … … 1143 1147 unit = textdial.getUnit() 1144 1148 colour = textdial.getColor() 1149 is_tick = textdial.getTickLabel() 1145 1150 label_temp = textdial.getText() 1146 1151 if label_temp.count("\%s"% "\\") > 0: … … 1161 1166 else: 1162 1167 is_ok = False 1168 is_tick = True 1163 1169 textdial.Destroy() 1164 return label, unit, font, colour, is_ok 1170 return label, unit, font, colour, is_ok, is_tick 1165 1171 1166 1172 def _on_removetext(self, event): … … 1249 1255 handletextsep=.05, loc=self.legendLoc) 1250 1256 1251 def xaxis(self, label, units, font=None, color='black' ):1257 def xaxis(self, label, units, font=None, color='black', t_font=False): 1252 1258 """xaxis label and units. 1253 1259 … … 1265 1271 if font: 1266 1272 self.subplot.set_xlabel(label, fontproperties=font, color=color) 1267 for tick in self.subplot.xaxis.get_major_ticks(): 1268 tick.label.set_fontproperties(font) 1273 if t_font: 1274 for tick in self.subplot.xaxis.get_major_ticks(): 1275 tick.label.set_fontproperties(font) 1269 1276 else: 1270 1277 self.subplot.set_xlabel(label, color=color) 1271 1278 pass 1272 1279 1273 def yaxis(self, label, units, font=None, color='black' ):1280 def yaxis(self, label, units, font=None, color='black', t_font=False): 1274 1281 """yaxis label and units.""" 1275 1282 if units != "": … … 1279 1286 if font: 1280 1287 self.subplot.set_ylabel(label, fontproperties=font, color=color) 1281 for tick_label in self.subplot.get_yticklabels(): 1282 tick_label.set_fontproperties(font) 1288 if t_font: 1289 for tick_label in self.subplot.get_yticklabels(): 1290 tick_label.set_fontproperties(font) 1283 1291 else: 1284 1292 self.subplot.set_ylabel(label, color=color) … … 1817 1825 self.set_yscale(_yscale) 1818 1826 1819 self.xaxis(xname, xunits, self.xaxis_font, self.xaxis_color) 1820 self.yaxis(yname, yunits, self.yaxis_font, self.yaxis_color) 1827 self.xaxis(xname, xunits, self.xaxis_font, 1828 self.xaxis_color, self.xaxis_tick) 1829 self.yaxis(yname, yunits, self.yaxis_font, 1830 self.yaxis_color, self.yaxis_tick) 1821 1831 self.subplot.texts = self.textList 1822 1832 self.subplot.figure.canvas.draw_idle() -
plottools/src/danse/common/plottools/TextDialog.py
r82a54b8 r26b0a7c 29 29 self.weight = WEIGHT[1] 30 30 self.color = COLOR[0] 31 self.tick_label = True 31 32 #Dialog interface 32 33 vbox = wx.BoxSizer(wx.VERTICAL) … … 49 50 self.unit_ctrl.SetValue(str(unit)) 50 51 unit_box = wx.BoxSizer(wx.HORIZONTAL) 52 tick_label_text = wx.StaticText(self, -1, 'Tick label') 53 tick_label_text.SetToolTipString("Apply to tick label too.") 54 self.tick_label_check = wx.CheckBox(self, -1, 55 '', (10, 10)) 56 self.tick_label_check.SetValue(True) 57 self.tick_label_check.SetToolTipString("Apply to tick label too.") 58 wx.EVT_CHECKBOX(self, self.tick_label_check.GetId(), 59 self.on_tick_label) 51 60 enter_text = 'Enter text:' 52 61 else: … … 57 66 self.unit_ctrl = None 58 67 unit_box = None 68 tick_label_text = None 69 self.tick_label_check = None 59 70 enter_text = 'Enter text' 60 71 if len(label) > 0: … … 119 130 family_box.Add(wx.StaticText(self, -1, 'Size :'), -1, 0) 120 131 family_box.Add(self.fontSize, -1, 0) 132 if unit_box != None: 133 family_box.Add((_BOX_WIDTH/2,-1)) 134 family_box.Add(tick_label_text, -1, 0) 135 family_box.Add(self.tick_label_check, -1, 0) 121 136 style_box.Add(wx.StaticText(self, -1, 'Style :'), -1, 0) 122 137 style_box.Add(self.fontStyle, -1, 0) … … 202 217 for idx in range(len(list)): 203 218 self.fontColor.Append(list[idx],idx) 219 220 def on_tick_label(self, event): 221 """ 222 Set the font for tick label 223 """ 224 event.Skip() 225 self.tick_label = self.tick_label_check.GetValue() 204 226 205 227 def on_family(self, event): … … 292 314 return str(self.color) 293 315 316 def getTickLabel(self): 317 """ 318 Bool for use on tick label 319 """ 320 return self.tick_label
Note: See TracChangeset
for help on using the changeset viewer.