private void _addTopDescription() {
            Label codeWord = new Label();
            Controls.Add(codeWord);
            codeWord.BringToFront();
            codeWord.Left = 8 + 22;
            codeWord.Top = 5;
            codeWord.Text = "Codeword";
            codeWord.Font = new Font(FontFamily.GenericMonospace.ToString(), 8);

            Label runSize = new Label();
            Controls.Add(runSize);
            runSize.Left = 8 + 22 + 116;
            runSize.Top = 5;
            runSize.Text = "Runsize";
            runSize.Font = new Font(FontFamily.GenericMonospace.ToString(), 8);

            Label line = new Label();
            Controls.Add(line);
            line.Left = 7 + 22;
            line.Top = 22;
            line.Size = new Size(195, 2);
            line.BorderStyle = BorderStyle.Fixed3D;
            line.BringToFront();
            line.ForeColor = SystemColors.ControlDarkDark;
        }
Example #2
0
        private void stopGame()
        {
            timer1.Stop();
            startButton.Enabled = true;
            trackBar1.Enabled   = true;
            stopButton.Enabled  = false;
            nameLabel.Enabled   = true;


            Label over = new Label();

            over.Text      = "Game\nOver";
            over.ForeColor = Color.White;
            over.Font      = new Font("Arial", 100, FontStyle.Bold);
            over.Size      = over.PreferredSize;
            over.TextAlign = ContentAlignment.MiddleCenter;



            int X = gamePanel.Width / 2 - over.Width / 2;
            int Y = gamePanel.Height / 2 - over.Width / 2;

            over.Location = new Point(X, Y);

            gamePanel.Controls.Add(over);
            over.BringToFront();

            addCurrenScoresToDatabase();
            UpdateScoreBoard();
        }
Example #3
0
        public Calendar()
        {
            InitializeComponent();

            for (int s = 1; s <= 6; s++)
            {
                for (int d = 1; d <= 7; d++)
                {
                    System.Windows.Forms.Label EtiquetaDia = new System.Windows.Forms.Label();
                    EtiquetaDia.BackColor = this.DisplayStyle.DataAreaColor;
                    EtiquetaDia.Text      = "";
                    EtiquetaDia.Size      = new Size(28, 20);
                    EtiquetaDia.TextAlign = ContentAlignment.MiddleCenter;
                    EtiquetaDia.ForeColor = this.DisplayStyle.TextColor;
                    EtiquetaDia.BringToFront();
                    this.Controls.Add(EtiquetaDia);
                    Dias.Add(EtiquetaDia);
                    EtiquetaDia.MouseDown   += new System.Windows.Forms.MouseEventHandler(EtiquetaDia_Click);
                    EtiquetaDia.DoubleClick += new System.EventHandler(EtiquetaDia_DoubleClick);
                }
            }
            EtiquetaMes.BackColor = this.DisplayStyle.BackgroundColor;
            ReubicarDias();
            MostrarCalendario();
        }
        public FileBrowserItem(ItemType tp, string path, Bitmap img, FileBrowser parent)
        {
            Type = tp;
            FullPath = path;
            Owner = parent;
            Margin = new Padding(0);
            FullImage = img; // FullImage - contains image in natural size.
            BackgroundImageLayout = ImageLayout.None;
            Click += ClickEvent;
            MouseEnter += OnMouseEnter;
            MouseLeave += OnMouseLeave;

            Text = new Label
            {
                Parent = this,
                AutoSize = false,
                AutoEllipsis = true
            };

            SetVariables(img, parent);
            Text.BackColor = Color.Transparent;
            if (Type == ItemType.Folder || Type == ItemType.File)
                Text.Text = Path.GetFileName(path);
            if (Type == ItemType.Drive)
                Text.Text = FullPath;
            Text.BringToFront();
            Text.Click += ClickEvent;
            Text.MouseEnter += OnMouseEnter;
            Text.MouseLeave += OnMouseLeave; 
        }
Example #5
0
 public void bindData(ArrayList al)
 {
     Label tb = new Label();
     tb.Text = al[0].ToString();
     tb.BringToFront();
     this.Controls.Add(tb);
 }
Example #6
0
// <snippet1>
        private void MakeLabelVisible()
        {
            /* If the panel contains label1, bring it
             * to the front to make sure it is visible. */
            if (panel1.Contains(label1))
            {
                label1.BringToFront();
            }
        }
Example #7
0
        public void createDrawInterface(Hero hero)
        {
            Color back = new Color();
            back = Color.White;

            health_lbl = new Label();
            health_lbl.Name = "health_lbl";
            health_lbl.Text = "Здоровье "+hero.Health.ToString();
            health_lbl.ForeColor = Color.Red;
            health_lbl.BackColor = back;
            health_lbl.Location = new Point(90, 400);
            health_lbl.BringToFront();
            Controls.Add(health_lbl);

            mana_lbl = new Label();
            mana_lbl.Name = "mana_lbl";
            mana_lbl.Text = "Мана " + hero.Mana.ToString();
            mana_lbl.ForeColor = Color.Blue;
            mana_lbl.BackColor = back;
            mana_lbl.Location = new Point(450, 400);
            Controls.Add(mana_lbl);

            weight_lbl = new Label();
            weight_lbl.Name = "weight_lbl";
            weight_lbl.Text = "Вес " + hero.Weight.ToString()+"/"+hero.Capacity.ToString();
            weight_lbl.ForeColor = Color.Black;
            weight_lbl.BackColor = back;
            weight_lbl.Location = new Point(90, 425);
            Controls.Add(weight_lbl);

            money_lbl = new Label();
            money_lbl.Name = "money_lbl";
            money_lbl.Text = "Золото " + hero.Money.ToString();
            money_lbl.ForeColor = Color.Goldenrod;
            money_lbl.BackColor = back;
            money_lbl.Location = new Point(450, 425);
            Controls.Add(money_lbl);

            inventory_btn = new Button();
            inventory_btn.Name = "inventory_btn";
            inventory_btn.Text = "Рюкзак";
            inventory_btn.BackColor = back;
            inventory_btn.Location = new Point(550, 400);
            inventory_btn.Click += new EventHandler (inventory_btn_Click);
            Controls.Add(inventory_btn);

            interface_panel = new Panel();
            interface_panel.Location = new Point(0, 370);
            interface_panel.Width = 635;
            interface_panel.Height = 100;
            interface_panel.BackColor = back;
            Controls.Add(interface_panel);

            Graphics g = interface_panel.CreateGraphics();
            g.FillRectangle(Brushes.Black, 0, 0, interface_panel.Width, 3);
        }
Example #8
0
        private void m_btnSave_Click(object sender, System.EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            m_lb.Show();
            m_lb.BringToFront();
            long lngRes = ((clsControlCreatePlan)this.objController).m_lngCreatePlan(this.m_DTPStart.Value, this.m_DTPEnd.Value);

            if (lngRes >= 0)
            {
                this.IsRefresh = true;
            }
            m_lb.Hide();
            this.Cursor = Cursors.Default;
        }
Example #9
0
        public static void CreateLabel(Form form)
        {
            last = DateTime.Now;

            label = new System.Windows.Forms.Label();
            label.Text = "0";
            label.Name = "fps";
            label.AutoSize = true;
            label.Dock = System.Windows.Forms.DockStyle.Right;
            label.BackColor = System.Drawing.Color.Transparent;
            label.Font = new System.Drawing.Font("Arial Black", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label.ForeColor = System.Drawing.Color.Yellow;
            label.Parent = form;
            label.BringToFront();
        }
Example #10
0
        private void label1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            label1.BringToFront();

            label1.Capture = false;
            if (this.Controls.Contains(CSharpTracker))
            {
                this.Controls.Remove(CSharpTracker);
            }
            CSharpTracker = new RectTracker(label1);

            this.Controls.Add(CSharpTracker);
            CSharpTracker.BringToFront();
            CSharpTracker.Draw();
        }
Example #11
0
 void ShowTCTip()
 {
     label1.Visible = true;
     label1.Text    = "Size:(" + controltobeResized.GetClientWidth() + "," + controltobeResized.GetClientHeight() + ")";
     label1.Top     = controltobeResized.Bottom + decoration;
     if (label1.Width > controltobeResized.Width)
     {
         label1.Left = controltobeResized.Left;
     }
     else
     {
         label1.Left = controltobeResized.Right - label1.Width;
     }
     label1.BringToFront();
 }
Example #12
0
        public TextBox()
        {
            _textBox = new System.Windows.Forms.TextBox();
            _textBox.Dock = DockStyle.Fill;
            _textBox.GotFocus += _textBox_GotFocus;
            _textBox.LostFocus += _textBox_LostFocus;
            Controls.Add(_textBox);

            _label = new Label();
            _label.ForeColor = SystemColors.GrayText;
            _label.Cursor = Cursors.IBeam;
            _label.MouseDown += new MouseEventHandler(_label_MouseDown);
            Controls.Add(_label);

            _label.BringToFront();
        }
Example #13
0
        public KroRForm(IWorld world)
        {
            this.world=world;
            ClientSize = new System.Drawing.Size(800, 600);

            var font=new Font("Arial", 18);

            clocks=new Label();
            clocks.Size=new Size(100,50);
            clocks.Location=new Point(ClientSize.Width-clocks.Width,0);
            clocks.Font=font;
            clocks.BackColor=Color.White;
            Controls.Add(clocks);

            scores = new Label();
            scores.BackColor = Color.White;
            scores.Font = font;
            scores.Size = new Size(ClientSize.Width-clocks.Width, clocks.Height);
            scores.BringToFront();
            Controls.Add(scores);
            
            var engine = world.Engine as KroREngine;
            var control = new DrawerControl(new DirectXFormDrawer(engine.DrawerFactory.GetDirectXScene(), new DrawerSettings
            {
                ViewMode = ViewModes.FirstPerson,
                BodyCameraLocation = world.Configuration.Settings.ObserverCameraLocation,
                Robot = engine.Root
            }));



            control.Size = new Size(ClientSize.Width,ClientSize.Height-scores.Height);
            control.Location = new Point(0, scores.Height);
            Controls.Add(control);


            world.Scores.ScoresChanged += () => { Invoke(new Action(UpdateScores)); };
            world.Clocks.Ticked += () => { Invoke(new Action(UpdateClocks)); };
            world.Exit += () => worldExited = true;

            UpdateScores();
            thread= new Thread(()=>world.RunActively(1)) { IsBackground = true };
            thread.Start();

           

        }
