From: Alex T. <ale...@us...> - 2005-11-02 11:17:10
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30257 Modified Files: helpful.py Log Message: Added support for optional tooltips. Made checkboxes wider. Index: helpful.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/helpful.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** helpful.py 2 Nov 2005 00:51:37 -0000 1.1 --- helpful.py 2 Nov 2005 11:16:57 -0000 1.2 *************** *** 49,53 **** bx, by = self.components.Button.size for b in buttons: ! self.components.Button.label = b newx, newy = self.components.Button.GetBestSize() bx = max(bx, newx) --- 49,57 ---- bx, by = self.components.Button.size for b in buttons: ! if type(b) == types.StringType: ! self.components.Button.label = b ! else: ! self.components.Button.label = b[0] ! newx, newy = self.components.Button.GetBestSize() bx = max(bx, newx) *************** *** 68,75 **** count = 0 for b in localbuttons: ! n = copyControl(self, "Button", "Button"+str(count), b) self.components[n.name].position = startx-count*dx, starty self.components[n.name].visible = True self.components[n.name].enabled = True count += 1 self.accepted = False --- 72,86 ---- count = 0 for b in localbuttons: ! if type(b) == types.StringType: ! theName = b ! theToolTip = '' ! else: ! theName = b[0] ! theToolTip = b[1] ! n = copyControl(self, "Button", "Button"+str(count), theName) self.components[n.name].position = startx-count*dx, starty self.components[n.name].visible = True self.components[n.name].enabled = True + self.components[n.name].toolTip = theToolTip count += 1 self.accepted = False *************** *** 120,123 **** --- 131,136 ---- class MultiCheckBoxDialog(model.CustomDialog): + # boxes is a list of (name, value) paris, not a dictionary + # because a dictionary didn't allow th ecaller to control the order of presentatino def __init__(self, parent, boxes, rsrc): model.CustomDialog.__init__(self, parent, rsrc) *************** *** 135,140 **** count = 0 self.boxes = {} ! for key, val in boxes: ! n = copyControl(self, "box", "Box"+str(count), key) self.components[n.name].position = startx, starty+count*(sy+20) --- 148,160 ---- count = 0 self.boxes = {} ! for b in boxes: ! val = False ! toolTip = '' ! if type(b) == types.StringType: ! key = b ! else: ! key = b[0] ! if len(b) > 1: val = b[1] ! if len(b) > 2: toolTip = b[2] n = copyControl(self, "box", "Box"+str(count), key) self.components[n.name].position = startx, starty+count*(sy+20) *************** *** 142,150 **** self.components[n.name].enabled = True self.components[n.name].checked = val self.boxes[key] = val count += 1 self.components.btnOK.position = (150, starty+count*(sy+20)) self.components.btnCancel.position = (250, starty+count*(sy+20)) - starty+count*(sy+20) self.accepted = False --- 162,170 ---- self.components[n.name].enabled = True self.components[n.name].checked = val + self.components[n.name].toolTip = toolTip self.boxes[key] = val count += 1 self.components.btnOK.position = (150, starty+count*(sy+20)) self.components.btnCancel.position = (250, starty+count*(sy+20)) self.accepted = False *************** *** 173,176 **** --- 193,197 ---- 'name':'box', 'position':(50, 15), + 'size':(250,20), 'actionBindings':{}, 'label':'template', |