public SolutionFileView()
        {
            this.Colors = new Dictionary <SolutionFileTextFragment, Color>
            {
                { SolutionFileTextFragment.Comment, Color.FromRGB(0, 0x80, 0) },
                { SolutionFileTextFragment.Keyword, Color.Blue },

                { SolutionFileTextFragment.None, Color.None },

                { SolutionFileTextFragment.String, Color.FromRGB(0x80, 0, 0) },
                { SolutionFileTextFragment.Type, Color.FromRGB(43, 145, 175) },

                { SolutionFileTextFragment.XMLKeyword, Color.FromRGB(0, 0, 0xff) },
                { SolutionFileTextFragment.XMLElement, Color.FromRGB(0x80, 0, 0) },
                { SolutionFileTextFragment.XMLAttributeName, Color.FromRGB(0xff, 0, 0) },
                { SolutionFileTextFragment.XMLAttributeValue, Color.FromRGB(0, 0, 0xff) },
                { SolutionFileTextFragment.XMLComment, Color.FromRGB(0, 0x80, 0) },
                { SolutionFileTextFragment.XMLText, Color.None },
            };

            this.Container = new IHTMLDiv();

            this.View = new IHTMLPre().AttachTo(this.Container);
            this.View.style.margin = "0";

            this.Container.style.overflow = IStyle.OverflowEnum.auto;
        }
Beispiel #2
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IDefaultPage page)
        {
            // Update document title
            // http://do.jsc-solutions.net/Update-document-title

            @"Hello world".ToDocumentTitle();

            #region phase 2
            var bg = new IHTMLDiv().AttachTo(page.Header);

            bg.style.SetSize(800, 600);
            bg.style.position = IStyle.PositionEnum.relative;

            var c = new IHTMLDiv().AttachTo(bg);

            c.style.left     = "4px";
            c.style.right    = "4px";
            c.style.bottom   = "4px";
            c.style.top      = "4px";
            c.style.position = IStyle.PositionEnum.absolute;

            new TwentyTenWorkspace().ToBackground(
                bg.style
                );


            var dv = new SolutionDocumentViewer
            {
                "Default.htm",
                "Application.cs",
                "ApplicationWebService.cs",
                "XX XXX XX XXX XX XXX XXX XXx XXX XXX",
            };

            dv.Add(
                new SolutionDocumentViewerTab
            {
                Text = "Program.cs"
            }.With(
                    k =>
            {
                k.Activated +=
                    delegate
                {
                    dv.Content.innerHTML = "hello world";
                };
            }
                    )
                );

            dv.Container.AttachTo(c);
            dv.Last().Activate();


            #endregion

            new TwentyTenWorkspace().ToBackground(
                page.Background.style
                );
        }
Beispiel #3
0
        private static IHTMLDiv SpawnDiv(Dictionary <string, IHTMLImage> Images, bool b)
        {
            var div1 = new IHTMLDiv();
            var div2 = new IHTMLDiv();


            var img1 = (IHTMLImage)Images["room 001, obj 005 (296,32)"].cloneNode(false);
            var img2 = (IHTMLImage)Images["room 002, obj 002 (0,24)"].cloneNode(false);
            var img3 = (IHTMLImage)Images["room 002, obj 002 (0,24)"].cloneNode(false);

            div2.AttachTo(div1);
            div2.style.position = IStyle.PositionEnum.relative;
            div2.style.SetSize(100, 100);
            div2.style.border = "1px solid red";

            if (b)
            {
                div2.onfocus += ev => div2.blur();
            }

            img1.style.SetLocation(4, 4);
            img1.AttachTo(div2);

            img2.style.SetLocation(33, 4);
            img2.AttachTo(div2);
            img2.onfocus += ev => img2.blur();

            img3.style.SetLocation(66, 4);
            img3.AttachTo(div2);
            img3.onfocus += ev => ev.preventDefault();

            return(div1);
        }
