Package Gnumed :: Package wxGladeWidgets :: Module wxgTagImageEAPnl
[frames] | no frames]

Source Code for Module Gnumed.wxGladeWidgets.wxgTagImageEAPnl

 1  # -*- coding: UTF-8 -*- 
 2  # 
 3  # generated by wxGlade 
 4  # 
 5   
 6  import wx 
 7   
 8  # begin wxGlade: dependencies 
 9  import gettext 
10  # end wxGlade 
11   
12  # begin wxGlade: extracode 
13  # end wxGlade 
14   
15   
16 -class wxgTagImageEAPnl(wx.ScrolledWindow):
17 - def __init__(self, *args, **kwds):
18 # begin wxGlade: wxgTagImageEAPnl.__init__ 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 # end wxGlade 32
33 - def __set_properties(self):
34 # begin wxGlade: wxgTagImageEAPnl.__set_properties 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 # end wxGlade 42
43 - def __do_layout(self):
44 # begin wxGlade: wxgTagImageEAPnl.__do_layout 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 # end wxGlade 65
66 - def _on_pick_image_button_pressed(self, event): # wxGlade: wxgTagImageEAPnl.<event_handler>
67 print("Event handler '_on_pick_image_button_pressed' not implemented!") 68 event.Skip()
69 70 # end of class wxgTagImageEAPnl 71