Inheritance: Graphic, IGraphicGroup
示例#1
0
	public HFlowLayout(GraphicGroup gg, int gap, int margin)
		: base(gg,gg.Frame)
	{
		fGap = gap;
		fMargin = margin;
		fCurrentX = fMargin;
	}
	public VEqualLayout(GraphicGroup gg, int gap, int margin)
		: base(gg,gg.Frame)
	{
		fForceNormalization = false;
		fGap = gap;
		fMargin = margin;
	}
示例#3
0
        void CreateComponents()
        {
            rootGroup = new GraphicGroup("root");
            rootGroup.Debug = true;
            AddGraphic(rootGroup);

            // Use a layout handler so all our graphics line up vertically
            rootGroup.LayoutHandler = new LinearLayout(rootGroup, 4, 4, Orientation.Vertical);

            StringLabel lookLabel = new StringLabel("Look Here:", 0, 0);

            StringLabel boxLabel = new StringLabel("Box", 0, 0);

            Caption cap = new Caption(lookLabel, boxLabel, Position.Right, 4);
            rootGroup.AddGraphic(cap, null);


        //    Switch aSwitch = new Switch("switch1", 100, 200, 100, 20, "Big Switch");
        //    aSwitch.Debug = true;
        //    rootGroup.AddGraphic(aSwitch);

            GraphicGroup controlGroup = new GraphicGroup("controlGroup", 10, 300, 400, 20);
            controlGroup.LayoutHandler = new LinearLayout(controlGroup, 4, 0, Orientation.Vertical);

            GraphicGroup layout1 = new GraphicGroup("layout1", 0, 0, 400, 40);
            layout1.LayoutHandler = new LinearLayout(layout1, 2, 0, Orientation.Horizontal);

            PushButton button1 = new PushButton("Pushy1", 0, 0, 100, 24, new StringLabel("Button1", 0, 0));
            button1.MouseUpEvent += new MouseEventHandler(this.ButtonActivity);
            layout1.AddGraphic(button1);

            PushButton button2 = new PushButton("Play", 104, 0, 100, 24, new StringLabel("Button2", 0, 0));
            button2.MouseDownEvent += new MouseEventHandler(this.PlayActivity);
            layout1.AddGraphic(button2);


            TrackSlider slider = new TrackSlider("slider",
                new GrayTrack("track", 0, 0, 200, 20),
                new GrayBox("box", 0, 0, 20, 16),
                Orientation.Horizontal,
                0, 255, 255);
            slider.PositionChangedEvent += new EventHandler(slider_PositionChangedEvent);

            controlGroup.AddGraphic(slider);
            controlGroup.AddGraphic(layout1);

            rootGroup.AddGraphic(controlGroup);

        }
示例#4
0
		public virtual void AddTeamLogo()
		{
			fTeamLogoBox = new GraphicGroup("teamlogo",797, 573,169,88);
            //fTeamLogoBox.LayoutHandler = new LinearLayout(fTeamLogoBox, 1, 1, Orientation.Horizontal);

			AddGraphic(fTeamLogoBox);
			fTeamLogoBox.AddGraphic(TeamLogo);
		}
示例#5
0
        // Here we'll add the legend and various other misfit graphics
        public override void AddLegend()
        {
            uint blueColor = RGBColor.RGB(204, 221, 255);
            uint blueBorder = RGBColor.RGB(119, 153, 238);
            uint blueText = RGBColor.RGB(51, 102, 204);

            uint orangeColor = RGBColor.RGB(255, 205, 170);
            uint orangeBorder = RGBColor.RGB(204, 51, 0);
            uint orangeText = RGBColor.RGB(153, 51, 0);


            uint greenColor = RGBColor.RGB(221, 255, 204);
            uint greenBorder = RGBColor.RGB(102, 204, 51);
            uint greenText = RGBColor.RGB(17, 102, 51);

            uint yellowColor = RGBColor.RGB(255, 221, 102);
            uint yellowBorder = RGBColor.RGB(255, 204, 0);
            uint yellowText = RGBColor.RGB(204, 153, 0);

            GraphicGroup legendBox = new GraphicGroup("legendbox", 63, 528, 135, 41);
            legendBox.GraphicsUnit = GraphicsUnit;

            legendBox.AddGraphic(new GradientRectangle(0, 0, 12, 12, RGBColor.White, yellowColor, yellowBorder, 90));
            legendBox.AddGraphic(new GradientRectangle(0, 21, 12, 12, RGBColor.White, orangeColor, orangeBorder, 90));
            legendBox.AddGraphic(new GradientRectangle(0, 41, 12, 12, RGBColor.White, greenColor, greenBorder, 45));

            legendBox.AddGraphic(new TextBox("Phases", "Tahoma", 8, GDIFont.FontStyle.Regular, 23, 0, 115, 12, StringAlignment.Left, StringAlignment.Center, yellowText, null));
            legendBox.AddGraphic(new TextBox("Stages", "Tahoma", 8, GDIFont.FontStyle.Regular, 23, 21, 115, 12, StringAlignment.Left, StringAlignment.Center, orangeText, null));
            legendBox.AddGraphic(new TextBox("Checkpoints", "Tahoma", 8, GDIFont.FontStyle.Regular, 23, 41, 115, 12, StringAlignment.Left, StringAlignment.Center, greenText, null));

            AddGraphic(legendBox);

            // Add the various accent lines
            //AddGraphic(new GraphicLine("gline", 65, 466, 235, 466, yellowBorder, 2));
            //AddGraphic(new GraphicLine("gline", 285, 699, 740, 699, yellowBorder, 2));
            //AddGraphic(new GraphicLine("gline", 797, 466, 964, 466, yellowBorder, 2));


        }