Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Top Label
            Alt.GUI.Temporary.Gwen.Control.Label m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Polar Transformer";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(10, 3, 0, 5);


            //  Spiral
            m_SpiralSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_SpiralSlider.Dock = Pos.Bottom;
            m_SpiralSlider.SetSize(150, 20);
            m_SpiralSlider.SetRange(-0.3f, 0.2f);
            m_SpiralSlider.ValueChanged += Slider_ValueChanged;

            m_SpiralSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_SpiralSliderLabel.AutoSizeToContents = true;
            m_SpiralSliderLabel.Dock   = Pos.Bottom;
            m_SpiralSliderLabel.Margin = new Margin(0, 5, 0, 0);


            //  BaseY
            m_BaseYSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_BaseYSlider.Dock = Pos.Bottom;
            m_BaseYSlider.SetSize(150, 20);
            m_BaseYSlider.SetRange(20, 200);
            m_BaseYSlider.NotchCount    = (int)(m_BaseYSlider.Max - m_BaseYSlider.Min);
            m_BaseYSlider.SnapToNotches = true;
            m_BaseYSlider.ValueChanged += Slider_ValueChanged;

            m_BaseYSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_BaseYSliderLabel.AutoSizeToContents = true;
            m_BaseYSliderLabel.Dock   = Pos.Bottom;
            m_BaseYSliderLabel.Margin = new Margin(0, 10, 0, 0);


            m_SpiralSlider.Value = -0.18f;
            m_BaseYSlider.Value  = 60;


            //  Text
            m_TextBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
            m_TextBox.SetText(Common.AltSketch_Vector_Graphics_Library);
            m_TextBox.Font      = new Font("Times New Roman", 42);
            m_TextBox.TextColor = Color.Red;
            m_TextBox.SizeToContents();
            m_TextBox.Dock     = Pos.Bottom;
            m_TextBox.Margin   = new Margin(5, 10, 5, 10);
            m_TextBox.ReadOnly = true;

            m_TextBox.CursorPos = 9;
            m_TextBox.CursorEnd = 3;
            m_TextBox.Focus();
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  OutlineThicknessSlider
            m_OutlineThicknessSlider      = new HorizontalSlider(this);
            m_OutlineThicknessSlider.Dock = Pos.Bottom;
            m_OutlineThicknessSlider.SetSize(150, 20);
            m_OutlineThicknessSlider.SetRange(0.5f, 3);
            m_OutlineThicknessSlider.ValueChanged += OutlineThicknessSlider_ValueChanged;

            m_OutlineThicknessSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_OutlineThicknessSliderLabel.AutoSizeToContents = true;
            m_OutlineThicknessSliderLabel.Dock   = Pos.Bottom;
            m_OutlineThicknessSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_OutlineThicknessSlider.Value = 1;


            //m_ShadowBrush1 = new SolidColorBrush(Color.FromArgb(192, Color.Red));
            m_ShadowBrush1 = Brushes.LightBlue;
            m_FillBrush1   = Brushes.White;
            m_ContourPen1  = Pens.Black;

            int a = 128;

            m_ShadowBrush2 = new SolidColorBrush(Color.FromArgb(a, Color.DarkRed));
            m_FillBrush2   = new SolidColorBrush(Color.FromArgb(a, Color.DodgerBlue));
            m_ContourPen2  = new Pen(Color.FromArgb(a, Color.LightGreen));
        }
Ejemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Top Label
            Alt.GUI.Temporary.Gwen.Control.Label m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Contour Tool (GeometryContour) & Polygon Orientation";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(0, 3, 0, 5);


            //  Width
            m_WidthSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_WidthSlider.Dock = Pos.Bottom;
            m_WidthSlider.SetSize(150, 20);
            m_WidthSlider.SetRange(-100, 100);
            m_WidthSlider.NotchCount    = (int)(m_WidthSlider.Max - m_WidthSlider.Min);
            m_WidthSlider.SnapToNotches = true;
            m_WidthSlider.ValueChanged += WidthSlider_ValueChanged;

            m_WidthSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_WidthSliderLabel.AutoSizeToContents = true;
            m_WidthSliderLabel.Dock   = Pos.Bottom;
            m_WidthSliderLabel.Margin = new Margin(0, 10, 0, 0);

            m_WidthSlider.Value = 0;


            //  AutoDetect
            m_AutoDetectCheckBox           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_AutoDetectCheckBox.Text      = "Autodetect orientation if not defined";
            m_AutoDetectCheckBox.Dock      = Pos.Bottom;
            m_AutoDetectCheckBox.IsChecked = true;
            m_AutoDetectCheckBox.Margin    = new Margin(0, 10, 0, 0);


            //  PolyCloseType
            m_PolyCloseTypeGroupBox                    = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(this, string.Empty);
            m_PolyCloseTypeGroupBox.Text               = "Polygon Close Type:";
            m_PolyCloseTypeGroupBox.Margin             = new Margin(0, 0, 0, 0);
            m_PolyCloseTypeGroupBox.Dock               = Pos.Bottom;
            m_PolyCloseTypeGroupBox.AutoSizeToContents = true;

            rbClose        = m_PolyCloseTypeGroupBox.AddOption("Close");
            rbClose.Margin = new Margin(0, 5, 0, 0);
            rbCloseCW      = m_PolyCloseTypeGroupBox.AddOption("Close CW");
            rbCloseCCW     = m_PolyCloseTypeGroupBox.AddOption("Close CCW");

            rbClose.Select();


            //
            m_FillBrush  = new SolidColorBrush(Color.LimeGreen * 1.2);
            m_ContourPen = new Pen(new ColorR(0.8, 0.2, 0.2), 2);
        }
