editors/ConfTreeNodeEditor.py
changeset 840 980863738cf6
parent 814 5743cbdff669
child 844 ec9e6ef49878
equal deleted inserted replaced
839:25ba9d74afb1 840:980863738cf6
   275         if self.ParamsEditor is not None:
   275         if self.ParamsEditor is not None:
   276             if self.SHOW_BASE_PARAMS:
   276             if self.SHOW_BASE_PARAMS:
   277                 self.ConfNodeName.ChangeValue(self.Controler.MandatoryParams[1].getName())
   277                 self.ConfNodeName.ChangeValue(self.Controler.MandatoryParams[1].getName())
   278                 self.RefreshIECChannelControlsState()
   278                 self.RefreshIECChannelControlsState()
   279             self.RefreshConfNodeParamsSizer()
   279             self.RefreshConfNodeParamsSizer()
       
   280             self.RefreshScrollbars()
   280     
   281     
   281     def EnableScrolling(self, enable):
   282     def EnableScrolling(self, enable):
   282         self.ScrollingEnabled = enable
   283         self.ScrollingEnabled = enable
   283     
   284     
   284     def RefreshIECChannelControlsState(self):
   285     def RefreshIECChannelControlsState(self):
   553                 infos[0] = value_infos
   554                 infos[0] = value_infos
   554             dialog.Destroy()
   555             dialog.Destroy()
   555             event.Skip()
   556             event.Skip()
   556         return OnBrowseButton
   557         return OnBrowseButton
   557     
   558     
   558     def OnWindowResize(self, event):
   559     def RefreshScrollbars(self):
   559         self.ParamsEditor.GetBestSize()
   560         self.ParamsEditor.GetBestSize()
   560         xstart, ystart = self.ParamsEditor.GetViewStart()
   561         xstart, ystart = self.ParamsEditor.GetViewStart()
   561         window_size = self.ParamsEditor.GetClientSize()
   562         window_size = self.ParamsEditor.GetClientSize()
   562         maxx, maxy = self.ParamsEditorSizer.GetMinSize()
   563         maxx, maxy = self.ParamsEditorSizer.GetMinSize()
   563         posx = max(0, min(xstart, (maxx - window_size[0]) / SCROLLBAR_UNIT))
   564         posx = max(0, min(xstart, (maxx - window_size[0]) / SCROLLBAR_UNIT))
   564         posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT))
   565         posy = max(0, min(ystart, (maxy - window_size[1]) / SCROLLBAR_UNIT))
   565         self.ParamsEditor.Scroll(posx, posy)
   566         self.ParamsEditor.Scroll(posx, posy)
   566         self.ParamsEditor.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT, 
   567         self.ParamsEditor.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT, 
   567                 maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, posx, posy)
   568                 maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, posx, posy)
       
   569     
       
   570     def OnWindowResize(self, event):
       
   571         self.RefreshScrollbars()
   568         event.Skip()
   572         event.Skip()
   569     
   573     
   570     def OnMouseWheel(self, event):
   574     def OnMouseWheel(self, event):
   571         if self.ScrollingEnabled:
   575         if self.ScrollingEnabled:
   572             event.Skip()
   576             event.Skip()