Beispiel #1
0
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)

        self.log = log
        tID = wx.NewId()

        self.il = wx.ImageList(16, 16)

        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())

        self.list = TestListCtrl(
            self,
            tID,
            style=wx.LC_REPORT
            #| wx.BORDER_SUNKEN
            | wx.BORDER_NONE
            | wx.LC_EDIT_LABELS
            | wx.LC_SORT_ASCENDING
            #| wx.LC_NO_HEADER
            #| wx.LC_VRULES
            #| wx.LC_HRULES
            #| wx.LC_SINGLE_SEL
        )

        self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        self.PopulateList()

        # Now that the list exists we can init the other base class,
        # see wx/lib/mixins/listctrl.py
        self.itemDataMap = musicdata
        listmix.ColumnSorterMixin.__init__(self, 3)
        #self.SortListItems(0, True)

        self.Bind(wx.EVT_SIZE, self.OnSize)

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.list)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected,
                  self.list)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list)
        self.Bind(wx.EVT_LIST_DELETE_ITEM, self.OnItemDelete, self.list)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick, self.list)
        self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColRightClick, self.list)
        self.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.OnColBeginDrag, self.list)
        self.Bind(wx.EVT_LIST_COL_DRAGGING, self.OnColDragging, self.list)
        self.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnColEndDrag, self.list)
        self.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginEdit, self.list)

        self.list.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
        self.list.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)

        # for wxMSW
        self.list.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)

        # for wxGTK
        self.list.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
Beispiel #2
0
    def __init__(self, parent, app):
        wxPanel.__init__(self, parent, -1, style=wxWANTS_CHARS)
        # wxTAB_TRAVERSAL)

        tID = wxNewId()

        self.il = wxImageList(16, 16)

        self.app = app

        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())

        self.list = TransferListCtrl(
            self,
            tID,
            style=wxLC_REPORT | wxLC_EDIT_LABELS  # | wxSUNKEN_BORDER
            # | wxLC_VRULES | wxLC_HRULES
            | wxLC_HRULES,
            size=(100, 100),
            pos=(50, 50),
        )
        self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL)

        self.itemDataMap = {}

        self.SetupList()
        # TODO: Column sorting is disabled now because nick2index loses
        # its associations and starts writing to the wrong column.
        # wxColumnSorterMixin.__init__(self, 3)

        # XXX: These are left over from wxListCtrl demo.
        # TODO: Do something useful with them
        EVT_SIZE(self, self.OnSize)
        EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
        EVT_LIST_ITEM_DESELECTED(self, tID, self.OnItemDeselected)
        EVT_LIST_ITEM_ACTIVATED(self, tID, self.OnItemActivated)
        EVT_LIST_DELETE_ITEM(self, tID, self.OnItemDelete)
        EVT_LIST_COL_CLICK(self, tID, self.OnColClick)
        EVT_LIST_COL_RIGHT_CLICK(self, tID, self.OnColRightClick)
        EVT_LIST_COL_BEGIN_DRAG(self, tID, self.OnColBeginDrag)
        EVT_LIST_COL_DRAGGING(self, tID, self.OnColDragging)
        EVT_LIST_COL_END_DRAG(self, tID, self.OnColEndDrag)
        # Begin and end rename
        EVT_LIST_BEGIN_LABEL_EDIT(self, tID, self.OnBeginEdit)
        EVT_LIST_END_LABEL_EDIT(self, tID, self.OnEndEdit)

        EVT_LEFT_DCLICK(self.list, self.OnDoubleClick)
        EVT_RIGHT_DOWN(self.list, self.OnRightDown)

        # for wxMSW
        EVT_COMMAND_RIGHT_CLICK(self.list, tID, self.OnRightClick)

        # for wxGTK
        EVT_RIGHT_UP(self.list, self.OnRightClick)
Beispiel #3
0
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)

        self.log = log
        tID = wx.NewId()

        self.il = wx.ImageList(16, 16)

        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())

        self.list = TestListCtrl(self, tID,
                                 style=wx.LC_REPORT 
                                 #| wx.BORDER_SUNKEN
                                 | wx.BORDER_NONE
                                 | wx.LC_EDIT_LABELS
                                 | wx.LC_SORT_ASCENDING
                                 #| wx.LC_NO_HEADER
                                 #| wx.LC_VRULES
                                 #| wx.LC_HRULES
                                 #| wx.LC_SINGLE_SEL
                                 )
        
        self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        self.PopulateList()

        # Now that the list exists we can init the other base class,
        # see wx/lib/mixins/listctrl.py
        self.itemDataMap = musicdata
        listmix.ColumnSorterMixin.__init__(self, 3)
        #self.SortListItems(0, True)

        self.Bind(wx.EVT_SIZE, self.OnSize)

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.list)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected, self.list)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list)
        self.Bind(wx.EVT_LIST_DELETE_ITEM, self.OnItemDelete, self.list)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick, self.list)
        self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColRightClick, self.list)
        self.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.OnColBeginDrag, self.list)
        self.Bind(wx.EVT_LIST_COL_DRAGGING, self.OnColDragging, self.list)
        self.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnColEndDrag, self.list)
        self.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginEdit, self.list)

        self.list.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
        self.list.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)

        # for wxMSW
        self.list.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)

        # for wxGTK
        self.list.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
Beispiel #4
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)

        tID = wx.NewId()

        self.il = wx.ImageList(16, 16)

        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
        self.file1Idx = self.il.Add(images.getFile1Bitmap())

        self.list = MyListCtrl(
            self,
            tID,
            style=wx.LC_REPORT | wx.SUNKEN_BORDER
            | wx.LC_EDIT_LABELS
            #| wx.LC_NO_HEADER
            #| wx.LC_VRULES | wx.LC_HRULES
        )
        self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        self.PopulateList()

        # Now that the list exists we can init the other base class,
        # see wxPython/lib/mixins/listctrl.py
        ColumnSorterMixin.__init__(self, 3)
        #self.SortListItems(0, True)

        EVT_SIZE(self, self.OnSize)
        EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
        EVT_LIST_ITEM_DESELECTED(self, tID, self.OnItemDeselected)
        EVT_LIST_ITEM_ACTIVATED(self, tID, self.OnItemActivated)
        EVT_LIST_DELETE_ITEM(self, tID, self.OnItemDelete)
        EVT_LIST_COL_CLICK(self, tID, self.OnColClick)
        EVT_LIST_COL_RIGHT_CLICK(self, tID, self.OnColRightClick)
        EVT_LIST_COL_BEGIN_DRAG(self, tID, self.OnColBeginDrag)
        EVT_LIST_COL_DRAGGING(self, tID, self.OnColDragging)
        EVT_LIST_COL_END_DRAG(self, tID, self.OnColEndDrag)
        EVT_LIST_BEGIN_LABEL_EDIT(self, tID, self.OnBeginEdit)

        EVT_LEFT_DCLICK(self.list, self.OnDoubleClick)
        EVT_RIGHT_DOWN(self.list, self.OnRightDown)

        # for wxMSW
        EVT_COMMAND_RIGHT_CLICK(self.list, tID, self.OnRightClick)

        # for wxGTK
        EVT_RIGHT_UP(self.list, self.OnRightClick)