Example #14
0
        public void build(string str)
        {
            int count = 0;
            int startX = 50;
            int startY = 36;

            string[] strCollection = Regex.Split(str, @"\{(.*?)\}");

            for (int i = 0; i < strCollection.Length; i++)
            {
                int temp = strCollection[i].IndexOf("/");
                count++;

                Point point = createPosition(i, startX, startY);

                if (strCollection[i].ToString() != "")
                {
                    if (temp == 0)
                    {
                        Label txtBox = new Label();
                        txtBox.Name = "txtBoxDynamic" + i.ToString();
                        txtBox.Text = strCollection[i].ToString();
                        txtBox.AutoSize = true;
                        txtBox.Location = point;
                        txtBox.Size = new System.Drawing.Size(50, 25);
                        txtBox.BringToFront();
                        gbREST.Controls.Add(txtBox);
                    }
                    else
                    {
                        //Parameter box
                        TextBox txtBox = new TextBox();
                        txtBox.Name = "txtBoxDynamic" + i.ToString();
                        txtBox.Text = "{" + strCollection[i].ToString() + "}";
                        txtBox.Font = new Font("Times New Roman", 9, FontStyle.Italic);
                        txtBox.Location = point;
                        txtBox.Size = new System.Drawing.Size(200, 25);
                        txtBox.BringToFront();
                        gbREST.Controls.Add(txtBox);
                    }

                }

            }
        }
Example #15
0
        public void PrintDebug(Color color, string message)
        {
            Label ConsoleNewLine = new System.Windows.Forms.Label();

            ConsoleNewLine.AutoSize = true;
            ConsoleNewLine.Dock     = System.Windows.Forms.DockStyle.Top;
            ConsoleNewLine.Font     = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            ConsoleNewLine.Margin   = new System.Windows.Forms.Padding(4, 0, 4, 0);

            ConsoleNewLine.ForeColor   = color;
            ConsoleNewLine.Text       += message + "\n";
            ConsoleNewLine.MaximumSize = new Size(this.Console.Size.Width - ConsoleNewLine.Margin.Right - 10, 0);

            this.Console.Controls.Add(ConsoleNewLine);
            this._ConsoleLines.Add(ConsoleNewLine);

            ConsoleNewLine.BringToFront();
        }
Example #16
0
 private void ReubicarDias()
 {
     if (Dias.Count > 0)
     {
         this.SuspendLayout();
         System.Windows.Forms.Label EtiquetaDia = null;
         for (int s = 1; s <= 6; s++)
         {
             for (int d = 1; d <= 7; d++)
             {
                 EtiquetaDia          = ((System.Windows.Forms.Label)(Dias[(s - 1) * 7 + d - 1]));
                 EtiquetaDia.Location = new Point(EtiquetaDia1.Left + (d - 1) * 32, EtiquetaDia1.Top + s * 24);
                 EtiquetaDia.BringToFront();
             }
         }
         PanelFondo.SendToBack();
         this.ResumeLayout();
     }
 }
        public PulseGeneratorForm(PIC.PIC pic)
        {
            InitializeComponent();

            portAAdapter = (PIC.Ports.IOAdapter) pic.getRegisterFileMap().getAdapter(PIC.Register.RegisterConstants.PORTA_ADDRESS);
            portBAdapter = (PIC.Ports.IOAdapter) pic.getRegisterFileMap().getAdapter(PIC.Register.RegisterConstants.PORTB_ADDRESS);

            intervalABox.Text = DEFAULT_INTERVAL.ToString();
            intervalBBox.Text = DEFAULT_INTERVAL.ToString();

            portATimer.Elapsed += portATimer_Elapsed;
            portBTimer.Elapsed += portBTimer_Elapsed;

            int i = 0;
            Label label;
            // PORT-Checkboxes dynamisch erstellen
            for (i = 0; i < 8; i++)
            {
                portACheckBoxes[7-i] = new CheckBox();
                portACheckBoxes[7-i].SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), CHECKBOX_PORTA_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                portACheckBoxes[7-i].Parent = this;
                portACheckBoxes[7-i].MouseClick += new MouseEventHandler(portACheckboxChanged);

                label = new Label();
                label.Text = (7 - i).ToString();
                label.SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), LABEL_PORTA_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                label.Parent = this;
                label.Show();
                label.BringToFront();

                portBCheckBoxes[7-i] = new CheckBox();
                portBCheckBoxes[7-i].SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), CHECKBOX_PORTB_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                portBCheckBoxes[7-i].Parent = this;
                portBCheckBoxes[7-i].MouseClick += new MouseEventHandler(portBCheckboxChanged);

                label = new Label();
                label.Text = (7 - i).ToString();
                label.SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), LABEL_PORTB_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
                label.Parent = this;
                label.Show();
                label.BringToFront();
            }
        }
Example #18
0
        private void dynamicLabel(int limit)
        {
            for (int i = 1; i <= limit; i++)
            {
                Label label = new Label();
                label           = new System.Windows.Forms.Label();
                label.Location  = new System.Drawing.Point(100 + 20 * (i - 1), 440);
                label.Name      = i.ToString() + "Page";
                label.Size      = new System.Drawing.Size(50, 23);
                label.TabIndex  = 1;
                label.Text      = i.ToString();
                label.Tag       = i;
                label.ForeColor = Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(53)))), ((int)(((byte)(87)))));
                //label.Visible = true;
                label.Click += new System.EventHandler(this.label_Click);

                this.Controls.Add(label);
                label.BringToFront();
            }
        }
        /// <summary>
        /// sets the form to display help information
        /// </summary>
        public void SetupForHelpMode(string sWeblink, string sHelplink, string sHelpfile)
        {
            if (sWeblink != "")
            {
                panelWebHelp.Visible = true;

                panelWebHelp.Dock     = DockStyle.Bottom;
                linkLabelWebHelp.Text = sWeblink;
            }

            /* Ju7ly 2010 - couldn't get this to work proerply so I removed
             * if (sHelplink != "" && sHelplink != null && sHelplink != "")
             * {
             * panelHelpHelp.Visible = true;
             * panelHelpHelp.Dock = DockStyle.Bottom;
             * linkLabelHelpFile.Text = sHelplink;
             * linkLabelHelpFile.Tag = sHelpfile;
             *
             * }*/
            labelMessage.Dock = DockStyle.Top;
            labelMessage.BringToFront();
        }
Example #20
0
                public Calendar()
                {
                        InitializeComponent();

                        for (int s = 1; s <= 6; s++) {
                                for (int d = 1; d <= 7; d++) {
                                        System.Windows.Forms.Label EtiquetaDia = new System.Windows.Forms.Label();
                                        EtiquetaDia.BackColor = this.DisplayStyle.DataAreaColor;
                                        EtiquetaDia.Text = "";
                                        EtiquetaDia.Size = new Size(28, 20);
                                        EtiquetaDia.TextAlign = ContentAlignment.MiddleCenter;
                                        EtiquetaDia.ForeColor = this.DisplayStyle.TextColor;
                                        EtiquetaDia.BringToFront();
                                        this.Controls.Add(EtiquetaDia);
                                        Dias.Add(EtiquetaDia);
                                        EtiquetaDia.MouseDown += new System.Windows.Forms.MouseEventHandler(EtiquetaDia_Click);
                                        EtiquetaDia.DoubleClick += new System.EventHandler(EtiquetaDia_DoubleClick);
                                }
                        }
                        EtiquetaMes.BackColor = this.DisplayStyle.BackgroundColor;
                        ReubicarDias();
                        MostrarCalendario();

                }
