コード例 #1
0
    def test_lib_agw_aquabuttonCtor(self):

        # Initialize AquaButton 1 (with image)
        bitmap = wx.Bitmap(pngFile, wx.BITMAP_TYPE_PNG)
        btn1 = AB.AquaButton(self.frame, -1, bitmap, "AquaButton")
        # Initialize AquaButton 2 (no image)
        btn2 = AB.AquaButton(self.frame, -1, None, "Hello World!")

        btn3 = AB.AquaToggleButton(self.frame, -1, None, 'Toggle')
コード例 #2
0
    def add_button(self,
                   message: str,
                   position: tuple,
                   size: tuple,
                   button_type: str = None,
                   color: str = None,
                   action: str = 'default') -> None:
        """Add Button."""
        # Button Type
        if button_type == 'gradient_button':
            btn = GB.GradientButton(self.panel,
                                    label=message,
                                    pos=position,
                                    size=size)
        elif button_type == 'aqua_button':
            btn = AB.AquaButton(self.panel,
                                label=message,
                                pos=position,
                                size=size)
        else:
            btn = buttons.GenButton(self.panel,
                                    label=message,
                                    pos=position,
                                    size=size)

            # You can really only set colors with GenButtons as the others
            #  use native widgets!
            if color:
                btn.SetBackgroundColour(color)

        # Attach Custom Actions
        self.bind_action(action, btn)

        self.buttons.append(btn)
コード例 #3
0
    def createButtons(self, parent, frame):
        for i in range(0, len(parent.cards.JSON)):
            buttonText = wordwrap(parent.cards.JSON[i]['question'],
                                  250,
                                  wx.ClientDC(self),
                                  breakLongWords=True,
                                  margin=0)
            buttonText = trimText(buttonText, 14)
            parent.button = AB.AquaButton(self,
                                          label=buttonText,
                                          name=str(i),
                                          size=(220, 170),
                                          id=i)
            parent.button.SetFont(wx.Font(6, wx.SWISS, wx.NORMAL, wx.BOLD))
            if i == 0:
                parent.button.SetBackgroundColour('#007db1')
            else:
                parent.button.SetBackgroundColour('#044059')
            parent.button.SetForegroundColour("black")
            parent.button.SetHoverColour('#C3E6F3')
            parent.button.Bind(
                wx.EVT_BUTTON,
                lambda event: self.selectButtonClick(event, parent, frame))
            parent.button.SetPulseOnFocus(True)

            parent.button.SetPulseOnFocus(False)
            self.sizer.Add(parent.button, 0, wx.CENTER | wx.ALL, 5)
コード例 #4
0
ファイル: wx_test.py プロジェクト: litian6363/learn_and_test
    def __init__(self, parent):
        """"""
        wx.Panel.__init__(self, parent, -1)
        self.SetBackgroundColour(wx.Colour(0, 255, 255))

        box = wx.BoxSizer(wx.VERTICAL)  # 设置上下方式的布局
        font = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.NORMAL)
        # 按钮数据
        self.date = {
            "IE6": "./rdp/IE6.rdp",
            "IE7": "./rdp/IE7.rdp",
            "IE8": "./rdp/IE8.rdp",
            "IE9": "./rdp/IE9.rdp",
            "IE10": "./rdp/IE10.rdp",
            "32IE11": "./rdp/win32IE11.rdp",
            "64IE11": "./rdp/win64IE11.rdp"
        }
        # 循环输出按钮
        self.buttonid = {}
        for buttonname in self.date:  # 循环输出按钮,颜色随机

            r = random.randint(0, 255)
            g = random.randint(0, 255)
            b = random.randint(0, 255)

            btn = AB.AquaButton(self, -1, None, buttonname)
            box.Add(btn, 1, wx.EXPAND | wx.EAST | wx.WEST, 5)
            btn.SetBackgroundColor(wx.Colour(r, g, b))
            btn.SetHoverColor(wx.Colour(g, r, b))
            btn.SetForegroundColour("black")
            btn.SetFont(font)
            self.Bind(wx.EVT_BUTTON, self.OnClick, btn)  # 绑定连接远程机器的事件
            self.buttonid[btn.GetId()] = buttonname
        self.SetSizer(box)