Beispiel #5
0
    def __init__(self, parent, ID, pos=wxDefaultPosition,
                 size=wxDefaultSize, style=wxLC_REPORT|wxLC_VIRTUAL|wxSUNKEN_BORDER):#|wxLC_VRULES|wxLC_HRULES):
        wxListCtrl.__init__(self, parent, ID, pos, size, style)
        wxListCtrlAutoWidthMixin.__init__(self)
        self.columntitles = [("title", "Title"),
                             ("publicname", "Public Name"),
                             ("TVsourceurl", "URL"),
                             ("TVlastnewitem", "Last new Item"),
                             ("TVitemsfetched", "Items Fetched"),
                             ("TVlastfetched", "Last Request")]
        self.columntokey = []

        pos = 0
        for key, title in self.columntitles:
            self.InsertColumn(pos, title)
            pos += 1
            self.columntokey.append(key)
        #self.SetColumnWidth(0, 175)
        #self.SetColumnWidth(1, 175)
        #self.SetColumnWidth(2, 175)
        
        self.itemlist = ListCtrlItemList()
        self.SetItemCount(len(self.itemlist))

        self.il = wxImageList(16, 16)
        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())

        numColumns = self.GetColumnCount()
        self._colSortFlag = [0] * numColumns
        self._col = -1

        # WDR: handler declarations for ServiceList
        EVT_LIST_ITEM_ACTIVATED(self, self.GetId(), self.OnItemactivated)
        EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.OnItemselected)
        EVT_LIST_DELETE_ALL_ITEMS(self, self.GetId(), self.OnDeleteallitems)
        EVT_LIST_DELETE_ITEM(self, self.GetId(), self.OnDeleteitem)
        EVT_LIST_END_LABEL_EDIT(self, self.GetId(), self.OnLabeledit)
        EVT_LIST_ITEM_RIGHT_CLICK(self, self.GetId(), self.OnItemrightclick)
        EVT_LIST_INSERT_ITEM(self, self.GetId(), self.OnInsertitem)
        EVT_LIST_ITEM_DESELECTED(self, self.GetId(), self.OnItemdeselected)
        EVT_LIST_COL_CLICK(self, self.GetId(), self.OnColClick)
Beispiel #6
0
 def __init__(self, parent, addon):
     """ Creates a new advanced restore dialog and populates it with available downgrades """
     
     wx.Dialog.__init__(self, parent, 10002, _("Advanced Restore: %(name)s") % {'name': addon.localname})
     
     # Resources
     self.il    = wx.ImageList(16, 16)
     self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
     self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
     
     # Controls
     gbsizer = wx.GridBagSizer(2, 2)
     self.lc = ListCtrlAutoWidth(self, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_SORT_ASCENDING | wx.LC_SINGLE_SEL)
     self.lc.InsertColumn(0, _("File"))
     self.lc.InsertColumn(1, _("Version"), format=wx.LIST_FORMAT_CENTRE)
     self.lc.InsertColumn(2, _("Source"))
     self.lc.SetColumnWidth(0, 160)
     self.lc.SetColumnWidth(1, 100)
     self.lc.SetColumnWidth(2, 100)
     
     self.lc.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
     
     gbsizer.Add(self.lc, (0, 0), flag=wx.EXPAND)
     gbsizer.AddGrowableRow(0)
     gbsizer.AddGrowableCol(0)
     
     # Add Buttons
     btnOnlineVersions = wx.Button(self, wx.ID_ADD, _("Add online versions"))
     self.Bind(wx.EVT_BUTTON, self.OnAddOnlineVersions, btnOnlineVersions)
     btnOnlineVersions.Disable()
     btnOk = wx.Button(self, wx.ID_OK, _("Restore"))
     self.Bind(wx.EVT_BUTTON, self.OnRestore, btnOk)
     btnCancel = wx.Button(self, wx.ID_CANCEL, "") #_("Cancel"))
     
     # put the buttons into a buttonsizer
     btnSizer = wx.StdDialogButtonSizer()
     btnSizer.AddButton(btnOnlineVersions)
     btnSizer.AddButton(btnOk)
     btnSizer.AddButton(btnCancel)
     btnSizer.SetNegativeButton(btnOnlineVersions) # just used to position the button
     btnSizer.SetAffirmativeButton(btnOk)
     btnSizer.SetCancelButton(btnCancel)
     btnSizer.Realize()
     
     # add button sizer
     gbsizer.Add(btnSizer, (1, 0))
     
     self.SetSizer(gbsizer)
     
     # List Sorting
     listmix.ColumnSorterMixin.__init__(self, 4)
     self._colSortFlag[1] = -1 # Sort Descending on first click
     
     self.restoreaddon = addon
     
     self._populateList()
     if self.lc.GetItemCount() > 0:
         # Select the first entry
         self.lc.Select(0)
         self.lc.Focus(0)
     else:
         btnOk.Disable()
         
     positionDialog(self)
