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._TCTRL_description = wx.TextCtrl(self, wx.ID_ANY, "")
22 self._TCTRL_filename = wx.TextCtrl(self, wx.ID_ANY, "")
23 from wx.lib.statbmp import GenStaticBitmap
24 self._BMP_image = GenStaticBitmap(self, wx.ID_ANY, wx.Bitmap(100, 100), style=wx.BORDER_SIMPLE)
25 self._BTN_pick_image = wx.Button(self, wx.ID_ANY, _("&Pick"), style=wx.BU_EXACTFIT)
26
27 self.__set_properties()
28 self.__do_layout()
29
30 self.Bind(wx.EVT_BUTTON, self._on_pick_image_button_pressed, self._BTN_pick_image)
31
32
34
35 self.SetScrollRate(10, 10)
36 self._TCTRL_description.SetToolTip(_("A name for the tag.\n\nNote that there cannot be two tags with the same name."))
37 self._TCTRL_filename.SetToolTip(_("An example file name for this image. Mainly used for deriving a suitable file extension."))
38 self._BMP_image.SetMinSize((100, 100))
39 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."))
40 self._BTN_pick_image.SetToolTip(_("Pick the file from which to load the tag image."))
41
42
44
45 _gszr_main = wx.FlexGridSizer(3, 2, 1, 3)
46 __szr_image = wx.BoxSizer(wx.HORIZONTAL)
47 __lbl_name = wx.StaticText(self, wx.ID_ANY, _("Tag name"))
48 __lbl_name.SetForegroundColour(wx.Colour(255, 0, 0))
49 _gszr_main.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
50 _gszr_main.Add(self._TCTRL_description, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
51 __lbl_fname = wx.StaticText(self, wx.ID_ANY, _("File name"))
52 _gszr_main.Add(__lbl_fname, 0, wx.ALIGN_CENTER_VERTICAL, 0)
53 _gszr_main.Add(self._TCTRL_filename, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
54 __lbl_image = wx.StaticText(self, wx.ID_ANY, _("Image"))
55 __lbl_image.SetForegroundColour(wx.Colour(255, 0, 0))
56 _gszr_main.Add(__lbl_image, 0, wx.ALIGN_CENTER_VERTICAL, 0)
57 __szr_image.Add(self._BMP_image, 0, wx.ALIGN_CENTER | wx.ALL, 3)
58 __szr_image.Add(self._BTN_pick_image, 0, wx.ALIGN_CENTER_VERTICAL, 0)
59 _gszr_main.Add(__szr_image, 1, wx.EXPAND, 0)
60 self.SetSizer(_gszr_main)
61 _gszr_main.Fit(self)
62 _gszr_main.AddGrowableCol(1)
63 self.Layout()
64
65
67 print("Event handler '_on_pick_image_button_pressed' not implemented!")
68 event.Skip()
69
70
71