コード例 #5
0
    def test_lib_agw_aquabuttonMethods(self):
        # Initialize AquaButton 2 (no image)
        btn2 = AB.AquaButton(self.frame, -1, None, "Hello World!")

        bitmap = wx.Bitmap(pngFile, wx.BITMAP_TYPE_PNG)
        btn2.SetBitmapLabel(bitmap)

        btn2.SetPulseOnFocus(True)
        self.assertTrue(btn2.GetPulseOnFocus())

        btn2.SetShadowColour(wx.Colour('grey'))
        btn2.SetRectColour(wx.WHITE)
        btn2.SetHoverColour(wx.BLACK)

        btn3 = AB.AquaToggleButton(self.frame, -1, None, 'Toggle')
        btn3.SetToggle(True)
        self.assertTrue(btn3.GetToggle())
コード例 #6
0
    def __init__(self):   
        self.flag = 0	
        wx.Frame.__init__(self, None, -1, 'Jbrew Controller',
                          wx.DefaultPosition, size=wx.DisplaySize(),
                          style=wx.DEFAULT_FRAME_STYLE | 
                         wx.NO_FULL_REPAINT_ON_RESIZE)   
        
        '''self.bmp = wx.Image("hops.png", wx.BITMAP_TYPE_PNG).ConvertToBitmap()'''
        
        self.set_time = 0
        self.timer = None
        self.received_temp = ''
        self.rex_mlt = re.compile('m[0-9][0-9]\.[0-9][0-9]|m[0-2][0-9][0-9]\.[0-9][0-9]')
        self.rex_hlt = re.compile('h[0-9][0-9]\.[0-9][0-9]|h[0-2][0-9][0-9]\.[0-9][0-9]')
	self.rex_he = re.compile('HE[0-9]')
	self.temp1 = 0
        self.temp2 = 0
        self.number = 0
        menubar = wx.MenuBar()
        file = wx.Menu()
        file.Append(22, 'Change Brew', 'Change Title of Brew')
        file.Append(23, 'About', 'About dialog')
        menubar.Append(file, '&File')
    
        self.SetMenuBar(menubar)
        wx.EVT_MENU(self, 22, self.OnChangeBrew)
        wx.EVT_MENU(self, 23, self.OnAboutDialog)
        
        self.panel1 = wx.Panel(self, -1, style=wx.SUNKEN_BORDER)
        self.panel2 = wx.Panel(self, -1, style=wx.RAISED_BORDER)
        self.panel1.SetBackgroundColour("black")
                
        self.panel3 = wx.Panel(self.panel2, -1, style=wx.SUNKEN_BORDER)
        self.panel4 = wx.Panel(self.panel2, -1, style=wx.RAISED_BORDER)
        self.panel3.SetBackgroundColour("black")
        self.panel4.SetBackgroundColour("black")
        self.panel5 = wx.Panel(self.panel3, -1)
        self.panel6 = wx.Panel(self.panel3, -1)
        self.panel7 = wx.Panel(self.panel3, -1)
        self.panel5.SetBackgroundColour("black")
        self.panel6.SetBackgroundColour("yellow")
        self.panel7.SetBackgroundColour("green")
        
        #Bottom section with clock
        self.panel8 = wx.Panel(self.panel7, -1)
        self.panel9 = wx.Panel(self.panel7, -1)
        self.panel10 = wx.Panel(self.panel7, -1)
        
        self.panel8.SetBackgroundColour("black")
        self.panel9.SetBackgroundColour("black")
        self.panel10.SetBackgroundColour("black")
        '''self.panel10.SetBackgroundColour(None)'''
             
        self.brew_st = wx.StaticText(self.panel1, -1, "BREW: Hoptimistic", (10, 20))
        self.mash_st = wx.StaticText(self.panel5, -1, "MASH MONITOR", (10, 10))
        self.pump_stat_st = wx.StaticText(self.panel8, -1, "PUMP 1 STATUS:", (10, 0))
        self.pump2_stat_st = wx.StaticText(self.panel8, -1, "PUMP 2 STATUS:", (10, 30))
        self.controls_st = wx.StaticText(self.panel4, -1, "CONTROLS", (5, 5))
        self.pump_control = wx.StaticText(self.panel4, -1, "Pump 1", (10, 70))
        self.pump_control2 = wx.StaticText(self.panel4, -1, "Pump 2", (10, 140))
        self.pump_toggle = wx.StaticText(self.panel8, -1, "Off", (240, 0))
        self.pump2_toggle = wx.StaticText(self.panel8, -1, "Off", (240, 30))
        self.he_result = wx.StaticText(self.panel8, -1, "Off", (275, 60))
        self.he_status = wx.StaticText(self.panel8, -1, "HEATING ELEMENT:", (10, 60))
        self.st_temp = wx.StaticText(self.panel4, -1, "Set Target", (10, 235)) 
        self.st_deg = wx.StaticText(self.panel4, -1, "°F", (75, 270))
        self.tc_entry = wx.TextCtrl(self.panel4, -1, "152", (10, 265), (60, 30))
        self.tc_time = wx.TextCtrl(self.panel4, -1, "60", (10, 400), (60, 30))
        self.st_secs = wx.StaticText(self.panel4, -1, "mins", (75, 405))
              
        self.tc_entry.SetMaxLength(3)
        self.tc_entry.SetWindowStyleFlag(wx.TE_RIGHT)
        self.tc_entry.Bind(wx.EVT_LEFT_DOWN, self.OnTempEntry)
        self.tc_time.SetMaxLength(2)
        self.tc_time.SetWindowStyleFlag(wx.TE_RIGHT)
        #self.tc_time.Bind(wx.EVT_CHAR, self.OnTimerEntry)
        self.tc_time.Bind(wx.EVT_LEFT_DOWN, self.OnTimerEntry)
        
        font = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.BOLD)
        self.brew_st.SetFont(font)
        self.mash_st.SetFont(font)
        self.pump_stat_st.SetFont(font)
        self.pump2_stat_st.SetFont(font)
        self.he_status.SetFont(font)
        font = wx.Font(16, wx.DECORATIVE, wx.ITALIC, wx.BOLD)
        self.controls_st.SetFont(font)
        font = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.BOLD)
        self.he_result.SetFont(font)
        self.pump_toggle.SetFont(font)
        self.pump2_toggle.SetFont(font)
        font = wx.Font(16, wx.DEFAULT, wx.DEFAULT, wx.BOLD)
        self.pump_control.SetFont(font)
        self.pump_control2.SetFont(font)
        self.st_temp.SetFont(font)
        self.st_deg.SetFont(font)
        self.tc_entry.SetFont(font)
        self.tc_time.SetFont(font)
        self.st_secs.SetFont(font)
        self.brew_st.SetForegroundColour("yellow")
        self.mash_st.SetForegroundColour("yellow")
        self.controls_st.SetForegroundColour("yellow")
        self.pump_stat_st.SetForegroundColour("orange")
        self.pump2_stat_st.SetForegroundColour("orange")
        self.pump_control.SetForegroundColour("yellow")
        self.pump_control2.SetForegroundColour("yellow")
        self.pump_toggle.SetForegroundColour("red")
        self.pump2_toggle.SetForegroundColour("red")
        self.he_status.SetForegroundColour("orange")
        self.he_result.SetForegroundColour("red")
        self.st_temp.SetForegroundColour("yellow")
        self.st_deg.SetForegroundColour("yellow")
        self.st_secs.SetForegroundColour("yellow")
        bs = wx.BoxSizer(wx.VERTICAL)
        bs.Add(self.panel1, 1, wx.EXPAND)
        bs.Add(self.panel2, 10, wx.EXPAND)
        self.SetSizer(bs)
             
        font = wx.Font(18, wx.DEFAULT, wx.DEFAULT, wx.BOLD)
        
        self.pump_off = 1
        pump_btn = ab.AquaButton(self.panel4, -1, label="On/Off", size=(130, 40), pos=(10, 100))
        pump_btn.SetFont(font)
        pump_btn.SetForegroundColour("black")
        pump_btn.SetBackgroundColor("blue")
        pump_btn.Bind(wx.EVT_BUTTON, self.OnPump)
        
        self.pump2_off = 1
        pump_btn2 = ab.AquaButton(self.panel4, -1, label="On/Off", size=(130, 40), pos=(10, 170))
        pump_btn2.SetFont(font)
        pump_btn2.SetForegroundColour("black")
        pump_btn2.SetBackgroundColor("blue")
        pump_btn2.Bind(wx.EVT_BUTTON, self.OnPump2)
        
        #this is the temperature set button 
        hlt_btn = ab.AquaButton(self.panel4, -1, label="Start", size=(70, 40), pos=(5,300))
        hlt_btn.SetFont(font)
        hlt_btn.SetForegroundColour("black")
        hlt_btn.SetBackgroundColor("blue")
        hlt_btn.Bind(wx.EVT_BUTTON, self.OnSetTemp)
        hlt_btn2 = ab.AquaButton(self.panel4, -1, label="Stop", size=(70, 40), pos=(75,300))
        hlt_btn2.SetFont(font)
        hlt_btn2.SetForegroundColour("black")
        hlt_btn2.SetBackgroundColor("blue")
        hlt_btn2.Bind(wx.EVT_BUTTON, self.OnStopTemp)
        #button that starts the mashing timer 
        ele_btn = ab.AquaButton(self.panel4, -1, label="Start", size=(70, 40), pos=(5, 445))
        ele_btn.SetFont(font)
        ele_btn.SetForegroundColour("black")
        ele_btn.SetBackgroundColor("blue")
        ele_btn.Bind(wx.EVT_BUTTON, self.OnStart)

        #button that stops the mashing timer 
        ele_btn = ab.AquaButton(self.panel4, -1, label="Stop", size=(70, 40), pos=(75, 445))
        ele_btn.SetFont(font)
        ele_btn.SetForegroundColour("black")
        ele_btn.SetBackgroundColor("blue")
        ele_btn.Bind(wx.EVT_BUTTON, self.OnStop)
        
        #button that resets the timer  
        ele_btn = ab.AquaButton(self.panel4, -1, label="Reset", size=(140, 40), pos=(5, 490))
        ele_btn.SetFont(font)
        ele_btn.SetForegroundColour("black")
        ele_btn.SetBackgroundColor("blue")
        ele_btn.Bind(wx.EVT_BUTTON, self.OnReset)
                
        bs_bottom = wx.BoxSizer(wx.HORIZONTAL)
        bs_bottom.Add(self.panel3, 8, wx.EXPAND)
        bs_bottom.Add(self.panel4, 1, wx.EXPAND)
        self.panel2.SetSizer(bs_bottom)
        
        self.mash_meter = sm.SpeedMeter(self.panel6, extrastyle=sm.SM_DRAW_SECTORS | sm.SM_DRAW_HAND 
                                        | sm.SM_DRAW_SECONDARY_TICKS | sm.SM_DRAW_MIDDLE_TEXT
					| sm.SM_DRAW_SPEED_READING)
        # Set The Region Of Existence Of SpeedMeter (Always In Radians!!!!)
        #self.mash_meter.SetAngleRange(-pi/6, 7*pi/6)
        self.mash_meter.SetAngleRange(-pi / 3, 4 * pi / 3)
        # Create The Intervals That Will Divide Our SpeedMeter In Sectors        
        intervals = range(0, 221, 20)
        self.mash_meter.SetIntervals(intervals)

        # Assign The Same Colours To All Sectors (We Simulate A Car Control For Speed)
        # Usually This Is Black
        colours = [wx.BLACK] * 11
        self.mash_meter.SetIntervalColours(colours)

        # Assign The Ticks: Here They Are Simply The String Equivalent Of The Intervals
        ticks = [str(interval) for interval in intervals]
        self.mash_meter.SetTicks(ticks)
        # Set The Ticks/Tick Markers Colour
        self.mash_meter.SetTicksColour(wx.Colour(255, 255, 0))
        # We Want To Draw 5 Secondary Ticks Between The Principal Ticks
        self.mash_meter.SetNumberOfSecondaryTicks(3)

        # Set The Font For The Ticks Markers
        self.mash_meter.SetTicksFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL))

        # Set The Text In The Center Of SpeedMeter
        self.mash_meter.SetMiddleText("Mash Temp")
        # Assign The Colour To The Center Text
        self.mash_meter.SetMiddleTextColour(wx.WHITE)
        # Assign A Font To The Center Text
        self.mash_meter.SetMiddleTextFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD))
        # Set The Default Speed Reading 
        self.mash_meter.SetSpeedReading(self.mash_meter.GetSpeedValue())
        # Assign The Font to the Speed Reading
        self.mash_meter.SetSpeedReadingFont(wx.Font(22, wx.SWISS, wx.NORMAL, wx.BOLD))
        # Assign The Color to the Speed Reading
        self.mash_meter.SetSpeedReadingColour(wx.WHITE)
        # Set The Colour For The Hand Indicator
        self.mash_meter.SetHandColour(wx.Colour(255, 50, 0))

        # Do Not Draw The External (Container) Arc. Drawing The External Arc May
        # Sometimes Create Uglier Controls. Try To Comment This Line And See It
        # For Yourself!
        self.mash_meter.DrawExternalArc(True)
        
        self.mash_meter.SetSpeedValue(100)
        
        self.hlt_meter = sm.SpeedMeter(self.panel6, extrastyle=sm.SM_DRAW_SECTORS | sm.SM_DRAW_HAND 
                                        | sm.SM_DRAW_SECONDARY_TICKS | sm.SM_DRAW_MIDDLE_TEXT
					| sm.SM_DRAW_SPEED_READING)
        # Set The Region Of Existence Of SpeedMeter (Always In Radians!!!!)
        #self.hlt_meter.SetAngleRange(-pi/6, 7*pi/6)
        self.hlt_meter.SetAngleRange(-pi / 3, 4 * pi / 3)
        # Create The Intervals That Will Divide Our SpeedMeter In Sectors        
        intervals = range(0, 221, 20)
        self.hlt_meter.SetIntervals(intervals)

        # Assign The Same Colours To All Sectors (We Simulate A Car Control For Speed)
        # Usually This Is Black
        colours = [wx.BLACK] * 11
        self.hlt_meter.SetIntervalColours(colours)

        # Assign The Ticks: Here frameThey Are Simply The String Equivalent Of The Intervals
        ticks = [str(interval) for interval in intervals]
        self.hlt_meter.SetTicks(ticks)
        # Set The Ticks/Tick Markers Colour
        self.hlt_meter.SetTicksColour(wx.Colour(255, 255, 0))
        # We Want To Draw 5 Secondary Ticks Between The Principal Ticks
        self.hlt_meter.SetNumberOfSecondaryTicks(3)

        # Set The Font For The Ticks Markers
        self.hlt_meter.SetTicksFont(wx.Font(16, wx.SWISS, wx.NORMAL, wx.NORMAL))

        # Set The Text In The Center Of SpeedMeter
        self.hlt_meter.SetMiddleText("HLT")
        # Assign The Colour To The Center Text
        self.hlt_meter.SetMiddleTextColour(wx.WHITE)
        # Assign A Font To The Center Text
        self.hlt_meter.SetMiddleTextFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD))

        # Set The Default Speed Reading 
        self.mash_meter.SetSpeedReading(self.mash_meter.GetSpeedValue())
        
        # Assign The Color to the Speed Reading
        self.hlt_meter.SetSpeedReading(self.mash_meter.GetSpeedValue())
        
        # Assign The Font to the Speed Reading
        self.hlt_meter.SetSpeedReadingFont(wx.Font(22, wx.SWISS, wx.NORMAL, wx.BOLD))
        
        # Assign The Color to the Speed Reading
        self.hlt_meter.SetSpeedReadingColour(wx.WHITE)
        
        # Set The Colour For The Hand Indicator
        self.hlt_meter.SetHandColour(wx.Colour(255, 50, 0))
        
        # Do Not Draw The External (Container) Arc. Drawing The External Arc May
        # Sometimes Create Uglier Controls. Try To Comment This Line And See It
        # For Yourself!
        self.hlt_meter.DrawExternalArc(True)

        # Set The Current Value For The SpeedMeter
        self.hlt_meter.SetSpeedValue(100)
        bs_meters = wx.BoxSizer(wx.VERTICAL)
        bs_meters.Add(self.panel5, 0, wx.EXPAND)
        bs_meters.Add(self.panel6, 8, wx.EXPAND)
        bs_meters.Add(self.panel7, 2, wx.EXPAND)
        self.panel3.SetSizer(bs_meters)
        
        hbs_meters = wx.BoxSizer(wx.HORIZONTAL)
        hbs_meters.Add(self.mash_meter, 1, wx.EXPAND)
        hbs_meters.Add(self.hlt_meter, 1, wx.EXPAND)
        self.panel6.SetSizer(hbs_meters)
        
        #begin led timer section
        self.led = gizmos.LEDNumberCtrl(self.panel9, -1, (100, 0), (200, 50), gizmos.LED_ALIGN_CENTER)
        #self.OnTimer(None)
        self.led.SetValue("00:00:00")
        #self.Bind(wx.EVT_TIMER, self.OnTimer)
        self.Centre()
        #end led timer
        '''wx.EVT_PAINT(self.panel10, self.OnBmp)'''
            
        bs_timer = wx.BoxSizer(wx.HORIZONTAL)
        bs_timer.Add(self.panel8, 1, wx.EXPAND)
        bs_timer.Add(self.panel9, 1, wx.EXPAND)
        bs_timer.Add(self.panel10, 1, wx.EXPAND)
        self.panel7.SetSizer(bs_timer)
        wx.CallAfter(self.OnInitialOpen)
