Python wx 模块,EmptyString() 实例源码

我们从Python开源项目中,提取了以下24个代码示例,用于说明如何使用wx.EmptyString()

项目:Crypter    作者:sithis993    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Encrypted Files", pos = wx.DefaultPosition, size = wx.Size( 600,400 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )

        BodySizer = wx.BoxSizer( wx.VERTICAL )

        self.m_panel4 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
        TextCtrlSizer = wx.BoxSizer( wx.VERTICAL )

        self.EncryptedFilesTextCtrl = wx.TextCtrl( self.m_panel4, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY )
        TextCtrlSizer.Add( self.EncryptedFilesTextCtrl, 1, wx.ALL|wx.EXPAND, 5 )


        self.m_panel4.SetSizer( TextCtrlSizer )
        self.m_panel4.Layout()
        TextCtrlSizer.Fit( self.m_panel4 )
        BodySizer.Add( self.m_panel4, 1, wx.EXPAND |wx.ALL, 5 )


        self.SetSizer( BodySizer )
        self.Layout()

        self.Centre( wx.BOTH )
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def add_txt(self, title, key, unit):
        sizer = wx.BoxSizer( wx.HORIZONTAL )
        lab_title = wx.StaticText( self, wx.ID_ANY, title,
                                   wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE )

        lab_title.Wrap( -1 )
        sizer.Add( lab_title, 0, wx.ALIGN_CENTER|wx.ALL, 5 )

        ctrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString,
                            wx.DefaultPosition, wx.DefaultSize, 0 )

        self.ctrl_dic[key] = ctrl
        ctrl.Bind( wx.EVT_KEY_UP, lambda x : self.para_changed(key))
        sizer.Add( ctrl, 2, wx.ALL, 5 )

        lab_unit = wx.StaticText( self, wx.ID_ANY, unit,
                                  wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE )

        lab_unit.Wrap( -1 )
        sizer.Add( lab_unit, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
        self.tus.append((lab_title, lab_unit))
        self.lst.Add( sizer, 0, wx.EXPAND, 5 )
项目:pywatch    作者:jackburridge    | 项目源码 | 文件源码
def __init__(self, parent):
        wx.Frame.__init__(self, parent, title=u"My Frame")

        self.model = WatchableDict()
        self.model["text"] = ""

        sizer = wx.BoxSizer(wx.VERTICAL)

        self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
        sizer.Add(self.text_ctrl, 0, 0, 0)
        pywatch.wx.ValueChanger(self.text_ctrl, self.model, "text")

        self.static_text = wx.StaticText(self, wx.ID_ANY, u"Text: {0}", wx.DefaultPosition, wx.DefaultSize, 0)
        sizer.Add(self.static_text, 0, 0, 0)
        pywatch.wx.LabelWatcher(self.static_text, self.model, "text")

        self.SetSizer(sizer)

        self.Centre(wx.BOTH)
项目:fritzchecksum    作者:mementum    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.TAB_TRAVERSAL )

        bSizer111 = wx.BoxSizer( wx.VERTICAL )

        self.m_textCtrlDocument = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,-1 ), wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY )
        bSizer111.Add( self.m_textCtrlDocument, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 )


        self.SetSizer( bSizer111 )
        self.Layout()
        bSizer111.Fit( self )
