コード例 #1
0
ファイル: icstaticbox.py プロジェクト: XHermitOne/defis
    def __init__(self, parent, id, component, logType=0, evalSpace=None,
                 bCounter=False, progressDlg=None, *arg, **kwarg):
        """
        Конструктор для создания icStaticBox

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        icSpcDefStruct(SPC_IC_STATICBOX, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)
        
        size = component['size']
        pos = component['position']
        label = component['label']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        style = component['style']

        wx.StaticBox.__init__(self, parent, id, label=label, pos=pos, size=size, style=style, name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))
コード例 #2
0
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace=None,
                 bCounter=False,
                 progressDlg=None,
                 *arg,
                 **kwarg):
        """
        Конструктор для создания icGuage

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1 - файл, 2 - окно лога, 3 - диалоговое окно)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        self.parent = parent

        util.icSpcDefStruct(SPC_IC_GAUGE, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        size = component['size']
        pos = component['position']
        layout = component['layout']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        max = component['max']
        val = component['value']

        if layout == 'vertical':
            style = wx.GA_VERTICAL | wx.GA_SMOOTH
        else:
            style = wx.GA_HORIZONTAL | wx.GA_SMOOTH

        wx.Gauge.__init__(self,
                          parent,
                          id,
                          max,
                          pos,
                          size,
                          style=style,
                          name=self.name)
        self.SetValue(val)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        self.BindICEvt()
コード例 #3
0
    def __init__(self, parent, id, component, logType=0, evalSpace=None,
                 bCounter=False, progressDlg=None):
        """
        Конструктор для создания icComboBox.

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно.
        @type id: C{int}
        @param id: Идентификатор окна.
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога).
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        util.icSpcDefStruct(SPC_IC_COMBOBOX, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)
        
        self.bChanged = 0
        self.items = component['items']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        size = component['size']
        pos = component['position']
        style = component['style']

        # --- Обрабатываем аттрибут инициализации списка
        if not component['items']:
            self.items = []
        elif type(component['items']) in (list, tuple):
            self.items = component['items']
        elif isinstance(component['items'], dict):
            self._dictRepl = component['items']
            self.items = self._dictRepl.values()
            self.items.sort()
        else:
            ret = util.getICAttr('@'+component['items'], self.evalSpace,
                                 'getICAttr() Error in icchoice.__init__(...) <items> name=%s' % self.name)

            if type(ret) in (list, tuple):
                self.items = ret
            elif isinstance(ret, dict):
                self._dictRepl = ret
                self.items = self._dictRepl.values()
                self.items.sort()
            else:
                self.items = []

        wx.ComboBox.__init__(self, parent, id, component['value'], pos, size, self.items, style, name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        self.BindICEvt()
コード例 #4
0
ファイル: icradiogroup.py プロジェクト: XHermitOne/defis
    def __init__(self, parent, id, component, logType=0, evalSpace=None,
                 bCounter=False, progressDlg=None, *arg, **kwarg):
        """
        Конструктор для создания  icRadioGroup

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        util.icSpcDefStruct(SPC_IC_RADIOGROUP, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        #   По спецификации создаем соответствующие атрибуты (кроме служебных атрибутов)
        lst_keys = [x for x in component.keys() if not x.startswith('__')]
        for key in lst_keys:
            setattr(self, key, component[key])
        
        layout = component['layout']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        max = component['max']
        label = component['label']
        items = component['items']
        size = component['size']
        pos = component['position']
        sel = component['selected']
        style = component['style']

        if layout == 'vertical' :
            style = style | wx.RA_SPECIFY_ROWS | wx.CLIP_SIBLINGS
        else:
            style = style | wx.RA_SPECIFY_COLS | wx.CLIP_SIBLINGS

        wx.RadioBox.__init__(self, parent, id, label, pos, size, items, max, style, name = self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        self.Bind(wx.EVT_RADIOBOX, self.OnSelected)
        self.BindICEvt()
コード例 #5
0
ファイル: icstaticline.py プロジェクト: XHermitOne/defis
    def __init__(self,
                 parent,
                 id=-1,
                 component={},
                 logType=0,
                 evalSpace=None,
                 bCounter=False,
                 progressDlg=None,
                 *arg,
                 **kwarg):
        """
        Конструктор для создания линии icStaticLine.

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно.
        @type id: C{int}
        @param id: Идентификатор окна.
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога).
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        icSpcDefStruct(SPC_IC_LINE, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        size = component['size']
        pos = component['position']
        layout = component['layout']

        if layout == 'vertical':
            style = wx.LI_VERTICAL
        else:
            style = wx.LI_HORIZONTAL

        wx.StaticLine.__init__(self,
                               parent,
                               id,
                               pos,
                               size,
                               style,
                               name=self.name)
コード例 #6
0
ファイル: icimagebutton.py プロジェクト: XHermitOne/defis
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace={},
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор.

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        util.icSpcDefStruct(SPC_IC_IMGBUTTON, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)
コード例 #7
0
ファイル: icstaticbitmap.py プロジェクト: XHermitOne/defis
    def __init__(self,
                 parent=None,
                 id=-1,
                 component={},
                 logType=0,
                 evalSpace=None,
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор для создания icStaticBitmap.

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно.
        @type id: C{int}
        @param id: Идентификатор окна.
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога).
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        self.editor = None

        util.icSpcDefStruct(SPC_IC_BITMAP, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        pos = component['position']
        style = component['style']
        size = component['size']
        self.hlp = component['hlp']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        img = None

        if component['field_name'] is None:
            self.field_name = self.name
        else:
            self.field_name = component['field_name']

        try:
            self.file = self.dataset.getNameValue(self.field_name)
        except:
            self.file = component['file']
            img = util.getICAttr(component['file'],
                                 self.evalSpace,
                                 msg='ERROR')

        if img and issubclass(img.__class__, wx.Bitmap):
            pass
        else:
            self.file = util.getICAttr(component['file'],
                                       self.evalSpace,
                                       msg='ERROR')
            bmptype = icBitmapType(self.file)

            if bmptype is not None and os.path.isfile(self.file):
                img = wx.Image(self.file, bmptype).ConvertToBitmap()
            else:
                img = common.icDefaultStaticPic

        if size == (-1, -1):
            size = wx.Size(img.GetWidth(), img.GetHeight())

        wx.StaticBitmap.__init__(self,
                                 parent,
                                 id,
                                 img,
                                 pos,
                                 size,
                                 style=style,
                                 name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        self.Bind(wx.EVT_LEFT_DOWN, self.OnSelect)
        self.BindICEvt()
コード例 #8
0
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace=None,
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор для создания icImageButton

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        util.icSpcDefStruct(SPC_IC_TOGGLE_IMGBUTTON, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        sz = component['size']
        pos = component['position']
        border = component['border']

        self.image = img = util.getICAttr(
            component['image'], evalSpace,
            'Error in getICAttr in icimagebutton. name=%s attribute <image>' %
            self.name)

        if type(img) in (str,
                         unicode) and img not in ['', 'None', u'', u'None']:
            bmptype = icBitmapType(img)
            img = wx.Image(img, bmptype).ConvertToBitmap()
        elif not img:
            img = common.imgEdtImage

        x = sz[0]

        if x == -2:
            x = img.getWidth()

        y = sz[1]

        if y == -2:
            y = img.getHeight()

        #   Устанавливае реальные размеры для дальнейшего использования
        component['size'] = (x, y)
        sz = (x, y)

        style = component['style']
        self.mouse_click = component['mouseClick']
        self.mouse_down = component['mouseDown']
        self.mouse_up = component['mouseUp']
        self.mouse_contextdown = component['mouseContextDown']
        self.label = component['label']
        self.shortHelpString = component['shortHelpString']
        self.bFocusIndicator = component['bFocusIndicator']
        self._helpWin = None

        buttons.ThemedGenBitmapTextToggleButton.__init__(self,
                                                         parent,
                                                         id,
                                                         img,
                                                         self.label,
                                                         pos,
                                                         sz,
                                                         style=style,
                                                         name=self.name)

        self.SetBezelWidth(1)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        self.Bind(wx.EVT_BUTTON, self.OnMouseClick, id=id)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp)
        self.Bind(wx.EVT_RIGHT_DOWN, self.OnMouseContextDown)
        self.Bind(wx.EVT_MOTION, self.OnMouseMove)
        self.BindICEvt()
コード例 #9
0
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace={},
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор для создания icChoice.

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        self.bChanged = 0

        util.icSpcDefStruct(SPC_IC_CHOICE, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        size = component['size']
        pos = component['position']
        style = component['style']

        if component['field_name'] is None:
            self.field_name = self.name
        else:
            self.field_name = component['field_name']

        self.losefocus = component['loseFocus']
        self.setfocus = component['setFocus']
        self.choice = component['choice']

        #   Номер последней заблокированной записи
        self._oldLockReck = -1

        #   Словарь замен. Ключи - соответствующие значения в объекте данных, значения  формируют список выбора
        self._dictRepl = None
        self._itemsLst = None

        # Обрабатываем аттрибут инициализации списка
        if not component['items']:
            self.items = []
        elif type(component['items']) in (list, tuple):
            self.items = component['items']
        elif isinstance(component['items'], dict):
            self._dictRepl = component['items']
            self.items = self._dictRepl.values()
            self.items.sort()
        else:
            ret = util.getICAttr(
                '@' + component['items'], self.evalSpace,
                'getICAttr() Error in icchoice.__init__(...) <items> name=%s' %
                self.name)

            if type(ret) in (list, tuple):
                self.items = ret
            elif isinstance(ret, dict):
                self._dictRepl = ret
                self.items = self._dictRepl.values()
                self.items.sort()
            else:
                self.items = []

        # Создаем объект
        wx.Choice.__init__(self,
                           parent,
                           id,
                           pos,
                           size,
                           self.items,
                           style,
                           name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        try:
            self.SetValue(self.dataset.getNameValue(self.field_name))
        except:
            pass

        self.Bind(wx.EVT_CHOICE, self.OnChoice, id=id)
        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
        self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        self.BindICEvt()
コード例 #10
0
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace=None,
                 bCounter=False,
                 progressDlg=None,
                 *arg,
                 **kwarg):
        """
        Конструктор для создания icSpinner

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        self.bChanged = 0

        component = util.icSpcDefStruct(SPC_IC_SPINNER, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        #   По спецификации создаем соответствующие атрибуты (кроме служебных атрибутов)
        lst_keys = [x for x in component.keys() if not x.startswith('__')]
        for key in lst_keys:
            setattr(self, key, component[key])

        if component['field_name'] is None:
            self.field_name = self.name
        else:
            self.field_name = component['field_name']

        min = util.getICAttr(
            component['min'], evalSpace,
            'Error in getICAttr in icspinner. name=%s <min>=%s' %
            (self.name, component['min']))
        max = util.getICAttr(
            component['max'], evalSpace,
            'Error in getICAttr in icspinner. name=%s <max>=%s' %
            (self.name, component['max']))
        val = util.getICAttr(
            component['value'], evalSpace,
            'Error in getICAttr in icspinner. name=%s <value>=%s' %
            (self.name, component['value']))

        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        style = component['style']
        pos = component['position']
        size = component['size']
        size = (int(size[0]), int(size[1]))
        font = component['font']

        #   Номер последней заблокированной записи
        self._oldLockReck = -1

        wx.SpinCtrl.__init__(self,
                             parent,
                             id,
                             str(val),
                             pos,
                             size,
                             style,
                             min=min,
                             max=max,
                             name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        try:
            self.SetValue(str(self.dataset.getNameValue(self.field_name)))
        except:
            pass

        obj = icFont(font)
        self.SetFont(obj)

        self.Bind(wx.EVT_SPIN, self.OnSpin, id=id)
        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
        self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        self.BindICEvt()
コード例 #11
0
ファイル: icsplitter.py プロジェクト: XHermitOne/defis
    def __init__(self,
                 parent,
                 id=-1,
                 component={},
                 logType=0,
                 evalSpace=None,
                 bCounter=False,
                 progressDlg=None,
                 *arg,
                 **kwarg):
        """
        Конструктор для создания объекта icSplitterWindow.
        @type parent: C{wxWindow}
        @param parent: Указатель на родительское окно.
        @type id: C{int}
        @param id: Идентификатор окна.
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога).
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        util.icSpcDefStruct(SPC_IC_SPLITTER, component)
        icWidget.__init__(self,
                          parent,
                          id,
                          component,
                          logType,
                          evalSpace,
                          bPrepareProp=True)

        size = component['size']
        pos = component['position']
        self.sash_size = component['sash_size']
        #   Флаг, указывающий, что необходимо сохранять изменяющиеся
        #   параметры окна (позицию и размеры).
        self.saveChangeProperty = True

        #   Читаем расположение сплиттера из файла настроек пользователя
        _pos = self.LoadUserProperty('sash_pos')

        if _pos:
            self.sash_pos = _pos
        # Последняя позиция разделителя
        self._last_sash_pos = _pos

        wx.SplitterWindow.__init__(self,
                                   parent,
                                   id,
                                   pos,
                                   size,
                                   component['style'],
                                   name=self.name)
        self.SetMinimumPaneSize(component['min_panelsize'])
        self.SetSashSize(self.sash_size)

        self.BindICEvt()

        #   Создаем дочерние компоненты
        self.child = []
        if component['win1']:
            self.child.append(component['win1'])
        if component['win2']:
            self.child.append(component['win2'])

        self.childCreator(bCounter, progressDlg)

        # Вспомогательные атрибуты
        self._toggle_win1 = False
        self._toggle_win2 = False
コード例 #12
0
ファイル: icstatictext.py プロジェクト: XHermitOne/defis
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace={},
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор для создания icStaticText

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно
        @type id: C{int}
        @param id: Идентификатор окна
        @type component: C{dictionary}
        @param component: Словарь описания компонента
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога)
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений
        @type evalSpace: C{dictionary}
        """
        icSpcDefStruct(SPC_IC_STATICTEXT, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        text = component['text']
        pos = component['position']
        size = component['size']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        font = component['font']
        style = component['style']

        #   Вычисляем текст поля после создания объекта
        if text.find('@') == -1:
            val = getICAttr('@' + text, self.evalSpace, None)
        else:
            val = getICAttr(
                '@' + text, self.evalSpace,
                'Error in icstatictext.__init__()<text>. Name:' + self.name)

        if not val:
            val = text

        wx.StaticText.__init__(self,
                               parent,
                               id,
                               val,
                               pos,
                               size=size,
                               style=style,
                               name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        obj = icFont(font)
        self.SetFont(obj)
コード例 #13
0
ファイル: iccheckbox.py プロジェクト: XHermitOne/defis
    def __init__(self,
                 parent,
                 id,
                 component,
                 logType=0,
                 evalSpace={},
                 bCounter=False,
                 progressDlg=None):
        """
        Конструктор для создания icCheckBox.

        @type parent: C{wx.Window}
        @param parent: Указатель на родительское окно.
        @type id: C{int}
        @param id: Идентификатор окна.
        @type component: C{dictionary}
        @param component: Словарь описания компонента.
        @type logType: C{int}
        @param logType: Тип лога (0 - консоль, 1- файл, 2- окно лога).
        @param evalSpace: Пространство имен, необходимых для вычисления внешних выражений.
        @type evalSpace: C{dictionary}
        """
        self.bChanged = 0
        component = util.icSpcDefStruct(SPC_IC_CHECKBOX, component)
        icWidget.__init__(self, parent, id, component, logType, evalSpace)

        label = component['label']
        pos = component['position']
        fgr = component['foregroundColor']
        bgr = component['backgroundColor']
        style = component['style']

        #   Номер последней заблокированной записи
        self._oldLockReck = -1

        if component['field_name'] is None:
            self.field_name = self.name
        else:
            self.field_name = component['field_name']

        self.check = component['check']
        self.uncheck = component['uncheck']
        self.losefocus = component['loseFocus']
        self.setfocus = component['setFocus']

        wx.CheckBox.__init__(self,
                             parent,
                             id,
                             label,
                             pos,
                             style=style,
                             name=self.name)

        if fgr is not None:
            self.SetForegroundColour(wx.Colour(fgr[0], fgr[1], fgr[2]))

        if bgr is not None:
            self.SetBackgroundColour(wx.Colour(bgr[0], bgr[1], bgr[2]))

        try:
            checked = self.dataset.getNameValue(self.field_name)
        except:
            checked = component['checked']

        if checked is not None:
            try:
                val = int(checked)
                self.SetValue(val)
            except:
                pass

        self.Bind(wx.EVT_CHECKBOX, self.OnCheckBox, id=id)
        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
        self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        self.BindICEvt()