Beispiel #4
0
        private static void AddSection12(Action <string, IHTMLDiv> AddSection)
        {
            var Content = new IHTMLDiv().With(
                k =>
            {
                k.style.border   = "1px solid gray";
                k.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.relative;
                k.style.width    = "100%";
                k.style.height   = "25em";
            }
                );

            var vsv = new VisualStudioView();

            vsv.Container.AttachTo(Content);

            //var Save = new InternalSaveActionSprite().AddSaveTo(vsv,
            //    i =>
            //    {
            //        i.FileName = "Project1.zip";


            //        new SolutionBuilder().WriteTo(i.Add);

            //    }
            //);

            AddSection(
                "TwentyTen Design With Save",
                Content
                );
        }
        public static void SetDialogColor(this IHTMLDiv toolbar, Color toolbar_color, bool up)
        {
            if (up)
            {
                toolbar.style.backgroundColor = toolbar_color;

                var toolbar_color_light  = toolbar_color.AddLum(+20);
                var toolbar_color_shadow = toolbar_color.AddLum(-20);

                toolbar.style.borderLeft         = "1px solid " + toolbar_color_light;
                toolbar.style.borderTop          = "1px solid " + toolbar_color_light;
                toolbar.style.borderRight        = "1px solid " + toolbar_color_shadow;
                toolbar.style.borderBottom       = "1px solid " + toolbar_color_shadow;
                toolbar.style.backgroundPosition = "0px 0px";
            }
            else
            {
                toolbar.style.backgroundColor = toolbar_color.AddLum(+15);

                var toolbar_color_light  = toolbar_color.AddLum(+20 + 15);
                var toolbar_color_shadow = toolbar_color.AddLum(-20 + 15);

                toolbar.style.borderLeft         = "1px solid " + toolbar_color_shadow;
                toolbar.style.borderTop          = "1px solid " + toolbar_color_shadow;
                toolbar.style.borderRight        = "1px solid " + toolbar_color_light;
                toolbar.style.borderBottom       = "1px solid " + toolbar_color_light;
                toolbar.style.backgroundPosition = "1px 1px";
            }
        }
Beispiel #6
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // http://stackoverflow.com/questions/2297217/ie-8-defaultview-equivalent
            // https://developer.mozilla.org/en-US/docs/Web/API/document.defaultView
            // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-defaultview
            // http://stackoverflow.com/questions/9183555/whats-the-point-of-document-defaultview

            {
                var div = new IHTMLDiv {
                    innerText = "?"
                }.AttachToDocument();

                // http://msdn.microsoft.com/en-us/library/ms534331%28VS.85%29.aspx
                var defaultView = (div.ownerDocument as dynamic).defaultView;

                div.innerText = new { defaultView }.ToString();
            }


            {
                var div = new IHTMLDiv {
                    innerText = "?"
                }.AttachToDocument();

                // http://msdn.microsoft.com/en-us/library/ms534331%28VS.85%29.aspx
                var parentwindow = (div.ownerDocument as dynamic).parentwindow;

                div.innerText = new { parentwindow }.ToString();
            }
        }
Beispiel #7
0
        private static void Spawn(double Rotation)
        {
            var z = new IHTMLDiv().AttachToDocument();
            var r = new IHTMLDiv().AttachTo(z);

            z.style.position = IStyle.PositionEnum.relative;
            var i = new IHTMLImage(Assets.Path + "/Preview.png").AttachTo(r);

            var b = new IHTMLButton().AttachTo(r);

            b.innerText = "hello world";
            b.style.SetLocation(20, 20);
            z.style.SetLocation(100, 100);


            var costheta = Math.Cos(Rotation);
            var sintheta = Math.Sin(Rotation);

            var M11 = costheta;
            var M12 = -sintheta;
            var M21 = sintheta;
            var M22 = costheta;


            z.style.SetMatrixTransform(
                M11, M21,
                M12, M22,

                0, 0
                );
        }
            public ScoreBoard(ImageResources gfx)
            {
                Life1 = gfx.biggun.Clone();
                Life2 = gfx.biggun.Clone();
                Life3 = gfx.biggun.Clone();

                score_label.style.color = Color.White;
                lives_label.style.color = Color.White;

                score_value.style.color = Color.Green;

                var left = new IHTMLDiv(score_label, score_value);

                left.style.Float = IStyle.FloatEnum.left;

                lives_value.appendChild(
                    Life1,
                    Life2,
                    Life3
                    );

                score_value.style.paddingLeft = "1em";
                Life1.style.paddingLeft       = "1em";
                Life2.style.paddingLeft       = "1em";
                Life3.style.paddingLeft       = "1em";

                var right = new IHTMLDiv(lives_label, lives_value);

                right.style.Float = IStyle.FloatEnum.right;

                Control.style.fontSize = "22px";
                Control.appendChild(left, right);
            }
