public HtmlConverter()
        {
            InitializeComponent();
            frameworkElements = Designer.frameworkElements;
            //HTMLnote.Text += "<html>\n  <head>\n </head>\n  <body>\n";
            //if (frameworkElements != null)
            //    foreach (DesignerComponent de in frameworkElements)
            //    {
            //        if (de.MyUI is UI_Button)
            //        {
            //            UI_Button be = de.MyUI as UI_Button;
            //            HTMLnote.Text += " <button type=" + '\u0022' + "button" + '\u0022' + ">\n   ";
            //            HTMLnote.Text += "   " + be.UIName;
            //            HTMLnote.Text += "  \n</button>\n";

            //        }
            //        else if (de.MyUI is UI_TextBox)
            //        {
            //            UI_TextBox be = de.MyUI as UI_TextBox;
            //            HTMLnote.Text += " <textbox type=" + '\u0022' + "textbox" + '\u0022' + ">\n   ";
            //            HTMLnote.Text += "   " + be.UIName;

            //            HTMLnote.Text += "  \n</textbox>\n";
            //        }
            //    }
            //HTMLnote.Text += "  </body>\n</html>";
            HTMLnote.Text += "<html>\n<head>\n</head>\n<body>\n";
            if (frameworkElements != null)
            {
                foreach (DesignerComponent de in frameworkElements)
                {
                    if (de.MyUI is UI_Button)
                    {
                        UI_Button be = de.MyUI as UI_Button;
                        HTMLnote.Text += "<button type=" + '\u0022' + "button" + '\u0022' + "size=" + '\u0022' + de.Width + '\u0022' +
                                         "name=" + '\u0022' + be.UIName + '\u0022'
                                         + "style=" + '\u0022' + "height:" + de.Height + "px" + '\u0022' + ">\n";
                        HTMLnote.Text += "" + be.UIName;
                        HTMLnote.Text += "\n</button>\n";
                    }
                    else if (de.MyUI is UI_TextBox)
                    {
                        UI_TextBox be = de.MyUI as UI_TextBox;
                        HTMLnote.Text += "<input style=" + '\u0022' + "ime - mode:auto" + '\u0022' +
                                         "size=" + '\u0022' + de.Width + '\u0022' +
                                         "name=" + '\u0022' + be.UIName + '\u0022'
                                         + "style=" + '\u0022' + "height:" + de.Height + "px" + '\u0022';
                        HTMLnote.Text += "</input>\n";
                    }
                }
            }
            HTMLnote.Text += "</body>\n</html>\n";
            WebModelingStaticClass.TestWebBrowserData = HTMLnote.Text;
        }
Exemplo n.º 2
0
        // 유아이 속성창 보여주기
        private void UIPropertyDataSetting()
        {
            WebModelingStaticClass.ucp.UI_NameSetting     = this.MyUI.UIName;
            WebModelingStaticClass.ucp.UIHeigthSetting    = this.Height;
            WebModelingStaticClass.ucp.UIWidthSetting     = this.Width;
            WebModelingStaticClass.ucp.UI_HorizonSetting  = UIHorizontal;
            WebModelingStaticClass.ucp.UI_VerticalSetting = UIVertical;

            //UI 형변환
            if ((MyUI is UI_Button))
            {
                UI_Button but = this.MyUI as UI_Button;
                WebModelingStaticClass.ucp.UIKindSetting         = "버튼";
                WebModelingStaticClass.ucp.LB_Option1.Text       = but.UIName;
                WebModelingStaticClass.ucp.UI_Option1.Text       = but.UIName;
                WebModelingStaticClass.ucp.UI_Option1.Visibility = Visibility.Visible;
            }
            else if ((MyUI is UI_TextBox))
            {
                UI_TextBox but = this.MyUI as UI_TextBox;
                WebModelingStaticClass.ucp.UIKindSetting = "텍스트박스";
            }
        }