项目:Pigrow    作者:Pragmatismo    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 1200,800 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
        self.Layout()
        self.Centre( wx.BOTH )
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def menu_drop(parent, toolbar, datas, btn, e):
    menu = wx.Menu()
    for data in datas[1][1:]:
        item = wx.MenuItem(menu, wx.ID_ANY, data[0].title, wx.EmptyString, wx.ITEM_NORMAL )
        menu.Append(item)
        parent.Bind(wx.EVT_MENU, lambda x,p=data[1]:add_tools(toolbar, p), item)
    parent.PopupMenu( menu )
    menu.Destroy()
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def __init__(self, title='ImagePy TexLog'):
        wx.Frame.__init__(self, IPy.curapp,title=title,size=(500,300))
        logopath = os.path.join(root_dir, 'data/logo.ico')
        self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
        self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
        self.title = title
        TextLogManager.add(title, self)
        self.file=''

        ### Create menus (name:event) k-v pairs 
        menus = [
                ## File 
                ('File(&F)',[('Open', self.OnOpen),
                             ('Save', self.OnSave),
                             ('Save as', self.OnSaveAs),
                             ('-'),
                             ('Exit', self.OnClose)
                             ]),
                ## Edit 
                ('Edit(&E)', [ ('Undo', self.OnUndo),
                             ('Redo', self.OnRedo),
                             ('-'),
                             ('Cut', self.OnCut),
                             ('Copy', self.OnCopy),
                             ('Paste', self.OnPaste),
                             ('-'),
                             ('All', self.OnSelectAll)
                             ]),               
                ## Help 
                ('Help(&H)', [('About', self.OnAbout)])
        ]

        ### Bind menus with the corresponding events 
        self.menuBar=wx.MenuBar()
        for menu in menus:
            m = wx.Menu()
            for item in menu[1]:
                if item[0]=='-':
                    m.AppendSeparator()
                else:
                    i = m.Append(-1, item[0])
                    self.Bind(wx.EVT_MENU,item[1], i)
            self.menuBar.Append(m,menu[0])
        self.SetMenuBar(self.menuBar) 
        self.Bind(wx.EVT_CLOSE, self.OnClosing)

        sizer = wx.BoxSizer( wx.VERTICAL )
        self.text= wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, 
                                wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
        sizer.Add( self.text, 1, wx.ALL|wx.EXPAND, 1 )
        self.SetSizer( sizer )

        self.Bind(wx.EVT_RIGHT_DOWN,self.OnRClick)
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def __init__( self, parent):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'Plugin List',
                            pos = wx.DefaultPosition, size = wx.Size( 412,500 ), 
                            style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
        logopath = os.path.join(root_dir, 'data/logo.ico')
        self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
        self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
        self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
        bSizer1 = wx.BoxSizer( wx.VERTICAL )
        bSizer2 = wx.BoxSizer( wx.HORIZONTAL )
        self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, "Search:", 
                                            wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText1.Wrap( -1 )
        bSizer2.Add( self.m_staticText1, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
        self.txt_search = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, 
                                       wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer2.Add( self.txt_search, 1, wx.ALL, 5 )
        bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
        self.lst_plgs = VirtualListCtrl( self, ['Name', 'Shotcut'])
        self.lst_plgs.SetColumnWidth(0,200)
        self.lst_plgs.SetColumnWidth(1,200)
        bSizer1.Add( self.lst_plgs, 1, wx.ALL|wx.EXPAND, 5 )
        self.SetSizer( bSizer1 )
        self.Layout()
        self.Centre( wx.BOTH )
        # Connect Events
        self.txt_search.Bind( wx.EVT_TEXT, self.on_search )
        self.lst_plgs.Bind(wx.EVT_LIST_KEY_DOWN, self.on_run)
        self.load()
        self.Bind(wx.EVT_CLOSE, self.on_close)
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def set_project_name(self, name=wx.EmptyString):
        if name:
            _, name = os.path.split(name)      
        self.view._set_project_name(name)


    ###
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def __init__(self, controller_uid):
        UIViewBase.__init__(self, controller_uid)
        UIM = UIManager()
        controller = UIM.get(self._controller_uid)
        parent_controller_uid = UIM._getparentuid(self._controller_uid)
        parent_controller =  UIM.get(parent_controller_uid)  

        wx.TreeCtrl.__init__(self, parent_controller.view, -1, wx.Point(0, 0), wx.Size(200, 250),
                           wx.TR_DEFAULT_STYLE | wx.NO_BORDER)

        self._rootid = self.AddRoot(wx.EmptyString)                  
        self._set_project_name() 

        self.SetItemData(self._rootid, (controller._PSEUDOROOTUID, None))

        self.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.on_rightclick)     

        '''
        imglist = wx.ImageList(16, 16, True, 2)
        imglist.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART_OTHER, wx.Size(16,16)))
        tree.AssignImageList(imglist)
        items.append(tree.AppendItem(root, "Item 1", 0))
        '''
        parent_controller.view._mgr.AddPane(self, wx.aui.AuiPaneInfo().Name("tree").
                Caption("Object Manager").Left().Layer(1).Position(1).
                PinButton(True).MinimizeButton(True).
                CloseButton(False).MaximizeButton(True)
        )        
        parent_controller.view._mgr.Update()

        self.Bind(wx.EVT_TREE_BEGIN_DRAG, self._on_begin_drag)
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def _set_project_name(self, name=wx.EmptyString):
        UIM = UIManager()
        controller = UIM.get(self._controller_uid)
        if name:          
            self._root_name = controller._DEFAULT_ROOT_NAME + ' [' + name + ']'
        else:
            self._root_name = controller._DEFAULT_ROOT_NAME
        self.SetItemText(self._rootid, self._root_name)
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def GetValue(self, item, col):
        obj = self.ItemToObject(item)    
        if isinstance(obj, TrackController):
            if col == 0:
                if obj.model.label:
                    return obj.model.label
                return 'Track ' + str(obj.model.pos + 1)
            return wx.EmptyString     
        elif isinstance(obj, TrackObjectController):
            if col == 0:
                return wx.EmptyString 
            elif col == 1:
                try:
                    if obj.model.obj_tid:
                        ret = ObjectManager.get_tid_friendly_name(obj.model.obj_tid)
                        if ret:
                            return ret
                        return wx.EmptyString
                    else:
                        return 'Select...'
                except AttributeError:
                    print '\nERRO! O objeto nao possui model: ' + str(obj.uid) + '\n'
                    return ''
            elif col == 2:    
                om_obj = obj.get_object()
                if om_obj:
                    return om_obj.name
                return 'Select...' 
        else:
            raise RuntimeError("unknown node type")
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def GetValueFromEditorCtrl(self, editor):
        selected_index = editor.GetSelection()
        #print 'GetValueFromEditorCtrl:', selected_index
        if selected_index == -1:
            return True, wx.EmptyString
        self._value = editor.GetString(selected_index)
        self._value = ObjectManager.get_tid(self._value)
        return True, self._value
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def set_value(self, value):
        if value is None:
            self.control.SetValue(wx.EmptyString)
        else:
            self.control.SetValue(str(value))