Example #21
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="ATopPanel">The Panel to which the Breadcrumb Trail should be added to.</param>
        public TBreadcrumbTrail(Panel ATopPanel)
        {
            TVisualStyles VisualStyle = new TVisualStyles(TVisualStylesEnum.vsHorizontalCollapse);

            FBreadcrumbTrailPanel = new Panel();
            FBreadcrumbTrailPanel.Name = "BreadcrumbTrail";
            FBreadcrumbTrailPanel.BackColor = Color.Transparent;
            FBreadcrumbTrailPanel.Dock = DockStyle.Fill;

            ATopPanel.Controls.Add(FBreadcrumbTrailPanel);

            Panel BreadcrumbTrailModulePanel = new Panel();
            BreadcrumbTrailModulePanel.Name = "BreadcrumbTrailMainPanel";
            BreadcrumbTrailModulePanel.BackColor = Color.Transparent;
            BreadcrumbTrailModulePanel.Dock = DockStyle.Left;
            BreadcrumbTrailModulePanel.AutoSize = true;
            BreadcrumbTrailModulePanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            FBreadcrumbTrailPanel.Controls.Add(BreadcrumbTrailModulePanel);

            FBreadcrumbTrailModuleLabel = new Label();
            FBreadcrumbTrailModuleLabel.Name = "BreadcrumbTrailModuleLabel";
            FBreadcrumbTrailModuleLabel.Font = VisualStyle.TitleFont;
            FBreadcrumbTrailModuleLabel.ForeColor = VisualStyle.TitleFontColour;
            FBreadcrumbTrailModuleLabel.BackColor = Color.Transparent;
            FBreadcrumbTrailModuleLabel.AutoSize = true;
            FBreadcrumbTrailModuleLabel.Dock = DockStyle.Left;

            BreadcrumbTrailModulePanel.Controls.Add(FBreadcrumbTrailModuleLabel);

            FBreadcrumbTrailDetailLabel = new Label();
            FBreadcrumbTrailDetailLabel.Name = "BreadcrumbTrailDetailLabel";
            FBreadcrumbTrailDetailLabel.Font = new System.Drawing.Font(VisualStyle.TitleFont.FontFamily, VisualStyle.TitleFont.SizeInPoints - 2,
                FontStyle.Bold);
            FBreadcrumbTrailDetailLabel.ForeColor = VisualStyle.TitleFontColour;
            FBreadcrumbTrailDetailLabel.BackColor = Color.Transparent;
            FBreadcrumbTrailDetailLabel.AutoEllipsis = true;
            FBreadcrumbTrailDetailLabel.Dock = DockStyle.Fill;
            FBreadcrumbTrailDetailLabel.Padding = new Padding(0, 2, 0, 0);

            FBreadcrumbTrailPanel.Controls.Add(FBreadcrumbTrailDetailLabel);

            FBreadcrumbTrailDetailLabel.BringToFront();

            FBreadcrumbTrailModuleLabel.Text = "Ledger 43";
            FBreadcrumbTrailDetailLabel.Text = "-> Gift";
        }
	public virtual void  actionPerformed(System.Object event_sender, System.EventArgs event_Renamed)
	{
		if (event_sender.Equals(openMenu))
		{
			chooser.ShowDialog(this);
			if (new System.IO.FileInfo(chooser.FileName) == null)
				return ;
			try
			{
				sourceImage = ImageIO.read(new System.IO.FileInfo(chooser.FileName));
			}
			catch (System.Exception e)
			{
				SupportClass.WriteStackTrace(e, Console.Error);
			}
		}
		else if (SupportClass.CommandManager.GetCommand(event_sender).Equals("Open from URL"))
		{
			try
			{
				//UPGRADE_TODO: Class 'java.net.URL' was converted to a 'System.Uri' which does not throw an exception if a URL specifies an unknown protocol. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1132'"
				sourceImage = ImageIO.read(new System.Uri(url.Text));
			}
			catch (System.Exception e)
			{
				SupportClass.WriteStackTrace(e, Console.Error);
			}
		}
		else
			return ;
		
		if (sourceImageLabel != null)
		{
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			((System.Windows.Forms.ContainerControl) this).Controls.Remove(sourceImageLabel);
		}
		
		System.Windows.Forms.Label temp_label;
		temp_label = new System.Windows.Forms.Label();
		temp_label.Image = (System.Drawing.Image) sourceImage.Clone();
		sourceImageLabel = temp_label;
		//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
		((System.Windows.Forms.ContainerControl) this).Controls.Add(sourceImageLabel);
		sourceImageLabel.Dock = System.Windows.Forms.DockStyle.Left;
		sourceImageLabel.BringToFront();
		
		
		QRCodeDecoder decoder = new QRCodeDecoder();
		if (canvas != null)
		{
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			((System.Windows.Forms.ContainerControl) this).Controls.Remove(canvas);
			//canvas.setImage(null);
		}
		canvas = new J2SEDebugCanvas();
		QRCodeDecoder.setCanvas(canvas);
		//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
		((System.Windows.Forms.ContainerControl) this).Controls.Add(canvas);
		canvas.Dock = System.Windows.Forms.DockStyle.Right;
		canvas.BringToFront();
		System.String decodedString = null;
		try
		{
			decodedString = new String(decoder.decode(new J2SEImage(this, sourceImage)));
		}
		catch (DecodingFailedException e)
		{
			canvas.println(e.getMessage());
			canvas.println("--------");
			return ;
		}
		decodedString = ContentConverter.convert(decodedString);
		canvas.println("\nDecode result:");
		canvas.println(decodedString);
		canvas.println("--------");
		if (decodedText != null)
		{
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			((System.Windows.Forms.ContainerControl) this).Controls.Remove(decodedText);
		}
		System.Windows.Forms.TextBox temp_TextBox;
		temp_TextBox = new System.Windows.Forms.TextBox();
		temp_TextBox.Multiline = true;
		temp_TextBox.WordWrap = false;
		temp_TextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
		temp_TextBox.Text = decodedString;
		decodedText = temp_TextBox;
		decodedText.WordWrap = true;
		//UPGRADE_ISSUE: Method 'javax.swing.JTextArea.setRows' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTextAreasetRows_int'"
		decodedText.setRows(decodedString.Length / 20 + 1);
		if (decodedString.Length < 20)
		{
			//UPGRADE_ISSUE: Method 'javax.swing.JTextArea.setColumns' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTextAreasetColumns_int'"
			decodedText.setColumns(decodedString.Length);
		}
		else
		{
			//UPGRADE_ISSUE: Method 'javax.swing.JTextArea.setColumns' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingJTextAreasetColumns_int'"
			decodedText.setColumns(20);
		}
		//decodedText.setSize(sourceImageLabel.getSize().width,100);
		//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
		((System.Windows.Forms.ContainerControl) this).Controls.Add(decodedText);
		decodedText.Dock = System.Windows.Forms.DockStyle.Bottom;
		decodedText.SendToBack();
		//UPGRADE_ISSUE: Method 'java.awt.Window.pack' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtWindowpack'"
		pack();
	}
        //nach character selektierung die oberfläche ändern
        private void selectCharacter()
        {
            selectedCharacterName.Text = selectedCharacter.Name;

            if (selectedCharacter.Equipment != null)
            {
                //leere benutzeroberfläche von früheren character die labels
                foreach (Label lb in this.Controls.OfType<Label>().ToArray())
                {
                    if (lb.Name.Contains("EquipmentLabel"))
                    {
                        lb.Dispose();
                        this.Controls.Remove(lb);
                    }
                }

                //leere benutzeroberfläche von früheren character die picture boxen
                foreach (PictureBox pb in this.Controls.OfType<PictureBox>().ToArray())
                {
                    if (pb.Name.Contains("ItemPicture"))
                    {
                        pb.Dispose();
                        this.Controls.Remove(pb);
                    }
                }

                int count = 0;
                int row = 0;

                foreach (Equipment equipment in selectedCharacter.Equipment)
                {
                    Label label = new Label();
                    label.Location = new Point(350 + row, 100 + count);
                    label.Size = new Size(100, 20);
                    label.Text = equipment.Slot;
                    label.Name = "EquipmentLabel" + equipment.Id;
                    label.BackColor = Color.Transparent;
                    label.Parent = background;
                    this.Controls.Add(label);
                    label.BringToFront();

                    PictureBox picture = new PictureBox();
                    picture.Location = new Point(450 + row, 100 + count);
                    picture.Size = new Size(64, 64);
                    picture.Text = equipment.Slot;
                    picture.BackColor = Color.Transparent;
                    picture.Name = "ItemPicture" + equipment.Id;
                    picture.Parent = background;
                    this.Controls.Add(picture);
                    picture.BringToFront();

                    row += 210;
                    if (row > 630)
                    {
                        count += 70;
                        row = 0;
                    }
                }
            }
        }
Example #24
0
        private WebBox()
        {
            this.Icon = global::MyTvShowsOrganizer.Properties.Resources.binggreensmall2_64_xgy_icon;
            this.Text = "[En ─› Ҩἒὧℓ₯]";
            Graphics g = this.CreateGraphics();
            Font titleFont = new System.Drawing.Font("Segoe UI", 13, FontStyle.Bold);

            // string hyper = "https://www.bing.com/translator/";// "https://www.bing.com/translator/";https://www.google.com.br/
            //Font translateLnkFont = new System.Drawing.Font("Arial", 9, FontStyle.Bold);
            this.Size = new Size(1050, 600);

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            // this.BackColor = Color.FromArgb(10, 10, 10);
            this.StartPosition = FormStartPosition.CenterParent;
            this.Padding = new System.Windows.Forms.Padding(1);

            _plHeader.BackColor = Color.FromArgb(30, 30, 30);
            _plHeader.Dock = DockStyle.Top;
            _plHeader.Height = ((int)(g.MeasureString("Sample", titleFont).Height + 3) * 2);
            _plHeader.Padding = new Padding(((int)(g.MeasureString("Sample", titleFont).Height / 2 + 1)));

            _lblTitle = new Label();
            _lblTitle.ForeColor = Color.White;
            _lblTitle.Font = titleFont;
            //this.Margin = new System.Windows.Forms.Padding(2);
            _lblTitle.Dock = DockStyle.Left;
            //SizeF sizeTitle = g.MeasureString("Sample", titleFont);
            //_lblTitle.Height = ((int)(g.MeasureString("Sample", titleFont).Height + 1));
            _lblTitle.AutoSize = true;
            _plHeader.Controls.Add(_lblTitle);

            //SizeF sizeTitle = g.MeasureString("Sample", titleFont);
            // _lblTitle.Height = 20;// ((int)(g.MeasureString("Sample", titleFont).Height + 1) * 2);

            //_lblMessage = new Label();
            //_lblMessage.ForeColor = Color.White;
            //_lblMessage.Font = messageFont;
            //_lblMessage.Dock = DockStyle.Fill;

            _flpButtons.FlowDirection = FlowDirection.RightToLeft;
            _flpButtons.Dock = DockStyle.Fill;

            //_plTranslator.BackColor = Color.FromArgb(30, 30, 30);
            //_plTranslator.Dock = DockStyle.Top;
            //_plTranslator.Height = 500;

            _plFooter.Dock = DockStyle.Bottom;
            _plFooter.Padding = new Padding(10);
            _plFooter.BackColor = Color.FromArgb(30, 40, 30);
            _plFooter.Height = 50;
            _plFooter.Controls.Add(_flpButtons);

            //webBrowserTranslator.AllowWebBrowserDrop = false;
            _webBrowserTranslator.IsWebBrowserContextMenuEnabled = false;
            _webBrowserTranslator.WebBrowserShortcutsEnabled = true;
            _webBrowserTranslator.Name = "webBrowserTranslator";
            _webBrowserTranslator.ScriptErrorsSuppressed = true;

            Controls.Add(_webBrowserTranslator);
            _webBrowserTranslator.Dock = DockStyle.Fill;

            //_webBrowserTranslator.Url = new Uri(_TranslateBox._translatorUrl);

            // this.webBrowser2.DocumentText = Parameters.newShowImageWebPage;
            // webBrowser2.Refresh();
            //_lnkLblTranslate = new LinkLabel();
            ////_lnkLblTranslate.ForeColor = Color.Blue;
            //_lnkLblTranslate.Font = translateLnkFont;
            //_lnkLblTranslate.Dock = DockStyle.Top;
            //_lnkLblTranslate.Text = "[En ─› Ҩἒὧℓ₯]";
            //// _lnkLblTranslate.Image =  global::MyTvShowsOrganizer.Properties.Resources.binggreensmall;
            ////_lnkLblTranslate.ImageAlign = ContentAlignment.MiddleLeft ;
            //_lnkLblTranslate.Click += _lnkLblTranslate_Click;

            //_plTranslate.Dock = DockStyle.Bottom;
            //_plTranslate.Padding = new Padding(20, 0, 0, 0);
            //_plTranslate.Height = ((int)(g.MeasureString(_lnkLblTranslate.Text, translateLnkFont).Height + 2));
            //_plTranslate.Controls.Add(_lnkLblTranslate);

            //_picIcon.Width = 32;
            //_picIcon.Height = 32;
            //_picIcon.Location = new Point(30, 50);
            //_plIcon.Dock = DockStyle.Left;
            //// _plIcon.Padding = new Padding(20);
            //_plIcon.Width = 65;
            //_plIcon.Controls.Add(_picIcon);

            List<Control> controlCollection = new List<Control>();
            //controlCollection.Add(this);
            controlCollection.Add(_plHeader);
            controlCollection.Add(_lblTitle);
            controlCollection.Add(_flpButtons);
            //controlCollection.Add(_plHeader);
            //controlCollection.Add(_plTranslate);
            //controlCollection.Add(_plFooter);
            //controlCollection.Add(_plIcon);
            //controlCollection.Add(_picIcon);
            //controlCollection.Add(webBrowserTranslator);

            foreach (Control control in controlCollection)
            {
                control.MouseDown += TranslateBox_MouseDown;
                control.MouseMove += TranslateBox_MouseMove;
            }

            this.Controls.Add(_plHeader);
            _plHeader.BringToFront();
            _lblTitle.BringToFront();
            //this.Controls.Add(_plIcon);
            //this.Controls.Add(_plTranslate);
            this.Controls.Add(_plFooter);
            _plFooter.BringToFront();
        }
