wxpython 5.1 待重构的一串代码 RefactorExample

#!/usr/bin/env python
#-*- coding:utf-8 -*-

import wx
 
class RefactorExample(wx.Frame):
    
    def __init__(self,parent,id):
        wx.Frame.__init__(self,parent,id,'ReFactor Example',
                          size=(340,200))
        panel=wx.Panel(self,-1)
        panel.SetBackgroundColour("While")
        prevButton=wx.Button(panel,-1,"<<PREV",pos=(80,0))
        self.Bind(wx.EVT_BUTTON,self.OnPrev,prevButton)
        nextButton=wx.Button(panel,-1,"NEXT>>",pos=(160,0))
        self.Bind(wx.EVT_BUTTON,self.OnNext,nextButton)
        self.Bind(wx.EVT_CLOSE,self.OnCloseWindow)
        
        menuBar=wx.MenuBar()
        menu1=wx.Menu()
        openMenuItem=menu1.Append(-1,"&Open","Copy in status bar")
        self.Bind(wx.EVT_MENU,self.OnOpen,openMenuItem)
        quitMenuItem=menu1.Append(-1,"&quit","quit")
        self.Bind(wx.EVT_MENU,self.OnCloseWindow,quitMenuItem)
        menuBar.Append(menu1,"&File")
        menu2=wx.Menu()
        copyItem=menu2.Append(-1,"&Copy","Copy")
        self.Bind(wx.EVT_MENU,self.OnCopy,copyItem)
        cutItem=menu2.Append(-1,"C&ut","Cut")
        self.Bind(wx.EVT_MENU,self.OnCut,cutItem)
        pasteItem=menu2.Append(-1,"Paste","Paste")
        self.Bind(wx.EVT_MENU,self.OnPaste,pasteItem)
        menuBar.Append(menu2,"&Edit")
        self.SetMenuBar(menuBar)
        
        static=wx.StaticText(panel,wx.NewId(),"First None",
                             pos=(10,50))
        static.SetBackgroundColour("White")
        text=wx.TextCtrl(panel,wx.NewId(),"",size=(100,-1),
                         pos=(80,50))
        
        static2=wx.StaticText(panel,wx.NewId(),"Last Name",
                              pos=(10,80))
        static2.SetBackgroundColour("White")
        text2=wx.TextCtrl(panel,wx.NewId(),"",size=(100,-1),
                          pos=(80,80))
        
        firstButton=wx.Button(panel,-1,"FIRST")
        self.Bind(wx.EVT_BUTTON,self.OnFirst,firstButton)
        
        menu2.AppendSeparator()
        optItem=menu2.Append(-1,"&Option...","Display Options")
        self.Bind(wx.EVT_MENU,self.OnOptions,optItem)
        
        lastButton=wx.Button(panel,-1,"LAST",pos=(240,0))
        self.Bind(wx.EVT_BUTTON,self.OnLast,lastButton)
        
        
    def OnPrev(self,event):pass
    def OnNext(self,event):pass
    def OnLast(self,event):pass
    def OnFirst(self,event):pass
    def OnOpen(self,event):pass
    def OnCopy(self,event):pass
    def OnCut(self,event):pass
    def OnPaste(self,event):pass
    def OnOptions(self,event):pass
        
    def OnCloseWindow(self,event):
        self.Destroy()
            
if __name__=='__main__':
    app=wx.PySimpleApp()
    frame=RefactorExample(parent=None,id=-1)
    frame.Show()
    app.MainLoop()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值