Beispiel #1
0
 def __init__(self, parent, timeout=None, *args, **kwds):
     wxStatusB.__init__(self, parent, *args, **kwds)
     self.SetFieldsCount(1)
     self.timeout = timeout
     width, height = parent.GetSizeTuple()
     self.gauge = wx.Gauge(self, style=wx.GA_HORIZONTAL,
                           size=(width, height/10))
     rect = self.GetFieldRect(0)
     self.gauge.SetPosition((rect.x , rect.y ))
     if self.timeout is not None:
         self.gauge.SetRange(int(self.timeout))
     self.timer = wx.Timer(self, -1)
     self.Bind(wx.EVT_TIMER, self._on_time, self.timer)
     self.timer.Start(1)
     self.pos = 0
Beispiel #2
0
 def __init__(self, parent, timeout=None, *args, **kwds):
     wxStatusB.__init__(self, parent, *args, **kwds)
     self.SetFieldsCount(1)
     self.timeout = timeout
     width, height = parent.GetSizeTuple()
     self.gauge = wx.Gauge(self,
                           style=wx.GA_HORIZONTAL,
                           size=(width, height / 10))
     rect = self.GetFieldRect(0)
     self.gauge.SetPosition((rect.x, rect.y))
     if self.timeout is not None:
         self.gauge.SetRange(int(self.timeout))
     self.timer = wx.Timer(self, -1)
     self.Bind(wx.EVT_TIMER, self._on_time, self.timer)
     self.timer.Start(1)
     self.pos = 0
 def __init__(self, parent):
     StatusBar.__init__(self, parent)
     connect(self.update, signal='status_update', sender=Any)
     connect(self.clear, signal='status_clear', sender=Any)
Beispiel #4
0
    def __init__(self, parent, id):
        wxStatusB.__init__(self, parent, id)
        self.parent = parent
        self.parent.SetStatusBarPane(MSG_POSITION)

        #Layout of status bar
        width = STATUS_BAR_ICON_SIZE
        height = STATUS_BAR_ICON_SIZE
        self.SetFieldsCount(NB_FIELDS)
        # Leave some space for the resize handle in the last field
        console_btn_width = 80
        self.SetStatusWidths([width + 4, -2, -1, width + console_btn_width])
        self.SetMinHeight(height + 10)

        #display default message
        self.msg_position = MSG_POSITION

        # Create progress bar
        gauge_width = 5 * width
        self.gauge = wx.Gauge(self,
                              size=(gauge_width, height),
                              style=wx.GA_HORIZONTAL)
        self.gauge.Hide()

        # Create status bar icon reflecting the type of status
        # for the last message
        self.status_color = wx.StaticText(self,
                                          id=wx.NewId(),
                                          label="   ",
                                          size=wx.Size(15, 15))
        self.status_color.SetBackgroundColour(GREEN)
        self.status_color.SetForegroundColour(GREEN)

        # Create the button used to show the console dialog
        self.console_button = wx.Button(self,
                                        wx.NewId(),
                                        "Console",
                                        size=(console_btn_width, -1))
        font = self.console_button.GetFont()
        _, pixel_h = font.GetPixelSize()
        font.SetPixelSize(wx.Size(0, int(pixel_h * 0.9)))
        self.console_button.SetFont(font)
        self.console_button.SetToolTipString("History of status bar messages")
        self.console_button.Bind(wx.EVT_BUTTON,
                                 self._onMonitor,
                                 id=self.console_button.GetId())

        self.reposition()
        ## Current progress value of the bar
        self.nb_start = 0
        self.nb_progress = 0
        self.nb_stop = 0
        self.frame = None
        self.list_msg = []
        self.frame = Console(parent=self)
        if hasattr(self.frame, "IsIconized"):
            if not self.frame.IsIconized():
                try:
                    icon = self.parent.GetIcon()
                    self.frame.SetIcon(icon)
                except:
                    try:
                        FRAME_ICON = wx.Icon(GUIFRAME_ICON.FRAME_ICON_PATH,
                                             wx.BITMAP_TYPE_ICO)
                        self.frame.SetIcon(FRAME_ICON)
                    except:
                        pass
        self.frame.set_multiple_messages(self.list_msg)
        self.frame.Hide()
        self.progress = 0
        self.timer = wx.Timer(self, -1)
        self.timer_stop = wx.Timer(self, -1)
        self.thread = None
        self.Bind(wx.EVT_TIMER, self._on_time, self.timer)
        self.Bind(wx.EVT_TIMER, self._on_time_stop, self.timer_stop)
        self.Bind(wx.EVT_SIZE, self.on_size)
        self.Bind(wx.EVT_IDLE, self.on_idle)
Beispiel #5
0
    def __init__(self, parent, id):
        wxStatusB.__init__(self, parent, id)
        self.parent = parent
        self.parent.SetStatusBarPane(MSG_POSITION)

        #Layout of status bar
        width = STATUS_BAR_ICON_SIZE
        height = STATUS_BAR_ICON_SIZE
        self.SetFieldsCount(NB_FIELDS)
        # Leave some space for the resize handle in the last field
        console_btn_width = 80
        self.SetStatusWidths([width+4, -2, -1, width+console_btn_width])
        self.SetMinHeight(height + 10)

        #display default message
        self.msg_position = MSG_POSITION

        # Create progress bar
        gauge_width = 5 * width
        self.gauge = wx.Gauge(self, size=(gauge_width, height),
                              style=wx.GA_HORIZONTAL)
        self.gauge.Hide()

        # Create status bar icon reflecting the type of status
        # for the last message
        self.status_color = wx.StaticText(self, id=wx.NewId(), label="   ",
                                          size=wx.Size(15, 15))
        self.status_color.SetBackgroundColour(GREEN)
        self.status_color.SetForegroundColour(GREEN)

        # Create the button used to show the console dialog
        self.console_button = wx.Button(self, wx.NewId(), "Console",
                                        size=(console_btn_width, -1))
        font = self.console_button.GetFont()
        _, pixel_h = font.GetPixelSize()
        font.SetPixelSize(wx.Size(0, int(pixel_h*0.9)))
        self.console_button.SetFont(font)
        self.console_button.SetToolTipString("History of status bar messages")
        self.console_button.Bind(wx.EVT_BUTTON, self._onMonitor,
                                 id=self.console_button.GetId())

        self.reposition()
        ## Current progress value of the bar
        self.nb_start = 0
        self.nb_progress = 0
        self.nb_stop = 0
        self.frame = None
        self.list_msg = []
        self.frame = Console(parent=self)
        if hasattr(self.frame, "IsIconized"):
            if not self.frame.IsIconized():
                try:
                    icon = self.parent.GetIcon()
                    self.frame.SetIcon(icon)
                except:
                    try:
                        FRAME_ICON = wx.Icon(GUIFRAME_ICON.FRAME_ICON_PATH,
                                             wx.BITMAP_TYPE_ICO)
                        self.frame.SetIcon(FRAME_ICON)
                    except:
                        pass
        self.frame.set_multiple_messages(self.list_msg)
        self.frame.Hide()
        self.progress = 0
        self.timer = wx.Timer(self, -1)
        self.timer_stop = wx.Timer(self, -1)
        self.thread = None
        self.Bind(wx.EVT_TIMER, self._on_time, self.timer)
        self.Bind(wx.EVT_TIMER, self._on_time_stop, self.timer_stop)
        self.Bind(wx.EVT_SIZE, self.on_size)
        self.Bind(wx.EVT_IDLE, self.on_idle)