コード例 #7
0
	def Elementos(self):
		header= wx.Panel(self,-1,size=(1200,120),pos=(0,0))
		header.SetBackgroundColour('#6E7B99')
	
		titulo = wx.StaticText(header, wx.ID_ANY, "Efenergy", style=wx.ALIGN_CENTER, pos=(150,25))
		font = wx.Font(40, wx.ROMAN, wx.ITALIC, wx.NORMAL)
		titulo.SetFont(font)

		
		bmp1 = wx.Image(logotipo1, wx.BITMAP_TYPE_ANY).ConvertToBitmap() 
		self.bitmap1 = wx.StaticBitmap(header, -1, bmp1, (30,10))

		txt_seleccion_dia = wx.StaticText(self.panel, -1, "Día: ", pos=(520,30))
		txt_seleccion_estado_voltaje = wx.StaticText(self.panel, wx.ID_ANY,  "Voltaje: ", pos=(520,65))
		txt_seleccion_fase = wx.StaticText(self.panel, wx.ID_ANY,  "Fase: ", pos=(520,95))
		
		#-------------------------------------------------------------------------------------------------	

		dias = self.archivo_excel.sheet_names
		self.choice = wx.Choice(self.panel, choices = dias, pos=(620, 30))
		self.choice.SetSelection(0)	
		
		reglas = ["MAYOR","MENOR"]
		self.reglas_potencia = wx.Choice(self.panel, choices = reglas, pos=(620, 65),size=(100,26))
		self.reglas_potencia.SetSelection(0)	

		lista_fase = ["A", "B", "C"]
		self.Fase = wx.Choice(self.panel, choices = lista_fase, pos=(620, 95),size=(100,26))
		self.Fase.SetSelection(0)	
		
		# -------------------------------------------------------------------------------------------------	
		
		icon_seleccionar_dia = 'imagenes/calendario.png'
		bmp1 = wx.Image(icon_seleccionar_dia, wx.BITMAP_TYPE_ANY).ConvertToBitmap() 
		self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (585, 30))

		icon_estado_voltaje = 'imagenes/potencia1.png'
		bmp1 = wx.Image(icon_estado_voltaje, wx.BITMAP_TYPE_ANY).ConvertToBitmap() 
		self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (585, 65))

		icon_fase = 'imagenes/fase.png'
		bmp1 = wx.Image(icon_fase, wx.BITMAP_TYPE_ANY).ConvertToBitmap() 
		self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (585, 95))
		# -------------------------------------------------------------------------------------------------	

		btn_listar = wx.Button(self.panel, 7, u"Listar", size=(200,30), pos=(520,130))
		btn_listar.Bind(wx.EVT_BUTTON, self.cargarDatos)

		ico_grafica = wx.Bitmap("imagenes/grafica.png", wx.BITMAP_TYPE_ANY)
		btn_grafica = AB.AquaButton(self.panel, wx.ID_ANY, bitmap=ico_grafica, size=(38,35), pos=(530,180), style=wx.NO_BORDER)
		btn_grafica.SetForegroundColour("red")
		btn_grafica.Bind(wx.EVT_BUTTON, self.cargarGrafica )

		#----------------------------------------------------------------------------------------------------
		
		self.tabla_potencia_reactiva = wx.ListCtrl(self.panel, pos=(25, 25), size=(450,450),
							style=wx.LC_REPORT
							|wx.BORDER_SUNKEN|wx.LC_HRULES|wx.LC_VRULES
							)
		self.tabla_potencia_reactiva.InsertColumn(0, 'Fecha',width=100)
		self.tabla_potencia_reactiva.InsertColumn(1, 'Hora',width=100)
		self.tabla_potencia_reactiva.InsertColumn(2, 'Potencia Activa',width=130)
		self.tabla_potencia_reactiva.InsertColumn(3, 'Potencia Reactiva',width=130)
	
		#----------------------------------------------------------------------------------------------------

		panel_informacion_voltaje= wx.Panel(self.panel,-1,size=(300,200),pos=(520,250))
		panel_informacion_voltaje.SetBackgroundColour("#FFFFFF")

		txt_rango_aceptable = wx.StaticText(panel_informacion_voltaje, -1, "la potencia reactiva debe ser menor\na la mitad de la potencia activa + 1", pos=(30, 30))
		font = wx.Font(12, wx.ROMAN, wx.NORMAL, wx.NORMAL)
		txt_rango_aceptable.SetFont(font)

		decoracion_derecha1_panel_informacion= wx.Panel(panel_informacion_voltaje,-1,size=(200,5),pos=(0,0))
		decoracion_derecha2_panel_informacion= wx.Panel(panel_informacion_voltaje,-1,size=(5,100),pos=(0,0))
		decoracion_izquierda1_panel_informacion= wx.Panel(panel_informacion_voltaje,-1,size=(200,5),pos=(100,195))
		decoracion_izquierda2_panel_informacion= wx.Panel(panel_informacion_voltaje,-1,size=(5,100),pos=(295,100))

		decoracion_derecha1_panel_informacion.SetBackgroundColour("#FFDF49")
		decoracion_derecha2_panel_informacion.SetBackgroundColour("#FFDF49")
		decoracion_izquierda1_panel_informacion.SetBackgroundColour("#7F7856")
		decoracion_izquierda2_panel_informacion.SetBackgroundColour("#7F7856")
		self.Layout()