Exemplo n.º 3
0
        private void OuterBorder_MouseUp(object sender, MouseButtonEventArgs e)
        {
            WebModelingStaticClass.IsMainGridClik = true;
            Point pt = e.GetPosition(this);

            pt.Y = pt.Y;
            if (WebModelingStaticClass.ul.NewButton.IsSelected || IsUIChecked[0] == true)
            {
                UI_Button my = new UI_Button("Button", "이태릭체", "없음", 10);
                Rectangle r  = new Rectangle();
                Button    mq = new Button();
                r.RadiusX = 0;
                r.RadiusY = 0;
                //ImageBrush myBrush = new ImageBrush();
                //myBrush.ImageSource =
                //    new BitmapImage(new Uri(@"C:\Users\inhye\Desktop\1497330714590.jpg", UriKind.Relative));
                //r.Fill = myBrush;
                // r.Fill = new SolidColorBrush(Colors.Black);
                VisualBrush myBrush = new VisualBrush();
                StackPanel  aPanel  = new StackPanel();
                // Create a DrawingBrush and use it to
                // paint the panel.
                DrawingBrush  myDrawingBrushBrush = new DrawingBrush();
                GeometryGroup aGeometryGroup      = new GeometryGroup();
                aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(0, 0, 50, 50)));
                //aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(50, 50, 50, 50)));
                RadialGradientBrush checkerBrush = new RadialGradientBrush();
                checkerBrush.GradientStops.Add(new GradientStop(Colors.Gray, 0.0));
                //checkerBrush.GradientStops.Add(new GradientStop(Colors.White, 1.0));
                GeometryDrawing checkers = new GeometryDrawing(checkerBrush, null, aGeometryGroup);
                myDrawingBrushBrush.Drawing = checkers;
                aPanel.Background           = myDrawingBrushBrush;

                // Create some text.
                TextBlock someText = new TextBlock();
                someText.Text = "Button";
                FontSizeConverter fSizeConverter = new FontSizeConverter();
                someText.FontSize = (double)fSizeConverter.ConvertFromString("10pt");
                someText.Margin   = new Thickness(10);
                aPanel.Children.Add(someText);
                myBrush.Visual = aPanel;
                r.Fill         = myBrush;
                r.Fill.Opacity = 0.8;
                this.Add(r, my, pt);
                WebModelingStaticClass.ul.NewButton.IsSelected = false;
            }

            else if ((WebModelingStaticClass.ul.NewCheckBox.IsSelected) || IsUIChecked[1] == true)
            {
                UI_TextBox my = new UI_TextBox("TextBox", "이태릭체", "없음", 10);
                Rectangle  r  = new Rectangle();
                r.RadiusX = 0;
                r.RadiusY = 0;

                VisualBrush   myBrush             = new VisualBrush();
                StackPanel    aPanel              = new StackPanel();
                DrawingBrush  myDrawingBrushBrush = new DrawingBrush();
                GeometryGroup aGeometryGroup      = new GeometryGroup();
                aGeometryGroup.Children.Add(new RectangleGeometry(new Rect(0, 0, 50, 50)));
                RadialGradientBrush checkerBrush = new RadialGradientBrush();
                checkerBrush.GradientStops.Add(new GradientStop(Colors.LightCyan, 0.0));
                GeometryDrawing checkers = new GeometryDrawing(checkerBrush, null, aGeometryGroup);
                myDrawingBrushBrush.Drawing = checkers;
                aPanel.Background           = myDrawingBrushBrush;

                // Create some text.
                TextBlock someText = new TextBlock();
                someText.Text = "텍스트박스";
                FontSizeConverter fSizeConverter = new FontSizeConverter();
                someText.FontSize = (double)fSizeConverter.ConvertFromString("10pt");
                someText.Margin   = new Thickness(10);
                aPanel.Children.Add(someText);
                myBrush.Visual = aPanel;

                r.Fill         = myBrush;
                r.Fill.Opacity = 0.8;
                this.Add(r, my, pt);
                WebModelingStaticClass.ul.NewCheckBox.IsSelected = false;
            }
            for (int i = 0; i < IsUIChecked.Length; i++)
            {
                IsUIChecked[i] = false;
            }
            WebModelingStaticClass.IsMainGridClik = false;
        }