Beispiel #9
0
        public static IHTMLElement AsHTMLElement(this XElement value)
        {
            // X:\jsc.svn\examples\javascript\Test\TestXElementAdd\TestXElementAdd\Application.cs

            if (value == null)
            {
                return(null);
            }

            // X:\jsc.svn\examples\javascript\appengine\StopwatchTimetravelExperiment\StopwatchTimetravelExperiment\Application.cs

            var __XElement = (__XElement)value;

            var c = new IHTMLDiv();


            var xml = value.ToString();

            //Console.WriteLine("AsHTMLElement " + new { xml });
            c.innerHTML = xml;

            var firstChild = ((IHTMLElement)c.firstChild);

            __XElement.InternalValue = firstChild;


            //var zxml = value.ToString();
            //Console.WriteLine("AsHTMLElement " + new { zxml });

            return(firstChild);
        }
Beispiel #10
0
        public Apple AttachTo(IHTMLDiv canvas)
        {
            MoveToLocation();
            Control.AttachTo(canvas);

            return(this);
        }
Beispiel #11
0
        public RedNumberDisplay(int Digits, int value, Assets MyAssets)
        {
            this.MyAssets = MyAssets;
            this.Digits   = Digits;

            this.Control.style.SetSize(Width, Height);
            this.Control.style.backgroundColor = Color.Black;
            this.Control.style.position        = IStyle.PositionEnum.relative;

            DigitControls = Enumerable.Range(0, Digits).Select(
                i =>
            {
                var d = new IHTMLDiv();

                d.style.SetLocation(i * DigitX, 0, DigitX, DigitY);
                d.style.SetBackground(MyAssets.red_numbers[0]);

                d.AttachTo(this.Control);

                return(d);
            }
                ).ToArray();


            this.Value = value;
        }
Beispiel #12
0
        public UltraApplication(IHTMLElement e)
        {
            var Title = new IHTMLDiv
            {
            };

            new Browsers
            {
            }.Container.AttachTo(Title);

            new HTML.Images.FromBase64.twitter_small().AttachToDocument();
            new HTML.Images.FromBase64._troll__by_GirlFlash().AttachToDocument();

            var TitleLogo = new IHTMLImage("assets/ScriptCoreLib/jsc.png");
            var TitleText = new IHTMLSpan("UltraApplication");

            TitleText.style.fontFamily    = ScriptCoreLib.JavaScript.DOM.IStyle.FontFamilyEnum.Verdana;
            TitleText.style.paddingLeft   = "2em";
            TitleText.style.fontSize      = "xx-large";
            TitleLogo.style.verticalAlign = "middle";


            Title.appendChild(TitleLogo);
            Title.appendChild(TitleText);

            Title.style.height = "128px";

            Title.AttachToDocument();
            Title.FadeIn(2500, 1000,
                         delegate
            {
                1500.AtDelay(ContinueBuildingApplication);
            }
                         );
        }
Beispiel #13
0
            public int Add(object e)
            {
                var i = new IHTMLDiv {
                    innerText = e.ToString()
                };

                var IsSelected = false;


                i.onclick +=
                    delegate
                {
                    IsSelected = !IsSelected;

                    if (IsSelected)
                    {
                        i.style.color           = JSColor.System.HighlightText;
                        i.style.backgroundColor = JSColor.System.Highlight;
                    }
                    else
                    {
                        i.style.color           = JSColor.None;
                        i.style.backgroundColor = JSColor.None;
                    }
                };


                Owner.HTMLTarget.Add(i);

                return(0);
            }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // what about gif, svg, canvas and webgl?
            Native.document.icon = new fullbox();

            new IHTMLButton {
                "?"
            }.AttachToDocument().WhenClicked(
                button =>
            {
                var div = new IHTMLDiv {
                    "?"
                };

                // 7x20
                div.style.color  = "red";
                div.style.width  = "16px";
                div.style.height = "16px";

                IHTMLImage i = div;

                var c = new CanvasRenderingContext2D(16, 16);

                c.drawImage(i, 0, 0, 16, 16);


                Native.css.style.cursorImage = i;

                // Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
                // why wont this work?
                Native.document.icon = c.canvas.toDataURL();
            }
                );
        }
