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