Ejemplo n.º 4
0
            public Example_BSpline_FlowGeometryContainer(Base parent)
                : base(parent)
            {
                ClientBackColor   = Color.FromArgb(50, Color.Black);
                DrawClientBorder  = true;
                ClientBorderColor = Color.DodgerBlue;


                //  Top Label
                m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
                m_TopLabel.AutoSizeToContents = true;
                m_TopLabel.Text      = "Transformed B-Spline";
                m_TopLabel.TextColor = Color.Yellow;
                m_TopLabel.Dock      = Pos.Top;
                m_TopLabel.Margin    = new Margin(0, 3, 0, 5);


                //  Flip
                m_Flip        = new Alt.GUI.Temporary.Gwen.Control.Button(this);
                m_Flip.Dock   = Pos.Bottom;
                m_Flip.Text   = "Flip";
                m_Flip.Click += new EventHandler(Flip_Click);
                m_Flip.Margin = new Margin(0, 5, 0, 0);


                //  PointsNumberSlider
                m_PointsNumberSlider = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
                //slider.SetPosition(10, 40);
                m_PointsNumberSlider.Dock = Pos.Bottom;
                m_PointsNumberSlider.SetSize(150, 20);
                m_PointsNumberSlider.SetRange(1, 40);
                m_PointsNumberSlider.NotchCount    = (int)(m_PointsNumberSlider.Max - m_PointsNumberSlider.Min);
                m_PointsNumberSlider.SnapToNotches = true;
                m_PointsNumberSlider.ValueChanged += PointsNumberSlider_ValueChanged;

                m_PointsNumberSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
                m_PointsNumberSliderLabel.AutoSizeToContents = true;
                m_PointsNumberSliderLabel.Dock   = Pos.Bottom;
                m_PointsNumberSliderLabel.Margin = new Margin(0, 3, 0, 0);

                m_PointsNumberSlider.Value = 30;


                //  CloseCheckBox
                m_CloseCheckBox        = new LabeledCheckBox(this);
                m_CloseCheckBox.Text   = "Close";
                m_CloseCheckBox.Dock   = Pos.Bottom;
                m_CloseCheckBox.Margin = new Margin(0, 7, 0, 0);


                //  Graphics
                m_BSplinePen = new Pen(Color.Cyan, 2);
            }
Ejemplo n.º 5
0
        public Example_AltNETType_FontAtlas(Base parent)
            : base(parent)
        {
            //  Height
            m_HeightSlider      = new HorizontalSlider(this);
            m_HeightSlider.Dock = Pos.Bottom;
            m_HeightSlider.SetRange(8, 72);
            m_HeightSlider.NotchCount    = (int)(m_HeightSlider.Max - m_HeightSlider.Min);
            m_HeightSlider.SnapToNotches = true;
            m_HeightSlider.Height        = 20;
            m_HeightSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_HeightSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_HeightSliderLabel.AutoSizeToContents = true;
            m_HeightSliderLabel.Dock   = Pos.Bottom;
            m_HeightSliderLabel.Margin = new Margin(0, 7, 0, 0);

            m_HeightSlider.Value = 72;


            //  Font
            CreateFontPanel();
        }
Ejemplo n.º 6
0
        Base CreateControls(Base subject, int dock_idx, String name, int x, int y)
        {
            Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
            gb.TextColor = labelColor;
            gb.SetBounds(x, y, 200, 150);
            gb.Text = name;

            Alt.GUI.Temporary.Gwen.Control.Label l_width = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
            l_width.TextColor = labelColor;
            l_width.SetSize(35, 15);
            l_width.Text = "Width:";

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider width = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(gb);
            width.Name     = "Width";
            width.UserData = subject;
            width.Min      = 50;
            width.Max      = 350;
            width.Value    = 100;
            width.SetSize(55, 15);
            width.ValueChanged += WidthChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(width, l_width);

            Alt.GUI.Temporary.Gwen.Control.Label l_height = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
            l_height.TextColor = labelColor;
            l_height.SetSize(35, 15);
            l_height.Text = "Height:";
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(l_height, width, 10);

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider height = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(gb);
            height.Name     = "Height";
            height.UserData = subject;
            height.Min      = 50;
            height.Max      = 350;
            height.Value    = 100;
            height.SetSize(55, 15);
            height.ValueChanged += HeightChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(height, l_height);

            Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup dock = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(gb, "Dock");
            dock.TextColor = labelColor;
            dock.UserData  = subject; // store control that we are controlling
            dock.AddOption("Left");
            dock.AddOption("Top");
            dock.AddOption("Right");
            dock.AddOption("Bottom");
            dock.AddOption("Fill");
            dock.SetSelection(dock_idx);
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(dock, l_width, 5);
            //dock.DrawDebugOutlines = true;
            dock.Invalidate();

            Alt.GUI.Temporary.Gwen.Control.Label l_margin = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
            l_margin.TextColor = labelColor;
            l_margin.Text      = "Margin:";
            l_margin.SetBounds(75, 20, 35, 15);
            //Align.PlaceRightBottom(l_margin, dock);
            // can't use Align to anchor with 'dock' because radio group is resized only after layout ~_~
            // this is become really cumbersome
            //l_margin.DrawDebugOutlines = true;

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider margin = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(gb);
            margin.Name     = "Margin";
            margin.UserData = subject;
            margin.Min      = 0;
            margin.Max      = 50;
            margin.Value    = 10;
            margin.SetSize(55, 15);
            margin.ValueChanged += MarginChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(margin, l_margin);

            dock.SelectionChanged += DockChanged;

            return(gb);
        }
