Example #1
0
        public GameUIManager()
        {
            UIMain uiMain = LKernel.GetG<UIMain>();

            //This mess gets the height and width of the window for centering UI entities.
            uint uheight, uwidth, colorDepth;
            int height, width;
            RenderWindow window = LKernel.GetG<RenderWindow>();
            window.GetMetrics(out uwidth, out uheight, out colorDepth);
            width = (int)uwidth;
            height = (int)uheight;

            inGameUI = uiMain.GetGUI("ingame gui");
            itembox = inGameUI.GetControl<PictureBox>("itembox");
            //itembox.Top = (height / 2);
            //itembox.Bottom = (height / 2);
            //itembox.Left = (width / 2);
            //itembox.Right = (width / 2);

            itemimage = inGameUI.GetControl<PictureBox>("itemimage");
            //itemimage.Top = (height / 2);
            //itemimage.Bottom = (height / 2);
            //itemimage.Left = (width / 2);
            //itemimage.Right = (width / 2);
        }
Example #2
0
        public Button(String label, EMode mode = EMode.BackgroundLabel, Boolean shortCutMode = DEFAULT_SHORTCUT_MODE)
            : base()
        {
            Mode = mode;

            if (Mode == EMode.BackgroundLabel)
            {
                BackgroundTextures = new Dictionary<EState, Texture>()
                {
                    { EState.Normal, Create.Texture("ButtonBackgroundN") },
                    { EState.MouseOver, Create.Texture("ButtonBackgroundO") }
                };

                Background = new PictureBox(GetCurrentTexture());
            }

            else if (Mode == EMode.LabelEffect)
            {
                Mode = EMode.LabelEffect;
                ClickOffset = DEFAULT_LABEL_CLICKOFFSET;
            }

            Label = new Label(label);
            AddWidget(Label);

            State = EState.Normal;

            ShortCutMode = shortCutMode && label != null;

            if (label != null && Label.Text.Length > 0)
                ShortCutKey = WindowEvents.KeyCodeFromString(Label.Text[0].ToString());
        }
Example #3
0
	public MainForm ()
	{
		// 
		// _richTextBox
		// 
		_richTextBox = new RichTextBox ();
		_richTextBox.Dock = DockStyle.Top;
		_richTextBox.Height = 300;
		_richTextBox.TabIndex = 0;
		Controls.Add (_richTextBox);
		// 
		// _pictureBox
		// 
		_pictureBox = new PictureBox ();
		_pictureBox.BackColor = Color.White;
		_pictureBox.BorderStyle = BorderStyle.Fixed3D;
		_pictureBox.Dock = DockStyle.Bottom;
		_pictureBox.Height = 300;
		Controls.Add (_pictureBox);
		// 
		// MainForm
		// 
		AutoScaleBaseSize = new Size (5, 13);
		ClientSize = new Size (400, 600);
		Location = new Point (150, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81915";
		Load += new EventHandler (MainForm_Load);
	}
Example #4
0
	public MainForm ()
	{
		// 
		// _captureButton
		// 
		_captureButton = new Button ();
		_captureButton.Anchor = (AnchorStyles.Bottom);
		_captureButton.Location = new Point (110, 240);
		_captureButton.Size = new Size (60, 20);
		_captureButton.Text = "Capture";
		_captureButton.Click += new EventHandler (CaptureButton_Click);
		Controls.Add (_captureButton);
		// 
		// _pictureBox
		// 
		_pictureBox = new PictureBox ();
		_pictureBox.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left |AnchorStyles.Right);
		_pictureBox.BackColor = Color.Blue;
		_pictureBox.BorderStyle = BorderStyle.FixedSingle;
		_pictureBox.Location = new Point (8, 8);
		_pictureBox.Size = new Size (280, 225);
		_pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
		Controls.Add (_pictureBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 235);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #363881";
		Load += new EventHandler (MainForm_Load);
	}
Example #5
0
    public AiDemo(Control paramGameController, Form paramPongGameForm)
    {
        pongGameForm = paramPongGameForm;
        gameController = paramGameController;
        picBoxAI1 = new PictureBox();//
        picBoxAI2 = new PictureBox();//Initializes the PictureBoxes
        picBoxBall = new PictureBox();//

        gameTime = new Timer();//Initializes the Timer

        gameTime.Enabled = true;//Enables the Timer
        gameTime.Interval = iGameTimeInterval;//Set the timer's interval

        gameTime.Tick += new EventHandler(gameTime_Tick);//Creates the Timer's Tick event


        pongGameForm.StartPosition = FormStartPosition.CenterScreen;//opens the form in center of the screen

        picBoxAI1.Size = sizePlayer;//sets the size of the picturebox
        picBoxAI1.Location = new Point(picBoxAI1.Width / 2, pongGameForm.Height / 2 - picBoxAI1.Height / 2);//sets it's location (centered)
        picBoxAI1.BackColor = Color.Blue;//fills the picturebox with a color
        gameController.Controls.Add(picBoxAI1);//adds the picture box to the form

        picBoxAI2.Size = sizeAI;
        picBoxAI2.Location = new Point(pongGameForm.Width - (picBoxAI2.Width + picBoxAI2.Width / 2), pongGameForm.Height / 2 - picBoxAI1.Height / 2);
        picBoxAI2.BackColor = Color.Red;
        gameController.Controls.Add(picBoxAI2);

        picBoxBall.Size = sizeBall;
        picBoxBall.Location = new Point(pongGameForm.Width / 2 - picBoxBall.Width / 2, pongGameForm.Height / 2 - picBoxBall.Height / 2);
        picBoxBall.BackColor = Color.Green;
        gameController.Controls.Add(picBoxBall);
    }
Example #6
0
 public void constructGrid(PictureBox thePictureBox, Map theMap)
 {
     this.thePictureBox = thePictureBox;
     this.theMap = theMap;
     thePictureBox.Invalidate();
     thePictureBox.Paint += new PaintEventHandler(paintGrid);
 }
Example #7
0
        public mnuInventory(string name, Enums.InvMenuType menuType, int itemSelected)
            : base(name)
        {
            base.Size = new Size(315, 360);
            base.MenuDirection = Enums.MenuDirection.Vertical;
            base.Location = new Point(10, 40);

            itemPicker = new Widgets.MenuItemPicker("itemPicker");
            itemPicker.Location = new Point(18, 63);

            lblInventory = new Label("lblInventory");
            lblInventory.AutoSize = true;
            lblInventory.Font = FontManager.LoadFont("PMDCP", 48);
            lblInventory.Text = "Inventory";
            lblInventory.ForeColor = Color.WhiteSmoke;
            lblInventory.Location = new Point(20, 0);

            picPreview = new PictureBox("picPreview");
            picPreview.Size = new Size(32, 32);
            picPreview.BackColor = Color.Transparent;
            picPreview.Location = new Point(255, 20);

            lblItemNum = new Label("lblItemNum");
            //lblItemNum.Size = new Size(100, 30);
            lblItemNum.AutoSize = true;
            lblItemNum.Location = new Point(182, 15);
            lblItemNum.Font = FontManager.LoadFont("PMDCP", 32);
            lblItemNum.BackColor = Color.Transparent;
            lblItemNum.ForeColor = Color.WhiteSmoke;
            lblItemNum.Text = "0/" + ((MaxInfo.MaxInv - 1) / 10 + 1);

            lblVisibleItems = new Label[10];
            for (int i = 0; i < lblVisibleItems.Length; i++) {
                lblVisibleItems[i] = new Label("lblVisibleItems" + i);
                //lblVisibleItems[i].AutoSize = true;
                lblVisibleItems[i].Size = new Size(200, 32);
                lblVisibleItems[i].Font = FontManager.LoadFont("PMDCP", 32);
                lblVisibleItems[i].Location = new Point(35, (i * 30) + 48);
                //lblVisibleItems[i].HoverColor = Color.Red;
                lblVisibleItems[i].ForeColor = Color.WhiteSmoke;
                lblVisibleItems[i].AllowDrop = true;
                lblVisibleItems[i].DragDrop += new EventHandler<DragEventArgs>(lblVisibleItems_DragDrop);
                lblVisibleItems[i].MouseDown += new EventHandler<MouseButtonEventArgs>(lblVisibleItems_MouseDown);
                lblVisibleItems[i].Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(inventoryItem_Click);
                this.AddWidget(lblVisibleItems[i]);
            }

            this.AddWidget(picPreview);
            this.AddWidget(itemPicker);
            this.AddWidget(lblInventory);
            this.AddWidget(lblItemNum);

            mode = menuType;
            currentTen = (itemSelected - 1) / 10;
            DisplayItems(currentTen * 10 + 1);
            ChangeSelected((itemSelected - 1) % 10);
            UpdateSelectedItemInfo();
        }
Example #8
0
 MandelbrotView()
 {
     PictureBox box = new PictureBox();
     box.BackColor = Color.White;
     box.Dock = DockStyle.Fill;
     box.SizeMode = PictureBoxSizeMode.CenterImage;
     box.Image = create_image();
     this.Controls.Add(box);
 }
        public winSkinSelector()
            : base("winSkinSelector")
        {
            this.Windowed = true;
            this.Size = new Size(390, 300);
            this.Location = DrawingSupport.GetCenter(SdlDotNet.Graphics.Video.Screen.Size, this.Size);
            this.TitleBar.BackgroundImageSizeMode = ImageSizeMode.StretchImage;
            this.TitleBar.BackgroundImage = SkinManager.LoadGuiElement("Skin Selector", "titlebar.png");
            this.TitleBar.CloseButton.Visible = false;
            this.Text = "Skin Selector";
            this.BackgroundImageSizeMode = ImageSizeMode.StretchImage;
            this.BackgroundImage = SkinManager.LoadGui("Skin Selector");

            picSkinPreview = new PictureBox("picSkinPreview");
            picSkinPreview.SizeMode = ImageSizeMode.StretchImage;
            picSkinPreview.Size = new System.Drawing.Size(242, 182);
            picSkinPreview.Location = new Point(DrawingSupport.GetCenter(this.Width, picSkinPreview.Width), 10);
            picSkinPreview.BackColor = Color.Green;
            picSkinPreview.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            picSkinPreview.BorderColor = Color.Black;
            picSkinPreview.BorderWidth = 1;

            cmbSkinSelect = new ComboBox("cmbSkinSelect");
            cmbSkinSelect.Location = new Point(10, 200);
            cmbSkinSelect.Size = new Size(this.Width - 20, 30);
            cmbSkinSelect.ItemSelected += new EventHandler(cmbSkinSelect_ItemSelected);

            btnSave = new Button("btnSave");
            btnSave.Size = new Size(100, 30);
            btnSave.Location = new Point(10, 240);
            btnSave.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            btnSave.Text = "Switch Skins!";
            btnSave.Click += new EventHandler<MouseButtonEventArgs>(btnSave_Click);

            btnFindSkin = new Button("btnFindSkin");
            btnFindSkin.Size = new System.Drawing.Size(100, 30);
            btnFindSkin.Location = new Point(110, 240);
            btnFindSkin.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            btnFindSkin.Text = "Find Skin";
            btnFindSkin.Click += new EventHandler<MouseButtonEventArgs>(btnFindSkin_Click);

            btnCancel = new Button("btnCancel");
            btnCancel.Size = new Size(100, 30);
            btnCancel.Location = new Point(210, 240);
            btnCancel.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            btnCancel.Text = "Cancel";
            btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click);

            this.AddWidget(picSkinPreview);
            this.AddWidget(cmbSkinSelect);
            this.AddWidget(btnSave);
            this.AddWidget(btnFindSkin);
            this.AddWidget(btnCancel);

            PopulateSkinList();
        }
	public viewItem()
	{
		Text = "View item";
		ShowInTaskbar = false;
		Size = new Size(350, 350);
		StartPosition = FormStartPosition.CenterParent;

		//itemType combobox
		itemType = new ComboBox();
		itemType.Parent = this;
		itemType.DropDownStyle = ComboBoxStyle.DropDownList;
		itemType.Width = 100;
		itemType.Location = new Point(this.Width - itemType.Width - 15, 10);
		itemType.Anchor = AnchorStyles.Top | AnchorStyles.Right;
		itemType.Items.Add("_virtual.dat");
		itemType.Items.Add("dll");
		itemType.Items.Add("Text");
		itemType.Items.Add("Image");
		itemType.Items.Add("Hex");
		itemType.SelectedIndexChanged += new EventHandler(itemType_SelectedIndexChanged);

		//filesize label
		fileSize = new Label();
		fileSize.Parent = this;
		fileSize.AutoSize = true;
		fileSize.Location = new Point(10, 10);

		//picturebox
		pictureBox = new PictureBox();
		pictureBox.Parent = this;
		pictureBox.BorderStyle = BorderStyle.FixedSingle;
		pictureBox.Location = new Point(10, 40);
		pictureBox.Size = new Size(this.Width - 30, this.Height - 80);
		pictureBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
		pictureBox.Visible = false;

		//textbox
		textBox = new TextBox();
		textBox.Parent = this;
		textBox.Multiline = true;
		textBox.ScrollBars = ScrollBars.Both;
		textBox.Location = pictureBox.Location;
		textBox.Size = pictureBox.Size;
		textBox.Anchor = pictureBox.Anchor;
		textBox.Visible = false;

		//listbox
		listBox = new ListBox();
		listBox.Parent = this;
		listBox.Location = pictureBox.Location;
		listBox.Size = pictureBox.Size;
		listBox.Anchor = pictureBox.Anchor;
		listBox.Visible = false;

		this.Load += new System.EventHandler(viewItem_Load);
	}
Example #11
0
fpv(Y a){try{
Action J=()=>{FormBorderStyle=(FormBorderStyle)(T=4-(X)(WindowState=2-WindowState)*2);BackColor=T!=0?Color.White:Color.Black;},j=()=>K("FPV by kasthack v 0.9.1.\r\nKeys:\r\nD/S/v/>/Num6/Num2/Space - next photo;\r\nA/W/^/</Num8/Num4 - previous photo;\r\nHome/H - first pic in folder\r\nEnd/E - last pic\r\nF11/Alt+Enter - fullscreen;\r\nEsc - exit fullscreen;\r\nEsc-Esc/Q - exit FPV;\r\nF1/?- show this message.","FPV:Help",0,64),k=()=>{if(K("Do U really want to delete"+G[B]+"?","Deleting",4,32)==6)try{File.Delete(G[B]);I(0);}catch{}},g=()=>A=true,h=()=>I(1),i=()=>I(-1),l=()=>I((B=0)-1),m=()=>I(B=0);
H=new Dictionary<X,Action>{{68,h},{83,h},{40,h},{39,h},{98,h},{102,h},{32,h},{65,i},{87,i},{38,i},{37,i},{104,i},{100,i},{36,m},{72,m},{35,l},{69,l},{112,j},{191,j},{46,k},{81,Application.Exit},{82,()=>I(E.Next())},{27,()=>H[(X)WindowState==2?122:81]()},{122,()=>H[-1]()},{13,()=>{if(!A)I(1);else H[-1]();}},{-1,J},{262144,g},{18,g},{111,j}};
Controls.Add(F=new PictureBox{BorderStyle=0});F.SizeMode+=4;F.Dock+=5;F.MouseDoubleClick+=(x,y)=>J();
KeyUp+=(_,e)=>A&=!((T=(X)e.KeyCode)==65||T==18);
KeyDown+=(c,b)=>{if(H.TryGetValue((X)b.KeyCode,out i))i();};
MouseWheel+=(_,e)=>I(e.Delta>0?-1:1);
G=Directory.GetFiles(D=(V=Path.GetDirectoryName(a))==""?".":V);}
catch{H[111]();T=9;return;}
B=Array.IndexOf(G,a);I(0);}}
Example #12
0
        public TextList(Int32 size = BlazeraLib.ExtendedBox.DEFAULT_SIZE, Boolean cursorMode = true)
            : base(size)
        {
            if (CursorMode = cursorMode)
            {
                Cursor = new PictureBox(Create.Texture("Gui_TextListSl"));
                AddWidget(Cursor);
            }

            Texts = new List<Button>();
        }
Example #13
0
        protected Pencil(Texture iconTexture)
            : base(iconTexture)
        {
            IsPainting = false;
            Mode = EMode.Normal;

            Cursor = new PictureBox(null);
            AddWidget(Cursor);

            Empty();
            ShowCursor(false);
        }
Example #14
0
        public HScrollBar()
            : base()
        {
            Background = new PictureBox(Create.Texture("HScrollBar_Background"));
            BackgroundDimension = new Vector2f(BackgroundDimension.X, BackgroundDimension.Y * ScrollBar.BACKGROUND_RESIZE_FACTOR);

            ScrollCursor = new PictureBox(Create.Texture("HScrollBar_Cursor"));
            ScrollCursor.Dimension = new Vector2f(ScrollCursor.Dimension.X * ScrollBar.CURSOR_RESIZE_FACTOR, ScrollCursor.Dimension.Y * ScrollBar.CURSOR_RESIZE_FACTOR);
            AddWidget(ScrollCursor);

            RefreshCursor();
        }
Example #15
0
 /// <summary>
 /// Update the Gear PictureBox status during retractation
 /// </summary>
 /// <param name="picture">The PictureBox to be update</param>
 public void retractGear(PictureBox picture)
 {
     this.gearBox = picture;
     while (this.state < 3)
     {
         Thread.Sleep(1000);
         picture.Image = this.pictures[2 - this.state];
         backgroundWorker.RunWorkerAsync();
         this.state++;
     }
     this.state = 0;
 }
Example #16
0
File: Program.cs Project: Orif/FPV
 public fpv(string a)
 {
     try {
         this.Controls.Add(P = new PictureBox() { Dock = DockStyle.Fill, SizeMode = PictureBoxSizeMode.Zoom, BorderStyle = BorderStyle.None });
         P.MouseDoubleClick += new MouseEventHandler(f);
         KeyUp += new KeyEventHandler(delegate( object _, KeyEventArgs e ) { if ( ( e.KeyCode == Keys.A ) || ( e.KeyCode == ( Keys.RButton | Keys.ShiftKey ) ) ) A = false; });
         KeyDown += new KeyEventHandler(p);
         MouseWheel += new MouseEventHandler(delegate(Object _, MouseEventArgs e) {r(e.Delta>0?-1:1); });
         ClientSize = new Size(320, 220);
         D = Path.GetDirectoryName(a);
         L.Clear(); L.AddRange(Directory.GetFiles(D));}
     catch { p(null, new KeyEventArgs(Keys.F1)); }
     I = L.IndexOf(a); r(0);
 }
Example #17
0
        public Button(Texture backgroundN, Texture backgroundO)
            : base()
        {
            Mode = EMode.Background;

            BackgroundTextures = new Dictionary<EState, Texture>()
            {
                { EState.Normal, backgroundN },
                { EState.MouseOver, backgroundO }
            };

            Background = new PictureBox(GetCurrentTexture());

            State = EState.Normal;
        }
Example #18
0
        public Menu(Alignment alignment = DEFAULT_ALIGNMENT, float itemOffset = DEFAULT_MARGINS, float margins = DEFAULT_MARGINS)
            : base()
        {
            Alignment = alignment;

            Margins = margins;
            ItemOffset = itemOffset;

            MenuItems = new List<MenuItem>();

            Cursor = new PictureBox(Create.Texture("MenuSl_Main"));
            AddWidget(Cursor);

            InitBox();

            Closable = true;
        }
