Changeset fa7bafd in sasview


Ignore:
Timestamp:
Apr 9, 2017 4:35:42 AM (8 months ago)
Author:
wojciech
Branches:
ticket-933
Children:
a968e0d
Parents:
959eb01
Message:

Towards drag and drop in data manager window

Location:
src/sas/sasgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/data_panel.py

    r959eb01 rfa7bafd  
    251251        self.enable_selection() 
    252252 
     253    def on_drag(self, evt): 
     254        # No evt.Allow() here, I won't use TreeCtrl's internal DND support 
     255        item = evt.GetItem() 
     256        if item == self.tree_ctrl.GetRootItem(): 
     257            return 
     258        dropsrc = wx.DropSource(self) 
     259        # Populate dropsource 
     260        dropsrc.DoDragDrop(wx.Drag_AllowMove) 
     261 
    253262    def _on_selection_type(self, event): 
    254263        """ 
     
    12171226            self.bt_append_plot.Enable() 
    12181227            self.cb_plotpanel.Enable() 
     1228 
     1229    def enable_drag_and_drop(self): 
     1230        """ 
     1231 
     1232        :return: 
     1233        """ 
     1234        self.tree_ctrl.SetDropTarget(MyDropTarget()) 
     1235        self.tree_ctrl.Bind(wx.EVT_TREE_BEGIN_DRAG, self.on_drag) 
     1236        self.tree_ctrl.GetMainWindow().Bind(wx.EVT_MOUSE_CAPTURE_LOST, lambda x: None) 
    12191237 
    12201238    def check_theory_to_freeze(self): 
  • src/sas/sasgui/guiframe/data_processor.py

    r9a5097c rfa7bafd  
    1919""" 
    2020import wx 
    21 import numpy 
     21import numpy as np 
    2222import math 
    2323import re 
  • src/sas/sasgui/perspectives/fitting/batchfitpage.py

    ree4b3cb rfa7bafd  
    44import wx 
    55import wx.lib.newevent 
    6 import math 
    7 from sas.sasgui.guiframe.events import StatusEvent 
    8 from sas.sasgui.guiframe.events import NewPlotEvent 
    96 
    107(Chi2UpdateEvent, EVT_CHI2_UPDATE) = wx.lib.newevent.NewEvent() 
     
    1411SMEAR_SIZE_H = 0.00 
    1512 
    16 from sas.sasgui.perspectives.fitting.basepage import PageInfoEvent 
    17 from sas.sascalc.data_util.qsmearing import smear_selection 
    1813from sas.sasgui.perspectives.fitting.fitpage import FitPage 
    1914from sas.sasgui.perspectives.fitting.fitpage import check_data_validity 
     
    5449        sizer_data.Add(text2) 
    5550 
     51        #We may need to change it to checkbox instead of combobox 
    5652        combo = wx.BoxSizer(wx.HORIZONTAL) 
    5753        self.dataSource = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    red2276f rfa7bafd  
    18871887                self.graph_id = self.data.group_id 
    18881888                flag = (data.id != self.data.id) 
     1889        print("Data ID", self.data.id, data.id) 
    18891890        self.data = data 
    18901891        if check_data_validity(data): 
Note: See TracChangeset for help on using the changeset viewer.