Ejemplo n.º 7
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            font = new Alt.Sketch.Font(Skin.DefaultFont.FontFamily, 20);

            outer = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            outer.SetBounds(10, 10, 400, 400);

            Alt.GUI.Temporary.Gwen.Control.Label inner1 = new Alt.GUI.Temporary.Gwen.Control.Label(outer);
            inner1.TextColor = labelColor;
            inner1.Text      = "1";
            inner1.Font      = font;
            inner1.SetSize(100, 100);
            inner1.Dock = Alt.GUI.Temporary.Gwen.Pos.Left;

            Alt.GUI.Temporary.Gwen.Control.Label inner2 = new Alt.GUI.Temporary.Gwen.Control.Label(outer);
            inner2.TextColor = labelColor;
            inner2.Text      = "2";
            inner2.Font      = font;
            inner2.SetSize(100, 100);
            inner2.Dock = Alt.GUI.Temporary.Gwen.Pos.Top;

            Alt.GUI.Temporary.Gwen.Control.Label inner3 = new Alt.GUI.Temporary.Gwen.Control.Label(outer);
            inner3.TextColor = labelColor;
            inner3.Text      = "3";
            inner3.Font      = font;
            inner3.SetSize(100, 100);
            inner3.Dock = Alt.GUI.Temporary.Gwen.Pos.Right;

            Alt.GUI.Temporary.Gwen.Control.Label inner4 = new Alt.GUI.Temporary.Gwen.Control.Label(outer);
            inner4.TextColor = labelColor;
            inner4.Text      = "4";
            inner4.Font      = font;
            inner4.SetSize(100, 100);
            inner4.Dock = Alt.GUI.Temporary.Gwen.Pos.Bottom;

            Alt.GUI.Temporary.Gwen.Control.Label inner5 = new Alt.GUI.Temporary.Gwen.Control.Label(outer);
            inner5.TextColor = labelColor;
            inner5.Text      = "5";
            inner5.Font      = font;
            inner5.SetSize(100, 100);
            inner5.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;

            outer.DrawDebugOutlines = true;

            inner1.UserData = CreateControls(inner1, 0, "Control 1", 440, 10);
            inner2.UserData = CreateControls(inner2, 1, "Control 2", 650, 10);
            inner3.UserData = CreateControls(inner3, 2, "Control 3", 440, 170);
            inner4.UserData = CreateControls(inner4, 3, "Control 4", 650, 170);
            inner5.UserData = CreateControls(inner5, 4, "Control 5", 440, 330);

            Alt.GUI.Temporary.Gwen.Control.Label l_padding = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            l_padding.TextColor = labelColor;
            l_padding.Text      = "Padding:";
            l_padding.SetSize(60, 19);
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(l_padding, outer, 20);

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider padding = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            padding.Min   = 0;
            padding.Max   = 200;
            padding.Value = 10;
            padding.SetSize(100, 20);
            padding.ValueChanged += PaddingChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(padding, l_padding);

            //DrawDebugOutlines = true;
        }
Ejemplo n.º 8
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            m_HtmlContainer                 = new HtmlContainer();
            m_HtmlContainer.Refresh        += OnRefresh;
            m_HtmlContainer.RenderError    += OnRenderError;
            m_HtmlContainer.StylesheetLoad += OnStylesheetLoad;
            m_HtmlContainer.ImageLoad      += OnImageLoad;


            //  FillBackground
            m_FillBackground               = new LabeledCheckBox(m_LeftPanel);
            m_FillBackground.Text          = "Fill Background";
            m_FillBackground.Dock          = Pos.Bottom;
            m_FillBackground.Margin        = new Margin(2, 10, 2, 0);
            m_FillBackground.IsChecked     = true;
            m_FillBackground.CheckChanged += new GwenEventHandler(FillBackground_CheckChanged);


#if !SILVERLIGHT
            //  AntiAlias Text
            m_AntiAliasText        = new LabeledCheckBox(m_LeftPanel);
            m_AntiAliasText.Text   = "AntiAlias Text";
            m_AntiAliasText.Dock   = Pos.Bottom;
            m_AntiAliasText.Margin = new Margin(2, 10, 2, 2);
            //m_AntiAliasText.IsChecked = true;
            m_AntiAliasText.CheckChanged += new GwenEventHandler(AntiAliasText_CheckChanged);
