def Notify(self): """ It's time to hide a ToasterBox! """ if len(winlist) == 0: return # clean the window list self.CleanList() # figure out how many blanks we have try: node = winlist[0] except: return if not node: return # move windows to fill in blank space for i in xrange(node.GetPosition()[1], self._popupposition[1], 4): if i > self._popupposition[1]: i = self._popupposition[1] # loop through all the windows for j in xrange(0, len(winlist)): ourNewHeight = i - (j*self._popupsize[1] - 8) tmpTb = winlist[j] # reset where the object THINKS its supposed to be tmpTb.SetPopupPosition((self._popupposition[0], ourNewHeight)) # actually move it tmpTb.SetDimensions(self._popupposition[0], ourNewHeight, tmpTb.GetSize().GetWidth(), tmpTb.GetSize().GetHeight()) wx.Usleep(self._sleeptime)
def ScrollUp(self): """ Scrolls The ToasterBox Up, Which Means Gradually Showing The ToasterBox. """ self.Show(True) # walk the Y value up in a raise motion xpos = self.GetPosition().x ypos = self._bottomright[1] windowsize = 0 # checking the type of the scroll (from up to down or from down to up) if self._scrollType == TB_SCR_TYPE_UD: start = self._dialogtop[1] stop = ypos step = self._step elif self._scrollType == TB_SCR_TYPE_DU: start = ypos stop = self._dialogtop[1] step = -self._step else: errMsg = ( "scrollType not supported (in ToasterBoxWindow.ScrollUp): %s" % self._scrollType) raise ValueError(errMsg) for i in xrange(start, stop, step): if i < self._dialogtop[1]: i = self._dialogtop[1] windowsize = windowsize + self._step # checking the type of the scroll (from up to down or from down to up) if self._scrollType == TB_SCR_TYPE_UD: dimY = self._dialogtop[1] elif self._scrollType == TB_SCR_TYPE_DU: dimY = i else: errMsg = ( "scrollType not supported (in ToasterBoxWindow.ScrollUp): %s" % self._scrollType) raise ValueError(errMsg) self.SetDimensions(self._dialogtop[0], dimY, self.GetSize().GetWidth(), windowsize) if self._tbstyle == TB_SIMPLE: self.DrawText() wx.Usleep(self._sleeptime) self.Update() self.Refresh() self.Update() if self._tbstyle == TB_SIMPLE: self.DrawText() self.SetFocus()
def _addoutput(self, checkinput=True): wx.Usleep(25) a = '' if checkinput and self.process.IsInputAvailable(): a = self._getoutput(self.inputstream) if self.process.IsErrorAvailable(): a += self._getoutput(self.errorstream) self.AddText(a) return a
def ScrollDown(self): """ Scrolls the L{ToasterBox} down, which means gradually hiding it. """ # walk down the Y value windowsize = self.GetSize().GetHeight() # checking the type of the scroll (from up to down or from down to up) if self._scrollType == TB_SCR_TYPE_UD: start = self._bottomright.y stop = self._dialogtop[1] step = -self._step elif self._scrollType == TB_SCR_TYPE_DU: start = self._dialogtop[1] stop = self._bottomright.y step = self._step else: errMsg = ( "scrollType not supported (in ToasterBoxWindow.ScrollUp): %s" % self._scrollType) raise ValueError(errMsg) for i in xrange(start, stop, step): if i > self._bottomright.y: i = self._bottomright.y windowsize = windowsize - self._step if windowsize <= 0: break # checking the type of the scroll (from up to down or from down to up) if self._scrollType == TB_SCR_TYPE_UD: dimY = self._dialogtop[1] elif self._scrollType == TB_SCR_TYPE_DU: dimY = i else: errMsg = ( "scrollType not supported (in ToasterBoxWindow.ScrollUp): %s" % self._scrollType) raise ValueError(errMsg) self.SetDimensions(self._dialogtop[0], dimY, self.GetSize().GetWidth(), windowsize) wx.Usleep(self._sleeptime) self.Refresh() self.Hide() if self._parent2: self._parent2.Notify()