//=====================
// Main.hoc

//=====================
// Display main menu
load_file("nrngui.hoc")

//=====================
// File Object for I/O
objref ioFile
strdef ioFileName	// File name
ioFile = new File()

//=====================
// Load hoc files
load_file("Boltzmann.hoc")	// Boltzmann's equation
load_file("CO.hoc")			// Two state scheme: C <-> O

//=====================
// Control panel
objref vboxControl
vboxControl = new VBox()

vboxControl.intercept(1)
{
	xpanel("Selection")
	{
		// Select one of these modes
		xbutton("Boltzmann", "SelectBoltzmann()")	// Boltzmann's equation
		xbutton("Two states (C <-> O)", "SelectCO()")	// Two states: C <-> O
		
		// Quit
		xlabel("")
		xbutton("Quit", "quit()")
	}
	xpanel()
}
vboxControl.intercept(0)
vboxControl.map("Curve Name", 600, 10, 200, 400)

//=====================
// Hide all boxes
proc HideAllCurves(){
	vboxBoltzmann.unmap()
	hBox.unmap()
}

//=====================
// Select Boltzmann
proc SelectBoltzmann(){
	HideAllCurves()
	vboxBoltzmann.map("Boltzmann", 900, 10, 400, 400)
	BoltzmannCurve()
}

//=====================
// Select Two States CO
proc SelectCO(){
	HideAllCurves()
	hBox.map("Two States (C <-> O)", 900, 10, 800, 700)
	PlotSchemeCurves()
}

