当前位置: 首页>>代码示例>>Python>>正文


Python wx.LB_SINGLE属性代码示例

本文整理汇总了Python中wx.LB_SINGLE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.LB_SINGLE属性的具体用法?Python wx.LB_SINGLE怎么用?Python wx.LB_SINGLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在wx的用法示例。


在下文中一共展示了wx.LB_SINGLE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def __init__(self, parent, id, title):
        wx.Dialog.__init__(self, parent, id, title)
        self.selection_idx = None
        self.selection_text = None

        vbox = wx.BoxSizer(wx.VERTICAL)
        stline = wx.StaticText(
            self,
            11,
            'Duplicate Component values found!'
            '\n\nPlease select which format to follow:')
        vbox.Add(stline, 0, wx.ALIGN_CENTER|wx.TOP)
        self.comp_list = wx.ListBox(self, 331, style=wx.LB_SINGLE)

        vbox.Add(self.comp_list, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND)
        self.SetSizer(vbox)
        self.comp_list.Bind(wx.EVT_LISTBOX_DCLICK, self.on_selection, id=wx.ID_ANY)
        self.Show(True) 
开发者ID:Jeff-Ciesielski,项目名称:Boms-Away,代码行数:20,代码来源:bomsaway.py

示例2: _on_text_click

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def _on_text_click(self, event):
        if self.deactivated and not self.auto_activated and self.text:
            text_rect = self.text.GetClientRect()
            text_rect.Offset(self.text.Position)
            if text_rect.Contains(event.Position):
                self.toggle_active(active=True)
                return
        event.Skip()

#class ListBoxProperty(ComboBoxProperty):
    #def __init__(self, value="", choices=[], default_value=_DefaultArgument, name=None):
        #self.choices = choices
        #TextProperty.__init__(self, value, False, default_value, name)

    #def create_text_ctrl(self, panel, value):
        #style = wx.LB_SINGLE
        #combo = wx.ListBox( panel, -1, self.value, choices=self.choices, style=style )
        #combo.Bind(wx.EVT_LISTBOX, self.on_combobox)
        ##combo.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus)
        ##combo.Bind(wx.EVT_CHAR, self.on_char)
        #return combo 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:23,代码来源:new_properties.py

示例3: Create

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def Create(self, parent):
        self.__listbox = ListBoxWithHeaders(parent, style=wx.LB_SINGLE)

        self.__listbox.Bind(wx.EVT_MOTION, self._on_motion)
        self.__listbox.Bind(wx.EVT_LEFT_DOWN, self._on_left_down)

        sizer = wx.BoxSizer()
        sizer.Add(self.__listbox, 1, wx.EXPAND)
        self.SetSizer(sizer)
        return True 
开发者ID:MrS0m30n3,项目名称:youtube-dl-gui,代码行数:12,代码来源:widgets.py

示例4: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: Frame194.__init__
        kwds["style"] = kwds.get("style", 0)
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((800, 600))
        self.SetTitle(_("frame_1"))

        sizer_1 = wx.GridSizer(2, 3, 0, 0)

        self.list_box_single = wx.ListBox(self, wx.ID_ANY, choices=[_("Listbox wxLB_SINGLE")])
        self.list_box_single.SetSelection(0)
        sizer_1.Add(self.list_box_single, 1, wx.ALL | wx.EXPAND, 5)

        self.list_box_multiple = wx.ListBox(self, wx.ID_ANY, choices=[_("Listbox wxLB_MULTIPLE")], style=wx.LB_MULTIPLE)
        self.list_box_multiple.SetSelection(0)
        sizer_1.Add(self.list_box_multiple, 1, wx.ALL | wx.EXPAND, 5)

        self.list_box_extended = wx.ListBox(self, wx.ID_ANY, choices=[_("Listbox wxLB_EXTENDED")], style=wx.LB_EXTENDED)
        self.list_box_extended.SetSelection(0)
        sizer_1.Add(self.list_box_extended, 1, wx.ALL | wx.EXPAND, 5)

        self.check_list_box_single = wx.CheckListBox(self, wx.ID_ANY, choices=[_("CheckListBox wxLB_SINGLE")], style=wx.LB_SINGLE)
        self.check_list_box_single.SetSelection(0)
        sizer_1.Add(self.check_list_box_single, 1, wx.ALL | wx.EXPAND, 5)

        self.check_list_box_multiple = wx.CheckListBox(self, wx.ID_ANY, choices=[_("CheckListBox wxLB_MULTIPLE")], style=wx.LB_MULTIPLE)
        self.check_list_box_multiple.SetSelection(0)
        sizer_1.Add(self.check_list_box_multiple, 1, wx.ALL | wx.EXPAND, 5)

        self.check_list_box_extended = wx.CheckListBox(self, wx.ID_ANY, choices=[_("CheckListBox wxLB_EXTENDED")], style=wx.LB_EXTENDED)
        self.check_list_box_extended.SetSelection(0)
        sizer_1.Add(self.check_list_box_extended, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sizer_1)

        self.Layout()
        # end wxGlade

# end of class Frame194 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:41,代码来源:bug194.py

示例5: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def __init__(self, parent, choices=None):
        wx.PopupWindow.__init__(self, parent, wx.BORDER_SIMPLE)

        self.ListBox = wx.ListBox(self, -1, style=wx.LB_HSCROLL | wx.LB_SINGLE | wx.LB_SORT)

        choices = [] if choices is None else choices
        self.SetChoices(choices)

        self.ListBox.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
        self.ListBox.Bind(wx.EVT_MOTION, self.OnMotion) 
