#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-git/gnumed/gnumed/client/wxg/wxgBrandedDrugEAPnl.wxg"

import wx

# begin wxGlade: extracode
# end wxGlade



class wxgBrandedDrugEAPnl(wx.ScrolledWindow):
    def __init__(self, *args, **kwds):

        from Gnumed.wxpython import gmMedicationWidgets
        from Gnumed.wxpython import gmSubstanceMgmtWidgets
        from Gnumed.wxpython import gmPhraseWheel

        # begin wxGlade: wxgBrandedDrugEAPnl.__init__
        kwds["style"] = wx.NO_BORDER | wx.TAB_TRAVERSAL
        wx.ScrolledWindow.__init__(self, *args, **kwds)
        self._PRW_brand = gmSubstanceMgmtWidgets.cBrandedDrugPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
        self._PRW_preparation = gmMedicationWidgets.cSubstancePreparationPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
        self._CHBOX_is_fake = wx.CheckBox(self, wx.ID_ANY, _("Fake brand"))
        self._TCTRL_components = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
        self._BTN_manage_components = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
        self._HL_atc_list = wx.HyperlinkCtrl(self, wx.ID_ANY, _("ATC Code"), _("http://www.whocc.no/atc_ddd_index/"), style=wx.HL_ALIGN_CENTRE | wx.HL_CONTEXTMENU | wx.HL_DEFAULT_STYLE)
        self._PRW_atc = gmSubstanceMgmtWidgets.cATCPhraseWheel(self, wx.ID_ANY, "", style=wx.NO_BORDER)
        self._TCTRL_external_code = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY | wx.NO_BORDER)
        self._PRW_external_code_type = gmPhraseWheel.cPhraseWheel(self, wx.ID_ANY, "", style=wx.TE_READONLY | wx.NO_BORDER)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self._on_manage_components_button_pressed, self._BTN_manage_components)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: wxgBrandedDrugEAPnl.__set_properties
        self.SetScrollRate(10, 10)
        self._CHBOX_is_fake.SetForegroundColour(wx.Colour(255, 127, 0))
        self._CHBOX_is_fake.SetToolTipString(_("Mark as a fake: use if brand does not commercially exist and you want to create a \"generic\" brand."))
        self._TCTRL_components.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
        self._BTN_manage_components.SetToolTipString(_("Manage the components of this drug."))
        self._HL_atc_list.SetToolTipString(_("Browse ATC list."))
        self._TCTRL_external_code.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
        self._TCTRL_external_code.SetToolTipString(_("An external code for this drug.\n\nIn most cases either a national drug identifier or the ID of this drug in an external database.\n\nIn any case, GNUmed will never actively do anything with this code apart from display and making it available when passing this drug to external applications."))
        self._PRW_external_code_type.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
        self._PRW_external_code_type.SetToolTipString(_("The type of the external code of this drug, if any."))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: wxgBrandedDrugEAPnl.__do_layout
        _gszr_main = wx.FlexGridSizer(6, 2, 1, 3)
        __szr_external_code = wx.BoxSizer(wx.HORIZONTAL)
        __szr_prep = wx.BoxSizer(wx.HORIZONTAL)
        __lbl_brand = wx.StaticText(self, wx.ID_ANY, _("Brand name"))
        __lbl_brand.SetForegroundColour(wx.Colour(255, 0, 0))
        _gszr_main.Add(__lbl_brand, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        _gszr_main.Add(self._PRW_brand, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
        __lbl_preparation = wx.StaticText(self, wx.ID_ANY, _("Preparation"))
        __lbl_preparation.SetForegroundColour(wx.Colour(255, 0, 0))
        _gszr_main.Add(__lbl_preparation, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        __szr_prep.Add(self._PRW_preparation, 1, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 10)
        __szr_prep.Add(self._CHBOX_is_fake, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
        _gszr_main.Add(__szr_prep, 1, wx.EXPAND, 0)
        __lbl_components = wx.StaticText(self, wx.ID_ANY, _("Components"))
        __lbl_components.SetForegroundColour(wx.Colour(255, 0, 0))
        _gszr_main.Add(__lbl_components, 0, wx.TOP, 3)
        _gszr_main.Add(self._TCTRL_components, 1, wx.RIGHT | wx.EXPAND, 5)
        _gszr_main.Add((20, 20), 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
        _gszr_main.Add(self._BTN_manage_components, 0, wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 3)
        _gszr_main.Add(self._HL_atc_list, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        _gszr_main.Add(self._PRW_atc, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
        __lbl_external_code = wx.StaticText(self, wx.ID_ANY, _("External code"))
        _gszr_main.Add(__lbl_external_code, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        __szr_external_code.Add(self._TCTRL_external_code, 1, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 10)
        __lbl_external_code_type = wx.StaticText(self, wx.ID_ANY, _("Type:"))
        __szr_external_code.Add(__lbl_external_code_type, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
        __szr_external_code.Add(self._PRW_external_code_type, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
        _gszr_main.Add(__szr_external_code, 1, wx.EXPAND, 0)
        self.SetSizer(_gszr_main)
        _gszr_main.Fit(self)
        _gszr_main.AddGrowableRow(2)
        _gszr_main.AddGrowableCol(1)
        # end wxGlade

    def _on_manage_components_button_pressed(self, event): # wxGlade: wxgBrandedDrugEAPnl.<event_handler>
        print "Event handler `_on_manage_components_button_pressed' not implemented"
        event.Skip()

# end of class wxgBrandedDrugEAPnl