Beispiel #15
0
        private static void AddSection4(IApplicationLoader pp)
        {
            var s = new Section().ToSectionConcept();

            s.Header = "Horizontal split";
            var Content = new IHTMLDiv().With(
                k =>
            {
                k.style.border   = "1px solid gray";
                k.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.relative;
                k.style.width    = "100%";
                k.style.height   = "4em";
            }
                );

            var hh = new HorizontalSplit
            {
                Minimum = 0.05,
                Maximum = 0.95,
                Value   = 0.7
            };

            hh.Container.AttachTo(Content);

            s.Content = Content;

            s.IsExpanded = false;
            s.Target.Container.AttachTo(pp.Content);
        }
Beispiel #16
0
 public __Shape()
 {
     InternalSprite = new IHTMLDiv();
     InternalSprite.style.position = ScriptCoreLib.JavaScript.DOM.IStyle.PositionEnum.absolute;
     InternalSprite.style.left     = "0px";
     InternalSprite.style.top      = "0px";
 }
Beispiel #17
0
        public __RadioButton()
        {
            // http://msdn2.microsoft.com/en-us/library/system.windows.forms.radiobutton.aspx

            /* Use the Checked property to get or set the state of a RadioButton.
             * The option button's appearance can be altered to appear as a toggle-style
             * button or as a standard option button by setting the Appearance property.
             */

            // http://javascript.about.com/library/blradio2.htm

            /* The solution here is to give all of the radio buttons within the group
             * the same name but different values. Here is the code used to code just
             * radio button themselves on the previous page that shows you how this is done.
             */

            // http://www.thescripts.com/forum/thread468483.html

            // IE support
            // http://www.gtalbot.org/DHTMLSection/DynamicallyCreateRadioButtons.html

            HTMLTarget = new IHTMLDiv();
            HTMLTarget.style.whiteSpace = ScriptCoreLib.JavaScript.DOM.IStyle.WhiteSpaceEnum.nowrap;

            button = new IHTMLInput(ScriptCoreLib.Shared.HTMLInputTypeEnum.radio);
            label  = new IHTMLLabel("", button);

            HTMLTarget.appendChild(button, label);
        }
Beispiel #18
0
            public XRectangle()
            {
                var aelement = new IHTMLDiv();



                // WPF: Rectangle, Image or Label
                var acontent = new IHTMLDiv();

                acontent.style.backgroundColor = "#ff0000";

                this.Rotor = new IHTMLDiv();

                //this.Rotor.style.backgroundColor = "#ffd0d0";

                this.Rotor.style.border = "1px solid black";

                //this.Rotor.style.paddingRight = "10px";

                this.Rotor.AttachTo(aelement);

                acontent.AttachTo(this.Rotor);

                aelement.AttachToDocument();

                Element = aelement;
                Content = acontent;
            }
        public void DrawRectangleToCanvas(CanvasRectangle c)
        {
            var x = new IHTMLDiv();

            x.style.overflow = IStyle.OverflowEnum.hidden;

            c._Dispose =
                delegate(CanvasRectangle u)
            {
                if (x == null)
                {
                    return;
                }
                x.Orphanize();
                x = null;
            };

            c._Update =
                delegate(CanvasRectangle u)
            {
                if (x == null)
                {
                    return;
                }

                var r = u.Location;

                x.style.SetLocation(r.Left, r.Top, r.Width, r.Height);
                x.style.backgroundColor = u.BackgroundColor;
            };

            c.Update();

            this.Layers.Canvas.appendChild(x);
        }