#endif


            //  Width
            m_WidthSlider      = new HorizontalSlider(m_RightPanel);
            m_WidthSlider.Dock = Pos.Bottom;
            m_WidthSlider.SetRange(200, 1000);
            m_WidthSlider.Height        = 20;
            m_WidthSlider.ValueChanged += new GwenEventHandler(WidthSlider_ValueChanged);

            m_WidthSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(m_RightPanel);
            m_WidthSliderLabel.AutoSizeToContents = true;
            m_WidthSliderLabel.Dock   = Pos.Bottom;
            m_WidthSliderLabel.Margin = new Margin(0, 10, 0, 0);


            //  Image
            Base imageMainPanel = new Base(m_RightPanel);
            imageMainPanel.Dock = Pos.Fill;


            m_ImageScrollControl        = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(imageMainPanel);
            m_ImageScrollControl.Margin = Margin.One;
            m_ImageScrollControl.Dock   = Pos.Fill;
            m_ImageScrollControl.EnableScroll(true, true);
            m_ImageScrollControl.AutoHideBars         = true;
            m_ImageScrollControl.ShouldDrawBackground = false;


            m_ImagePanel          = new Base(m_ImageScrollControl);
            m_ImagePanel.Margin   = Margin.Two;
            m_ImagePanel.Location = PointI.Zero;
            m_ImagePanel.Size     = new SizeI(100, 100);
            m_ImagePanel.Paint   += new GUI.PaintEventHandler(ImagePanel_Paint);
            m_ImagePanel.Hide();


            m_WidthSlider.Value = 500;


            SelectFirstExample();
        }