项目:kicad_scripts    作者:NilujePerchut    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Teardrops", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.CAPTION|wx.CLOSE_BOX|wx.DEFAULT_DIALOG_STYLE )

        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )

        bvs_main = wx.BoxSizer( wx.VERTICAL )

        rbx_actionChoices = [ u"Set Teardrops", u"Remove All Teardrops" ]
        self.rbx_action = wx.RadioBox( self, wx.ID_ANY, u"Action", wx.DefaultPosition, wx.DefaultSize, rbx_actionChoices, 1, wx.RA_SPECIFY_ROWS )
        self.rbx_action.SetSelection( 0 )
        bvs_main.Add( self.rbx_action, 0, wx.ALL, 5 )

        gs_params = wx.GridSizer( 0, 2, 0, 0 )

        self.st_hpercent = wx.StaticText( self, wx.ID_ANY, u"Horizontal percent", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.st_hpercent.Wrap( -1 )
        gs_params.Add( self.st_hpercent, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )

        self.sp_hpercent = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 30 )
        gs_params.Add( self.sp_hpercent, 0, wx.ALL|wx.SHAPED, 5 )

        self.st_vpercent = wx.StaticText( self, wx.ID_ANY, u"Vertical percent", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.st_vpercent.Wrap( -1 )
        gs_params.Add( self.st_vpercent, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )

        self.sp_vpercent = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 70 )
        gs_params.Add( self.sp_vpercent, 0, wx.ALL|wx.SHAPED, 5 )

        self.st_nbseg = wx.StaticText( self, wx.ID_ANY, u"Number of segments", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.st_nbseg.Wrap( -1 )
        gs_params.Add( self.st_nbseg, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )

        self.sp_nbseg = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 100, 10 )
        gs_params.Add( self.sp_nbseg, 0, wx.ALL|wx.SHAPED, 5 )


        bvs_main.Add( gs_params, 1, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND|wx.SHAPED, 5 )

        bhs_modal = wx.BoxSizer( wx.HORIZONTAL )


        bhs_modal.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )

        self.but_cancel = wx.Button( self, wx.ID_ANY, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0 )
        bhs_modal.Add( self.but_cancel, 0, wx.ALIGN_RIGHT|wx.EXPAND, 5 )

        self.but_ok = wx.Button( self, wx.ID_ANY, u"Ok", wx.DefaultPosition, wx.DefaultSize, 0 )
        bhs_modal.Add( self.but_ok, 0, 0, 5 )


        bvs_main.Add( bhs_modal, 0, wx.EXPAND, 5 )


        self.SetSizer( bvs_main )
        self.Layout()
        bvs_main.Fit( self )

        self.Centre( wx.BOTH )
