//ChoicePanel.java
//
import java.awt.*;
import java.applet.*;
import java.lang.*;  


public class ChoicePanel extends Panel{ 
	public Choice c1;
	public Choice c2;
	private  Label lab1, lab2;
	
	//private static final Color bgcolor = new Color(216,216,191);
	private static final Color bgcolor = new Color(236,236,236);

        private static final Color tinta = Color.white;
        public CheckboxGroup cbxgroup;
        public Checkbox cbx1, cbx2;
        public Button binstructions;
	//private static final Color bgcolor = Color.lightGray;
	//private static final Color tinta = new Color(235,235,235);
	
	public ChoicePanel(String arg1[], String arg2[]){
		super();
		setLayout(null);
		setBackground(bgcolor);
		Font labelfont=new Font("SanSerif",Font.BOLD,11);
                
		Font labelfont2=new Font("SanSerif",Font.PLAIN,11);
                
                lab1=new Label(arg1[0],Label.RIGHT);
		lab1.setFont(labelfont);
		add(lab1);
		
		c1=new Choice();
		for(int i = 1; i < arg1.length; i++){
		    c1.addItem(arg1[i]);
		}
		
		add(c1);
		c1.setFont(new Font("SanSerif",Font.PLAIN,11));
		c1.setBackground(tinta);
		//c1.setBackground(bgcolor.brighter());
		c1.setForeground(Color.black);
		
		lab2=new Label(arg2[0],Label.RIGHT);
		lab2.setFont(labelfont);
		//add(lab2);
		c2=new Choice();
		for(int i = 1; i < arg2.length; i++){
		    c2.addItem(arg2[i]);
		}
		//add(c2);
		c2.setFont(new Font("SanSerif",Font.PLAIN,11));
		c2.setBackground(tinta);
		//c2.setBackground(bgcolor.brighter());
		c2.setForeground(Color.black);
                
                // CHANGE #1 6/13/2017 =========================================
                // MODIFY LINE BELOW
                //lab1.setBounds(13,10,40,20);
                lab1.setBounds(2,10,40,20);
                //==============================================================
                lab2.setBounds(150,10,45,20);
                // CHANGE #2 6/13/2017 =========================================
                // MODIFY LINE BELOW
                //c1.setBounds(55,10,140,20);
                c1.setBounds(45,10,155,20);
                //==============================================================
                c2.setBounds(197,10,102,20);
                
                cbxgroup = new CheckboxGroup();
                cbx1 = new Checkbox("Smith Chart",cbxgroup,true);
                cbx2 = new Checkbox("Output Data",cbxgroup,false);
                cbx1.setBackground(bgcolor);
                cbx2.setBackground(bgcolor);
        
		add(cbx1);
                add(cbx2);
                // CHANGE # 3 6/13/2017 ========================================
                // MODIFY LINES BELOW
                //cbx1.setBounds(310,12,85,15);
                //cbx2.setBounds(400,12,85,15);
                cbx1.setBounds(300,10,95,20);
                cbx2.setBounds(390,10,98,20);
                //==============================================================
                cbx1.setFont(labelfont2);
                cbx2.setFont(labelfont2);
                
                binstructions = new Button("Instructions");
		binstructions.setBackground(bgcolor);
                binstructions.setFont(labelfont2);
		add(binstructions);
                
                binstructions.setBounds(210,10,85,20);
                
      	}
	public void paint(Graphics g){
	    g.clearRect(0,0,getSize().width,getSize().height);
	    g.setColor(bgcolor.darker());
	    g.fillRect(0,getSize().height-2,getSize().width,2);
	    g.fillRect(getSize().width-2,0,2,getSize().height);
	    g.setColor(bgcolor.brighter());
	    g.fillRect(0,0,2,getSize().height-1);
	    g.fillRect(0,0,getSize().width-2,2);
            
            g.setColor(Color.black);
            g.drawRect(207,7,89,24);
	}
	
} // ChoicePanel.java