Ejemplo n.º 9
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = 1;


            //  Scale
            m_ScaleControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_ScaleControl.SetBounds(10, 30, 20, 200);

            m_ScalePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            m_ScalePlusButton.Text   = "+";
            m_ScalePlusButton.Dock   = Pos.Top;
            m_ScalePlusButton.Click += new EventHandler(ScalePlusButton_Click);

            m_ScaleMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            m_ScaleMinusButton.Text   = "-";
            m_ScaleMinusButton.Dock   = Pos.Bottom;
            m_ScaleMinusButton.Click += new EventHandler(ScaleMinusButton_Click);

            m_ScaleSlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleSlider.Dock = Pos.Fill;
            m_ScaleSlider.SetRange(0.3f, 5);
            m_ScaleSlider.Value = 1;


            //  Rotate
            m_RotateControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_RotateControl.SetBounds(30, 10, 200, 20);

            m_RotatePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotatePlusButton.Text   = "+";
            m_RotatePlusButton.Dock   = Pos.Right;
            m_RotatePlusButton.Width  = m_RotateControl.Height;
            m_RotatePlusButton.Click += new EventHandler(RotatePlusButton_Click);

            m_RotateMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotateMinusButton.Text   = "-";
            m_RotateMinusButton.Dock   = Pos.Left;
            m_RotateMinusButton.Width  = m_RotateControl.Height;
            m_RotateMinusButton.Click += new EventHandler(RotateMinusButton_Click);

            m_RotateSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(m_RotateControl);
            m_RotateSlider.Dock = Pos.Fill;
            m_RotateSlider.SetRange(-180, 180);
            m_RotateSlider.Value = 0;


            m_OpacitySlider.ValueChanged += new GwenEventHandler(Slider_ValueChanged);
            m_ScaleSlider.ValueChanged   += new GwenEventHandler(Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(Slider_ValueChanged);
            //  Preview
            m_OpacitySlider.ValueChanged += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);



            //
            m_SVGPath = new SVGPath();

            int k = 30;

            m_x        = m_DrawingPanel.ClientWidth / 2 + k;
            m_y        = m_DrawingPanel.ClientHeight / 2 + k;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/longhorn.svg");
                //LoadSVG("AltData/SVG/lion.svg");
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 10
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = 1;


            //  Scale
            m_ScaleControl = new Base(m_DrawingPanel);
            m_ScaleControl.SetBounds(10, 30, 20, 200);

            m_ScalePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            m_ScalePlusButton.Text   = "+";
            m_ScalePlusButton.Dock   = Pos.Top;
            m_ScalePlusButton.Click += new EventHandler(ScalePlusButton_Click);

            m_ScaleMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            m_ScaleMinusButton.Text   = "-";
            m_ScaleMinusButton.Dock   = Pos.Bottom;
            m_ScaleMinusButton.Click += new EventHandler(ScaleMinusButton_Click);

            m_ScaleSlider      = new VerticalSlider(m_ScaleControl);
            m_ScaleSlider.Dock = Pos.Fill;
            m_ScaleSlider.SetRange(0.3f, 5);
            m_ScaleSlider.Value = 1;


            //  Rotate
            m_RotateControl = new Base(m_DrawingPanel);
            m_RotateControl.SetBounds(30, 10, 200, 20);

            m_RotatePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotatePlusButton.Text   = "+";
            m_RotatePlusButton.Dock   = Pos.Right;
            m_RotatePlusButton.Width  = m_RotateControl.Height;
            m_RotatePlusButton.Click += new EventHandler(RotatePlusButton_Click);

            m_RotateMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotateMinusButton.Text   = "-";
            m_RotateMinusButton.Dock   = Pos.Left;
            m_RotateMinusButton.Width  = m_RotateControl.Height;
            m_RotateMinusButton.Click += new EventHandler(RotateMinusButton_Click);

            m_RotateSlider      = new HorizontalSlider(m_RotateControl);
            m_RotateSlider.Dock = Pos.Fill;
            m_RotateSlider.SetRange(-180, 180);
            m_RotateSlider.Value = 0;


            //  Expand
            m_ExpandSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_ExpandSlider.Dock = Pos.Bottom;
            m_ExpandSlider.SetRange(-1, 1.2f);
            m_ExpandSlider.ValueChanged += new GwenEventHandler(ExpandSlider_ValueChanged);
            m_ExpandSlider.Height        = 20;
            m_ExpandSlider.Margin        = new Margin(0, 3, 0, 0);

            m_ExpandLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_ExpandLabel.AutoSizeToContents = true;
            m_ExpandLabel.Dock = Pos.Bottom;

            m_ExpandSlider.Value = 0;


            m_OpacitySlider.ValueChanged += new GwenEventHandler(Slider_ValueChanged);
            m_ScaleSlider.ValueChanged   += new GwenEventHandler(Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(Slider_ValueChanged);
            m_ExpandSlider.ValueChanged  += new GwenEventHandler(Slider_ValueChanged);



            //
            m_SVGPath = new SVGPath();

            m_x        = m_DrawingPanel.ClientWidth / 2;
            m_y        = m_DrawingPanel.ClientHeight / 2;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/tiger.svg");
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 11
0
        public Example_AltNETType_Outline_Transformations(Base parent)
            : base(parent)
        {
            //  OutlineThicknessSlider
            m_OutlineThicknessSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_OutlineThicknessSlider.Dock = Pos.Bottom;
            m_OutlineThicknessSlider.SetSize(150, 20);
            m_OutlineThicknessSlider.SetRange(0.5f, 3);
            m_OutlineThicknessSlider.ValueChanged += OutlineThicknessSlider_ValueChanged;

            m_OutlineThicknessSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_OutlineThicknessSliderLabel.AutoSizeToContents = true;
            m_OutlineThicknessSliderLabel.Dock   = Pos.Bottom;
            m_OutlineThicknessSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_OutlineThicknessSlider.Value = 0.6f;


            //  OutlineCheckBox
            m_OutlineCheckBox               = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_OutlineCheckBox.Margin        = new Margin(0, 5, 0, 0);
            m_OutlineCheckBox.Text          = "Outline";
            m_OutlineCheckBox.Dock          = Pos.Bottom;
            m_OutlineCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  FillCheckBox
            m_FillCheckBox               = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_FillCheckBox.Margin        = new Margin(0, 5, 0, 0);
            m_FillCheckBox.Text          = "Fill";
            m_FillCheckBox.Dock          = Pos.Bottom;
            m_FillCheckBox.IsChecked     = true;
            m_FillCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Faux Italic
            m_AuxItalicSlider      = new HorizontalSlider(this);
            m_AuxItalicSlider.Dock = Pos.Bottom;
            m_AuxItalicSlider.SetRange(-1.5f, 1.5f);
            m_AuxItalicSlider.Height        = 20;
            m_AuxItalicSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_AuxItalicSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_AuxItalicSliderLabel.AutoSizeToContents = true;
            m_AuxItalicSliderLabel.Dock   = Pos.Bottom;
            m_AuxItalicSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_AuxItalicSlider.Value = 0;


            //  Interval
            m_IntervalSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_IntervalSlider.Dock = Pos.Bottom;
            m_IntervalSlider.SetRange(-5, 5);
            m_IntervalSlider.Height        = 20;
            m_IntervalSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_IntervalSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_IntervalSliderLabel.AutoSizeToContents = true;
            m_IntervalSliderLabel.Dock   = Pos.Bottom;
            m_IntervalSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_IntervalSlider.Value = 0;


            //  Faux Weight
            m_AuxWeightSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_AuxWeightSlider.Dock = Pos.Bottom;
            m_AuxWeightSlider.SetRange(-0.2f, 1);
            m_AuxWeightSlider.Height        = 20;
            m_AuxWeightSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_AuxWeightSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_AuxWeightSliderLabel.AutoSizeToContents = true;
            m_AuxWeightSliderLabel.Dock   = Pos.Bottom;
            m_AuxWeightSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_AuxWeightSlider.Value = 0;


            //  Width
            m_WidthSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_WidthSlider.Dock = Pos.Bottom;
            m_WidthSlider.SetRange(0.75f, 1.25f);
            m_WidthSlider.Height        = 20;
            m_WidthSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_WidthSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_WidthSliderLabel.AutoSizeToContents = true;
            m_WidthSliderLabel.Dock   = Pos.Bottom;
            m_WidthSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_WidthSlider.Value = 1;


            //  Font Scale (Height)
            m_HeightSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_HeightSlider.Dock = Pos.Bottom;
            m_HeightSlider.SetRange(0.5f, 2);
            m_HeightSlider.Height        = 20;
            m_HeightSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_HeightSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_HeightSliderLabel.AutoSizeToContents = true;
            m_HeightSliderLabel.Dock   = Pos.Bottom;
            m_HeightSliderLabel.Margin = new Margin(0, 5, 0, 0);

            m_HeightSlider.Value = 1;


            //  m_Hinting
            m_HintingCheckBox               = new LabeledCheckBox(this);
            m_HintingCheckBox.Margin        = new Margin(0, 5, 0, 0);
            m_HintingCheckBox.Dock          = Pos.Bottom;
            m_HintingCheckBox.Text          = "Hinting";
            m_HintingCheckBox.IsChecked     = true;
            m_HintingCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Kerning
            m_KerningCheckBox               = new LabeledCheckBox(this);
            m_KerningCheckBox.Margin        = new Margin(0, 5, 0, 0);
            m_KerningCheckBox.Dock          = Pos.Bottom;
            m_KerningCheckBox.Text          = "Kerning";
            m_KerningCheckBox.IsChecked     = true;
            m_KerningCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Invert
            m_InvertCheckBox               = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_InvertCheckBox.Margin        = new Margin(0, 10, 0, 0);
            m_InvertCheckBox.Dock          = Pos.Bottom;
            m_InvertCheckBox.Text          = "Invert";
            m_InvertCheckBox.IsChecked     = false;
            m_InvertCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Font
            CreateFontPanel();
        }
Ejemplo n.º 12
0
        public VectorText_TransformedCurve2(Base parent)
            : base(parent)
        {
            //  Top Label
            Alt.GUI.Temporary.Gwen.Control.Label TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            TopLabel.AutoSizeToContents = true;
            TopLabel.Text      = "Non-linear \"Along-A-Curve\" Double Path Transformer";
            TopLabel.TextColor = Color.Yellow;
            TopLabel.Dock      = Pos.Top;
            TopLabel.Margin    = new Margin(0, 3, 0, 5);


            //  OutlineThicknessSlider
            m_OutlineThicknessSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_OutlineThicknessSlider.Dock = Pos.Bottom;
            m_OutlineThicknessSlider.SetSize(150, 20);
            m_OutlineThicknessSlider.SetRange(0.5f, 3);
            m_OutlineThicknessSlider.ValueChanged += OutlineThicknessSlider_ValueChanged;

            m_OutlineThicknessSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_OutlineThicknessSliderLabel.AutoSizeToContents = true;
            m_OutlineThicknessSliderLabel.Dock   = Pos.Bottom;
            m_OutlineThicknessSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_OutlineThicknessSlider.Value = 0.7f;


            //  OutlineCheckBox
            m_OutlineCheckBox      = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_OutlineCheckBox.Text = "Outline";
            m_OutlineCheckBox.Dock = Pos.Bottom;


            //  FillCheckBox
            m_FillCheckBox           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_FillCheckBox.Text      = "Fill";
            m_FillCheckBox.Dock      = Pos.Bottom;
            m_FillCheckBox.IsChecked = true;



            //  PointsNumberSlider
            m_PointsNumberSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_PointsNumberSlider.Dock = Pos.Bottom;
            m_PointsNumberSlider.SetSize(150, 20);
            m_PointsNumberSlider.SetRange(10, 400);
            m_PointsNumberSlider.NotchCount    = (int)(m_PointsNumberSlider.Max - m_PointsNumberSlider.Min);
            m_PointsNumberSlider.SnapToNotches = true;
            m_PointsNumberSlider.ValueChanged += PointsNumberSlider_ValueChanged;

            m_PointsNumberSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_PointsNumberSliderLabel.AutoSizeToContents = true;
            m_PointsNumberSliderLabel.Dock   = Pos.Bottom;
            m_PointsNumberSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_PointsNumberSlider.Value = 200;


            //  PreserveXScaleCheckBox
            m_PreserveXScaleCheckBox           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_PreserveXScaleCheckBox.Text      = "Preserve X scale";
            m_PreserveXScaleCheckBox.Dock      = Pos.Bottom;
            m_PreserveXScaleCheckBox.IsChecked = true;


            //  FixedLenCheckBox
            m_FixedLenCheckBox      = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_FixedLenCheckBox.Text = "Fixed Length";
            m_FixedLenCheckBox.Dock = Pos.Bottom;


            //  AnimateCheckBox
            m_AnimateCheckBox               = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(this);
            m_AnimateCheckBox.Text          = "Animate";
            m_AnimateCheckBox.Dock          = Pos.Bottom;
            m_AnimateCheckBox.CheckChanged += new GwenEventHandler(AnimateCheckBox_CheckChanged);
            m_AnimateCheckBox.Margin        = new Margin(0, 7, 0, 0);
        }
        public Example_AltNETType_SimpleFontCacheManager(Base parent)
            : base(parent)
        {
            //  OutlineThicknessSlider
            m_OutlineThicknessSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_OutlineThicknessSlider.Dock = Pos.Bottom;
            m_OutlineThicknessSlider.SetSize(150, 20);
            m_OutlineThicknessSlider.SetRange(0.5f, 3);
            m_OutlineThicknessSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_OutlineThicknessSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_OutlineThicknessSliderLabel.AutoSizeToContents = true;
            m_OutlineThicknessSliderLabel.Dock   = Pos.Bottom;
            m_OutlineThicknessSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_OutlineThicknessSlider.Value = 0.9f;


            //  Width
            m_WidthSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_WidthSlider.Dock = Pos.Bottom;
            m_WidthSlider.SetRange(8, 72);
            m_WidthSlider.NotchCount    = (int)(m_WidthSlider.Max - m_WidthSlider.Min);
            m_WidthSlider.SnapToNotches = true;
            m_WidthSlider.Height        = 20;
            m_WidthSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_WidthSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_WidthSliderLabel.AutoSizeToContents = true;
            m_WidthSliderLabel.Dock   = Pos.Bottom;
            m_WidthSliderLabel.Margin = new Margin(0, 3, 0, 0);

            m_WidthSlider.Value = 48;


            //  Height
            m_HeightSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_HeightSlider.Dock = Pos.Bottom;
            m_HeightSlider.SetRange(8, 72);
            m_HeightSlider.NotchCount    = (int)(m_HeightSlider.Max - m_HeightSlider.Min);
            m_HeightSlider.SnapToNotches = true;
            m_HeightSlider.Height        = 20;
            m_HeightSlider.ValueChanged += new GwenEventHandler(control_ValueChanged);

            m_HeightSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_HeightSliderLabel.AutoSizeToContents = true;
            m_HeightSliderLabel.Dock   = Pos.Bottom;
            m_HeightSliderLabel.Margin = new Margin(0, 5, 0, 0);

            m_HeightSlider.Value = m_WidthSlider.Value;


            //  m_Hinting
            m_HintingCheckBox               = new LabeledCheckBox(this);
            m_HintingCheckBox.Margin        = new Margin(0, 5, 0, 0);
            m_HintingCheckBox.Dock          = Pos.Bottom;
            m_HintingCheckBox.Text          = "Hinting";
            m_HintingCheckBox.IsChecked     = true;
            m_HintingCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Kerning
            m_KerningCheckBox               = new LabeledCheckBox(this);
            m_KerningCheckBox.Margin        = new Margin(0, 5, 0, 0);
            m_KerningCheckBox.Dock          = Pos.Bottom;
            m_KerningCheckBox.Text          = "Kerning";
            m_KerningCheckBox.IsChecked     = true;
            m_KerningCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Invert
            m_InvertCheckBox               = new LabeledCheckBox(this);
            m_InvertCheckBox.Margin        = new Margin(0, 10, 0, 0);
            m_InvertCheckBox.Dock          = Pos.Bottom;
            m_InvertCheckBox.Text          = "Invert";
            m_InvertCheckBox.IsChecked     = false;
            m_InvertCheckBox.CheckChanged += new GwenEventHandler(control_CheckChanged);


            //  Font
            CreateFontPanel();
        }
Ejemplo n.º 14
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Top Label
            Alt.GUI.Temporary.Gwen.Control.Label m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Sin Transformer";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(10, 3, 0, 5);


            //  ShiftX
            m_ShiftSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_ShiftSlider.Dock = Pos.Bottom;
            m_ShiftSlider.SetSize(150, 20);
            m_ShiftSlider.SetRange(0, 500);
            m_ShiftSlider.NotchCount    = (int)(m_ShiftSlider.Max - m_ShiftSlider.Min);
            m_ShiftSlider.SnapToNotches = true;
            m_ShiftSlider.ValueChanged += Slider_ValueChanged;

            m_ShiftSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_ShiftSliderLabel.AutoSizeToContents = true;
            m_ShiftSliderLabel.Dock   = Pos.Bottom;
            m_ShiftSliderLabel.Margin = new Margin(0, 10, 0, 0);


            //  Period
            m_PeriodSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_PeriodSlider.Dock = Pos.Bottom;
            m_PeriodSlider.SetSize(150, 20);
            m_PeriodSlider.SetRange(100, 500);
            m_PeriodSlider.NotchCount    = (int)(m_PeriodSlider.Max - m_PeriodSlider.Min);
            m_PeriodSlider.SnapToNotches = true;
            m_PeriodSlider.ValueChanged += Slider_ValueChanged;

            m_PeriodSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_PeriodSliderLabel.AutoSizeToContents = true;
            m_PeriodSliderLabel.Dock   = Pos.Bottom;
            m_PeriodSliderLabel.Margin = new Margin(0, 10, 0, 0);


            //  Amplitude
            m_AmplitudeSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_AmplitudeSlider.Dock = Pos.Bottom;
            m_AmplitudeSlider.SetSize(150, 20);
            m_AmplitudeSlider.SetRange(10, 100);
            m_AmplitudeSlider.NotchCount    = (int)(m_AmplitudeSlider.Max - m_AmplitudeSlider.Min);
            m_AmplitudeSlider.SnapToNotches = true;
            m_AmplitudeSlider.ValueChanged += Slider_ValueChanged;

            m_AmplitudeSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_AmplitudeSliderLabel.AutoSizeToContents = true;
            m_AmplitudeSliderLabel.Dock   = Pos.Bottom;
            m_AmplitudeSliderLabel.Margin = new Margin(0, 5, 0, 0);


            m_AmplitudeSlider.Value = 50;
            m_PeriodSlider.Value    = 500;
            m_ShiftSlider.Value     = 0;


            //  Text
            m_TextBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
            m_TextBox.SetText(Common.AltSketch_Vector_Graphics_Library);
            m_TextBox.Font      = new Font("Times New Roman", 42);
            m_TextBox.TextColor = Color.OrangeRed;
            //m_TextBox.SelectionColor = Color.Yellow;
            m_TextBox.SizeToContents();
            m_TextBox.Dock     = Pos.Bottom;
            m_TextBox.Margin   = new Margin(5, 10, 5, 10);
            m_TextBox.ReadOnly = true;

            m_TextBox.CursorPos = 19;
            m_TextBox.CursorEnd = 7;
            m_TextBox.Focus();
        }