Beispiel #20
0
        // Summary:
        //     Initializes a new instance of the System.Windows.Forms.TabPage class.
        public __TabPage()
        {
            this.__controlCollection = new __TabPageControlCollection((TabPage)this);
            this.__tabId             = "tab" + __tabCount;
            __tabCount++;

            InternalElement = new IHTMLDiv();
            InternalElement.style.whiteSpace = ScriptCoreLib.JavaScript.DOM.IStyle.WhiteSpaceEnum.nowrap;
            InternalElement.style.border     = "1px solid gray";
            InternalElement.style.borderTop  = "none";

            __tabButton = new IHTMLButton(this.__tabId);

            __tabButton.ApplyBorderStyle(global::System.Windows.Forms.BorderStyle.Fixed3D);

            __tabButton.style.textDecoration  = "none";
            __tabButton.style.color           = "#42454a";
            __tabButton.style.backgroundColor = "#dedbde";

            __tabButton.style.top    = "50%";
            __tabButton.style.bottom = "50%";

            int newh = __TabControl.__TAB_BAR_HEIGHT - 2;

            __tabButton.style.height = "" + newh;

            __tabButton.style.border       = "ridge";
            __tabButton.style.borderTop    = "ridge";
            __tabButton.style.borderRight  = "ridge";
            __tabButton.style.borderLeft   = "ridge";
            __tabButton.style.borderBottom = "none";

            __tabButton.style.paddingBottom = "8px";

            setFont(DefaultFont);

            Li = new IHTMLListItem();
            Li.style.display = IStyle.DisplayEnum.inline;
            //Li.style.padding = "5px";
            Li.style.marginRight = "0"; // "5px";

            Li.style.Float = IStyle.FloatEnum.left;

            this.__isSelected = true;

            // 2013-09-30
            // Error	5	The type 'System.Xml.Linq.XElement' is defined in
            // an assembly that is not referenced. You must add a
            // reference to assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.	X:\jsc.svn\core\ScriptCoreLib.Windows.Forms\ScriptCoreLib.Windows.Forms\JavaScript\BCLImplementation\System\Windows\Forms\TabPage.cs	72	13	ScriptCoreLib.Windows.Forms

            Li.appendChild(__tabButton);
            Li.style.Float = IStyle.FloatEnum.left;

            __DeSelectTab();

            InternalElement.style.backgroundColor = "white";

            TextChanged += OnTextChanged;
        }
Beispiel #21
0
        public static void Create(IHTMLDiv Container, int width, int height, Action <YouTubePlayer> handler)
        {
            var Context = Container.Token.Context;

            var n = new YouTubePlayer {
                id = Context.CreateToken()
            };

            if (Create_onYouTubePlayerReady_token == null)
            {
                Create_onYouTubePlayerReady_token = Context.CreateToken();
                Create_onYouTubePlayerReady_token.External(
                    (string id) =>
                {
                    if (Create_onYouTubePlayerReady != null)
                    {
                        Create_onYouTubePlayerReady(id);
                    }
                }
                    );

                1.ExternalAtDelay(
                    "window['onYouTubePlayerReady'] = function (_id) {document.getElementById('" + Context.Element.id + "')['" + Create_onYouTubePlayerReady_token + "'](_id); };"
                    );
            }

            Container.innerHTML = @"<object 
				type='application/x-shockwave-flash' 
				data='http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="                 + n.id + @"' 
				width='"                 + width + @"' 
				height='"                 + height + @"' 
				
				wmode='window' 
				id='"                 + n.id + @"'
				name='"                 + n.id + @"'
			
				allowFullScreen='true' 
				allowNetworking='all' 
				allowScriptAccess='always'>
			  <param name='movie' value='http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="             + n.id + @"' />
			</object>"            ;

            n.Token.Context = Container.Token.Context;

            Create_onYouTubePlayerReady +=
                id =>
            {
                if (n == null)
                {
                    return;
                }

                if (id == n.id)
                {
                    handler(n);
                    n = null;
                }
            };
        }
Beispiel #22
0
 public __ContextMenuStrip(IContainer container)
 {
     InternalElement = new IHTMLDiv();
     InternalElement.style.background  = JSColor.White;
     InternalElement.style.border      = JSColor.Gray;
     InternalElement.style.borderWidth = "1px";
     InternalElement.style.borderStyle = "solid";
 }
        public static IHTMLDiv AttachToDocument(this string e)
        {
            var r = new IHTMLDiv(e);

            r.AttachToDocument();

            return(r);
        }
