# -*- coding: utf-8 -*-
# generated by wxGlade 0.5 on Wed Aug  8 10:56:48 2007 from /home/scratch/mjc/cibc/SCIRun/src/StandAlone/Apps/FEMesher/wxMesher

import wx
from events import *
# begin wxGlade: dependencies
import wx.grid
# end wxGlade

class controls(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: controls.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.notebook = wx.Notebook(self, -1, style=0)
        self.volume_pane = wx.Panel(self.notebook, -1, style=wx.RAISED_BORDER|wx.TAB_TRAVERSAL)
        self.projdir_sizer_staticbox = wx.StaticBox(self.volume_pane, -1, "Project Dir")
        self.mmat_sizer_staticbox = wx.StaticBox(self.volume_pane, -1, "Max Material Index")
        self.nin_sizer_staticbox = wx.StaticBox(self.volume_pane, -1, "Input Nrrd")
        
        # Menu Bar
        self.frame_1_menubar = wx.MenuBar()
        self.SetMenuBar(self.frame_1_menubar)
        wxglade_tmp_menu = wx.Menu()
        wxglade_tmp_menu.Append(ID_EXIT, "Quit", "", wx.ITEM_NORMAL)
        self.frame_1_menubar.Append(wxglade_tmp_menu, "File")
        wxglade_tmp_menu = wx.Menu()
        self.frame_1_menubar.Append(wxglade_tmp_menu, "Edit")
        wxglade_tmp_menu = wx.Menu()
        self.frame_1_menubar.Append(wxglade_tmp_menu, "View")
        wxglade_tmp_menu = wx.Menu()
        wxglade_tmp_menu.Append(ID_ABOUT, "About", "", wx.ITEM_NORMAL)
        self.frame_1_menubar.Append(wxglade_tmp_menu, "Help")
        # Menu Bar end
        self.nin_tctrl = wx.TextCtrl(self.volume_pane, -1, "", style=wx.TE_READONLY)
        self.projdir_tctrl = wx.TextCtrl(self.volume_pane, -1, "", style=wx.TE_READONLY)
        self.mmat_tctrl = wx.TextCtrl(self.volume_pane, -1, "0", style=wx.TE_RIGHT)
        self.add_button = wx.Button(self.volume_pane, wx.ID_ADD, "")
        self.remove_button = wx.Button(self.volume_pane, wx.ID_REMOVE, "")
        self.generate_button = wx.Button(self.volume_pane, -1, "Generate")
        self.material_grid = wx.grid.Grid(self.volume_pane, -1, size=(1, 1))
        self.surf_pane = wx.Panel(self.notebook, -1)
        self.tet_pane = wx.Panel(self.notebook, -1)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_MENU, self.menu_item_about, id=ID_EXIT)
        self.Bind(wx.EVT_TEXT, self.text_handler_boo, self.nin_tctrl)
        # end wxGlade

        # ---- Add Event bindings ----
        wx.EVT_BUTTON(self, self.add_button.GetId(), add_pushed)
        wx.EVT_BUTTON(self, self.remove_button.GetId(), remove_pushed)
        wx.EVT_BUTTON(self, self.generate_button.GetId(), generate_pushed)
        wx.EVT_MENU(self, ID_ABOUT,  menu_item_about)
        wx.EVT_MENU(self, ID_EXIT,  menu_item_quit)
        
        

    def __set_properties(self):
        # begin wxGlade: controls.__set_properties
        self.SetTitle("Mesh3D")
        self.material_grid.CreateGrid(100, 4)
        self.material_grid.SetColLabelValue(0, "Material Index")
        self.material_grid.SetColSize(0, 100)
        self.material_grid.SetColLabelValue(1, "Material Name")
        self.material_grid.SetColSize(1, 100)
        self.material_grid.SetColLabelValue(2, "IsoValue")
        self.material_grid.SetColSize(2, 60)
        self.material_grid.SetColLabelValue(3, "Notes")
        self.material_grid.SetColSize(3, 300)
        self.notebook.SetMinSize((600, 400))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: controls.__do_layout
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        bgrid_sizer = wx.BoxSizer(wx.VERTICAL)
        mmat_sizer = wx.StaticBoxSizer(self.mmat_sizer_staticbox, wx.HORIZONTAL)
        projdir_sizer = wx.StaticBoxSizer(self.projdir_sizer_staticbox, wx.HORIZONTAL)
        nin_sizer = wx.StaticBoxSizer(self.nin_sizer_staticbox, wx.HORIZONTAL)
        nin_sizer.Add(self.nin_tctrl, 1, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_2.Add(nin_sizer, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
        projdir_sizer.Add(self.projdir_tctrl, 1, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_2.Add(projdir_sizer, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
        mmat_sizer.Add(self.mmat_tctrl, 1, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_2.Add(mmat_sizer, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
        bgrid_sizer.Add(self.add_button, 1, 0, 0)
        bgrid_sizer.Add(self.remove_button, 1, 0, 0)
        bgrid_sizer.Add(self.generate_button, 1, 0, 0)
        sizer_3.Add(bgrid_sizer, 0, wx.ADJUST_MINSIZE, 0)
        sizer_3.Add(self.material_grid, 10, wx.ALL|wx.EXPAND, 0)
        sizer_2.Add(sizer_3, 5, wx.ALL|wx.EXPAND, 0)
        self.volume_pane.SetSizer(sizer_2)
        self.notebook.AddPage(self.volume_pane, "Volume")
        self.notebook.AddPage(self.surf_pane, "Surfaces")
        self.notebook.AddPage(self.tet_pane, "Tets")
        sizer_1.Add(self.notebook, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        self.Layout()
        # end wxGlade

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

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

# end of class controls