Ejemplo n.º 15
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = 1;


            //  Scale
            m_ScaleControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_ScaleControl.SetBounds(10, 30, 20, 200);

            m_ScalePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            m_ScalePlusButton.Text   = "+";
            m_ScalePlusButton.Dock   = Pos.Top;
            m_ScalePlusButton.Click += new EventHandler(ScalePlusButton_Click);

            m_ScaleMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            m_ScaleMinusButton.Text   = "-";
            m_ScaleMinusButton.Dock   = Pos.Bottom;
            m_ScaleMinusButton.Click += new EventHandler(ScaleMinusButton_Click);

            m_ScaleSlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleSlider.Dock = Pos.Fill;
            m_ScaleSlider.SetRange(0.3f, 5);
            m_ScaleSlider.Value = 1;


            //  Rotate
            m_RotateControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_RotateControl.SetBounds(30, 10, 200, 20);

            m_RotatePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotatePlusButton.Text   = "+";
            m_RotatePlusButton.Dock   = Pos.Right;
            m_RotatePlusButton.Width  = m_RotateControl.Height;
            m_RotatePlusButton.Click += new EventHandler(RotatePlusButton_Click);

            m_RotateMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotateMinusButton.Text   = "-";
            m_RotateMinusButton.Dock   = Pos.Left;
            m_RotateMinusButton.Width  = m_RotateControl.Height;
            m_RotateMinusButton.Click += new EventHandler(RotateMinusButton_Click);

            m_RotateSlider      = new HorizontalSlider(m_RotateControl);
            m_RotateSlider.Dock = Pos.Fill;
            m_RotateSlider.SetRange(-180, 180);
            m_RotateSlider.Value = 0;


            //  Magnification
            m_MagnificationSlider      = new HorizontalSlider(this);
            m_MagnificationSlider.Dock = Pos.Bottom;
            m_MagnificationSlider.SetRange(0.01f, 4);
            m_MagnificationSlider.ValueChanged += new GwenEventHandler(MagnificationSlider_ValueChanged);
            m_MagnificationSlider.Height        = 20;
            m_MagnificationSlider.Margin        = new Margin(0, 3, 0, 0);

            m_MagnificationLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_MagnificationLabel.AutoSizeToContents = true;
            m_MagnificationLabel.Dock = Pos.Bottom;

            m_MagnificationSlider.Value = 3.2f;


            //  Radius
            m_RadiusSlider      = new HorizontalSlider(this);
            m_RadiusSlider.Dock = Pos.Bottom;
            m_RadiusSlider.SetRange(10, 200);
            m_RadiusSlider.ValueChanged += new GwenEventHandler(RadiusSlider_ValueChanged);
            m_RadiusSlider.Height        = 20;
            m_RadiusSlider.Margin        = new Margin(0, 3, 0, 0);

            m_RadiusLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_RadiusLabel.AutoSizeToContents = true;
            m_RadiusLabel.Dock   = Pos.Bottom;
            m_RadiusLabel.Margin = new Margin(0, 10, 0, 0);

            m_RadiusSlider.Value = 100;


            //  Sight
            m_ShowSightCheckBox               = new LabeledCheckBox(this);
            m_ShowSightCheckBox.Dock          = Pos.Bottom;
            m_ShowSightCheckBox.Text          = "Show Sight";
            m_ShowSightCheckBox.Margin        = new Margin(0, 3, 0, 0);
            m_ShowSightCheckBox.IsChecked     = true;
            m_ShowSightCheckBox.CheckChanged += new GwenEventHandler(ShowSightCheckBox_CheckChanged);



            m_OpacitySlider.ValueChanged       += new GwenEventHandler(Slider_ValueChanged);
            m_ScaleSlider.ValueChanged         += new GwenEventHandler(Slider_ValueChanged);
            m_RotateSlider.ValueChanged        += new GwenEventHandler(Slider_ValueChanged);
            m_MagnificationSlider.ValueChanged += new GwenEventHandler(Slider_ValueChanged);
            m_RadiusSlider.ValueChanged        += new GwenEventHandler(Slider_ValueChanged);
            //  Preview
            m_OpacitySlider.ValueChanged += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);



            //
            m_RadiusPen = new Pen(
                Color.FromArgb(0.7, Color.LimeGreen * 1.2),
                //Color.FromArgb(0.7, Color.Red),
                3);



            //
            m_SVGPath = new SVGPath();

            m_x        = m_DrawingPanel.ClientWidth / 2;
            m_y        = m_DrawingPanel.ClientHeight / 2;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/tiger.svg");
            }
            catch (SVGException)
            {
                //TEMP  message(.ToString(e.Message));

                return;
            }
        }