Beispiel #24
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IDefaultPage page)
        {
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.getExternalStoragePublicDirectory(
                "",
                root =>
            {
                Action <string, IHTMLElement> listFiles = null;

                listFiles =
                    (xroot, xcontainer) =>
                {
                    if (!xroot.EndsWith("/"))
                    {
                        xroot += "/";
                    }

                    new IHTMLPre {
                        innerText = xroot
                    }.AttachTo(xcontainer);

                    service.listFiles(xroot,
                                      f =>
                    {
                        var ch = new IHTMLDiv();

                        ch.style.marginLeft = "1em";


                        new IHTMLButton {
                            innerText = f
                        }.AttachTo(xcontainer).With(
                            btn =>
                        {
                            btn.style.display = IStyle.DisplayEnum.block;

                            btn.onclick +=
                                delegate
                            {
                                if (f.EndsWith("/"))
                                {
                                    listFiles(xroot + f, ch);
                                }
                            };
                        }
                            );

                        ch.AttachTo(xcontainer);
                    }
                                      );
                };


                listFiles(root, Native.Document.body);
            }
                );
        }
        internal static void CreateToolboxTo(IHTMLDiv ToolboxContainer)
        {
            var items = new
            {
                img = default(IHTMLElement)
            }.ToEmptyList();

            Action <IHTMLElement> Add =
                img =>
            {
                img.style.cursor = ScriptCoreLib.JavaScript.DOM.IStyle.CursorEnum.move;

                new IHTMLDiv().With(
                    div =>
                {
                    var backgroundColor = default(Color);

                    if (items.Count % 2 == 0)
                    {
                        backgroundColor = Color.FromGray(0xf7);
                    }
                    else
                    {
                        backgroundColor = Color.FromGray(0xf0);
                    }



                    //div.style.height = "90px";
                    div.style.overflow  = ScriptCoreLib.JavaScript.DOM.IStyle.OverflowEnum.hidden;
                    div.style.textAlign = ScriptCoreLib.JavaScript.DOM.IStyle.TextAlignEnum.center;

                    div.Add(
                        img
                        );

                    img.title = "Drag this component into the designer!";

                    items.Add(
                        new
                    {
                        img = img
                    }
                        );

                    ToolboxContainer.Add(div);

                    ApplyMouseHoverStyle(div, backgroundColor);
                }
                    );
            };

            Add(new JSCSolutionsNETImage());
            Add(new ToolboxIconsIHTMLButton());
            Add(new ToolboxIconsIHTMLInputCheckbox());
            Add(new ToolboxIconsIHTMLInputText());
            Add(new ToolboxIconsIHTMLTextarea());
        }
        void init()
        {
            this.__ul = new IHTMLUnorderedList();

            this.__ul.name               = "tabs";
            this.__ul.style.marginTop    = "0";
            this.__ul.style.marginRight  = "0";
            this.__ul.style.marginBottom = "-1px";
            this.__ul.style.marginLeft   = "0";

            this.__ul.style.paddingTop    = "0";
            this.__ul.style.paddingRight  = "0";
            this.__ul.style.paddingBottom = "0.3em";
            this.__ul.style.paddingLeft   = "0";

            this.__ul.style.width  = "" + this.Size.Width;
            this.__ul.style.height = "" + __TAB_BAR_HEIGHT;

            this.__ul.style.Float = DOM.IStyle.FloatEnum.left;

            this.__ulContainer                = new IHTMLDiv();
            this.__ulContainer.name           = "ulcontainer";
            this.__ulContainer.style.width    = "" + this.Size.Width;
            this.__ulContainer.style.height   = "" + __TAB_BAR_HEIGHT;
            this.__ulContainer.style.position = DOM.IStyle.PositionEnum.relative;
            this.__ulContainer.style.top      = "0";
            this.__ulContainer.style.bottom   = "0";

            this.__ulContainer.appendChild(this.__ul);

            this.__tabFiller                    = new IHTMLDiv();
            this.__tabFiller.name               = "filler";
            this.__tabFiller.style.height       = "" + __TAB_BAR_HEIGHT;
            this.__tabFiller.style.borderBottom = "1px solid";
            this.__tabFiller.style.borderTop    = "none";
            this.__tabFiller.style.borderRight  = "none";
            this.__tabFiller.style.borderLeft   = "none";
            this.__tabFiller.style.minWidth     = "0";
            this.__tabFiller.style.Float        = DOM.IStyle.FloatEnum.left;

            this.InternalContainer      = new IHTMLDiv();
            this.InternalContainer.name = "tabcontrol";

            this.__tabs          = new Panel();
            this.__tabs.Location = new Point(0, 0);
            this.__tabs.Size     = new Size(this.Size.Width, __TAB_BAR_HEIGHT);

            setTabsSize();

            base.Controls.Add(this.__tabs);
            this.__tabs.GetHTMLTarget().appendChild(this.__ulContainer);

            this.__tabs.GetHTMLTarget().style.SetLocation(0, 0, this.Size.Width, __TAB_BAR_HEIGHT);

            _tabPages = new TabControl.TabPageCollection((TabControl)this);

            FontChanged += OnFontChanged;
        }