Beispiel #7
0
 def __init__(self, parent, addonlist, addontoclist, settingslist, addonsite):
     """"""
     tracer.debug("WurmAddonInstallDlg - __init__")
     
     self.title  = _("Install %(site)s Addons") % {'site': addonsite}
     self.oldfilter = ""
     self.filterok  = True
     # The SearchCtrl only became available in wx version 2.8.0.1
     if wx.VERSION[:2] < (2, 8):
         self.filterok = False
     
     wx.Dialog.__init__(self, parent, title=self.title, size=(660, 400), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
     
     # Initialize dictionaries
     self.addonlist    = addonlist
     self.addontoclist = addontoclist
     self.settingslist = settingslist
     self.toInstall    = []
     
     # Counts for displaying in the title line
     self.countt = len(self.addonlist)
     self.counti = 0
     self.countf = len(self.toInstall)
     
     # Resources
     self.il    = wx.ImageList(16, 16)
     self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
     self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
     
     # Controls
     gbsizer = wx.GridBagSizer(2, 2)
     self.lc = ListCtrlAutoWidth(self, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_SORT_ASCENDING)
     self.lc.InsertColumn(0, _("Name"))
     self.lc.InsertColumn(1, _("Ins?"), format=wx.LIST_FORMAT_CENTRE)
     self.lc.InsertColumn(2, _("Version"))
     self.lc.InsertColumn(3, _("Note"))
     
     self.lc.SetColumnWidth(0, 150)
     self.lc.SetColumnWidth(1, 40)
     self.lc.SetColumnWidth(2, 50)
     self.lc.SetColumnWidth(3, 200)
     
     self.lc.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
     
     gbsizer.Add(self.lc, (0, 0), flag=wx.EXPAND)
     gbsizer.AddGrowableRow(0)
     gbsizer.AddGrowableCol(0)
     
     # Add Buttons
     self.btnToggle = wx.Button(self, wx.ID_ANY, _("Toggle Install"))
     self.btnClose  = wx.Button(self, wx.ID_CLOSE, _("Close and Download"))
     self.btnCancel = wx.Button(self, wx.ID_CANCEL, "") #_("Cancel"))
     
     # Put them all in a BoxSizer
     hbox = wx.BoxSizer(wx.HORIZONTAL)
     hbox.Add(self.btnToggle, proportion=1)
     hbox.Add(self.btnClose, proportion=1)
     hbox.Add(self.btnCancel, proportion=1)
     
     if self.filterok:
         self.filter = wx.SearchCtrl(self, style=wx.TE_PROCESS_ENTER)
         self.filter.SetDescriptiveText("Search")
         self.filter.ShowCancelButton(True)
         self.filter.SetToolTip(wx.ToolTip(_("Enter a string to search for in the Name or Note")))
     
     if self.filterok:
         hbox.Add(self.filter, proportion=1)
         
     gbsizer.Add(hbox, (1, 0))
     
     self.SetSizer(gbsizer)
     
     # Bind Events to their handlers
     self.Bind(wx.EVT_BUTTON, self.OnToggle, self.btnToggle)
     self.Bind(wx.EVT_BUTTON, self.OnClickClose, self.btnClose)
     self.Bind(wx.EVT_BUTTON, self.OnCancel, self.btnCancel)
     if self.filterok:
         self.Bind(wx.EVT_TEXT_ENTER, self.OnFilterChanged, self.filter)
         self.Bind(wx.EVT_TEXT, self.OnFilterChanged, self.filter)
         self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancelFilter, self.filter)
     self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
     
     # List Sorting
     listmix.ColumnSorterMixin.__init__(self,4)
     self._colSortFlag[1] = -1 # Sort Descending on first click
     
     # Type Ahead mixin
     WurmUtility.TypeAheadListCtrlMixin.__init__(self)
     
     try:
         # Load the List Control
         self.RefreshAddonList()
     except Exception, details:
         logger.exception("Error refreshing the Addon List, %s" % (str(details)))
