Trees | Indices | Help |
|
---|
|
1 # -*- coding: utf-8 -*- 2 3 ########################################################################## 4 # toolbar.py 5 # 6 # Tasarım Editörünün ana toolbar sınıfı 7 # 8 # (C) 2007 Likya Yazılım ve Bilişim Hizmetleri Ltd. Şti. 9 ########################################################################## 10 11 from PyQt4.QtCore import * 12 from PyQt4.QtGui import * 13 14 from tools import * 15 16 import icons 17199521 ''' 22 Tasarım editörü için toolbarı oluşturur. 23 ''' 24 QToolBar.__init__(self, parent) 25 26 self._editor = editor 27 self._plugin = plugin 28 29 # Toolbar'da bulunan düğmelerin action'ları 30 self._actions = {} 31 32 # Düğmeler oluşturulmadan önce çalışır. 33 self.preInitToolBar() 34 35 # Toolbar'ı oluştur. 36 self.createToolbarButtons() 37 38 self.initToolBar() 39 40 # Silinecek toolbutton'lar 41 for actionCode in self._plugin.removableActions(): 42 if actionCode in self._actions: 43 action = self.getAction(actionCode) 44 action.setVisible(False)45 48 5153 ''' 54 Toolbar'da nelerin olacağını belirler. 55 ''' 56 toolbarItems = [ 57 ] 58 59 return toolbarItems60 66 7274 ''' 75 Toolbar'da bulunan düğmelerin action'ları oluşturur. 76 ''' 77 toolbarItems = self.getToolbarItems() 78 79 # Düğmeleri oluşturuyoruz. 80 for name, definition, shortcut, description in toolbarItems: 81 82 if name == '-': 83 self.addSeparator() 84 85 else: 86 icon = getattr(icons, '%sIcon' % name) 87 definition = tr(definition) 88 if shortcut: 89 definition += " (%s)" % shortcut 90 action = QAction(icon, definition, self.parent()) 91 action.setShortcut(QKeySequence(shortcut)) 92 action.setStatusTip(tr(description)) 93 self.addAction(action) 94 self._actions[name] = action
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Oct 29 19:47:02 2009 | http://epydoc.sourceforge.net |