Changeset 2640


Ignore:
Timestamp:
Jan 17, 2017 5:11:27 PM (5 years ago)
Author:
vondreele
Message:

change Width to Size in setSizePosLeft
kluge to get correct scrolling in Phase windows in SetPhaseWinows?

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2635 r2640  
    25422542        self.userReSize = True
    25432543       
    2544     def setSizePosLeft(self,Width):
     2544    def setSizePosLeft(self,Size):
    25452545        '''Place the dataFrame window so that the upper left-hand corner remains in the same place;
    25462546        The size is dictated by parameter Width, unless overridden by a previous Phase window resize
    25472547        '''
    25482548        self.userReSize = False
    2549         Width = list(Width)
     2549        Size = list(Size)
    25502550        id = self.G2frame.PatternTree.GetSelection()
    25512551        try:            #avoid bad tree item on start via gpx file selection
     
    25572557            # is this a phase window and has a previous window has been resized?
    25582558            if self.manualPhaseSize and parent == "Phases":
    2559                 Width = list(self.manualPhaseSize)
     2559                Size = list(self.manualPhaseSize)
    25602560        Pos = self.GetPosition()
    25612561        clientSize = wx.ClientDisplayRect()     #display window size (e.g. 1304x768)
    2562         Width[1] = min(Width[1],clientSize[2]-300)
    2563         Width[0] = max(Width[0],300)
     2562        Size[1] = min(Size[1],clientSize[2]-300)
     2563        Size[0] = max(Size[0],300)
    25642564#        print 'current position/width:',Pos,Width
    2565         self.SetSize(Width)
     2565        self.SetSize(Size)
    25662566        if self.lastSize[0]:
    2567             Pos[0] += self.lastSize[0]-Width[0]
     2567            Pos[0] += self.lastSize[0]-Size[0]
    25682568        offSet = 0
    25692569        if Pos[0] < clientSize[2]:
    2570             offSet = Pos[0]+Width[0]-clientSize[2]
     2570            offSet = Pos[0]+Size[0]-clientSize[2]
    25712571        if offSet > 0:
    25722572            Pos[0] -= offSet
    25732573        self.SetPosition(wx.Point(Pos[0],Pos[1]))
    2574         self.lastSize = Width
     2574        self.lastSize = Size
    25752575        self.userReSize = True
    25762576       
  • trunk/GSASIIphsGUI.py

    r2638 r2640  
    7575    phasePage.Scroll(0,Scroll)
    7676    Size[1] = min(500,Size[1])
     77    mainFrame.setSizePosLeft(Size)
     78    Size[1] += 1                    #kluge to get correct scrolling!
    7779    mainFrame.setSizePosLeft(Size)
    7880   
     
    30563058                attr.SetEditor(G2G.GridFractionEditor(atomGrid))
    30573059                atomGrid.SetColAttr(c, attr)
     3060            for row,atom in enumerate(Layer['Atoms']):
     3061                atomGrid.SetReadOnly(row,1,True)
    30583062            atomGrid.Bind(wg.EVT_GRID_CELL_LEFT_DCLICK, AtomTypeSelect)
    30593063            atomGrid.AutoSizeColumns(True)
Note: See TracChangeset for help on using the changeset viewer.