项目:JincinExamHelper    作者:Qinet    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(WebPanel, self).__init__(parent=parent)
        self.current_url = HOMEURL
        sizer = wx.BoxSizer(orient=wx.VERTICAL)
        btn_sizer = wx.BoxSizer(orient=wx.HORIZONTAL)
        self.web_view = webview.WebView.New(parent=self)
        self.Bind(event=webview.EVT_WEBVIEW_LOADED, handler=self.webview_loaded, source=self.web_view)
        self.Bind(event=webview.EVT_WEBVIEW_NEWWINDOW, handler=self.open_new_window, source=self.web_view)

        btn_home = wx.Button(parent=self, label=u"??", style=wx.BU_EXACTFIT)
        self.Bind(event=wx.EVT_BUTTON, handler=self.click_home_button, source=btn_home)
        btn_sizer.Add(item=btn_home, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2)

        btn_back_page = wx.Button(parent=self, label=u"<--", style=wx.BU_EXACTFIT)
        self.Bind(event=wx.EVT_BUTTON, handler=self.click_preview_page_button, source=btn_back_page)
        self.Bind(event=wx.EVT_UPDATE_UI, handler=self.check_can_goback, source=btn_back_page)
        btn_sizer.Add(item=btn_back_page, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2)

        btn_next_page = wx.Button(parent=self, label=u"-->", style=wx.BU_EXACTFIT)
        self.Bind(event=wx.EVT_BUTTON, handler=self.click_next_page_button, source=btn_next_page)
        self.Bind(event=wx.EVT_UPDATE_UI, handler=self.check_can_goforward, source=btn_next_page)
        btn_sizer.Add(item=btn_next_page, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2)

        btn_stop = wx.Button(parent=self, label=u"??", style=wx.BU_EXACTFIT)
        self.Bind(event=wx.EVT_BUTTON, handler=self.click_stop_button, source=btn_stop)
        btn_sizer.Add(item=btn_stop, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2)

        btn_refresh = wx.Button(parent=self, label=u"??", style=wx.BU_EXACTFIT)
        self.Bind(event=wx.EVT_BUTTON, handler=self.click_refresh_page_button, source=btn_refresh)
        btn_sizer.Add(btn_refresh, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2)

        url_bar_title = wx.StaticText(parent=self, label=u"??:")
        btn_sizer.Add(url_bar_title, proportion=CAN_NOT_CHANGE, flag=wx.CENTER | wx.ALL, border=2)

        self.location = wx.ComboBox(parent=self, value=wx.EmptyString, style=wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER)
        self.location.Bind(event=wx.EVT_TEXT_ENTER, handler=self.enter_location)
        self.Bind(event=wx.EVT_COMBOBOX, handler=self.select_location, source=self.location)
        btn_sizer.Add(item=self.location, proportion=CAN_CHANGE, flag=wx.EXPAND | wx.ALL, border=2)

        sizer.Add(item=btn_sizer, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND)
        sizer.Add(item=self.web_view, proportion=CAN_CHANGE, flag=wx.EXPAND)
        self.SetSizer(sizer=sizer)

        self.web_view.LoadURL(url=self.current_url)
