dialogs/IDManager.py
author Edouard Tisserant
Fri, 22 Mar 2019 10:57:04 +0100
branchsearch_in_CTN
changeset 2528 6bfc8a9bf0e7
parent 2492 7dd551ac2fa0
child 3750 f62625418bff
permissions -rw-r--r--
WIP adding searching capabilities in python files. was done :
- added search in body of Code File Tree Nodes (moved editor code so that we CTN search can have the same sections text layout as editor to search in)
2337
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     1
from __future__ import absolute_import
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     2
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     3
import wx
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     4
from controls.IDBrowser import IDBrowser
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     5
2492
7dd551ac2fa0 check_sources.sh makes me become even less productive
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2428
diff changeset
     6
2337
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     7
class IDManager(wx.Dialog):
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     8
    def __init__(self, parent, ctr):
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
     9
        self.ctr = ctr
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
    10
        wx.Dialog.__init__(self,
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
    11
                           name='IDManager', parent=parent,
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
    12
                           title=_('URI Editor'),
2428
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    13
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
2492
7dd551ac2fa0 check_sources.sh makes me become even less productive
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 2428
diff changeset
    14
                           size=(800, 600))
2337
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
    15
        # start IDBrowser in manager mode
8689ce77076f Added toolbar button to launch ID Manager dialog.
Edouard Tisserant
parents:
diff changeset
    16
        self.browser = IDBrowser(self, ctr)
2428
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    17
        self.Bind(wx.EVT_CHAR_HOOK, self.OnEscapeKey)
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    18
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    19
    def OnEscapeKey(self, event):
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    20
        keycode = event.GetKeyCode()
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    21
        if keycode == wx.WXK_ESCAPE:
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    22
            self.EndModal(wx.ID_CANCEL)
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    23
        else:
e0f16317668e IDManager : finished Import/Export. Added merging capability to import (asks if particular ID is replaced during import). Added ESC as closing shortcut to IDManager dialog, and adjusted its size.
Edouard Tisserant
parents: 2337
diff changeset
    24
            event.Skip()