Beispiel #8
0
    def __init__(self, parent, id):
        wxPanel.__init__(self, parent, id)
        self.SetAutoLayout(True)
        sizer = wxBoxSizer(wxHORIZONTAL)
        self.SetBackgroundColour(wxColour(222, 222, 222))
        #-----------------------------------------------------
        #create imagelist for use by the lists in the notebook
        #e.g the icons to sort the columns up and down
        #-----------------------------------------------------
        self.ListsImageList = wxImageList(16, 16)
        self.small_arrow_up = self.ListsImageList.Add(
            images.getSmallUpArrowBitmap())
        self.small_arrow_down = self.ListsImageList.Add(
            images.getSmallDnArrowBitmap())
        #------------------------------------------------------------------------
        #----------------------------------------------------------------------
        #Add a notebook control to hold the lists of things eg scripts, recalls
        #----------------------------------------------------------------------
        #self.notebook1 = Notebook(self, -1, wxDefaultPosition, wxDefaultSize, style = 0)
        self.notebook1 = Notebook(self, -1)
        #-------------------------------------------------------------------------
        #Associate an imagelist with the notebook and add images to the image list
        #-------------------------------------------------------------------------
        tabimage_Script = tabimage_Requests = tabimage_Requests = tabimage_Requests = tabimage_Requests = tabimage_Requests = -1
        self.notebook1.il = wxImageList(16, 16)
        tabimage_Script = self.notebook1.il.Add(
            self.getBitmap(self.__icons_script[_("""icon_Rx_symbol""")]))
        tabimage_Requests = self.notebook1.il.Add(
            self.getBitmap(self.__icons_requests[_("""icon_blood_sample""")]))
        tabimage_Measurements = self.notebook1.il.Add(
            self.getBitmap(
                self.__icons_measurements[_("""icon_Set_Square""")]))
        tabimage_Referrals = self.notebook1.il.Add(
            self.getBitmap(self.__icons_referrals[_("""icon_writing_pen""")]))
        tabimage_Recalls = self.notebook1.il.Add(
            self.getBitmap(self.__icons_recalls[_("""icon_talking_head""")]))
        tabimage_Inbox = self.notebook1.il.Add(
            self.getBitmap(self.__icons_inbox[_("""icon_inbox""")]))
        self.notebook1.SetImageList(self.notebook1.il)
        szr_notebook = wxNotebookSizer(self.notebook1)
        #----------------------------------------------------------------------------------
        #now create the lists that will sit on the notebook pages, and add them to the page
        #----------------------------------------------------------------------------------
        szr_script_page = wxBoxSizer(wxVERTICAL)
        ListScript_ID = wxNewId(
        )  #can use wxLC_VRULES to put faint cols in list
        self.List_Script = wxListCtrl(self.notebook1, ListScript_ID,
                                      wxDefaultPosition, wxDefaultSize,
                                      wxLC_REPORT | wxSUNKEN_BORDER)
        szr_script_page.Add(self.List_Script, 100, wxEXPAND)
        self.List_Script.SetForegroundColour(wxColor(131, 129, 131))
        self.List_Requests = wxListCtrl(self.notebook1, -1, wxDefaultPosition,
                                        wxDefaultSize, wxSUNKEN_BORDER)
        self.List_Measurements = wxListCtrl(self.notebook1, -1,
                                            wxDefaultPosition, wxDefaultSize,
                                            wxSUNKEN_BORDER)
        self.List_Referrals = wxListCtrl(self.notebook1, -1, wxDefaultPosition,
                                         wxDefaultSize, wxSUNKEN_BORDER)
        self.List_Recalls = wxListCtrl(self.notebook1, -1, wxDefaultPosition,
                                       wxDefaultSize, wxSUNKEN_BORDER)
        self.List_Inbox = wxListCtrl(self.notebook1, -1, wxDefaultPosition,
                                     wxDefaultSize, wxSUNKEN_BORDER)

        self.notebook1.AddPage(self.List_Script, '', True, tabimage_Script)
        #self.notebook1.AddPage(True, tabimage_Inbox, szr_script_page, '')
        self.notebook1.AddPage(self.List_Requests, '', True, tabimage_Requests)
        self.notebook1.AddPage(self.List_Measurements, '', True,
                               tabimage_Measurements)
        self.notebook1.AddPage(self.List_Referrals, '', True,
                               tabimage_Referrals)
        self.notebook1.AddPage(self.List_Recalls, '', True, tabimage_Recalls)
        self.notebook1.AddPage(self.List_Inbox, '', True, tabimage_Inbox)
        self.notebook1.SetSelection(0)  #start on scriptpage
        #--------------------------------------
        #Now lets do things to the script list:
        #--------------------------------------
        self.List_Script.SetImageList(self.ListsImageList, wxIMAGE_LIST_SMALL)
        #------------------------------------------------------------------------
        # since we want images on the column header we have to do it the hard way
        #------------------------------------------------------------------------
        info = wxListItem()
        info.Mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE | wxLIST_MASK_FORMAT
        info.Image = -1
        info.Align = 0
        info.Text = _("Drug")
        self.List_Script.InsertColumnInfo(0, info)

        info.Align = wxLIST_FORMAT_LEFT
        info.Text = _("Dose")
        self.List_Script.InsertColumnInfo(1, info)

        info.Align = wxLIST_FORMAT_RIGHT
        info.Text = _("Instructions")
        self.List_Script.InsertColumnInfo(2, info)

        info.Align = wxLIST_FORMAT_RIGHT
        info.Text = _("Last Date")
        self.List_Script.InsertColumnInfo(3, info)

        info.Align = wxLIST_FORMAT_RIGHT
        info.Text = _("Prescribed For")
        self.List_Script.InsertColumnInfo(4, info)

        info.Align = wxLIST_FORMAT_RIGHT
        info.Text = _("Quantity")
        self.List_Script.InsertColumnInfo(5, info)

        info.Align = 0
        info.Text = _("First Date")
        self.List_Script.InsertColumnInfo(6, info)
        #-------------------------------------------------------------
        #loop through the scriptdata array and add to the list control
        #note the different syntax for the first coloum of each row
        #i.e. here > self.List_Script.InsertItem(x, data[0])!!
        #-------------------------------------------------------------
        items = scriptdata.items()
        for x in range(len(items)):
            key, data = items[x]
            #<DEBUG>
            gmLog.gmDefLog.Log(gmLog.lData, items[x])
            #</DEBUG>
            #print x, data[0],data[1],data[2]
            self.List_Script.InsertItem(x, data[0])
            self.List_Script.SetItem(x, 1, data[1])
            self.List_Script.SetItem(x, 2, data[2])
            self.List_Script.SetItem(x, 3, data[3])
            self.List_Script.SetItem(x, 4, data[4])
            self.List_Script.SetItem(x, 5, data[5])
            self.List_Script.SetItem(x, 6, data[6])
            self.List_Script.SetItemData(x, key)
        #--------------------------------------------------------
        #note the number pased to the wxColumnSorterMixin must be
        #the 1 based count of columns
        #--------------------------------------------------------
        self.itemDataMap = scriptdata
        #wxColumnSorterMixin.__init__(self, 5)              #I excluded first date as it didn't sort

        self.List_Script.SetColumnWidth(0, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(1, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(2, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(3, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(4, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(5, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(6, 150)
        sizer.AddSizer(szr_notebook, 40, wxEXPAND)
        self.SetSizer(sizer)  #set the sizer
        sizer.Fit(self)  #set to minimum size as calculated by sizer
        self.SetAutoLayout(True)  #tell frame to use the sizer
        self.Show(True)
Beispiel #9
0
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)

        self.log = log
        tID = wx.NewId()
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        
        if wx.Platform == "__WXMAC__" and \
               hasattr(wx.GetApp().GetTopWindow(), "LoadDemo"):
            self.useNative = wx.CheckBox(self, -1, "Use native listctrl")
            self.useNative.SetValue( 
                not wx.SystemOptions.GetOptionInt("mac.listctrl.always_use_generic") )
            self.Bind(wx.EVT_CHECKBOX, self.OnUseNative, self.useNative)
            sizer.Add(self.useNative, 0, wx.ALL | wx.ALIGN_RIGHT, 4)
            
        self.il = wx.ImageList(16, 16)

        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())

        self.list = TestListCtrl(self, tID,
                                 style=wx.LC_REPORT 
                                 #| wx.BORDER_SUNKEN
                                 | wx.BORDER_NONE
                                 | wx.LC_EDIT_LABELS
                                 | wx.LC_SORT_ASCENDING
                                 #| wx.LC_NO_HEADER
                                 #| wx.LC_VRULES
                                 #| wx.LC_HRULES
                                 #| wx.LC_SINGLE_SEL
                                 )
        
        self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
        sizer.Add(self.list, 1, wx.EXPAND)

        self.PopulateList()

        # Now that the list exists we can init the other base class,
        # see wx/lib/mixins/listctrl.py
        self.itemDataMap = musicdata
        listmix.ColumnSorterMixin.__init__(self, 3)
        #self.SortListItems(0, True)

        self.SetSizer(sizer)
        self.SetAutoLayout(True)

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.list)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected, self.list)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list)
        self.Bind(wx.EVT_LIST_DELETE_ITEM, self.OnItemDelete, self.list)
        self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick, self.list)
        self.Bind(wx.EVT_LIST_COL_RIGHT_CLICK, self.OnColRightClick, self.list)
        self.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.OnColBeginDrag, self.list)
        self.Bind(wx.EVT_LIST_COL_DRAGGING, self.OnColDragging, self.list)
        self.Bind(wx.EVT_LIST_COL_END_DRAG, self.OnColEndDrag, self.list)
        self.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginEdit, self.list)

        self.list.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
        self.list.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)

        # for wxMSW
        self.list.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)

        # for wxGTK
        self.list.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