项目:Turrican2Editor    作者:GitExl    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"About", pos = wx.DefaultPosition, size = wx.Size( 800,512 ), style = wx.DEFAULT_DIALOG_STYLE )

        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )

        Sizer = wx.BoxSizer( wx.VERTICAL )

        self.Panel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
        SizerC1 = wx.BoxSizer( wx.VERTICAL )

        SizerText = wx.BoxSizer( wx.VERTICAL )

        self.AppName = wx.StaticText( self.Panel, wx.ID_ANY, u"Turrican 2 Editor", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.AppName.Wrap( -1 )
        self.AppName.SetFont( wx.Font( wx.NORMAL_FONT.GetPointSize(), 70, 90, 92, False, wx.EmptyString ) )

        SizerText.Add( self.AppName, 0, wx.LEFT|wx.RIGHT|wx.TOP, 8 )

        self.AppVersion = wx.StaticText( self.Panel, wx.ID_ANY, u"Version 1.0.2", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.AppVersion.Wrap( -1 )
        SizerText.Add( self.AppVersion, 0, wx.BOTTOM|wx.LEFT|wx.RIGHT, 8 )

        self.License = wx.TextCtrl( self.Panel, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY|wx.NO_BORDER )
        self.License.SetFont( wx.Font( 9, 75, 90, 90, False, "Courier New" ) )
        self.License.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) )

        SizerText.Add( self.License, 1, wx.ALL|wx.EXPAND, 8 )


        SizerC1.Add( SizerText, 1, wx.EXPAND, 5 )

        SizerButton = wx.BoxSizer( wx.HORIZONTAL )


        SizerButton.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )

        self.Ok = wx.Button( self.Panel, wx.ID_ANY, u"Ok", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.Ok.SetDefault()
        SizerButton.Add( self.Ok, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )


        SizerC1.Add( SizerButton, 0, wx.EXPAND, 5 )


        self.Panel.SetSizer( SizerC1 )
        self.Panel.Layout()
        SizerC1.Fit( self.Panel )
        Sizer.Add( self.Panel, 1, wx.EXPAND |wx.ALL, 8 )


        self.SetSizer( Sizer )
        self.Layout()

        self.Centre( wx.BOTH )

        # Connect Events
        self.Ok.Bind( wx.EVT_BUTTON, self.ok )
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def __init__(self, parent=None):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY,
                            title = wx.EmptyString,
                            pos = wx.DefaultPosition,
                            size = wx.Size( -1,-1 ),
                            style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
        logopath = os.path.join(root_dir, 'data/logo.ico')
        self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
        self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
        self.SetSizeHints( wx.Size( 560,-1 ), wx.DefaultSize )
        WindowsManager.add(self)
        print('frame added')

        self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
        self.SetBackgroundColour( wx.Colour( 255, 255, 255 ) )

        sizer = wx.BoxSizer( wx.VERTICAL )
        self.txt_info = wx.StaticText( self, wx.ID_ANY,
                                       '500*500 pixels 173k',
                                       wx.DefaultPosition, wx.DefaultSize, 0 )
        self.txt_info.Wrap( -1 )
        sizer.Add( self.txt_info, 0, wx.ALL, 0 )

        self.canvas = Canvas(self)
        self.canvas.fit = self

        sizer.Add( self.canvas, 1, wx.EXPAND |wx.ALL, 0 )

        self.page = wx.ScrollBar( self, wx.ID_ANY,
                                  wx.DefaultPosition, wx.DefaultSize, wx.SB_HORIZONTAL)

        self.page.SetScrollbar(0,0,0,0, refresh=True)
        sizer.Add( self.page, 0, wx.ALL|wx.EXPAND, 0 )
        #self.page.Hide()
        self.SetSizer(sizer)
        self.Layout()

        self.Bind(wx.EVT_IDLE, self.on_idle)
        self.Bind(wx.EVT_SCROLL, self.on_scroll)
        self.Bind(wx.EVT_ACTIVATE, self.on_valid)
        self.Bind(wx.EVT_CLOSE, self.on_close)
        self.canvas.Bind(wx.EVT_CHAR, self.on_key)
        self.canvas.SetFocus()
        # panel.Bind(wx.EVT_CHAR, self.OnKeyDown)
        self.opage = 0
        self.Fit()

        self.SetAcceleratorTable(IPy.curapp.shortcut)
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Plugins Tree", 
                            pos = wx.DefaultPosition, size = wx.Size( 452,300 ), 
                            style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
        logopath = os.path.join(root_dir, 'data/logo.ico')
        self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
        self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
        self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
        bSizer1 = wx.BoxSizer( wx.HORIZONTAL )

        self.tre_plugins = wx.TreeCtrl( self, wx.ID_ANY, wx.DefaultPosition, 
                                        wx.DefaultSize, wx.TR_DEFAULT_STYLE )
        self.tre_plugins.SetMinSize( wx.Size( 200,-1 ) )

        bSizer1.Add( self.tre_plugins, 0, wx.ALL|wx.EXPAND, 5 )
        bSizer3 = wx.BoxSizer( wx.VERTICAL )
        bSizer4 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, "Plugin Infomation:",
                                            wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText2.Wrap( -1 )
        bSizer4.Add( self.m_staticText2, 0, wx.ALL, 5 )

        self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, "[SourceCode]", 
                                            wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText3.Wrap( -1 )
        self.m_staticText3.SetForegroundColour(
            wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )

        bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 )
        bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 )

        self.txt_info = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, 
                                     wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
        bSizer3.Add( self.txt_info, 1, wx.ALL|wx.EXPAND, 5 )


        bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
        self.SetSizer( bSizer1 )
        self.Layout()

        self.Centre( wx.BOTH )

        # Connect Events
        self.tre_plugins.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.on_run )
        self.tre_plugins.Bind( wx.EVT_TREE_SEL_CHANGED, self.on_select )
        self.m_staticText3.Bind( wx.EVT_LEFT_DOWN, self.on_source )
        self.plg = None
        self.load()
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def __init__( self, parent ):
        wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Tools Tree", 
                            pos = wx.DefaultPosition, size = wx.Size( 452,300 ), 
                            style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
        logopath = os.path.join(root_dir, 'data/logo.ico')
        self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
        self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
        self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
        bSizer1 = wx.BoxSizer( wx.HORIZONTAL )

        self.tre_plugins = wx.TreeCtrl( self, wx.ID_ANY, wx.DefaultPosition, 
                                        wx.DefaultSize, wx.TR_DEFAULT_STYLE )
        self.tre_plugins.SetMinSize( wx.Size( 200,-1 ) )

        bSizer1.Add( self.tre_plugins, 0, wx.ALL|wx.EXPAND, 5 )
        bSizer3 = wx.BoxSizer( wx.VERTICAL )
        bSizer4 = wx.BoxSizer( wx.HORIZONTAL )

        self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, "Tool Infomation:", 
                                            wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText2.Wrap( -1 )
        bSizer4.Add( self.m_staticText2, 0, wx.ALL, 5 )

        self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, "[SourceCode]", 
                                            wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText3.Wrap( -1 )
        self.m_staticText3.SetForegroundColour( 
            wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )

        bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 )
        bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 )

        self.txt_info = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, 
                                     wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
        bSizer3.Add( self.txt_info, 1, wx.ALL|wx.EXPAND, 5 )


        bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
        self.SetSizer( bSizer1 )
        self.Layout()

        self.Centre( wx.BOTH )

        # Connect Events
        self.tre_plugins.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.on_run )
        self.tre_plugins.Bind( wx.EVT_TREE_SEL_CHANGED, self.on_select )
        self.m_staticText3.Bind( wx.EVT_LEFT_DOWN, self.on_source )
        self.plg = None
        self.load()
