Changeset 2893


Ignore:
Timestamp:
Jul 2, 2017 9:33:22 AM (4 years ago)
Author:
vondreele
Message:

fixes to window resize issues

Location:
branch/2frame
Files:
7 edited

Legend:

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

    r2890 r2893  
    25612561        self.Status = self.CreateStatusBar()
    25622562#TODO - split window tree on left, data on right
    2563         self.mainPanel = GSASIIsplit(self,-1)
     2563        self.mainPanel = GSASIIsplit(self,-1)       
    25642564        self.treePanel = wx.Panel(self.mainPanel, wx.ID_ANY,
    25652565            style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
    2566         self.treePanel.SetAutoLayout(True)
    25672566        self.dataPanel = wx.Panel(self.mainPanel, wx.ID_ANY,
    25682567            style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
    2569         self.dataWindow = G2gd.DataWindow(self.dataPanel)
    2570         self.dataWindow.SetAutoLayout(True)
    2571         self.dataWindow.SetInitialSize()
    25722568        self.mainPanel.SetMinimumPaneSize(100)
    25732569        self.mainPanel.SplitVertically(self.treePanel, self.dataPanel, 200)
    2574         self.dataFrame = self.dataWindow        #kluge!!
    25752570       
    25762571        wxID_PATTERNTREE = wx.NewId()
    25772572        treeSizer = wx.BoxSizer()
     2573        self.treePanel.SetSizer(treeSizer)
    25782574        self.PatternTree = G2G.G2TreeCtrl(id=wxID_PATTERNTREE,
    2579             parent=self.treePanel, size=self.treePanel.GetSize(),style=wx.TR_DEFAULT_STYLE )
    2580         treeSizer.Add(self.PatternTree,1,wx.EXPAND)
    2581         self.treePanel.SetSizer(treeSizer)
     2575            parent=self.treePanel, size=self.treePanel.GetClientSize(),style=wx.TR_DEFAULT_STYLE )
     2576        treeSizer.Add(self.PatternTree,1,wx.EXPAND|wx.ALL,0)
    25822577        self.PatternTree.Bind(wx.EVT_TREE_SEL_CHANGED,self.OnDataTreeSelChanged)
    25832578        self.PatternTree.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK,self.OnDataTreeSelChanged)
     
    25962591        self.root = self.PatternTree.root       
    25972592       
     2593        self.dataWindow = G2gd.DataWindow(self.dataPanel)
     2594        self.dataWindow.SetSize(self.dataPanel.GetClientSize())
     2595        self.dataWindow.SetAutoLayout(True)
     2596        self.dataWindow.SetInitialSize()
     2597        self.dataFrame = self.dataWindow        #kluge!!
     2598#        self.SetDataSize()
     2599       
     2600       
    25982601        plotFrame = wx.Frame(None,-1,'GSASII Plots',size=wx.Size(700,600), \
    25992602            style=wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX)
    26002603        self.G2plotNB = G2plt.G2PlotNoteBook(plotFrame,G2frame=self)
    26012604        plotFrame.Show()
    2602         self.SetDataSize()
    26032605       
    26042606    def __init__(self, parent):
     
    27122714        w,h = self.GetClientSizeTuple()
    27132715        self.dataWindow.SetupScrolling()
    2714         self.mainPanel.SetSize(wx.Size(w,h+1))
    27152716        self.mainPanel.SetSize(wx.Size(w,h))
    27162717        self.PatternTree.SetSize(wx.Size(w,h))
    2717         self.dataWindow.SetSize(wx.Size(w,h))
    2718 #        self.dataWindow.Refresh()
    2719 #        self.dataWindow.Update()
     2718        self.dataWindow.SetSize(self.dataPanel.GetClientSize())
    27202719       
    27212720    def SetDataSize(self):
    27222721        Size = self.GetSize()
     2722        self.SetSize(Size)
    27232723        Size[1] += 1        #kluge to ensure scrollbar settings & window properly displayed
    2724         self.SetSize(Size)
    2725         Size[1] -= 1        #kluge to ensure scrollbar settings & window properly displayed
    27262724        self.SetSize(Size)
    27272725                               
  • branch/2frame/GSASIIconstrGUI.py

    r2890 r2893  
    10821082        else: # called directly, get current page
    10831083            page = G2frame.constr.GetSelection()
     1084        G2frame.constr.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
    10841085        G2frame.constr.ChangeSelection(page)
    10851086        text = G2frame.constr.GetPageText(page)
     
    13161317        else:
    13171318            page = G2frame.rbBook.GetSelection()
     1319        G2frame.rbBook.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
    13181320        G2frame.rbBook.ChangeSelection(page)
    13191321        text = G2frame.rbBook.GetPageText(page)
     
    20862088    SetStatusLine('')
    20872089    G2frame.dataWindow.ClearData()
    2088     G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataFrame,size=G2frame.dataFrame.GetClientSize())
     2090    G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataFrame,size=G2frame.dataWindow.GetClientSize())
    20892091
    20902092    VectorRB = wx.ScrolledWindow(G2frame.rbBook)
  • branch/2frame/GSASIIgrid.py

    r2890 r2893  
    26892689    text.AppendText('Notebook entry @ '+time.ctime()+"\n")
    26902690    mainSizer.Add(text,1,wx.EXPAND)
     2691    G2frame.dataWindow.SetAutoLayout(True)
     2692    G2frame.dataWindow.Layout()
    26912693    G2frame.dataWindow.SetSizer(mainSizer)
    2692     G2frame.SetDataSize()
     2694   
     2695#    G2frame.SetDataSize()
    26932696           
    26942697################################################################################
     
    27102713    mainSizer = wx.BoxSizer()
    27112714    mainSizer.Add(text,1,wx.EXPAND)
     2715    G2frame.dataWindow.SetAutoLayout(True)
     2716    G2frame.dataWindow.Layout()
    27122717    G2frame.dataWindow.SetSizer(mainSizer)
    2713     G2frame.SetDataSize()
     2718#    G2frame.SetDataSize()
    27142719           
    27152720################################################################################
  • branch/2frame/GSASIIimgGUI.py

    r2888 r2893  
    105105        G2plt.PlotExposedImage(G2frame,newPlot=True,event=tc.event)
    106106       
    107 #    G2frame.dataWindow = wx.Panel(G2frame.dataFrame)
     107    G2frame.dataWindow.ClearData()
    108108    G2frame.ImageZ = GetImageZ(G2frame,data)
    109109    mainSizer = wx.BoxSizer(wx.VERTICAL)
  • branch/2frame/GSASIIphsGUI.py

    r2892 r2893  
    80278027            page.ClearGrid()
    80288028        page = event.GetSelection()
     8029        G2frame.phaseDisplay.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
    80298030        ChangePage(page)
    80308031       
  • branch/2frame/GSASIIpwdGUI.py

    r2890 r2893  
    35633563        routine is needed because the reflection table may not have been created yet.
    35643564        '''
     3565        G2frame.refBook.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
    35653566        page = event.GetSelection()
    35663567        phaseName = G2frame.refBook.GetPageText(page)
  • branch/2frame/GSASIIrestrGUI.py

    r2890 r2893  
    17791779        #print 'OnPageChanged'
    17801780        page = event.GetSelection()
     1781        G2frame.restrBook.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
    17811782        text = G2frame.restrBook.GetPageText(page)
    17821783        G2frame.dataFrame.RestraintEdit.SetLabel(G2gd.wxID_RESRCHANGEVAL,'Change value')
     
    18521853    G2frame.SetLabel(G2frame.GetLabel().split('||')[0]+' || '+'restraints for '+phaseName)
    18531854    G2frame.dataWindow.ClearData()
     1855    G2frame.restrBook = G2G.GSNoteBook(parent=G2frame.dataWindow,size=G2frame.dataWindow.GetClientSize())
    18541856   
    18551857    G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTSELPHASE,False)
     
    18621864        G2frame.dataWindow.Bind(wx.EVT_MENU, OnAddAARestraint, id=G2gd.wxID_AARESTRAINTADD)
    18631865        G2frame.dataWindow.Bind(wx.EVT_MENU, OnPlotAARestraint, id=G2gd.wxID_AARESTRAINTPLOT)
    1864     G2frame.restrBook = G2G.GSNoteBook(parent=G2frame.dataWindow,size=G2frame.dataWindow.GetClientSize())
    18651866   
    18661867    # clear menu and menu pointers
Note: See TracChangeset for help on using the changeset viewer.