
import wx
import os

import globalvar as globalvar
from utils import *
from dv3dDialogs import *
from dv3dContourPlot3D_routines import *
from dv3dSTCprocessing import *

class MEGTab(wx.Panel):
	def __init__(self, parent, frame_parent):
		wx.Panel.__init__(self, parent, -1)
	
		self.frame_parent = frame_parent
		
		self.Load3DContourPlotButton = wx.Button(self, -1, '3D Contour Plot', (15,15))
		self.Bind(wx.EVT_BUTTON, self.OnLoad3DContourPlotButton, self.Load3DContourPlotButton)
	
		self.LoadSTCButton = wx.Button(self, -1, 'Load STC data', (200,15))
		self.Bind(wx.EVT_BUTTON, self.OnLoadSTCButton, self.LoadSTCButton)
	
		self.LoadMinNormButton = wx.Button(self, -1, 'Min Norm Solution', (15,45))
		self.Bind(wx.EVT_BUTTON, self.OnLoadMinNormButton , self.LoadMinNormButton )
		
		self.LoadDipoleData = wx.Button(self, -1, 'Dipole Data', (15,75))
		self.Bind(wx.EVT_BUTTON, self.OnLoadDipoleData , self.LoadDipoleData )
	
	def OnLoad3DContourPlotButton(self, evt):
		frame = MyDialogFrame(self.frame_parent, 'ContourPlot3D')
		frame.Show()
		
	def OnLoadMinNormButton(self, evt):
		frame = MyDialogFrame(self.frame_parent, 'MinNorm_Type1')
		frame.Show()
		
	def OnLoadDipoleData(self, evt):
		frame = MyDialogFrame(self.frame_parent, 'Dipole_4DNI')
		frame.Show()        
		
	def OnLoadSTCButton(self, evt):
		loadSTC(self.frame_parent, 0)