Example #19
0
	public MainForm ()
	{
		// 
		// _pictureBox
		// 
		_pictureBox = new PictureBox ();
		_pictureBox.Dock = DockStyle.Fill;
		Controls.Add (_pictureBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (260, 115);
		Location = new Point (300, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81773";
		Load += new EventHandler (MainForm_Load);
	}
Example #20
0
	public MainForm ()
	{
		// 
		// _pictureBox
		// 
		_pictureBox = new PictureBox ();
		_pictureBox.Dock = DockStyle.Top;
		_pictureBox.Height = 352;
		Controls.Add (_pictureBox);
		// 
		// MainForm
		// 
		Location = new Point (250, 100);
		ClientSize = new Size (360, 352);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82445";
		Load += new EventHandler (MainForm_Load);
	}
Example #21
0
	public MainForm ()
	{
		// 
		// _pictureBox
		// 
		_pictureBox = new PictureBox ();
		_pictureBox.Image = Image.FromFile ("animacija_okolo.gif");
		_pictureBox.Location = new Point (12, 12);
		_pictureBox.Size = new Size (279, 103);
		Controls.Add (_pictureBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (305, 131);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #80345";
		Load += new EventHandler (MainForm_Load);
	}
Example #22
0
        public kitParty(string name)
            : base(name)
        {
            enabled = true;

            base.BackColor = Color.Transparent;
            picMemberMugshot = new PictureBox[PARTY_SIZE];
            for (int i = 0; i < PARTY_SIZE; i++) {
                picMemberMugshot[i] = new PictureBox("picMemberMugshot" + i);
                picMemberMugshot[i].Size = new Size(40, 40);
                picMemberMugshot[i].BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
                picMemberMugshot[i].BorderWidth = 1;
                picMemberMugshot[i].BorderColor = Color.Black;

                picMemberMugshot[i].X = 10;

                this.AddWidget(picMemberMugshot[i]);
            }
            lblMemberName = new Label[PARTY_SIZE];
            for (int i = 0; i < PARTY_SIZE; i++) {
                lblMemberName[i] = new Label("lblMemberName" + i);
                lblMemberName[i].AutoSize = true;
                lblMemberName[i].Font = Logic.Graphics.FontManager.LoadFont("PMDCP", 24);
                lblMemberName[i].ForeColor = Color.WhiteSmoke;

                this.AddWidget(lblMemberName[i]);
            }
            pgbMemberHP = new ProgressBar[PARTY_SIZE];
            pgbMemberExp = new ProgressBar[PARTY_SIZE];
            for (int i = 0; i < PARTY_SIZE; i++) {
                pgbMemberHP[i] = new ProgressBar("pgbMemberHP" + i);
                pgbMemberExp[i] = new ProgressBar("pgbMemberExp" + i);

                pgbMemberHP[i].Maximum = 100;
                pgbMemberHP[i].TextStyle = ProgressBarTextStyle.Custom;

                pgbMemberExp[i].Maximum = 100;
                pgbMemberExp[i].TextStyle = ProgressBarTextStyle.Custom;

                this.AddWidget(pgbMemberHP[i]);
                this.AddWidget(pgbMemberExp[i]);
            }
        }
Example #23
0
    public static void Main()
    {
        Form fm = new Form();
        fm.Text = "サンプル";

        PictureBox pb = new PictureBox();

        Car c = new Car();
        c.Move();
        c.Move();

        pb.Image = c.img;
        pb.Top = c.top;
        pb.Left = c.left;

        pb.Parent = fm;

        Application.Run(fm);
    }
Example #24
0
        public mnuHelpPage(string name, string helpFolder, int page)
            : base(name)
        {
            this.Size = new Size(620, 420);
            this.MenuDirection = Enums.MenuDirection.Vertical;
            this.Location = new Point(10, 40);

            this.page = page;
            this.helpFolder = helpFolder;

            lblHelpPage = new Label("lblHelpTopics");
            lblHelpPage.Location = new Point(40, 5);
            lblHelpPage.Font = FontManager.LoadFont("PMDCP", 36);
            lblHelpPage.AutoSize = true;
            lblHelpPage.Text = helpFolder;
            lblHelpPage.ForeColor = Color.WhiteSmoke;

            lblPageNumber = new Label("lblPageNumber");
            lblPageNumber.AutoSize = true;
            lblPageNumber.Font = FontManager.LoadFont("PMDCP", 36);
            lblPageNumber.Text = "Page 1";
            lblPageNumber.Location = new Point(this.Width - lblPageNumber.Width - 40, 5);
            lblPageNumber.ForeColor = Color.WhiteSmoke;

            picHelpPage = new PictureBox("picHelpPage");
            picHelpPage.SizeMode = ImageSizeMode.StretchImage;
            picHelpPage.Location = new Point(50, 50);
            picHelpPage.Size = new Size(this.Width - (picHelpPage.X * 2), this.Height - picHelpPage.Y -20);
            picHelpPage.BackColor = Color.Green;

            //lstHelpTopics = new ListBox("lstHelpTopics");
            //lstHelpTopics.Location = new Point(10, 50);
            //lstHelpTopics.Size = new Size(this.Width - lstHelpTopics.X * 2, this.Height - lstHelpTopics.Y - 10);
            //lstHelpTopics.BackColor = Color.Transparent;
            //lstHelpTopics.BorderStyle = SdlDotNet.Widgets.BorderStyle.None;

            this.AddWidget(lblHelpPage);
            this.AddWidget(picHelpPage);
            this.AddWidget(lblPageNumber);

            LoadHelpPage(this.page);
        }
        public mnuTournamentMatchUpViewer(string name)
            : base(name)
        {
            this.Size = new System.Drawing.Size(300, 400);

            lblLeftArrow = new Label("lblLeftArrow");
            lblLeftArrow.AutoSize = false;
            lblLeftArrow.Size = new System.Drawing.Size(50, 35);
            lblLeftArrow.Font = FontManager.LoadFont("PMDCP", 32);
            lblLeftArrow.Text = "<";
            lblLeftArrow.Location = new Point(5);

            lblRightArrow = new Label("lblRightArrow");
            lblRightArrow.AutoSize = false;
            lblRightArrow.Size = new System.Drawing.Size(50, 35);
            lblRightArrow.Font = FontManager.LoadFont("PMDCP", 32);
            lblRightArrow.Text = ">";
            lblRightArrow.Location = new Point(this.Width - lblRightArrow.Width - 5);

            pbxPlayerOneMugshot = new PictureBox("pbxPlayerOneMugshot");
            pbxPlayerOneMugshot.Size = new Size(40, 40);
            pbxPlayerOneMugshot.Location = new Point(lblLeftArrow.X + lblLeftArrow.Width + 5, 5);

            lblVSLabel = new Label("lblVSLabel");
            lblVSLabel.Font = FontManager.LoadFont("PMDCP", 32);
            lblVSLabel.AutoSize = false;
            lblVSLabel.Size = new Size(100, 35);
            lblVSLabel.Location = new Point(pbxPlayerOneMugshot.X + pbxPlayerOneMugshot.Width + 5, pbxPlayerOneMugshot.Y + pbxPlayerOneMugshot.Height - lblVSLabel.Height);

            pbxPlayerTwoMugshot = new PictureBox("pbxPlayerTwoMugshot");
            pbxPlayerTwoMugshot.Size = new Size(40, 40);
            pbxPlayerTwoMugshot.Location = new Point(lblVSLabel.X + lblVSLabel.Width + 5, pbxPlayerOneMugshot.Y);

            lblPlayerOneName = new Label("lblPlayerOneName");
            lblPlayerOneName.Font = FontManager.LoadFont("PMDCP", 24);
            lblPlayerOneName.Location = new Point(pbxPlayerOneMugshot.X, pbxPlayerOneMugshot.Y + pbxPlayerOneMugshot.Height + 5);

            lblPlayerTwoName = new Label("lblPlayerTwoName");
            lblPlayerTwoName.Font = FontManager.LoadFont("PMDCP", 24);
            lblPlayerTwoName.Location = new Point(pbxPlayerTwoMugshot.X, pbxPlayerTwoMugshot.Y + pbxPlayerTwoMugshot.Height + 5);
        }
Example #26
0
   void InitializeComponent()
   {
      this.components = new System.ComponentModel.Container();
      this.m_SplashPictureBox = new System.Windows.Forms.PictureBox();
      this.m_Timer = new System.Windows.Forms.Timer(this.components);
      ((System.ComponentModel.ISupportInitialize)(this.m_SplashPictureBox)).BeginInit();
      this.SuspendLayout();
// 
// m_SplashPictureBox
// 
      this.m_SplashPictureBox.AutoSize = true;
      this.m_SplashPictureBox.Cursor = System.Windows.Forms.Cursors.AppStarting;
      this.m_SplashPictureBox.Location = new System.Drawing.Point(0,0);
      this.m_SplashPictureBox.Name = "m_SplashPictureBox";
      this.m_SplashPictureBox.Size = new System.Drawing.Size(112,80);
      this.m_SplashPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
      this.m_SplashPictureBox.TabIndex = 0;
      this.m_SplashPictureBox.TabStop = false;
// 
// m_Timer
// 
      this.m_Timer.Enabled = true;
      this.m_Timer.Interval = 500;
      this.m_Timer.Tick += new System.EventHandler(this.OnTick);
// 
// SplashForm
// 
      
      this.ClientSize = new System.Drawing.Size(227,172);
      this.ControlBox = false;
      this.Controls.Add(this.m_SplashPictureBox);
      this.Cursor = System.Windows.Forms.Cursors.Cross;
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
      this.Name = "SplashForm";
      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
      this.TopMost = true;
      ((System.ComponentModel.ISupportInitialize)(this.m_SplashPictureBox)).EndInit();
      this.ResumeLayout(false);
      this.PerformLayout();

   }
Example #27
0
	public MainForm() 
    {
		Text = "Freenect2.Net test";
		Size = new Size(1100, 900);

        var imageSize = new Size(500, 400);

		var colorBox = new PictureBox();
        colorBox.Size = imageSize;
        colorBox.Location = new Point(0, 0); 
        colorBox.SizeMode = PictureBoxSizeMode.StretchImage;
        Controls.Add(colorBox);

		var depthBox = new PictureBox();
        depthBox.Size = imageSize;
        depthBox.Location = new Point(0, imageSize.Height); 
        depthBox.SizeMode = PictureBoxSizeMode.StretchImage;
        Controls.Add(depthBox);

        device = new Device(0);
        device.FrameReceived += (color, depth) => {
            var colorImage = Utility.ColorFrameTo32bppRgb(color, device.FrameSize);
            var depthImage = Utility.DepthFrameTo8bppGrayscale(depth, device.FrameSize, device.MaxDepth);

            // This is called from another thread, so we can't access control directly. Also can't use
            // Invoke, because it is blocking and can cause deadlock when device is disposed. 
            // StartInvoke works best.
            BeginInvoke(new Action(() => {
                colorBox.Image = colorImage;
                depthBox.Image = depthImage;
            }));
        };

        device.Start();

        FormClosed += (sender, args) => {
            device.Stop();
            device.Dispose();
        };
	}
    public MForm3()
    {
        Text = "TrackBar";
        Size = new Size(260, 190);

        tb = new TrackBar();
        tb.Parent = this;
        tb.Size = new Size(160, 30);
        tb.Location = new Point(20, 40);
        tb.TickStyle = TickStyle.None;

        tb.ValueChanged += new EventHandler(OnChanged);

        LoadImages();

        pb = new PictureBox();
        pb.Parent = this;
        pb.Location = new Point(210, 50);
        pb.Image = mute;

        CenterToScreen();
    }
Example #29
0
   void InitializeComponent()
   {
      this.components = new System.ComponentModel.Container();
      this.m_SplashPictureBox = new System.Windows.Forms.PictureBox();
      this.m_Timer = new System.Windows.Forms.Timer(this.components);
      ((System.ComponentModel.ISupportInitialize)(this.m_SplashPictureBox)).BeginInit();
      this.SuspendLayout();
      // 
      // m_SplashPictureBox
      // 
      this.m_SplashPictureBox.Cursor = System.Windows.Forms.Cursors.AppStarting;
      this.m_SplashPictureBox.Image = CredentialsManagerClient.Properties.Resources.Progress;
      this.m_SplashPictureBox.Location = new System.Drawing.Point(0,0);
      this.m_SplashPictureBox.Name = "m_SplashPictureBox";
      this.m_SplashPictureBox.Size = new System.Drawing.Size(206,42);
      this.m_SplashPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
      this.m_SplashPictureBox.TabIndex = 0;
      this.m_SplashPictureBox.TabStop = false;
      // 
      // m_Timer
      // 
      this.m_Timer.Enabled = true;
      this.m_Timer.Interval = 500;
      this.m_Timer.Tick += new System.EventHandler(this.OnTick);
      // 
      // SplashForm
      // 
      this.ClientSize = new System.Drawing.Size(205,19);
      this.ControlBox = false;
      this.Controls.Add(this.m_SplashPictureBox);
      this.Cursor = System.Windows.Forms.Cursors.Cross;
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
      this.Name = "SplashForm";
      this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
      this.TopMost = true;
      ((System.ComponentModel.ISupportInitialize)(this.m_SplashPictureBox)).EndInit();
      this.ResumeLayout(false);

   }
Example #30
0
        public SpokenTextMenu(string name, Size storyBounds)
            : base(name)
        {
            this.Size = new System.Drawing.Size(storyBounds.Width - 10, 100);
            this.Location = new Point(5, storyBounds.Height - this.Height);

            lblText = new Label("lblText");
            lblText.BackColor = Color.Transparent;
            lblText.ForeColor = Color.WhiteSmoke;
            lblText.AutoSize = false;
            lblText.Font = Graphics.FontManager.LoadFont("PMU", 24);
            lblText.Location = new Point(15, 10);
            lblText.Size = new System.Drawing.Size(this.WidgetPanel.Width - lblText.Location.X, this.WidgetPanel.Height - lblText.Location.Y);

            picSpeaker = new PictureBox("picSpeaker");
            picSpeaker.Size = new Size(40, 40);
            picSpeaker.Location = new Point(10, DrawingSupport.GetCenter(WidgetPanel.Height, 40));
            picSpeaker.BorderWidth = 1;
            picSpeaker.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;

            this.WidgetPanel.AddWidget(lblText);
            this.WidgetPanel.AddWidget(picSpeaker);
        }
Example #31
0
 public void CancelUpdate()
 {
     PictureBox.CancelUpdate();
 }
Example #32
0
 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
     byte[] arayTmp = new byte[1];
     if (tabControl1.SelectedIndex == 1)
     {
         arayTmp[0] = 1;
     }
     else if (tabControl1.SelectedIndex == 2)
     {
         arayTmp[0] = 2;
     }
     else if (tabControl1.SelectedIndex == 3)
     {
         arayTmp[0] = 3;
     }
     else if (tabControl1.SelectedIndex == 4)
     {
         arayTmp[0] = 4;
     }
     else if (tabControl1.SelectedIndex == 5)
     {
         arayTmp[0] = 5;
     }
     else if (tabControl1.SelectedIndex == 6)
     {
         arayTmp[0] = 6;
     }
     else if (tabControl1.SelectedIndex == 7)
     {
         arayTmp[0] = 7;
     }
     if (CsConst.mySends.AddBufToSndList(arayTmp, 0x19B2, SubnetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == false)
     {
         Cursor.Current = Cursors.Default;
         return;
     }
     if (tabControl1.SelectedIndex == 0)
     {
         List <byte> listTmp = new List <byte>();
         int         intTmp  = 0;
         for (int i = 0; i < 7; i++)
         {
             if (CsConst.myRevBuf[26 + i] != 0)
             {
                 listTmp.Add(CsConst.myRevBuf[26 + i]);
             }
         }
         List <byte> arayByt = new List <byte>()
         {
             1, 2, 3, 4, 5, 6, 7
         };
         if (listTmp.Count < 7)
         {
             foreach (byte tmp in listTmp)
             {
                 arayByt.Remove(tmp);
             }
         }
         for (int i = 0; i < 7; i++)
         {
             PictureBox temp = this.Controls.Find("PMain" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] != 0)
             {
                 if (i != 6)
                 {
                     temp.Image     = img.Images[CsConst.myRevBuf[26 + i]];
                     temp.Image.Tag = (CsConst.myRevBuf[26 + i]);
                     Tag            = (CsConst.myRevBuf[26 + i]);
                 }
                 else
                 {
                     temp.Image     = img.Images[9];
                     temp.Image.Tag = (CsConst.myRevBuf[26 + i]);
                     Tag            = (CsConst.myRevBuf[26 + i]);
                 }
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
                 Tag            = arayByt[intTmp];
                 intTmp         = intTmp + 1;
             }
         }
         for (int i = 1; i <= 7; i++)
         {
             PictureBox tmp   = this.Controls.Find("PMain" + i.ToString(), true)[0] as PictureBox;
             Label      lbTmp = this.Controls.Find("Main" + i.ToString(), true)[0] as Label;
             if (Convert.ToInt32(tmp.Tag) == 1)
             {
                 lbTmp.Text = "LIGHT";
             }
             else if (Convert.ToInt32(tmp.Tag) == 2)
             {
                 lbTmp.Text = "AC";
             }
             else if (Convert.ToInt32(tmp.Tag) == 3)
             {
                 lbTmp.Text = "CURTAIN";
             }
             else if (Convert.ToInt32(tmp.Tag) == 4)
             {
                 lbTmp.Text = "HEAT";
             }
             else if (Convert.ToInt32(tmp.Tag) == 5)
             {
                 lbTmp.Text = "MUSIC";
             }
             else if (Convert.ToInt32(tmp.Tag) == 6)
             {
                 lbTmp.Text = "SCENES";
             }
             else if (Convert.ToInt32(tmp.Tag) == 7)
             {
                 lbTmp.Text = "SENSOR";
             }
         }
     }
     else if (tabControl1.SelectedIndex == 1)
     {
         for (int i = 0; i < 6; i++)
         {
             PictureBox temp = this.Controls.Find("PL" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 temp.Image     = img.Images[7];
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     else if (tabControl1.SelectedIndex == 2)
     {
         for (int i = 0; i < 9; i++)
         {
             PictureBox temp = this.Controls.Find("PA" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 temp.Image     = img.Images[2];
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     else if (tabControl1.SelectedIndex == 3)
     {
         for (int i = 0; i < 6; i++)
         {
             PictureBox temp = this.Controls.Find("PC" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 temp.Image     = img.Images[8];
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     else if (tabControl1.SelectedIndex == 4)
     {
         for (int i = 0; i < 9; i++)
         {
             PictureBox temp = this.Controls.Find("PH" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 temp.Image     = img.Images[4];
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     else if (tabControl1.SelectedIndex == 5)
     {
         for (int i = 0; i < 9; i++)
         {
             PictureBox temp = this.Controls.Find("PM" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 temp.Image     = img.Images[5];
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     else if (tabControl1.SelectedIndex == 6)
     {
         for (int i = 0; i < 2; i++)
         {
             PictureBox temp = this.Controls.Find("PS" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 temp.Image     = img.Images[6];
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     else if (tabControl1.SelectedIndex == 7)
     {
         for (int i = 0; i < 4; i++)
         {
             PictureBox temp = this.Controls.Find("PR" + (i + 1).ToString(), true)[0] as PictureBox;
             if (CsConst.myRevBuf[26 + i] == (i + 1))
             {
                 if (Name == "PR1")
                 {
                     temp.Image = img.Images[10];
                 }
                 else if (Name == "PR2")
                 {
                     temp.Image = img.Images[11];
                 }
                 else if (Name == "PR3")
                 {
                     temp.Image = img.Images[12];
                 }
                 else if (Name == "PR4")
                 {
                     temp.Image = img.Images[13];
                 }
                 temp.Image.Tag = (i + 1);
             }
             else
             {
                 temp.Image     = img.Images[0];
                 temp.Image.Tag = 0;
             }
         }
     }
     CsConst.myRevBuf = new byte[1200];
     Cursor.Current   = Cursors.Default;
 }
Example #33
0
        private void PictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            if ((Mode == MouseMode.Pan && e.Button == MouseButtons.Left) ||
                (e.Button == MouseButtons.Middle))
            {
                // Start panning the image
                PanStartMousePosition   = e.Location;
                PanStartPicturePosition = PictureBox.PicturePosition;
            }
            else if ((Mode == MouseMode.Pick || Mode == MouseMode.Erase) &&
                     e.Button == MouseButtons.Left &&
                     ActiveAnnotation == null)
            {
                // Pick and activate annotation and possibly also control point

                var result = PictureBox.FindAnnotation(e.Location);

                if (result != null)
                {
                    if (Mode == MouseMode.Pick)
                    {
                        ActiveAnnotation   = result.Item1;
                        ActiveControlPoint = result.Item2;

                        oldControlPointLocations.Clear();
                        oldControlPointLocations.AddRange(ActiveAnnotation.ControlPoints);

                        controlPointSelectLocation = new Vec3(PictureBox.ScreenToPicture(new Vec2(e.Location)), PictureBox.Slice);
                    }
                    else
                    {
                        // Erase annotation
                        PictureBox.Annotations.Remove(result.Item1);
                        Refresh();
                    }
                }
            }
            else if ((Mode == MouseMode.AddAnnotation || Mode == MouseMode.Profile) &&
                     e.Button == MouseButtons.Left &&
                     ActiveAnnotation == null)
            {
                if (Mode == MouseMode.Profile)
                {
                    NewAnnotationName = "Line segment";
                    EraseProfileAnnotation();
                }

                // Add new annotation object
                if (!String.IsNullOrEmpty(NewAnnotationName))
                {
                    ActiveAnnotation = AnnotationFactory.Create(NewAnnotationName);
                    PictureBox.Annotations.Add(ActiveAnnotation);
                    Vec3 pos = new Vec3(PictureBox.ScreenToPicture(new Vec2(e.Location)), PictureBox.Slice);
                    ActiveAnnotation.ControlPoints.Add(pos);
                    ActiveControlPoint = 0;

                    // Add another control point right away if multiple points are required.
                    if (ActiveAnnotation.RequiredPointCount > 1)
                    {
                        ActiveAnnotation.ControlPoints.Add(pos);
                        ActiveControlPoint = 1;
                    }

                    Refresh();

                    if (Mode != MouseMode.Profile)
                    {
                        if (ToolStrip != null)
                        {
                            ToolStrip.ResetAnnotation();
                        }
                    }
                }

                if (Mode == MouseMode.Profile)
                {
                    ProfileAnnotation = ActiveAnnotation;
                    UpdateProfile();
                }
            }
        }
Example #34
0
        protected override void LoadContent()
        {
            KeyDown    = false;
            objManager = new ObjectManager(base.menuFont);
            //inheriting the base structure of the gameplay screen from Game1.cs
            Content = GameRef.Content;
            //load this content
            base.LoadContent();



            #region login screen

            labelTitle = Content.Load <SpriteFont>(@"Fonts\LoginPage\Title");
            //labelRecommendation = Content.Load<SpriteFont>(@"Fonts\LoginPage\Recommendation");
            labelFooters = Content.Load <SpriteFont>(@"Fonts\LoginPage\Footer");

            #endregion

            menuFont = Content.Load <SpriteFont>(@"Fonts\ControlFont");
            #region Label
            //added in a overload to set the spritefont you can load in base.menuFont
            //base is basegamestate
            //add more fonts to basegamestate if you want them then call them as follows
            lblTitle       = new Label("OmniRax Kingdom\nDefence", labelTitle);
            lblTitle.Color = Color.White;

            lblPlayGame = new Label("Arcade", labelTitle);

            lblProfileName = new Label("Profile", labelFooters);
            lblGold        = new Label("Treasury ", labelFooters);
            lblCompletion  = new Label("Exit", labelFooters);
            //lblRecommendation = new Label("New here?\nPlease create an\naccount to get the\nfull OmniRax Experience", base.labelRecommendation);
            lblFooterDevelopment = new Label("A Synergy Development Game", labelFooters);
            lblFooterDate        = new Label("2012", labelFooters);


            ////objects position set
            lblTitle.Position = new Vector2(GameRef.ScreenRectangle.Width / 18, GameRef.ScreenRectangle.Height / 18);

            lblPlayGame.Position = new Vector2((GameRef.ScreenRectangle.Width / 18) * 11, (GameRef.ScreenRectangle.Height / 20) * 7);

            lblProfileName.Position = new Vector2((GameRef.ScreenRectangle.Width / 18) * 11, (GameRef.ScreenRectangle.Height / 22) * 12);
            lblGold.Position        = new Vector2((GameRef.ScreenRectangle.Width / 18) * 11, (GameRef.ScreenRectangle.Height / 21) * 14);
            lblCompletion.Position  = new Vector2((GameRef.ScreenRectangle.Width / 18) * 11, (GameRef.ScreenRectangle.Height / 25) * 20);

            //lblRecommendation.Position = new Vector2((GameRef.ScreenRectangle.Width / 10 * 7), (GameRef.ScreenRectangle.Height / 4));
            lblFooterDevelopment.Position = new Vector2(GameRef.ScreenRectangle.Width / 7, (GameRef.ScreenRectangle.Height / 10) * 9);
            lblFooterDate.Position        = new Vector2((GameRef.ScreenRectangle.Width / 10) * 8, (GameRef.ScreenRectangle.Height / 10) * 9);

            #endregion

            backgroundImage = Content.Load <Texture2D>(@"UI Content\Login\StartMenuBackRound");
            texCoin         = Content.Load <Texture2D>(@"UI Content\185px-Shine_Sprite");
            backRound       = new PictureBox(backgroundImage, GameRef.ScreenRectangle, 1, 1, 0);
            objManager.Add(backRound);
            ////objects added to list
            //objManager.Add(lblTitle);


            ////objManager.Add(lblRecommendation);
            objManager.Add(lblFooterDevelopment);
            //objManager.Add(lblFooterDate);
            //end

            statusBar = Content.Load <Texture2D>(@"UI Content\2d_bars");
            loadBar   = new LoadingBar(statusBar, 4, 1, new Vector2(GameRef.ScreenRectangle.Width / 2 - statusBar.Width / 2,
                                                                    GameRef.ScreenRectangle.Height / 2 + statusBar.Height), 0);
            loadBar.Visable = false;
            //all content for the display of the title page

            //btnCreateAccount = content.Load<Texture2D>(@"UI Content\Login\CreateAccount");
            //btnLogin = content.Load<Texture2D>(@"UI Content\Login\LoginButton");;
            btnPlayGame = Content.Load <Texture2D>(@"UI Content\buttons_2");

            #region Save slots
            //Save slot image load
            btnSaveSlot1 = Content.Load <Texture2D>(@"UI Content\buttons_2");

            #endregion

            //logo "button"
            btnLogo = Content.Load <Texture2D>(@"UI Content\Login\loginLogo");

            //loginPicture Display
            btnLogonImage = Content.Load <Texture2D>(@"UI Content\Login\ForcesCollide");

            //logo
            pbGameLogo = new PictureBox(btnLogo, new Rectangle((GameRef.ScreenRectangle.Width / 10) * 4 + 2, 5, 180, 150), 1, 1, 0);
            objManager.Add(pbGameLogo);

            //login Picture
            pbLoginPicture = new PictureBox(btnLogonImage, new Rectangle(GameRef.ScreenRectangle.Width / 18, (GameRef.ScreenRectangle.Height / 19) * 5, 500, 400), 1, 1, 0);
            objManager.Add(pbLoginPicture);

            //progress "button"
            pbSaveSlot3 = new PictureBox(btnSaveSlot1, new Rectangle((GameRef.ScreenRectangle.Width / 11) * 6, (GameRef.ScreenRectangle.Height / 16) * 12, 300, 75), 3, 1, 0);
            objManager.Add(pbSaveSlot3);


            pbSaveSlot3.obj_Selected  += new EventHandler(exit_selected);
            pbSaveSlot3.obj_MouseOver += new EventHandler(startLable_obj_MouseOver);
            pbSaveSlot3.obj_Leave     += new EventHandler(startLable_obj_Leave);

            #region Play Game

            pbStartButton = new PictureBox(btnPlayGame, new Rectangle((GameRef.ScreenRectangle.Width / 11) * 6, (GameRef.ScreenRectangle.Height / 16) * 5, 400, 125), 3, 1, 0);
            pbStartButton.obj_Selected  += new EventHandler(startLable_Selected);
            pbStartButton.obj_MouseOver += new EventHandler(startLable_obj_MouseOver);
            pbStartButton.obj_Leave     += new EventHandler(startLable_obj_Leave);
            objManager.Add(pbStartButton);

            #endregion

            objManager.Add(lblPlayGame);
            objManager.Add(lblCompletion);
            coin = new Coin(texCoin, new Rectangle(780, 490, 50, 50), 1, 1);
        }
Example #35
0
        public void FillAreaWithDelay(Bitmap canvas, Color fillColor, Color borderColor, Point seed, PictureBox pb, int delay)
        {
            Stack <Point> stack = new Stack <Point>();
            Point         curPoint;
            int           x, y, xRight, xLeft;

            stack.Push(seed);

            canvas.SetPixel(seed.X, seed.Y, fillColor);
            pb.Refresh();

            while (stack.Count > 0)
            {
                curPoint = stack.Pop();
                x        = curPoint.X;
                y        = curPoint.Y;

                canvas.SetPixel(x, y, Color.Black);
                x++;
                while (!PixelIsBorder(canvas, x, y, borderColor) && x < canvas.Width)
                {
                    canvas.SetPixel(x, y, fillColor);
                    x++;
                }
                xRight = x - 1;

                x = curPoint.X - 1;
                while (!PixelIsBorder(canvas, x, y, borderColor) && x >= 0)
                {
                    canvas.SetPixel(x, y, fillColor);
                    x--;
                }
                xLeft = x + 1;

                if (y > 0)
                {
                    FindSeed(stack, canvas, xLeft, xRight, y - 1, fillColor, borderColor);
                }
                if (y < canvas.Height - 1)
                {
                    FindSeed(stack, canvas, xLeft, xRight, y + 1, fillColor, borderColor);
                }
                Thread.Sleep(delay);
                pb.Refresh();
            }
        }
Example #36
0
        private void Frm_Initialize()
        {
            this.BackColor = Color.White;
            int   width  = this.Width;
            int   height = this.Height;
            Panel p_top  = new Panel();

            p_top.Width     = width;
            p_top.Height    = height / 15;
            p_top.Location  = new Point(0, 0);
            p_top.BackColor = Color.FromArgb(240, 244, 247);

            PictureBox logo = new PictureBox();

            logo.Width    = width / 8;
            logo.Height   = p_top.Height;
            logo.Image    = Properties.Resources.logo;
            logo.Location = new Point(0, 0);
            logo.SizeMode = PictureBoxSizeMode.StretchImage;
            logo.Click   += Exit;


            Label lb_top = new Label();

            lb_top.Width     = width / 2;
            lb_top.Height    = p_top.Height;
            lb_top.Text      = "北京安道拓打印分装单系统";
            lb_top.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            lb_top.Font      = new Font("微软雅黑", 22, FontStyle.Regular);

            lb_top.Location = new Point(width / 2 - lb_top.Width / 2, 0);
            lb_top.AutoSize = false;

            Panel p_mid = new Panel();

            p_mid.Width    = width;
            p_mid.Height   = height - p_top.Height;
            p_mid.Location = new Point(0, p_top.Height);
            // p_mid.BackColor = Color.Orange;


            this.scanTitle.Size     = new Size(Convert.ToInt32(this.Width * 0.268), Convert.ToInt32(this.Height * 0.07));
            this.scanTitle.Location = new Point(Convert.ToInt32(this.Width * 0.09), Convert.ToInt32(this.Height * 0.1));

            this.scanBox.Size     = new Size(Convert.ToInt32(this.Width * 0.457), Convert.ToInt32(this.Height * 0.07));
            this.scanBox.Location = new Point(this.scanTitle.Right, this.Height / 10);


            this.EDIQueue.Size     = new Size(Convert.ToInt32(this.Width * 0.35), Convert.ToInt32(this.Height * 0.575));
            this.EDIQueue.Location = new Point(Convert.ToInt32(this.Width * 0.07), this.Height / 5 + this.EDIQueue.Height / 8);

            this.Title.Size     = new Size(Convert.ToInt32(this.Width * 0.35), this.EDIQueue.Height / 8);
            this.Title.Location = new Point(Convert.ToInt32(this.Width * 0.07), this.Height / 5);

            this.errorInfo.Size     = new Size(this.Width / 3, this.EDIQueue.Height - 30);
            this.errorInfo.Location = new Point(this.EDIQueue.Width + this.Width / 6, this.Height / 5);
            this.errorInfo.Text     = "提示信息";

            this.print.Size     = new Size(352, 61);
            this.print.Location = new Point(Convert.ToInt32(this.Width * 0.58), Convert.ToInt32(this.Height * 0.8));



            p_top.Controls.Add(lb_top);
            p_top.Controls.Add(logo);

            this.Controls.Add(p_top);
            this.Controls.Add(p_mid);
        }
Example #37
0
 /// <summary>
 /// Displays the tool tip.
 /// </summary>
 /// <param name="information">The information.</param>
 /// <param name="target">The target.</param>
 /// <param name="colourType">Type of the colour.</param>
 /// <param name="alphaValue">The alpha value.</param>
 /// <param name="redValue">The red value.</param>
 /// <param name="greenValue">The green value.</param>
 /// <param name="blueValue">The blue value.</param>
 /// <param name="hexValue">The hexadecimal value.</param>
 /// <param name="hueValue">The hue value.</param>
 public void DisplayToolTip(ToolTip information, PictureBox target, string colourType, int alphaValue, int redValue, int greenValue, int blueValue, string hexValue, double hueValue)
 {
     information.SetToolTip(target, $"{ colourType } Colour\nARGB: ({ alphaValue.ToString() }, { redValue.ToString() }, { greenValue.ToString() }, { blueValue.ToString() })\nRGB: ({ redValue.ToString() }, { greenValue.ToString() }, { blueValue.ToString() })\nHexadecimal Value: #{ hexValue.ToUpper() }\nHue Value: { hueValue.ToString() }");
 }
Example #38
0
        private void FrmGame_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Space:
                if (metak != null)
                {
                    break;
                }
                metak        = new PictureBox();
                metak.Width  = 5;
                metak.Height = 15;
                Bitmap image = new Bitmap(@"C:\Users\Damir Delijic\source\repos\Game1\Resources\metak.png");
                metak.Location = new Point(playerBox.Location.X + playerBox.Width / 2 - (int)metak.Width / 2, playerBox.Location.Y);
                metak.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                metak.BackgroundImage       = (Image)image;
                metak.Visible = true;
                Controls.Add(metak);
                metak.Show();
                break;

            case Keys.Down:
                if (broj_pogodaka_za_vakcinu == prag)
                {
                    vakcina        = new PictureBox();
                    vakcina.Width  = 200;
                    vakcina.Height = 200;
                    Bitmap img = new Bitmap(@"C:\Users\Damir Delijic\source\repos\Game1\Resources\vaccine.png");
                    vakcina.Location = new Point((int)this.Width / 2 - (int)vakcina.Width / 2, (int)this.Height / 2 - (int)vakcina.Height / 2);
                    vakcina.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
                    vakcina.BackgroundImage       = (Image)img;
                    vakcina.Visible = true;
                    Controls.Add(vakcina);
                    vakcina.Show();
                    foreach (PictureBox virus in virusi)
                    {
                        score++;
                        virus.Dispose();
                    }
                    scoreLabel.Text = null;
                    scoreLabel.Text = score.ToString();
                    virusi.Clear();
                    progressBar.Increment(-100);
                    broj_pogodaka_za_vakcinu = 0;
                    prag += 15;
                    progressBar.Maximum = prag;
                }
                break;

            case Keys.Left:
                if (playerBox.Location.X + (int)x_padding / 2 - 25 > 0)
                {
                    playerBox.Location = new Point(playerBox.Location.X - 25, playerBox.Location.Y);
                }
                break;

            case Keys.Right:
                if (playerBox.Location.X + 25 < this.Width - (int)playerBox.Width)
                {
                    playerBox.Location = new Point(playerBox.Location.X + 25, playerBox.Location.Y);
                }
                break;
            }
        }
Example #39
0
 public ChessBoardManager(Panel chessboard, PictureBox ptbMark, TextBox tbxName)
 {
     this.Chessboard = chessboard;
     this.TbxName    = tbxName;
     this.ptbMark    = ptbMark;
 }
Example #40
0
        public void checkAndBoxart(string isopath, string riifolder, Button btnDecompiled, Button btnOpenPatch, Button btnLaunch, PictureBox pbxBoxart, PictureBox pbxRegion)
        {
            // check if the game has been decompiled earlier, and if so, change the according buttons
            if (Directory.Exists(riifolder + "/" + Path.GetFileNameWithoutExtension(isopath)))
            {
                btnDecompiled.Enabled = true;
                btnDecompiled.Text    = "Reset";
                btnOpenPatch.Enabled  = true;
                btnLaunch.Enabled     = true;
            }
            else                                                                                    // if not, do the same but in reverse
            {
                btnDecompiled.Enabled = true;
                btnDecompiled.Text    = "Decompile";
                btnOpenPatch.Enabled  = false;
                btnLaunch.Enabled     = false;
            }

            string gameid = generateGameID(isopath);

            // grabbing the boxart (my favorite part!!!)
            if (gameid == "")
            {
                pbxBoxart.Image = null;
                pbxRegion.Image = null;
            }
            else
            {
                pbxBoxart.Load("http://www.wiiboxart.com/artwork/cover/" + gameid.Replace(System.Environment.NewLine, "") + ".png");
                switch (gameid[3].ToString())
                {
                case "P": pbxRegion.Image = Properties.Resources.pal;
                    break;

                case "E": pbxRegion.Image = Properties.Resources.ntsc;
                    break;

                case "J": pbxRegion.Image = Properties.Resources.ntscj;
                    break;
                }
            }
        }
Example #41
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Sunburst));
     this.groupBox1        = new System.Windows.Forms.GroupBox();
     this.groupBox2        = new System.Windows.Forms.GroupBox();
     this.rdbChartSheet    = new System.Windows.Forms.RadioButton();
     this.rdbEmbeddedChart = new System.Windows.Forms.RadioButton();
     this.btn2016Charts    = new System.Windows.Forms.Button();
     this.btnViewTemplate  = new System.Windows.Forms.Button();
     this.pictureBox3      = new System.Windows.Forms.PictureBox();
     this.label1           = new System.Windows.Forms.Label();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.groupBox2);
     this.groupBox1.Controls.Add(this.btn2016Charts);
     this.groupBox1.Controls.Add(this.btnViewTemplate);
     this.groupBox1.Font     = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox1.Location = new System.Drawing.Point(3, 125);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(372, 109);
     this.groupBox1.TabIndex = 0;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Sunburst";
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.rdbChartSheet);
     this.groupBox2.Controls.Add(this.rdbEmbeddedChart);
     this.groupBox2.Location = new System.Drawing.Point(23, 20);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(323, 46);
     this.groupBox2.TabIndex = 5;
     this.groupBox2.TabStop  = false;
     this.groupBox2.Text     = "Location";
     //
     // rdbChartSheet
     //
     this.rdbChartSheet.AutoSize = true;
     this.rdbChartSheet.Location = new System.Drawing.Point(181, 20);
     this.rdbChartSheet.Name     = "rdbChartSheet";
     this.rdbChartSheet.Size     = new System.Drawing.Size(92, 17);
     this.rdbChartSheet.TabIndex = 1;
     this.rdbChartSheet.TabStop  = true;
     this.rdbChartSheet.Text     = "Chart Sheet";
     this.rdbChartSheet.UseVisualStyleBackColor = true;
     //
     // rdbEmbeddedChart
     //
     this.rdbEmbeddedChart.AutoSize = true;
     this.rdbEmbeddedChart.Location = new System.Drawing.Point(22, 20);
     this.rdbEmbeddedChart.Name     = "rdbEmbeddedChart";
     this.rdbEmbeddedChart.Size     = new System.Drawing.Size(118, 17);
     this.rdbEmbeddedChart.TabIndex = 0;
     this.rdbEmbeddedChart.TabStop  = true;
     this.rdbEmbeddedChart.Text     = "Embedded Chart";
     this.rdbEmbeddedChart.UseVisualStyleBackColor = true;
     //
     // btn2016Charts
     //
     this.btn2016Charts.Font     = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btn2016Charts.Location = new System.Drawing.Point(203, 72);
     this.btn2016Charts.Name     = "btn2016Charts";
     this.btn2016Charts.Size     = new System.Drawing.Size(129, 25);
     this.btn2016Charts.TabIndex = 2;
     this.btn2016Charts.Text     = "Generate Excel";
     this.btn2016Charts.UseVisualStyleBackColor = true;
     this.btn2016Charts.Click += new System.EventHandler(this.btn2016Charts_Click);
     //
     // btnViewTemplate
     //
     this.btnViewTemplate.Font     = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnViewTemplate.Location = new System.Drawing.Point(33, 72);
     this.btnViewTemplate.Name     = "btnViewTemplate";
     this.btnViewTemplate.Size     = new System.Drawing.Size(129, 25);
     this.btnViewTemplate.TabIndex = 4;
     this.btnViewTemplate.Text     = "Input Template";
     this.btnViewTemplate.UseVisualStyleBackColor = true;
     this.btnViewTemplate.Click += new System.EventHandler(this.btnViewTemplate_Click);
     //
     // pictureBox3
     //
     this.pictureBox3.Image    = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
     this.pictureBox3.Location = new System.Drawing.Point(0, 0);
     this.pictureBox3.Name     = "pictureBox3";
     this.pictureBox3.Size     = new System.Drawing.Size(639, 71);
     this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
     this.pictureBox3.TabIndex = 74;
     this.pictureBox3.TabStop  = false;
     //
     // label1
     //
     this.label1.Font     = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
     this.label1.Location = new System.Drawing.Point(0, 74);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(375, 48);
     this.label1.TabIndex = 64;
     this.label1.Text     = "Click the button to view an Excel spreadsheet generated by Essential XlsIO. Pleas" +
                            "e note that MS Excel Viewer or MS Excel is required to view the resultant docume" +
                            "nt.";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // Sunburst
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Inherit;
     this.BackColor           = System.Drawing.Color.White;
     this.ClientSize          = new System.Drawing.Size(377, 236);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.pictureBox3);
     this.Controls.Add(this.groupBox1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.Name            = "Sunburst";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "Sunburst Chart";
     this.FormClosing    += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.groupBox2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
        private void InitializeComponent()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(formBackgroundEffectSelecter));

            this.button1               = new Button();
            this.panel1                = new Panel();
            this.panel_Picture         = new FlowLayoutPanel();
            this.axShockwaveFlash1     = new AxShockwaveFlash();
            this.buttonOk              = new Button();
            this.buttonAdd             = new Button();
            this.pictureBox_View       = new PictureBox();
            this.panel2                = new Panel();
            this.panel3                = new Panel();
            this.LblBackgroundFillType = new Label();
            this.RdoOriginal           = new RadioButton();
            this.RdoStretch            = new RadioButton();
            this.RdoTiling             = new RadioButton();
            this.RdoZoom               = new RadioButton();
            this.buttonCancel          = new Button();
            ((ISupportInitialize)this.axShockwaveFlash1).BeginInit();
            ((ISupportInitialize)this.pictureBox_View).BeginInit();
            this.panel2.SuspendLayout();
            this.panel3.SuspendLayout();
            base.SuspendLayout();
            this.button1.Anchor   = (AnchorStyles.Bottom | AnchorStyles.Left);
            this.button1.Location = new System.Drawing.Point(87, 543);
            this.button1.Name     = "button1";
            this.button1.Size     = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 21;
            this.button1.Text     = "确定";
            this.button1.UseVisualStyleBackColor = true;
            this.panel1.Anchor                     = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            this.panel1.AutoScroll                 = true;
            this.panel1.Location                   = new System.Drawing.Point(2, 1);
            this.panel1.Name                       = "panel1";
            this.panel1.Size                       = new System.Drawing.Size(300, 529);
            this.panel1.TabIndex                   = 0;
            this.panel_Picture.AutoScroll          = true;
            this.panel_Picture.BorderStyle         = BorderStyle.FixedSingle;
            this.panel_Picture.Location            = new System.Drawing.Point(12, 17);
            this.panel_Picture.Name                = "panel_Picture";
            this.panel_Picture.Size                = new System.Drawing.Size(470, 190);
            this.panel_Picture.TabIndex            = 0;
            this.panel_Picture.Click              += new EventHandler(this.panel_Picture_Click);
            this.axShockwaveFlash1.Dock            = DockStyle.Fill;
            this.axShockwaveFlash1.Enabled         = true;
            this.axShockwaveFlash1.Location        = new System.Drawing.Point(0, 0);
            this.axShockwaveFlash1.Name            = "axShockwaveFlash1";
            this.axShockwaveFlash1.OcxState        = (AxHost.State)componentResourceManager.GetObject("axShockwaveFlash1.OcxState");
            this.axShockwaveFlash1.Size            = new System.Drawing.Size(116, 66);
            this.axShockwaveFlash1.TabIndex        = 25;
            this.axShockwaveFlash1.Visible         = false;
            this.buttonOk.Location                 = new System.Drawing.Point(498, 141);
            this.buttonOk.Name                     = "buttonOk";
            this.buttonOk.Size                     = new System.Drawing.Size(120, 30);
            this.buttonOk.TabIndex                 = 23;
            this.buttonOk.Text                     = "确认";
            this.buttonOk.UseVisualStyleBackColor  = true;
            this.buttonOk.Click                   += new EventHandler(this.buttonOk_Click);
            this.buttonAdd.BackgroundImageLayout   = ImageLayout.Zoom;
            this.buttonAdd.Image                   = Resources.image_add;
            this.buttonAdd.ImageAlign              = System.Drawing.ContentAlignment.MiddleLeft;
            this.buttonAdd.Location                = new System.Drawing.Point(12, 268);
            this.buttonAdd.Name                    = "buttonAdd";
            this.buttonAdd.Size                    = new System.Drawing.Size(119, 30);
            this.buttonAdd.TabIndex                = 22;
            this.buttonAdd.Text                    = "添加素材";
            this.buttonAdd.TextAlign               = System.Drawing.ContentAlignment.MiddleRight;
            this.buttonAdd.UseVisualStyleBackColor = true;
            this.buttonAdd.Click                  += new EventHandler(this.buttonAdd_Click);
            this.pictureBox_View.BackColor         = System.Drawing.SystemColors.ActiveCaption;
            this.pictureBox_View.Dock              = DockStyle.Fill;
            this.pictureBox_View.Location          = new System.Drawing.Point(0, 0);
            this.pictureBox_View.Name              = "pictureBox_View";
            this.pictureBox_View.Size              = new System.Drawing.Size(116, 66);
            this.pictureBox_View.SizeMode          = PictureBoxSizeMode.Zoom;
            this.pictureBox_View.TabIndex          = 24;
            this.pictureBox_View.TabStop           = false;
            this.panel2.BorderStyle                = BorderStyle.Fixed3D;
            this.panel2.Controls.Add(this.pictureBox_View);
            this.panel2.Controls.Add(this.axShockwaveFlash1);
            this.panel2.Location  = new System.Drawing.Point(500, 17);
            this.panel2.Name      = "panel2";
            this.panel2.Size      = new System.Drawing.Size(120, 70);
            this.panel2.TabIndex  = 26;
            this.panel3.BackColor = System.Drawing.SystemColors.HighlightText;
            this.panel3.Controls.Add(this.LblBackgroundFillType);
            this.panel3.Controls.Add(this.RdoOriginal);
            this.panel3.Controls.Add(this.RdoStretch);
            this.panel3.Controls.Add(this.RdoTiling);
            this.panel3.Location = new System.Drawing.Point(12, 224);
            this.panel3.Name     = "panel3";
            this.panel3.Size     = new System.Drawing.Size(470, 29);
            this.panel3.TabIndex = 27;
            this.LblBackgroundFillType.AutoSize = true;
            this.LblBackgroundFillType.Location = new System.Drawing.Point(3, 9);
            this.LblBackgroundFillType.Name     = "LblBackgroundFillType";
            this.LblBackgroundFillType.Size     = new System.Drawing.Size(65, 12);
            this.LblBackgroundFillType.TabIndex = 29;
            this.LblBackgroundFillType.Text     = "背景填充:";
            this.RdoOriginal.AutoSize           = true;
            this.RdoOriginal.Location           = new System.Drawing.Point(373, 7);
            this.RdoOriginal.Name     = "RdoOriginal";
            this.RdoOriginal.Size     = new System.Drawing.Size(47, 16);
            this.RdoOriginal.TabIndex = 2;
            this.RdoOriginal.TabStop  = true;
            this.RdoOriginal.Text     = "原始";
            this.RdoOriginal.UseVisualStyleBackColor = true;
            this.RdoOriginal.CheckedChanged         += new EventHandler(this.RdoOriginal_CheckedChanged);
            this.RdoStretch.AutoSize = true;
            this.RdoStretch.Location = new System.Drawing.Point(247, 7);
            this.RdoStretch.Name     = "RdoStretch";
            this.RdoStretch.Size     = new System.Drawing.Size(47, 16);
            this.RdoStretch.TabIndex = 1;
            this.RdoStretch.TabStop  = true;
            this.RdoStretch.Text     = "拉伸";
            this.RdoStretch.UseVisualStyleBackColor = true;
            this.RdoStretch.CheckedChanged         += new EventHandler(this.RdoStretch_CheckedChanged);
            this.RdoTiling.AutoSize = true;
            this.RdoTiling.Location = new System.Drawing.Point(124, 7);
            this.RdoTiling.Name     = "RdoTiling";
            this.RdoTiling.Size     = new System.Drawing.Size(47, 16);
            this.RdoTiling.TabIndex = 0;
            this.RdoTiling.TabStop  = true;
            this.RdoTiling.Text     = "平铺";
            this.RdoTiling.UseVisualStyleBackColor = true;
            this.RdoTiling.CheckedChanged         += new EventHandler(this.RdoTiling_CheckedChanged);
            this.RdoZoom.AutoSize = true;
            this.RdoZoom.Location = new System.Drawing.Point(502, 231);
            this.RdoZoom.Name     = "RdoZoom";
            this.RdoZoom.Size     = new System.Drawing.Size(47, 16);
            this.RdoZoom.TabIndex = 3;
            this.RdoZoom.TabStop  = true;
            this.RdoZoom.Text     = "缩放";
            this.RdoZoom.UseVisualStyleBackColor = true;
            this.RdoZoom.Visible         = false;
            this.RdoZoom.CheckedChanged += new EventHandler(this.RdoZoom_CheckedChanged);
            this.buttonCancel.Location   = new System.Drawing.Point(498, 177);
            this.buttonCancel.Name       = "buttonCancel";
            this.buttonCancel.Size       = new System.Drawing.Size(120, 30);
            this.buttonCancel.TabIndex   = 28;
            this.buttonCancel.Text       = "取消";
            this.buttonCancel.UseVisualStyleBackColor = true;
            this.buttonCancel.Click += new EventHandler(this.buttonCancel_Click);
            base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
            base.AutoScaleMode       = AutoScaleMode.Font;
            this.BackColor           = System.Drawing.SystemColors.GradientInactiveCaption;
            base.ClientSize          = new System.Drawing.Size(632, 310);
            base.Controls.Add(this.buttonCancel);
            base.Controls.Add(this.RdoZoom);
            base.Controls.Add(this.panel3);
            base.Controls.Add(this.panel2);
            base.Controls.Add(this.buttonOk);
            base.Controls.Add(this.buttonAdd);
            base.Controls.Add(this.panel_Picture);
            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.Icon            = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
            base.MaximizeBox     = false;
            base.MinimizeBox     = false;
            base.Name            = "formBackgroundEffectSelecter";
            base.SizeGripStyle   = SizeGripStyle.Hide;
            base.StartPosition   = FormStartPosition.CenterParent;
            base.Load           += new EventHandler(this.formBackgroundEffectSelecter_Load);
            ((ISupportInitialize)this.axShockwaveFlash1).EndInit();
            ((ISupportInitialize)this.pictureBox_View).EndInit();
            this.panel2.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
        public RecommendedPanels(food f, Main_Menu m)
        {
            temp1       = m;
            lblFoodName = new Label();
            this.Controls.Add(lblFoodName);

            pbThumbnail = new PictureBox();
            this.Controls.Add(pbThumbnail);



            lblPrice = new Label();
            this.Controls.Add(lblPrice);

            lblsoldHeader = new Label();
            this.Controls.Add(lblsoldHeader);

            lblsold = new Label();
            this.Controls.Add(lblsold);

            PurchaseFromMenu = new Button();
            this.Controls.Add(PurchaseFromMenu);



            this.Size        = new Size(343, 685);
            this.BorderStyle = BorderStyle.FixedSingle;
            //0
            this.lblFoodName.AutoSize  = true;
            this.lblFoodName.Size      = new Size(170, 43);
            this.lblFoodName.Text      = f.name;
            this.lblFoodName.BackColor = Color.Transparent;
            this.lblFoodName.Font      = new Font("Monotype Corsiva", (float)16, FontStyle.Italic);

            //1
            this.pbThumbnail.Image     = Image.FromFile(f.image);
            this.pbThumbnail.SizeMode  = PictureBoxSizeMode.StretchImage;
            this.pbThumbnail.Size      = new Size(337, 202);
            this.pbThumbnail.BackColor = Color.Transparent;


            //2
            this.lblPrice.AutoSize  = true;
            this.lblPrice.Size      = new Size(179, 43);
            this.lblPrice.Text      = f.price.ToString();
            this.lblPrice.BackColor = Color.Transparent;
            this.lblPrice.Font      = new Font("Monotype Corsiva", (float)16, FontStyle.Italic);

            //3
            this.lblsoldHeader.AutoSize  = true;
            this.lblsoldHeader.Size      = new Size(179, 43);
            this.lblsoldHeader.Text      = "*Meal Has Been Sold For*";
            this.lblsoldHeader.BackColor = Color.Transparent;
            this.lblsoldHeader.Font      = new Font("Monotype Corsiva", (float)16, FontStyle.Italic);

            //4
            this.lblsold.AutoSize  = true;
            this.lblsold.Size      = new Size(179, 43);
            this.lblsold.Text      = f.sold.ToString() + " Times ";
            this.lblsold.BackColor = Color.Transparent;
            this.lblsold.Font      = new Font("Monotype Corsiva", (float)16, FontStyle.Italic);

            //5
            this.PurchaseFromMenu.Text = "Purchase From Menu";
            //  this.PurchaseFromMenu.Name = (int.Parse(f.id) - 1).ToString();
            this.PurchaseFromMenu.AutoSize  = true;
            this.PurchaseFromMenu.TextAlign = ContentAlignment.MiddleRight;
            // this.btnAddCart.Size = new Size(100, 25);
            //   this.PurchaseFromMenu.Image = P;
            this.PurchaseFromMenu.Font       = new Font("Monotype Corsiva", (float)14, FontStyle.Italic);
            this.PurchaseFromMenu.FlatStyle  = FlatStyle.Flat;
            this.PurchaseFromMenu.BackColor  = Color.Snow;
            this.PurchaseFromMenu.Click     += new EventHandler(m.Recommended_Button);
            this.PurchaseFromMenu.AutoSize   = true;
            this.PurchaseFromMenu.ImageAlign = ContentAlignment.MiddleLeft;



            //6
            lblpriceHeader = new Label();

            this.lblpriceHeader.AutoSize  = true;
            this.lblpriceHeader.Text      = "Price ($):";
            this.lblpriceHeader.BackColor = Color.Transparent;
            this.lblpriceHeader.Font      = new Font("Monotype Corsiva", (float)16, FontStyle.Italic);
            this.Visible = true;
            this.Controls.Add(lblpriceHeader);

            this.Controls[0].Location = new Point(20, 226);
            this.Controls[0].BringToFront(); //name
            this.Controls[1].Location = new Point(3, 3);
            this.Controls[1].BringToFront(); //pic
            this.Controls[2].Location = new Point(223, 299);
            this.Controls[2].BringToFront();
            this.Visible = true;
            this.Controls[3].Location = new Point(20, 388);
            this.Controls[3].BringToFront();
            this.Controls[4].Location = new Point(115, 444);
            this.Controls[4].BringToFront();

            this.Controls[5].Location = new Point(72, 566);
            this.Controls[6].Location = new Point(32, 299);
            this.Controls[6].BringToFront();
            this.Visible = true;
        }
Example #44
0
        //setup gia dien nguoi dùng (phần danh sách sản phẩm trong panel main)
        private void SetupUI()
        {
            //lay thong tin tat ca sản pham
            ProductList = productBAL.GetDataProduct();
            //duyen tat ca san pham trong danh sach
            for (int i = 0; i < ProductList.Count; i++)
            {

                //danh sach co hinh dang nhu sau
                //la 1 flowlayoutpanel
                //gom nhieu panel nhu the nay

                /*---------------------
                 * -   picturebox     -
                 * -                  -
                 * -                  -
                 * -                  -
                 * -                  -
                 * --------------------
                 * -    label ten sp  -
                 * --------------------
                 * -     label gia    -
                 * --------------------*/

                //tao 1 panel chua ptb, label name, label gia
                Panel pnl = new Panel();
                //dinh dang height width
                pnl.Width = Convert.ToInt32(250);
                pnl.Height = Convert.ToInt32(fpnlProduct.Height / 2);

                
                
                //tao moi 1 ptb va dinh dang height width
                PictureBox ptb = new PictureBox();
                ptb.Location = pnl.Location;
                ptb.Height = Convert.ToInt32(pnl.Height * 0.7);
                ptb.Width = pnl.Width;
                ptb.SizeMode = PictureBoxSizeMode.Zoom;
                //load hình với sizemode là zoom
                ptb.LoadAsync(ProductList[i].LinkImg);
                //gan tag bang vi tri cua no trong danh sach sản phẩm
                ptb.Tag = i.ToString();
                //add ptb vao panel 
                pnl.Controls.Add(ptb);
                //tao action click vao hình se hien len thong tin chi tiet
                ptb.Click += Picturebox_click;
                //tao 1 label name va dinh vi vi tri x = bang voi vi tri x cua panel cha, y= chieu cao cua picturebox , height va width
                Label lbName = new Label();
                lbName.Location = new Point(Convert.ToInt32(pnl.Location.X), pnl.Location.Y + ptb.Height);
                lbName.Width = pnl.Width;
                lbName.Height = Convert.ToInt32(pnl.Height * 0.15);
                lbName.Text = ProductList[i].ProductName;//lay ten sản pham tu i trong danh sach sp
                lbName.Font = new Font("Arial", 15, FontStyle.Regular);
                lbName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // alight center
                pnl.Controls.Add(lbName);//them lbname vao panel
                //label gia tương tự . có vấn đề liên hệ Lê Anh Đức gmail: [email protected]
                Label lbPrice = new Label();
                lbPrice.Location = new Point(Convert.ToInt32(pnl.Location.X), pnl.Location.Y + ptb.Height + lbName.Height);
                lbPrice.Width = pnl.Width;
                lbPrice.Height = Convert.ToInt32(pnl.Height * 0.15);
                lbPrice.Text = ProductList[i].Dongia;
                lbPrice.Font = new Font("Arial", 13, FontStyle.Regular);
                lbPrice.TextAlign = System.Drawing.ContentAlignment.TopCenter;
                pnl.Controls.Add(lbPrice);
                //add panel 1 san pham vao flowlayoutPanel
                fpnlProduct.Controls.Add(pnl);
            }

            //thiet lap label hien ten user , height width location nam ben trái center vertical so voi panel toolbox
            //button xem thong tin user nam ben duoi ten user
            
            


            //hinh anh toolbox nhu vay ne
            /*--------------------------------------------------------------------------------------------
             * -  panel trái             -                                 -         panel phải          -
             * -  chua tenuser           -        title                    -       chua 1 ptb va label   -label hien thi so sp trong gio hang
             * -------------------------------------------------------------------------------------------
            */

            //panel ben phải trong paneltoolbox
            //them ptb vao pnel phai load hinh anh xe day hang len
            pnlToolRight.Controls.Add(ptbGioHang);
            ptbGioHang.LoadAsync("https://icon-library.com/images/white-shopping-cart-icon/white-shopping-cart-icon-9.jpg");
            ptbGioHang.SizeMode = PictureBoxSizeMode.Zoom;
            //thiet lap kich thuoc vi tri cho ptb
            ptbGioHang.Height = Convert.ToInt32(pnlToolRight.Height);
            ptbGioHang.Width = Convert.ToInt32(pnlToolRight.Width / 3);
            ptbGioHang.Click += gioHang_click;
            //them label so luong sp vao panel phai
            pnlToolRight.Controls.Add(lbGioHang);
            lbGioHang.Font = lbInfo.Font = new Font("Arial", Convert.ToInt32(pnlToolBox.Height * 0.09), FontStyle.Regular);
            lbGioHang.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            lbGioHang.Height = ptbGioHang.Height;
            lbGioHang.ForeColor = Color.White;
            lbGioHang.Click += gioHang_click;

            lbGioHang.Width = Convert.ToInt32(pnlToolRight.Width * 0.7);
            lbGioHang.Location = new Point(ptbGioHang.Width, ptbGioHang.Location.Y);
        }
Example #45
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn public EllipseTool(PictureBox mainView) : base(mainView)
        ///
        /// \brief Constructor
        ///
        /// \param mainView The main view control.
        ///-------------------------------------------------------------------------------------------------

        public EllipseTool(PictureBox mainView) : base(mainView)
        {
        }
Example #46
0
        private void InitializeComponent()
        {
            components = new Container();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(QuestionEditor));

            addFormulaButton                    = new Button();
            addPicturebutton                    = new Button();
            pictureBox                          = new PictureBox();
            label6                              = new Label();
            label4                              = new Label();
            difficutlyLevelcomboBox             = new ComboBox();
            label1                              = new Label();
            subTypecomboBox                     = new ComboBox();
            typelabel                           = new Label();
            typeComboBox                        = new ComboBox();
            label2                              = new Label();
            textTextBox                         = new TextBox();
            groupBox2                           = new GroupBox();
            addAnswerFormula                    = new Button();
            answersDataGridView                 = new DataGridView();
            idDataGridViewTextBoxColumn         = new DataGridViewTextBoxColumn();
            questionIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
            textDataGridViewTextBoxColumn       = new DataGridViewTextBoxColumn();
            isCorrectDataGridViewCheckBoxColumn = new DataGridViewCheckBoxColumn();
            orderDataGridViewTextBoxColumn      = new DataGridViewTextBoxColumn();
            addNewButton                        = new Button();
            removeButton                        = new Button();
            imageList                           = new ImageList(components);
            groupBox1                           = new GroupBox();
            groupBox3                           = new GroupBox();
            deletePicturebutton                 = new Button();
            ((ISupportInitialize)(data)).BeginInit();
            ((ISupportInitialize)(pictureBox)).BeginInit();
            groupBox2.SuspendLayout();
            ((ISupportInitialize)(answersDataGridView)).BeginInit();
            groupBox1.SuspendLayout();
            groupBox3.SuspendLayout();
            SuspendLayout();

            //
            // explanationButton
            //
            explanationButton          = new Button();
            explanationButton.Location = new Point(132, 11);
            explanationButton.Name     = "explanationButton";
            explanationButton.Size     = new Size(85, 23);
            explanationButton.Text     = "explanation";
            explanationButton.Click   += new EventHandler(explanationButton_Click);
            explanationButton.UseVisualStyleBackColor = true;
            //
            // explanationButton
            //

            //
            // addFormulaButton
            //
            addFormulaButton.Location = new Point(41, 11);
            addFormulaButton.Name     = "addFormulaButton";
            addFormulaButton.Size     = new Size(85, 23);
            addFormulaButton.TabIndex = 43;
            addFormulaButton.Text     = "add formula";
            addFormulaButton.UseVisualStyleBackColor = true;
            addFormulaButton.Click += new EventHandler(addFormulaButton_Click);
            //
            // addPicturebutton
            //
            addPicturebutton.Location = new Point(210, 92);
            addPicturebutton.Name     = "addPicturebutton";
            addPicturebutton.Size     = new Size(45, 20);
            addPicturebutton.TabIndex = 42;
            addPicturebutton.Text     = "add";
            addPicturebutton.UseVisualStyleBackColor = true;
            addPicturebutton.Click += new EventHandler(addPicturebutton_Click);
            //
            // pictureBox
            //
            pictureBox.BorderStyle = BorderStyle.Fixed3D;
            pictureBox.Location    = new Point(9, 118);
            pictureBox.Name        = "pictureBox";
            pictureBox.Size        = new Size(297, 154);
            pictureBox.SizeMode    = PictureBoxSizeMode.Zoom;
            pictureBox.TabIndex    = 41;
            pictureBox.TabStop     = false;
            //
            // label6
            //
            label6.AutoSize = true;
            label6.Location = new Point(6, 92);
            label6.Name     = "label6";
            label6.Size     = new Size(43, 13);
            label6.TabIndex = 40;
            label6.Text     = "Picture:";
            //
            // label4
            //
            label4.Location = new Point(6, 14);
            label4.Name     = "label4";
            label4.Size     = new Size(77, 23);
            label4.TabIndex = 39;
            label4.Text     = "Difficutly level";
            //
            // difficutlyLevelcomboBox
            //
            difficutlyLevelcomboBox.FormattingEnabled = true;
            difficutlyLevelcomboBox.Location          = new Point(89, 11);
            difficutlyLevelcomboBox.Name     = "difficutlyLevelcomboBox";
            difficutlyLevelcomboBox.Size     = new Size(217, 21);
            difficutlyLevelcomboBox.TabIndex = 38;
            //
            // label1
            //
            label1.Location = new Point(6, 68);
            label1.Name     = "label1";
            label1.Size     = new Size(77, 23);
            label1.TabIndex = 37;
            label1.Text     = "Sub type:";
            //
            // subTypecomboBox
            //
            subTypecomboBox.FormattingEnabled = true;
            subTypecomboBox.Location          = new Point(89, 65);
            subTypecomboBox.Name                  = "subTypecomboBox";
            subTypecomboBox.Size                  = new Size(217, 21);
            subTypecomboBox.TabIndex              = 36;
            subTypecomboBox.SelectedIndexChanged += new EventHandler(subTypecomboBox_SelectedIndexChanged);
            //
            // typelabel
            //
            typelabel.Location = new Point(6, 41);
            typelabel.Name     = "typelabel";
            typelabel.Size     = new Size(51, 23);
            typelabel.TabIndex = 35;
            typelabel.Text     = "Type:";
            //
            // typeComboBox
            //
            typeComboBox.FormattingEnabled = true;
            typeComboBox.Location          = new Point(89, 38);
            typeComboBox.Name     = "typeComboBox";
            typeComboBox.Size     = new Size(217, 21);
            typeComboBox.TabIndex = 34;
            //
            // label2
            //
            label2.AutoSize = true;
            label2.Location = new Point(5, 16);
            label2.Name     = "label2";
            label2.Size     = new Size(31, 13);
            label2.TabIndex = 33;
            label2.Text     = "Text:";
            //
            // textTextBox
            //
            textTextBox.Location     = new Point(6, 41);
            textTextBox.Multiline    = true;
            textTextBox.Name         = "textTextBox";
            textTextBox.Size         = new Size(441, 232);
            textTextBox.TabIndex     = 32;
            textTextBox.TextChanged += new EventHandler(textTextBox_TextChanged);
            //
            // groupBox2
            //
            groupBox2.Controls.Add(addAnswerFormula);
            groupBox2.Controls.Add(answersDataGridView);
            groupBox2.Controls.Add(addNewButton);
            groupBox2.Controls.Add(removeButton);
            groupBox2.FlatStyle = FlatStyle.System;
            groupBox2.Location  = new Point(6, 288);
            groupBox2.Name      = "groupBox2";
            groupBox2.Size      = new Size(771, 341);
            groupBox2.TabIndex  = 47;
            groupBox2.TabStop   = false;
            groupBox2.Text      = "Answers";
            //
            // addAnswerFormula
            //
            addAnswerFormula.Enabled  = false;
            addAnswerFormula.Location = new Point(8, 16);
            addAnswerFormula.Name     = "addAnswerFormula";
            addAnswerFormula.Size     = new Size(85, 23);
            addAnswerFormula.TabIndex = 44;
            addAnswerFormula.Text     = "add formula";
            addAnswerFormula.UseVisualStyleBackColor = true;
            addAnswerFormula.Click += new EventHandler(addAnswerFormula_Click);
            //
            // answersDataGridView
            //
            answersDataGridView.AllowUserToAddRows      = false;
            answersDataGridView.AllowUserToDeleteRows   = false;
            answersDataGridView.AllowUserToOrderColumns = true;
            answersDataGridView.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
            answersDataGridView.AutoGenerateColumns         = false;
            answersDataGridView.ColumnHeadersBorderStyle    = DataGridViewHeaderBorderStyle.None;
            answersDataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            answersDataGridView.Columns.AddRange(new DataGridViewColumn[]
            {
                idDataGridViewTextBoxColumn,
                questionIdDataGridViewTextBoxColumn,
                textDataGridViewTextBoxColumn,
                isCorrectDataGridViewCheckBoxColumn,
                orderDataGridViewTextBoxColumn
            });
            answersDataGridView.DataMember    = "Answers";
            answersDataGridView.DataSource    = data;
            answersDataGridView.Location      = new Point(6, 64);
            answersDataGridView.MultiSelect   = false;
            answersDataGridView.Name          = "answersDataGridView";
            answersDataGridView.Size          = new Size(759, 271);
            answersDataGridView.TabIndex      = 11;
            answersDataGridView.CellEndEdit  += new DataGridViewCellEventHandler(answersDataGridView_CellEndEdit);
            answersDataGridView.Click        += new EventHandler(answersDataGridView_Click);
            answersDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            //
            // idDataGridViewTextBoxColumn
            //
            idDataGridViewTextBoxColumn.DataPropertyName = "Id";
            idDataGridViewTextBoxColumn.HeaderText       = "Id";
            idDataGridViewTextBoxColumn.Name             = "idDataGridViewTextBoxColumn";
            idDataGridViewTextBoxColumn.ReadOnly         = true;
            idDataGridViewTextBoxColumn.Visible          = false;
            //
            // questionIdDataGridViewTextBoxColumn
            //
            questionIdDataGridViewTextBoxColumn.DataPropertyName = "QuestionId";
            questionIdDataGridViewTextBoxColumn.HeaderText       = "QuestionId";
            questionIdDataGridViewTextBoxColumn.Name             = "questionIdDataGridViewTextBoxColumn";
            questionIdDataGridViewTextBoxColumn.Visible          = false;
            //
            // textDataGridViewTextBoxColumn
            //
            textDataGridViewTextBoxColumn.DataPropertyName = "Text";
            textDataGridViewTextBoxColumn.HeaderText       = "Text";
            textDataGridViewTextBoxColumn.Name             = "textDataGridViewTextBoxColumn";
            textDataGridViewTextBoxColumn.SortMode         = DataGridViewColumnSortMode.NotSortable;
            textDataGridViewTextBoxColumn.Width            = 300;
            //
            // isCorrectDataGridViewCheckBoxColumn
            //
            isCorrectDataGridViewCheckBoxColumn.DataPropertyName = "IsCorrect";
            isCorrectDataGridViewCheckBoxColumn.HeaderText       = "IsCorrect";
            isCorrectDataGridViewCheckBoxColumn.Name             = "isCorrectDataGridViewCheckBoxColumn";
            //
            // orderDataGridViewTextBoxColumn
            //
            orderDataGridViewTextBoxColumn.DataPropertyName = "Order";
            orderDataGridViewTextBoxColumn.HeaderText       = "Order";
            orderDataGridViewTextBoxColumn.Name             = "orderDataGridViewTextBoxColumn";
            orderDataGridViewTextBoxColumn.Visible          = false;
            //
            // addNewButton
            //
            addNewButton.Anchor     = AnchorStyles.Right;
            addNewButton.FlatStyle  = FlatStyle.System;
            addNewButton.ImageIndex = 0;
            addNewButton.Location   = new Point(583, 34);
            addNewButton.Name       = "addNewButton";
            addNewButton.Size       = new Size(88, 24);
            addNewButton.TabIndex   = 8;
            addNewButton.Text       = "Add &New...";
            addNewButton.Click     += new EventHandler(addNewButton_Click);
            //
            // removeButton
            //
            removeButton.Anchor     = AnchorStyles.Right;
            removeButton.FlatStyle  = FlatStyle.System;
            removeButton.ImageIndex = 2;
            removeButton.Location   = new Point(677, 34);
            removeButton.Name       = "removeButton";
            removeButton.Size       = new Size(88, 24);
            removeButton.TabIndex   = 9;
            removeButton.Text       = "&Remove";
            removeButton.Click     += new EventHandler(removeButton_Click);
            //
            // imageList
            //
            imageList.ImageStream      = ((ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
            imageList.TransparentColor = Color.Fuchsia;
            imageList.Images.SetKeyName(0, "");
            imageList.Images.SetKeyName(1, "");
            //
            // groupBox1
            //
            groupBox1.Controls.Add(deletePicturebutton);
            groupBox1.Controls.Add(subTypecomboBox);
            groupBox1.Controls.Add(typeComboBox);
            groupBox1.Controls.Add(typelabel);
            groupBox1.Controls.Add(addPicturebutton);
            groupBox1.Controls.Add(label1);
            groupBox1.Controls.Add(pictureBox);
            groupBox1.Controls.Add(difficutlyLevelcomboBox);
            groupBox1.Controls.Add(label6);
            groupBox1.Controls.Add(label4);
            groupBox1.Location = new Point(465, 3);
            groupBox1.Name     = "groupBox1";
            groupBox1.Size     = new Size(312, 279);
            groupBox1.TabIndex = 48;
            groupBox1.TabStop  = false;
            //
            // groupBox3
            //
            groupBox3.Controls.Add(addFormulaButton);
            groupBox3.Controls.Add(explanationButton);
            groupBox3.Controls.Add(textTextBox);
            groupBox3.Controls.Add(label2);
            groupBox3.Location = new Point(6, 3);
            groupBox3.Name     = "groupBox3";
            groupBox3.Size     = new Size(453, 279);
            groupBox3.TabIndex = 49;
            groupBox3.TabStop  = false;
            //
            // deletePicturebutton
            //
            deletePicturebutton.Location = new Point(261, 92);
            deletePicturebutton.Name     = "deletePicturebutton";
            deletePicturebutton.Size     = new Size(45, 20);
            deletePicturebutton.TabIndex = 43;
            deletePicturebutton.Text     = "delete";
            deletePicturebutton.UseVisualStyleBackColor = true;
            deletePicturebutton.Click += new EventHandler(deletePicturebutton_Click);
            //
            // QuestionEditor
            //
            Controls.Add(groupBox3);
            Controls.Add(groupBox1);
            Controls.Add(groupBox2);
            Name  = "QuestionEditor";
            Size  = new Size(782, 632);
            Load += new EventHandler(QuestionEditor_Load);
            ((ISupportInitialize)(data)).EndInit();
            ((ISupportInitialize)(pictureBox)).EndInit();
            groupBox2.ResumeLayout(false);
            ((ISupportInitialize)(answersDataGridView)).EndInit();
            groupBox1.ResumeLayout(false);
            groupBox1.PerformLayout();
            groupBox3.ResumeLayout(false);
            groupBox3.PerformLayout();
            ResumeLayout(false);
        }
Example #47
0
        /// <summary>
        /// Handler method that's called when the user changes the text in <see cref="urlTextBox"/>.  Updates the list of auto-complete entries and updates
        /// the OmniBar accordingly.
        /// </summary>
        /// <param name="sender">Object from which this event originated.</param>
        /// <param name="e">Arguments associated with this event.</param>
        private void urlTextBox_TextChanged(object sender, EventArgs e)
        {
            // If the text box is blank or we're deliberately suppressing the OmniBar, hide it
            if (urlTextBox.Text.Length == 0 || _suppressOmniBar)
            {
                _omniBarPanel.Visible  = false;
                _omniBarBorder.Visible = false;

                return;
            }

            IConnection currentlyFocusedItem = null;

            if (_omniBarFocusIndex != -1)
            {
                currentlyFocusedItem = _validAutoCompleteEntries[_omniBarFocusIndex];
            }

            // If this is the first text change since the user focused on the text box, then we get the list of all bookmarks and history items that weren't
            // from bookmarks and then use them all as potential auto-complete entries
            if (_autoCompleteEntries.Count == 0)
            {
                List <IConnection> bookmarks = new List <IConnection>();
                GetAllBookmarks(ParentTabs.Bookmarks.RootFolder, bookmarks);
                _autoCompleteEntries.AddRange(bookmarks);

                // Exclude history entries that are from the user clicking a bookmark
                if (ParentTabs.History.Connections != null)
                {
                    _autoCompleteEntries.AddRange(
                        ParentTabs.History.Connections.OrderByDescending(c => c.LastConnection).Distinct(
                            new EqualityComparer <HistoryWindow.HistoricalConnection>(
                                (x, y) => x.Connection.Host == y.Connection.Host)).Where(
                            c => _autoCompleteEntries.FindIndex(a => a.Host == c.Connection.Host) == -1).Select
                            (c => c.Connection));
                }
            }

            // Get a list of valid auto-complete entries by matching on the bookmark's display name or host
            _validAutoCompleteEntries =
                _autoCompleteEntries.Where(
                    c =>
                    c.DisplayName.IndexOf(urlTextBox.Text, StringComparison.InvariantCultureIgnoreCase) != -1 ||
                    c.Host.IndexOf(urlTextBox.Text, StringComparison.InvariantCultureIgnoreCase) != -1).OrderBy(c => c.DisplayName).Take(6).ToList();

            if (_validAutoCompleteEntries.Count > 0)
            {
                _omniBarPanel.SuspendLayout();
                _omniBarBorder.SuspendLayout();

                for (int i = 0; i < _validAutoCompleteEntries.Count; i++)
                {
                    IConnection connection             = _validAutoCompleteEntries[i];
                    HtmlPanel   autoCompletePanel      = _omniBarPanel.Controls[i * 2 + 1] as HtmlPanel;
                    PictureBox  autoCompletePictureBox = _omniBarPanel.Controls[i * 2] as PictureBox;

                    // Set the text of the auto-complete item to "{Protocol}://{URI} - {DisplayName}" and bold the matching portions of the text
                    autoCompletePanel.Text =
                        String.Format(
                            @"<div style=""background-color: #FFFFFF; padding-left: 29px; padding-top: 5px; padding-bottom: 5px; padding-right: 5px; font-family: {3}; font-size: {4}pt; height: 30px; color: #9999BF;""><font color=""green"">{0}://{1}</font>{2}</div>",
                            ConnectionFactory.GetProtocol(connection).ProtocolPrefix,
                            Regex.Replace(connection.Host, urlTextBox.Text, "<b>$0</b>", RegexOptions.IgnoreCase), connection.DisplayName == connection.Host
                                                                                                                                                       ? ""
                                                                                                                                                       : " - " +
                            Regex.Replace(
                                connection.DisplayName,
                                urlTextBox.Text, "<b>$0</b>",
                                RegexOptions.IgnoreCase),
                            urlTextBox.Font.FontFamily.GetName(0), urlTextBox.Font.SizeInPoints);

                    autoCompletePictureBox.Image     = new Icon(ConnectionFactory.GetProtocol(connection).ProtocolIcon, 16, 16).ToBitmap();
                    autoCompletePictureBox.BackColor = Color.White;

                    // If the user was focused on this item, highlight it
                    if (connection == currentlyFocusedItem)
                    {
                        FocusOmniBarItem(autoCompletePanel);
                    }
                }

                _omniBarPanel.Height   = _validAutoCompleteEntries.Count * 30 - 1;
                _omniBarBorder.Height  = _omniBarPanel.Height + 2;
                _omniBarPanel.Visible  = true;
                _omniBarBorder.Visible = true;
                _omniBarPanel.ResumeLayout();
                _omniBarBorder.ResumeLayout();
                _omniBarPanel.PerformLayout();
                _omniBarBorder.PerformLayout();
            }

            // If we found no matching entries, hide the OmniBar
            else
            {
                _omniBarPanel.Visible  = false;
                _omniBarBorder.Visible = false;
            }
        }
Example #48
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PriceInquiryWnd));
     this.lblHeader             = new System.Windows.Forms.Label();
     this.grpProducts           = new System.Windows.Forms.GroupBox();
     this.imgRBSLogo            = new System.Windows.Forms.PictureBox();
     this.imgCompany            = new System.Windows.Forms.PictureBox();
     this.lblPrice              = new System.Windows.Forms.Label();
     this.lblProductDescription = new System.Windows.Forms.Label();
     this.lblPriceLabel         = new System.Windows.Forms.Label();
     this.txtBarCode            = new System.Windows.Forms.TextBox();
     this.lblCaption            = new System.Windows.Forms.Label();
     this.imgIcon = new System.Windows.Forms.PictureBox();
     this.label1  = new System.Windows.Forms.Label();
     this.label2  = new System.Windows.Forms.Label();
     this.grpProducts.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.imgRBSLogo)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.imgCompany)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.imgIcon)).BeginInit();
     this.SuspendLayout();
     //
     // lblHeader
     //
     this.lblHeader.BackColor = System.Drawing.Color.Transparent;
     this.lblHeader.Font      = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblHeader.ForeColor = System.Drawing.Color.White;
     this.lblHeader.Location  = new System.Drawing.Point(67, 22);
     this.lblHeader.Name      = "lblHeader";
     this.lblHeader.Size      = new System.Drawing.Size(408, 16);
     this.lblHeader.TabIndex  = 3;
     this.lblHeader.Text      = "PRICE INQURY... REWARD POINTS ... CREDIT CARD LIMIT     INQUIRY";
     //
     // grpProducts
     //
     this.grpProducts.BackColor             = System.Drawing.Color.White;
     this.grpProducts.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
     this.grpProducts.Controls.Add(this.imgRBSLogo);
     this.grpProducts.Controls.Add(this.imgCompany);
     this.grpProducts.Controls.Add(this.lblPrice);
     this.grpProducts.Controls.Add(this.lblProductDescription);
     this.grpProducts.Controls.Add(this.lblPriceLabel);
     this.grpProducts.Controls.Add(this.txtBarCode);
     this.grpProducts.Font      = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.grpProducts.ForeColor = System.Drawing.Color.Blue;
     this.grpProducts.Location  = new System.Drawing.Point(12, 178);
     this.grpProducts.Name      = "grpProducts";
     this.grpProducts.Size      = new System.Drawing.Size(780, 430);
     this.grpProducts.TabIndex  = 0;
     this.grpProducts.TabStop   = false;
     //
     // imgRBSLogo
     //
     this.imgRBSLogo.BackColor             = System.Drawing.Color.Transparent;
     this.imgRBSLogo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
     this.imgRBSLogo.Location = new System.Drawing.Point(5, 242);
     this.imgRBSLogo.Name     = "imgRBSLogo";
     this.imgRBSLogo.Size     = new System.Drawing.Size(206, 181);
     this.imgRBSLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
     this.imgRBSLogo.TabIndex = 89;
     this.imgRBSLogo.TabStop  = false;
     //
     // imgCompany
     //
     this.imgCompany.BackColor             = System.Drawing.Color.Transparent;
     this.imgCompany.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
     this.imgCompany.Location = new System.Drawing.Point(570, 242);
     this.imgCompany.Name     = "imgCompany";
     this.imgCompany.Size     = new System.Drawing.Size(206, 181);
     this.imgCompany.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
     this.imgCompany.TabIndex = 83;
     this.imgCompany.TabStop  = false;
     //
     // lblPrice
     //
     this.lblPrice.AutoEllipsis = true;
     this.lblPrice.BackColor    = System.Drawing.Color.Transparent;
     this.lblPrice.Font         = new System.Drawing.Font("Tahoma", 48F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblPrice.ForeColor    = System.Drawing.Color.Red;
     this.lblPrice.Location     = new System.Drawing.Point(200, 193);
     this.lblPrice.Name         = "lblPrice";
     this.lblPrice.Size         = new System.Drawing.Size(398, 64);
     this.lblPrice.TabIndex     = 9;
     this.lblPrice.Text         = "100.00";
     this.lblPrice.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblProductDescription
     //
     this.lblProductDescription.Font      = new System.Drawing.Font("Tahoma", 26.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblProductDescription.ForeColor = System.Drawing.Color.MediumBlue;
     this.lblProductDescription.Location  = new System.Drawing.Point(6, 84);
     this.lblProductDescription.Name      = "lblProductDescription";
     this.lblProductDescription.Size      = new System.Drawing.Size(768, 51);
     this.lblProductDescription.TabIndex  = 1;
     this.lblProductDescription.Text      = "CHUPA CHUPS";
     this.lblProductDescription.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblPriceLabel
     //
     this.lblPriceLabel.AutoSize  = true;
     this.lblPriceLabel.Font      = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblPriceLabel.ForeColor = System.Drawing.Color.MediumBlue;
     this.lblPriceLabel.Location  = new System.Drawing.Point(200, 156);
     this.lblPriceLabel.Name      = "lblPriceLabel";
     this.lblPriceLabel.Size      = new System.Drawing.Size(77, 23);
     this.lblPriceLabel.TabIndex  = 4;
     this.lblPriceLabel.Text      = "PRICE:";
     //
     // txtBarCode
     //
     this.txtBarCode.BackColor   = System.Drawing.Color.White;
     this.txtBarCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.txtBarCode.Font        = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtBarCode.ForeColor   = System.Drawing.Color.Transparent;
     this.txtBarCode.Location    = new System.Drawing.Point(124, 449);
     this.txtBarCode.Name        = "txtBarCode";
     this.txtBarCode.Size        = new System.Drawing.Size(539, 23);
     this.txtBarCode.TabIndex    = 82;
     //
     // lblCaption
     //
     this.lblCaption.AutoSize  = true;
     this.lblCaption.BackColor = System.Drawing.Color.Transparent;
     this.lblCaption.Font      = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblCaption.ForeColor = System.Drawing.Color.Red;
     this.lblCaption.Location  = new System.Drawing.Point(25, 78);
     this.lblCaption.Name      = "lblCaption";
     this.lblCaption.Size      = new System.Drawing.Size(410, 29);
     this.lblCaption.TabIndex  = 85;
     this.lblCaption.Text      = "Please scan item to check the price...";
     this.lblCaption.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // imgIcon
     //
     this.imgIcon.BackColor = System.Drawing.Color.Blue;
     this.imgIcon.Location  = new System.Drawing.Point(9, 5);
     this.imgIcon.Name      = "imgIcon";
     this.imgIcon.Size      = new System.Drawing.Size(49, 49);
     this.imgIcon.TabIndex  = 86;
     this.imgIcon.TabStop   = false;
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.BackColor = System.Drawing.Color.Transparent;
     this.label1.Font      = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.Red;
     this.label1.Location  = new System.Drawing.Point(90, 107);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(471, 29);
     this.label1.TabIndex  = 87;
     this.label1.Text      = "or your reward card to check your points...";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // label2
     //
     this.label2.AutoSize  = true;
     this.label2.BackColor = System.Drawing.Color.Transparent;
     this.label2.Font      = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label2.ForeColor = System.Drawing.Color.Red;
     this.label2.Location  = new System.Drawing.Point(164, 136);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(562, 29);
     this.label2.TabIndex  = 88;
     this.label2.Text      = "or your credit card to check your available credits...";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // PriceInquiryWnd
     //
     this.AutoScaleBaseSize     = new System.Drawing.Size(5, 14);
     this.BackColor             = System.Drawing.Color.White;
     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
     this.ClientSize            = new System.Drawing.Size(802, 620);
     this.ControlBox            = false;
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.imgIcon);
     this.Controls.Add(this.grpProducts);
     this.Controls.Add(this.lblCaption);
     this.Controls.Add(this.lblHeader);
     this.Font            = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.KeyPreview      = true;
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.Name            = "PriceInquiryWnd";
     this.ShowInTaskbar   = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.TopMost         = true;
     this.Load           += new System.EventHandler(this.PriceInquiryWnd_Load);
     this.KeyDown        += new System.Windows.Forms.KeyEventHandler(this.PriceInquiryWnd_KeyDown);
     this.grpProducts.ResumeLayout(false);
     this.grpProducts.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.imgRBSLogo)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.imgCompany)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.imgIcon)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #49
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.button1          = new Syncfusion.Windows.Forms.ButtonAdv();
     this.label2           = new System.Windows.Forms.Label();
     this.toolTip1         = new System.Windows.Forms.ToolTip(this.components);
     this.pictureBox1      = new System.Windows.Forms.PictureBox();
     this.groupBox1        = new System.Windows.Forms.GroupBox();
     this.wordDocxRadioBtn = new Syncfusion.Windows.Forms.Tools.RadioButtonAdv();
     this.wordDocRadioBtn  = new Syncfusion.Windows.Forms.Tools.RadioButtonAdv();
     this.pdfRadioBtn      = new Syncfusion.Windows.Forms.Tools.RadioButtonAdv();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     this.groupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.wordDocxRadioBtn)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.wordDocRadioBtn)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.pdfRadioBtn)).BeginInit();
     this.SuspendLayout();
     //
     // button1
     //
     this.button1.Anchor             = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.button1.Appearance         = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.button1.BackColor          = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
     this.button1.BeforeTouchSize    = new System.Drawing.Size(108, 23);
     this.button1.ComboEditBackColor = System.Drawing.Color.Silver;
     this.button1.Font                    = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button1.ForeColor               = System.Drawing.Color.White;
     this.button1.ImageAlign              = System.Drawing.ContentAlignment.MiddleRight;
     this.button1.IsBackStageButton       = false;
     this.button1.KeepFocusRectangle      = false;
     this.button1.Location                = new System.Drawing.Point(245, 165);
     this.button1.Name                    = "button1";
     this.button1.Office2007ColorScheme   = Syncfusion.Windows.Forms.Office2007Theme.Managed;
     this.button1.Size                    = new System.Drawing.Size(108, 23);
     this.button1.TabIndex                = 26;
     this.button1.Text                    = "Generate";
     this.button1.UseVisualStyle          = true;
     this.button1.UseVisualStyleBackColor = false;
     this.button1.Click                  += new System.EventHandler(this.button1_Click);
     //
     // label2
     //
     this.label2.Font      = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
     this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
     this.label2.Location  = new System.Drawing.Point(0, 85);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(363, 62);
     this.label2.TabIndex  = 73;
     this.label2.Text      = "Click the button to view the generated Word document or PDF. Please note that Microsoft Word Viewer or Microsoft Word is required to view the resultant Word document and PDF viewer is required to view the resultant PDF.";
     //
     // pictureBox1
     //
     this.pictureBox1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.pictureBox1.Image    = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
     this.pictureBox1.Location = new System.Drawing.Point(0, 0);
     this.pictureBox1.Name     = "pictureBox1";
     this.pictureBox1.Size     = new System.Drawing.Size(365, 82);
     this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex = 70;
     this.pictureBox1.TabStop  = false;
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.wordDocxRadioBtn);
     this.groupBox1.Controls.Add(this.wordDocRadioBtn);
     this.groupBox1.Controls.Add(this.pdfRadioBtn);
     this.groupBox1.Font     = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox1.Location = new System.Drawing.Point(12, 150);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(209, 41);
     this.groupBox1.TabIndex = 101;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Save As";
     //
     // worddocxRadioBtn
     //
     this.wordDocxRadioBtn.BeforeTouchSize = new System.Drawing.Size(52, 20);
     this.wordDocxRadioBtn.Border3DStyle   = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.wordDocxRadioBtn.Checked         = true;
     this.wordDocxRadioBtn.Font            = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.wordDocxRadioBtn.GradientEnd     = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
     this.wordDocxRadioBtn.GradientStart   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.wordDocxRadioBtn.Location        = new System.Drawing.Point(83, 18);
     this.wordDocxRadioBtn.MetroColor      = System.Drawing.Color.Empty;
     this.wordDocxRadioBtn.Name            = "wordDocxRadioBtn";
     this.wordDocxRadioBtn.Size            = new System.Drawing.Size(52, 20);
     this.wordDocxRadioBtn.TabIndex        = 103;
     this.wordDocxRadioBtn.Text            = "DOCX";
     this.wordDocxRadioBtn.ThemesEnabled   = true;
     //
     // worddocRadioBtn
     //
     this.wordDocRadioBtn.BeforeTouchSize = new System.Drawing.Size(48, 20);
     this.wordDocRadioBtn.Border3DStyle   = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.wordDocRadioBtn.Font            = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
     this.wordDocRadioBtn.GradientEnd     = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
     this.wordDocRadioBtn.GradientStart   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.wordDocRadioBtn.Location        = new System.Drawing.Point(6, 18);
     this.wordDocRadioBtn.MetroColor      = System.Drawing.Color.Empty;
     this.wordDocRadioBtn.Name            = "wordDocRadioBtn";
     this.wordDocRadioBtn.Size            = new System.Drawing.Size(48, 20);
     this.wordDocRadioBtn.TabIndex        = 44;
     this.wordDocRadioBtn.Text            = "DOC";
     this.wordDocRadioBtn.ThemesEnabled   = true;
     //
     // pdfRadioBtn
     //
     this.pdfRadioBtn.BeforeTouchSize = new System.Drawing.Size(45, 20);
     this.pdfRadioBtn.Border3DStyle   = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.pdfRadioBtn.Font            = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
     this.pdfRadioBtn.GradientEnd     = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
     this.pdfRadioBtn.GradientStart   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.pdfRadioBtn.Location        = new System.Drawing.Point(164, 18);
     this.pdfRadioBtn.MetroColor      = System.Drawing.Color.Empty;
     this.pdfRadioBtn.Name            = "pdfRadioBtn";
     this.pdfRadioBtn.Size            = new System.Drawing.Size(45, 20);
     this.pdfRadioBtn.TabIndex        = 45;
     this.pdfRadioBtn.Text            = "PDF";
     this.pdfRadioBtn.ThemesEnabled   = true;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
     this.BackColor         = System.Drawing.Color.White;
     this.BorderColor       = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
     this.ClientSize        = new System.Drawing.Size(365, 219);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.pictureBox1);
     this.Controls.Add(this.button1);
     this.DropShadow      = true;
     this.Font            = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.Name            = "Form1";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "Format Text";
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     this.groupBox1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.wordDocxRadioBtn)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.wordDocRadioBtn)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.pdfRadioBtn)).EndInit();
     this.ResumeLayout(false);
 }