コード例 #8
0
    def Elementos(self):
        header = wx.Panel(self, -1, size=(1500, 120), pos=(0, 0))
        header.SetBackgroundColour("#6E7B99")

        titulo = wx.StaticText(header,
                               wx.ID_ANY,
                               "Efenergy",
                               style=wx.ALIGN_CENTER,
                               pos=(150, 25))
        font = wx.Font(40, wx.ROMAN, wx.ITALIC, wx.NORMAL)
        titulo.SetFont(font)

        bmp1 = wx.Image(logotipo1, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        self.bitmap1 = wx.StaticBitmap(header, -1, bmp1, (30, 10))

        txt_seleccion_dia = wx.StaticText(self.panel,
                                          -1,
                                          "Día: ",
                                          pos=(440, 32))
        dias = self.archivo_excel.sheet_names
        self.choice = wx.Choice(self.panel, choices=dias, pos=(500, 30))
        self.choice.SetSelection(0)

        txt_seleccion_nivel_tension = wx.StaticText(self.panel,
                                                    -1,
                                                    "Tension: ",
                                                    pos=(30, 32))
        valores = ['Nivel 1', 'Nivel 2', 'Nivel 3', 'Nivel 4']
        self.nivel_tension = wx.Choice(self.panel,
                                       choices=valores,
                                       pos=(120, 30),
                                       size=(90, 26))
        self.nivel_tension.SetSelection(0)

        txt_seleccion_fase = wx.StaticText(self.panel,
                                           -1,
                                           "Fase: ",
                                           pos=(250, 32))
        lista_fase = ["A", "B", "C"]
        self.Fase = wx.Choice(self.panel,
                              choices=lista_fase,
                              pos=(310, 30),
                              size=(90, 26))
        self.Fase.SetSelection(0)

        btn_listar = wx.Button(self.panel,
                               7,
                               u"Listar",
                               size=(100, 30),
                               pos=(1010, 30))
        btn_listar.Bind(wx.EVT_BUTTON, self.AnalisisArmonicos)

        # -------------------------------------------------------------------------------------------------

        ico_grafica = wx.Bitmap("imagenes/grafica.png", wx.BITMAP_TYPE_ANY)
        button_grafica_faseA = AB.AquaButton(self.panel,
                                             1,
                                             bitmap=ico_grafica,
                                             size=(35, 35),
                                             pos=(1150, 90))
        button_grafica_faseA.SetForegroundColour("black")
        button_grafica_faseA.Bind(wx.EVT_BUTTON, self.graficaArmonicoVsTiempo)

        icon_seleccionar_dia = 'imagenes/calendario.png'
        bmp1 = wx.Image(icon_seleccionar_dia,
                        wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (465, 30))

        icon_listar = 'imagenes/listar.png'
        bmp1 = wx.Image(icon_listar, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (975, 30))

        icon_estado_voltaje = 'imagenes/voltaje.png'
        bmp1 = wx.Image(icon_estado_voltaje,
                        wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (85, 30))

        icon_fase = 'imagenes/fase.png'
        bmp1 = wx.Image(icon_fase, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
        self.bitmap1 = wx.StaticBitmap(self.panel, -1, bmp1, (280, 28))

        # -------------------------------------------------------------------------------------------------

        self.list_ctrl = wx.ListCtrl(self.panel,
                                     pos=(30, 70),
                                     size=(1080, 400),
                                     style=wx.LC_REPORT
                                     | wx.BORDER_SUNKEN | wx.LC_HRULES
                                     | wx.LC_VRULES)
        self.list_ctrl.InsertColumn(0, 'Fecha')
        self.list_ctrl.InsertColumn(1, 'Hora')
        self.list_ctrl.InsertColumn(2, 'THD V')
        self.list_ctrl.InsertColumn(3, '	')
        self.list_ctrl.InsertColumn(4, 'ARM 1')
        self.list_ctrl.InsertColumn(5, 'ARM 2')
        self.list_ctrl.InsertColumn(6, 'ARM 3')
        self.list_ctrl.InsertColumn(7, 'ARM 4')
        self.list_ctrl.InsertColumn(8, 'ARM 5')
        self.list_ctrl.InsertColumn(9, 'ARM 6')
        self.list_ctrl.InsertColumn(10, 'ARM 7')
        self.list_ctrl.InsertColumn(11, 'ARM 8')
        self.list_ctrl.InsertColumn(12, 'ARM 9')
        self.list_ctrl.InsertColumn(13, 'ARM 10')
        self.list_ctrl.InsertColumn(14, 'ARM 11')