项目:pywatch    作者:jackburridge    | 项目源码 | 文件源码
def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"Selection Frame", pos=wx.DefaultPosition,
                          size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)
        self.model = WatchableDict()
        self.model["selection"] = 1
        self.model["list"] = [u"One", u"Two", u"Three"]
        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        sizer = wx.BoxSizer(wx.VERTICAL)

        gb_sizer = wx.GridBagSizer(5, 5)
        gb_sizer.SetFlexibleDirection(wx.BOTH)
        gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        choices = []
        self.combo_box = wx.ComboBox(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize,
                                     choices, 0)
        gb_sizer.Add(self.combo_box, wx.GBPosition(0, 0), wx.GBSpan(1, 1), wx.EXPAND, 5)
        pywatch.wx.ItemContainerItemWatcher(self.combo_box, self.model, "list")
        pywatch.wx.SelectionChanger(self.combo_box, self.model, "selection")

        self.choice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choices, 0)
        self.choice.SetSelection(0)
        gb_sizer.Add(self.choice, wx.GBPosition(1, 0), wx.GBSpan(1, 1), wx.EXPAND, 5)
        pywatch.wx.ItemContainerItemWatcher(self.choice, self.model, "list")
        pywatch.wx.SelectionChanger(self.choice, self.model, "selection")

        self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choices, 0)
        gb_sizer.Add(self.list_box, wx.GBPosition(2, 0), wx.GBSpan(1, 1), wx.EXPAND, 5)
        pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "list")
        pywatch.wx.SelectionChanger(self.list_box, self.model, "selection")

        self.radio_box = wx.RadioBox(self, wx.ID_ANY, u"Radio Box", wx.DefaultPosition, wx.DefaultSize,
                                     [u"One", u"Two", u"Three"], 1, wx.RA_SPECIFY_COLS)
        self.radio_box.SetSelection(0)
        gb_sizer.Add(self.radio_box, wx.GBPosition(3, 0), wx.GBSpan(1, 1), wx.EXPAND, 5)
        pywatch.wx.SelectionChanger(self.radio_box, self.model, "selection")


        gb_sizer.AddGrowableCol(0)
        gb_sizer.AddGrowableRow(2)

        sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(sizer)
        self.Layout()

        self.Centre(wx.BOTH)