Beispiel #27
0
        public Application(IAbout a)
        {
            var s = new InternalSaveActionSprite();

            s.AttachSpriteTo(a.Content);

            s.WebService = new ApplicationWebService();

            var pp = new ProjectNameInput();

            pp.AttachControlTo(a.Content);

            var Files = new IHTMLDiv().AttachTo(a.Content);

            s.WhenReady(
                i =>
            {
                Action Update = delegate
                {
                    var sln = new SolutionBuilder
                    {
                        Name = pp.ProjectName.Text
                    };

                    i.FileName = sln.Name + ".zip";
                    i.Clear();

                    Files.Clear();

                    sln.WriteTo(
                        (SolutionFile f) =>
                    {
                        new IHTMLPre {
                            innerText = f.Name
                        }.AttachTo(Files);

                        i.Add(f.Name, f.Content);
                    }
                        );
                };

                pp.UpdateButton.TextChanged +=
                    delegate
                {
                };

                pp.UpdateButton.Click +=
                    delegate
                {
                    Update();
                };

                Update();
            }
                );
        }
Beispiel #28
0
        private static IHTMLElement Dump(object xs, IHTMLElement to, object diff)
        {
            var c = new IHTMLDiv();

            c.style.backgroundColor = Color.White;
            c.style.border          = "1px solid gray";
            c.style.padding         = "1em";
            c.style.fontFamily      = IStyle.FontFamilyEnum.Consolas;

            var ttx = new IHTMLDiv(xs.ToString());

            c.appendChild(ttx);

            var dx = Expando.Of(diff);

            foreach (var v in Expando.Of(xs).GetMembers())
            {
                var tt = default(IHTMLDiv);
                var ok = true;

                if (dx != null)
                {
                    if (dx.Contains(v.Name))
                    {
                        if (dx[v.Name] == v.Self)
                        {
                            ok = false;
                        }
                    }
                }

                if (ok)
                {
                    if (v.Self.IsFunction)
                    {
                        tt             = new IHTMLDiv(v.Self.TypeString + " " + v.Name);
                        tt.style.color = Color.Red;
                    }
                    else if (v.Self.IsObject)
                    {
                        tt             = new IHTMLDiv(v.Self.TypeString + " " + v.Name + " = " + v.Self.ToString());
                        tt.style.color = Color.Blue;
                    }
                    else
                    {
                        tt = new IHTMLDiv(v.Self.TypeString + " " + v.Name + " = " + v.Self.ToString());
                    }

                    c.appendChild(tt);
                }
            }

            to.appendChild(c);

            return(to);
        }
        public void DrawRectangleToCanvas(Rectangle r, Color c)
        {
            var box = new IHTMLDiv();

            box.style.overflow = IStyle.OverflowEnum.hidden;
            box.style.SetLocation(r.Left, r.Top, r.Width, r.Height);
            box.style.backgroundColor = c;

            this.Layers.Canvas.appendChild(box);
        }
Beispiel #30
0
        private static void AppendError(IHTMLDiv workspace0, string err_msg)
        {
            var err = new IHTMLElement(IHTMLElement.HTMLElementEnum.pre, err_msg)
            {
                className = "error"
            };


            workspace0.appendChild(err);
        }