Ejemplo n.º 1
0
    def _create_control(self, parent):
        # Get the splash screen image.
        image = self.image.create_image()

        splash_screen = wx.SplashScreen(
            # The bitmap to display on the splash screen.
            image.ConvertToBitmap(),
            # Splash Style.
            wx.SPLASH_NO_TIMEOUT | wx.SPLASH_CENTRE_ON_SCREEN,
            # Timeout in milliseconds (we don't currently timeout!).
            0,
            # The parent of the splash screen.
            parent,
            # wx Id.
            -1,
            # Window style.
            style = wx.SIMPLE_BORDER | wx.FRAME_NO_TASKBAR
        )

        # By default we create a font slightly bigger and slightly more italic
        # than the normal system font ;^)  The font is used inside the event
        # handler for 'EVT_PAINT'.
        self._wx_default_text_font = new_font_like(
            wx.NORMAL_FONT,
            point_size = wx.NORMAL_FONT.GetPointSize() + 1,
            style      = wx.ITALIC
        )

        # This allows us to write status text on the splash screen.
        wx.EVT_PAINT(splash_screen, self._on_paint)

        return splash_screen
    def _create_control(self, parent):
        # Get the splash screen image.
        image = self.image.create_image()

        splash_screen = adv.SplashScreen(
            # The bitmap to display on the splash screen.
            image.ConvertToBitmap(),
            # Splash Style.
            adv.SPLASH_NO_TIMEOUT | adv.SPLASH_CENTRE_ON_SCREEN,
            # Timeout in milliseconds (we don't currently timeout!).
            0,
            # The parent of the splash screen.
            parent,
            # wx Id.
            -1,
            # Window style.
            style=wx.SIMPLE_BORDER | wx.FRAME_NO_TASKBAR)

        # By default we create a font slightly bigger and slightly more italic
        # than the normal system font ;^)  The font is used inside the event
        # handler for 'EVT_PAINT'.
        self._wx_default_text_font = new_font_like(
            wx.NORMAL_FONT,
            point_size=wx.NORMAL_FONT.GetPointSize() + 1,
            style=wx.ITALIC)

        # This allows us to write status text on the splash screen.
        splash_screen.Bind(wx.EVT_PAINT, self._on_paint)

        return splash_screen
Ejemplo n.º 3
0
    def _create_control(self, parent):
        """ Create the toolkit-specific control that represents the widget. """

        collapsed_carat = self.collapsed_carat_image.create_image()
        self._collapsed_bmp = collapsed_carat.ConvertToBitmap()
        self._carat_w = self._collapsed_bmp.GetWidth()

        expanded_carat = self.expanded_carat_image.create_image()
        self._expanded_bmp = expanded_carat.ConvertToBitmap()

        # create our panel and initialize it appropriately
        sizer = wx.BoxSizer(wx.VERTICAL)
        panel = wx.Panel(parent, -1, style=wx.CLIP_CHILDREN | wx.BORDER_SIMPLE)
        panel.SetSizer(sizer)
        panel.SetAutoLayout(True)

        # create the remove button
        remove = wx.BitmapButton.NewCloseButton(panel, -1)
        sizer.Add(remove, 0, wx.ALIGN_RIGHT, 5)

        # Create a suitable font.
        self._font = new_font_like(
            wx.NORMAL_FONT, point_size=wx.NORMAL_FONT.GetPointSize() - 1
        )

        height = self._get_preferred_height(parent, self.title, self._font)
        panel.SetMinSize((-1, height+2))

        panel.Bind(wx.EVT_PAINT, self._on_paint)
        panel.Bind(wx.EVT_LEFT_DOWN, self._on_down)
        panel.Bind(wx.EVT_BUTTON, self._on_remove)

        return panel