Beispiel #10
0
    def __init__(self, parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize,
            style=0):
        wx.ListCtrl.__init__(self, parent, id, pos, size, style)

        self.showUpPayment = Decimal('0.00')

        # for ColumnSorterMixin: a dictionary of lists, one for each row (data
        # item) which basically replicates what the list contains, but is
        # sortable (e.g. numbers are numbers rather than strings).  Indexed by
        # integers 0 to n.
        self.itemDataMap = {}

        self.numCols = 8  # number of columns
    
        # Hard way to create columns, because we need images (sort arrows)
        info = wx.ListItem()
        info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE \
                | wx.LIST_MASK_FORMAT
        info.m_image = -1
        info.m_format = 0
        info.m_text = 'ID'
        self.InsertColumnInfo(0, info)
        info.m_text = 'IP Address'
        self.InsertColumnInfo(1, info)
        info.m_text = 'Name'
        self.InsertColumnInfo(2, info)
        info.m_text = 'Status'
        self.InsertColumnInfo(3, info)
        info.m_format = wx.LIST_FORMAT_RIGHT
        info.m_text = 'Game Earnings ($)'
        self.InsertColumnInfo(4, info)
        info.m_text = 'Rounded Earnings ($)'
        self.InsertColumnInfo(5, info)
        info.m_text = 'Show-up Payment ($)'
        self.InsertColumnInfo(6, info)
        info.m_text = 'Total Earnings ($)'
        self.InsertColumnInfo(7, info)

        # This is the widest each column has ever been after an automatic
        # resize.  They will never be auto-resized smaller than this.
        self.maxColumnWidths = [0] * self.numCols
        for i in range(self.numCols):
            self.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER)
            self.maxColumnWidths[i] = self.GetColumnWidth(i)

            # Unfortunately, AUTOSIZE_USE_HEADER doesn't take images into
            # account, so even if we put sort arrow images in all the headers to
            # begin with, they end up too small to accommodate the arrows.  So
            # we'll add a few pixels here:
            self.maxColumnWidths[i] += 16
            self.SetColumnWidth(i, self.maxColumnWidths[i])

        # Maybe the name is misleading: it just tells updateClient() whether to
        # do a resizeColumns() next time it is called.  updateClients() sets it
        # to false to avoid doing a resize for every updated client when
        # updating multiple clients.
        self.columnsNeedResize = True

        self.sortColumn = 0

        self.Bind(wx.EVT_LIST_COL_CLICK, self.onHeaderClicked)

        # Right-clicking has some platform differences.  Windows sends an
        # EVT_COMMAND_RIGHT_CLICK while GTK sends an EVT_RIGHT_UP.  We need to
        # know the location of the click.  EVT_RIGHT_UP has GetX()/GetY(), but
        # EVT_COMMAND_RIGHT_CLICK doesn't and it crashes.  But both platforms
        # have an EVT_RIGHT_DOWN that seems to work the same way, so we get the
        # location of the click in EVT_RIGHT_DOWN, and the UP/CLICK event comes
        # later and pops up the menu.
        self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown)
        # for wxMSW:
        self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.onRightClick)
        # for wxGTK:
        self.Bind(wx.EVT_RIGHT_UP, self.onRightClick)

        # Sort arrow bitmaps
        self.il = wx.ImageList(16, 16)
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
        self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        # needs to be after the Bind
        ColumnSorterMixin.__init__(self, self.numCols)
    def __init__(self,
                 parent,
                 id,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=0):
        wx.ListCtrl.__init__(self, parent, id, pos, size, style)

        self.showUpPayment = Decimal('0.00')

        # for ColumnSorterMixin: a dictionary of lists, one for each row (data
        # item) which basically replicates what the list contains, but is
        # sortable (e.g. numbers are numbers rather than strings).  Indexed by
        # integers 0 to n.
        self.itemDataMap = {}

        self.numCols = 8  # number of columns

        # Hard way to create columns, because we need images (sort arrows)
        info = wx.ListItem()
        info.m_mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_IMAGE \
                | wx.LIST_MASK_FORMAT
        info.m_image = -1
        info.m_format = 0
        info.m_text = 'ID'
        self.InsertColumnInfo(0, info)
        info.m_text = 'IP Address'
        self.InsertColumnInfo(1, info)
        info.m_text = 'Name'
        self.InsertColumnInfo(2, info)
        info.m_text = 'Status'
        self.InsertColumnInfo(3, info)
        info.m_format = wx.LIST_FORMAT_RIGHT
        info.m_text = 'Game Earnings ($)'
        self.InsertColumnInfo(4, info)
        info.m_text = 'Rounded Earnings ($)'
        self.InsertColumnInfo(5, info)
        info.m_text = 'Show-up Payment ($)'
        self.InsertColumnInfo(6, info)
        info.m_text = 'Total Earnings ($)'
        self.InsertColumnInfo(7, info)

        # This is the widest each column has ever been after an automatic
        # resize.  They will never be auto-resized smaller than this.
        self.maxColumnWidths = [0] * self.numCols
        for i in range(self.numCols):
            self.SetColumnWidth(i, wx.LIST_AUTOSIZE_USEHEADER)
            self.maxColumnWidths[i] = self.GetColumnWidth(i)

            # Unfortunately, AUTOSIZE_USE_HEADER doesn't take images into
            # account, so even if we put sort arrow images in all the headers to
            # begin with, they end up too small to accommodate the arrows.  So
            # we'll add a few pixels here:
            self.maxColumnWidths[i] += 16
            self.SetColumnWidth(i, self.maxColumnWidths[i])

        # Maybe the name is misleading: it just tells updateClient() whether to
        # do a resizeColumns() next time it is called.  updateClients() sets it
        # to false to avoid doing a resize for every updated client when
        # updating multiple clients.
        self.columnsNeedResize = True

        self.sortColumn = 0

        self.Bind(wx.EVT_LIST_COL_CLICK, self.onHeaderClicked)

        # Right-clicking has some platform differences.  Windows sends an
        # EVT_COMMAND_RIGHT_CLICK while GTK sends an EVT_RIGHT_UP.  We need to
        # know the location of the click.  EVT_RIGHT_UP has GetX()/GetY(), but
        # EVT_COMMAND_RIGHT_CLICK doesn't and it crashes.  But both platforms
        # have an EVT_RIGHT_DOWN that seems to work the same way, so we get the
        # location of the click in EVT_RIGHT_DOWN, and the UP/CLICK event comes
        # later and pops up the menu.
        self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown)
        # for wxMSW:
        self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.onRightClick)
        # for wxGTK:
        self.Bind(wx.EVT_RIGHT_UP, self.onRightClick)

        # Sort arrow bitmaps
        self.il = wx.ImageList(16, 16)
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
        self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        # needs to be after the Bind
        ColumnSorterMixin.__init__(self, self.numCols)
