userform.py 文件源码

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

项目:samples-Python-RPS 作者: PMoureu 项目源码 文件源码
def __init__(self, param):
        super(PanelParameter, self ).__init__()

        self.Height = Fconfig.unitline
        self.paramtype = param[1]
        tooltips = ToolTip()
        self.value = ''


        self.textlabel = Label()
        self.textlabel.Parent = self
        self.textlabel.Text = '{0} ({1}) :'.format(param[0],param[1])
        self.textlabel.Location = Point(0, 0)
        self.textlabel.Size = Size(Fconfig.lblwidth, Fconfig.unitline)
        self.textlabel.TextAlign = ContentAlignment.MiddleLeft


        #ComboBox if list 
        if len(param) >= 3 :
            self.textbox = ComboBox()
            list_items = List[Object](param[2])
            self.textbox.Items.AddRange(list_items.ToArray())

            #dropdownstyle with 4th param if False:
            if len(param)>3 and not param[3]:
                self.textbox.DropDownStyle = ComboBoxStyle.DropDownList
                self.textbox.SelectionChangeCommitted += self.onInput

        #else simple textbox 
        else:
            self.textbox = TextBox()

        self.textbox.Parent = self
        self.textbox.Location = Point(self.textlabel.Right+Fconfig.margin, 10)
        self.textbox.Width = Fconfig.smwidth-self.textlabel.Width- 2*Fconfig.margin
        self.textbox.TextChanged += self.onInput

        tooltips.SetToolTip(self.textbox, Types.types(param[1], 'tooltip'))

        ModeDBG.say('panel {0}, top {1}, height :{2}'.format(
                    param[1], self.Top, self.Height))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号