Example #50
0
        private static void GetQuickFiller(PictureBox pb, TrainerPoke pk)
        {
            var rawImg = SpriteBuilder.GetSprite(pk.Species, pk.Form, pk.Gender, pk.HeldItem, false, pk.Shiny);

            pb.Image = ImageUtil.ScaleImage((Bitmap)rawImg, 2);
        }
Example #51
0
 private void InitializeComponent()
 {
     this.pictureBox1   = new PictureBox();
     this.kryptonPanel1 = new KryptonPanel();
     this.lbinfo        = new KryptonLabel();
     this.btnCancel     = new KryptonButton();
     this.btnConfirm    = new KryptonButton();
     ((ISupportInitialize)this.pictureBox1).BeginInit();
     ((ISupportInitialize)this.kryptonPanel1).BeginInit();
     this.kryptonPanel1.SuspendLayout();
     base.SuspendLayout();
     this.pictureBox1.BackColor = Color.Transparent;
     this.pictureBox1.Dock      = DockStyle.Left;
     this.pictureBox1.Image     = global::Properties.Resource.CLEAN;
     this.pictureBox1.Location  = new Point(0, 0);
     this.pictureBox1.Name      = "pictureBox1";
     this.pictureBox1.Size      = new Size(86, 90);
     this.pictureBox1.SizeMode  = PictureBoxSizeMode.Zoom;
     this.pictureBox1.TabIndex  = 0;
     this.pictureBox1.TabStop   = false;
     this.kryptonPanel1.Controls.Add(this.lbinfo);
     this.kryptonPanel1.Controls.Add(this.btnCancel);
     this.kryptonPanel1.Controls.Add(this.btnConfirm);
     this.kryptonPanel1.Controls.Add(this.pictureBox1);
     this.kryptonPanel1.Dock                   = DockStyle.Fill;
     this.kryptonPanel1.Location               = new Point(0, 0);
     this.kryptonPanel1.Name                   = "kryptonPanel1";
     this.kryptonPanel1.Size                   = new Size(375, 90);
     this.kryptonPanel1.StateCommon.Color1     = Color.White;
     this.kryptonPanel1.StateCommon.ColorStyle = PaletteColorStyle.SolidAllLine;
     this.kryptonPanel1.TabIndex               = 1;
     this.lbinfo.Location        = new Point(94, 12);
     this.lbinfo.Name            = "lbinfo";
     this.lbinfo.Size            = new Size(269, 20);
     this.lbinfo.TabIndex        = 3;
     this.lbinfo.Values.Text     = "是否确认清空用户所有填报数据,并初始化?";
     this.btnCancel.Location     = new Point(273, 53);
     this.btnCancel.Name         = "btnCancel";
     this.btnCancel.Size         = new Size(90, 25);
     this.btnCancel.TabIndex     = 2;
     this.btnCancel.Values.Text  = "取消";
     this.btnCancel.Click       += new EventHandler(this.btnCancel_Click);
     this.btnConfirm.Location    = new Point(166, 53);
     this.btnConfirm.Name        = "btnConfirm";
     this.btnConfirm.Size        = new Size(90, 25);
     this.btnConfirm.TabIndex    = 1;
     this.btnConfirm.Values.Text = "确认";
     this.btnConfirm.Click      += new EventHandler(this.btnConfirm_Click);
     base.AutoScaleDimensions    = new SizeF(6f, 12f);
     ////base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(375, 90);
     base.Controls.Add(this.kryptonPanel1);
     //base.FormBorderStyle = FormBorderStyle.None;
     base.Name          = "frmClear";
     base.StartPosition = FormStartPosition.CenterScreen;
     this.Text          = "frmClear";
     ((ISupportInitialize)this.pictureBox1).EndInit();
     ((ISupportInitialize)this.kryptonPanel1).EndInit();
     this.kryptonPanel1.ResumeLayout(false);
     this.kryptonPanel1.PerformLayout();
     base.ResumeLayout(false);
 }
