Beispiel #1
0
    def _initialize_window(self, parent, wxid):
        """ Initialize the window with the specified Id. """

        window = parent.FindWindowById(wxid)
        sizer = wx.BoxSizer(wx.VERTICAL)
        window.SetSizer(sizer)
        window.SetAutoLayout(True)

        window.SetBackgroundColour("white")
        window.SetWindowStyleFlag(wx.CLIP_CHILDREN)
        window.Refresh()
        image = ImageResource("closed_folder_24x24")
        bitmap = image.create_image().ConvertToBitmap()

        image_widget = ImageWidget(window, bitmap=bitmap)
        image_widget.control.SetBackgroundColour("white")
        sizer.Add(image_widget.control, 0, wx.EXPAND)

        text = wx.StaticText(window, -1, "Blah", style=wx.ALIGN_CENTRE)
        sizer.Add(text, 0, wx.EXPAND)

        # Resize the window to match the sizer's minimum size.
        sizer.Fit(window)

        return
Beispiel #2
0
    def _initialize_window(self, parent, wxid):
        """ Initialize the window with the specified Id. """

        window = parent.FindWindowById(wxid)
        sizer = wx.BoxSizer(wx.VERTICAL)
        window.SetSizer(sizer)
        window.SetAutoLayout(True)

        window.SetBackgroundColour('white')
        window.SetWindowStyleFlag(wx.CLIP_CHILDREN)
        window.Refresh()
        image = ImageResource('closed_folder_24x24')
        bitmap = image.create_image().ConvertToBitmap()

        image_widget = ImageWidget(window, bitmap=bitmap)
        image_widget.control.SetBackgroundColour('white')
        sizer.Add(image_widget.control, 0, wx.EXPAND)

        text = wx.StaticText(window, -1, "Blah", style=wx.ALIGN_CENTRE)
        sizer.Add(text, 0, wx.EXPAND)

        # Resize the window to match the sizer's minimum size.
        sizer.Fit(window)

        return
Beispiel #3
0
 def _get_image ( self ):
     path, name = split( self.file_name )
     if splitext( name )[1] in ( '.png', '.gif', '.jpg', '.jpeg' ):
         image = ImageResource( name, search_path = [ path ] )
     else:
         image = ImageResource( 'unknown' )
     self._cur_image = image.create_image()
     return image
Beispiel #4
0
 def _get_image(self):
     path, name = split(self.file_name)
     if splitext(name)[1] in (".png", ".gif", ".jpg", ".jpeg"):
         image = ImageResource(name, search_path=[path])
     else:
         image = ImageResource("unknown")
     self._cur_image = image.create_image()
     return image