Ejemplo n.º 1
0
        public MatterCadWidget()
        {
            SuspendLayout();
            verticleSpliter = new Splitter();
            {
                // pannel 1 stuff
                textSide = new FlowLayoutWidget(FlowDirection.TopToBottom);
                {
                    matterScriptEditor            = new TextEditWidget("", pixelWidth: 300, pixelHeight: 500, multiLine: true);
                    matterScriptEditor.ShowBounds = true;
                    //matterScriptEditor.LocalBounds = new rect_d(0, 0, 200, 300);
                    textSide.AddChild(matterScriptEditor);
                    textSide.Resize += new ResizeEventHandler(textSide_Resize);

                    FlowLayoutWidget buttonBar = new FlowLayoutWidget();
                    {
                        Button loadFile = new Button("Load Matter Script");
                        loadFile.Click += new ButtonBase.ButtonEventHandler(loadFile_Click);
                        buttonBar.AddChild(loadFile);

                        runMatterScript        = new Button("Run Matter Script");
                        runMatterScript.Click += new ButtonBase.ButtonEventHandler(runMatterScript_Click);
                        buttonBar.AddChild(runMatterScript);

                        outputScad        = new Button("Output SCAD");
                        outputScad.Click += new ButtonBase.ButtonEventHandler(outputScad_Click);
                        buttonBar.AddChild(outputScad);
                    }
                    textSide.AddChild(buttonBar);
                }

                // pannel 2 stuff
                FlowLayoutWidget rightStuff = new FlowLayoutWidget(FlowDirection.TopToBottom);
                {
                    previewWindowRayTrace = new PreviewWindowRayTrace();
                    rightStuff.AddChild(previewWindowRayTrace);
                    previewWindowGL = new PreviewWindowGL();
                    previewWindowGL.DrawGlContent += new PreviewWindowGL.DrawGlContentEventHandler(glLightedView_DrawGlContent);
                    rightStuff.AddChild(previewWindowGL);

                    FlowLayoutWidget radioButtons = new FlowLayoutWidget();
                    {
                        RadioButton rayTrace = new RadioButton("Ray Trace");
                        radioButtons.AddChild(rayTrace);
                        RadioButton openGL = new RadioButton("OpenGL");
                        radioButtons.AddChild(openGL);

                        rayTrace.CheckedStateChanged += new RadioButton.CheckedStateChangedEventHandler(rayTrace_CheckedStateChanged);
                        openGL.CheckedStateChanged   += new RadioButton.CheckedStateChangedEventHandler(openGL_CheckedStateChanged);

                        //rayTrace.Checked = true;
                        openGL.Checked = true;
                    }
                    rightStuff.AddChild(radioButtons);
                }
                verticleSpliter.Panel2.AddChild(rightStuff);

                verticleSpliter.Panel1.AddChild(textSide);
            }
            ResumeLayout();

            AddChild(verticleSpliter);
        }
Ejemplo n.º 2
0
        public MatterCadWidget()
        {
            SuspendLayout();
            verticleSpliter = new Splitter();
            {
                // pannel 1 stuff
                textSide = new FlowLayoutWidget(FlowDirection.TopToBottom);
                {
                    matterScriptEditor = new TextEditWidget("", pixelWidth: 300, pixelHeight: 500, multiLine: true);
                    matterScriptEditor.ShowBounds = true;
                    //matterScriptEditor.LocalBounds = new rect_d(0, 0, 200, 300);
                    textSide.AddChild(matterScriptEditor);
                    textSide.Resize += new ResizeEventHandler(textSide_Resize);

                    FlowLayoutWidget buttonBar = new FlowLayoutWidget();
                    {
                        Button loadFile = new Button("Load Matter Script");
                        loadFile.Click += new ButtonBase.ButtonEventHandler(loadFile_Click);
                        buttonBar.AddChild(loadFile);

                        runMatterScript = new Button("Run Matter Script");
                        runMatterScript.Click += new ButtonBase.ButtonEventHandler(runMatterScript_Click);
                        buttonBar.AddChild(runMatterScript);

                        outputScad = new Button("Output SCAD");
                        outputScad.Click += new ButtonBase.ButtonEventHandler(outputScad_Click);
                        buttonBar.AddChild(outputScad);
                    }
                    textSide.AddChild(buttonBar);
                }

                // pannel 2 stuff
                FlowLayoutWidget rightStuff = new FlowLayoutWidget(FlowDirection.TopToBottom);
                {
                    previewWindowRayTrace = new PreviewWindowRayTrace();
                    rightStuff.AddChild(previewWindowRayTrace);
                    previewWindowGL = new PreviewWindowGL();
                    previewWindowGL.DrawGlContent += new PreviewWindowGL.DrawGlContentEventHandler(glLightedView_DrawGlContent);
                    rightStuff.AddChild(previewWindowGL);

                    FlowLayoutWidget radioButtons = new FlowLayoutWidget();
                    {
                        RadioButton rayTrace = new RadioButton("Ray Trace");
                        radioButtons.AddChild(rayTrace);
                        RadioButton openGL = new RadioButton("OpenGL");
                        radioButtons.AddChild(openGL);

                        rayTrace.CheckedStateChanged += new RadioButton.CheckedStateChangedEventHandler(rayTrace_CheckedStateChanged);
                        openGL.CheckedStateChanged += new RadioButton.CheckedStateChangedEventHandler(openGL_CheckedStateChanged);

                        //rayTrace.Checked = true;
                        openGL.Checked = true;
                    }
                    rightStuff.AddChild(radioButtons);
                }
                verticleSpliter.Panel2.AddChild(rightStuff);

                verticleSpliter.Panel1.AddChild(textSide);
            }
            ResumeLayout();

            AddChild(verticleSpliter);
        }