Example #25
0
        /// <summary>
        /// Expand the displayed path into <paramref name="into"/>
        /// </summary>
        /// <param name="into">The location to append to the end of the path</param>
        public virtual void Expand(string into)
        {
            //label for the seperator
            Label sepLabel = new Label();
            sepLabel.Text = Seperator;
            FormatLabel(sepLabel);
            this.Controls.Add(sepLabel);
            sepLabel.BringToFront();

            //label for the location (given by the "into" parameter)
            Label locLabel = new Label();
            locLabel.Text = into;
            FormatClickableLabel(locLabel);
            this.Controls.Add(locLabel);
            locLabel.BringToFront();
        }
Example #26
0
        private void ActivityHistoryForm_Paint(object sender, PaintEventArgs e)
        {
            if (this.historyGraph != null
                && this.ClientRectangle.Width == this.lastWindowWidth
                && !(DateTime.Now.Subtract(this.lastHistoryRedraw).TotalMinutes > Config.HistoryRedrawTimeout)
                && !this.forceRedraw)
            {
                return;
            }

            var oldScroll = historyPanel.VerticalScroll.Value;

            // Allow user to select year/month
            var history = ActivityManager.GetMonthActivity((short)(this.currentMonth / 100), (byte)(this.currentMonth % 100));

            // Figure out when first activity started and when last activity ended (for the whole month)
            var firstTime = (uint)60 * 60 * 24;
            var lastTime = (uint)0;
            foreach (List<ActivitySpan> activities in history.Days.Values)
            {
                firstTime = firstTime < activities.First().StartSecond ? firstTime : activities.First().StartSecond;
                lastTime = lastTime > activities.Last().EndSecond ? lastTime : activities.Last().EndSecond;
            }

            this.graphFirstSecond = firstTime;

            // Create a new bitmap that is as wide as the windows and as high as it needs to be to fit all days
            var width = this.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth;
            var height = history.Days.Count * (Config.GraphHeight + Config.GraphSpacing);
            this.historyGraph = new Bitmap(width: width,
                height: history.Days.Count * (Config.GraphHeight + Config.GraphSpacing),
                format: System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            this.historyGraph.MakeTransparent();

            // Make sure we have as many labels as we need
            for (int i = this.timeLabels.Count; i < history.Days.Count * 4; i++)
            {
                var label = new Label();
                label.AutoSize = true;
                label.BackColor = Color.Transparent;
                label.BringToFront();
                this.historyPicture.Controls.Add(label);
                this.timeLabels.Add(label);
            }

            var graphicsObj = Graphics.FromImage(this.historyGraph);
            Pen pen = new Pen(Color.Olive, 1);
            var brush = new SolidBrush(Color.Olive);

            this.graphWidth = (uint) width - 80;
            this.graphSeconds = lastTime - firstTime;
            var daylineHeight = 2;

            // Draw hour lines
            var greypen = new Pen(Color.LightGray, 1);
            var firstHour = (int)Math.Ceiling(firstTime / 3600.0);
            var lastHour = (int)Math.Floor(lastTime / 3600.0);
            for (int x = firstHour; x <= lastHour; x++)
            {
                var xpixel = (((x * 3600) - firstTime) * this.graphWidth) / this.graphSeconds + GraphStartPixel;
                graphicsObj.DrawLine(greypen, xpixel, 10, xpixel, height);
            }

            // Put labels
            int index = 0;
            int currentY = Config.GraphSpacing;
            foreach (var dayNumber in history.Days.Keys.OrderBy(x => x))
            {
                var todaysFirstSecond = 0u;
                var todaysLastSecond = 0u;
                if (history.Days[dayNumber].Any(x => x.WasActive))
                {
                    todaysFirstSecond = history.Days[dayNumber].First(x => x.WasActive).StartSecond;
                    todaysLastSecond = history.Days[dayNumber].Last(x => x.WasActive).EndSecond;
                }

                var title = this.timeLabels[index++];
                title.Location = new Point(0, currentY);
                title.Text = new DateTime(history.Year, history.Month, dayNumber).DayOfWeek + " " + dayNumber + "/" + history.Month;

                var startTime = this.timeLabels[index++];
                startTime.Location = new Point(0, currentY + 20);
                startTime.Text = this.SecondToTime(todaysFirstSecond);

                var endTime = this.timeLabels[index++];
                endTime.Text = this.SecondToTime(todaysLastSecond);
                endTime.Location = new Point(width - endTime.Width, currentY + 20);

                var totalTime = this.timeLabels[index++];
                totalTime.Text = "("+this.SecondToTime(todaysLastSecond - todaysFirstSecond)+")";
                totalTime.Location = new Point(width - endTime.Width, currentY);

                var startpixel = ((todaysFirstSecond - firstTime) * this.graphWidth) / this.graphSeconds;
                var endPixel = ((todaysLastSecond - firstTime) * this.graphWidth) / this.graphSeconds;
                var graphbox = new Rectangle((int)startpixel + GraphStartPixel, currentY + Config.GraphHeight / 2 - daylineHeight / 2, (int)(endPixel - startpixel) + 1, daylineHeight);

                graphicsObj.DrawRectangle(pen, graphbox);

                foreach (var span in history.Days[dayNumber])
                {
                    startpixel = ((span.StartSecond - firstTime) * this.graphWidth) / this.graphSeconds;
                    endPixel = ((span.EndSecond - firstTime) * this.graphWidth) / this.graphSeconds;

                    var top = currentY + (span.WasActive ? 0 : 15);
                    var boxheight = span.WasActive ? Config.GraphHeight - 1 : Config.GraphHeight - 31;

                    graphbox = new Rectangle((int)startpixel + GraphStartPixel, top, (int)(endPixel - startpixel) + 1, boxheight);

                    //graphicsObj.DrawRectangle(pen, graphbox);
                    graphicsObj.FillRectangle(brush, graphbox);
                }

                currentY += Config.GraphSpacing + Config.GraphHeight;
            }

            graphicsObj.Dispose();
            this.historyPicture.Image = this.historyGraph;

            //if (timeLabels.Any())
            //{
            //    foreach (var timeLabel in timeLabels)
            //    {
            //        historyPanel.Controls.Remove(timeLabel);
            //    }
            //    timeLabels.Clear();
            //}
            //{
            //    var label = new Label();
            //    label.Name = "label1";
            //    label.Text = "HEJ 13:4" + new Random().Next(10);
            //    label.AutoSize = true;
            //    label.Location = new Point(10, 15);
            //    label.BackColor = Color.Transparent;
            //    label.BringToFront();
            //    //label.Parent = historyPanel;
            //    historyPicture.Controls.Add(label);
            //    timeLabels.Add(label);
            //}
            this.lastWindowWidth = this.ClientRectangle.Width;
            this.lastHistoryRedraw = DateTime.Now;
            this.forceRedraw = false;
        }
Example #27
0
        private void _DisplayErrorLabel()
        {
            this._Page.PageTitle = _Page.PageTitle + " (" + RsViewEngine.Locale.GetTagText("error") + ")";

            this.SuspendLayout();

            _ErrorLabel = new Label();
            _ErrorLabel.Name = "lErrorLabel";
            _ErrorLabel.BackColor = Color.FromArgb(255, 255, 200, 200);
            _ErrorLabel.TextAlign = ContentAlignment.MiddleCenter;
            _ErrorLabel.Text = RsViewEngine.Locale.GetTagText("appCrashedNotify");
            _ErrorLabel.BorderStyle = BorderStyle.FixedSingle;
            _ErrorLabel.Location = new Point(0, 0);
            _ErrorLabel.Size = new Size(this.ClientRectangle.Width, this.ClientRectangle.Height);
            _ErrorLabel.Font = RsViewEngine.TitleFont;
            _ErrorLabel.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom);

            this.Controls.Add(_ErrorLabel);
            _ErrorLabel.BringToFront();

            this.ResumeLayout();

            WindowManagement.SetParent(_ChildHandle, 0);
        }