项目:pywatch    作者:jackburridge    | 项目源码 | 文件源码
def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"List Editor", pos=wx.DefaultPosition,
                          size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        sizer = wx.BoxSizer(wx.VERTICAL)

        gb_sizer = wx.GridBagSizer(5, 5)
        gb_sizer.SetFlexibleDirection(wx.BOTH)
        gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        list_boxChoices = []
        self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, list_boxChoices, 0)
        gb_sizer.Add(self.list_box, wx.GBPosition(0, 0), wx.GBSpan(1, 2), wx.EXPAND, 0)

        self.add_button = wx.Button(self, wx.ID_ANY, u"Add", wx.DefaultPosition, wx.DefaultSize, 0)
        gb_sizer.Add(self.add_button, wx.GBPosition(1, 0), wx.GBSpan(1, 1), wx.EXPAND, 0)

        self.remove_button = wx.Button(self, wx.ID_ANY, u"Remove", wx.DefaultPosition, wx.DefaultSize, 0)
        gb_sizer.Add(self.remove_button, wx.GBPosition(1, 1), wx.GBSpan(1, 1), wx.EXPAND, 0)

        self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0)
        gb_sizer.Add(self.text_ctrl, wx.GBPosition(2, 0), wx.GBSpan(1, 2), wx.EXPAND, 0)

        gb_sizer.AddGrowableCol(0)
        gb_sizer.AddGrowableCol(1)
        gb_sizer.AddGrowableRow(0)

        sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(sizer)
        self.Layout()

        self.Centre(wx.BOTH)

        self.add_button.Bind(wx.EVT_BUTTON, self.on_add)
        self.remove_button.Bind(wx.EVT_BUTTON, self.on_remove)

        self.model = WatchableDict()
        self.model["list"] = ["one", "two", "three", "four"]
        self.model["selection"] = 0

        pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "list")
        pywatch.wx.SelectionChanger(self.list_box, self.model, "selection")

        def getter():
            return self.model["list"][self.model["selection"]]

        def setter(value):
            self.model["list"][self.model["selection"]] = value

        pywatch.wx.ValueChanger(self.text_ctrl, self.model, ("list", "selection", setter, getter))