Beispiel #12
0
    def __init__(self, parent,id):
	wxPanel.__init__(self, parent, id)
	self.SetAutoLayout(True)
	sizer = wxBoxSizer(wxHORIZONTAL)
	self.SetBackgroundColour(wxColour(222,222,222))
       	#-----------------------------------------------------
	#create imagelist for use by the lists in the notebook
	#e.g the icons to sort the columns up and down
	#-----------------------------------------------------
	self.ListsImageList= wxImageList(16,16)
	self.small_arrow_up = self.ListsImageList.Add(images.getSmallUpArrowBitmap())
        self.small_arrow_down = self.ListsImageList.Add(images.getSmallDnArrowBitmap())
	#------------------------------------------------------------------------
	#----------------------------------------------------------------------
	#Add a notebook control to hold the lists of things eg scripts, recalls
	#----------------------------------------------------------------------
	#self.notebook1 = Notebook(self, -1, wxDefaultPosition, wxDefaultSize, style = 0)
        self.notebook1 = Notebook(self, -1)
	#-------------------------------------------------------------------------
	#Associate an imagelist with the notebook and add images to the image list
	#-------------------------------------------------------------------------
	tabimage_Script = tabimage_Requests = tabimage_Requests = tabimage_Requests = tabimage_Requests = tabimage_Requests = -1
        self.notebook1.il = wxImageList(16, 16)
	tabimage_Script = self.notebook1.il.Add(self.getBitmap(self.__icons_script[_("""icon_Rx_symbol""")]))
	tabimage_Requests = self.notebook1.il.Add( self.getBitmap(self.__icons_requests[_("""icon_blood_sample""")]))
	tabimage_Measurements = self.notebook1.il.Add( self.getBitmap(self.__icons_measurements[_("""icon_Set_Square""")]))
	tabimage_Referrals = self.notebook1.il.Add( self.getBitmap(self.__icons_referrals[_("""icon_writing_pen""")]))
	tabimage_Recalls = self.notebook1.il.Add(self.getBitmap(self.__icons_recalls[_("""icon_talking_head""")]))
	tabimage_Inbox = self.notebook1.il.Add(self.getBitmap(self.__icons_inbox[_("""icon_inbox""")]))
	self.notebook1.SetImageList(self.notebook1.il)
	szr_notebook = wxNotebookSizer(self.notebook1)
	#----------------------------------------------------------------------------------
	#now create the lists that will sit on the notebook pages, and add them to the page
	#----------------------------------------------------------------------------------
	szr_script_page= wxBoxSizer(wxVERTICAL)
	ListScript_ID = wxNewId()                                                         #can use wxLC_VRULES to put faint cols in list
       	self.List_Script = wxListCtrl(self.notebook1, ListScript_ID,  wxDefaultPosition, wxDefaultSize,wxLC_REPORT|wxSUNKEN_BORDER)
        szr_script_page.Add(self.List_Script,100,wxEXPAND)
        self.List_Script.SetForegroundColour(wxColor(131,129,131))
	self.List_Requests = wxListCtrl(self.notebook1, -1, wxDefaultPosition, wxDefaultSize,wxSUNKEN_BORDER)
	self.List_Measurements = wxListCtrl(self.notebook1, -1, wxDefaultPosition, wxDefaultSize,wxSUNKEN_BORDER)
	self.List_Referrals = wxListCtrl(self.notebook1, -1, wxDefaultPosition, wxDefaultSize,wxSUNKEN_BORDER)
	self.List_Recalls = wxListCtrl(self.notebook1, -1, wxDefaultPosition, wxDefaultSize,wxSUNKEN_BORDER)
	self.List_Inbox = wxListCtrl(self.notebook1, -1, wxDefaultPosition, wxDefaultSize,wxSUNKEN_BORDER)

	self.notebook1.AddPage(self.List_Script, '', True, tabimage_Script)
	#self.notebook1.AddPage(True, tabimage_Inbox, szr_script_page, '')
	self.notebook1.AddPage(self.List_Requests, '', True, tabimage_Requests)
	self.notebook1.AddPage(self.List_Measurements, '', True, tabimage_Measurements)
	self.notebook1.AddPage(self.List_Referrals, '', True, tabimage_Referrals)
	self.notebook1.AddPage(self.List_Recalls, '', True, tabimage_Recalls)
	self.notebook1.AddPage(self.List_Inbox, '', True, tabimage_Inbox)
        self.notebook1.SetSelection(0)                               #start on scriptpage
