Exemple #1
0
 def SetStyle(self, *styles):
     """Use this at your own risk."""
     st = {
         'blackframe': 7,
         'grayframe': 8,
         'whiteframe': 9,
         'etchedframe': 18
     }
     style = ControlMethods.GetStyleL(self, 'style')
     out = []
     flag = False
     for i in styles:
         if i in st:
             style |= 7 | 8 | 9 | 18
             style ^= 7 | 8 | 9 | 18
             style |= st[i]
             flag = True
         else:
             out.append(i)
     if flag:
         ControlMethods.SetStyleL(self, 'style', style)
         # Not enough
         #self.OffsetWindowSize(1, 1)
         #self.OffsetWindowSize(-1, -1)
         x, y, w, h = self.GetWindowRect().ToSize()
         self.SetWindowSize(0, 0)
         self.SetWindowSize(w, h)
     if out: ControlMethods.SetStyle(self, *out)
Exemple #2
0
 def SetStyle(self, *styles):
     rcStyles = ['blackrect', 'grayrect', 'whiterect']
     rcStyles2 = ['-blackrect', '-grayrect', '-whiterect']
     a, b = [], []
     for i in styles:
         if i in rcStyles: a.append(i)
         else: b.append(i)
     if a:
         rcStyles2.remove('-%s' % a[-1])
         b += rcStyles2 + [a[-1]]
     ControlMethods.SetStyle(self, *b)
     self.RedrawClientArea()
Exemple #3
0
 def SetStyle(self, *styles):
     lv_styles = ['icon', 'report', 'smallicon', 'list']
     style = ControlMethods.GetStyleL(self, 'style')
     out = []
     flag = False
     for i in styles:
         if i in lv_styles:
             style &= (~3)
             style |= lv_styles.index(i)
             flag = True
         else:
             out.append(i)
     if flag: ControlMethods.SetStyleL(self, 'style', style)
     if out: ControlMethods.SetStyle(self, *out)
Exemple #4
0
 def SetStyle(self, *styles):
     out = []
     fReadonly = None
     for i in styles:
         if 'readonly' in i: fReadonly = i
         else: out.append(i)
     if fReadonly:
         flag = 1
         if fReadonly[0] == '-': flag = 0
         if fReadonly[0] == '~':
             ES_READONLY = 2048
             if self.GetStyleL('style') & ES_READONLY:
                 flag = 0
         self.SendMessage(self.Hwnd, self.Msg.EM_SETREADONLY, flag, 0)
     if out:
         ControlMethods.SetStyle(self, *out)
Exemple #5
0
    def SetStyle(self, *styles):
        """Sets the style for the checkbox.
		Same as the SetStyle method for other controls, except  
		The styles 'radiobutton', 'autoradiobutton'
		are mutually exclusive. You can not use the flags '-' and
		'~' on them.
		"""
        out = []
        st = ('radiobutton', 'autoradiobutton')
        for i in styles:
            if i in st:
                if i == 'radiobutton': style = 4
                elif i == 'autoradiobutton': style = 9
                self.SendMessage(self.Hwnd, self.Msg.BM_SETSTYLE, style, 1)
            else:
                out.append(i)
            if out:
                ControlMethods.SetStyle(self, *out)
Exemple #6
0
 def SetStyle(self, *styles):
     """  """
     st = {
         'left': 0,
         'center': 1,
         'right': 2,
         'simple': 11,
         'leftnowordwrap': 12
     }
     style = ControlMethods.GetStyleL(self, 'style')
     out = []
     flag = False
     for i in styles:
         if i in st:
             style |= 1 | 2 | 11 | 12
             style ^= 1 | 2 | 11 | 12
             style |= st[i]
             flag = True
         else:
             out.append(i)
     if flag:
         ControlMethods.SetStyleL(self, 'style', style)
     if out:
         ControlMethods.SetStyle(self, *out)