1
2
3
4
5
6 import wx
7
8
9 import gettext
10
11
12
13
14
15
18
19 kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
20 wx.ScrolledWindow.__init__(self, *args, **kwds)
21 self.SetScrollRate(10, 10)
22
23 _gszr_main = wx.FlexGridSizer(3, 2, 1, 3)
24
25 __lbl_name = wx.StaticText(self, wx.ID_ANY, _("Tag name"))
26 __lbl_name.SetForegroundColour(wx.Colour(255, 0, 0))
27 _gszr_main.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
28
29 self._TCTRL_description = wx.TextCtrl(self, wx.ID_ANY, "")
30 self._TCTRL_description.SetToolTip(_("A name for the tag.\n\nNote that there cannot be two tags with the same name."))
31 _gszr_main.Add(self._TCTRL_description, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
32
33 __lbl_fname = wx.StaticText(self, wx.ID_ANY, _("File name"))
34 _gszr_main.Add(__lbl_fname, 0, wx.ALIGN_CENTER_VERTICAL, 0)
35
36 self._TCTRL_filename = wx.TextCtrl(self, wx.ID_ANY, "")
37 self._TCTRL_filename.SetToolTip(_("An example file name for this image. Mainly used for deriving a suitable file extension."))
38 _gszr_main.Add(self._TCTRL_filename, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
39
40 __lbl_image = wx.StaticText(self, wx.ID_ANY, _("Image"))
41 __lbl_image.SetForegroundColour(wx.Colour(255, 0, 0))
42 _gszr_main.Add(__lbl_image, 0, wx.ALIGN_CENTER_VERTICAL, 0)
43
44 __szr_image = wx.BoxSizer(wx.HORIZONTAL)
45 _gszr_main.Add(__szr_image, 1, wx.EXPAND, 0)
46
47 self._BMP_image = wx.lib.statbmp.GenStaticBitmap(self, wx.ID_ANY, wx.Bitmap(wx.Image(100, 100, clear = True)), style=wx.BORDER_SIMPLE)
48 self._BMP_image.SetToolTip(_("The image to use for the tag.\n\nDo not use a big image because the tag will be downscaled anyway."))
49 __szr_image.Add(self._BMP_image, 0, wx.ALIGN_CENTER | wx.ALL, 3)
50
51 self._BTN_pick_image = wx.Button(self, wx.ID_ANY, _("&Pick"), style=wx.BU_EXACTFIT)
52 self._BTN_pick_image.SetToolTip(_("Pick the file from which to load the tag image."))
53 __szr_image.Add(self._BTN_pick_image, 0, wx.ALIGN_CENTER_VERTICAL, 0)
54
55 _gszr_main.AddGrowableCol(1)
56 self.SetSizer(_gszr_main)
57 _gszr_main.Fit(self)
58
59 self.Layout()
60
61 self.Bind(wx.EVT_BUTTON, self._on_pick_image_button_pressed, self._BTN_pick_image)
62
63
65 print("Event handler '_on_pick_image_button_pressed' not implemented!")
66 event.Skip()
67
68
69