#--------------------------------------
	#Now lets do things to the script list:
	#--------------------------------------
	self.List_Script.SetImageList(self.ListsImageList, wxIMAGE_LIST_SMALL)
	#------------------------------------------------------------------------
	# since we want images on the column header we have to do it the hard way
	#------------------------------------------------------------------------
	info = wxListItem()
	info.Mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE | wxLIST_MASK_FORMAT
	info.Image = -1
	info.Align = 0
	info.Text = _("Drug")
	self.List_Script.InsertColumnInfo(0, info)


	info.Align = wxLIST_FORMAT_LEFT
	info.Text = _("Dose")
	self.List_Script.InsertColumnInfo(1, info)

	info.Align = wxLIST_FORMAT_RIGHT
	info.Text = _("Instructions")
	self.List_Script.InsertColumnInfo(2, info)

	info.Align = wxLIST_FORMAT_RIGHT
	info.Text = _("Last Date")
	self.List_Script.InsertColumnInfo(3, info)

	info.Align = wxLIST_FORMAT_RIGHT
	info.Text = _("Prescribed For")
	self.List_Script.InsertColumnInfo(4, info)


	info.Align = wxLIST_FORMAT_RIGHT
	info.Text = _("Quantity")
	self.List_Script.InsertColumnInfo(5, info)


	info.Align = 0
	info.Text = _("First Date")
	self.List_Script.InsertColumnInfo(6, info)
	#-------------------------------------------------------------
	#loop through the scriptdata array and add to the list control
	#note the different syntax for the first coloum of each row
	#i.e. here > self.List_Script.InsertItem(x, data[0])!!
	#-------------------------------------------------------------
	items = scriptdata.items()
	for x in range(len(items)):
            key, data = items[x]
	    #<DEBUG>
            gmLog.gmDefLog.Log (gmLog.lData, items[x])
            #</DEBUG>
	    #print x, data[0],data[1],data[2]
	    self.List_Script.InsertItem(x, data[0])
            self.List_Script.SetItem(x, 1, data[1])
            self.List_Script.SetItem(x, 2, data[2])
	    self.List_Script.SetItem(x, 3, data[3])
	    self.List_Script.SetItem(x, 4, data[4])
	    self.List_Script.SetItem(x, 5, data[5])
	    self.List_Script.SetItem(x, 6, data[6])
	    self.List_Script.SetItemData(x, key)
	#--------------------------------------------------------
	#note the number pased to the wxColumnSorterMixin must be
	#the 1 based count of columns
	#--------------------------------------------------------
        self.itemDataMap = scriptdata
        #wxColumnSorterMixin.__init__(self, 5)              #I excluded first date as it didn't sort

	self.List_Script.SetColumnWidth(0, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(1, wxLIST_AUTOSIZE)
	self.List_Script.SetColumnWidth(2, wxLIST_AUTOSIZE)
	self.List_Script.SetColumnWidth(3, wxLIST_AUTOSIZE)
	self.List_Script.SetColumnWidth(4, wxLIST_AUTOSIZE)
	self.List_Script.SetColumnWidth(5, wxLIST_AUTOSIZE)
        self.List_Script.SetColumnWidth(6, 150)
	sizer.AddSizer(szr_notebook,40,wxEXPAND)
	self.SetSizer(sizer)  #set the sizer
	sizer.Fit(self)             #set to minimum size as calculated by sizer
        self.SetAutoLayout(True)                 #tell frame to use the sizer
        self.Show(True)
Beispiel #13
0
    def __init__(self, parent, id, title):

        # the setting need to keep
        self.dirname = ""
        self.flnm = ""
        self.tracerinfo = "/geos/u23/enkf_std/diaginfo.dat"
        self.diaginfo = "/geos/u23/enkf_std/tracerinfo.dat"
        self.bpdata_list = None
        self.ifig = 0

        try:
            deffile = open(default_setting_file, 'r')
            lines = deffile.readlines()
            deffile.close()

            for line in lines:
                if 'DIR:' in line:
                    terms = line.split()
                    self.dirname = terms[1].strip()
                elif 'FLNM' in line:
                    terms = line.split()
                    self.flnm = terms[1].strip()
                elif ('TRACERINFO:' in line):
                    terms = line.split()
                    self.tracerinfo = terms[1].strip()
                elif ('DIAGINFO:' in line):
                    terms = line.split()
                    self.diaginfo = terms[1].strip()

        except IOError:
            self.dirname = "/geos/u23/enkf_std/enkf_output/"
            self.flnm = "restart.EN0001-EN0024.20030101"
            self.fullname = self.dirname + self.flnm
            self.tracerinfo = "/geos/u23/enkf_std/enkf_output/diaginfo.EN0001-EN0024.dat"
            self.diaginfo = "/geos/u23/enkf_std/enkf_output/tracerinfo.EN0001-EN0024.dat"

        if (self.dirname in self.flnm):
            self.fullname = self.flnm
        else:
            self.fullname = self.dirname + '/' + self.flnm

        wx.Frame.__init__(self, parent, wx.ID_ANY, title, size=(880, 800))
        # self.control=wx.TextCtrl(self, 1, style=wx.TE_MULTILINE)

        self.CreateStatusBar()

        filemenu = wx.Menu()
        filemenu.Append(ID_LOAD, "&Load", "Load BPCH2 FILE")
        filemenu.Append(ID_SAVE_SETTING, "&Save Setting",
                        "Save Current Settings")
        filemenu.AppendSeparator()
        filemenu.Append(ID_EXIT, "E&xit", "Terminate the program")

        setmenu = wx.Menu()
        setmenu.Append(ID_SET, "Ch&oose Info", "Set Tracer & Diag Info files")
        helpmenu = wx.Menu()
        helpmenu.Append(ID_ABOUT, "&About", "About wx BPCH dump")
        menuBar = wx.MenuBar()
        menuBar.Append(filemenu, "&File")
        menuBar.Append(setmenu, "&Configure")
        menuBar.Append(helpmenu, "&Help")

        wx.EVT_MENU(self, ID_ABOUT, self.OnAbout)
        wx.EVT_MENU(self, ID_EXIT, self.OnExit)
        wx.EVT_MENU(self, ID_LOAD, self.OnLoad)
        wx.EVT_MENU(self, ID_SAVE_SETTING, self.OnSaveSetting)
        wx.EVT_MENU(self, ID_SET, self.OnSet)
        self.SetMenuBar(menuBar)
        # set up the list box

        self.il = wx.ImageList(16, 16)
        self.idx1 = self.il.Add(images.getSmilesBitmap())
        self.sm_up = self.il.Add(images.getSmallUpArrowBitmap())
        self.sm_dn = self.il.Add(images.getSmallDnArrowBitmap())
        bmp_browse = wx.Bitmap('/geos/u23/enkf_std/minus4.ico')

        panel_w = wx.Panel(self, -1)
        vbox = wx.BoxSizer(wx.VERTICAL)

        panel_file = wx.Panel(panel_w, -1)
        hbox1 = wx.BoxSizer(wx.HORIZONTAL)

        label_file = wx.StaticText(panel_file, -1, 'File Name:')
        hbox1.Add(label_file, 0, wx.ALL | wx.ALIGN_RIGHT, 10)
        self.text_file = wx.TextCtrl(panel_file, -1, size=(-1, 30))
        self.text_file.SetValue(self.fullname)
        hbox1.Add(
            self.text_file, 1, wx.RIGHT | wx.TOP | wx.BOTTOM
            | wx.ALIGN_CENTRE_HORIZONTAL | wx.EXPAND, 10)
        self.browsebtn = wx.BitmapButton(panel_file,
                                         ID_BROWSE,
                                         bmp_browse,
                                         size=(30, 30))
        self.Bind(wx.EVT_BUTTON, self.OnClick_Browse, self.browsebtn)
        hbox1.Add(self.browsebtn, 0,
                  wx.RIGHT | wx.TOP | wx.BOTTOM | wx.ALIGN_RIGHT, 10)

        self.loadbtn = wx.Button(panel_file, ID_LOAD, "Load", size=(60, 30))
        hbox1.Add(self.loadbtn, 0, wx.ALL, 10)
        self.Bind(wx.EVT_BUTTON, self.OnLoad, self.loadbtn)

        panel_file.SetSizer(hbox1)
        vbox.Add(panel_file, 0, wx.ALL | wx.EXPAND, 1)

        panel_list = wx.Panel(panel_w, -1)

        self.infolist = wx.ListCtrl(panel_list, -1, style=wx.LC_REPORT)
        self.currentItem = -1

        self.infolist.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        self.infolist.InsertColumn(0, 'No')
        self.infolist.InsertColumn(1, 'Category')
        self.infolist.InsertColumn(2, 'Name')
        self.infolist.InsertColumn(3, 'Unit')
        self.infolist.InsertColumn(4, 'TAU0')
        self.infolist.InsertColumn(5, 'TAU1')
        self.infolist.InsertColumn(6, 'NX')
        self.infolist.InsertColumn(7, 'NY')
        self.infolist.InsertColumn(8, 'NZ')
        self.infolist.InsertColumn(9, 'Max')
        self.infolist.InsertColumn(10, 'Min')

        self.infolist.SetColumnWidth(0, 80)
        self.infolist.SetColumnWidth(1, 80)
        self.infolist.SetColumnWidth(2, 80)
        self.infolist.SetColumnWidth(3, 80)
        self.infolist.SetColumnWidth(4, 100)
        self.infolist.SetColumnWidth(5, 100)
        self.infolist.SetColumnWidth(6, 40)
        self.infolist.SetColumnWidth(7, 40)
        self.infolist.SetColumnWidth(8, 40)
        self.infolist.SetColumnWidth(9, 120)
        self.infolist.SetColumnWidth(10, 120)

        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected,
                  self.infolist)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected,
                  self.infolist)
        # self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.infolist)

        self.infolist.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.infolist, 1,
                  wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 1)
        sizer.Add((-1, 5))
        panel_list.SetSizer(sizer)

        vbox.Add(panel_list, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL,
                 5)

        panel_vals = wx.Panel(panel_w, -1)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        label_x = wx.StaticText(panel_vals, -1, 'IX:', size=(30, 30))
        hbox.Add(label_x, 0, wx.ALL | wx.ALIGN_RIGHT, 10)
        self.text_x = wx.TextCtrl(panel_vals,
                                  -1,
                                  style=wx.TE_PROCESS_ENTER,
                                  size=(-1, 30))
        hbox.Add(self.text_x, 1, wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND, 10)
        self.text_x.SetValue('0')
        self.text_x.Enable(False)
        self.text_x.Bind(wx.EVT_TEXT_ENTER, self.EvtTextEnter_x)
        self.text_x.Bind(wx.EVT_KILL_FOCUS, self.EvtTextKillFocus_x)

        label_y = wx.StaticText(panel_vals, -1, 'IY:', size=(30, 30))
        hbox.Add(label_y, 0, wx.ALL | wx.ALIGN_RIGHT, 10)
        self.text_y = wx.TextCtrl(panel_vals,
                                  -1,
                                  style=wx.TE_PROCESS_ENTER,
                                  size=(-1, 30))
        hbox.Add(self.text_y, 1, wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND, 10)
        self.text_y.SetValue('0')
        self.text_y.Enable(False)
        self.Bind(wx.EVT_TEXT_ENTER, self.EvtTextEnter_y, self.text_y)
        self.text_y.Bind(wx.EVT_KILL_FOCUS, self.EvtTextKillFocus_y)

        label_z = wx.StaticText(panel_vals, -1, 'IZ:', size=(30, 30))
        hbox.Add(label_z, 0, wx.ALL | wx.ALIGN_RIGHT, 10)
        self.text_z = wx.TextCtrl(panel_vals,
                                  -1,
                                  style=wx.TE_PROCESS_ENTER,
                                  size=(-1, 30))
        hbox.Add(self.text_z, 1, wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND, 10)
        self.text_z.SetValue('0')
        self.text_z.Enable(False)
        self.Bind(wx.EVT_TEXT_ENTER, self.EvtTextEnter_z, self.text_z)
        self.text_z.Bind(wx.EVT_KILL_FOCUS, self.EvtTextKillFocus_z)

        label_v = wx.StaticText(panel_vals, -1, 'VAL:', size=(60, 30))
        hbox.Add(label_v, 0, wx.ALL | wx.ALIGN_LEFT, 10)
        self.text_v = wx.TextCtrl(panel_vals, -1, size=(-1, 30))
        hbox.Add(self.text_v, 1, wx.ALL | wx.ALIGN_LEFT | wx.EXPAND, 10)
        self.text_v.Enable(False)
        self.ix, self.iy, self.iz = 0, 0, 0

        panel_vals.SetSizer(hbox)
        # panel python  #

        vbox.Add(panel_vals, 0, wx.ALL | wx.EXPAND, 1)
        self.err_on = False

        self.panel_cmd = wx.Panel(panel_w, -1)
        # locals={'cur_l':cur_l, 'test_d':test_d}
        # self.myshell=pysh.shell.Shell(self.panel_cmd, -1,locals=locals, size=(850, 300))
        # help(self.myshell)
        self.myshell = pysh.shell.Shell(self.panel_cmd, -1, size=(850, 300))

        # vbox.Add(self.panel_cmd, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTRE_HORIZONTAL, 10)
        # vbox.Add(self.panel_cmd, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTRE_HORIZONTAL, 10)

        vbox.Add(self.panel_cmd, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_LEFT,
                 10)

        vbox.Add((-1, 5))
        panel_w.SetSizer(vbox)

        # panel list

        self.Centre()

        self.Show(True)