Changeset 70
- Timestamp:
- 03/03/04 22:42:28 (5 years ago)
- Files:
-
- 05/devel/board1.py (modified) (1 diff)
- 05/devel/kombilo.py (modified) (2 diffs)
- 05/devel/v.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
05/devel/board1.py
r42 r70 417 417 return (x,y) 418 418 419 def placeMark(self, pos, color ):419 def placeMark(self, pos, color, outln='', size=''): 420 420 """ Place colored mark at pos. """ 421 421 x1, x2, y1, y2 = self.getPixelCoord(pos, 1) 422 self.create_oval(x1+2, x2+2, y1-2, y2-2, fill = color, tags=('marks','non-bg')) 422 423 if size == 'small': 424 tmp1 = (y1 - x1) * 1 / 5 425 tmp2 = (y2 - x2) * 1 / 5 426 else: 427 tmp1 = 2 428 tmp2 = 2 429 self.create_oval(x1+tmp1, x2+tmp2, y1-tmp1, y2-tmp2, fill = color, 430 outline = outln, tags=('marks', 'non-bg')) 423 431 self.marks[pos]=color 424 432 self.onChange() 05/devel/kombilo.py
r69 r70 4712 4712 def delFile(self): 4713 4713 self.prevSearches.deleteFile(self.cursor) 4714 v.Viewer.delFile(self)4714 return v.Viewer.delFile(self) 4715 4715 4716 4716 … … 5826 5826 5827 5827 def quit(self): 5828 self.changeCurrentFile(None, 0) 5829 for i in range(len(self.filelist)): 5830 if not self.delFile(): return 5831 5828 5832 self.saveOptions() 5829 5833 try: 05/devel/v.py
r67 r70 1422 1422 """ Mark all variations for the next move. """ 1423 1423 1424 if not self.cursor or self.cursor.atEnd: return1424 if not self.cursor: return 1425 1425 1426 1426 passV = 0 1427 1427 1428 1428 try: 1429 if self.options.showCurrMoveVar.get(): 1430 c = self.cursor.currentNode() 1431 for color in ['B', 'W']: 1432 if c.has_key(color) and c[color][0] and self.convCoord(c[color][0]): 1433 if color == 'B': self.board.placeMark(self.convCoord(c[color][0]),'', 'white', 'small') 1434 else: self.board.placeMark(self.convCoord(c[color][0]), '', 'black', 'small') 1435 1436 if self.cursor.atEnd: return 1429 1437 1430 1438 for i in range(self.cursor.noChildren()): … … 1435 1443 if c[color][0] and self.convCoord(c[color][0]): 1436 1444 if self.options.showNextMoveVar.get(): 1437 self.board.placeMark(self.convCoord(c[color][0]),'' )1445 self.board.placeMark(self.convCoord(c[color][0]),'', 'black') 1438 1446 else: 1439 1447 passV = 1 … … 1457 1465 def showNextMove(self): 1458 1466 """ Toggle 'show next move' option. """ 1459 if self.options.showNextMoveVar.get(): 1460 self.markAll()1461 else:1462 self.board.delMarks()1467 1468 self.board.delMarks() 1469 self.markAll() 1470 1463 1471 1464 1472 def passFct(self): … … 1734 1742 self.moveno.set(str(int(self.moveno.get())+1)) 1735 1743 1736 self.markAll()1737 1744 self.displayNode(c) 1738 1745 if c.has_key('B'): … … 1783 1790 1784 1791 self.currentFileChanged() 1792 1793 self.markAll() 1785 1794 1786 1795 return done … … 1853 1862 self.capVar.set('Cap - B: ' + str(self.capB) + ', W: ' + str(self.capW)) 1854 1863 1855 if not self.cursor.atEnd:self.markAll()1864 self.markAll() 1856 1865 1857 1866 if self.board.currentColor == 'black': … … 2276 2285 index = int(self.dataWindow.filelist.list.curselection()[0]) 2277 2286 2287 s = self.dataWindow.filelist.list.get(index) 2288 if self.options.confirmDelete.get() and s[0:2] == '* ': 2289 if not askokcancel('Confirm deletion', 'There are unsaved changes. Delete?'): 2290 return 2291 2278 2292 del self.filelist[index] 2279 2293 … … 2286 2300 self.currentFileNum = -2 2287 2301 self.newFile() 2288 return 2302 return 1 2289 2303 2290 2304 self.currentFileNum = -1 2291 2305 self.changeCurrentFile(None, index) 2292 2306 2307 return 1 2293 2308 2294 2309 def modeChange(self): … … 2466 2481 def quit(self): 2467 2482 """ Exit the program. """ 2483 2484 self.changeCurrentFile(None, 0) 2485 for i in range(len(self.filelist)): 2486 if not self.delFile(): return 2487 2468 2488 self.saveOptions() 2469 2489 self.dataWindow.window.destroy() … … 2769 2789 command = self.showNextMove) 2770 2790 2791 self.options.showCurrMoveVar = IntVar() 2792 self.optionsmenu.add_checkbutton(label='Show last move', underline=5, 2793 variable = self.options.showCurrMoveVar, 2794 command = self.showNextMove) 2795 2771 2796 self.options.showCoordinates = IntVar() 2772 2797 self.optionsmenu.add_checkbutton(label='Show coordinates', 2773 2798 variable = self.options.showCoordinates, 2774 2799 command = self.toggleCoordinates) 2800 2801 self.options.confirmDelete = IntVar() 2802 self.optionsmenu.add_checkbutton(label='Ask for confirmation before deleting file', 2803 variable = self.options.confirmDelete) 2804 2775 2805 2776 2806 self.helpmenu = Menu(menu, name='help')