Example #28
0
        public TileData(string text, int row, int column, string unit = "", EventHandler handler = null)
            : base(text, row, column)
        {
            this.unit = unit;
            ClickMethod = handler;
            panel = new Panel { Size = new Size(158, 64) };
            // panel.Dock = DockStyle.Fill;
            ;
            var headLabel = new Label()
            {
                Text = text,
                ForeColor = Color.FromArgb(255, 41, 171, 226),
                Font = new Font("Century Gothic", 10, FontStyle.Italic),
                Top = 10,
                Left = 10,
                Width = 160
            };
            var unitLabel = new Label()
            {
                Text = unit,
                ForeColor = Color.White,
                Font = new Font("Century Gothic", 12),
                TextAlign = ContentAlignment.BottomRight,
            };
            unitLabel.Top = 64 - unitLabel.Height - 12;
            unitLabel.Left = 158 - unitLabel.Width - 10;

            valueLabel = new Label()
            {
                ForeColor = Color.White,
                Font = new Font("Century Gothic", 18),
                Left = 10,
                Text = "0",
                Height = 25,
                Name = text.Replace(' ', '_').Replace('\n', '_')
            };
            valueLabel.Top = 64 - valueLabel.Height - 12;
            panel.Controls.Add(unitLabel);
            panel.Controls.Add(valueLabel);
            valueLabel.BringToFront();
            panel.Controls.Add(headLabel);
            panel.Click += ClickMethod;
            foreach (var label in panel.Controls.OfType<Label>())
            {
                label.Click += ClickMethod;
            }
            panel.Dock = DockStyle.Fill;
        }
Example #29
0
        private void InitializeComponent()
        {
            DrawMovementBar();
            this.btn       = new Button();
            btn.Location   = new Point(200, 200);
            this.LifeBar   = new SimpleProgressBar();
            this.MresBar   = new SimpleProgressBar();
            this.CombatBar = new SimpleProgressBar();

            this.LifeBar            = new SimpleProgressBar();
            this.MresBar            = new SimpleProgressBar();
            this.CombatBar          = new SimpleProgressBar();
            this.lblCanAttackUndead = new System.Windows.Forms.Label();
            this.lblIsUndead        = new System.Windows.Forms.Label();
            this.label2             = new System.Windows.Forms.Label();
            this.lblCombat          = new System.Windows.Forms.Label();
            this.lblMRes            = new System.Windows.Forms.Label();
            this.label1             = new System.Windows.Forms.Label();
            this.lblName            = new System.Windows.Forms.Label();
            this.HPlabel            = new System.Windows.Forms.Label();
            this.HPMAXlabel         = new System.Windows.Forms.Label();
            this.MRlabel            = new System.Windows.Forms.Label();
            this.MRMAXlabel         = new System.Windows.Forms.Label();
            this.CMBlabel           = new System.Windows.Forms.Label();
            this.CMAXlabel          = new System.Windows.Forms.Label();
            //
            // CombatBar
            //
            this.CombatBar.Location  = new System.Drawing.Point(270, 282);
            this.CombatBar.Size      = new System.Drawing.Size(131, 18);
            this.CombatBar.BackColor = Color.FromArgb(255, 0, 0);
            this.CombatBar.ForeColor = Color.FromArgb(0, 255, 0);
            ListOfControls.Add(CombatBar);
            //
            // MresBar
            //

            this.MresBar.Location  = new System.Drawing.Point(270, 248);
            this.MresBar.Size      = new System.Drawing.Size(131, 18);
            this.MresBar.BackColor = Color.FromArgb(255, 0, 0);
            this.MresBar.ForeColor = Color.FromArgb(0, 255, 0);
            ListOfControls.Add(MresBar);
            //
            // LifeBar
            //

            this.LifeBar.Location  = new System.Drawing.Point(270, 216);
            this.LifeBar.Name      = "LifeBar";
            this.LifeBar.Size      = new System.Drawing.Size(131, 18);
            this.LifeBar.BackColor = Color.FromArgb(255, 0, 0);
            this.LifeBar.ForeColor = Color.FromArgb(0, 255, 0);
            ListOfControls.Add(LifeBar);
            //
            // lblCanAttackUndead
            //
            this.lblCanAttackUndead.AutoSize  = true;
            this.lblCanAttackUndead.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblCanAttackUndead.ForeColor = System.Drawing.Color.Red;
            this.lblCanAttackUndead.Location  = new System.Drawing.Point(17, 568);
            this.lblCanAttackUndead.Name      = "lblCanAttackUndead";
            this.lblCanAttackUndead.Size      = new System.Drawing.Size(176, 18);
            this.lblCanAttackUndead.TabIndex  = 6;
            this.lblCanAttackUndead.Text      = "Can Attack Undead";
            ListOfControls.Add(lblCanAttackUndead);
            //
            // lblIsUndead
            //
            this.lblIsUndead.AutoSize  = true;
            this.lblIsUndead.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblIsUndead.ForeColor = System.Drawing.Color.Red;
            this.lblIsUndead.Location  = new System.Drawing.Point(17, 540);
            this.lblIsUndead.Name      = "lblIsUndead";
            this.lblIsUndead.Size      = new System.Drawing.Size(76, 18);
            this.lblIsUndead.TabIndex  = 5;
            this.lblIsUndead.Text      = "Undead";
            ListOfControls.Add(lblIsUndead);
            //
            // label2
            //
            this.label2.AutoSize  = true;
            this.label2.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.label2.Location  = new System.Drawing.Point(17, 352);
            this.label2.Name      = "label2";
            this.label2.Size      = new System.Drawing.Size(100, 18);
            this.label2.TabIndex  = 4;
            this.label2.Text      = "Movement";
            ListOfControls.Add(label2);
            //
            // lblCombat
            //
            this.lblCombat.AutoSize  = true;
            this.lblCombat.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblCombat.ForeColor = System.Drawing.Color.Fuchsia;
            this.lblCombat.Location  = new System.Drawing.Point(17, 279);
            this.lblCombat.Name      = "lblCombat";
            this.lblCombat.Size      = new System.Drawing.Size(76, 18);
            this.lblCombat.TabIndex  = 3;
            this.lblCombat.Text      = "Combat";
            ListOfControls.Add(lblCombat);
            //
            // lblMRes
            //
            this.lblMRes.AutoSize  = true;
            this.lblMRes.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblMRes.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.lblMRes.Location  = new System.Drawing.Point(17, 245);
            this.lblMRes.Name      = "lblMRes";
            this.lblMRes.Size      = new System.Drawing.Size(158, 18);
            this.lblMRes.TabIndex  = 2;
            this.lblMRes.Text      = "Magic Resistance";
            ListOfControls.Add(lblMRes);
            //
            // label1
            //
            this.label1.AutoSize  = true;
            this.label1.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.label1.Location  = new System.Drawing.Point(17, 213);
            this.label1.Name      = "label1";
            this.label1.Size      = new System.Drawing.Size(94, 18);
            this.label1.TabIndex  = 1;
            this.label1.Text      = "Life Force";
            ListOfControls.Add(label1);
            //
            // lblName
            //
            lblName.BringToFront();
            this.lblName.Font      = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
            this.lblName.Location  = new System.Drawing.Point(0, 0);
            this.lblName.Name      = "lblName";
            this.lblName.Size      = new System.Drawing.Size(322, 23);
            this.lblName.Text      = "MonsterName (WizardName)";
            ListOfControls.Add(lblName);
            //
            //HPlabel
            //
            this.HPlabel.AutoSize  = true;
            this.HPlabel.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.HPlabel.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.HPlabel.Location  = new System.Drawing.Point(230, 213);
            this.HPlabel.Name      = "HPlabel";
            this.HPlabel.Size      = new System.Drawing.Size(94, 18);
            this.HPlabel.TabIndex  = 1;
            ListOfControls.Add(HPlabel);
            //
            //HPMAXlabel
            //
            this.HPMAXlabel.AutoSize  = true;
            this.HPMAXlabel.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.HPMAXlabel.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.HPMAXlabel.Location  = new System.Drawing.Point(400, 213);
            this.HPMAXlabel.Name      = "HPMAXlabel";
            this.HPMAXlabel.Size      = new System.Drawing.Size(94, 18);
            this.HPMAXlabel.TabIndex  = 1;
            ListOfControls.Add(HPMAXlabel);
            //
            //MRlabel
            //
            this.MRlabel.AutoSize  = true;
            this.MRlabel.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.MRlabel.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.MRlabel.Location  = new System.Drawing.Point(230, 245);
            this.MRlabel.Name      = "MRlabel";
            this.MRlabel.Size      = new System.Drawing.Size(94, 18);
            this.MRlabel.TabIndex  = 1;
            ListOfControls.Add(MRlabel);
            //
            //MRMAXlabel
            //
            this.MRMAXlabel.AutoSize  = true;
            this.MRMAXlabel.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.MRMAXlabel.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.MRMAXlabel.Location  = new System.Drawing.Point(400, 245);
            this.MRMAXlabel.Name      = "MRMAXlabel";
            this.MRMAXlabel.Size      = new System.Drawing.Size(94, 18);
            this.MRMAXlabel.TabIndex  = 1;
            ListOfControls.Add(MRMAXlabel);
            //
            //CMBlabel
            //
            CMBlabel.AutoSize  = true;
            CMBlabel.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            CMBlabel.ForeColor = System.Drawing.Color.MediumTurquoise;
            CMBlabel.Location  = new System.Drawing.Point(230, 279);
            CMBlabel.Name      = "CMBlabel";
            CMBlabel.Size      = new System.Drawing.Size(94, 18);
            CMBlabel.TabIndex  = 1;
            ListOfControls.Add(CMBlabel);
            //
            //CMAXlabel
            //
            this.CMAXlabel.AutoSize  = true;
            this.CMAXlabel.Font      = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.CMAXlabel.ForeColor = System.Drawing.Color.MediumTurquoise;
            this.CMAXlabel.Location  = new System.Drawing.Point(400, 279);
            this.CMAXlabel.Name      = "CMAXlabel";
            this.CMAXlabel.Size      = new System.Drawing.Size(94, 18);
            this.CMAXlabel.TabIndex  = 1;

            ListOfControls.Add(CMAXlabel);
        }
        public void Initialize()
        {
            menuControls = new List<Control>();
            Panel dummy_panel;
            Label dummy_label;
            PictureBox dummy_picbox;

            #region create panels
            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(50, 147);
            dummy_panel.Size = new Size(235, 158);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            Globals._mainForm.Controls.Add(dummy_panel);
            dummy_panel.Click += new EventHandler(Globals._mainForm.go_to_list);

            dummy_picbox.Parent = dummy_panel;
            dummy_picbox.BackColor = Color.Transparent;
            dummy_picbox.Image = Properties.Resources.manage_people_hover;
            dummy_picbox.Location = new Point(3, 3);
            dummy_picbox.Size = new Size(86,86);
            dummy_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            dummy_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_picbox.Click += new EventHandler(Globals._mainForm.go_to_list);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Acceseaza Lista";
            dummy_label.Font = new Font("Segoe UI", 15);
            dummy_label.Location = new Point(80, 29);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(252, 32);
            dummy_label.BringToFront();
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_label.Click += new EventHandler(Globals._mainForm.go_to_list);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);

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

            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(291, 147);
            dummy_panel.Size = new Size(235, 76);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            dummy_panel.Click += new EventHandler(Globals._mainForm.peep_creator);
            Globals._mainForm.Controls.Add(dummy_panel);

            dummy_picbox.Parent = dummy_panel;
            //dummy_picbox.BackColor = Color.Transparent;
            dummy_picbox.Image = Properties.Resources.add_sambodeeh;
            dummy_picbox.Location = new Point(0,1);
            dummy_picbox.Size = new Size(76, 76);
            dummy_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            dummy_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_picbox.Click += new EventHandler(Globals._mainForm.peep_creator);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Adauga Cient";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(70, 24);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(177, 25);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_label.Click += new EventHandler(Globals._mainForm.peep_creator);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);

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

            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(291, 229);
            dummy_panel.Size = new Size(235, 76);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            Globals._mainForm.Controls.Add(dummy_panel);

            dummy_picbox.Parent = dummy_panel;
            dummy_picbox.BackColor = Color.Transparent;
            dummy_picbox.Image = Properties.Resources.search;
            dummy_picbox.Location = new Point(0,1);
            dummy_picbox.Size = new Size(76,76);
            dummy_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            dummy_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Cauta Client";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(70, 24);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(250, 25);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);

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

            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(50, 410);
            dummy_panel.Size = new Size(235, 158);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            dummy_panel.Click += new EventHandler(Globals._mainForm.go_to_templateM);
            Globals._mainForm.Controls.Add(dummy_panel);

            dummy_picbox.Parent = dummy_panel;
            dummy_picbox.BackColor = Color.Transparent;
            dummy_picbox.Image = Properties.Resources.manage_tempaltes;
            dummy_picbox.Location = new Point(-2,3);
            dummy_picbox.Size = new Size(86,86);
            dummy_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            dummy_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_picbox.Click += new EventHandler(Globals._mainForm.go_to_templateM);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Acceseaza Masuri";
            dummy_label.Font = new Font("Segoe UI", 15);
            dummy_label.Location = new Point(66,29);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(250, 25);
            dummy_label.BringToFront();
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_label.Click += new EventHandler(Globals._mainForm.go_to_templateM);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);

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

            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(291, 410);
            dummy_panel.Size = new Size(235, 76);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            dummy_panel.Click += new EventHandler(Globals._mainForm.template_creator);
            Globals._mainForm.Controls.Add(dummy_panel);

            dummy_picbox.Parent = dummy_panel;
            dummy_picbox.BackColor = Color.Transparent;
            dummy_picbox.Image = Properties.Resources.newnotifications_hover;
            dummy_picbox.Location = new Point(0,1);
            dummy_picbox.Size = new Size(76,76);
            dummy_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            dummy_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_picbox.Click += new EventHandler(Globals._mainForm.template_creator);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Adauga Masura";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(70,24);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(250, 25);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
            dummy_label.Click += new EventHandler(Globals._mainForm.template_creator);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);

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

            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(291, 492);
            dummy_panel.Size = new Size(235, 76);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            Globals._mainForm.Controls.Add(dummy_panel);

            dummy_picbox.Parent = dummy_panel;
            dummy_picbox.BackColor = Color.Transparent;
            dummy_picbox.Image = Properties.Resources.new_template;
            dummy_picbox.Location = new Point(0,1);
            dummy_picbox.Size = new Size(76,76);
            dummy_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
            dummy_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Importa Masuri";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(70, 24);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(250, 25);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);

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


            dummy_panel = new Panel();
            dummy_label = new Label();
            dummy_picbox = new PictureBox();

            dummy_panel.Location = new Point(542, 147);
            dummy_panel.Size = new Size(279, 421);
            dummy_panel.BackColor = Color.FromArgb(32,32,32);
            dummy_panel.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
            dummy_panel.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
            Globals._mainForm.Controls.Add(dummy_panel);

            dummy_label.Parent = dummy_panel;
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Empty ..so empty";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(18, 10);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(250, 25);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

            menuControls.Add(dummy_panel);
            menuControls.Add(dummy_label);
            menuControls.Add(dummy_picbox);


            #endregion

            #region decorative controls
            dummy_label = new Label();
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "People Manager";
            dummy_label.Font = new Font("Segoe UI", 24);
            dummy_label.Location = new Point(42,99);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.BringToFront();
            menuControls.Add(dummy_label);
            Globals._mainForm.Controls.Add(dummy_label);
            dummy_label.Size = new Size(260, 50);

            dummy_label = new Label();
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "Template Manager";
            dummy_label.Font = new Font("Segoe UI", 24);
            dummy_label.Location = new Point(42, 362);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.BringToFront();
            menuControls.Add(dummy_label);
            Globals._mainForm.Controls.Add(dummy_label);
            dummy_label.Size = new Size(288, 45);

            dummy_label = new Label();
            dummy_label.BackColor = Color.Transparent;
            dummy_label.Text = "News";
            dummy_label.Font = new Font("Segoe UI", 24);
            dummy_label.Location = new Point(534, 99);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.BringToFront();
            menuControls.Add(dummy_label);
            Globals._mainForm.Controls.Add(dummy_label);
            dummy_label.Size = new Size(98, 45);
            #endregion




        }
