trackssplitter.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:GRIPy 作者: giruenf 项目源码 文件源码
def _SizeWindows(self):
        #print '\n_SizeWindows', self.GetSize(), self.GetParent().GetSize(), self.GetClientSize()
        if not self._windows:
            return       
        if len(self.get_windows_shown()) == 0:
            return

        largUtil = self._LarguraUtil()

        if self._GetFit():
            usado = 0
            for idx, spos in enumerate(self._sashes):
               # #print '_sash fit:', idx, spos
                if idx < len(self._sashes)-1:
                    self._sashes[idx] = round(self._proporcao[idx] * largUtil)
                    usado += round(self._proporcao[idx] * largUtil)
                else:
                    self._sashes[idx] = largUtil - usado                    

        border = self._border_size
        sash   = self._sash_size

        if 'wxMSW' in wx.PlatformInfo:
            self.Freeze()

        x = y = border
        h = self.GetClientSize().GetHeight() - (2 * border)

        for idx, spos in enumerate(self._sashes):
            ##print '    _sash:', idx, spos
            window = self.GetWindow(idx)
            if window.IsShown():
                #print 'window.SetSize({}, {}, {}, {})'.format(x, y, spos, h)
                window.SetSize(x, y, spos, h)
                ##print '    {} - SetDimensions({}, {}, {}, {})'.format(window._view._controller_uid, x, y, spos, h)

                #for panel in window.selectedCanvas:
                #    panel.Refresh()                
                #self._draw_window_selection(window)                

                x += spos + sash    

        if 'wxMSW' in wx.PlatformInfo:
            self.Thaw()

        self._DrawSashes()
        self._DrawBorders()  

       # self._needUpdating = False

        ##print
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号