Exemplo n.º 1
0
def CreateWidgets():

    WindowPanel = PyQT4_API.myWindow('AnyGUI Login Form', 300, 300, 500, 300)
    userLbl = PyQT4_API.Label("User Name :", 250, 50, 80, 30, WindowPanel)
    PswdLbl = PyQT4_API.Label("Password :"******"Not Registered User : ?", 120, 220, 170, 30,
                                 WindowPanel)
    AdmLabel = PyQT4_API.Label("Administrator :", 300, 20, 140, 30,
                               WindowPanel)
    CrctPswdLbl = PyQT4_API.Label("", 220, 160, 280, 30, WindowPanel)
    RadioLbl = PyQT4_API.Label("Choose ToolKit to Work With", 20, 15, 160, 30,
                               WindowPanel)
    usrtb = PyQT4_API.TextBox("", 340, 55, 150, 20, WindowPanel)
    Pstb = PyQT4_API.PasswordBox("", 340, 85, 150, 20, WindowPanel)
    rb1 = PyQT4_API.RadioButton("PyQT4", 20, 50, 100, 20, WindowPanel)
    rb1.setChecked(True)
    rb2 = PyQT4_API.RadioButton("Wx-Python", 20, 70, 100, 20, WindowPanel)
    rb3 = PyQT4_API.RadioButton("PyGTK", 20, 90, 100, 20, WindowPanel)
    rb4 = PyQT4_API.RadioButton("Tkinter", 20, 110, 100, 20, WindowPanel)
    rbgrp = PyQT4_API.ButtonGroup(WindowPanel)
    rlist = [rb1, rb2, rb3, rb4]
    rbgrp.addButtons(rlist)
    widgets = [WindowPanel, usrtb, Pstb, rbgrp, CrctPswdLbl]
    guest_btn = PyQT4_API.Button("Guest Login", 280, 220, 100, 35, WindowPanel)
    guest_btn.buttonListener(guest_log, widgets)
    btn = PyQT4_API.Button("Login", 320, 120, 100, 35, WindowPanel)
    btn.buttonListener(login_method, widgets)
    WindowPanel.Show()
Exemplo n.º 2
0
def CreateWidgets():

		
        
        WindowPanel = PyQT4_API.myWindow('PyQT4 Window By Santosh Kumar' ,300,100,520,450)
#        menubr=PyQT4_API.MenuBar(0,0,500,20,WindowPanel)
 #       menu_list=[['&File','&Exit',exit_method],['&About','&About Me',aboutMe_method]]
        userLbl=PyQT4_API.Label("User Name :",20,25,80,30,WindowPanel)
        PswdLbl=PyQT4_API.Label("Password",20,50,140,30,WindowPanel)
        RadioLbl=PyQT4_API.Label("Your Favourite Tool-Kit",350,15,160,30,WindowPanel)
        ComboLbl=PyQT4_API.Label("Your City",40,300,160,30,WindowPanel)
        ListLbl=PyQT4_API.Label("Your Favourite Animal",300,300,360,30,WindowPanel)        
        BirthLbl=PyQT4_API.Label("Your Birth Date",20,170,120,30,WindowPanel)
        RateLbl=PyQT4_API.Label("Please rate the GUI on (0-10) scale",20,370,220,30,WindowPanel)
        usrtb=PyQT4_API.TextBox("",150,30,150,20,WindowPanel)
        Pstb=PyQT4_API.PasswordBox("",150,55,150,20,WindowPanel)
        '''NewPstb=PyQT4_API.PasswordBox("",150,85,150,30,WindowPanel)
        ReNewPstb=PyQT4_API.PasswordBox("",150,120,150,30,WindowPanel)
'''
        ck1=PyQT4_API.CheckBox("I Love Animals ",20,45,150,110,WindowPanel)
        ck1.setCheckState(0)
        '''ck2=PyQT4_API.CheckBox("I Love Birds ",150,45,150,110,WindowPanel)
        ck2.setCheckState(2)
        ckBox= PyQT4_API.ButtonGroup(WindowPanel)'''
        #ckBox.addButtons([ck1,ck2])
        rb1=PyQT4_API.RadioButton("PyQT4",360,40,100,20,WindowPanel)
        rb1.setChecked(True)
        rb2=PyQT4_API.RadioButton("Wx-Python",360,60,100,20,WindowPanel)
        rb3=PyQT4_API.RadioButton("PyGTK",360,80,100,20,WindowPanel)
        rb4=PyQT4_API.RadioButton("Tkinter",360,100,100,20,WindowPanel)
        rbgrp=PyQT4_API.ButtonGroup(WindowPanel)
        rlist=[rb1,rb2,rb3,rb4]
        rbgrp.addButtons(rlist)
       # print (rbgrp.getCheck())
        cal1=PyQT4_API.Calendar(240,140,240,140,WindowPanel)  
        sld1=PyQT4_API.Slider(300,380,180,20,WindowPanel)
        sld1.setRange(0,10)
        comboList= ["Lucknow","Ahmedabad","Ropar","Mumbai","Muzaffarpur","NewDelhi","Chandigarh"]
        comboBox=PyQT4_API.ComboBox("My Combo Box",comboList,20,330,180,30,WindowPanel)
        listBox=PyQT4_API.ListBox("My List Box",300,330,180,30,WindowPanel)
        myList=["Elephant","Peacock","Bear","Lion","Tiger","Leopard","Dog","Cat","Wolf","Spider","Parrot","Nightangle"]
        listBox.addItems(myList)
        widgets=[WindowPanel,usrtb,Pstb,ck1,rbgrp,cal1,sld1,listBox,comboBox]
#        menubr.addItems(menu_list,widgets);
        btn= PyQT4_API.Button("Submit",100,415,100,30,WindowPanel)
        btn.buttonListener(call_method,widgets)
        Exit_btn= PyQT4_API.Button("Exit",300,415,100,30,WindowPanel)
        Exit_btn.buttonListener(exit_method)
        WindowPanel.show()