开发者ID:thiagoralves,项目名称:OpenPLC_Editor,代码行数:12,代码来源:TextCtrlAutoComplete.py

示例6: Configure

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def Configure(self, location_id = "Antwerp, Belgium", hl=''):

        text=self.text

        dialog = eg.ConfigPanel(self)
        sizer = dialog.sizer
        mySizer = wx.FlexGridSizer(cols=2)

        desc0 = wx.StaticText(dialog, -1, text.LanguageLabel)
        mySizer.Add(desc0, 0,  wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

        Language = wx.TextCtrl(dialog, -1,hl)
        mySizer.Add(Language, 0, wx.EXPAND|wx.ALL, 5)

        desc1 = wx.StaticText(dialog, -1, text.LocationLabel)
        mySizer.Add(desc1, 0,  wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

        Location = wx.TextCtrl(dialog, -1,location_id)
        mySizer.Add(Location, 0, wx.EXPAND|wx.ALL, 5)

        desc2 = wx.StaticText(dialog, -1, text.CountriesLabel)
        mySizer.Add(desc2, 0,  wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

        CountriesEdit = wx.ListBox(dialog, -1, choices=[], style=wx.LB_SINGLE)
        mySizer.Add(CountriesEdit, 0, wx.EXPAND|wx.ALL, 5)
        CountriesEdit.Clear()
        CountryList = pywapi.get_countries_from_google()
        i=0
        while i < len(CountryList):
            CountriesEdit.Append(CountryList[i]['name'])
            i=i+1
        def OnCountrySelect(event):
            CitiesEdit.Clear()
            result = pywapi.get_cities_from_google(str(CountryList[CountriesEdit.GetSelection()]['iso_code']))
            i=0
            while i < len(result):
                 CitiesEdit.Append(result[i]['name'])
                 i=i+1
            Location.SetValue(CitiesEdit.GetStringSelection() + ", " + CountriesEdit.GetStringSelection())
        CountriesEdit.Bind(wx.EVT_LISTBOX, OnCountrySelect)

        desc3 = wx.StaticText(dialog, -1, text.CitiesLabel)
        mySizer.Add(desc3, 0,  wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)

        CitiesEdit = wx.ListBox(dialog, -1, choices=[], style=wx.LB_SINGLE)
        mySizer.Add(CitiesEdit, 0, wx.EXPAND|wx.ALL, 5)
        def OnCitySelect(event):
            Location.SetValue(CitiesEdit.GetStringSelection() + ", " + CountriesEdit.GetStringSelection())
        CitiesEdit.Bind(wx.EVT_LISTBOX, OnCitySelect)

        sizer.Add(mySizer, 1, wx.EXPAND)

        while dialog.Affirmed():
            dialog.SetResult(Location.GetValue(), Language.GetValue()) 
开发者ID:EventGhost,项目名称:EventGhost,代码行数:56,代码来源:__init__.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import LB_SINGLE [as 别名]
def __init__(self, *args, **kwds):
        # begin wxGlade: JobInfo.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((659, 612))
        self.operations_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE)
        self.commands_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE)
        self.button_job_spooler = wx.BitmapButton(self, wx.ID_ANY, icons8_route_50.GetBitmap())
        self.button_writer_control = wx.Button(self, wx.ID_ANY, _("Start Job"))
        self.button_writer_control.SetBitmap(icons8_laser_beam_52.GetBitmap())
        self.button_writer_control.SetFont(
            wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI"))

        # Menu Bar
        self.JobInfo_menubar = wx.MenuBar()
        wxglade_tmp_menu = wx.Menu()
        self.menu_autostart = wxglade_tmp_menu.Append(wx.ID_ANY, _("Start Spooler"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_auto_start_controller, id=self.menu_autostart.GetId())
        self.menu_prehome = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home Before"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_home_before, id=self.menu_prehome.GetId())
        self.menu_autohome = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home After"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_home_after, id=self.menu_autohome.GetId())
        self.menu_autobeep = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep After"), "", wx.ITEM_CHECK)
        self.Bind(wx.EVT_MENU, self.on_check_beep_after, id=self.menu_autobeep.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Automatic"))

        wxglade_tmp_menu = wx.Menu()
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_home, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Wait"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_wait, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_beep, id=t.GetId())
        t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Interrupt"), "")
        self.Bind(wx.EVT_MENU, self.jobadd_interrupt, id=t.GetId())
        self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Add"))
        self.SetMenuBar(self.JobInfo_menubar)
        # Menu Bar end

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_LISTBOX, self.on_listbox_operation_click, self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_operation_dclick, self.operations_listbox)
        self.Bind(wx.EVT_LISTBOX, self.on_listbox_commands_click, self.commands_listbox)
        self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_commands_dclick, self.commands_listbox)
        self.Bind(wx.EVT_BUTTON, self.on_button_start_job, self.button_writer_control)
        self.Bind(wx.EVT_BUTTON, self.on_button_job_spooler, self.button_job_spooler)
        # end wxGlade

        self.Bind(wx.EVT_CLOSE, self.on_close, self)

        # TODO: Move this to Elements
        self.preprocessor = OperationPreprocessor()
        self.operations = [] 
开发者ID:meerk40t,项目名称:meerk40t,代码行数:58,代码来源:JobInfo.py


注:本文中的wx.LB_SINGLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。