import  java.awt.*;
import  java.io.*;
import java.util.*;
import cnp.ew.util.*;
import cnp.ew.layout.*;
import cnp.ew.misc.*;
import cnp.ew.lightweight.*;
import cnp.ew.calendar.*;
import cnp.ew.spin.*;
import cnp.ew.image.*;

public class CpCalendarDemo extends CpLcApplet
implements CpObserver
{

    CpCalendarLc popup;

	public void init()
	{
	    super.init();
		CpAttachmentsLayout layout;
		CpAttachments attachments;


		CpPanelLc rootLc = new CpPanelLc();
		setLc(rootLc);

		rootLc.setLayout(layout = new CpAttachmentsLayout());

        rootLc.setDrawOffscreen(true);

        CpPanelLc panelLc = new CpPanelLc(CpAbstractLc.BORDER_LABELED_RAISED);
        attachments = new CpAttachments(10, 10, 10, 10);
        layout.setAttachments(panelLc, attachments);
        rootLc.add(panelLc);


        layout = new CpAttachmentsLayout();
        panelLc.setLayout(layout);

        CpDateSpinEditorLc spin = new CpDateSpinEditorLc();

        popup = new CpCalendarLc((CpDateModel)spin.getModel());
        attachments = new CpAttachments();
        attachments.setHorizontalCentering();
        attachments.setTopAttachment(10);
        layout.setAttachments(popup, attachments);
        panelLc.add(popup);

        attachments = new CpAttachments();
        attachments.setHorizontalCentering();
        attachments.setTopAttachment(10, popup);
        layout.setAttachments(spin, attachments);
        panelLc.add(spin);

        setBackground(Color.lightGray);
	}



	public static void main (String argv[]) {
		CpCalendarDemo test = new CpCalendarDemo();
		test.init();
		test.show();
    }

    public void update(CpObservable o, int facet, Object arg)
    {
	}
}



