Changeset b18cf3d in sasview for sansguiframe/src/sans
- Timestamp:
- Oct 13, 2011 11:39:37 AM (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:
- 1f83477
- Parents:
- fe98127
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/data_processor.py
rfe98127 rb18cf3d 218 218 label = self.GetCellValue(row, col) 219 219 self.insert_col_menu(col_label_menu, label, self) 220 221 222 col_after_menu = wx.Menu() 223 label = "Insert column after %s " % str(c_name) 224 slicerpop.AppendSubMenu(col_after_menu , 225 '&%s' % str(label), str(label)) 226 col_name = [self.GetCellValue(0, c) 227 for c in range(self.GetNumberCols())] 228 self.insert_after_col_menu(col_after_menu, label, self) 229 230 220 231 id = wx.NewId() 221 232 hint = 'Remove selected column %s' … … 247 258 wx.EVT_MENU(window, id, self.on_insert_column) 248 259 249 260 def insert_after_col_menu(self, menu, label, window): 261 """ 262 """ 263 id = wx.NewId() 264 title = "Empty" 265 hint = 'Insert empty column after %s' % str(label) 266 menu.Append(id, title, hint) 267 wx.EVT_MENU(window, id, self.on_insert_after_column) 268 row = 0 269 col_name = [self.GetCellValue(row, col) 270 for col in range(self.GetNumberCols())] 271 for c_name in self.data.keys(): 272 if c_name not in col_name: 273 id = wx.NewId() 274 hint = "Insert %s column after the " % str(c_name) 275 hint += " %s column" % str(label) 276 menu.Append(id, '&%s' % str(c_name), hint) 277 wx.EVT_MENU(window, id, self.on_insert_after_column) 278 250 279 def on_remove_column(self, event=None): 251 280 """ … … 289 318 col += 1 290 319 self.selected_cols[0] += 1 320 321 def on_insert_after_column(self, event): 322 """ 323 Insert the given column after the highlighted column 324 """ 325 if self.selected_cols is not None or len(self.selected_cols) > 0: 326 col = self.selected_cols[0] + 1 327 # add data to the grid 328 row = 0 329 id = event.GetId() 330 col_name = event.GetEventObject().GetLabelText(id) 331 self.insert_column(col=col, col_name=col_name) 332 if not issubclass(event.GetEventObject().__class__ , wx.Menu): 333 self.selected_cols[0] += 1 291 334 292 335 def insert_column(self, col, col_name): … … 302 345 cell_row = 1 303 346 for value in value_list: 304 self.SetCellValue(cell_row, col, str(value)) 347 label = format_number(value, high=True) 348 self.SetCellValue(cell_row, col, str(label)) 305 349 cell_row += 1 306 350 self.AutoSizeColumn(col, True) 351 width = self.GetColSize(col) 352 if width < self.default_col_width: 353 self.SetColSize(col, self.default_col_width) 354 self.ForceRefresh() 307 355 308 356 def on_set_x_axis(self, event): … … 720 768 if label.lower() in ["data", "chi2"]: 721 769 if len(grid.selected_cells) != 1: 722 msg = " Can only view one"723 msg += " selected data at once"770 msg = "2D View: Please select one data set" 771 msg += " at a time to view." 724 772 wx.PostEvent(self.parent.parent, 725 773 StatusEvent(status=msg, … … 836 884 self.y_axis_unit = wx.TextCtrl(self, -1) 837 885 self.view_button = wx.Button(self, -1, "View Results") 886 view_tip = "Highlight data sets or Chi2 column first." 887 self.view_button.SetToolTipString(view_tip) 838 888 wx.EVT_BUTTON(self, self.view_button.GetId(), self.on_view) 839 889 self.plot_button = wx.Button(self, -1, "Plot") 890 plot_tip = "Highlight column for axis and click the Add button first." 891 self.plot_button.SetToolTipString(plot_tip) 840 892 self.button_sizer.AddMany( [ (500, 30), 841 893 (self.view_button, 0, wx.RIGHT|wx.BOTTOM, 10),
Note: See TracChangeset
for help on using the changeset viewer.