Changeset 2949


Ignore:
Timestamp:
Jul 30, 2017 2:16:54 PM (4 years ago)
Author:
vondreele
Message:

fix window behavior - use wx.ScrolledWindow? instead of ScrolledPanel?
remove the special sizing stuff for phase windows - not needed

Location:
branch/2frame
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIdataGUI.py

    r2944 r2949  
    28852885        self.root = self.GPXtree.root       
    28862886
    2887         self.dataWindow.SetupScrolling()
     2887#        self.dataWindow.SetupScrolling()
    28882888               
    28892889        self.plotFrame = wx.Frame(None,-1,'GSASII Plots',size=wx.Size(700,600), \
     
    46754675# Data window side of main GUI
    46764676################################################################################
    4677 class G2DataWindow(wxscroll.ScrolledPanel):
     4677class G2DataWindow(wx.ScrolledWindow):      #wxscroll.ScrolledPanel):
    46784678    '''Create the data item window entries in menus used in
    46794679    that window. The menu entries are created for all
     
    47374737    '''
    47384738    # TODO: debug code ######################################################################
    4739     def Bind(self,eventtype,handler,*args,**kwargs):  # PATCH: debug code: catch when a menu is bind'ed to
    4740         # the dataWindow as this should not be done in the 2 frame version.
    4741         if eventtype == wx.wx.EVT_MENU:
    4742             print 'wx.EVT_MENU Bind to dataWindow'
    4743             G2obj.HowDidIgetHere(True)
    4744             wx.Frame.Bind(self.GetTopLevelParent(),eventtype,handler,*args,**kwargs)
    4745         else:
    4746             wxscroll.ScrolledPanel.Bind(self,eventtype,handler,*args,**kwargs)
    4747     def DestroyChildren(self):
    4748         print 'Fix this: dataWindow.DestroyChildren called'
    4749         G2obj.HowDidIgetHere()
    4750     def SetTitle(self,*args):
    4751         print('Warning: attempt to label dataWindow')
    4752         G2obj.HowDidIgetHere(True)
    4753         self.G2frame.SetTitle(*args)
    4754     def SetLabel(self,*args):
    4755         print('Warning: attempt to label dataWindow')
    4756         G2obj.HowDidIgetHere(True)
    4757         self.G2frame.SetTitle(*args)
     4739#    def Bind(self,eventtype,handler,*args,**kwargs):  # PATCH: debug code: catch when a menu is bind'ed to
     4740#        # the dataWindow as this should not be done in the 2 frame version.
     4741#        if eventtype == wx.wx.EVT_MENU:
     4742#            print 'wx.EVT_MENU Bind to dataWindow'
     4743#            G2obj.HowDidIgetHere(True)
     4744#            wx.Frame.Bind(self.GetTopLevelParent(),eventtype,handler,*args,**kwargs)
     4745#        else:
     4746#            wxscroll.ScrolledPanel.Bind(self,eventtype,handler,*args,**kwargs)
     4747#    def DestroyChildren(self):
     4748#        print 'Fix this: dataWindow.DestroyChildren called'
     4749#        G2obj.HowDidIgetHere()
     4750#    def SetTitle(self,*args):
     4751#        print('Warning: attempt to label dataWindow')
     4752#        G2obj.HowDidIgetHere(True)
     4753#        self.G2frame.SetTitle(*args)
     4754#    def SetLabel(self,*args):
     4755#        print('Warning: attempt to label dataWindow')
     4756#        G2obj.HowDidIgetHere(True)
     4757#        self.G2frame.SetTitle(*args)
    47584758    # end TODO: remove this later ############################################################
    47594759
    47604760    def __init__(self,parent):
    4761         wxscroll.ScrolledPanel.__init__(self,parent,wx.ID_ANY,size=parent.GetSize())
     4761#        wxscroll.ScrolledPanel.__init__(self,parent,wx.ID_ANY,size=parent.GetSize())
     4762        wx.ScrolledWindow.__init__(self,parent,wx.ID_ANY,size=parent.GetSize())
    47624763        self.parent = parent
    47634764        self._initMenus()
     
    47854786            print 'No sizer in dataWindow'
    47864787            raise Exception
    4787 #        self.Layout()
    47884788        self.SetAutoLayout(True)
    4789         self.SetupScrolling()
     4789        self.SetScrollRate(1,1)
     4790#        self.SetupScrolling()      #TODO - setscrollbars here
    47904791        self.SendSizeEvent()
    47914792
  • branch/2frame/GSASIIimgGUI.py

    r2927 r2949  
    16091609    littleSizer.Add(upperThreshold,0,WACV)
    16101610    mainSizer.Add(littleSizer,0,)
    1611     if len(Spots):
     1611    if len(Spots):      #TODO: replace with a GSTable
    16121612        lbl = wx.StaticText(parent=G2frame.dataWindow,label=' Spot masks')
    16131613        lbl.SetBackgroundColour(wx.Colour(200,200,210))
     
    20442044        return samSizer
    20452045       
    2046     def DzeroSizer():
     2046    def DzeroSizer():       #TODO replace with a GSTable
    20472047   
    20482048        def OnDzero(invalid,value,tc):
  • branch/2frame/GSASIIphsGUI.py

    r2945 r2949  
    986986def SetPhaseWindow(phasePage,mainSizer=None,size=None,Scroll=0):
    987987    phasePage.SetAutoLayout(True)
    988     if not mainSizer is None:
    989         phasePage.SetSizer(mainSizer)
    990         Size = mainSizer.GetMinSize()
    991     else:
    992         Size = phasePage.GetBestSize()
    993     Size[0] += 40
    994     phasePage.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    995     phasePage.Scroll(0,Scroll)
    996     phasePage.GetTopLevelParent().dataWindow.SetDataSize()
     988    phasePage.SetScrollRate(1,1)
     989    phasePage.SendSizeEvent()
     990
     991#    if not mainSizer is None:
     992#        phasePage.SetSizer(mainSizer)
     993#        Size = mainSizer.GetMinSize()
     994#    else:
     995#        Size = phasePage.GetBestSize()
     996#    Size[0] += 40
     997#    phasePage.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
     998#    phasePage.Scroll(0,Scroll)
     999#    phasePage.GetTopLevelParent().dataWindow.SetDataSize()
    9971000   
    9981001def FindBondsDraw(data):   
Note: See TracChangeset for help on using the changeset viewer.