Ejemplo n.º 4
0
    def _create_control(self, parent):
        """ Create the toolkit-specific control that represents the widget. """

        collapsed_carat = self.collapsed_carat_image.create_image()
        self._collapsed_bmp = collapsed_carat.ConvertToBitmap()
        self._carat_w = self._collapsed_bmp.GetWidth()

        expanded_carat = self.expanded_carat_image.create_image()
        self._expanded_bmp = expanded_carat.ConvertToBitmap()

        header_bar = self.header_bar_image.create_image()
        self._header_bmp = header_bar.ConvertToBitmap()

        header_bar_over = self.header_mouseover_image.create_image()
        self._header_mouseover_bmp = header_bar_over.ConvertToBitmap()

        self._background_bmp = self._header_bmp

        close_image = self.remove_image.create_image()
        self._remove_bmp = close_image.ConvertToBitmap()

        # create our panel and initialize it appropriately
        sizer = wx.BoxSizer(wx.VERTICAL)
        panel = wx.Panel(parent, -1, style=wx.CLIP_CHILDREN)
        panel.SetSizer(sizer)
        panel.SetAutoLayout(True)

        # needed on GTK systems for EVT_ERASE_BACKGROUND to work
        panel.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)

        # create the remove button
        remove = wx.BitmapButton(panel,
                                 -1,
                                 self._remove_bmp,
                                 style=0,
                                 pos=(-1, 3))
        sizer.Add(remove, 0, wx.ALIGN_RIGHT, 5)

        # Create a suitable font.
        self._font = new_font_like(wx.NORMAL_FONT,
                                   point_size=wx.NORMAL_FONT.GetPointSize() -
                                   1)

        height = self._get_preferred_height(parent, self.title, self._font)
        panel.SetSize((-1, height))

        wx.EVT_ERASE_BACKGROUND(panel, self._on_erase_background)
        wx.EVT_ENTER_WINDOW(panel, self._on_enter_leave)
        wx.EVT_LEAVE_WINDOW(panel, self._on_enter_leave)
        wx.EVT_LEFT_DOWN(panel, self._on_down)
        wx.EVT_RIGHT_DOWN(panel, self._on_down)

        wx.EVT_BUTTON(panel, remove.GetId(), self._on_remove)

        return panel
Ejemplo n.º 5
0
    def _create_control(self, parent):
        """ Create the toolkit-specific control that represents the widget. """

        collapsed_carat = self.collapsed_carat_image.create_image()
        self._collapsed_bmp = collapsed_carat.ConvertToBitmap()
        self._carat_w = self._collapsed_bmp.GetWidth()

        expanded_carat = self.expanded_carat_image.create_image()
        self._expanded_bmp = expanded_carat.ConvertToBitmap()

        header_bar = self.header_bar_image.create_image()
        self._header_bmp = header_bar.ConvertToBitmap()

        header_bar_over = self.header_mouseover_image.create_image()
        self._header_mouseover_bmp = header_bar_over.ConvertToBitmap()

        self._background_bmp = self._header_bmp

        close_image = self.remove_image.create_image()
        self._remove_bmp = close_image.ConvertToBitmap()

        # create our panel and initialize it appropriately
        sizer = wx.BoxSizer(wx.VERTICAL)
        panel = wx.Panel(parent, -1, style=wx.CLIP_CHILDREN)
        panel.SetSizer(sizer)
        panel.SetAutoLayout(True)

        # needed on GTK systems for EVT_ERASE_BACKGROUND to work
        panel.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)

        # create the remove button
        remove = wx.BitmapButton(panel, -1, self._remove_bmp, style=0,
                                 pos=(-1, 3))
        sizer.Add(remove, 0, wx.ALIGN_RIGHT, 5)

        # Create a suitable font.
        self._font = new_font_like(wx.NORMAL_FONT,
                                   point_size=wx.NORMAL_FONT.GetPointSize()- 1)

        height = self._get_preferred_height(parent, self.title, self._font)
        panel.SetSize((-1, height))

        wx.EVT_ERASE_BACKGROUND(panel, self._on_erase_background)
        wx.EVT_ENTER_WINDOW(panel, self._on_enter_leave)
        wx.EVT_LEAVE_WINDOW(panel, self._on_enter_leave)
        wx.EVT_LEFT_DOWN(panel, self._on_down)
        wx.EVT_RIGHT_DOWN(panel, self._on_down)

        wx.EVT_BUTTON(panel, remove.GetId(), self._on_remove)

        return panel
Ejemplo n.º 6
0
    def _create_control(self, parent):
        """ Create the toolkit-specific control that represents the widget. """

        # The background image (it is tiled).
        image = self.image.create_image()
        self._bmp = image.ConvertToBitmap()

        sizer = wx.BoxSizer(wx.VERTICAL)
        panel = wx.Panel(parent, -1, style=wx.CLIP_CHILDREN | wx.SIMPLE_BORDER)
        panel.SetSizer(sizer)
        panel.SetAutoLayout(True)

        # Create a suitable font.
        self._font = new_font_like(wx.NORMAL_FONT, family=wx.SWISS)

        width, height = self._get_preferred_size(self.text, self._font)
        panel.SetMinSize((width, height))

        wx.EVT_PAINT(panel, self._on_paint_background)
        wx.EVT_ERASE_BACKGROUND(panel, self._on_erase_background)

        return panel