Example #31
0
        void Menu_Click(object sender, EventArgs e)
        {
            Program.TimerReset();
            var MenuButton = sender as Button;
            menu = new Menu();
            menu.Tag = MenuButton.Tag;
            menu.Parent = this;
            menu.Location = new Point(MenuButton.Location.X - 100, MenuButton.Location.Y + MenuButton.Height);
            mask = new Label();
            mask.BackColor = this.BackColor;
            mask.Size = this.Size;
            //mask.Location = this.Location;
            mask.Parent = this;
            mask.BringToFront();
            var nam = this.Controls[this.Controls.IndexOfKey("name" + menu.Tag.ToString())] as Button;
            var org = this.Controls[this.Controls.IndexOfKey("org" + menu.Tag.ToString())] as Label;
            nam.BringToFront();
            org.BringToFront();

            mask.Show();
            menu.VisitClass += Visit_Click;
            var c = list[(int)menu.Tag];
            nam.Enabled = false;
            menu.EditRecord += EditRecord_Click;
            menu.PrintLabel += PrintLabel_Click;
            menu.AddFamily += AddToFamily_Click;
            menu.JoinClass += Join_Click;
            if (c.cinfo.oid != 0)
            {
                menu.DropJoin.Visible = true;
                if (c.cinfo.mv == "M")
                {
                    menu.DropJoinClass += DropThis_Click;
                    menu.DropJoin.Text = "Drop This Class";
                }
                else
                {
                    menu.DropJoinClass += JoinThis_Click;
                    menu.DropJoin.Text = "Join This Class";
                }
            }
            else
                menu.DropJoin.Visible = false;
            menu.CancelMenu += new EventHandler(CancelMenu_Click);
            menu.Show();
            menu.BringToFront();
        }
Example #32
0
        private void createNames()
        {
            int left = 90;
            int top = 33;
            for (int i = 0; i < 8; i++)
            {
                Label label = new Label();
                label.Left = left;
                label.Top = top;
                if ((i % 2) == 1)
                {
                    label.Text = "RAAS";
                    left += 120;
                }
                else
                {
                    label.Text = "Betablokker";
                    left += 80;
                }

                this.Controls.Add(label);
                label.BringToFront();

            }
        }
