dialogs/FBDBlockDialog.py
changeset 1696 8043f32de7b8
parent 1571 486f94a8032c
child 1730 64d8f52bc8c8
equal deleted inserted replaced
1695:a63bb4025852 1696:8043f32de7b8
     3 
     3 
     4 # This file is part of Beremiz, a Integrated Development Environment for
     4 # This file is part of Beremiz, a Integrated Development Environment for
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
     6 #
     6 #
     7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
     7 # Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
       
     8 # Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
     8 #
     9 #
     9 # See COPYING file for copyrights details.
    10 # See COPYING file for copyrights details.
    10 #
    11 #
    11 # This program is free software; you can redistribute it and/or
    12 # This program is free software; you can redistribute it and/or
    12 # modify it under the terms of the GNU General Public License
    13 # modify it under the terms of the GNU General Public License
    54         @param parent: Parent wx.Window of dialog for modal
    55         @param parent: Parent wx.Window of dialog for modal
    55         @param controller: Reference to project controller
    56         @param controller: Reference to project controller
    56         @param tagname: Tagname of project POU edited
    57         @param tagname: Tagname of project POU edited
    57         """
    58         """
    58         BlockPreviewDialog.__init__(self, parent, controller, tagname,
    59         BlockPreviewDialog.__init__(self, parent, controller, tagname,
    59               size=wx.Size(600, 450), title=_('Block Properties'))
    60               title=_('Block Properties'))
    60         
    61         
    61         # Init common sizers
    62         # Init common sizers
    62         self._init_sizers(2, 0, 1, 0, 3, 2)
    63         self._init_sizers(2, 0, 1, 0, 3, 2)
    63         
    64         
    64         # Create static box around library panel
    65         # Create static box around library panel
    66         left_staticboxsizer = wx.StaticBoxSizer(type_staticbox, wx.VERTICAL)
    67         left_staticboxsizer = wx.StaticBoxSizer(type_staticbox, wx.VERTICAL)
    67         self.LeftGridSizer.AddSizer(left_staticboxsizer, border=5, flag=wx.GROW)
    68         self.LeftGridSizer.AddSizer(left_staticboxsizer, border=5, flag=wx.GROW)
    68         
    69         
    69         # Create Library panel and add it to static box
    70         # Create Library panel and add it to static box
    70         self.LibraryPanel = LibraryPanel(self)
    71         self.LibraryPanel = LibraryPanel(self)
       
    72         self.LibraryPanel.SetInitialSize(wx.Size(-1, 400))
       
    73         
    71         # Set function to call when selection in Library panel changed
    74         # Set function to call when selection in Library panel changed
    72         setattr(self.LibraryPanel, "_OnTreeItemSelected", 
    75         setattr(self.LibraryPanel, "_OnTreeItemSelected", 
    73               self.OnLibraryTreeItemSelected)
    76               self.OnLibraryTreeItemSelected)
    74         left_staticboxsizer.AddWindow(self.LibraryPanel, 1, border=5, 
    77         left_staticboxsizer.AddWindow(self.LibraryPanel, 1, border=5, 
    75               flag=wx.GROW|wx.TOP)
    78               flag=wx.GROW|wx.TOP)
   148         # Variable containing last name typed
   151         # Variable containing last name typed
   149         self.CurrentBlockName = None
   152         self.CurrentBlockName = None
   150         
   153         
   151         # Refresh Library panel values
   154         # Refresh Library panel values
   152         self.LibraryPanel.SetBlockList(controller.GetBlockTypes(tagname))
   155         self.LibraryPanel.SetBlockList(controller.GetBlockTypes(tagname))
       
   156         self.Fit()
   153         self.LibraryPanel.SetFocus()
   157         self.LibraryPanel.SetFocus()
   154     
   158     
   155     def SetValues(self, values):
   159     def SetValues(self, values):
   156         """
   160         """
   157         Set default block parameters
   161         Set default block parameters