Example #52
0
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(frmUpdate));

            this.pbImage     = new PictureBox();
            this.btnNo       = new Button();
            this.txtMessage  = new RichTextBox();
            this.lblHint     = new Label();
            this.btnNow      = new Button();
            this.btnNextTime = new Button();
            ((ISupportInitialize)this.pbImage).BeginInit();
            base.SuspendLayout();
            this.pbImage.Image            = (Image)Properties.Resources.pbImage_Image; //manager.GetObject("pbImage.Image");
            this.pbImage.Location         = new Point(8, 8);
            this.pbImage.Name             = "pbImage";
            this.pbImage.Size             = new Size(0x20, 0x20);
            this.pbImage.SizeMode         = PictureBoxSizeMode.CenterImage;
            this.pbImage.TabIndex         = 0;
            this.pbImage.TabStop          = false;
            this.btnNo.Anchor             = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnNo.DialogResult       = DialogResult.Cancel;
            this.btnNo.Location           = new Point(0x152, 0xe0);
            this.btnNo.Name               = "btnNo";
            this.btnNo.Size               = new Size(0x5c, 0x17);
            this.btnNo.TabIndex           = 2;
            this.btnNo.Text               = "&No";
            this.btnNo.Click             += new EventHandler(this.btnOk_Click);
            this.txtMessage.Anchor        = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.txtMessage.BackColor     = SystemColors.Control;
            this.txtMessage.BorderStyle   = BorderStyle.None;
            this.txtMessage.Location      = new Point(0x30, 8);
            this.txtMessage.Name          = "txtMessage";
            this.txtMessage.ReadOnly      = true;
            this.txtMessage.Size          = new Size(0x180, 0xb8);
            this.txtMessage.TabIndex      = 3;
            this.txtMessage.Text          = manager.GetString("txtMessage.Text");
            this.txtMessage.LinkClicked  += new LinkClickedEventHandler(this.txtMessage_LinkClicked);
            this.lblHint.Anchor           = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            this.lblHint.BackColor        = SystemColors.Highlight;
            this.lblHint.Font             = new Font("Tahoma", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.lblHint.ForeColor        = SystemColors.HighlightText;
            this.lblHint.Location         = new Point(3, 0xc3);
            this.lblHint.Name             = "lblHint";
            this.lblHint.Size             = new Size(0x1ab, 0x1a);
            this.lblHint.TabIndex         = 4;
            this.lblHint.Text             = "Would you like to install this update?";
            this.lblHint.TextAlign        = ContentAlignment.MiddleCenter;
            this.btnNow.Anchor            = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnNow.DialogResult      = DialogResult.Yes;
            this.btnNow.Location          = new Point(0x30, 0xe0);
            this.btnNow.Name              = "btnNow";
            this.btnNow.Size              = new Size(0x88, 0x17);
            this.btnNow.TabIndex          = 5;
            this.btnNow.Text              = "&Yes";
            this.btnNow.Click            += new EventHandler(this.btnOk_Click);
            this.btnNextTime.Anchor       = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnNextTime.DialogResult = DialogResult.Retry;
            this.btnNextTime.Location     = new Point(190, 0xe0);
            this.btnNextTime.Name         = "btnNextTime";
            this.btnNextTime.Size         = new Size(140, 0x17);
            this.btnNextTime.TabIndex     = 6;
            this.btnNextTime.Text         = "Next &Time";
            this.btnNextTime.Click       += new EventHandler(this.btnOk_Click);
            this.AutoScaleBaseSize        = new Size(5, 14);
            base.CancelButton             = this.btnNo;
            base.ClientSize               = new Size(440, 250);
            base.Controls.Add(this.btnNextTime);
            base.Controls.Add(this.btnNow);
            base.Controls.Add(this.lblHint);
            base.Controls.Add(this.txtMessage);
            base.Controls.Add(this.btnNo);
            base.Controls.Add(this.pbImage);
            this.Font            = new Font("Tahoma", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            base.FormBorderStyle = FormBorderStyle.SizableToolWindow;
            base.Icon            = (Icon)Properties.Resources.sbpCapture_Icon;//manager.GetObject("$this.Icon");
            base.KeyPreview      = true;
            this.MinimumSize     = new Size(0x1a9, 150);
            base.Name            = "frmUpdate";
            base.SizeGripStyle   = SizeGripStyle.Hide;
            base.StartPosition   = FormStartPosition.Manual;
            this.Text            = " Fiddler Update";
            base.KeyDown        += new KeyEventHandler(this.frmAlert_KeyDown);
            ((ISupportInitialize)this.pbImage).EndInit();
            base.ResumeLayout(false);
        }
Example #53
0
        /// <summary>
        /// OYUN TÝMER FONKSÝYONU
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tmrGame_Tick(object sender, EventArgs e)
        {
            iValTmrEnergyLoss++;


            Random rnd = new Random();

            // Topa en yakýn oyuncuyu bul ve topa yönlendir
            vfnFindTheClosestPlayer(pbxBall.Location);

            // Tüm oyuncular için default yönelme durumu rastgele olarak ayarlanýyor
            foreach (Control cnt in this.Controls)
            {
                if (cnt is PictureBox)
                {
                    PictureBox pbx = cnt as PictureBox;

                    int off_x = rnd.Next(0, 2);
                    int off_y = rnd.Next(0, 2);

                    // Top haricindeki tüm picturebox bileþenleri futbolcudur
                    if (pbx.Name != pbxBall.Name)
                    {
                        // Topa yönlenme vektörü
                        int devX = pbxBall.Location.X - pbx.Location.X;
                        int devY = pbxBall.Location.Y - pbx.Location.Y;


                        // Kaleciler kaleye yakýn konumlansýn
                        //if (pbx.Name == pbxGKLeft.Name)
                        //{
                        //    devX = (GoalLeft.Bounds.Right) - pbx.Location.X;
                        //    devY = (GoalLeft.Location.Y + GoalLeft.Height / 2) - pbx.Location.Y;

                        //    off_x = 1;
                        //    off_y = 1;

                        //}
                        //// Kaleciler kaleye yakýn konumlansýn
                        //if (pbx.Name == pbxGKRight.Name)
                        //{
                        //    devX = (GoalRight.Bounds.Left - pbx.Width) - pbx.Location.X;
                        //    devY = (GoalRight.Location.Y + GoalRight.Height / 2) - pbx.Location.Y;

                        //    off_x = 1;
                        //    off_y = 1;

                        //}

                        // Topa yakýn olmayan tüm futbolcular topa doðru rand(0,2) kadar yaklaþýyor
                        pbx.Location = new Point(pbx.Location.X + Math.Sign(devX) * off_x, pbx.Location.Y + Math.Sign(devY) * off_y);

                        // Konumlar güncelleniyor
                        vfnUpdateList(pbx);
                    }
                }
            }



            // Hamle için rasgele deðiþken
            Random rndAct  = new Random();
            int    iRndAct = 0;

            // ----------------- PLAYER LEFT ---------------------------------
            //
            #region PLAYER LEFT TIMER EVENTS
            foreach (PictureBox pbx in lstPlayersLeft)
            {
                // Top P1(Left) oyuncularýnda ise
                if (pbx.Bounds.IntersectsWith(pbxBall.Bounds) && blnLeftHasTheBall == false)
                {
                    blnLeftHasTheBall = true;


                    // 0-20 arasýnda rastgele sayý seçiliyor
                    // Öncelik: Shoot ise
                    // 0-10 arasý Shoot
                    // 10-15 arasý Pass
                    // 15-20 arasý Dribbling
                    // always: checked ise 0-20 arasý Shoot

                    bool    rangeShoot = false, rangePass = false, rangeDribbling = false;
                    CPlayer selectedPlayer = dctPbxVSPlayer[pbx];
                    selectedPlayerAtThisMoment = selectedPlayer;
                    iRndAct = rndAct.Next(0, 20);



                    // Eðer kullanýcýnýn oyuncusuna top geldiyse
                    if (pbxUser != null)
                    {
                        if (pbx.Name == pbxUser.Name)
                        {
                            if (blnUserPass)
                            {
                                selectedPlayer.blnAlways = true;
                                selectedPlayer.Priority  = EPriority.Pass;
                            }
                            else if (blnUserShoot)
                            {
                                selectedPlayer.blnAlways = true;
                                selectedPlayer.Priority  = EPriority.Shoot;
                            }
                            else if (blnUserDribble)
                            {
                                selectedPlayer.blnAlways = true;
                                selectedPlayer.Priority  = EPriority.Dribbling;
                            }
                        }
                    }


                    // Önceliðe göre aralýklar belirleniyor
                    switch (selectedPlayer.Priority)
                    {
                    case EPriority.Dribbling:
                        rangeDribbling = (iRndAct < 11);
                        rangePass      = (iRndAct >= 11) && (iRndAct < 16);
                        rangeShoot     = (iRndAct >= 16);

                        if (selectedPlayer.blnAlways)
                        {
                            rangeDribbling = true;
                            rangePass      = rangeShoot = false;
                        }

                        break;

                    case EPriority.Pass:
                        rangePass      = (iRndAct < 11);
                        rangeDribbling = (iRndAct >= 11) && (iRndAct < 16);
                        rangeShoot     = (iRndAct >= 16);

                        if (selectedPlayer.blnAlways)
                        {
                            rangePass      = true;
                            rangeDribbling = rangeShoot = false;
                        }
                        break;

                    case EPriority.Shoot:
                        rangeShoot     = (iRndAct < 11);
                        rangePass      = (iRndAct >= 11) && (iRndAct < 16);
                        rangeDribbling = (iRndAct >= 16);

                        if (selectedPlayer.blnAlways)
                        {
                            rangeShoot     = true;
                            rangeDribbling = rangePass = false;
                        }
                        break;

                    default:
                        break;
                    }



                    // kaleci ile arasýnda rakip yoksa þut çek
                    int nOfRightPlayer = 0, nOfPlayerInTriangle = 0;
                    foreach (PictureBox var in lstPlayersRight)
                    {
                        if (pbx.Bounds.Left > var.Bounds.Left)
                        {
                            nOfRightPlayer++;
                        }

                        if (PointInTriangle(var.Location, pbx.Location, GoalRight.Location, new Point(GoalRight.Location.X, GoalRight.Location.Y + GoalRight.Height)))
                        {
                            nOfPlayerInTriangle++;
                        }
                    }


                    // Geride en az 5 kiþi kalmýþsa VEYA
                    // Kaleyi gördüðü noktada en fazla bir kiþi varsa top sür ya da þut çek
                    if (nOfRightPlayer >= 5 || nOfPlayerInTriangle <= 1)
                    {
                        if (selectedPlayer.Priority != EPriority.Dribbling)
                        {
                            rangeShoot = true;
                        }
                        else
                        {
                            rangeDribbling = true;
                        }
                    }


                    // SHOOT
                    if (rangeShoot)
                    {
                        pbxBall.Location = new Point(pbx.Location.X + pbx.Width, pbx.Location.Y);

                        ballDevX = Math.Sign(GoalRight.Location.X - pbx.Location.X) * 7 * (int)selectedPlayer.Power;
                        ballDevY = Math.Sign((GoalRight.Location.Y + GoalRight.Height / 2) - pbx.Location.Y) * rnd.Next(1, 7) * (int)selectedPlayer.Power;

                        selectedPlayer.nOfShoot++;
                    }
                    // PASS
                    else if (rangePass)
                    {
                        // kendi haricinde rasgele bir takým arkadaþý seçiliyor
                        int rndIdx = rndAct.Next(lstPlayersLeft.Count);
                        if (lstPlayersLeft[rndIdx].Name == pbx.Name)
                        {
                            rndIdx = (rndIdx + 1) % lstPlayersLeft.Count;
                        }

                        int unitVectorX = Math.Sign(lstPlayersLeft[rndIdx].Location.X - pbx.Location.X);
                        int unitVectorY = Math.Sign(lstPlayersLeft[rndIdx].Location.Y - pbx.Location.Y);

                        pbxBall.Location = new Point(pbx.Location.X + pbx.Width * (unitVectorX), pbx.Location.Y + pbx.Height * (unitVectorY));

                        ballDevX = unitVectorX * 4 * (int)selectedPlayer.Power;
                        ballDevY = unitVectorY * 4 * (int)selectedPlayer.Power;

                        selectedPlayer.nOfPass++;
                    }
                    // DRIBBLING
                    else if (rangeDribbling)
                    {
                        int unitVectorX = Math.Sign(GoalRight.Location.X - pbx.Location.X);
                        int unitVectorY = Math.Sign(GoalRight.Location.Y - pbx.Location.Y);

                        pbxBall.Location = new Point(pbx.Location.X + pbx.Width * (unitVectorX), pbx.Location.Y + pbx.Height * (unitVectorY));

                        // Dribbling
                        ballDevX = unitVectorX * rndAct.Next(3, 7);
                        ballDevY = unitVectorY * rndAct.Next(2, 5);

                        selectedPlayer.nOfDribble++;

                        // Belli bir mesafe katedilince þut çek
                        if (pbx.Bounds.Right > this.Width * 4 / 5)
                        {
                            pbxBall.Location = new Point(pbx.Location.X + pbx.Width, pbx.Location.Y);

                            ballDevX = Math.Sign(GoalRight.Location.X - pbx.Location.X) * 7 * (int)selectedPlayer.Power;
                            ballDevY = Math.Sign((GoalRight.Location.Y + GoalRight.Height / 2) - pbx.Location.Y) * rnd.Next(1, 7) * (int)selectedPlayer.Power;

                            selectedPlayer.nOfShoot++;
                        }
                    }
                }
                else
                {
                    blnLeftHasTheBall = false;
                }
            }
            #endregion


            // ----------------- PLAYER RIGHT ---------------------------------
            //


            #region PLAYER RIGHT TIMER EVENTS
            foreach (PictureBox pbx in lstPlayersRight)
            {
                if (pbx.Bounds.IntersectsWith(pbxBall.Bounds) && blnRightHasTheBall == false)
                {
                    blnRightHasTheBall = true;


                    // 0-20 arasýnda rastgele sayý seçiliyor
                    // Öncelik: Shoot ise
                    // 0-10 arasý Shoot
                    // 10-15 arasý Pass
                    // 15-20 arasý Dribbling
                    // always: checked ise 0-20 arasý Shoot

                    bool    rangeShoot = false, rangePass = false, rangeDribbling = false;
                    CPlayer selectedPlayer = dctPbxVSPlayer[pbx];
                    selectedPlayerAtThisMoment = selectedPlayer;
                    iRndAct = rndAct.Next(0, 20);

                    switch (selectedPlayer.Priority)
                    {
                    case EPriority.Dribbling:
                        rangeDribbling = (iRndAct < 11);
                        rangePass      = (iRndAct >= 11) && (iRndAct < 16);
                        rangeShoot     = (iRndAct >= 16);

                        if (selectedPlayer.blnAlways)
                        {
                            rangeDribbling = true;
                            rangePass      = rangeShoot = false;
                        }

                        break;

                    case EPriority.Pass:
                        rangePass      = (iRndAct < 11);
                        rangeDribbling = (iRndAct >= 11) && (iRndAct < 16);
                        rangeShoot     = (iRndAct >= 16);

                        if (selectedPlayer.blnAlways)
                        {
                            rangePass      = true;
                            rangeDribbling = rangeShoot = false;
                        }
                        break;

                    case EPriority.Shoot:
                        rangeShoot     = (iRndAct < 11);
                        rangePass      = (iRndAct >= 11) && (iRndAct < 16);
                        rangeDribbling = (iRndAct >= 16);

                        if (selectedPlayer.blnAlways)
                        {
                            rangeShoot     = true;
                            rangeDribbling = rangePass = false;
                        }
                        break;

                    default:
                        break;
                    }


                    // kaleci ile arasýnda rakip yoksa þut çek
                    int nOfLeftPlayer = 0, nOfPlayerInTriangle = 0;
                    foreach (PictureBox var in lstPlayersLeft)
                    {
                        if (pbx.Bounds.Left < var.Bounds.Left)
                        {
                            nOfLeftPlayer++;
                        }

                        if (PointInTriangle(var.Location, pbx.Location, GoalLeft.Location, new Point(GoalLeft.Location.X, GoalLeft.Location.Y + GoalRight.Height)))
                        {
                            nOfPlayerInTriangle++;
                        }
                    }

                    //Console.WriteLine("nOfLeftPlayer:" + nOfLeftPlayer + "\t PlayerInTriangle: " + nOfPlayerInTriangle);

                    // Geride en az 5 kiþi kalmýþsa þut çek
                    if (nOfLeftPlayer >= 5)
                    {
                        rangeDribbling = true;
                        rangePass      = rangeShoot = false;
                    }

                    // Kaleyi gördüðü noktada en fazla bir kiþi varsa þut çek
                    if (nOfPlayerInTriangle <= 1)
                    {
                        rangeShoot = true;
                    }


                    // SHOOT
                    if (rangeShoot)
                    {
                        pbxBall.Location = new Point(pbx.Location.X - pbx.Width, pbx.Location.Y);

                        ballDevX = Math.Sign(GoalLeft.Location.X - pbx.Location.X) * 7 * (int)selectedPlayer.Power;
                        ballDevY = Math.Sign((GoalLeft.Location.Y + GoalLeft.Height / 2) - pbx.Location.Y) * rnd.Next(1, 7) * (int)selectedPlayer.Power;


                        selectedPlayer.nOfShoot++;
                    }

                    // PASS
                    else if (rangePass)
                    {
                        int rndIdx = rndAct.Next(lstPlayersRight.Count);
                        if (lstPlayersRight[rndIdx].Name == pbx.Name)
                        {
                            rndIdx = (rndIdx + 1) % lstPlayersRight.Count;
                        }

                        int unitVectorX = Math.Sign(lstPlayersRight[rndIdx].Location.X - pbx.Location.X);
                        int unitVectorY = Math.Sign(lstPlayersRight[rndIdx].Location.Y - pbx.Location.Y);

                        pbxBall.Location = new Point(pbx.Location.X + pbx.Width * (unitVectorX), pbx.Location.Y + pbx.Height * (unitVectorY));

                        ballDevX = unitVectorX * 4 * (int)selectedPlayer.Power;
                        ballDevY = unitVectorY * 4 * (int)selectedPlayer.Power;

                        selectedPlayer.nOfPass++;
                    }

                    // DRIBBLING
                    else if (rangeDribbling)
                    {
                        int unitVectorX = Math.Sign(GoalLeft.Location.X - pbx.Location.X);
                        int unitVectorY = Math.Sign(GoalLeft.Location.Y - pbx.Location.Y);

                        pbxBall.Location = new Point(pbx.Location.X + pbx.Width * (unitVectorX), pbx.Location.Y + pbx.Height * (unitVectorY));

                        // Dribbling
                        ballDevX = unitVectorX * rndAct.Next(3, 7);
                        ballDevY = unitVectorY * rndAct.Next(2, 5);

                        selectedPlayer.nOfDribble++;

                        // Belli bir mesafe katedilince þut çek
                        if (pbx.Bounds.Left < this.Width * 1 / 5)
                        {
                            pbxBall.Location = new Point(pbx.Location.X - pbx.Width, pbx.Location.Y);

                            ballDevX = Math.Sign(GoalLeft.Location.X - pbx.Location.X) * 7 * (int)selectedPlayer.Power;
                            ballDevY = Math.Sign((GoalLeft.Location.Y + GoalLeft.Height / 2) - pbx.Location.Y) * rnd.Next(1, 7) * (int)selectedPlayer.Power;

                            selectedPlayer.nOfShoot++;
                        }
                    }
                }
                else
                {
                    blnRightHasTheBall = false;
                }
            }
            #endregion


            // Direkten dönme durumu
            if (pbxBall.Bounds.IntersectsWith(lblLeftPost1.Bounds))
            {
                lblLeftPost1.BackColor = Color.White;
            }
            else
            {
                lblLeftPost1.BackColor = Color.ForestGreen;
            }

            if (pbxBall.Bounds.IntersectsWith(lblLeftPost2.Bounds))
            {
                lblLeftPost2.BackColor = Color.White;
            }
            else
            {
                lblLeftPost2.BackColor = Color.ForestGreen;
            }


            if (pbxBall.Bounds.IntersectsWith(lblRightPost1.Bounds))
            {
                lblRightPost1.BackColor = Color.White;
            }
            else
            {
                lblRightPost1.BackColor = Color.SteelBlue;
            }

            if (pbxBall.Bounds.IntersectsWith(lblRightPost2.Bounds))
            {
                lblRightPost2.BackColor = Color.White;
            }
            else
            {
                lblRightPost2.BackColor = Color.SteelBlue;
            }



            // Gol olma durumu (Right Scored)
            //if (pbxBall.Bounds.IntersectsWith(GoalLeft.Bounds))
            //if (pbxBall.Bounds.Right < GoalLeft.Bounds.Left)
            if (pbxBall.Bounds.Right < lblLeftBound.Bounds.Left)
            {
                blnGoalScored = true;
                FSK           = 2;

                //ballDevX = 0;
                //ballDevY = 0;
                //pbxBall.Location = new Point(GoalLeft.Bounds.Right + 1, pbxBall.Location.Y);
                //pbxBall.Location = new Point(this.Width/2, this.Height/2);

                //GoalLeft.BackColor = Color.Red;

                rightScored++;
                selectedPlayerAtThisMoment.nOfGoal++;

                lblScoreLeft.Text  = leftScored.ToString();
                lblScoreRight.Text = rightScored.ToString();
                lblGoal.ForeColor  = Color.SteelBlue;
                lblGoal.Visible    = true;

                tmrGame.Stop();
                tmrGoalScored.Start();
            }
            else
            {
                GoalLeft.BackColor = Color.Transparent;
            }

            // Gol olma durumu (Left Scored)
            //if (pbxBall.Bounds.IntersectsWith(GoalRight.Bounds))
            //if (pbxBall.Bounds.Left > GoalRight.Bounds.Right)
            if (pbxBall.Bounds.Left > lblRightBound.Bounds.Right)
            {
                blnGoalScored = true;
                FSK           = 2;

                //ballDevX = 0;
                //ballDevY = 0;
                //pbxBall.Location = new Point(GoalRight.Bounds.Left - pbxBall.Width - 1, pbxBall.Location.Y);


                //GoalRight.BackColor = Color.Red;

                leftScored++;
                selectedPlayerAtThisMoment.nOfGoal++;

                lblScoreLeft.Text  = leftScored.ToString();
                lblScoreRight.Text = rightScored.ToString();
                lblGoal.ForeColor  = Color.ForestGreen;
                lblGoal.Visible    = true;

                tmrGame.Stop();
                tmrGoalScored.Start();
            }
            else
            {
                GoalRight.BackColor = Color.Transparent;
            }



            this.Update();
        }
Example #54
0
        public F_Main()
        {
            InitializeComponent();



            F_Settings fSettings = new F_Settings();

            fSettings.ShowDialog();

            pLeftGK  = fSettings.pLeftGK;
            pLeftLB  = fSettings.pLeftLB;
            pLeftRB  = fSettings.pLeftRB;
            pLeftDMF = fSettings.pLeftDMF;
            pLeftLF  = fSettings.pLeftLF;
            pLeftRF  = fSettings.pLeftRF;


            tmrGame.Interval = 30;
            tmrGame.Tick    += new EventHandler(tmrGame_Tick);
            tmrGame.Start();


            tmrBall.Interval = 30;
            tmrBall.Tick    += new EventHandler(tmrBall_Tick);
            tmrBall.Start();


            tmrGoalScored.Interval = 1000;
            tmrGoalScored.Tick    += new EventHandler(tmrGoalScored_Tick);


            tmrEnergyLoss.Interval = 1000;
            tmrEnergyLoss.Tick    += new EventHandler(tmrEnergyGain_Tick);



            vfnInitializePlayers();



            // P1 oyuncularýný listeye ekle
            lstPlayersLeft.Add(pbxGKLeft);
            lstPlayersLeft.Add(pbxLBLeft);
            lstPlayersLeft.Add(pbxRBLeft);
            lstPlayersLeft.Add(pbxDMFLeft);
            lstPlayersLeft.Add(pbxLFLeft);
            lstPlayersLeft.Add(pbxRFLeft);
            // P1 oyuncularý kütüphanesi
            dctPbxVSPlayer.Add(pbxGKLeft, pLeftGK);
            dctPbxVSPlayer.Add(pbxLBLeft, pLeftLB);
            dctPbxVSPlayer.Add(pbxRBLeft, pLeftRB);
            dctPbxVSPlayer.Add(pbxDMFLeft, pLeftDMF);
            dctPbxVSPlayer.Add(pbxLFLeft, pLeftLF);
            dctPbxVSPlayer.Add(pbxRFLeft, pLeftRF);


            // P2 oyuncularýný listeye ekle
            lstPlayersRight.Add(pbxGKRight);
            lstPlayersRight.Add(pbxLBRight);
            lstPlayersRight.Add(pbxRBRight);
            lstPlayersRight.Add(pbxDMFRight);
            lstPlayersRight.Add(pbxLFRight);
            lstPlayersRight.Add(pbxRFRight);
            // P2 oyuncularý kütüphanesi
            dctPbxVSPlayer.Add(pbxGKRight, pRightGK);
            dctPbxVSPlayer.Add(pbxLBRight, pRightLB);
            dctPbxVSPlayer.Add(pbxRBRight, pRightRB);
            dctPbxVSPlayer.Add(pbxDMFRight, pRightDMF);
            dctPbxVSPlayer.Add(pbxLFRight, pRightLF);
            dctPbxVSPlayer.Add(pbxRFRight, pRightRF);



            foreach (PictureBox var in lstPlayersLeft)
            {
                lstOrgListOfPlayersLeft.Add(var.Location);
            }


            foreach (PictureBox var in lstPlayersRight)
            {
                lstOrgListOfPlayersRight.Add(var.Location);
            }


            // Picturebox eventleri
            foreach (Control cnt in this.Controls)
            {
                if (cnt is PictureBox)
                {
                    PictureBox pbx = cnt as PictureBox;


                    pbx.MouseMove  += new MouseEventHandler(pbx_MouseMove);
                    pbx.MouseLeave += new EventHandler(pbx_MouseLeave);
                    pbx.MouseClick += new MouseEventHandler(pbx_MouseClick);
                }
            }
        }
Example #55
0
        public void DisplayErrForm(TextBox _tbName, TextBox _tbEnum, TextBox _tbAction, TextBox _tbErrMsg, PictureBox _pbErr)
        {
            //Local Var.
            string Temp, Str;
            int    iRect;
            int    Cnt, iCount;
            char   CChar;
            int    iErrNo;
            int    iPicWidth;
            int    iPicHeight;

            iPicWidth  = _pbErr.Width;
            iPicHeight = _pbErr.Height;

            iErrNo = GetLastErr();


            if (m_aErr[iErrNo].Para.sImgPath != "")
            {
                fi = new FileInfo(m_aErr[iErrNo].Para.sImgPath);
            }

            //Set Caption.
            Temp = string.Format("ERR{0:000}", iErrNo);
            //_tbErrNo . Text = Temp;

            _tbName.Text = m_aErr[iErrNo].Para.sName;
            _tbEnum.Text = m_aErr[iErrNo].Para.sEnum;
            //_tbAction. Text = m_aErr[iErrNo].Para.sAction;
            _tbErrMsg.Text = m_aErr[iErrNo].Stat.sSubMsg;

            //Display Solution
            String[] sSplit = m_aErr[iErrNo].Para.sAction.Split('$');
            _tbAction.Clear();
            foreach (var i in sSplit)
            {
                _tbAction.Text += i.ToString().Trim() + "\r\n";
            }

            Temp = m_aErr[iErrNo].Para.sImgPath;
            if (m_aErr[iErrNo].Para.sImgPath == "" || !fi.Exists)
            {
                _pbErr.Visible = false;
            }
            else if (fi.Exists)
            {
                _pbErr.Visible = true;
                _pbErr.Image   = Image.FromFile(Temp);
            }


            //m_aErr[iErrNo].Para.sErrMsg = "";
        }
Example #56
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
     byte[] arayTmp = new byte[17];
     for (byte i = 0; i < 17; i++)
     {
         arayTmp[i] = i;
     }
     if (tabControl1.SelectedIndex == 0)
     {
         arayTmp[0]  = 0;
         arayTmp[8]  = 0;
         arayTmp[9]  = 0;
         arayTmp[10] = 0;
         for (int i = 0; i < 7; i++)
         {
             PictureBox temp = this.Controls.Find("PMain" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
         if (DeviceType != 179)
         {
             arayTmp[7] = 0;
         }
     }
     else if (tabControl1.SelectedIndex == 1)
     {
         arayTmp[0] = 1;
         for (int i = 0; i < 6; i++)
         {
             PictureBox temp = this.Controls.Find("PL" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     else if (tabControl1.SelectedIndex == 2)
     {
         arayTmp[0] = 2;
         for (int i = 0; i < 9; i++)
         {
             PictureBox temp = this.Controls.Find("PA" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     else if (tabControl1.SelectedIndex == 3)
     {
         arayTmp[0] = 3;
         for (int i = 0; i < 6; i++)
         {
             PictureBox temp = this.Controls.Find("PC" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     else if (tabControl1.SelectedIndex == 4)
     {
         arayTmp[0] = 4;
         for (int i = 0; i < 9; i++)
         {
             PictureBox temp = this.Controls.Find("PH" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     else if (tabControl1.SelectedIndex == 5)
     {
         arayTmp[0] = 5;
         for (int i = 0; i < 9; i++)
         {
             PictureBox temp = this.Controls.Find("PM" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     else if (tabControl1.SelectedIndex == 6)
     {
         arayTmp[0] = 6;
         for (int i = 0; i < 2; i++)
         {
             PictureBox temp = this.Controls.Find("PS" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     else if (tabControl1.SelectedIndex == 7)
     {
         arayTmp[0] = 7;
         for (int i = 0; i < 4; i++)
         {
             PictureBox temp = this.Controls.Find("PR" + (i + 1).ToString(), true)[0] as PictureBox;
             arayTmp[i + 1] = Convert.ToByte(temp.Image.Tag);
         }
     }
     if (CsConst.mySends.AddBufToSndList(arayTmp, 0x19B4, SubnetID, DeviceID, false, true, true, CsConst.minAllWirelessDeviceType.Contains(DeviceType)) == false)
     {
         Cursor.Current = Cursors.Default;
         return;
     }
     Cursor.Current = Cursors.Default;
 }
        private void CreateControls()
        {
            Texture2D leftTexture = Game.Content.Load<Texture2D>(@"GUI\leftarrowUp");
            Texture2D rightTexture = Game.Content.Load<Texture2D>(@"GUI\rightarrowUp");
            Texture2D stopTexture = Game.Content.Load<Texture2D>(@"GUI\StopBar");

            backgroundImage = new PictureBox(
                Game.Content.Load<Texture2D>(@"Backgrounds\titlescreen"),
                GameRef.ScreenRectangle);

            ControlManager.Add(backgroundImage);

            Label label1 = new Label
            {
                Text = "Who will search for the Eyes of the Dragon?"
            };
            label1.Size = label1.SpriteFont.MeasureString(label1.Text);
            label1.Position = new Vector2(
                (GameRef.Window.ClientBounds.Width - label1.Size.X) /2, 150);

            ControlManager.Add(label1);

            nameSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            nameSelector.SetItems(maleName, 125);
            nameSelector.Position = new Vector2(label1.Position.X, 200);

            ControlManager.Add(nameSelector);

            genderSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            genderSelector.SetItems(genderItems, 125);
            genderSelector.Position = new Vector2(label1.Position.X, 250);
            genderSelector.SelectionChanged += GenderSelector_SelectionChanged;

            ControlManager.Add(genderSelector);

            classSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            classSelector.SetItems(classItems, 125);
            classSelector.Position = new Vector2(label1.Position.X, 300);
            classSelector.SelectionChanged += ClassSelector_SelectionChanged;

            ControlManager.Add(classSelector);

            LinkLabel linkLabel1 = new LinkLabel
            {
                Text = "Accept this character.",
                Position = new Vector2(label1.Position.X, 350)
            };

            linkLabel1.Selected += new EventHandler(LinkLabel1_Selected);

            ControlManager.Add(linkLabel1);

            characterImage = new PictureBox(
                characterImages[0, 0],
                new Rectangle(600, 200, 96, 96),
                new Rectangle(0, 0, 32, 32));

            ControlManager.Add(characterImage);

            ControlManager.NextControl();
        }
Example #58
0
        public void ShowDialog()
        {
            f = new Form()
            {
                Width       = 400,
                Height      = 420,
                MaximizeBox = false,
                // BackColor = Color.Azure,
                BackColor = Color.Beige,
                Icon      = EgbinInstrumentInfoApp.Properties.Resources.addredpicicon,
                Text      = "Add New Department",
                //StartPosition = FormStartPosition.CenterParent
                StartPosition = FormStartPosition.CenterScreen
            };

            Label lb = new Label();

            lb.Text      = "Enter Department Name:";
            lb.Location  = new Point(2, 2);
            lb.TextAlign = ContentAlignment.MiddleLeft;
            lb.Height    = 28;
            lb.AutoSize  = false;
            lb.Width     = (int)(0.9 * f.Width);
            lb.Font      = new Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            FlowLayoutPanel fp = new FlowLayoutPanel();

            fp.Width    = f.Width;
            fp.Height   = f.Height - 200;
            fp.Location = new Point(2, 4);

            tb           = new TextBox();
            tb.Width     = fp.Width - 50;
            tb.Font      = new Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            tb.TextAlign = HorizontalAlignment.Left;

            Label descriptionLabel = new Label()
            {
                Text      = "Enter a brief description of the department:",
                Location  = new Point(2, 50),
                TextAlign = ContentAlignment.MiddleLeft,
                Height    = 28,
                AutoSize  = false,
                Width     = (int)(0.9 * f.Width),
                Font      = new Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular)
            };

            briefDescription = new RichTextBox()
            {
                Width = fp.Width - 50,
                Font  = new Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular),
                //TextAlign = HorizontalAlignment.
                WordWrap   = true,
                ZoomFactor = 1,
                ScrollBars = RichTextBoxScrollBars.Both,
                DetectUrls = true,
                Multiline  = true,
                AcceptsTab = false,
                TabStop    = true
            };
            Label lb2 = new Label();

            lb2.Text      = "Department Icon:";
            lb2.Location  = new Point(2, 50);
            lb2.TextAlign = ContentAlignment.MiddleLeft;
            lb2.Height    = 28;
            lb2.AutoSize  = false;
            lb2.Width     = (int)(0.9 * f.Width);
            lb2.Font      = new Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            Panel p = new Panel();

            p.Width       = fp.Width;
            tb2           = new TextBox();
            tb2.Width     = fp.Width - 90;
            tb2.Font      = new Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            tb2.TextAlign = HorizontalAlignment.Left;

            Button selectButton = new Button();

            selectButton.Text   = "Select";
            selectButton.Width  = 65;
            selectButton.Height = tb2.Height + 2;
            selectButton.UseVisualStyleBackColor = true;
            selectButton.AutoSize = true;
            selectButton.Click   += new EventHandler(showChooser);
            selectButton.Location = new Point(tb2.Location.X + tb2.Width, tb2.Location.Y - 1);
            f.Controls.Add(lb);
            fp.Controls.Add(tb);
            fp.Controls.Add(descriptionLabel);
            fp.Controls.Add(briefDescription);
            fp.Controls.Add(lb2);
            p.Controls.Add(tb2);
            p.Controls.Add(selectButton);
            fp.Controls.Add(p);
            fp.Location     = new Point(2, 2 + lb.Height + 2);
            pic             = new PictureBox();
            pic.Width       = 80;
            pic.Height      = 80;
            pic.Location    = new Point(fp.Location.X, fp.Location.Y + fp.Height);
            pic.BackColor   = Color.MintCream;
            pic.BorderStyle = BorderStyle.FixedSingle;
            done            = new Button();
            done.Text       = "DONE";
            done.UseVisualStyleBackColor = true;
            done.AutoSize = true;
            done.Click   += new EventHandler(doneHandler);
            done.Location = new Point(pic.Location.X, pic.Location.Y + pic.Height + 5);
            f.Controls.Add(fp);
            f.Controls.Add(pic);
            f.Controls.Add(done);
            f.ShowDialog();
        }
Example #59
0
        public void Draw_Histogram(Image image, ref PictureBox pb)
        {
            int    height  = image.Height;
            int    width   = image.Width;
            Bitmap process = (Bitmap)image;
            Color  pixel;

            Histogram = new int[256];
            int[] HistogramR = new int[256];
            int[] HistogramG = new int[256];
            int[] HistogramB = new int[256];
            int   Gray, r, g, b;

            for (int i = 0; i <= 255; i++)
            {
                Histogram[i]  = 0;
                HistogramR[i] = 0;
                HistogramG[i] = 0;
                HistogramB[i] = 0;
            }

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    pixel = process.GetPixel(i, j);
                    r     = pixel.R;
                    g     = pixel.G;
                    b     = pixel.B;

                    //Gray = (int)(0.3 * r + 0.59 * g + 0.11 * b);
                    Gray = (r + g + b) / 3;
                    // Gray = (int)(0.59 * r + 0.3 * g + 0.11 * b);

                    Histogram[Gray] = Histogram[Gray] + 1;
                    HistogramR[r]   = HistogramR[r] + 1;
                    HistogramG[g]   = HistogramG[g] + 1;
                    HistogramB[b]   = HistogramB[b] + 1;
                }
            }

            //--------------------------------------------------------------


            //int max = 0;
            //foreach (int i in Histogram) max = max > i ? max : i;
            //Bitmap Bmp = new Bitmap(256, max+10);
            Bitmap   Bmp  = new Bitmap(300, 300);
            Bitmap   BmpR = new Bitmap(300, 300);
            Bitmap   BmpG = new Bitmap(300, 300);
            Bitmap   BmpB = new Bitmap(300, 300);
            Graphics his  = Graphics.FromImage(Bmp);
            Graphics hisR = Graphics.FromImage(BmpR);
            Graphics hisG = Graphics.FromImage(BmpG);
            Graphics hisB = Graphics.FromImage(BmpB);
            Pen      pen  = new Pen(Color.Black);

            his.DrawLine(pen, 10, 0, 10, 270);
            his.DrawLine(pen, 10, 270, 300, 270);
            pen.Color = Color.Red;
            hisR.DrawLine(pen, 10, 0, 10, 270);
            hisR.DrawLine(pen, 10, 270, 300, 270);
            pen.Color = Color.Green;
            hisG.DrawLine(pen, 10, 0, 10, 270);
            hisG.DrawLine(pen, 10, 270, 300, 270);
            pen.Color = Color.Blue;
            hisB.DrawLine(pen, 10, 0, 10, 270);
            hisB.DrawLine(pen, 10, 270, 300, 270);

            switch (count)
            {
            case 1:

                pen.Color = Color.Black;
                var    max    = Histogram.Max();
                double factor = max / 270;
                for (int i = 0; i <= 255; i++)
                {
                    double x = Histogram[i] / factor;
                    //Console.WriteLine(Histogram[i] + "   "+x);
                    if (x % 1 != 0)
                    {
                        x += 1;
                    }
                    his.DrawLine(pen, i + 11, 270 - (int)x, i + 11, 270);
                    //his.DrawLine(pen, 0, i, 0, Histogram[i]);
                    //drawhis(his, Histogram, max);
                }
                pb.Image = (Image)Bmp;
                break;

            case 2:
                pen.Color = Color.Red;
                var    maxR    = HistogramR.Max();
                double factorR = maxR / 270;
                for (int i = 0; i <= 255; i++)
                {
                    double x = HistogramR[i] / factorR;
                    //Console.WriteLine(HistogramR[i] + "   " + x);
                    if (x % 1 != 0)
                    {
                        x += 1;
                    }
                    hisR.DrawLine(pen, i + 11, 270 - (int)x, i + 11, 270);
                    //his.DrawLine(pen, 0, i, 0, Histogram[i]);
                    //drawhis(his, Histogram, max);
                }
                pb.Image = (Image)BmpR;
                break;

            case 3:
                pen.Color = Color.Green;
                var    maxG    = HistogramG.Max();
                double factorG = maxG / 270;
                for (int i = 0; i <= 255; i++)
                {
                    double x = (double)HistogramG[i] / factorG;
                    //Console.WriteLine(HistogramG[i] + "   " + x);
                    if (x % 1 != 0)
                    {
                        x += 1;
                    }
                    hisG.DrawLine(pen, i + 11, 270 - (int)x, i + 11, 270);
                    //his.DrawLine(pen, 0, i, 0, Histogram[i]);
                    //drawhis(his, Histogram, max);
                }
                pb.Image = (Image)BmpG;
                break;

            case 4:
                pen.Color = Color.Blue;
                var    maxB    = HistogramB.Max();
                double factorB = maxB / 270;
                for (int i = 0; i <= 255; i++)
                {
                    double x = ((double)HistogramB[i] / factorB);
                    //Console.WriteLine(HistogramB[i] + "   " + x);
                    if (x % 1 != 0)
                    {
                        x += 1;
                    }
                    hisB.DrawLine(pen, i + 11, 270 - (int)x, i + 11, 270);
                    //his.DrawLine(pen, 0, i, 0, Histogram[i]);
                    //drawhis(his, Histogram, max);
                }
                pb.Image = (Image)BmpB;
                count    = 0;
                break;
            }

            count++;
            pb.Refresh();
        }
Example #60
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Builder));
     this.m_optionsTV       = new System.Windows.Forms.TreeView();
     this.statusBar1        = new System.Windows.Forms.StatusBar();
     this.imageList1        = new System.Windows.Forms.ImageList(this.components);
     this.m_headPanel       = new CSharpCustomPanelControl.RoundCornerPanel();
     this.pictureBox1       = new System.Windows.Forms.PictureBox();
     this.m_configLabel     = new System.Windows.Forms.Label();
     this.m_mainPanel       = new CSharpCustomPanelControl.RoundCornerPanel();
     this.mainMenu1         = new System.Windows.Forms.MainMenu(this.components);
     this.FileMnu           = new System.Windows.Forms.MenuItem();
     this.menuItem1         = new System.Windows.Forms.MenuItem();
     this.menuItem5         = new System.Windows.Forms.MenuItem();
     this.menuItem4         = new System.Windows.Forms.MenuItem();
     this.TlsMenu           = new System.Windows.Forms.MenuItem();
     this.HelpMnu           = new System.Windows.Forms.MenuItem();
     this.menuItem6         = new System.Windows.Forms.MenuItem();
     this.menuItem7         = new System.Windows.Forms.MenuItem();
     this.menuItem8         = new System.Windows.Forms.MenuItem();
     this.menuItem9         = new System.Windows.Forms.MenuItem();
     this.menuItem10        = new System.Windows.Forms.MenuItem();
     this.menuItem11        = new System.Windows.Forms.MenuItem();
     this.menuItem12        = new System.Windows.Forms.MenuItem();
     this.menuItem13        = new System.Windows.Forms.MenuItem();
     this.menuItem14        = new System.Windows.Forms.MenuItem();
     this.menuItem15        = new System.Windows.Forms.MenuItem();
     this.menuItem16        = new System.Windows.Forms.MenuItem();
     this.menuItem17        = new System.Windows.Forms.MenuItem();
     this.menuItem18        = new System.Windows.Forms.MenuItem();
     this.menuItem19        = new System.Windows.Forms.MenuItem();
     this.menuItem20        = new System.Windows.Forms.MenuItem();
     this.treeView1         = new System.Windows.Forms.TreeView();
     this.roundCornerPanel1 = new CSharpCustomPanelControl.RoundCornerPanel();
     this.progressBar1      = new System.Windows.Forms.ProgressBar();
     this.button1           = new System.Windows.Forms.Button();
     this.m_headPanel.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     this.roundCornerPanel1.SuspendLayout();
     this.SuspendLayout();
     //
     // m_optionsTV
     //
     this.m_optionsTV.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                     | System.Windows.Forms.AnchorStyles.Left)));
     this.m_optionsTV.Font          = new System.Drawing.Font("Segoe UI", 9F);
     this.m_optionsTV.FullRowSelect = true;
     this.m_optionsTV.HideSelection = false;
     this.m_optionsTV.Location      = new System.Drawing.Point(6, 5);
     this.m_optionsTV.Name          = "m_optionsTV";
     this.m_optionsTV.Size          = new System.Drawing.Size(190, 349);
     this.m_optionsTV.TabIndex      = 92;
     this.m_optionsTV.AfterSelect  += new System.Windows.Forms.TreeViewEventHandler(this.SelectConfig);
     //
     // statusBar1
     //
     this.statusBar1.Location   = new System.Drawing.Point(0, 427);
     this.statusBar1.Name       = "statusBar1";
     this.statusBar1.ShowPanels = true;
     this.statusBar1.Size       = new System.Drawing.Size(818, 22);
     this.statusBar1.SizingGrip = false;
     this.statusBar1.TabIndex   = 100;
     //
     // imageList1
     //
     this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     this.imageList1.Images.SetKeyName(0, "Information.ico");
     this.imageList1.Images.SetKeyName(1, "Execute.ico");
     this.imageList1.Images.SetKeyName(2, "Message.ico");
     this.imageList1.Images.SetKeyName(3, "Plugin Add.ico");
     this.imageList1.Images.SetKeyName(4, "Processes.ico");
     this.imageList1.Images.SetKeyName(5, "User.ico");
     this.imageList1.Images.SetKeyName(6, "Setup.ico");
     this.imageList1.Images.SetKeyName(7, "Keyboard.ico");
     this.imageList1.Images.SetKeyName(8, "radioactivity.png");
     this.imageList1.Images.SetKeyName(9, "shield.png");
     this.imageList1.Images.SetKeyName(10, "dialog.png");
     this.imageList1.Images.SetKeyName(11, "distribution.png");
     this.imageList1.Images.SetKeyName(12, "connections.png");
     this.imageList1.Images.SetKeyName(13, "application.png");
     this.imageList1.Images.SetKeyName(14, "check_box_list.png");
     //
     // m_headPanel
     //
     this.m_headPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.m_headPanel.BackColor   = System.Drawing.SystemColors.Control;
     this.m_headPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.m_headPanel.Controls.Add(this.pictureBox1);
     this.m_headPanel.Controls.Add(this.m_configLabel);
     this.m_headPanel.Curvature = 1;
     this.m_headPanel.Location  = new System.Drawing.Point(202, 5);
     this.m_headPanel.Name      = "m_headPanel";
     this.m_headPanel.Size      = new System.Drawing.Size(428, 21);
     this.m_headPanel.TabIndex  = 102;
     //
     // pictureBox1
     //
     this.pictureBox1.Anchor      = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.pictureBox1.Image       = global::PpRBuilder.Properties.Resources.information;
     this.pictureBox1.Location    = new System.Drawing.Point(409, 3);
     this.pictureBox1.MaximumSize = new System.Drawing.Size(16, 16);
     this.pictureBox1.MinimumSize = new System.Drawing.Size(16, 16);
     this.pictureBox1.Name        = "pictureBox1";
     this.pictureBox1.Size        = new System.Drawing.Size(16, 16);
     this.pictureBox1.SizeMode    = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex    = 147;
     this.pictureBox1.TabStop     = false;
     //
     // m_configLabel
     //
     this.m_configLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this.m_configLabel.Location = new System.Drawing.Point(3, 2);
     this.m_configLabel.Name     = "m_configLabel";
     this.m_configLabel.Size     = new System.Drawing.Size(397, 16);
     this.m_configLabel.TabIndex = 0;
     this.m_configLabel.Text     = "Title";
     //
     // m_mainPanel
     //
     this.m_mainPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                      | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.m_mainPanel.BackColor   = System.Drawing.SystemColors.Control;
     this.m_mainPanel.BackColor2  = System.Drawing.SystemColors.Control;
     this.m_mainPanel.BorderColor = System.Drawing.Color.Gray;
     this.m_mainPanel.Curvature   = 1;
     this.m_mainPanel.Location    = new System.Drawing.Point(202, 30);
     this.m_mainPanel.Name        = "m_mainPanel";
     this.m_mainPanel.Size        = new System.Drawing.Size(428, 324);
     this.m_mainPanel.TabIndex    = 101;
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.FileMnu,
         this.TlsMenu,
         this.HelpMnu
     });
     //
     // FileMnu
     //
     this.FileMnu.Index = 0;
     this.FileMnu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem1,
         this.menuItem5,
         this.menuItem4
     });
     this.FileMnu.Text = "File";
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.Text  = "Create New";
     //
     // menuItem5
     //
     this.menuItem5.Index = 1;
     this.menuItem5.Text  = "-";
     //
     // menuItem4
     //
     this.menuItem4.Index = 2;
     this.menuItem4.Text  = "Exit";
     //
     // TlsMenu
     //
     this.TlsMenu.Index = 1;
     this.TlsMenu.Text  = "Tools";
     //
     // HelpMnu
     //
     this.HelpMnu.Index = 2;
     this.HelpMnu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem6,
         this.menuItem7,
         this.menuItem8,
         this.menuItem9,
         this.menuItem10,
         this.menuItem11,
         this.menuItem12,
         this.menuItem13,
         this.menuItem14,
         this.menuItem18,
         this.menuItem19,
         this.menuItem20
     });
     this.HelpMnu.Text = "Help";
     //
     // menuItem6
     //
     this.menuItem6.Index = 0;
     this.menuItem6.Text  = "Payment Plans";
     //
     // menuItem7
     //
     this.menuItem7.Index = 1;
     this.menuItem7.Text  = "-";
     //
     // menuItem8
     //
     this.menuItem8.Index = 2;
     this.menuItem8.Text  = "Prepril Website";
     //
     // menuItem9
     //
     this.menuItem9.Index = 3;
     this.menuItem9.Text  = "Prepril Forum";
     //
     // menuItem10
     //
     this.menuItem10.Index = 4;
     this.menuItem10.Text  = "-";
     //
     // menuItem11
     //
     this.menuItem11.Index = 5;
     this.menuItem11.Text  = "Download Translations";
     //
     // menuItem12
     //
     this.menuItem12.Index = 6;
     this.menuItem12.Text  = "Check for Updates";
     //
     // menuItem13
     //
     this.menuItem13.Index = 7;
     this.menuItem13.Text  = "-";
     //
     // menuItem14
     //
     this.menuItem14.Index = 8;
     this.menuItem14.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem15,
         this.menuItem16,
         this.menuItem17
     });
     this.menuItem14.Text = "Folders";
     //
     // menuItem15
     //
     this.menuItem15.Index = 0;
     this.menuItem15.Text  = "Databases Folder";
     //
     // menuItem16
     //
     this.menuItem16.Index = 1;
     this.menuItem16.Text  = "Logs Folder";
     //
     // menuItem17
     //
     this.menuItem17.Index = 2;
     this.menuItem17.Text  = "Plugins Folder";
     //
     // menuItem18
     //
     this.menuItem18.Index = 9;
     this.menuItem18.Text  = "-";
     //
     // menuItem19
     //
     this.menuItem19.Index = 10;
     this.menuItem19.Text  = "Show Welcome Dialog";
     //
     // menuItem20
     //
     this.menuItem20.Index = 11;
     this.menuItem20.Text  = "About";
     //
     // treeView1
     //
     this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.treeView1.Location = new System.Drawing.Point(636, 5);
     this.treeView1.Name     = "treeView1";
     this.treeView1.Size     = new System.Drawing.Size(176, 415);
     this.treeView1.TabIndex = 104;
     //
     // roundCornerPanel1
     //
     this.roundCornerPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                                           | System.Windows.Forms.AnchorStyles.Right)));
     this.roundCornerPanel1.BackColor   = System.Drawing.SystemColors.Control;
     this.roundCornerPanel1.BackColor2  = System.Drawing.SystemColors.Control;
     this.roundCornerPanel1.BorderColor = System.Drawing.Color.Gray;
     this.roundCornerPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.roundCornerPanel1.Controls.Add(this.progressBar1);
     this.roundCornerPanel1.Controls.Add(this.button1);
     this.roundCornerPanel1.Curvature = 1;
     this.roundCornerPanel1.Location  = new System.Drawing.Point(6, 360);
     this.roundCornerPanel1.Name      = "roundCornerPanel1";
     this.roundCornerPanel1.Size      = new System.Drawing.Size(624, 60);
     this.roundCornerPanel1.TabIndex  = 105;
     //
     // progressBar1
     //
     this.progressBar1.Location = new System.Drawing.Point(206, 27);
     this.progressBar1.Name     = "progressBar1";
     this.progressBar1.Size     = new System.Drawing.Size(320, 20);
     this.progressBar1.TabIndex = 98;
     //
     // button1
     //
     this.button1.Font     = new System.Drawing.Font("Segoe UI", 9F);
     this.button1.Location = new System.Drawing.Point(532, 26);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(75, 23);
     this.button1.TabIndex = 99;
     this.button1.Text     = "Build";
     this.button1.UseVisualStyleBackColor = true;
     //
     // Builder
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(818, 449);
     this.Controls.Add(this.m_optionsTV);
     this.Controls.Add(this.m_mainPanel);
     this.Controls.Add(this.m_headPanel);
     this.Controls.Add(this.roundCornerPanel1);
     this.Controls.Add(this.treeView1);
     this.Controls.Add(this.statusBar1);
     this.Font            = new System.Drawing.Font("Segoe UI", 9F);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.Menu            = this.mainMenu1;
     this.Name            = "Builder";
     this.SizeGripStyle   = System.Windows.Forms.SizeGripStyle.Hide;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Load           += new System.EventHandler(this.Builder_Load);
     this.m_headPanel.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     this.roundCornerPanel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }