Beremiz.py
changeset 101 93e487ccee14
parent 99 e5e9cb0f027f
child 102 18793be117b9
equal deleted inserted replaced
100:24b504f67c72 101:93e487ccee14
    80 
    80 
    81     def writelines(self, l):
    81     def writelines(self, l):
    82         map(self.write, l)
    82         map(self.write, l)
    83 
    83 
    84     def write(self, s, style = None):
    84     def write(self, s, style = None):
    85         if not style : style=self.black_white
    85         if not style : style=self.black_white    
    86         if self.default_style != style: 
    86         if self.default_style != style: 
    87             self.output.SetDefaultStyle(style)
    87             self.output.SetDefaultStyle(style)
    88             self.default_style = style
    88             self.default_style = style
    89         self.output.AppendText(s) 
    89         self.output.AppendText(s) 
    90 
    90 
   366         window_size = self.PLCConfig.GetClientSize()
   366         window_size = self.PLCConfig.GetClientSize()
   367         sizer = self.PLCConfig.GetSizer()
   367         sizer = self.PLCConfig.GetSizer()
   368         if sizer:
   368         if sizer:
   369             maxx, maxy = sizer.GetMinSize()
   369             maxx, maxy = sizer.GetMinSize()
   370             self.PLCConfig.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT, 
   370             self.PLCConfig.SetScrollbars(SCROLLBAR_UNIT, SCROLLBAR_UNIT, 
   371                 maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, xstart, ystart, True)
   371                 maxx / SCROLLBAR_UNIT, maxy / SCROLLBAR_UNIT, xstart, ystart)
   372 
   372 
   373     def RefreshPLCParams(self):
   373     def RefreshPLCParams(self):
   374         self.ClearSizer(self.PLCParamsSizer)
   374         self.ClearSizer(self.PLCParamsSizer)
   375         
   375         
   376         if self.PluginRoot.HasProjectOpened():
   376         if self.PluginRoot.HasProjectOpened():
   416             minimizebutton.labelDelta = 0
   416             minimizebutton.labelDelta = 0
   417             minimizebutton.SetBezelWidth(0)
   417             minimizebutton.SetBezelWidth(0)
   418             minimizebutton.SetUseFocusIndicator(False)
   418             minimizebutton.SetUseFocusIndicator(False)
   419             minimizebutton.SetBitmapSelected(wx.Bitmap(os.path.join(CWD, 'images', 'Minimize.png')))
   419             minimizebutton.SetBitmapSelected(wx.Bitmap(os.path.join(CWD, 'images', 'Minimize.png')))
   420             plcwindowbuttonsizer.AddWindow(minimizebutton, 0, border=5, flag=wx.ALL)
   420             plcwindowbuttonsizer.AddWindow(minimizebutton, 0, border=5, flag=wx.ALL)
   421             
       
   422             self.PLCConfigMainSizer.Layout()
       
   423             self.RefreshScrollBars()
       
   424             
   421             
   425             if len(self.PluginRoot.PlugChildsTypes) > 0:
   422             if len(self.PluginRoot.PlugChildsTypes) > 0:
   426                 addsizer = self.GenerateAddButtonSizer(self.PluginRoot, plcwindow)
   423                 addsizer = self.GenerateAddButtonSizer(self.PluginRoot, plcwindow)
   427                 plcwindowbuttonsizer.AddSizer(addsizer, 0, border=0, flag=0)
   424                 plcwindowbuttonsizer.AddSizer(addsizer, 0, border=0, flag=0)
   428             else:
   425             else:
   441                         addsizer.SetCols(len(self.PluginRoot.PlugChildsTypes))
   438                         addsizer.SetCols(len(self.PluginRoot.PlugChildsTypes))
   442                 self.PLCConfigMainSizer.Layout()
   439                 self.PLCConfigMainSizer.Layout()
   443                 self.RefreshScrollBars()
   440                 self.RefreshScrollBars()
   444                 event.Skip()
   441                 event.Skip()
   445             minimizebutton.Bind(wx.EVT_BUTTON, togglewindow, id=minimizebutton_id)
   442             minimizebutton.Bind(wx.EVT_BUTTON, togglewindow, id=minimizebutton_id)
   446             
   443         
       
   444         self.PLCConfigMainSizer.Layout()
       
   445         self.RefreshScrollBars()
   447 
   446 
   448     def GenerateAddButtonSizer(self, plugin, parent, horizontal = True):
   447     def GenerateAddButtonSizer(self, plugin, parent, horizontal = True):
   449         if horizontal:
   448         if horizontal:
   450             addsizer = wx.FlexGridSizer(cols=len(plugin.PluginMethods))
   449             addsizer = wx.FlexGridSizer(cols=len(plugin.PluginMethods))
   451         else:
   450         else: