Gnumed.timelinelib.wxgui.components.welcomepanel

Package Gnumed :: Package timelinelib :: Package wxgui :: Package components :: Module welcomepanel |
[frames] | no frames]

# Source Code for Module Gnumed.timelinelib.wxgui.components.welcomepanel

     1  # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018  Rickard Lindberg, Roger Lindberg
     2  #
     3  # This file is part of Timeline.
     4  #
     5  # Timeline is free software: you can redistribute it and/or modify
     6  # it under the terms of the GNU General Public License as published by
     7  # the Free Software Foundation, either version 3 of the License, or
     8  # (at your option) any later version.
     9  #
    10  # Timeline is distributed in the hope that it will be useful,
    11  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  # GNU General Public License for more details.
    14  #
    15  # You should have received a copy of the GNU General Public License
    16  # along with Timeline.  If not, see <http://www.gnu.org/licenses/>.
    17
    18
    19  import wx.adv
    20
    21  from timelinelib.wxgui.components.hyperlinkbutton import HyperlinkButton
    22
    23
    24 -class WelcomePanel(wx.Panel):
    25
    26 -    def __init__(self, parent, main_frame):
    27          wx.Panel.__init__(self, parent)
    28          self.main_frame = main_frame
    29          self._create_gui()
    30
    31 -    def _create_gui(self):
    32          vsizer = wx.BoxSizer(wx.VERTICAL)
    33          # Text 1
    34          t1 = wx.StaticText(self, label=_("No timeline opened."))
    35          vsizer.Add(t1, flag=wx.ALIGN_CENTER_HORIZONTAL)
    36          # Spacer
    37          vsizer.AddSpacer(20)
    38          # Text 2
    39          t2 = wx.StaticText(self, label=_("First time using Timeline?"))
    40          vsizer.Add(t2, flag=wx.ALIGN_CENTER_HORIZONTAL)
    41          # Button
    42          btn_tutorial = HyperlinkButton(self, _("Getting started tutorial"))
    43          self.Bind(wx.adv.EVT_HYPERLINK, self._btn_tutorial_on_click, btn_tutorial)
    44          vsizer.Add(btn_tutorial, flag=wx.ALIGN_CENTER_HORIZONTAL)
    45          # Sizer
    46          hsizer = wx.BoxSizer(wx.HORIZONTAL)
    47          hsizer.Add(vsizer, flag=wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, proportion=1)
    48          self.SetSizer(hsizer)
    49
    50 -    def _btn_tutorial_on_click(self, e):
    51          self.main_frame.controller.open_timeline(":tutorial:")
    52
    53 -    def activated(self):
    54          pass
    55