Example #33
0
		public void Attend_Click(Button ab)
		{
			Program.TimerReset();
			var c = list[(int)ab.Tag];
			if (c.lastpress.HasValue && DateTime.Now.Subtract(c.lastpress.Value).TotalSeconds < 1)
				return;

			if (c.access == "restricted") {
				Program.attendant.AddHistoryString("-- " + DateTime.Now.ToString("MM-dd-yy hh:mm tt") + " Check-in rejected for " + c.name + " because they are not permitted to use the facility.");
				MessageBox.Show("An access error has occurred. Please check with the attendant.", "Access Error");
				return;
			} else if (c.access == "timer") {
				Program.attendant.AddHistoryString("-- " + DateTime.Now.ToString("MM-dd-yy hh:mm tt") + " Check-in rejected for " + c.name + " because they have logged in recently.");
				MessageBox.Show("An access error has occurred. Please check with the attendant.", "Access Error");
				return;
			} else if (c.access == "true") {
				c.accesstype = 1;
			} else {
				if (c.visitcount < Program.BuildingInfo.maxvisits && Program.addguests == null) {
					MessageBox.Show("Welcome " + c.name + "! This is visit number " + (c.visitcount + 1) + " of " + Program.BuildingInfo.maxvisits + ".", "Guest Information");
					c.accesstype = 2;
				} else {
					if (Program.addguests == null) {
						Program.attendant.AddHistoryString("-- " + DateTime.Now.ToString("MM-dd-yy hh:mm tt") + " Check-in rejected for " + c.name + " because they are not a member.");
						MessageBox.Show("Only members may check-in. You will need to be a guest of a member to check-in.", "Members Only Error");
						return;
					}

					if (Program.BuildingInfo.maxguests > -1) {
						var p = Program.GuestOf();

						if (p != null && Util.GetGuestCount(p.pid) >= Program.BuildingInfo.maxguests) {
							Program.attendant.AddHistoryString("-- " + DateTime.Now.ToString("MM-dd-yy hh:mm tt") + " Check-in rejected for " + c.name + " because " + p.name + " reached the guest limit.");
							MessageBox.Show("No additional guests are permitted for today.", "Guest Limit Error");
							return;
						}

						c.accesstype = 3;
					}
				}
			}

			var pb = Program.attendant.pictureBox1;
			pb.SetPropertyThreadSafe(() => pb.Image, Util.GetImage(c.pid));
			var na = Program.attendant.NameDisplay;
			na.SetPropertyThreadSafe(() => na.Text, c.name);
			var notes = Program.attendant.notes;
			notes.SetPropertyThreadSafe(() => notes.Text, c.notes);

			activities = new BuildingChooseActivities();
			activities.ControlBox = false;
			activities.Tag = ab.Tag;
			activities.StartPosition = FormStartPosition.Manual;
			activities.Location = new Point(Program.baseform.Location.X + 100, Program.baseform.Location.Y + 100);
			activities.Text = "Choose Activities for " + c.name;

			activities.list.Items.Clear();
			foreach (var i in Program.BuildingInfo.Activities)
				activities.list.Items.Add(i);
			activities.ok.Tag = ab;
			activities.cancel.Tag = ab;
			activities.AcceptButton = activities.ok;
			activities.CancelButton = activities.cancel;
			activities.ok.Click += ok_Click;
			activities.cancel.Click += cancel_Click;

			mask = new Label();
			mask.BackColor = BackColor;
			mask.Size = Size;
			//mask.Location = this.Location;
			mask.Parent = this;
			mask.BringToFront();
			var nam = this.Controls[this.Controls.IndexOfKey("name" + ab.Tag.ToString())] as Button;
			var org = this.Controls[this.Controls.IndexOfKey("org" + ab.Tag.ToString())] as Label;
			nam.BringToFront();
			org.BringToFront();

			mask.Show();
			nam.Enabled = false;
			activities.ShowDialog();
			activities.BringToFront();
		}
Example #34
0
 private void btHelpLookup_Click(object sender, System.EventArgs e)
 {
     lblHelpLookup.Visible = true;
     lblHelpLookup.BringToFront();
 }
Example #35
0
        Boolean m_IsFullScreen = false;//标记是否全屏
        public void FullScreenInAndOut() // 直接调用,每次取反
        {

            if (_play.isScreen == false)
            {
                Cursor.Hide();
                //记录播放器尺寸位置
                _play.position.Top = _Player.Top;
                _play.position.Left = _Player.Left;
                _play.position.Width = _Player.Width;
                _play.position.Height = _Player.Height;
                maxForm = new Form();//实例化新窗口设置屏幕设备大小 并置于播放器父窗口
                

                maxForm.Width = Screen.PrimaryScreen.Bounds.Width;
                maxForm.Height = Screen.PrimaryScreen.Bounds.Height;
                maxForm.FormBorderStyle = FormBorderStyle.None;
                _Player.Parent = maxForm;
                maxFormLable = new Label();
                maxFormLable.Width = 120;
                
                maxFormLable.Font = new Font("微软雅黑", 12);
                maxFormLable.ForeColor = SystemColors.ButtonHighlight;
                maxFormLable.BackColor = SystemColors.ActiveCaptionText;
                maxForm.Controls.Add(maxFormLable);
                maxForm.Show();
                maxForm.TopMost = true;
                _play.isScreen = true;
                Win32.SetParent((int)_Player.Handle, (int)maxForm.Handle);
                _Player.Left = 0;
                _Player.Top = 0;
                _Player.Width = Screen.PrimaryScreen.Bounds.Width;
                _Player.Height = Screen.PrimaryScreen.Bounds.Height;
                maxFormLable.BringToFront();
                label3.Text = "开启全屏播放";
            }
            else
            {
                Cursor.Show();
                _Player.Parent = this;
                _Player.Dock = DockStyle.Fill;
                _Player.BringToFront();
                _play.isScreen = false;
                Win32.SetParent((int)_Player.Handle, (int)this.Handle);
                _Player.Top = _play.position.Top + paneltop.Height;
                _Player.Left = _play.position.Left;
                _Player.Width = _play.position.Width;
                _Player.Height = _play.position.Height - paneltop.Height - panelbottom.Height - panelpro.Height;
                maxForm.Visible = false;
                maxForm.Close();
                maxForm.Dispose();
                label3.Text = "取消全屏播放";
            }
        }
Example #36
0
        internal bool Collides(Vector[] points, int carX, int carY)
        {
            var returnvalue = false;

            var carGridX = (int)(carX  / elementWidth);
            var carGridY = (int)(carY / elementHeight);
            for (var i = 0; i < points.Length; i++)
            {
                var point = points[i];

                var px = (int)(point.X / elementWidth);
                var py = (int)(point.Y / elementHeight);
                var ctrl = new Label() { BackColor = Color.Green, Text = "", Location = new System.Drawing.Point((int)point.X, (int)point.Y), Width = 5, Height = 5 };
                if (px != carGridX || py != carGridY)
                {
                    if (px < grid.GridElementCollection.Length && px >= 0)
                    {
                        var side = grid.GridElementCollection[px];
                        if (py < side.Length && py >= 0)
                        {
                            if (side[py].PassableSides == 0)
                            {
                                returnvalue = true;
                                ctrl.BackColor = Color.Yellow;
                            }
                        }
                        else
                        {
                            returnvalue = true;
                            ctrl.BackColor = Color.Yellow;
                        }
                    }
                    else
                    {
                        returnvalue = true;
                        ctrl.BackColor = Color.Yellow;
                    }
                }
            #if (DEBUG)
                if (debugMAP != null)
                {
                    ctrls.Add(ctrl);
                    debugMAP.Controls.Add(ctrl);
                    ctrl.BringToFront();
                }
            #endif
            }

            return returnvalue;
        }
        private void crearCamposAdicionales()
        {
            int x = 10, y = 25;
            int x2 = 500;
            int contador = 0;
            this.analizarNombresDeLotes(etq.TipoEtiqueta, etq.VariacionEtiqueta);
            lista_camposCodBarr = new List<string>();
            camposPropiedadEtiqueta = new List<string>();
            this.NoHayTara = true;
            foreach (string campo in columnasPorUsar)
            {
                DateTimePicker datePicker = new DateTimePicker();
                Label lbl = new Label();
                TextBox txt = new TextBox();
                ComboBox comboDirecc = new ComboBox();
                ComboBox embarque = new ComboBox();
                comboDirecc.MouseWheel += new MouseEventHandler(deshabilitarRuedaDeMouse);
                contador++;
                if (campo[0] == 'b' && campo[1] == 'c' && campo[2] == 'd')
                {
                    lista_camposCodBarr.Add(campo);
                    continue;
                }
                if (diccionario_propiedadesEtq.ContainsKey(campo))
                {
                    if (diccionario_propiedadesEtq[campo] == "Etiqueta.PesoBruto" || diccionario_propiedadesEtq[campo] == "Etiqueta.PesoNeto")
                        continue;
                }
                if (!diccionario_lotes.Keys.Contains(campo))
                {
                    if (Regex.IsMatch(campo, @".*date.*", RegexOptions.IgnoreCase) || Regex.IsMatch(campo, @".*fecha.*", RegexOptions.IgnoreCase)) //fecha
                    {
                        datePicker.Location = new Point(x2, y);
                        datePicker.Name = campo;
                        datePicker.Format = DateTimePickerFormat.Short;
                        datePicker.TabStop = false;
                        gb_CamposAdicionales.Controls.Add(datePicker);
                        
                    }
                    else if (diccionario_propiedadesEtq.ContainsKey(campo))
                    {
                        if (diccionario_propiedadesEtq[campo] == "Etiqueta.Direccion") //el campo es una direccion
                        {
                            txt.Name = campo;
                            txt.ForeColor = Color.Black;
                            txt.BackColor = Color.White;
                            txt.Location = new Point(x2, y);
                            txt.Text = "";
                            txt.Width *= 3;
                            txt.Leave += new EventHandler(convertirMayusculas);
                            txt.Leave += new EventHandler(AsignarCliente);
                            txt.KeyDown += new KeyEventHandler(enter_tabChange);
                            gb_CamposAdicionales.Controls.Add(txt);
                        }
                        else if (diccionario_propiedadesEtq[campo] == "Etiqueta.Tara")
                        {
                            txt.Name = campo;
                            txt.ForeColor = Color.Black;
                            txt.BackColor = Color.White;
                            txt.Location = new Point(x2, y);
                            gb_CamposAdicionales.Controls.Add(txt);
                            txt.Leave += new EventHandler(tara_leave);
                            txt.KeyDown += new KeyEventHandler(enter_tabChange);
                            Label tara_unidades = new Label();
                            tara_unidades.Name = "lblUnidadesTara";
                            tara_unidades.ForeColor = Color.Black;
                            tara_unidades.BackColor = Color.Transparent;
                            tara_unidades.Location = new Point(x2, y);
                            tara_unidades.Text = etq.UnidadPesos;
                            gb_CamposAdicionales.Controls.Add(tara_unidades);
                            this.NoHayTara = false;

                        }
                        else if (diccionario_propiedadesEtq[campo] == "Etiqueta.Embarque")
                        {
                            embarque.Name = campo;
                            embarque.ForeColor = Color.Black;
                            embarque.BackColor = Color.White;
                            embarque.Location = new Point(x2, y);
                            embarque.Enabled = true;
                            embarque.DropDownStyle = ComboBoxStyle.DropDownList;
                            if (etq.obtenerEmbarques())
                            {
                                foreach (string em in etq.ListaEmbarques)
                                {
                                    embarque.Items.Add(em);
                                    cmbEmbarqueFijo.Items.Add(em);
                                }
                            }
                            embarque.SelectedIndexChanged += new EventHandler(EmbarqueSeleccionado);
                            embarque.KeyDown += new KeyEventHandler(enter_tabChange);
                            embarque.SelectedIndex = 0;
                            gb_CamposAdicionales.Controls.Add(embarque);
                        }
                        else
                        {
                            txt.Name = campo;
                            txt.ForeColor = Color.Black;
                            txt.BackColor = Color.White;
                            txt.Location = new Point(x2, y);
                            txt.Leave += new EventHandler(convertirMayusculas);
                            txt.KeyDown += new KeyEventHandler(enter_tabChange);
                            if (diccionario_equivalencias.ContainsKey(txt.Name))
                            {
                                if (diccionario_equivalencias[txt.Name] == "lbl_panel_Corte")
                                    txt.Leave -= convertirMayusculas;
                                if (diccionario_equivalencias[txt.Name] == "lbl_panel_Calibre")
                                    txt.Leave -= convertirMayusculas;
                                if (diccionario_equivalencias[txt.Name] == "lbl_panel_ClaveProducto")
                                    txt.Enabled = false;
                            }
                            if (diccionario_propiedadesEtq.ContainsKey(campo))
                            {
                                if (diccionario_propiedadesEtq[campo] == "Etiqueta.PedidoCliente")
                                    txt.Enabled = false;
                            }
                            gb_CamposAdicionales.Controls.Add(txt);
                        }
                    }
                    else
                    {
                        txt.Name = campo;
                        txt.ForeColor = Color.Black;
                        txt.BackColor = Color.White;
                        txt.Location = new Point(x2, y);
                        txt.Leave += new EventHandler(convertirMayusculas);
                        txt.KeyDown += new KeyEventHandler(enter_tabChange);
                        gb_CamposAdicionales.Controls.Add(txt);
                        if (diccionario_equivalencias.ContainsKey(txt.Name))
                        {
                            if (diccionario_equivalencias[txt.Name] == "lbl_panel_Corte")
                                txt.Leave -= convertirMayusculas;
                            if(diccionario_equivalencias[txt.Name] == "lbl_panel_Calibre")
                                txt.Leave -= convertirMayusculas;
                            if (diccionario_equivalencias[txt.Name] == "lbl_panel_ClaveProducto")
                                txt.Enabled = false;
                        }
                    }
                    lbl.BringToFront();
                    lbl.AutoSize = true;
                    lbl.ForeColor = Color.Black;
                    lbl.Text = diccionario_relaciones[campo];
                    lbl.Location = new Point(x, y);
                    gb_CamposAdicionales.Controls.Add(lbl);
                    diccionario_relaciones_usadas.Add(campo, diccionario_relaciones[campo]);

                }
                else //el campo es un lote
                {
                    if (diccionario_lotes[campo] == "LoteProduccion")
                        continue;

                    lbl.ForeColor = Color.Black;
                    lbl.Text = diccionario_relaciones[campo];
                    lbl.Location = new Point(x, y);
                    gb_CamposAdicionales.Controls.Add(lbl);
                    txt.Name = campo;
                    txt.ForeColor = Color.Black;
                    txt.BackColor = Color.White;
                    txt.Location = new Point(x2, y);
                    txt.KeyDown += new KeyEventHandler(enter_tabChange);
                    txt.Leave += new EventHandler(convertirMayusculas);
                    
                    gb_CamposAdicionales.Controls.Add(txt);
                    gb_PesoLote.Visible = true;
                }
            }
            gb_PesoLote.Visible = true;
            this.acomodarControlesDeGroupBox(gb_CamposAdicionales);
            if (this.NoHayTara)
                chkActivarTara.Enabled = true;
            else
                chkActivarTara.Enabled = false;
            this.relacionarCamposRepetidos(gb_CamposAdicionales);

        }
