def __init__(self, mw, parent, palette_name): self.palette_name = palette_name item_id = wal.new_id() wal.MenuItem.__init__(self, parent, item_id, palette_name) self.bind_to(mw, self.action, item_id) if config.palette == self.palette_name: self.set_checkable(True)
def __init__(self, mw, parent, zoom): self.app = mw.app self.zoom = zoom self.id = wal.new_id() wal.MenuItem.__init__(self, parent, self.id, '%d%%' % zoom) self.bind_to(mw, self.action, self.id) if int(round(self.get_zoom())) == self.zoom: self.set_checkable(True)
def __init__(self, mw, parent, zoom): self.app = mw.app self.zoom = zoom item_id = wal.new_id() txt = '%d%%\tCtrl+F4' % zoom if zoom == 100 else '%d%%' % zoom wal.MenuItem.__init__(self, parent, item_id, txt) self.bind_to(mw, self.action, item_id) if int(round(self.get_zoom())) == self.zoom: self.set_checkable(True)
def create_menu(self, parent, entries): for entry in entries: menu = wal.Menu() subentries = entry[1] for item in subentries: if item is None: menu.append_separator() elif isinstance(item, wal.Menu): menu = item elif isinstance(item, tuple): self.create_menu(menu, (item, )) else: action = self.app.actions[item] menuitem = ActionMenuItem(self.mw, menu, action) menu.append_item(menuitem) parent.append_menu(wal.new_id(), entry[0], menu)
def create_menu(self, parent, entries): for entry in entries: menu = wx.Menu() subentries = entry[1] for item in subentries: if item is None: menu.AppendSeparator() elif isinstance(item, wx.Menu): menu = item elif isinstance(item, tuple): self.create_menu(menu, (item,)) else: action = self.app.actions[item] menuitem = ActionMenuItem(self.mw, menu, action) menu.AppendItem(menuitem) parent.AppendMenu(wal.new_id(), entry[0], menu)
def __init__(self, app, mw): self.app = app self.mw = mw wx.Menu.__init__(self) self.empty_item = wx.MenuItem(self, wal.new_id(), _('Empty')) if not wal.is_wx3(): self.empty_item.Enable(False) self.items.append(self.AppendSeparator()) action = self.app.actions[pdids.ID_CLEAR_LOG] menuitem = ActionMenuItem(self.mw, self, action) self.AppendItem(menuitem) self.items.append(menuitem) self.persistent_items += self.items self.rebuild() events.connect(events.HISTORY_CHANGED, self.rebuild)
def __init__(self, app, mw): self.app = app self.mw = mw wal.Menu.__init__(self) self.items = [] self.persistent_items = [] self.empty_item = wal.MenuItem(self, wal.new_id(), _('Empty')) self.items.append(self.append_separator()) action = self.app.actions[pdids.ID_CLEAR_LOG] menuitem = ActionMenuItem(self.mw, self, action) self.append_item(menuitem) self.items.append(menuitem) self.persistent_items += self.items self.rebuild() events.connect(events.HISTORY_CHANGED, self.rebuild)
def __init__(self, app, mw): self.app = app self.mw = mw wx.Menu.__init__(self) self.empty_item = wx.MenuItem(self, wal.new_id(), _("Empty")) if not wal.is_wx3(): self.empty_item.Enable(False) self.items.append(self.AppendSeparator()) action = self.app.actions[pdids.ID_CLEAR_LOG] menuitem = ActionMenuItem(self.mw, self, action) self.AppendItem(menuitem) self.items.append(menuitem) self.persistent_items += self.items self.rebuild() events.connect(events.HISTORY_CHANGED, self.rebuild)
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. from wal import new_id # ----- Canvas modes SELECT_MODE = new_id() SHAPER_MODE = new_id() ZOOM_MODE = new_id() FLEUR_MODE = new_id() LINE_MODE = new_id() CURVE_MODE = new_id() RECT_MODE = new_id() ELLIPSE_MODE = new_id() POLYGON_MODE = new_id() TEXT_MODE = new_id() GRADIENT_MODE = new_id() FILL_MODE = new_id() STROKE_MODE = new_id() ZOOM_OUT_MODE = new_id()
def __init__(self, mw, parent, text, path): self.app = mw.app self.path = path self.id = wal.new_id() wal.MenuItem.__init__(self, parent, self.id, text) self.bind_to(mw, self.action, self.id)
def __init__(self, mw, parent, text, path): self.app = mw.app self.path = path self.id = wal.new_id() wx.MenuItem.__init__(self, parent, self.id, text=text) mw.Bind(wx.EVT_MENU, self.action, id=self.id)
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from wal import new_id #----- Canvas modes SELECT_MODE = new_id() SHAPER_MODE = new_id() ZOOM_MODE = new_id() FLEUR_MODE = new_id() LINE_MODE = new_id() CURVE_MODE = new_id() RECT_MODE = new_id() ELLIPSE_MODE = new_id() POLYGON_MODE = new_id() TEXT_MODE = new_id() GRADIENT_MODE = new_id() FILL_MODE = new_id() STROKE_MODE = new_id() ZOOM_OUT_MODE = new_id()