项目:pywatch    作者:jackburridge    | 项目源码 | 文件源码
def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"List Frame", pos=wx.DefaultPosition,
                          size=wx.Size(500, 300), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        sizer = wx.BoxSizer(wx.VERTICAL)

        gb_sizer = wx.GridBagSizer(5, 5)
        gb_sizer.SetFlexibleDirection(wx.BOTH)
        gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        list_boxChoices = []
        self.list_box = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, list_boxChoices, 0)
        gb_sizer.Add(self.list_box, wx.GBPosition(0, 0), wx.GBSpan(1, 2), wx.EXPAND, 0)

        combo_boxChoices = []
        self.combo_box = wx.ComboBox(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize,
                                     combo_boxChoices, 0)
        gb_sizer.Add(self.combo_box, wx.GBPosition(1, 0), wx.GBSpan(1, 2), wx.EXPAND, 0)

        choiceChoices = []
        self.choice = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choiceChoices, 0)
        self.choice.SetSelection(0)
        gb_sizer.Add(self.choice, wx.GBPosition(2, 0), wx.GBSpan(1, 2), wx.EXPAND, 0)

        self.text_ctrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize,
                                     wx.TE_PROCESS_ENTER)
        gb_sizer.Add(self.text_ctrl, wx.GBPosition(3, 0), wx.GBSpan(1, 1), wx.EXPAND, 0)

        self.button = wx.Button(self, wx.ID_ANY, u"Add", wx.DefaultPosition, wx.DefaultSize, 0)
        gb_sizer.Add(self.button, wx.GBPosition(3, 1), wx.GBSpan(1, 1), wx.ALL, 0)

        gb_sizer.AddGrowableCol(0)
        gb_sizer.AddGrowableRow(0)

        sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(sizer)
        self.Layout()

        self.Centre(wx.BOTH)

        # Connect Events
        self.button.Bind(wx.EVT_BUTTON, self.on_add)
        self.text_ctrl.Bind(wx.EVT_TEXT_ENTER, self.on_add)

        self.model = WatchableDict()
        self.model["list"] = []
        self.model["text"] = ""
        pywatch.wx.ValueChanger(self.text_ctrl, self.model, "text")
        pywatch.wx.ItemContainerItemWatcher(self.list_box, self.model, "list")
        pywatch.wx.ItemContainerItemWatcher(self.choice, self.model, "list")
        pywatch.wx.ItemContainerItemWatcher(self.combo_box, self.model, "list")

    # Virtual event handlers, overide them in your derived class
项目:pywatch    作者:jackburridge    | 项目源码 | 文件源码
def __init__(self, parent):
        wx.Frame.__init__(self, parent, title=u"Addition Frame")

        self.model = WatchableDict()
        self.model["a"] = 2
        self.model["b"] = 3

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        sizer = wx.BoxSizer(wx.VERTICAL)

        gb_sizer = wx.GridBagSizer(5, 5)
        gb_sizer.SetFlexibleDirection(wx.BOTH)
        gb_sizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        self.spin_ctrl_a = wx.SpinCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize,
                                       wx.SP_ARROW_KEYS, 0, 10, 0)
        gb_sizer.Add(self.spin_ctrl_a, wx.GBPosition(0, 0), wx.GBSpan(1, 1),
                     wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
        pywatch.wx.ValueChanger(self.spin_ctrl_a, self.model, "a")

        self.static_text = wx.StaticText(self, wx.ID_ANY, u"+", wx.DefaultPosition, wx.DefaultSize, 0)
        self.static_text.Wrap(-1)
        gb_sizer.Add(self.static_text, wx.GBPosition(0, 1), wx.GBSpan(1, 1),
                     wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.spin_ctrl_b = wx.SpinCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize,
                                       wx.SP_ARROW_KEYS, 0, 10, 0)
        gb_sizer.Add(self.spin_ctrl_b, wx.GBPosition(0, 2), wx.GBSpan(1, 1),
                     wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
        pywatch.wx.ValueChanger(self.spin_ctrl_b, self.model, "b")

        self.static_text_out = wx.StaticText(self, wx.ID_ANY, u"{}", wx.DefaultPosition, wx.DefaultSize, 0)
        self.static_text_out.Wrap(-1)
        gb_sizer.Add(self.static_text_out, wx.GBPosition(1, 0), wx.GBSpan(1, 3),
                     wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 5)
        pywatch.wx.LabelWatcher(self.static_text_out, self.model, ("a", "b", lambda: self.model["a"] + self.model["b"]))

        self.gauge = wx.Gauge(self, wx.ID_ANY, 20, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL)
        self.gauge.SetValue(0)
        gb_sizer.Add(self.gauge, wx.GBPosition(2, 0), wx.GBSpan(1, 3),
                     wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 0)
        pywatch.wx.ValueWatcher(self.gauge, self.model, ("a", "b", lambda: self.model["a"] + self.model["b"]))

        gb_sizer.AddGrowableCol(0)
        gb_sizer.AddGrowableCol(2)

        sizer.Add(gb_sizer, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(sizer)
        self.Layout()

        self.Centre(wx.BOTH)