Example #38
0
 private Label ShowInfoTooltip(string msg, Point location)
 {
     var l = new Label
     {
         Text = msg,
         Location = location,
         BackColor = Color.FromArgb(255, 246, 115),
         Padding = new Padding(4),
         TextAlign = ContentAlignment.MiddleCenter,
         AutoSize = true,
         MinimumSize = new Size(120, 15),
         MaximumSize = new Size(120, 300)
     };
     this.Controls.Add(l);
     l.BringToFront();
     return l;
 }
Example #39
0
		void Menu_Click(object sender, EventArgs e)
		{
			Program.TimerReset();
			var MenuButton = sender as Button;
			menu = new BuildingMenu();
			menu.Tag = MenuButton.Tag;
			menu.Parent = this;
			menu.Location = new Point(MenuButton.Location.X - 100, MenuButton.Location.Y + MenuButton.Height);
			mask = new Label();
			mask.BackColor = this.BackColor;
			mask.Size = this.Size;
			//mask.Location = this.Location;
			mask.Parent = this;
			mask.BringToFront();
			var nam = this.Controls[this.Controls.IndexOfKey("name" + menu.Tag.ToString())] as Button;
			var org = this.Controls[this.Controls.IndexOfKey("org" + menu.Tag.ToString())] as Label;
			nam.BringToFront();
			org.BringToFront();

			mask.Show();
			var c = list[(int)menu.Tag];
			nam.Enabled = false;
			menu.EditRecord += EditRecord_Click;
			menu.AddFamily += AddToFamily_Click;
			menu.CancelMenu += CancelMenu_Click;
			menu.Show();
			menu.BringToFront();
		}
        private Label ProduceMarkerLabel(Control control)
        {
            Label _label = new Label();

            _label.Size = new Size(5, 5); _label.BackColor = Color.OrangeRed;
            _label.Location = control.Location; _label.Name = "lblNew_" + control.Name;
            _label.Visible = true; _label.Show(); _label.BringToFront();

            if (control.Parent != null)
            {
                control.Parent.Controls.Add(_label);
                _label.Show(); _label.BringToFront();
            }

            return _label;
        }
Example #41
0
 private void lbltat_MouseEnter(object sender, System.EventArgs e)
 {
     lbltat.Visible = true;
     lbltat.BringToFront();
 }
 public static Label add_Label(this IStep step, string text, int top, int left)
 {            
     if (step.UI == null)
         return null;
     return (Label) step.UI.invokeOnThread(
                        () =>
                            {
                                var label = new Label();
                                label.AutoSize = true;
                                label.Text = text;
                                if (top > -1)
                                    label.Top = top;
                                if (left > -1)
                                    label.Left = left;
                                step.UI.Controls.Add(label);
                                label.AutoSize = true;
                                label.BringToFront();
                                return label;
                            });
 }
Example #43
0
        /// <summary> 设置容器内控件替换为label
        /// </summary>
        /// <param name="cnl">容器控件</param>
        /// <param name="isCanUse">是否可用</param>
        public static void SetControlForLable(Control pControl, bool isShowButton)
        {
            int count = pControl.Controls.Count;
            for (int i = 0; i < count; i++)
            {
                var cnl = pControl.Controls[i];
                if (cnl is TextBoxEx)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;                    
                    lable.Size = cnl.Size;
                    //lable.Location = cnl.Location;
                    lable.Location = new System.Drawing.Point(cnl.Location.X, cnl.Location.Y + 4);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    TextBoxEx txt = cnl as TextBoxEx;
                    lable.Text = txt.Caption;
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                if (cnl is TextChooser)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    //lable.Location = cnl.Location;
                    lable.Location = new System.Drawing.Point(cnl.Location.X, cnl.Location.Y + 4);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    TextChooser txt = cnl as TextChooser;
                    lable.Text = txt.Text;
                    pControl.Controls.Remove(cnl);
                    i--;
                }

                if (cnl is ComboBoxEx || cnl is ComboBox)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    //lable.Location = cnl.Location;
                    lable.Location = new System.Drawing.Point(cnl.Location.X, cnl.Location.Y + 4);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    lable.Text = cnl.Text;
                    if (cnl.Text == "全部" || cnl.Text == "请选择")
                    {
                        lable.Text = "";
                    }
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is TextBox || cnl is ComboBox)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    //lable.Location = cnl.Location;
                    lable.Location = new System.Drawing.Point(cnl.Location.X, cnl.Location.Y + 4);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    lable.Text = cnl.Text;
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is NumericUpDown)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    lable.Location = new System.Drawing.Point(cnl.Location.X, cnl.Location.Y + 4);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    lable.Text = cnl.Text;
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is ServiceStationClient.ComponentUI.DateTimePickerEx)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    lable.Location = cnl.Location;
                    DateTimePickerEx dtp = cnl as DateTimePickerEx;
                    lable.Text = dtp.Value.ToString(dtp.ShowFormat);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is CheckBox)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    lable.Location = cnl.Location;
                    CheckBox cb = cnl as CheckBox;
                    if (cb.Checked)
                    {
                        lable.Text = "☑" + cb.Text;
                    }
                    else
                    {
                        lable.Text = "□" + cb.Text;
                    }
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is RadioButton)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    lable.Location = cnl.Location;
                    RadioButton rb = cnl as RadioButton;
                    if (rb.Checked)
                    {
                        lable.Text = "☑" + rb.Text;
                    }
                    else
                    {
                        lable.Text = "□" + rb.Text;
                    }
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is DateTimePicker)
                {
                    Label lable = new Label();
                    lable.AutoSize = false;
                    lable.Size = cnl.Size;
                    lable.Location = cnl.Location;
                    DateTimePicker dtp = cnl as DateTimePicker;
                    lable.Text = dtp.Value.ToString(dtp.CustomFormat);
                    pControl.Controls.Add(lable);
                    lable.BringToFront();
                    pControl.Controls.Remove(cnl);
                    i--;
                }
                else if (cnl is Button || cnl is ServiceStationClient.ComponentUI.ButtonEx)
                {
                    cnl.Visible = isShowButton;
                    cnl.Enabled = false;
                }
                if (cnl is Label)
                {
                    if (cnl.Text == "*")
                    {
                        cnl.Visible = false;
                    }
                }
                else if (cnl is DataGridView)
                {
                    DataGridView dgv = cnl as DataGridView;
                    dgv.ReadOnly = true;
                }
                else
                {
                    if (cnl.HasChildren)
                    {
                        SetControlForLable(cnl,isShowButton);
                    }
                }
            }
        }