"""Subclass of LogExplorerPane, which is generated by wxFormBuilder."""

import wx
import Tool
from ctx import context


# Implementing LogExplorerPane
class ToolLogExplorerPane(Tool.LogExplorerPane):
    """Panel de exploracion de operaciones"""
    def __init__(self, parent):
        """Inicializa dialogo"""
        Tool.LogExplorerPane.__init__(self, parent)
        self.app = context.app
        self.log = self.app.log
        sz = self.m_report.GetClientSize()
        w1 = sz.x // 4 - 4
        w2 = sz.x - w1 - 4
        self.m_report.InsertColumn(0, "date", wx.LIST_FORMAT_LEFT, w1)
        self.m_report.InsertColumn(1, "values", wx.LIST_FORMAT_LEFT, w2)
        for entry in self.log._log:
            self.m_report.Append((entry._time, entry._text))

