Changeset 71
- Timestamp:
- 03/04/04 11:37:46 (4 years ago)
- Files:
-
- 05/devel/kombilo.py (modified) (5 diffs)
- 05/devel/v.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
05/devel/kombilo.py
r70 r71 115 115 116 116 def __init__(self, master, boardSize, canvasSize, fuzzy, labelFontsize, fixedColor, smartFixedColor, 117 boardImg, blackImg, whiteImg ):117 boardImg, blackImg, whiteImg, onlyOneMouseButton = 0): 118 118 Board.__init__(self, master, boardSize, canvasSize, fuzzy, labelFontsize, 1, None, 119 119 boardImg, blackImg, whiteImg) … … 126 126 self.smartFixedColor = smartFixedColor 127 127 128 # self.boundM2_1 = self.bind('<M2-Button-1>', self.selStart) 129 # self.boundM2_1m = self.bind('<M2-B1-Motion>', self.selDrag) 130 self.bound3 = self.bind('<Button-3>', self.selStart) 131 self.bound3m = self.bind('<B3-Motion>', self.selDrag) 128 self.onlyOneMouseButton = onlyOneMouseButton 129 if onlyOneMouseButton: 130 self.bound3 = self.bind('<M2-Button-1>', self.selStart) 131 self.bound3m = self.bind('<M2-B1-Motion>', self.selDrag) 132 else: 133 self.bound3 = self.bind('<Button-3>', self.selStart) 134 self.bound3m = self.bind('<B3-Motion>', self.selDrag) 132 135 133 136 self.bounds1 = self.bind('<Shift-1>', self.wildcard) 134 137 135 138 self.invertSelection = IntVar() 139 140 141 def rebindMouseButtons(self, onlyOneMouseButton): 142 if self.onlyOneMouseButton: 143 self.unbind('<M2-B1-Motion>', self.bound3m) 144 self.unbind('<M2-Button-1>', self.bound3) 145 else: 146 self.unbind('<B3-Motion>', self.bound3m) 147 self.unbind('<3>', self.bound3) 148 self.onlyOneMouseButton = onlyOneMouseButton 149 if onlyOneMouseButton: 150 self.bound3 = self.bind('<M2-Button-1>', self.selStart) 151 self.bound3m = self.bind('<M2-B1-Motion>', self.selDrag) 152 else: 153 self.bound3 = self.bind('<Button-3>', self.selStart) 154 self.bound3m = self.bind('<B3-Motion>', self.selDrag) 136 155 137 156 … … 1014 1033 b.update_idletasks() 1015 1034 b.bound1 = b.bind('<1>', lambda event, self=self, l=len(self.data): self.click(l)) 1016 b.unbind('<B3-Motion>', b.bound3m) 1017 b.unbind('<3>', b.bound3) 1018 # b.unbind('<M2-Button-1>', b.boundM2_1) 1019 # b.unbind('<M2-B1-Motion>', b.boundM2_1m) 1035 1036 if b.onlyOneMouseButton: 1037 b.unbind('<M2-B1-Motion>', b.bound3m) 1038 b.unbind('<M2-Button-1>', b.bound3) 1039 else: 1040 b.unbind('<B3-Motion>', b.bound3m) 1041 b.unbind('<3>', b.bound3) 1020 1042 b.unbind('<Configure>', b.boundConf) 1021 1043 b.bound3 = b.bind('<3>', lambda event, self=self, l = len(self.data): self.postMenu(event, l)) … … 5996 6018 5997 6019 6020 def rebindMouseButtons(self): 6021 self.board.rebindMouseButtons(self.options.onlyOneMouseButton.get()) 6022 6023 6024 6025 5998 6026 def initMenus(self): 5999 6027 """ Initialize the menus, and a few options variables. """ … … 6171 6199 advOptMenu.add_checkbutton(label='Do not change window title', 6172 6200 variable=self.options.doNotChangeWindowTitle) 6201 6202 self.options.onlyOneMouseButton = IntVar() 6203 advOptMenu.add_checkbutton(label='Only one mouse button', 6204 variable=self.options.onlyOneMouseButton, 6205 command=self.rebindMouseButtons) 6173 6206 6174 6207 advOptMenu.add_command(label='Customize appearance', underline=0, 05/devel/v.py
r70 r71 2800 2800 2801 2801 self.options.confirmDelete = IntVar() 2802 self.optionsmenu.add_checkbutton(label='Ask for confirmation before deleting file',2802 self.optionsmenu.add_checkbutton(label='Ask before discarding unsaved changes', 2803 2803 variable = self.options.confirmDelete) 2804 2804
