示例#1
0
        private void serverConnect_Click(object sender, System.EventArgs e)
        {
            activeConfig            = (ServerConfig)servers[serverList.SelectedIndex];
            server.ConnectionString = "server=" + activeConfig.host + ";uid=" + activeConfig.uid +
                                      ";pwd=" + activeConfig.pwd + ";pooling=false;database=mysql";
            MessageBox.Show(server.ConnectionString, "connstr");
            objectList.Items.Clear();
            activeServer.Text = activeConfig.name;

            try
            {
                server.Open();

                MySqlCommand cmd = new MySqlCommand("SHOW DATABASES", server);
                using (MySqlDataReader reader = cmd.ExecuteReader())
                {
                    dbList.Items.Clear();
                    while (reader.Read())
                    {
                        dbList.Items.Add(reader.GetString(0));
                    }
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }

            showServerPanel.BringToFront();
        }
示例#2
0
 public void ShowLogPanel()
 {
     logItem.Checked = logPanel.Visible = true;
     logPanel.BringToFront();
     logBox.Focus();
     logBox.SelectionStart = logBox.TextLength;
     logBox.ScrollToCaret();
 }
        private void AddCardDiscardPile(MouseEventArgs e, Panel sourcePanel, DiscardPile discardPile, ref Point lastLocation, MouseEventHandler methodToHandle)
        {
            if (e.Button == MouseButtons.Left)
            {
            if (wPile.getCount() > 0)
            {
                Card card = wPile.getLastCardInPile();
                discardPile.AddToPile(card);
                if (discardPile.getCount() == 1)
                    sourcePanel.BackgroundImage = card.getCardImage();
                else
                {
                    Panel p = new Panel();
                    p.BackgroundImage = card.getCardImage();
                    p.Height = sourcePanel.Height;
                    p.Width = sourcePanel.Width;
                    lastLocation.Offset(0, 20);
                    p.Location = lastLocation;
                    lastLocation = p.Location;
                    p.MouseDown += new System.Windows.Forms.MouseEventHandler(methodToHandle);
                    this.Controls.Add(p);
                    p.BringToFront();
                }

                //Remove card from the waste pile
                wPile.removeCard(card);
                wastePilePicture.BackgroundImage = null;
            }
            }
        }
示例#4
0
        /// <summary>
        ///		Updates the wizard layout to match the suggested <see cref="PageLayout"/>.
        /// </summary>
        /// <param name="layout">The suggested layout to use</param>
        protected virtual void UpdateLayout(PageLayout layout)
        {
            // Should we perform a layout?
            if (layout == PageLayout.None)
            {
                return;
            }

            SuspendLayout();
            try
            {
                switch (layout)
                {
                case PageLayout.InteriorPage:
                    // Show the top bar
                    wizardTop.Visible = true;
                    wizardTop.Dock    = DockStyle.Top;
                    wizardTop.Height  = 64;

                    // Show the top line
                    topLine.Visible = true;
                    topLine.Dock    = DockStyle.Top;

                    // Hide the side bar
                    sidePanel.Visible = false;

                    // Position and size the step panel
                    panelStep.Dock            = DockStyle.Fill;
                    panelStep.DockPadding.All = 8;

                    BackColor           = SystemColors.Control;
                    panelStep.BackColor = SystemColors.Control;
                    break;

                case PageLayout.ExteriorPage:
                    // Hide the top bar
                    wizardTop.Visible = false;
                    topLine.Visible   = false;

                    //BackColor = Color.White;
                    panelStep.BackColor = Color.White;

                    panelStep.Dock = DockStyle.Fill;

                    sidePanel.Visible = true;
                    sidePanel.Dock    = DockStyle.Left;
                    sidePanel.Width   = 160;
                    break;

                default:
                    throw new InvalidOperationException("WizardLayout is not set to one of the allowed values");
                }

                panelStep.BringToFront();
            }
            finally
            {
                ResumeLayout();
            }
        }
示例#5
0
        public void add_total(int total)
        {
            for (int i = 0; i < total; i++)
            {
                Panel Temp_Panel = new Panel();
                Temp_Panel.BackColor = System.Drawing.Color.Aqua;
                Temp_Panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                Temp_Panel.BringToFront();
                Temp_Panel.Location = new System.Drawing.Point(X_Location, Y_Location);
                Temp_Panel.Name = "Panel" + i;
                Temp_Panel.Size = new System.Drawing.Size(10, 16);
                panels.Add(Temp_Panel);
                Temp_Panel = null;
                if (Temp_Panel != null)
                    Temp_Panel.Dispose();
                write_controls(panels.Count - 1);
                //Controls.Add(panels[panels.Count - 1]);

                if ((X_Location + 16) > 575)
                {
                    write_textbox("\r\n");
                    Y_Location += 18;
                    X_Location = 4;

                }
                else
                    X_Location += 16;
                //panels[panels.Count - 1].Show();
            }
            write_progress(0, panels.Count);
            if (panels.Count >= 200)
                MessageBox.Show("Achievement Unlocked: Over 200!", "Achievement Unlocked", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
示例#6
0
        public GiveawaysWindow(IExtension sender)
        {
            InitializeComponent();

            ini = new Settings(sender, "Settings.ini", "[Default]");

            UI.CenterSpacer(GiveawayTypeLabel, GiveawayTypeSpacer);
            UI.CenterSpacer(GiveawaySettingsLabel, GiveawaySettingsSpacer, false, true);
            UI.CenterSpacer(GiveawayBansLabel, GiveawayBansSpacer);
            UI.CenterSpacer(GiveawayUsersLabel, GiveawayUsersSpacer);

            Panel panel = new Panel();
            panel.Size = new Size(1, 1);
            panel.Location = new Point(GiveawayTypeSpacer.Location.X + GiveawayTypeSpacer.Size.Width - 1, GiveawayTypeSpacer.Location.Y + 9);
            Controls.Add(panel);
            panel.BringToFront();
            panel = new Panel();
            panel.Size = new Size(1, 1);
            panel.Location = new Point(GiveawayBansSpacer.Location.X + GiveawayBansSpacer.Size.Width - 1, GiveawayBansSpacer.Location.Y + 9);
            Controls.Add(panel);
            panel.BringToFront();
            /*panel.BackColor = Color.Black;
            panel.Size = new Size(Giveaway_AddPresent.Size.Width + Giveaway_RemovePresent.Size.Width, 1);
            panel.Location = new Point(Giveaway_AddPresent.Location.X, Giveaway_AddPresent.Location.Y + 1);
            Controls.Add(panel);
            panel.BringToFront();*/
        }
示例#7
0
 private void butBieudo_CheckedChanged(object sender, System.EventArgs e)
 {
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
         tu.Focus();
         return;
     }
     ucChart1.Visible = butBieudo.Checked;
     panel1.Visible   = ucChart1.Visible;
     if (panel1.Visible)
     {
         panel1.BringToFront();
         ucChart1.Chart.ChartType = ChartTypes.Bar;
         ucChart1.Chart.Series.Items.Clear();
         ucChart1.Chart.CategoryX.Items.Clear();
         panel1.Controls.Clear();
         try
         {
             ucChart1.Chart.CategoryX.Items.Add(new ChartCategory(noidung.Text.ToUpper(), 0));
             int i = 0;
             foreach (DataRow r in ds.Tables[0].Rows)
             {
                 float [] f = { float.Parse(r["solieu"].ToString()) };
                 ucChart1.Chart.Series.Items.Add(new ChartSerie(m.getColor(i), Color.Black, f));
                 title(r["tenbenh"].ToString(), r["maicd"].ToString(), i, i * 26 + 8, decimal.Parse(r["solieu"].ToString()));                //40
                 i++;
             }
             ucChart1.Refresh();
         }
         catch {}
     }
 }
示例#8
0
        private void ReportDesign_Load(object sender, System.EventArgs e)
        {
            this.ParentForm.KeyPreview = true;
            this.ParentForm.Closed    += new EventHandler(ParentForm_Closed);
            this.ParentForm.KeyDown   += new KeyEventHandler(ParentForm_KeyDown);
            this.ParentForm.KeyUp     += new KeyEventHandler(ParentForm_KeyUp);

            panLeftTop.Location = new Point(0, 0);
            panLeftTop.Size     = new Size(rulerLeft.Width, rulerTop.Height);

            rulerTop.Location  = new Point(panLeftTop.Width, 0);
            rulerLeft.Location = new Point(0, rulerTop.Height);
            panDesign.Location = new Point(rulerLeft.Width, rulerTop.Height);

            panRightBottom.Location = new Point(panMain.Width - panRightBottom.Width, panMain.Height - panRightBottom.Height);

            hscrBar.Location = new Point(rulerLeft.Width, panMain.Height - hscrBar.Height);
            hscrBar.Size     = new Size(panMain.Width - rulerLeft.Width - panRightBottom.Width, hscrBar.Height);

            vscrBar.Location = new Point(panMain.Width - vscrBar.Width, rulerTop.Height);
            vscrBar.Size     = new Size(vscrBar.Width, panMain.Height - rulerTop.Height - panRightBottom.Height);
            rulerLeft.Size   = new Size(rulerLeft.Width, panMain.Height - rulerLeft.Top);


            rulerLeft.BringToFront();
            rulerTop.BringToFront();
            hscrBar.BringToFront();
            vscrBar.BringToFront();
            panLeftTop.BringToFront();
        }
示例#9
0
 private void buttonYeniPalet_Click(object sender, System.EventArgs e)
 {
     panelCari.Location = new Point(8, 8);
     panelCari.BringToFront();
     panelCari.Visible = true;
     return;
 }
示例#10
0
        private void frmMain_MdiChildActivate(object sender, System.EventArgs e)
        {
            pForm.BringToFront();
//			if (Screen.PrimaryScreen.WorkingArea.Width >= 800)
//			{
            pButton.Visible = true;
            pButton.Dock    = DockStyle.Top;
//			}
        }
示例#11
0
 private void C2iImageViewer_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (!m_bIsMoving)
     {
         Point pt = new Point(e.X, e.Y);
         if (sender is Control)
         {
             pt = ((Control)sender).PointToScreen(pt);
         }
         pt = PointToClient(pt);
         if (pt.X < m_panelMenu.Right && pt.Y < m_panelMenu.Height)
         {
             if (Size.Width > m_panelMenu.Width * 4 && Size.Height > m_panelMenu.Height * 4)
             {
                 m_panelMenu.Visible = true;
                 m_panelMenu.BringToFront();
             }
         }
         else
         {
             m_panelMenu.Visible = false;
         }
     }
     else
     {
         Point pt = new Point(e.X, e.Y);
         pt = ((Control)sender).PointToScreen(pt);
         Point newPos = new Point(m_wndImage.Left - m_ptOrigine.X + pt.X, m_wndImage.Top - m_ptOrigine.Y + pt.Y);
         if (m_wndImage.Width > ClientRectangle.Width)
         {
             if (newPos.X > 0)
             {
                 newPos.X = 0;
             }
             if (newPos.X + m_wndImage.Width < ClientRectangle.Width)
             {
                 newPos.X = ClientRectangle.Width - m_wndImage.Width;
             }
             pt.X = newPos.X - m_wndImage.Left + m_ptOrigine.X;
         }
         if (m_wndImage.Height > ClientRectangle.Height)
         {
             if (newPos.Y > 0)
             {
                 newPos.Y = 0;
             }
             if (newPos.Y + m_wndImage.Height < ClientRectangle.Height)
             {
                 newPos.Y = ClientRectangle.Height - m_wndImage.Height;
             }
             pt.Y = newPos.Y - m_wndImage.Top + m_ptOrigine.Y;
         }
         m_wndImage.Location = newPos;
         m_ptOrigine         = pt;
     }
 }
示例#12
0
        /// <summary>
        /// Creates the waiting box.
        /// </summary>
        /// User:Ryan  CreateTime:2012-8-5 16:22.
        private void CreateWaitingBox()
        {
            if (!this._IsWaitingBoxCreated)
            {
                #region CreateWaitingBox

                this.waitingBox = new System.Windows.Forms.Panel();
                //ControlHelper.BindMouseMoveEvent(this.waitingBox);
                waitingBox.BackColor = Color.FromArgb(234, 244, 252);
                ////innerpanel
                waitingBoxInnerPanel                = new TXPanel();
                waitingBoxInnerPanel.Width          = 280;
                waitingBoxInnerPanel.Height         = 80;
                waitingBoxInnerPanel.CornerRadius   = 6;
                waitingBoxInnerPanel.BackBeginColor = Color.White;
                waitingBoxInnerPanel.BackEndColor   = Color.White;
                waitingBoxInnerPanel.Padding        = new System.Windows.Forms.Padding(8, 5, 5, 5);
                ////label
                waitingBoxLab              = new Label();
                waitingBoxLab.TextAlign    = ContentAlignment.MiddleLeft;
                waitingBoxLab.AutoEllipsis = true;
                waitingBoxLab.Dock         = DockStyle.Fill;
                //waitingBox.AutoSize = false;
                //ControlHelper.BindMouseMoveEvent(this.waitingBoxLab);
                waitingBoxInnerPanel.Controls.Add(waitingBoxLab);
                ////pictruebox
                PictureBox pb = new PictureBox();
                pb.Dock          = DockStyle.Left;
                pb.Size          = new System.Drawing.Size(72, 70);
                pb.Image         = LoadResource.GetRandomLoadImage();
                pb.Margin        = new System.Windows.Forms.Padding(3, 3, 20, 3);
                pb.SizeMode      = PictureBoxSizeMode.StretchImage;
                this._waitPicBox = pb;
                waitingBoxInnerPanel.Controls.Add(pb);
                ////...
                waitingBox.Controls.Add(waitingBoxInnerPanel);
                waitingBox.BringToFront();
                if (!this.Controls.Contains(waitingBox))
                {
                    this.Controls.Add(waitingBox);
                }
                waitingBox.Show();
                this._IsWaitingBoxCreated = true;
                #endregion
            }

            Rectangle rect = this.WorkRectangle;
            waitingBox.Width           = rect.Width;
            waitingBox.Height          = rect.Height;
            waitingBox.Location        = new Point(rect.X, rect.Y);
            this._waitPicBox.Image     = LoadResource.GetRandomLoadImage();
            waitingBox.BackgroundImage = this.CreateBacgroundImage();
            //waitingBox.BackgroundImage = Properties.Resources.logo_mini;
            waitingBox.BackgroundImageLayout = ImageLayout.Stretch;
        }
示例#13
0
 //adding obstacles
 public void addHind(int lanePosition)
 {
     Panel hind = new Panel();
     hind.Location = new System.Drawing.Point(this.Width-1, lanePosition);
     hind.Name = "hind";
     hind.Size = new System.Drawing.Size(35, 30);
     hind.TabIndex = 1;
     obstacles.Add(hind);
     this.Controls.Add(hind);
     hind.BringToFront();
     car1.BringToFront();
 }
示例#14
0
        public ServerForm()
        {
            this._iconList = new List<PictureBox>();
            this._labelList = new List<Label>();
            for (int i = 0; i < 8; i++)
            {
                PictureBox newbox = new PictureBox();
                Point point = new Point((81 + 72*i), 254);
                newbox.Location = point;
                newbox.ImageLocation = Environment.CurrentDirectory + "/../../Resources/buddy_bleu_normal.png";
                newbox.SizeMode = PictureBoxSizeMode.AutoSize;
                newbox.Visible = false;
                this.Controls.Add(newbox);
                _iconList.Add(newbox);

                Label newlabel = new Label();
                newlabel.Font = new Font("Impact", 15);
                newlabel.Visible = false;
                //newlabel.TextAlign = ContentAlignment.MiddleCenter;
                newlabel.Text = "-1";
                newlabel.BackColor = Color.Transparent;
                //newlabel.Location = point;
                newlabel.Parent = _iconList[i];
                _labelList.Add(newlabel);
            }

            Panel panel = new Panel();
            panel.BorderStyle = BorderStyle.FixedSingle;
            panel.Visible = true;
            panel.BackColor = Color.White;
            panel.Location = new Point(66, 311);
            panel.Size = new Size(600, 128);
            this.Controls.Add(panel);
            panel.BringToFront();

            //this._dataObj = new DataPack();

            InitializeComponent();

            DataTable table = new DataTable();
            string schemePath = Environment.CurrentDirectory + "/../../TableScheme.xsd";
            table.ReadXmlSchema(schemePath);

            DataPack._cli_table = table;

            setData();

            this._server = new ServerListener(9000);
            _srv_thread = new Thread(this._server.RegisterClients);
            _srv_thread.Start();
        }
示例#15
0
        private void ShowProc()
        {
            MySqlCommand cmd = new MySqlCommand("SHOW CREATE PROCEDURE " + objectList.SelectedItem, server);

            using (MySqlDataReader reader = cmd.ExecuteReader())
            {
                reader.Read();
                string body = reader.GetString(2);
                body        = body.Replace("\n", "\r\n");
                spText.Text = body;
            }
            activeProc.Text = objectList.SelectedItem.ToString();
            spViewPanel.BringToFront();
        }
示例#16
0
 public void OpenReport()
 {
     _Parent.SuspendLayout();
             _ctlBoard = new Panel();
             _ctlBoard.Name = "CR_Board";
             _ctlBoard.Top = 0;
             _ctlBoard.Left = 0;
             _ctlBoard.Location = new System.Drawing.Point(0, 0);
             _ctlBoard.Size = new System.Drawing.Size(800, 600);
             //_ctlBoard.Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right);
             _ctlBoard.BringToFront();
             _ctlBoard.Text = "Initializing report controls...";
             _Parent.Controls.Add(_ctlBoard);
             _Parent.ResumeLayout(false);
             _Parent.PerformLayout();
 }
 private void modifyTenantToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Panel display = new Panel();
     Presentation.UpdateTenant tenant = new Presentation.UpdateTenant();
     tenant.BringToFront();
     tenant.TopLevel = false;
     tenant.Visible = true;
     tenant.FormBorderStyle = FormBorderStyle.None;
     tenant.Dock = DockStyle.Fill;
     display.Controls.Add(tenant);
     display.Size = panel1.Size;
     panel1.Controls.Add(display);
     display.Show();
     display.BringToFront();
     tenant.Show();
 }
        /// <summary>
        /// aktualisiert Parameter
        /// </summary>
        public void RefreshParameters()
        {
            // wenn kein Frontend zugeordnet
            if (_device.Frontend == null)
            {
                // Parameter aktualisieren
                RefreshLabel(labelDeviceCode, _device.Code);

                // Seite anzeigen
                panelPageUnassigned.BringToFront();
            }
            else
            {
                // Parameter aktualisieren
                RefreshLabel(labelState, _device.Frontend.State.ToString());
                _stateColor = GetStateColor(_device.Frontend.State);
                RefreshLabel(labelAgentCode, _device.Frontend.AgentCode);

                // ggf. Statusdauer aktualisieren
                if (_lastStateChange != _device.Frontend.LastStateChange)
                {
                    _lastStateChange = _device.Frontend.LastStateChange;
                    RefreshLabel(labelStateTime, GetStateTime(_lastStateChange));
                }

                // Kampagnenanmeldungen aktualisieren
                pictureBoxCampaignSessions.Visible = _device.Frontend.CampaignSessions.Count > 0;
                toolTip.SetToolTip(pictureBoxCampaignSessions, GetCampaignDisplayNames(
                                       _device.Frontend.CampaignSessions));

                // Coach aktualisieren
                pictureBoxCoach.Visible = _device.Frontend.MonitorCode != "";
                toolTip.SetToolTip(pictureBoxCoach, _device.Frontend.MonitorCode);

                // Seite anzeigen
                panelPageAssigned.BringToFront();
            }

            // ggf. Position aktualisieren
            if (this.Location != _device.Location)
            {
                this.Location = _device.Location;
            }

            // Steuerelement aktualisieren
            this.Refresh();
        }
示例#19
0
        /// <summary>
        /// Event when Leaderboard button is clicked on main form.
        /// Shows the header and the listBox with the top 5 players
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_leaderboard_Click(object sender, EventArgs e)
        {
            gameMain.ActiveForm.BackgroundImage       = null;
            gameMain.ActiveForm.BackgroundImageLayout = ImageLayout.Stretch;

            //Creates a listBox for the top 5 leaderboard
            listBox_leaderboard = new ListBox();
            listBox_leaderboard.FormattingEnabled = true;
            listBox_leaderboard.Location          = new System.Drawing.Point(251, 200);
            listBox_leaderboard.Name     = "listBox_leaderboard";
            listBox_leaderboard.Size     = new System.Drawing.Size(200, 200);
            listBox_leaderboard.TabIndex = 0;
            listBox_leaderboard.Font     = new System.Drawing.Font("Comic Sans MS", 16F, FontStyle.Bold);

            //New panel
            panel_leaderboard           = new Panel();
            panel_leaderboard.Dock      = System.Windows.Forms.DockStyle.Fill;
            panel_leaderboard.Location  = new System.Drawing.Point(0, 0);
            panel_leaderboard.Size      = new System.Drawing.Size(gameMain.ActiveForm.Width, gameMain.ActiveForm.Height);
            panel_leaderboard.Visible   = true;
            panel_leaderboard.BackColor = Color.AntiqueWhite;

            //Creates a Leaderboard Header
            label_leaderboard_header           = new Label();
            label_leaderboard_header.AutoSize  = true;
            label_leaderboard_header.BackColor = System.Drawing.Color.Transparent;
            label_leaderboard_header.Size      = new System.Drawing.Size(200, 200);
            label_leaderboard_header.Text      = "LEADERBOARD";
            label_leaderboard_header.Font      = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            //x_label = (x_label - label_leaderboard_header.Width) / 2;
            label_leaderboard_header.Location = new System.Drawing.Point(150, 50);
            label_leaderboard_header.Name     = "label_leaderboard_header";


            //Adds objects to panel
            panel_leaderboard.Controls.Add(label_leaderboard_header);
            panel_leaderboard.Controls.Add(listBox_leaderboard);
            this.Controls.Add(panel_leaderboard);
            button_howTo.Hide();
            button_leaderboard.Hide();
            button_start.Hide();
            panel_leaderboard.BringToFront();
            panel_leaderboard.Show();
            label_leaderboard_header.Show();
            get_leaderboard();
        }
示例#20
0
	private void ShowParametrForm(DataGridView Table)
	{
		if (Table != null) {
			int CurrentElementPosition = 0;
			SelectedColumns = new bool[Table.ColumnCount - 1];
			SelectedColumns[0] = true;
			Panel Surface = new Panel();
			Surface.AutoScroll = true;
			Surface.Dock = DockStyle.Fill;
			Surface.Parent = this;
			Surface.BringToFront();
			Surface.HorizontalScroll.Visible = false;
			this.Padding = new Padding(0, 0, 0, 10);
			for (int i = 2; i < Table.ColumnCount; i++) {
				CheckBox CurrentCheckBox = new CheckBox();
				CurrentCheckBox.Location = new Point(15, CurrentElementPosition + 10);
				CurrentCheckBox.Text = Table.Columns[i].HeaderText;
				CurrentCheckBox.Parent = Surface;
				CurrentCheckBox.AutoSize = true;
				CurrentCheckBox.Tag = i - 1;
				CurrentCheckBox.CheckedChanged += (_s, _e) =>
				{
					SelectedColumns[(int)((CheckBox)_s).Tag] = CurrentCheckBox.Checked;
				};
				CurrentCheckBox.Checked = true;
				CurrentElementPosition = CurrentCheckBox.Bottom;
			}
			Button BackButton = new Button();
			BackButton.Text = "Назад";
			BackButton.AutoSize = true;
			BackButton.Click += (_s, _e) =>
			{
				this.Close();
			};
			Button OkButton = new Button();
			OkButton.Text = "Корреляция";
			OkButton.AutoSize = true;
			BackButton.Location = new Point(15, CurrentElementPosition + 10);
			OkButton.Location = new Point(this.Width - OkButton.Width - 10, CurrentElementPosition + 10);
			OkButton.Anchor = AnchorStyles.Right;
			BackButton.Parent = Surface;
			OkButton.Parent = Surface;
			OkButton.Click += StartCorelationDelegate;
		}
	}
示例#21
0
        private void InitializeAdditionalComponents()
        {
            // The panel for moving the form by any point.

            this.panel1 = new TransparentDraggablePanel(this)
            {
                Name     = "panel1",
                Location = new System.Drawing.Point(0, 0),
                Size     = this.Size,
                TabIndex = 1,
                Locked   = m_Locked
            };

            var title = User32Windows.GetWindowText(m_Handle, 255);

            this.Text = "Transparent - " + title;

            var icon = User32Windows.GetIcon(m_Handle);

            if (icon != null)
            {
                this.pictureBox1.Image = icon.ToBitmap();
            }

            this.Controls.Add(this.panel1);

            panel1.BringToFront();

            if (IsWindows10())
            {
                this.panel1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.TransparentWindowToolForm_MouseWheel);
            }
            else
            {
                this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.TransparentWindowToolForm_MouseWheel);
            }

            this.panel1.DoubleClick += new System.EventHandler(this.TransparentWindowToolForm_DoubleClick);
            this.panel1.MouseClick  += new System.Windows.Forms.MouseEventHandler(this.TransparentWindowToolForm_MouseClick);
            this.LocationChanged    += (sender, e) =>
            {
                m_ClicksCount = ClicksToShow - 2;
            };
        }
示例#22
0
        void rePlay(int i)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate { rePlay(i); }));
                return;
            }
            VLCLib.UPlayer player = (VLCLib.UPlayer)uPlayers[i];
            player.Stop();
            player.Dispose();


            string playerName   = player.Name;
            int    crameraIndex = int.Parse(playerName.Split('&')[0]);
            int    panelIndex   = int.Parse(playerName.Split('&')[1]);

            this.main_panel.Controls.Remove(videoPanels[panelIndex]);

            Panel  panel = CreatePanel(rectangles[panelIndex]);
            string reUrl = cameraList[crameraIndex].CarmerUrl;

            panel.Name = "videoPanel" + i;
            //panel.BackColor = Color.Red;
            panel.MouseDoubleClick += msDoubleClick;

            this.main_panel.Controls.Add(panel);
            VLCLib.UPlayer playerNew = new VLCLib.UPlayer();
            panel.Controls.Add(playerNew);
            playerNew.Play(reUrl, panel.Handle);
            playerNew.Name = playerName;


            System.Windows.Forms.Panel panelDoubleClick = new System.Windows.Forms.Panel();
            panelDoubleClick.Dock              = DockStyle.Fill;
            panelDoubleClick.BackColor         = Color.Transparent;
            panelDoubleClick.MouseDoubleClick += msDoubleClick;
            panel.Controls.Clear();
            panel.Controls.Add(panelDoubleClick);
            panelDoubleClick.BringToFront();


            uPlayers[i]             = playerNew;
            videoPanels[panelIndex] = panel;
        }
示例#23
0
	/// <summary>
	/// Создать заголовок боковой панели
	/// </summary>
	/// <param name="Caption"></param>
	private Label CreateSideBarTitle(string Caption)
	{
		if (SideBarPanel != null) {
			Label sidebar_text = new Label();
			sidebar_text.Text = Caption;
			sidebar_text.Dock = DockStyle.Top;
			sidebar_text.TextAlign = ContentAlignment.MiddleCenter;
			sidebar_text.Parent = SideBarPanel;
			sidebar_text.BackColor = System.Drawing.Color.SteelBlue;
			sidebar_text.ForeColor = Color.White;
			Surface = new Panel();
			Surface.Parent = SideBarPanel;
			Surface.Dock = DockStyle.Top;
			Surface.AutoSize = true;
			Surface.BringToFront();
			return sidebar_text;
		}
		return null;
	}
        public administrate(string _given_name, NetworkStream _ns, string _IP)
        {
            InitializeComponent();

            // Importing the external variables
            given_name = _given_name;
            ns = _ns;
            this.Text = this.Text.Replace("%CLIENTNAME%", given_name);
            ip = _IP;

            // Trying to keep the looks good
            Panel coverage = new Panel();
            coverage.Location = new Point(200, -6);
            coverage.Size = new Size(398, 20);
            coverage.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;

            Controls.Add(coverage);
            coverage.BringToFront();
        }
示例#25
0
 /// /////////////////////////////////////////
 private void InitAffichage()
 {
     m_panelVueHierarchique.Visible = !m_bModeListe;
     base.m_panelListe.Visible      = m_bModeListe;
     if (!m_bModeListe)
     {
         if (m_arbre.Nodes.Count == 0)
         {
             FillNode(null);
         }
         m_panelVueHierarchique.BringToFront();
     }
     else
     {
         base.m_panelListe.BringToFront();
     }
     m_chkVueArbre.BringToFront();
     m_chkVueListe.BringToFront();
     m_panelVues.BringToFront();
 }
示例#26
0
 private void frmEditFoodTaste_Load(System.Object sender, System.EventArgs e)
 {
     LoadFoodTaste();
     if (frmMode == 1)             //1=编辑口味
     {
         Panel1.Visible = true;
         Panel2.Visible = false;
         Panel1.BringToFront();
         this.Text = "编辑口味";
     }
     else if (frmMode == 2)             //2=编辑当前菜品口味
     {
         Panel1.Visible = false;
         Panel2.Visible = true;
         Panel2.BringToFront();
         //返回当前菜品的口味
         this.Text     = "设置当前菜品的口味";
         TextBox3.Text = rms_var.GetCurrentFoodTaste(foodcode);
     }
 }
示例#27
0
        public void ShowLogPanel()
        {
            // Controls.Add( logPanel );
            logItem.Checked = logPanel.Visible = true;
            this.Text       = Globals.GetVersionString();

            if (_currentAppliance != null)
            {
                Controls.Remove(_currentAppliance.GetUIGenerator());
            }

            setActionItemName();

            logPanel.BringToFront();
            logBox.SelectionStart = logBox.TextLength;
            logBox.ScrollToCaret();
            logPanel.Focus();
            logBox.Focus();
            this.BringToFront();
        }
示例#28
0
 private void ActivateDetalhesTexto()
 {
     if (PesquisaUFList1.GetSelectedRows.Count() == 1)
     {
         var nivelRow = (GISADataset.NivelRow)PesquisaUFList1.SelectedRow;
         // Conta como consulta de detalhe da Unidade Física
         GisaDataSetHelper.RecordEstatisticaPesquisa(nivelRow.ID, "UF");
         rtfDetalhes.Clear();
         //rtfDetalhes.Rtf = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Microsoft Sans Serif;}}\\viewkind4\\uc1\\pard\\f0\\fs24 " + GetFRDBaseAsRTF((GISADataset.NivelRow)(PesquisaUFList1.SelectedItems[0].Tag)) + "\\par}";
         rtfDetalhes.Rtf = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Microsoft Sans Serif;}}\\viewkind4\\uc1\\pard\\f0\\fs24 " +
                           GetFRDBaseAsRTF(nivelRow) + "\\par}";
         Debug.WriteLine("");
         Debug.WriteLine(rtfDetalhes.Rtf);
         Debug.WriteLine("");
         pnlDetalhesTexto.BringToFront();
     }
     else
     {
         ToolBar_ButtonClick(this, new ToolBarButtonClickEventArgs(ToolBarButton2));
     }
 }
        private void AfficheUnBateau(Bateau unBateau)
        {
            char lettre;
            int chiffre;
            Panel unPanel;
            for (int i = 0; i < unBateau.Tab.Length; i++)
            {
                lettre = unBateau.Tab[i].letter;
                chiffre = unBateau.Tab[i].number;

                unPanel = new Panel();
                unPanel.BackgroundImage = new Bitmap(Battleship.Properties.Resources.Bateau);
                unPanel.Parent = PN_Joueur;
                unPanel.Location = new Point(chiffre * 35, GetPosition(lettre) * 35);
                unPanel.Height = 35;
                unPanel.Width = 35;
                unPanel.BorderStyle = BorderStyle.FixedSingle;
                unPanel.BackgroundImageLayout = ImageLayout.Stretch;
                unPanel.BringToFront();
            }
        }
示例#30
0
        public LightMarker(Control parent, uint time, Point pos, Color clr)
        {
            BasePosition = pos;
            Fixed = false;
            mMarker = new Panel();
            mMarker.BackColor = clr;
            mMarker.Size = new Size(6, 10);
            mMarker.BorderStyle = BorderStyle.FixedSingle;
            mMarker.BringToFront();

            mMarker.Location = new Point(pos.X - 3, pos.Y - 7);
            mMarker.MouseClick += new MouseEventHandler(MouseClicked);
            mMarker.MouseDoubleClick += new MouseEventHandler(MouseDoubleClick);
            mMarker.MouseDown += new MouseEventHandler(MarkerMouseDown);
            mMarker.MouseUp += new MouseEventHandler(MarkerMouseUp);

            mMarker.MouseMove += new MouseEventHandler(MarkerMouseMove);
            parent.Controls.Add(mMarker);
            Time = time;
            Color = clr;
        }
示例#31
0
        public MainForm()
        {
            InitializeComponent();
            this.spListView1 = new SPListView();
            // Add content panel
            contentPanel = new Panel();
            sideBar = new Panel();
            this.panel3.TabStop = true;

            this.panel3.Controls.Add(contentPanel);
            this.panel3.Controls.Add(sideBar);
            this.panel3.Controls.Add(spListView1);

            sideBar.Dock = DockStyle.Right;
            sideBar.Width = 320;

            contentPanel.TabStop = true;
            contentPanel.Dock = DockStyle.Fill;
            contentPanel.BringToFront();
            spListView1.Dock = DockStyle.Left;

            spListView1.Width =234;
            spListView1.ItemSelected += new SPListView.SPListItemMouseEventHandler(spListView1_ItemSelected);
            BuildMenu();
            this.Windows = new Dictionary<String, Control>();
            // Add sidebar

            browser = new SPWebBrowser("http://webchat.quakenet.org/");

            sideBar.Controls.Add(browser);

            browser.Dock = DockStyle.Fill;

            // Add SPTabView
            tabView = new SPTabView();
            this.contentPanel.Controls.Add(tabView);
            tabView.Dock = DockStyle.Fill;
            tabView.TabChanged += new EventHandler(tabView_TabChanged);
            navigate(new Uri("mako://static.cobresia.webfactional.com/spotdev/index.html"));
        }
示例#32
0
        /// <summary>
        /// 显示非模式的等待窗体界面(对窗体数据的更新等操作可在等待委托内处理)
        /// </summary>
        /// <param name="method">等待需要执行的方法(无参数).</param>
        /// <param name="message">等候显示消息.</param>
        /// User:Ryan  CreateTime:2011-10-24 11:28.
        public void Waiting(MethodInvoker method, string message)
        {
            if (this._isOnWaiting)
            {
                return;
            }
            this._isOnWaiting = true;
            this.CreateWaitingBox();
            Random ran = new Random(DateTime.Now.Millisecond);

            message = string.IsNullOrEmpty(message) ? this.iWaittingMessage[ran.Next(0, this.iWaittingMessage.Length)] : message;
            this.SetWaitingMessage(message);
            waitingBox.Visible = true;
            waitingBox.BringToFront();
            //AcceptButton,CancelButton
            this._btnAcceptOfKeyboard = this.AcceptButton;
            this._btnCancelOfKeyboard = this.CancelButton;
            this.AcceptButton         = null;
            this.CancelButton         = null;
            //execution
            IAsyncResult ar = method.BeginInvoke(this.WorkComplete, method);
        }
示例#33
0
        public CollectionTabPage(int width, int height)
        {
            // View
            this.Width = width;
            this.Height = height;

            int topToBound = (height - numberOfRows * (borderWidth - 1) - 1) / 2;
            int leftToBound = (width - numberOfColunms * (borderWidth - 1) - 1) / 2;
            for (int i = 0; i < numberOfRows; i++)
                for (int j = 0; j < numberOfColunms; j++) {
                    Panel panel = new Panel();
                    panel.Top = topToBound + i * (borderWidth - 1) + 1;
                    panel.Left = leftToBound + j * (borderWidth - 1) + 1;
                    panel.Width = borderWidth;
                    panel.Height = borderWidth;
                    panel.BackColor = ConstUtility.GlobalBorderColor;
                    this.Controls.Add(panel);

                    Panel panel1 = new Panel();
                    panel1.Top = topToBound + i * (borderWidth - 1) + 2;
                    panel1.Left = leftToBound + j * (borderWidth - 1) + 2;
                    panel1.Width = borderWidth - 2;
                    panel1.Height = borderWidth - 2;
                    panel1.BackColor = ConstUtility.GlobalBackColor();
                    this.Controls.Add(panel1);
                    panel1.BringToFront();

                }

            // Data
            worker = new BackgroundWorker();
            worker.DoWork += Worker_DoWork;
            worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
            worker.RunWorkerAsync();

            // Event
            EnvUtility.CollectedExprsChanged += EnvUtility_CollectedExprsChanged;
        }
示例#34
0
        private void cmbSample_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            for (int i = 0; i < 16; i++)
            {
                if (sender.Equals(cmbSample[i]))
                {
                    sampleMenu = i;

                    if (e.Button == System.Windows.Forms.MouseButtons.Right)
                    {
                        panelPopUp.Visible = false;
                        panelPopUp.Left    = e.X + cmbSample[i].Left - 2;
                        panelPopUp.Top     = e.Y + cmbSample[i].Top - 2;
                        panelPopUp.BringToFront();
                        panelPopUp.Visible = true;
                        sampleMenu         = i + beatPadScroll.Value * 4;
                    }
                    else
                    {
                        clearPopUp();
                    }
                }
            }
        }
        private void InitializeAdditionalComponents()
        {
            this.label1.TextAlign = m_InfoTextAlign;
            this.timer1.Interval  = m_RefreshInterval;

            if (m_FormSize != Size.Empty)
            {
                this.ClientSize  = m_FormSize;
                this.label1.Size = new System.Drawing.Size(m_FormSize.Width - 2, m_FormSize.Height - 2);
            }

            // The panel for moving the form by any point.
            this.panel1 = new TransparentDraggablePanel(this)
            {
                Name     = "panel1",
                Location = new System.Drawing.Point(0, 0),
                Size     = (m_FormSize != Size.Empty ? m_FormSize : new System.Drawing.Size(220, 31)),
                TabIndex = 1
            };

            this.Controls.Add(this.panel1);

            panel1.BringToFront();
        }
示例#36
0
        private void avatarBox_Click(object sender, EventArgs e)
        {
            if (pb != null)
            {
                this.WindowState = FormWindowState.Maximized;
                p.Show();
                pb.Show();
            }
            else
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    p = new Panel();
                    p.Location = new Point(0, 0);

                    p.BackColor = Color.Black;

                    pb = new PictureBox();
                    string url = _User.profile_image_url.Replace("_normal", "");

                    var request = WebRequestFactory.CreateHttpRequest(url);
                    var httpResponse = (HttpWebResponse)request.GetResponse();
                    Stream stream = httpResponse.GetResponseStream();

                    Image i = new Bitmap(stream);
                    pb.Image = i;
                    pb.SizeMode = PictureBoxSizeMode.StretchImage;

                    this.WindowState = FormWindowState.Maximized;

                    pb.Size = getImageSize(i.Size, Screen.PrimaryScreen.Bounds.Size);

                    pb.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (pb.Size.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (pb.Size.Height / 2));

                    pb.Click += new EventHandler(pb_Click);
                    p.Click += new EventHandler(pb_Click);

                    p.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
                    p.Visible = true;
                    this.Controls.Add(p);
                    p.BringToFront();

                    this.Controls.Add(pb);

                    pb.BringToFront();
                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.Message);
                    pb.Hide();
                }
            }
        }
示例#37
0
文件: Tiles.cs 项目: klonage/nlt-gcs
        public static void SetTiles(Panel p, bool isFlightMode)
        {
            var angleBtnUp = new TileButton("+5", 2, 4, (sender, args) => angleInfo.Value = (Convert.ToInt32(angleInfo.Value) + 5).ToString());
            var angleBtnDown = new TileButton("-5", 3, 4, (sender, args) => angleInfo.Value = (Convert.ToInt32(angleInfo.Value)- 5).ToString());
            TileButton angleBtnOk = null;
            angleBtnOk = new TileButton("OK", 4, 4, (sender, args) => angleBtnUp.Visible = angleBtnDown.Visible = angleBtnOk.Visible = false);
            var altBtnUp = new TileButton("+25", 2, 5, (sender, args) => ChangeAlt(25));
            var altBtnDown = new TileButton("-25", 3, 5, (sender, args) => ChangeAlt(-25));
            TileButton altBtnOk = null;
            altBtnOk = new TileButton("OK", 4, 5, (sender, args) => altBtnDown.Visible = altBtnUp.Visible = altBtnOk.Visible = false);

            altInfo = new TileData("ALTITUDE ", 1, 5, "m", (sender, args) =>
            {
                var x = !altBtnUp.Visible;
                altBtnUp.Visible = altBtnDown.Visible = altBtnOk.Visible = x;
            });
            if (!isFlightMode && MainV2.config.ContainsKey("TXT_DefaultAlt"))
                altInfo.Value = FlightPlanner.instance.TXT_DefaultAlt.Text = MainV2.config["TXT_DefaultAlt"].ToString();

            var hideList = new TileInfo[] { altBtnUp, altBtnDown, altBtnOk, angleBtnDown, angleBtnUp, angleBtnOk };

            var tilesFlightMode = new List<TileInfo>(new TileInfo[]
            {

                new TileButton("FLIGHT\nINFO", 0, 0, (sender, e) => MainV2.View.ShowScreen("FlightData"),
                    Color.FromArgb(255, 255, 51, 0)),
                new TileData("GROUND SPEED", 0, 1, "km/h"),
                new TileData("ALTITUDE", 0, 2, "m"),
                new TileData("TIME IN THE AIR", 0, 3,"min"),
                new TileData("BATTERY REMAINING", 0, 4, "%"),
                new TileData("RADIO SIGNAL", 0, 5, "%"),
                new TileButton("DISARM", 0, 7),
                new TileButton("FLIGHT\nPLANNING", 1, 0, (sender, e) => MainV2.View.ShowScreen("FlightPlanner")),
                new TileData("AIR SPEED", 1, 1, "km/h"),
                new TileData("DISTANCE TO HOME", 1, 2, "km"),
                new TileData("BATTERY VOLTAGE", 1, 3, "V"),
                new TileData("CURRENT", 1, 4, "A"),
                new TileData("GPS SIGNAL", 1, 5, "Sat."),
            });

            var defaultHead = new TileButton("DEFAULT", 2, 3, (sender, args) => { });
            var cam1Head = new TileButton("CAMERA 1", 3, 3);

            var cam2Head = new TileButton("CAMERA 2", 4, 3);
            var obsHeadBtn = new TileData("OBSERVATION HEAD", 1, 3, "16Mpx");
            obsHeadBtn.ClickMethod += (sender, args) =>
            {
                defaultHead.Label.Visible = cam1Head.Label.Visible = cam2Head.Label.Visible = true;
                var label = sender as Label;
                if (label != null) obsHeadBtn.Label.Text = "nex-5";
            };

            EventHandler fnc = (sender, args) =>
            {
                defaultHead.Label.Visible =
                    cam1Head.Label.Visible = cam2Head.Label.Visible = false;
            };
            fnc(null, null);
            defaultHead.ClickMethod += fnc;
            cam1Head.ClickMethod += fnc;
            cam2Head.ClickMethod += fnc;

            angleInfo = new TileData("ANGLE", 1, 4, "deg", (sender, args) =>
            {
                var x = !angleBtnUp.Visible;
                angleBtnUp.Visible = angleBtnDown.Visible = angleBtnOk.Visible = x;
            });

            const string polygonmodestring = "POLYGON\nMODE";
            var tilesFlightPlanning = new List<TileInfo>(new TileInfo[]
            {
                obsHeadBtn,
                altBtnUp, altBtnDown, altBtnOk, angleBtnDown, angleBtnUp, angleBtnOk,
                new TileButton("FLIGHT\nINFO", 0, 0, (sender, e) => MainV2.View.ShowScreen("FlightData")),
                new TileButton(polygonmodestring, 0, 1, (sender, e) =>
                {
                    var s = sender as Label;
                    // todo YEAH HACKING EVERYWHERE!
                    if (s.Text == polygonmodestring)
                    {
                        s.Text = "WAYPOINT\nMODE";
                        FlightPlanner.instance.PolygonGridMode = false;
                    }
                    else
                    {
                        s.Text = polygonmodestring;
                        FlightPlanner.instance.PolygonGridMode = true;
                    }
                }),
                new TileButton("ADD START\nCOMMAND", 0, 2,
                    (sender, args) => FlightPlanner.instance.takeoffToolStripMenuItem_Click(null, null)),
                new TileButton("CLEAR", 0, 3, (sender, args) =>
                {
                    FlightPlanner.instance.clearMissionToolStripMenuItem_Click(null, null);
                    FlightPlanner.instance.clearPolygonToolStripMenuItem_Click(null, null);
                }),
                new TileData("DISTANCE", 0, 4, "km"),
                new TileData("RADIO SIGNAL", 0, 5, "%"),
                new TileButton("WRITE WAYPOINTS", 3, 7, (sender, args) => FlightPlanner.instance.BUT_write_Click(sender, args)),

                new TileButton("FLIGHT\nPLANNING", 1, 0, (sender, e) => MainV2.View.ShowScreen("FlightPlanner"),
                    Color.FromArgb(255, 255, 51, 0)),

                new TileButton("PATH\nGENERATION", 1, 1, (sender, e) =>
                {
                    var Host = new Plugin.PluginHost();
                    ToolStripItemCollection col = Host.FPMenuMap.Items;
                    int index = col.Count;
                    foreach (
                        var toolStripItem in
                            col.Cast<ToolStripItem>()
                                .Where(item => item.Text.Equals("Auto WP"))
                                .OfType<ToolStripMenuItem>()
                                .SelectMany(toolStripMenuItem => toolStripMenuItem.DropDownItems.Cast<object>()
                                    .OfType<ToolStripItem>()
                                    .Where(toolStripItem => toolStripItem.Text.Equals("Survey (Grid)"))))
                    {
                        toolStripItem.PerformClick();
                    }
                }),
                new TileButton("ADD LANDING POINT", 1, 2,
                    (sender, args) => FlightPlanner.instance.landToolStripMenuItem_Click(null, null)),
                    angleInfo
                ,
               altInfo
            });

            var tilesArray = (isFlightMode) ? tilesFlightMode : tilesFlightPlanning;

            tilesArray.Add(new TileButton("CONNECTION", 0, 6,
                (sender, args) => MainV2.instance.MenuConnect_Click(null, null)));
            tilesArray.Add(new TileButton("AUTO", 1, 6, (sender, e) =>
            {
                try
                {
                    MainV2.comPort.setMode("Auto");
                }
                catch
                {
                    CustomMessageBox.Show("The Command failed to execute", "Error");
                }
            }, Color.FromArgb(255, 255, 51, 0)));
            tilesArray.Add(new TileButton("RESTART", 2, 6, (sender, args) =>
            {
                try
                {
                    MainV2.comPort.setWPCurrent(0);
                }
                catch
                {
                    CustomMessageBox.Show("The command failed to execute", "Error");
                }
            }));
            tilesArray.Add(new TileButton("RETURN", 2, 7, (sender, args) =>
            {
                try
                {
                    MainV2.comPort.setMode("RTL");
                }
                catch
                {
                    CustomMessageBox.Show("The Command failed to execute", "Error");
                }
            }));
            tilesArray.Add(new TileButton("LAND", 1, 7, (sender, args) =>
            {
                FlightData.instance.BUT_loadtelem_Click(null, null);
                FlightData.instance.BUT_playlog_Click(null, null);
                try
                {
                    FlightData.instance.BUT_clear_track_Click(sender, null);

                    MainV2.comPort.lastlogread = DateTime.MinValue;
                    MainV2.comPort.MAV.cs.ResetInternals();

                    if (MainV2.comPort.logplaybackfile != null)
                        MainV2.comPort.logplaybackfile.BaseStream.Position =
                            (long)(MainV2.comPort.logplaybackfile.BaseStream.Length * (40 / 100.0));

                    FlightData.instance.updateLogPlayPosition();
                }
                catch
                {
                }
            })); // todo not implemented
            // (sender, args) => FlightPlanner.instance.landToolStripMenuItem_Click(null, null)));
            tilesArray.Add(new TileButton("ARM/DISARM", 0, 7,
                (sender, args) => FlightData.instance.BUT_ARM_Click(sender, args)));
            tilesArray.Add(new TileData("WIND SPED", 9, 0, "m/s"));

            foreach (var tile in tilesArray)
            {
                //TODO: transparent
                var panel = new Panel
                {
                    Size = new Size(158, 64),
                    Location = new Point(tile.Column * 160, tile.Row * 66),
                    BackColor = Color.FromArgb(220, 0, 0, 0),
                    Parent = p
                };

                panel.Controls.Add(tile.Label);

                p.Controls.Add(panel);
                panel.BringToFront();
                if (hideList.Contains(tile) && tile is TileButton)
                    (tile as TileButton).Visible = false;
            }
        }
示例#38
0
        private void InstantiateCollapsiblePanels()
        {
            this.SuspendLayout();

            this.Controls.Clear();
            FCollPanelCount = 0;

            if (FMasterXmlNode == null)
            {
                throw new Exception("MasterXmlNode Property not set to an instance of XmlNode");
            }

            XmlNode TaskNode = FMasterXmlNode.FirstChild;

            //Iterate through all children nodes of the node
            while (TaskNode != null)
            {
                // Create a wrapper Panel. This is only needed to be able to set a distance between Collapsible Panels.
                Panel WrapperPanel = new Panel();
                WrapperPanel.AutoSize = true;
                WrapperPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                WrapperPanel.BackColor = Color.Transparent;
                WrapperPanel.Dock = DockStyle.Top;
                WrapperPanel.Padding = new Padding(0, 0, 0, FDistanceBetweenCollapsiblePanels);
                WrapperPanel.TabIndex = FCollPanelCount;
                WrapperPanel.Tag = TaskNode;
                WrapperPanel.Name = TaskNode.Name;

                // Create a Collapsible Panel
                TPnlCollapsible CollPanel = new TPnlCollapsible(THostedControlKind.hckTaskList,
                    TaskNode,
                    TCollapseDirection.cdVertical,
                    10,
                    false,
                    FVisualStyle);
                CollPanel.Tag = WrapperPanel;
                CollPanel.Name = TaskNode.Name;
                CollPanel.Text = TLstFolderNavigation.GetLabel(TaskNode);
                CollPanel.Dock = DockStyle.Top;
                CollPanel.TabIndex = 0;

                if ((TaskNode.Attributes["Visible"] != null)
                    && (TaskNode.Attributes["Visible"].Value.ToLower() == "false"))
                {
                    CollPanel.Visible = false;
                }

                if ((TaskNode.Attributes["Enabled"] != null)
                    && (TaskNode.Attributes["Enabled"].Value.ToLower() == "false"))
                {
                    CollPanel.Enabled = false;
                }
                else
                {
                    CollPanel.ItemActivation += delegate(TTaskList ATaskList, XmlNode ATaskListNode, LinkLabel AItemClicked, object AOtherData)
                    {
                        OnItemActivation(ATaskList, ATaskListNode, AItemClicked);
                    };
                }

                WrapperPanel.Height = CollPanel.ExpandedSize + FDistanceBetweenCollapsiblePanels;
                WrapperPanel.Controls.Add(CollPanel);
                this.Controls.Add(WrapperPanel);

                // Make sure the Collapsible Panels' Wrapper Panels are shown in correct order and not in reverse order.
                // (This is needed because we 'stack them up' with '.Controls.Dock = DockStyle.Top')
                WrapperPanel.BringToFront();

                TaskNode = TaskNode.NextSibling;

                FCollPanelCount++;
            }

            this.ResumeLayout();
        }
示例#39
0
        private void buttonAddRequirement_Click(object sender, EventArgs e)
        {
            buttonAddRequirement.Top += 29;

            Panel         panelRequirement = new System.Windows.Forms.Panel();
            ComboBox      comboBoxRequirementCalculation     = new System.Windows.Forms.ComboBox();
            ComboBox      comboBoxRequirementGreaterLessThan = new System.Windows.Forms.ComboBox();
            NumericUpDown numericUpDownRequirementValue      = new System.Windows.Forms.NumericUpDown();
            Button        buttonRemoveRequirement            = new System.Windows.Forms.Button();

            panelRequirement.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(numericUpDownRequirementValue)).BeginInit();
            //
            // panelRequirement
            //
            panelRequirement.Controls.Add(numericUpDownRequirementValue);
            panelRequirement.Controls.Add(buttonRemoveRequirement);
            panelRequirement.Controls.Add(comboBoxRequirementGreaterLessThan);
            panelRequirement.Controls.Add(comboBoxRequirementCalculation);
            panelRequirement.Dock     = System.Windows.Forms.DockStyle.Top;
            panelRequirement.Location = new System.Drawing.Point(3, 16);
            panelRequirement.Name     = "panelRequirement";
            panelRequirement.Size     = new System.Drawing.Size(294, 29);
            panelRequirement.TabIndex = 6;
            //
            // comboBoxRequirementCalculation
            //
            comboBoxRequirementCalculation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                                          | System.Windows.Forms.AnchorStyles.Right)));
            comboBoxRequirementCalculation.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBoxRequirementCalculation.FormattingEnabled = true;
            comboBoxRequirementCalculation.Location          = new System.Drawing.Point(64, 4);
            comboBoxRequirementCalculation.Name     = "comboBoxRequirementCalculation";
            comboBoxRequirementCalculation.Size     = new System.Drawing.Size(125, 21);
            comboBoxRequirementCalculation.TabIndex = 3;
            //
            // comboBoxRequirementGreaterLessThan
            //
            comboBoxRequirementGreaterLessThan.Anchor        = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            comboBoxRequirementGreaterLessThan.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            comboBoxRequirementGreaterLessThan.Items.AddRange(new object[] {
                "≥",
                "≤"
            });
            comboBoxRequirementGreaterLessThan.Location = new System.Drawing.Point(195, 4);
            comboBoxRequirementGreaterLessThan.Name     = "comboBoxRequirementGreaterLessThan";
            comboBoxRequirementGreaterLessThan.Size     = new System.Drawing.Size(30, 21);
            comboBoxRequirementGreaterLessThan.TabIndex = 3;
            //
            // numericUpDownRequirementValue
            //
            numericUpDownRequirementValue.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            numericUpDownRequirementValue.Location = new System.Drawing.Point(231, 5);
            numericUpDownRequirementValue.Maximum  = new decimal(new int[] {
                1000000,
                0,
                0,
                0
            });
            numericUpDownRequirementValue.Minimum = new decimal(new int[] {
                1000000,
                0,
                0,
                -2147483648
            });
            numericUpDownRequirementValue.Name               = "numericUpDownRequirementValue";
            numericUpDownRequirementValue.Size               = new System.Drawing.Size(60, 20);
            numericUpDownRequirementValue.TabIndex           = 6;
            numericUpDownRequirementValue.ThousandsSeparator = true;
            //
            // buttonRemoveRequirement
            //
            buttonRemoveRequirement.Location = new System.Drawing.Point(3, 3);
            buttonRemoveRequirement.Name     = "buttonRemoveRequirement";
            buttonRemoveRequirement.Size     = new System.Drawing.Size(55, 23);
            buttonRemoveRequirement.TabIndex = 5;
            buttonRemoveRequirement.Text     = "Remove";
            buttonRemoveRequirement.UseVisualStyleBackColor = true;
            buttonRemoveRequirement.Click += new EventHandler(buttonRemoveRequirement_Click);


            comboBoxRequirementCalculation.Items.Add("Overall Rating");
            comboBoxRequirementCalculation.Tag = Calculations.SubPointNameColors.Count;
            foreach (string subPoint in Calculations.SubPointNameColors.Keys)
            {
                comboBoxRequirementCalculation.Items.Add(subPoint + " Rating");
            }
            comboBoxRequirementCalculation.Items.AddRange(Calculations.OptimizableCalculationLabels);

            comboBoxRequirementCalculation.SelectedIndex = comboBoxRequirementGreaterLessThan.SelectedIndex = 0;
            groupBoxRequirements.Controls.Add(panelRequirement);
            ((System.ComponentModel.ISupportInitialize)(numericUpDownRequirementValue)).EndInit();
            panelRequirement.ResumeLayout();
            panelRequirement.BringToFront();
        }
        /// <summary>
        /// Creates the waiting box.
        /// </summary>
        private void CreateWaitingBox()
        {
            if (!this._IsWaitingBoxCreated)
            {
                #region CreateWaitingBox

                this.waitingBox = new System.Windows.Forms.Panel();
                //ControlHelper.BindMouseMoveEvent(this.waitingBox);
                waitingBox.BackColor = Color.WhiteSmoke;

                if (!Control.Contains(waitingBox))
                {
                    _Loading = new ProgressPanel();
                    //_Loading.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
                    _Loading.Appearance.BackColor                  = System.Drawing.Color.FromArgb(60, Color.WhiteSmoke);
                    _Loading.Appearance.Font                       = new System.Drawing.Font("Tahoma", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    _Loading.Appearance.ForeColor                  = System.Drawing.Color.Black;
                    _Loading.Appearance.Options.UseBackColor       = true;
                    _Loading.Appearance.Options.UseFont            = true;
                    _Loading.Appearance.Options.UseForeColor       = true;
                    _Loading.AppearanceCaption.Font                = new System.Drawing.Font("Microsoft Sans Serif", 12F);
                    _Loading.AppearanceCaption.Options.UseFont     = true;
                    _Loading.AppearanceDescription.Font            = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
                    _Loading.AppearanceDescription.Options.UseFont = true;
                    _Loading.Size        = new System.Drawing.Size(223, 53);
                    _Loading.Caption     = _text;
                    _Loading.Description = "";
                    //_Loading.Dock = System.Windows.Forms.DockStyle.Fill;
                    _Loading.Margin  = new System.Windows.Forms.Padding(2, 2, 2, 2);
                    _Loading.Name    = "progressPanel1";
                    _Loading.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0);
                    //_Loading.Size = new System.Drawing.Size(223, 53);
                    //_Loading.Location = new Point((Control.Width - _Loading.Width) / 2,  (Control.Height - _Loading.Height) / 2);//居中
                    _Loading.Dock = DockStyle.Top;
                    _Loading.LookAndFeel.SkinName = "Visual Studio 2013 Light";
                    _Loading.LookAndFeel.UseDefaultLookAndFeel = false;

                    _Loading.TabIndex = 0;
                    _Loading.Text     = "progressPanel1";

                    pe             = new PanelEx();
                    pe.Size        = new System.Drawing.Size(223, 75);
                    pe.Location    = new Point((Control.Width - _Loading.Width) / 2, (Control.Height - _Loading.Height) / 2);//居中
                    pe.BorderColor = Color.LightGray;
                    pe.Controls.Add(_Loading);
                    waitingBox.Controls.Add(pe);
                    Control.Controls.Add(waitingBox);
                    //取消按钮
                    buttonControl = new Xr.Common.Controls.ButtonControl();

                    buttonControl.BackColor      = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245)))));
                    buttonControl.Dock           = DockStyle.None;
                    buttonControl.ForeColor      = System.Drawing.Color.FromArgb(((int)(((byte)(42)))), ((int)(((byte)(131)))), ((int)(((byte)(113)))));
                    buttonControl.HoverBackColor = System.Drawing.Color.Empty;
                    buttonControl.Location       = new Point((pe.Width - buttonControl.Width) / 2 + 10, _Loading.Height);//居中
                    buttonControl.Margin         = new System.Windows.Forms.Padding(5, 0, 5, 0);
                    buttonControl.Size           = new System.Drawing.Size(50, 20);
                    buttonControl.Style          = Xr.Common.Controls.ButtonStyle.Return;
                    buttonControl.TabIndex       = 90;
                    buttonControl.TabStop        = false;
                    buttonControl.Text           = "取消";
                    buttonControl.Click         += new System.EventHandler(this.button_Click);
                    pe.Controls.Add(buttonControl);
                }

                waitingBox.Show();
                this._IsWaitingBoxCreated = true;
                #endregion
            }
            _Loading.Caption = _text;
            if (IsShowCancelBtn)
            {
                if (buttonControl != null)
                {
                    buttonControl.Visible = true;
                    pe.Size = new System.Drawing.Size(223, 75);
                }
            }
            else
            {
                if (buttonControl != null)
                {
                    buttonControl.Visible = false;
                    pe.Size = new System.Drawing.Size(223, 52);
                }
            }
            if (status == false)
            {
                Rectangle rect = Control.DisplayRectangle;
                if (rectDisplay == new Rectangle())
                {
                    rect = Control.DisplayRectangle;
                }

                else
                {
                    rect                   = rectDisplay;
                    pe.Location            = new Point((rect.Width - _Loading.Width) / 2, (rect.Height - _Loading.Height) / 2); //居中
                    buttonControl.Location = new Point((pe.Width - buttonControl.Width) / 2 + 10, _Loading.Height);             //居中
                }
                waitingBox.Width    = rect.Width;
                waitingBox.Height   = rect.Height;
                waitingBox.Location = new Point(rect.X, rect.Y);

                if (IsShowtransparencyBG)
                {
                    waitingBox.BackgroundImage = this.CreateBacgroundImage();
                    //waitingBox.BackgroundImage = Properties.Resources.logo_mini;
                    waitingBox.BackgroundImageLayout = ImageLayout.Stretch;
                }
                if (_alpha != 0f)
                {
                    waitingBox.BackgroundImage = this.CreateBacgroundImage();
                    //waitingBox.BackgroundImage = Properties.Resources.logo_mini;
                    waitingBox.BackgroundImageLayout = ImageLayout.Stretch;
                }
            }

            waitingBox.Visible = true;
            waitingBox.BringToFront();
            waitingBox.Focus();
            status = true;
        }
示例#41
0
 private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
 {
     #region Controles_Abrir
     //INICIALIZANDO CONTROLES
     panel_Busqueda = new System.Windows.Forms.Panel();
     txt_Busqueda = new System.Windows.Forms.TextBox();
     data_resultado = new System.Windows.Forms.DataGridView();
     pic_Lupa = new System.Windows.Forms.PictureBox();
     bttn_Busqueda = new System.Windows.Forms.Button();
     lbl_Etiqueta = new System.Windows.Forms.Label();
     //groupBoxfoto.SuspendLayout();
     //INICIALIZANDO COLUMNAS
     Loteb = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Nombreb = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Idb = new System.Windows.Forms.DataGridViewTextBoxColumn();
     //DISEÑOS DE A LOS CONTROLES
     txt_Busqueda.Location = new System.Drawing.Point(130, 57);
     txt_Busqueda.Name = "txt_Busqueda";
     txt_Busqueda.Size = new System.Drawing.Size(124, 20);
     txt_Busqueda.TabIndex = 0;
     txt_Busqueda.KeyPress += new System.Windows.Forms.KeyPressEventHandler(txt_Busqueda_KeyPress);
     //
     // pic_Lupa
     //
     pic_Lupa.BackgroundImage = ((System.Drawing.Image)(global::Shajobe.Properties.Resources.lupa));
     pic_Lupa.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     pic_Lupa.Location = new System.Drawing.Point(21, 19);
     pic_Lupa.Name = "pic_Lupa";
     pic_Lupa.Size = new System.Drawing.Size(100, 101);
     pic_Lupa.TabIndex = 1;
     pic_Lupa.TabStop = false;
     //
     // data_resultado
     //
     data_resultado.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     data_resultado.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     Idb,
     Nombreb,
     Loteb});
     data_resultado.Location = new System.Drawing.Point(21, 136);
     data_resultado.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
     data_resultado.Name = "data_resultado";
     data_resultado.RowHeadersWidth = 25;
     data_resultado.RowTemplate.Height = 25;
     data_resultado.Size = new System.Drawing.Size(470, 150);
     data_resultado.TabIndex = 2;
     data_resultado.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(data_resultado_MouseDoubleClick);
     //
     // Descripcion
     //
     Loteb.HeaderText = "Lote";
     Loteb.Name = "Loteb";
     //
     // Nombre
     //
     Nombreb.HeaderText = "Nombre";
     Nombreb.Name = "Nombreb";
     //
     // Id
     //
     Idb.HeaderText = "Id";
     Idb.Name = "Idb";
     Idb.Visible = false;
     //
     // lbl_Etiqueta
     //
     lbl_Etiqueta.AutoSize = true;
     lbl_Etiqueta.Location = new System.Drawing.Point(127, 26);
     lbl_Etiqueta.Name = "lbl_Etiqueta";
     lbl_Etiqueta.Size = new System.Drawing.Size(419, 13);
     lbl_Etiqueta.TabIndex = 3;
     lbl_Etiqueta.Text = "Escriba el nombre o lote del producto a buscar";
     //
     // bttn_Busqueda
     //
     bttn_Busqueda.BackgroundImage = ((System.Drawing.Image)(global::Shajobe.Properties.Resources.Siguiente));
     bttn_Busqueda.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     bttn_Busqueda.Location = new System.Drawing.Point(274, 48);
     bttn_Busqueda.Name = "bttn_Busqueda";
     bttn_Busqueda.Size = new System.Drawing.Size(62, 54);
     bttn_Busqueda.TabIndex = 4;
     bttn_Busqueda.UseVisualStyleBackColor = true;
     bttn_Busqueda.Click += new System.EventHandler(bttn_Busqueda_Click);
     //
     // panel_Busqueda
     //
     panel_Busqueda.Controls.Add(bttn_Busqueda);
     panel_Busqueda.Controls.Add(lbl_Etiqueta);
     panel_Busqueda.Controls.Add(data_resultado);
     panel_Busqueda.Controls.Add(pic_Lupa);
     panel_Busqueda.Controls.Add(txt_Busqueda);
     panel_Busqueda.Enabled = false;
     panel_Busqueda.Location = new System.Drawing.Point(200, 127);
     panel_Busqueda.Name = "panel_Busqueda";
     panel_Busqueda.Size = new System.Drawing.Size(370, 321);
     panel_Busqueda.TabIndex = 35;
     panel_Busqueda.BringToFront();
     txt_Busqueda.Clear();
     data_resultado.Rows.Clear();
     Controls.Add(panel_Busqueda);
     panel_Busqueda.Visible = true;
     panel_Busqueda.Enabled = true;
     tabControl1.Visible = false;
     #endregion
     string ficha = tabControl1.SelectedIndex.ToString();
     #region Ficha0_Abrir
     if (ficha == "0")
     {
         //CARACTERISTICA DE AUTOCOMPLETADO EN TXT_BUSQUEDA
         txt_Busqueda.AutoCompleteCustomSource = Autocomplete1();
         txt_Busqueda.AutoCompleteMode = AutoCompleteMode.Suggest;
         txt_Busqueda.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
     #endregion
     #region Ficha1_Abrir
     else if (ficha == "1")
     {
         //CARACTERISTICA DE AUTOCOMPLETADO EN TXT_BUSQUEDA
         txt_Busqueda.AutoCompleteCustomSource = Autocomplete2();
         txt_Busqueda.AutoCompleteMode = AutoCompleteMode.Suggest;
         txt_Busqueda.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
     #endregion
     #region Ficha2_Abrir
     else if (ficha == "2")
     {
         //CARACTERISTICA DE AUTOCOMPLETADO EN TXT_BUSQUEDA
         txt_Busqueda.AutoCompleteCustomSource = Autocomplete3();
         txt_Busqueda.AutoCompleteMode = AutoCompleteMode.Suggest;
         txt_Busqueda.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
     #endregion
     #region Ficha3_Abrir
     else if (ficha == "3")
     {
         //CARACTERISTICA DE AUTOCOMPLETADO EN TXT_BUSQUEDA
         txt_Busqueda.AutoCompleteCustomSource = Autocomplete4();
         txt_Busqueda.AutoCompleteMode = AutoCompleteMode.Suggest;
         txt_Busqueda.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
     #endregion
     #region Ficha4_Abrir
     else if (ficha == "4")
     {
         //CARACTERISTICA DE AUTOCOMPLETADO EN TXT_BUSQUEDA
         txt_Busqueda.AutoCompleteCustomSource = Autocomplete5();
         txt_Busqueda.AutoCompleteMode = AutoCompleteMode.Suggest;
         txt_Busqueda.AutoCompleteSource = AutoCompleteSource.CustomSource;
     }
     #endregion
 }
示例#42
0
 private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         //Quito el panel de busqueda
         Controls.Remove(panel_Permisos);
     }
     catch (Exception)
     {
         //En caso de que no existe todavia el panel de busqueda
         //omite la instrucción de quitar dicho control
     }
     #region Creando controles
     //INICIALIZANDO CONTROLES
     txt_Busqueda = new System.Windows.Forms.TextBox();
     panel_Busqueda = new System.Windows.Forms.Panel();
     data_resultado = new System.Windows.Forms.DataGridView();
     pic_Lupa = new System.Windows.Forms.PictureBox();
     bttn_Busqueda = new System.Windows.Forms.Button();
     lbl_Etiqueta = new System.Windows.Forms.Label();
     //groupBoxfoto.SuspendLayout();
     //INICIALIZANDO COLUMNAS
     Descripcion = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Nombre = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Id = new System.Windows.Forms.DataGridViewTextBoxColumn();
     #endregion
     #region Diseño de controles
     //DISEÑOS DE A LOS CONTROLES
     txt_Busqueda.Location = new System.Drawing.Point(130, 57);
     txt_Busqueda.Name = "txt_Busqueda";
     txt_Busqueda.Size = new System.Drawing.Size(124, 20);
     txt_Busqueda.TabIndex = 0;
     txt_Busqueda.MaxLength = 25;
     txt_Busqueda.KeyPress += new System.Windows.Forms.KeyPressEventHandler(txt_Busqueda_KeyPress);
     //
     // pic_Lupa
     //
     pic_Lupa.BackgroundImage = ((System.Drawing.Image)(global::Sistema_Shajobe.Properties.Resources.lupa));
     pic_Lupa.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     pic_Lupa.Location = new System.Drawing.Point(21, 19);
     pic_Lupa.Name = "pic_Lupa";
     pic_Lupa.Size = new System.Drawing.Size(100, 101);
     pic_Lupa.TabIndex = 1;
     pic_Lupa.TabStop = false;
     //
     // data_resultado
     //
     data_resultado.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     data_resultado.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     Id,
     Nombre,
     Descripcion});
     data_resultado.Location = new System.Drawing.Point(11, 126);
     data_resultado.Name = "data_resultado";
     data_resultado.RowHeadersWidth = 25;
     data_resultado.RowTemplate.Height = 25;
     data_resultado.Size = new System.Drawing.Size(340, 100);
     data_resultado.TabIndex = 2;
     data_resultado.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(data_resultado_MouseDoubleClick);
     data_resultado.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
     //
     // Descripcion
     //
     Descripcion.HeaderText = "Descripcion";
     Descripcion.Name = "Descripcion";
     //
     // Nombre
     //
     Nombre.HeaderText = "Nombre";
     Nombre.Name = "Nombre";
     //
     // Id
     //
     Id.HeaderText = "Id";
     Id.Name = "Id";
     Id.Visible = false;
     //
     // lbl_Etiqueta
     //
     lbl_Etiqueta.AutoSize = true;
     lbl_Etiqueta.Location = new System.Drawing.Point(110, 26);
     lbl_Etiqueta.Name = "lbl_Etiqueta";
     lbl_Etiqueta.Size = new System.Drawing.Size(419, 13);
     lbl_Etiqueta.TabIndex = 3;
     lbl_Etiqueta.Text = "Escriba el nombre del tipo de materia prima a buscar";
     //
     // bttn_Busqueda
     //
     bttn_Busqueda.BackgroundImage = ((System.Drawing.Image)(global::Sistema_Shajobe.Properties.Resources.Siguiente));
     bttn_Busqueda.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     bttn_Busqueda.Location = new System.Drawing.Point(274, 48);
     bttn_Busqueda.Name = "bttn_Busqueda";
     bttn_Busqueda.Size = new System.Drawing.Size(62, 54);
     bttn_Busqueda.TabIndex = 4;
     bttn_Busqueda.UseVisualStyleBackColor = true;
     bttn_Busqueda.Click += new System.EventHandler(bttn_Busqueda_Click);
     //
     // panel_Busqueda
     //
     panel_Busqueda.Controls.Add(bttn_Busqueda);
     panel_Busqueda.Controls.Add(lbl_Etiqueta);
     panel_Busqueda.Controls.Add(data_resultado);
     panel_Busqueda.Controls.Add(pic_Lupa);
     panel_Busqueda.Controls.Add(txt_Busqueda);
     panel_Busqueda.Enabled = false;
     panel_Busqueda.Location = new System.Drawing.Point(40, 30);
     panel_Busqueda.Name = "panel_Busqueda";
     panel_Busqueda.Size = new System.Drawing.Size(370, 235);
     panel_Busqueda.TabIndex = 35;
     panel_Busqueda.BorderStyle = BorderStyle.FixedSingle;
     panel_Busqueda.Visible = false;
     //CARACTERISTICA DE AUTOCOMPLETADO EN TXT_BUSQUEDA
     txt_Busqueda.AutoCompleteCustomSource = Autocomplete();
     txt_Busqueda.AutoCompleteMode = AutoCompleteMode.Suggest;
     txt_Busqueda.AutoCompleteSource = AutoCompleteSource.CustomSource;
     Controls.Add(panel_Busqueda);
     groupBoxdatos.Visible = false;
     panel_Busqueda.Visible = true;
     panel_Busqueda.Enabled = true;
     panel_Busqueda.BringToFront();
     #endregion
 }
示例#43
0
 private void PermisosToolStripMenuItem_Click(object sender, EventArgs e)
 {
     #region Creando controles de panel de permisos
     panel_Permisos = new System.Windows.Forms.Panel();
     bttn_Agregar = new System.Windows.Forms.Button();
     bttn_Quitar = new System.Windows.Forms.Button();
     dataGridView_Menu = new System.Windows.Forms.DataGridView();
     dataGridView_Permisos = new System.Windows.Forms.DataGridView();
     Id_Menu = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Menu1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Id_MenuP = new System.Windows.Forms.DataGridViewTextBoxColumn();
     Permiso = new System.Windows.Forms.DataGridViewTextBoxColumn();
     comboBox_TipoUsuario = new System.Windows.Forms.ComboBox();
     lbl_STipo_Usuario = new System.Windows.Forms.Label();
     label1 = new System.Windows.Forms.Label();
     panel_Permisos.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(dataGridView_Menu)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(dataGridView_Permisos)).BeginInit();
     SuspendLayout();
     //
     // panel_Permisos
     //
     panel_Permisos.Controls.Add(label1);
     panel_Permisos.Controls.Add(lbl_STipo_Usuario);
     panel_Permisos.Controls.Add(comboBox_TipoUsuario);
     panel_Permisos.Controls.Add(dataGridView_Permisos);
     panel_Permisos.Controls.Add(dataGridView_Menu);
     panel_Permisos.Controls.Add(bttn_Quitar);
     panel_Permisos.Controls.Add(bttn_Agregar);
     panel_Permisos.Location = new System.Drawing.Point(33, 21);
     panel_Permisos.Name = "panel_Permisos";
     panel_Permisos.Size = new System.Drawing.Size(370, 247);
     panel_Permisos.TabIndex = 0;
     //
     // bttn_Agregar
     //
     bttn_Agregar.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     bttn_Agregar.Location = new System.Drawing.Point(148, 89);
     bttn_Agregar.Name = "bttn_Agregar";
     bttn_Agregar.Size = new System.Drawing.Size(75, 23);
     bttn_Agregar.TabIndex = 0;
     bttn_Agregar.Text = ">>";
     bttn_Agregar.Click += new System.EventHandler(bttn_Agregar_Click);
     bttn_Agregar.UseVisualStyleBackColor = true;
     //
     // bttn_Quitar
     //
     bttn_Quitar.Location = new System.Drawing.Point(148, 118);
     bttn_Quitar.Name = "bttn_Quitar";
     bttn_Quitar.Size = new System.Drawing.Size(75, 23);
     bttn_Quitar.TabIndex = 1;
     bttn_Quitar.Text = "<<";
     bttn_Quitar.Click += new System.EventHandler(bttn_Quitar_Click);
     bttn_Quitar.UseVisualStyleBackColor = true;
     //
     // dataGridView_Menu
     //
     dataGridView_Menu.AllowUserToAddRows = false;
     dataGridView_Menu.AllowUserToDeleteRows = false;
     dataGridView_Menu.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     dataGridView_Menu.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     Id_Menu,
     Menu1});
     dataGridView_Menu.Location = new System.Drawing.Point(3, 36);
     dataGridView_Menu.Name = "dataGridView_Menu";
     dataGridView_Menu.ReadOnly = true;
     dataGridView_Menu.Size = new System.Drawing.Size(133, 205);
     dataGridView_Menu.TabIndex = 2;
     //
     // dataGridView_Permisos
     //
     dataGridView_Permisos.AllowUserToAddRows = false;
     dataGridView_Permisos.AllowUserToDeleteRows = false;
     dataGridView_Permisos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     dataGridView_Permisos.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
     Id_MenuP,
     Permiso});
     dataGridView_Permisos.Location = new System.Drawing.Point(234, 36);
     dataGridView_Permisos.Name = "dataGridView_Permisos";
     dataGridView_Permisos.ReadOnly = true;
     dataGridView_Permisos.Size = new System.Drawing.Size(133, 205);
     dataGridView_Permisos.TabIndex = 3;
     //
     // Id_Menu
     //
     Id_Menu.HeaderText = "Id_Menu";
     Id_Menu.Name = "Id_Menu";
     Id_Menu.ReadOnly = true;
     Id_Menu.Visible = false;
     //
     // Menu
     //
     Menu1.HeaderText = "Menu";
     Menu1.Name = "Menu1";
     Menu1.ReadOnly = true;
     //
     // Id_MenuP
     //
     Id_MenuP.HeaderText = "Id_MenuP";
     Id_MenuP.Name = "Id_MenuP";
     Id_MenuP.ReadOnly = true;
     Id_MenuP.Visible = false;
     //
     // Permiso
     //
     Permiso.HeaderText = "Permiso";
     Permiso.Name = "Permiso";
     Permiso.ReadOnly = true;
     //
     // comboBox_TipoUsuario
     //
     comboBox_TipoUsuario.FormattingEnabled = true;
     comboBox_TipoUsuario.Location = new System.Drawing.Point(82, 10);
     comboBox_TipoUsuario.Name = "comboBox_TipoUsuario";
     comboBox_TipoUsuario.Size = new System.Drawing.Size(121, 21);
     comboBox_TipoUsuario.KeyPress += new KeyPressEventHandler(NoescrituracomboBox_KeyPress);
     comboBox_TipoUsuario.SelectedIndexChanged += new System.EventHandler(Permisos_SelectedIndexChanged);
     comboBox_TipoUsuario.TabIndex = 4;
     //
     // lbl_STipo_Usuario
     //
     lbl_STipo_Usuario.AutoSize = true;
     lbl_STipo_Usuario.FlatStyle = System.Windows.Forms.FlatStyle.System;
     lbl_STipo_Usuario.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lbl_STipo_Usuario.Location = new System.Drawing.Point(3, 13);
     lbl_STipo_Usuario.Name = "lbl_STipo_Usuario";
     lbl_STipo_Usuario.Size = new System.Drawing.Size(80, 13);
     lbl_STipo_Usuario.TabIndex = 5;
     lbl_STipo_Usuario.Text = "Tipo de usuario";
     //
     // label1
     //
     label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     label1.ForeColor = System.Drawing.Color.Black;
     label1.Location = new System.Drawing.Point(235, 3);
     label1.Name = "label1";
     label1.Size = new System.Drawing.Size(132, 33);
     label1.TabIndex = 6;
     label1.Text = "Panel de asignación de permisos";
     //
     // Form1
     //
     Controls.Add(panel_Permisos);
     panel_Permisos.ResumeLayout(false);
     panel_Permisos.PerformLayout();
     panel_Permisos.BorderStyle = BorderStyle.FixedSingle;
     //groupBoxdatos.SendToBack();
     //pic_Logo.SendToBack();
     //pic_TipoUsuario.SendToBack();
     panel_Permisos.BringToFront();
     #endregion
     try
     {
         //Quito el panel de busqueda
         Controls.Remove(panel_Busqueda);
     }
     catch (Exception)
     {
         //En caso de que no existe todavia el panel de busqueda
         //omite la instrucción de quitar dicho control
     }
     //Llenando controles
     Llenando_DataGridViewMenus();
     Llenando_ComboboxTipoUsuario();
     eliminarToolStripMenuItem.Enabled = true;
     modificarToolStripMenuItem.Enabled = true;
     Tipo_Diseño = true;
 }
        private void NewDispenserPanel(int Index, AES.MHE.Dispenser Dispenser)
        {
            //
            // DispenserPanel
            //
            System.Windows.Forms.Panel dispenserPanel = new Panel();
            dispenserPanel.Location = new System.Drawing.Point(3, dispenserPanelHeight * Index);
            dispenserPanel.Name = "DispenserPanel_" + Index.ToString();
            dispenserPanel.Size = new System.Drawing.Size(640, dispenserPanelHeight);
            dispenserPanel.TabIndex = 0;
            this.DispenserPanel.Controls.Add(dispenserPanel);
            //
            // DispenserTypeTextBox
            //
            System.Windows.Forms.TextBox dispenserTypeTextBox = new TextBox();
            dispenserTypeTextBox.Location = new System.Drawing.Point(8, 8);
            dispenserTypeTextBox.Name = "DispenserTypeTextBox_" + Index.ToString();
            dispenserTypeTextBox.Size = new System.Drawing.Size(202, 22);
            dispenserTypeTextBox.TextAlign = HorizontalAlignment.Center;
            dispenserTypeTextBox.TabIndex = 0;
            dispenserTypeTextBox.Text = DispenserType(Dispenser);
            dispenserTypeTextBox.ReadOnly = true;
            dispenserPanel.Controls.Add(dispenserTypeTextBox);
            //
            // DispenserValueTextBox
            //
            System.Windows.Forms.TextBox dispenserValueTextBox = new TextBox();
            dispenserValueTextBox.Location = new System.Drawing.Point(220, 8);
            dispenserValueTextBox.Name = "DispenserValueTextBox_" + Index.ToString();
            dispenserValueTextBox.Size = new System.Drawing.Size(30, 22);
            dispenserValueTextBox.TextAlign = HorizontalAlignment.Center;
            dispenserValueTextBox.TabIndex = 1;
            dispenserValueTextBox.Text = Dispenser.Value.ToString();
            dispenserValueTextBox.ReadOnly = true;
            dispenserPanel.Controls.Add(dispenserValueTextBox);
            //
            // DispenserAddressTextBox
            //
            System.Windows.Forms.TextBox dispenserAddressTextBox = new TextBox();
            dispenserAddressTextBox.Location = new System.Drawing.Point(260, 8);
            dispenserAddressTextBox.Name = "DispenserAddressTextBox_" + Index.ToString();
            dispenserAddressTextBox.Size = new System.Drawing.Size(24, 22);
            dispenserAddressTextBox.TextAlign = HorizontalAlignment.Center;
            dispenserAddressTextBox.TabIndex = 2;
            dispenserAddressTextBox.Text = Dispenser.UnitAddress.ToString();
            dispenserAddressTextBox.ReadOnly = true;
            dispenserPanel.Controls.Add(dispenserAddressTextBox);
            //
            // DispenserCoinsTextBox
            //
            System.Windows.Forms.TextBox dispenserCoinsTextBox = new TextBox();
            dispenserCoinsTextBox.Location = new System.Drawing.Point(320, 8);
            dispenserCoinsTextBox.Name = "DispenserCoinsTextBox_" + Index.ToString();
            dispenserCoinsTextBox.Size = new System.Drawing.Size(44, 22);
            dispenserCoinsTextBox.TextAlign = HorizontalAlignment.Center;
            dispenserCoinsTextBox.TabIndex = 3;
            dispenserCoinsTextBox.Text = Dispenser.Count.ToString();
            dispenserCoinsTextBox.ReadOnly = true;
            dispenserPanel.Controls.Add(dispenserCoinsTextBox);
            //
            // DispenserContentsTextBox
            //
            System.Windows.Forms.TextBox dispenserContentsTextBox = new TextBox();
            dispenserContentsTextBox.Location = new System.Drawing.Point(380, 8);
            dispenserContentsTextBox.Name = "DispenserContentsTextBox_" + Index.ToString();
            dispenserContentsTextBox.Size = new System.Drawing.Size(68, 22);
            dispenserContentsTextBox.TextAlign = HorizontalAlignment.Center;
            dispenserContentsTextBox.TabIndex = 4;
            dispenserContentsTextBox.Text = Dispenser.Count.ToString();
            dispenserContentsTextBox.ReadOnly = true;
            dispenserPanel.Controls.Add(dispenserContentsTextBox);
            //
            // DispenserStatusTextBox
            //
            System.Windows.Forms.TextBox dispenserStatusTextBox = new TextBox();
            dispenserStatusTextBox.Location = new System.Drawing.Point(456, 8);
            dispenserStatusTextBox.Name = "DispenserStatusTextBox_" + Index.ToString();
            dispenserStatusTextBox.Size = new System.Drawing.Size(148, 22);
            dispenserStatusTextBox.TextAlign = HorizontalAlignment.Center;
            dispenserStatusTextBox.TabIndex = 5;
            dispenserStatusTextBox.Text = ((MHE.DispenserPayStatus)Dispenser.Status).ToString();
            dispenserStatusTextBox.ReadOnly = true;
            dispenserPanel.Controls.Add(dispenserStatusTextBox);
            //
            // DispenserInhibitCheckBox
            //
            System.Windows.Forms.CheckBox dispenserInhibitCheckBox = new CheckBox();
            dispenserInhibitCheckBox.Location = new System.Drawing.Point(628, 8);
            dispenserInhibitCheckBox.Name = "DispenserInhibitCheckBox_" + Index.ToString();
            dispenserInhibitCheckBox.Size = new System.Drawing.Size(16, 24);
            dispenserInhibitCheckBox.TabIndex = 6;
            dispenserInhibitCheckBox.Checked = (Dispenser.Inhibit != 0);
            dispenserPanel.Controls.Add(dispenserInhibitCheckBox);

            dispenserInhibitCheckBox.Click += new EventHandler(dispenserInhibitCheckBox_Click);
            dispenserInhibitCheckBox.Tag = Index;

            dispenserPanel.BringToFront();
        }
        private void NewCoinPanel(int Index, AESImhei.AcceptorCoin Coin)
        {
            System.Windows.Forms.Panel coinPanel = new Panel();
            coinPanel.Location = new System.Drawing.Point(8 + 45*Index, 32);
            coinPanel.Name = "CoinPanel" + Index.ToString();
            coinPanel.Size = new System.Drawing.Size(64, 240);
            coinPanel.TabIndex = 0;
            this.AcceptorPanel.Controls.Add(coinPanel );

            // ValueTextBox
            System.Windows.Forms.TextBox valueTextBox = new TextBox();
            valueTextBox.ReadOnly  = true;
            valueTextBox.Location = new System.Drawing.Point(8, 8);
            valueTextBox.Name = "ValueTextBox_" + Index.ToString();
            valueTextBox.Size = new System.Drawing.Size(40, 22);
            valueTextBox.TabIndex = 0;
            valueTextBox.Text = Coin.Value.ToString();
            coinPanel.Controls.Add( valueTextBox );

            // DescTextBox0
            System.Windows.Forms.TextBox descTextBox = new TextBox();
            descTextBox.ReadOnly = true;
            descTextBox.Location = new System.Drawing.Point(8, 32);
            descTextBox.Name = "DescTextBox_" + Index.ToString();
            descTextBox.Size = new System.Drawing.Size(40, 22);
            descTextBox.Font = new Font("Arial", 8);
            descTextBox.TabIndex = 1;
            descTextBox.Text = Coin.Count.ToString();
            coinPanel.Controls.Add(descTextBox);

            // CountTextBox0
            System.Windows.Forms.TextBox countTextBox = new TextBox();
            countTextBox.ReadOnly = true;
            countTextBox.Location = new System.Drawing.Point(8, 56);
            countTextBox.Name = "CountTextBox_" + Index.ToString();
            countTextBox.Size = new System.Drawing.Size(40, 22);
            countTextBox.TabIndex = 2;
            countTextBox.Text = Coin.Count.ToString();
            coinPanel.Controls.Add(countTextBox);

            // RoutedPathTextBox0
            System.Windows.Forms.TextBox routedPathTextBox = new TextBox();
            routedPathTextBox.Location = new System.Drawing.Point(8, 80);
            routedPathTextBox.Name = "RoutedPathTextBox_" + Index.ToString();
            routedPathTextBox.Size = new System.Drawing.Size(40, 22);
            routedPathTextBox.TabIndex = 3;
            routedPathTextBox.Text = Coin.Path.ToString();
            routedPathTextBox.MaxLength = 1;
            routedPathTextBox.TextChanged += new System.EventHandler(this.CoinControlChanged);
            coinPanel.Controls.Add( routedPathTextBox );
            //
            // DefaultPathTextBox0
            //
            System.Windows.Forms.TextBox defaultPathTextBox = new TextBox();
            defaultPathTextBox.Location = new System.Drawing.Point(8, 104);
            defaultPathTextBox.Name = "DefaultPathTextBox_" + Index.ToString();
            defaultPathTextBox.Size = new System.Drawing.Size(40, 22);
            defaultPathTextBox.TabIndex = 4;
            defaultPathTextBox.Text = Coin.DefaultPath.ToString();
            defaultPathTextBox.MaxLength = 1;
            defaultPathTextBox.TextChanged += new System.EventHandler(this.CoinControlChanged);
            coinPanel.Controls.Add( defaultPathTextBox );
            //
            // NoSentTextBox0
            //
            System.Windows.Forms.TextBox noSentTextBox = new TextBox();
            noSentTextBox.ReadOnly  = true;
            noSentTextBox.Location = new System.Drawing.Point(8, 128);
            noSentTextBox.Name = "NoSentTextBox_" + Index.ToString();
            noSentTextBox.Size = new System.Drawing.Size(40, 22);
            noSentTextBox.TabIndex = 5;
            noSentTextBox.Text = Coin.PathCount.ToString();
            coinPanel.Controls.Add( noSentTextBox );
            //
            // LevelTextBox0
            //
            System.Windows.Forms.TextBox levelTextBox = new TextBox();
            levelTextBox.Location = new System.Drawing.Point(8, 152);
            levelTextBox.Name = "LevelTextBox_" + Index.ToString();
            levelTextBox.Size = new System.Drawing.Size(40, 22);
            levelTextBox.TabIndex = 6;
            levelTextBox.Text = Coin.PathSwitchLevel.ToString();
            levelTextBox.TextChanged += new System.EventHandler(this.CoinControlChanged);
            coinPanel.Controls.Add( levelTextBox );
            //
            // EscrowTextBox0
            //
            System.Windows.Forms.TextBox escrowTextBox = new TextBox();
            escrowTextBox.ReadOnly  = true;
            escrowTextBox.Location = new System.Drawing.Point(8, 184);
            escrowTextBox.Name = "EscrowTextBox_" + Index.ToString();
            escrowTextBox.Size = new System.Drawing.Size(40, 22);
            escrowTextBox.TabIndex = 7;
            escrowTextBox.Text = Coin.HeldInEscrow.ToString();
            coinPanel.Controls.Add( escrowTextBox );
            //
            // InhibitCheckBox0
            //
            System.Windows.Forms.CheckBox inhibitCheckBox = new CheckBox();
            inhibitCheckBox.Location = new System.Drawing.Point(16, 216);
            inhibitCheckBox.Name = "InhibitCheckBox_" + Index.ToString();
            inhibitCheckBox.Size = new System.Drawing.Size(16, 16);
            inhibitCheckBox.TabIndex = 8;
            inhibitCheckBox.Checked = (Coin.Inhibit != 0);
            inhibitCheckBox.CheckedChanged += new System.EventHandler(this.CoinControlChanged);
            coinPanel.Controls.Add( inhibitCheckBox );

            coinPanel.BringToFront();
        }
示例#46
0
        public void ActivateEstruturaDocs()
        {
            if (PesquisaUFList1.GetSelectedRows.Count() == 1)
            {
                long ticks = DateTime.Now.Ticks;
                List <PesquisaRule.DocAssociado> docsAssociados = new List <PesquisaRule.DocAssociado>();
                var    nivelRow = (GISADataset.NivelRow)PesquisaUFList1.SelectedRow;
                string ID       = nivelRow.ID.ToString();

                // Conta como consulta de detalhe da Unidade Física
                GisaDataSetHelper.RecordEstatisticaPesquisa(nivelRow.ID, "UF");


                GisaDataSetHelper.ManageDatasetConstraints(false);

                GisaDataSetHelper.HoldOpen ho = new GisaDataSetHelper.HoldOpen(GisaDataSetHelper.GetConnection());
                try
                {
                    docsAssociados = PesquisaRule.Current.LoadEstruturaDocsData(GisaDataSetHelper.GetInstance(), ID, ho.Connection);
                    GisaDataSetHelper.ManageDatasetConstraints(true);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                    throw;
                }
                finally
                {
                    ho.Dispose();
                }

                panelInfoEPs1.ClearAll();

                lstVwEstruturaDocs.BeginUpdate();
                lstVwEstruturaDocs.Items.Clear();
                lstVwEstruturaDocs.SmallImageList = TipoNivelRelacionado.GetImageList();

                List <ListViewItem> items = new List <ListViewItem>();
                foreach (var dAssoc in docsAssociados)
                {
                    ListViewItem item = new ListViewItem(new string[] { string.Empty, string.Empty, string.Empty, string.Empty });
                    item.SubItems[chCodigo.Index].Text     = dAssoc.Codigo;
                    item.SubItems[chTipoNivel.Index].Text  = dAssoc.RelDesignacao;
                    item.SubItems[chDesignacao.Index].Text = dAssoc.NivelDesignacao;
                    if (this.lstVwEstruturaDocs.Columns.Contains(this.chRequisitado))
                    {
                        if (dAssoc.Requisitado)
                        {
                            item.SubItems[chRequisitado.Index].Text = "Sim";
                        }
                        else
                        {
                            item.SubItems[chRequisitado.Index].Text = "Não";
                        }
                    }
                    item.ImageIndex      = SharedResourcesOld.CurrentSharedResources.NivelImageBase(dAssoc.GUIOrder);
                    item.StateImageIndex = item.ImageIndex;
                    item.Tag             = (GISADataset.NivelRow)(GisaDataSetHelper.GetInstance().Nivel.Select("ID=" + dAssoc.IDNivel.ToString())[0]);
                    items.Add(item);
                }
                lstVwEstruturaDocs.Items.AddRange(items.ToArray());

                lstVwEstruturaDocs.EndUpdate();
                pnlEstruturaDocs.BringToFront();
                Debug.WriteLine("<<ActivateEstruturaDocs>>: " + new TimeSpan(DateTime.Now.Ticks - ticks).ToString());
            }
            else
            {
                ToolBar_ButtonClick(this, new ToolBarButtonClickEventArgs(ToolBarButton2));
            }
        }
示例#47
0
 private void ActivateUnidadesFisicas()
 {
     pnlUnidadesFisicas.BringToFront();
 }
示例#48
0
        public opening(Form1 parent1 /*, bool InGame*/)          //
        {
            this.ClientSize = new Size(240, 320);
            //		this.Menu = new MainMenu();

            parent = parent1;

            this.ControlBox = false;

            InitializeComponent();

            cmdNewGame.Text  = language.getAString(language.order.openingNewGame);
            cmdLoadGame.Text = language.getAString(language.order.openingLoadGame);
            cmdLoadMap.Text  = language.getAString(language.order.openingLoadMap);
            cmdExit.Text     = language.getAString(language.order.openingExit);
            cmdContinue.Text = language.getAString(language.order.openingContinue);

// panel1
            lbYourName.Text    = language.getAString(language.order.nGYourName);
            lbYourNation.Text  = language.getAString(language.order.nGYourNation);
            lblDifficulty.Text = language.getAString(language.order.nGDifficulty);

            butFirstBackButton.Text = language.getAString(language.order.nGBack);
            butFirstNextButton.Text = language.getAString(language.order.nGNext);

            cbNiceBeginning.Text = language.getAString(language.order.nGHaveANiceBeginningSite);
            cbTutorialMode.Text  = language.getAString(language.order.nGTutorialMode);

// panel2
            butBackSecond.Text  = language.getAString(language.order.nGBack);
            butGenerateMap.Text = language.getAString(language.order.nGGenerateMap);

            lblMapSize.Text       = language.getAString(language.order.nGMapSize);
            lblContinentSize.Text = language.getAString(language.order.nGContinentSize);
            lblPercOfWater.Text   = language.getAString(language.order.nGPercOfWater);
            lblWorldAge.Text      = language.getAString(language.order.nGWorldAge);

//

// end panels

            tbMapSize.Value       = 1;
            tbContinentSize.Value = 1;

            tbWorldAge.Value = 0;
            tbWorldAge.Value = 1;

            tbNbrAis.Value = 8;             // ais

            #region progress
            //
            // panel3
            //
            panel3.Location = new System.Drawing.Point(8 * platformSpec.resolution.mod, 200 * platformSpec.resolution.mod);
            panel3.Size     = new System.Drawing.Size(224 * platformSpec.resolution.mod, 48 * platformSpec.resolution.mod);
            panel3.Visible  = false;
            panel3.Parent   = this;
            panel3.BringToFront();
            //
            // lblNewGameInfo
            //
            lblNewGameInfo.Location = new System.Drawing.Point(16 * platformSpec.resolution.mod, 4 * platformSpec.resolution.mod);
            lblNewGameInfo.Size     = new System.Drawing.Size(panel3.Width * 7 / 8, 16 * platformSpec.resolution.mod);
            lblNewGameInfo.Text     = "";
            panel3.Controls.Add(progressBar1);
            //
            // progressBar1
            //
            progressBar1.Location = new System.Drawing.Point(panel3.Width / 20, 22 * platformSpec.resolution.mod);
            progressBar1.Size     = new System.Drawing.Size(panel3.Width * 18 / 20, 20 * platformSpec.resolution.mod);
            panel3.Controls.Add(lblNewGameInfo);
            #endregion

            playerNameModified = false;
            tbMapSize.Value    = 0;

            /*	vgaSupport.vga( this.Controls );
             *      vgaSupport.vga( this.panel1.Controls );
             *      vgaSupport.vga( this.panel2.Controls );
             *      vgaSupport.vga( panel3.Controls );*/

            /*inGame = InGame;
             *
             * if ( inGame )
             * {
             *      cmdContinue.Text = "Return to game";
             *      cmdContinue.Click += new EventHandler( returnToGame_Click);
             * }
             * else*/
        }
示例#49
0
        /// <summary>
        ///     Used to embed connections that derive from <see cref="ExternalConnection" />.
        /// </summary>
        /// <param name="hWnd"> The control to be embedded in the tab page. </param>
        /// <param name="terminalTabPage">The terminal tab page that will be the parent of the external hWnd.</param>
        private Panel EmbedWindow(IntPtr hWnd, Control terminalTabPage)
        {
            lock (EmbedWindowLock)
            {
                terminalTabPage.InvokeIfNecessary(() => terminalTabPage.Controls.Clear());

                Panel panel = null;

                terminalTabPage.InvokeIfNecessary(() =>
                {
                    panel = new Panel
                    {
                        Size =
                            new Size(terminalTabPage.Size.Width,
                                    terminalTabPage.Size.Height)
                    };
                    panel.BringToFront();
                    SetParent(hWnd, panel.Handle);
                });

                SetWindowLong(hWnd, GWL_STYLE, WS_VISIBLE + WS_MAXIMIZE);
                MoveWindow(hWnd, 0, 0, terminalTabPage.Size.Width, terminalTabPage.Size.Height, true);

                terminalTabPage.InvokeIfNecessary(() => terminalTabPage.Controls.Add(panel));

                return panel;
            }
        }
示例#50
0
 private void button2_Click(object sender, System.EventArgs e)
 {
     panelDetay.Location = new Point(8, 8);
     panelDetay.Visible  = true;
     panelDetay.BringToFront();
 }
示例#51
0
        private void yamuiCharButton4_Click(object sender, EventArgs e)
        {
            // take a screenshot of the form and darken it:
            Bitmap bmp = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);
            using (Graphics G = Graphics.FromImage(bmp)) {
                G.CompositingMode = CompositingMode.SourceOver;
                G.CopyFromScreen(PointToScreen(new Point(0, 0)), new Point(0, 0), ClientRectangle.Size);
                double percent = 0.60;
                Color darken = Color.FromArgb((int)(255 * percent), Color.Black);
                using (Brush brsh = new SolidBrush(darken)) {
                    G.FillRectangle(brsh, ClientRectangle);
                }
            }

            // put the darkened screenshot into a Panel and bring it to the front:
            using (Panel p = new Panel()) {
                p.Location = new Point(0, 0);
                p.Size = ClientRectangle.Size;
                p.BackgroundImage = bmp;
                Controls.Add(p);
                p.BringToFront();

                // display your dialog somehow:
                Form frm = new Form();
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.ShowDialog(this);
            } // panel will be disposed and the form will "lighten" again...
        }
    private static void ShowPanelBar(string text)
    {
      if (_form == null)
      {
        return;
      }
      _form.UseWaitCursor = true;

      _splashOuterPanel = new Panel();
      _splashOuterTable = new TableLayoutPanel();
      _splashInnerTable = new TableLayoutPanel();
      _splashStatusLabel = new Label();
      _splashAnimation = new PictureBox();

      _splashOuterPanel.SuspendLayout();
      _splashOuterTable.SuspendLayout();
      _splashInnerTable.SuspendLayout();
      ((System.ComponentModel.ISupportInitialize)(_splashAnimation)).BeginInit();
      _form.SuspendLayout();

      var splashX = (_form.ClientRectangle.Width / 2) - (262 / 2);
      var splashY = (_form.ClientRectangle.Height / 2) - (117 / 2);

      // 
      // splashOuterPanel
      // 
      _splashOuterPanel.BorderStyle = BorderStyle.FixedSingle;
      _splashOuterPanel.Controls.Add(_splashOuterTable);
      _splashOuterPanel.Location = new System.Drawing.Point(splashX, splashY);
      _splashOuterPanel.Name = "splashOuterPanel";
      _splashOuterPanel.Size = new System.Drawing.Size(262, 117);
      _splashOuterPanel.UseWaitCursor = true;

      // 
      // splashOuterTable
      // 
      _splashOuterTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
      _splashOuterTable.ColumnCount = 1;
      _splashOuterTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
      _splashOuterTable.Controls.Add(_splashInnerTable, 0, 0);
      _splashOuterTable.Dock = DockStyle.Fill;
      _splashOuterTable.Location = new System.Drawing.Point(0, 0);
      _splashOuterTable.Name = "splashOuterTable";
      _splashOuterTable.RowCount = 1;
      _splashOuterTable.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
      _splashOuterTable.Size = new System.Drawing.Size(260, 115);
      _splashOuterTable.UseWaitCursor = true;

      // 
      // splashInnerTable
      // 
      _splashInnerTable.AutoSize = true;
      _splashInnerTable.BackgroundImage = Properties.Resources.AboutBack;
      _splashInnerTable.BackgroundImageLayout = ImageLayout.Stretch;
      _splashInnerTable.ColumnCount = 1;
      _splashInnerTable.ColumnStyles.Add(new ColumnStyle());
      _splashInnerTable.Controls.Add(_splashStatusLabel, 0, 0);
      _splashInnerTable.Controls.Add(_splashAnimation, 0, 1);
      _splashInnerTable.Dock = DockStyle.Fill;
      _splashInnerTable.ForeColor = System.Drawing.SystemColors.ControlText;
      _splashInnerTable.Location = new System.Drawing.Point(1, 1);
      _splashInnerTable.Margin = new Padding(0);
      _splashInnerTable.Name = "splashInnerTable";
      _splashInnerTable.RowCount = 2;
      _splashInnerTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 60F));
      _splashInnerTable.RowStyles.Add(new RowStyle());
      _splashInnerTable.Size = new System.Drawing.Size(258, 113);
      _splashInnerTable.UseWaitCursor = true;

      // 
      // splashStatusLabel
      // 
      _splashStatusLabel.BackColor = System.Drawing.Color.Transparent;
      _splashStatusLabel.Dock = DockStyle.Fill;
      _splashStatusLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F);
      _splashStatusLabel.ImeMode = ImeMode.NoControl;
      _splashStatusLabel.Location = new System.Drawing.Point(20, 0);
      _splashStatusLabel.Margin = new Padding(20, 0, 40, 0);
      _splashStatusLabel.Name = "splashStatusLabel";
      _splashStatusLabel.Size = new System.Drawing.Size(210, 60);
      if (text.Length > 0)
      {
        _splashStatusLabel.Text = text;
      }
      _splashStatusLabel.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
      _splashStatusLabel.UseWaitCursor = true;

      // 
      // splashAnimation
      // 
      _splashAnimation.Image = Properties.Resources.progressbar_green;
      _splashAnimation.ImeMode = ImeMode.NoControl;
      _splashAnimation.Location = new System.Drawing.Point(20, 70);
      _splashAnimation.Margin = new Padding(20, 10, 0, 0);
      _splashAnimation.Name = "splashAnimation";
      _splashAnimation.Size = new System.Drawing.Size(214, 15);
      _splashAnimation.TabStop = false;
      _splashAnimation.UseWaitCursor = true;

      // 
      // Add to form
      // 
      _form.Controls.Add(_splashOuterPanel);
      _splashOuterPanel.ResumeLayout(false);
      _splashOuterTable.ResumeLayout(false);
      _splashOuterTable.PerformLayout();
      _splashInnerTable.ResumeLayout(false);
      ((System.ComponentModel.ISupportInitialize)(_splashAnimation)).EndInit();
      _form.ResumeLayout(false);

      _splashOuterPanel.BringToFront();
    }
示例#53
0
 private void YearlyRadio_CheckedChanged(object sender, System.EventArgs e)
 {
     this.HideAllPanels();
     YearlyPanel.Visible = true;
     YearlyPanel.BringToFront();
 }
示例#54
0
        public ColorPickerPanel()
            : base()
        {
            this.TabStop = false;
            this.Margin = this.Padding = new Padding(1);
            this.AutoSize = false;

            panel = new Panel();
            panel.TabStop = false;
            panel.AutoSize = false;
            panel.Location = new Point(0, 0);
            panel.Dock = DockStyle.Fill;

            tab = new FlatTabControl();
            tab.TabStop = false;
            tab.Tabs = new string[] {
                System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.Equals("ja",
                    StringComparison.CurrentCultureIgnoreCase)?"ソリッド":"Solid" };
            tab.Size = new Size(ClientRectangle.Width, 20);
            tab.Dock = DockStyle.Top;
            tab.SelectedIndexChanged += (s, e) => panels[tab.SelectedIndex].BringToFront();

            Controls.Add(tab);
            Controls.Add(panel);

            solidPanel.Dock = DockStyle.Fill;
            solidPanel.ColorPicked += (s, e) =>
            {
                currentColor = null;// new SolidColor(colorPickerPanel.CurrentColor);
                if (ColorPicked != null) ColorPicked(this, e);
            };
            solidPanel.BringToFront();

            panel.Controls.Add(solidPanel);

            panels.Add(solidPanel);

            this.Size = new Size(172, 220);
            panel.BringToFront();
        }
示例#55
0
        /// <summary>
        /// Metodo che mostra la finestra di inserimento.
        /// </summary>
        private void showInsertingWindow()
        {
            TransPanel background = new TransPanel(this.Width,
                                                   this.Height,
                                                   Color.FromArgb(200, 192, 192, 192) //Argento con trasparenza 200 (max 255 = opaco)
                                                   );
            background.Size = this.Size;
            background.Name = "background";
            background.Location = new Point(0, 0);
            background.BackColor = Color.FromArgb(200, 192, 192, 192);
            this.Controls.Add(background); //Per far sì che il controllo sia presente

            //Sezione per la creazione del pannello "insertingWindow".
            Panel insertingWindow = new Panel(); //Oggetto, che per comodità si chiamerà come il controllo
            insertingWindow.BorderStyle = BorderStyle.FixedSingle; //Border del pannello
            //Larga 2/3 la form
            //Alta 3/4 la form
            insertingWindow.Size = new Size(this.Size.Width * 2 / 3, this.Size.Height * 3 / 4);
            insertingWindow.Location = new Point(this.Size.Width / 5, -insertingWindow.Height); //-1 per non mostrare il bordo superiore
            insertingWindow.Name = "insertingWindow"; //Nome con cui verrà visualizzato il controllo
            createInsertingControls(insertingWindow); //Solo ed esclusivamente per ordine del cordice
            this.Controls.Add(insertingWindow); //Per far sì che il controllo sia presente
            for (int i = 0; i < this.Size.Height * 3 / 4 - 1; i+=4) {
                insertingWindow.Location = new Point(insertingWindow.Location.X, i - insertingWindow.Height);
            }

            //Sezione per la creazione del pannello "background"
            //Oggetto, che per comodità si chiamerà come il controllo
            this.ActiveControl = insertingWindow; //Per rendere il tutto piacevole alla vista

            background.BringToFront(); //Mette in primo piano il background
            insertingWindow.BringToFront(); //Mette in primo piano la finestra
        }
        public void Initialize_PeopleM()
        {
            drag_timer = new Timer();
            drag_timer.Tick += new EventHandler(drag_timer_Tick_1);

            peopleM_controls = new List<Control>();
            Panel dummy_panel;
            Label dummy_label;
            PictureBox dummy_picbox;
            customerPanels = new Panel[10];

            //Create Panels
            #region Button Panels

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

            dummy_panel.Location = new Point(26, 121);
            dummy_panel.Size = new Size(211, 97);
            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(3, 3);
            dummy_picbox.Size = new Size(56, 56);
            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 = "Add Sambodeeh";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(3, 62);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(211, 97);
            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);

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

            //new panel 

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

            dummy_panel.Location = new Point(26, 224);
            dummy_panel.Size = new Size(211, 97);
            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(3, 3);
            dummy_picbox.Size = new Size(56, 56);
            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 = "Search Sambodeeh";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(3, 62);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(211, 97);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

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

            //new panel 

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

            dummy_panel.Location = new Point(26, 327);
            dummy_panel.Size = new Size(211, 97);
            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.appbar_undo;
            dummy_picbox.Location = new Point(3, 3);
            dummy_picbox.Size = new Size(56, 56);
            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 = "Undo";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(3, 62);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(211, 97);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

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

            //new panel 

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

            dummy_panel.Location = new Point(26, 430);
            dummy_panel.Size = new Size(211, 97);
            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.appbar_redo;
            dummy_picbox.Location = new Point(3, 3);
            dummy_picbox.Size = new Size(56, 56);
            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 = "Redo";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(3, 62);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(211, 97);
            dummy_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
            dummy_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

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

            //new panel 

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

            dummy_panel.Location = new Point(26, 532);
            dummy_panel.Size = new Size(211, 97);
            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.exit_normal;
            dummy_picbox.Location = new Point(3, 3);
            dummy_picbox.Size = new Size(56, 56);
            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 = "Go Back";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(3, 62);
            dummy_label.ForeColor = Color.FromArgb(245, 245, 245);
            dummy_label.Size = new Size(211, 97);
            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.return_to_menu);
            dummy_panel.Click += new EventHandler(Globals._mainForm.return_to_menu);
            dummy_picbox.Click += new EventHandler(Globals._mainForm.return_to_menu);

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



            #endregion

            //Default Controls
            #region Labels/Pic Box
            dummy_label = new Label();
            dummy_label.BackColor = Color.FromArgb(16, 16, 16);
            dummy_label.Text = "Main/People";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(21, 94);
            dummy_label.ForeColor = Color.FromArgb(9, 165, 210);
            dummy_label.Size = new Size(211, 97);
            peopleM_controls.Add(dummy_label);

            dummy_label = new Label();
            dummy_label.BackColor = Color.FromArgb(16, 16, 16);
            dummy_label.Text = "Employees";
            dummy_label.Font = new Font("Segoe UI", 14);
            dummy_label.Location = new Point(244, 103);
            dummy_label.ForeColor = Color.FromArgb(9, 165, 210);
            dummy_label.Size = new Size(211, 27);
            peopleM_controls.Add(dummy_label);

            #endregion

            #region Customer Panels
            for (int i = 0; i < 10; i++)
            {
                //panel
                Panel customerBox = new Panel();
                customerBox.Location = new Point(251, 131 + 49 * i);
                if (i % 2 == 0)
                    customerBox.BackColor = Color.FromArgb(32, 32, 32);
                else
                    customerBox.BackColor = Color.FromArgb(36, 36, 36);
                customerBox.Size = new Size(570, 50);
                customerBox.Name = "pp" + i;
                customerBox.Click += new EventHandler(peep_loader);
                Globals._mainForm.Controls.Add(customerBox);
                //customer photo
                PictureBox customer_picbox = new PictureBox();
                customer_picbox.Parent = customerBox;
                customer_picbox.Location = new Point(10, 5);
                customer_picbox.Image = Properties.Resources.peep;
                customer_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
                customer_picbox.Size = new Size(44, 44);
                customer_picbox.Name = "pb" + i;
                customer_picbox.Click += new EventHandler(peep_loader);

                PictureBox remove_picbox = new PictureBox();
                remove_picbox.Parent = customerBox;
                remove_picbox.Location = new Point(520, 10);
                remove_picbox.Image = Properties.Resources.appbar_user_delete;
                remove_picbox.SizeMode = PictureBoxSizeMode.StretchImage;
                remove_picbox.Size = new Size(28, 28);
                remove_picbox.Name = "pb" + i;
                remove_picbox.Click += new EventHandler(delete_peep);
                remove_picbox.MouseEnter += new EventHandler(remove_picbox_MouseEnter);
                remove_picbox.MouseLeave += new EventHandler(remove_picbox_MouseLeave);
                //text

                Label customer_label = new Label();
                customer_label.Font = new Font("Segoe UI", 12);
                customer_label.ForeColor = Color.White;
                if (Globals._customers[i] != null)
                    customer_label.Text = Globals._customers[i]._name + " " + Globals._customers[i]._prenume;
                else
                    customer_label.Text = "Customer number " + i + 1;
                customer_label.Parent = customerBox;
                customer_label.Location = new Point(60, 15);
                customer_label.Size = new Size(350, 100);
                customer_label.Name = "cl" + i;
                customer_label.Click += new EventHandler(peep_loader);

                customerBox.MouseEnter += new EventHandler(Globals._mainForm.box_enter);
                customer_label.MouseEnter += new EventHandler(Globals._mainForm.child_enter);
                customer_picbox.MouseEnter += new EventHandler(Globals._mainForm.child_enter);

                customerBox.MouseLeave += new EventHandler(Globals._mainForm.box_leave);
                customer_label.MouseLeave += new EventHandler(Globals._mainForm.child_leave);
                customer_picbox.MouseLeave += new EventHandler(Globals._mainForm.child_leave);

                customerBox.BringToFront();
                customerPanels[i] = customerBox;

                peopleM_controls.Add(customerBox);
            }
            #endregion

            #region CUSTOM SCROLLBAR :) :) :)
            scrollbar = new PictureBox();
            scrollbar.Location = new Point(830, 131);
            scrollbar.BackColor = Color.FromArgb(16,16,16);
            scrollbar_dragged = false;
            if ((Globals._cN - 10) > 0)
            {
                scrollbar.Size = new Size(20, Math.Max(10, (507 / (Globals._cN - 10 + 1))));
                scrollbar.BackColor = Color.FromArgb(36, 36, 36);
                scale_ratio = (float)(507 / Globals._cN);
            }

            peopleM_controls.Add(scrollbar);

            scrollbar.MouseMove += new MouseEventHandler(scrollbar_MouseMove);
            scrollbar.MouseUp += new MouseEventHandler(scrollbar_MouseUp);
            scrollbar.MouseDown += new MouseEventHandler(scrollbar_MouseDown);
            #endregion
            foreach (Control control in peopleM_controls)
            {
                if (control.Parent == null)
                    Globals._mainForm.Controls.Add(control);
                control.Visible = false;
            }
        }
示例#57
0
        public void DoExecute()
        {
            if (stbMain.Text.Length == 0)
            {
                return;
            }

            if (!panelBottom.Visible)
            {
                stbMain.Dock        = DockStyle.Top;
                sptMain.Visible     = true;
                panelBottom.Visible = true;
            }

            rtxtResults.Clear();
            rtxtResults.BringToFront();

            for (int iControl = panelGrids.Controls.Count; --iControl >= 0;)
            {
                panelGrids.Controls.RemoveAt(iControl);
            }

            m_oDataSet      = null;
            m_fExecuteError = false;
            m_sLastError    = "";
            sbpStatus.Text  = "Executing query batch...";
            sbpTime.Text    = GetTimeText(0);
            sbpRows.Text    = "0 rows";

            try
            {
                if (m_oConn.State != ConnectionState.Open)
                {
                    m_oConn.Open();
                    m_oConn.ChangeDatabase(sbpDatabase.Text);
                }

                m_fCancelExecute = false;

                long cTickStart = DateTime.Now.Ticks;

                System.Threading.Thread oThread = new System.Threading.Thread(new System.Threading.ThreadStart(ExecuteQuery));
                oThread.Start();

                int cRows = 0;

                string sLastTime = "";
                while (oThread.IsAlive)
                {
                    string sTime = GetTimeText(DateTime.Now.Ticks - cTickStart);
                    if (sTime != sLastTime)
                    {
                        Globals.MainForm.UpdateExecuteState(this);
                        sbpTime.Text = sTime;

                        cRows = 0;
                        if (m_oDataSet != null)
                        {
                            foreach (DataTable oTable in m_oDataSet.Tables)
                            {
                                cRows += oTable.Rows.Count;
                            }
                            if (cRows == 1)
                            {
                                sbpRows.Text = "1 row";
                            }
                            else
                            {
                                sbpRows.Text = cRows.ToString("#,##0") + " rows";
                            }
                        }

                        sLastTime = sTime;
                    }

                    if (m_fCancelExecute)
                    {
                        try
                        {
                            oThread.Abort();
                        }
                        catch (Exception oEx)
                        {
                            string s = oEx.ToString();
                            s = "";
                        }
                        m_fIsExecuting = false;
                        Globals.MainForm.UpdateExecuteState(this);
                    }
                    else
                    {
                        Application.DoEvents();
                        System.Threading.Thread.Sleep(200);
                    }
                }

                int cTables = m_oDataSet.Tables.Count;
                int dypGrid = (cTables == 0) ? 0 : panelGrids.Height / cTables;
                if (dypGrid < kdypMinResults)
                {
                    dypGrid = kdypMinResults;
                }
                panelGrids.AutoScrollMinSize = new Size(0, dypGrid * cTables);

                //for (int iTable = cTables; --iTable >= 0; )
                for (int iTable = 0; iTable < cTables; iTable++)
                {
                    DataTable oTable = m_oDataSet.Tables[iTable];

                    NumberedDataGrid oGrid = new NumberedDataGrid();
                    oGrid.AllowSorting      = false;
                    oGrid.Size              = new System.Drawing.Size(panelGrids.Width, dypGrid);
                    oGrid.BackgroundColor   = System.Drawing.SystemColors.Window;
                    oGrid.CaptionVisible    = false;
                    oGrid.HeaderForeColor   = System.Drawing.SystemColors.ControlText;
                    oGrid.ReadOnly          = true;
                    oGrid.RowHeadersVisible = false;
                    //oGrid.Resize += new EventHandler(Grid_Resize);
                    panelGrids.Resize += new EventHandler(Grid_Resize);

                    panelGrids.Controls.Add(oGrid);
                    oGrid.Location = new Point(0, iTable * (dypGrid + kdypSpacing));

                    oTable.DefaultView.AllowNew    = false;
                    oTable.DefaultView.AllowEdit   = false;
                    oTable.DefaultView.AllowDelete = false;

                    DataGridTableStyle oTableStyle = new DataGridTableStyle();
                    oTableStyle.RowHeadersVisible = true;
                    oTableStyle.ReadOnly          = true;
                    oTableStyle.MappingName       = oTable.TableName;
                    oTableStyle.AllowSorting      = false;

                    foreach (DataColumn oColumn in oTable.Columns)
                    {
                        DataGridColumnStyle oColStyle = GetColStyle(oColumn);
                        oTableStyle.GridColumnStyles.Add(oColStyle);
                    }

                    oGrid.TableStyles.Add(oTableStyle);
                    oGrid.DataSource = oTable;
                }

                if (cTables == 0)
                {
                    if (m_sbMessages.Length == 0)
                    {
                        SqlCommand oCommand = m_oConn.CreateCommand();
                        oCommand.CommandText = "select @@rowcount";
                        int cRecords = (int)oCommand.ExecuteScalar();
                        if (cRecords == 1)
                        {
                            m_sbMessages.AppendLine("(1 row affected)");
                        }
                        else
                        {
                            m_sbMessages.AppendLine("(" + cRecords.ToString("#,##0") + " rows affected)");
                        }
                    }
                    rtxtResults.Text = m_sbMessages.ToString();
                    rtxtResults.BringToFront();
                }
                else
                {
                    panelGrids.BringToFront();
                }

                sbpTime.Text = GetTimeText(DateTime.Now.Ticks - cTickStart);

                cRows = 0;
                foreach (DataTable oTable in m_oDataSet.Tables)
                {
                    cRows += oTable.Rows.Count;
                }
                if (cRows == 1)
                {
                    sbpRows.Text = "1 row";
                }
                else
                {
                    sbpRows.Text = cRows.ToString("#,##0") + " rows";
                }

                // Since the database might have changed, update it.
                if (m_oConn.State == ConnectionState.Open)
                {
                    sbpDatabase.Text = m_oConn.Database;
                }

                if (m_fCancelExecute)
                {
                    sbpStatus.Text = "Query batch was cancelled";
                }
                else
                {
                    sbpStatus.Text = "Query batch completed";
                }
            }
            catch (Exception oEx)
            {
                m_sLastError = oEx.Message;
            }

            if (m_fExecuteError && !m_fCancelExecute)
            {
                sbpStatus.Text = "Query batch completed with errors";
                rtxtResults.Clear();
                rtxtResults.SelectionColor = System.Drawing.Color.Red;
                rtxtResults.SelectedText   = m_sLastError;
                rtxtResults.BringToFront();
            }

            m_fIsExecuting = false;
        }
 private void SetPanelToFill(Panel panel)
 {
     panel.Dock = DockStyle.Fill;
     panel.BringToFront();
 }
示例#59
0
        private void InitializeDesign()
        {
            //Window
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            HubHeader header = new HubHeader(this);

            this.statusBar      = new UI.WindowsForms.UIElements.StatusBar(this);
            this.sizeGrip       = new SizeGrip(this);
            this.SizeChanged   += Hub_SizeChanged;
            pnlContainer        = new TableLayoutPanel();
            hubItem             = new TableLayoutPanel();
            hubItem.ColumnCount = 4;
            hubItem.RowCount    = 5;


            pnlContainer.Top = 50;

            pnlContainer.Font = FontManager.GetFont("IRANSans", 14, FontStyle.Regular);

            HandleResize();
            pnlContainer.ColumnCount = 3;
            pnlContainer.RowCount    = 1;
            pnlContainer.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 330));
            //BasicInformation
            HubButton basicInformation = new HubButton(Definitions.EnvironmentNames.BasicInformation, this);

            hubItem.Controls.Add(basicInformation, 0, 0);
            //Sales Management
            HubButton KalaGostaran = new HubButton(Definitions.EnvironmentNames.KalaGostaran, this);

            hubItem.Controls.Add(KalaGostaran, 1, 0);
            //Sales Management
            HubButton sales = new HubButton(Definitions.EnvironmentNames.Sales, this);

            hubItem.Controls.Add(sales, 1, 1);

            HubButton salesManagement = new HubButton(Definitions.EnvironmentNames.SalesManagement, this);

            hubItem.Controls.Add(salesManagement, 0, 1);
            //  pnlHubItemContainer.Controls.Add(salesManagement);
            //Sales

            // Treasury
            HubButton treasury = new HubButton(Definitions.EnvironmentNames.Treasury, this);

            hubItem.Controls.Add(treasury, 0, 2);
            //Accounting
            HubButton accounting = new HubButton(Definitions.EnvironmentNames.Accounting, this);

            hubItem.Controls.Add(accounting, 1, 2);

            //Reporting
            HubButton reporting = new HubButton(Definitions.EnvironmentNames.Reporting, this);

            hubItem.Controls.Add(reporting, 0, 3);

            ////Warehouse
            //HubButton warehouse = new HubButton(Definitions.EnvironmentNames.Warehouse, this);
            //pnlHubItemContainer.Controls.Add(warehouse);
            //Rahyab
            HubButton rahyab = new HubButton(Definitions.EnvironmentNames.Rahyab, this);

            hubItem.Controls.Add(rahyab, 1, 3);

            //EMS
            HubButton ems = new HubButton(Definitions.EnvironmentNames.EMS, this);

            hubItem.Controls.Add(ems, 0, 4);
            //SMS
            HubButton sms = new HubButton(Definitions.EnvironmentNames.SMS, this);

            hubItem.Controls.Add(sms, 1, 4);
            //BackupAndRestore
            HubButton bak = new HubButton(Definitions.EnvironmentNames.BackupAndRestore, this);

            hubItem.Controls.Add(bak, 2, 4);
            //Settings
            HubButton setting = new HubButton(Definitions.EnvironmentNames.Settings, this);

            hubItem.Controls.Add(setting, 3, 4);

            hubItem.Dock        = DockStyle.Fill;
            hubItem.RightToLeft = RightToLeft.Yes;
            pnlContainer.Controls.Add(hubItem, 2, 0);

            pnlSeperator = new FlowLayoutPanel();

            pnlSeperator.BackColor = Color.Transparent;

            pnlSeperator.Dock = DockStyle.Left;
            HubSeperator seperator = new HubSeperator(this.pnlSeperator);

            seperator.Height = Screen.PrimaryScreen.Bounds.Height - 100;
            pnlSeperator.Controls.Add(seperator);
            pnlSeperator.ControlAdded += PnlSeperator_ControlAdded;
            pnlSeperator.Width         = seperator.Width;
            pnlContainer.Controls.Add(pnlSeperator, 1, 0);

            pnlFeed             = new TableLayoutPanel();
            pnlFeed.ColumnCount = 1;
            pnlFeed.RowCount    = 3;
            System.Windows.Forms.Panel pnlTopFeed = new System.Windows.Forms.Panel();
            pnlTopFeed.Dock = DockStyle.Top;
            System.Windows.Forms.Panel pnlFooterFeed = new System.Windows.Forms.Panel();
            pnlFooterFeed.Dock  = DockStyle.Bottom;
            pnlMainFeed         = new System.Windows.Forms.Panel();
            pnlMainFeed.Dock    = DockStyle.Fill;
            pnlFeed.RightToLeft = RightToLeft.Yes;
            pnlFeed.BackColor   = Color.FromArgb(238, 238, 238);
            pnlFeed.Width       = pnlContainer.Width - hubItem.Width - pnlSeperator.Width;
            pnlFeed.Height      = Screen.PrimaryScreen.Bounds.Height;

            LinkLabel lbltxtAtiran = new LinkLabel();

            lbltxtAtiran.AutoSize = true;
            lbltxtAtiran.Parent   = pnlFeed;
            lbltxtAtiran.Font     = FontManager.GetFont("IRANSans", 11, FontStyle.Regular);
            lbltxtAtiran.Text     = $"گروه نرم افزاري آتيران www.Atiran.ir";
            lbltxtAtiran.Dock     = DockStyle.Top;
            pnlFooterFeed.Controls.Add(lbltxtAtiran);
            pnlMainFeed.Height = pnlFeed.Height - pnlTopFeed.Height - pnlFooterFeed.Height - 100;
            pnlFeed.Controls.Add(pnlTopFeed, 0, 0);
            pnlFeed.Controls.Add(pnlMainFeed, 0, 1);
            pnlFeed.Controls.Add(pnlFooterFeed, 0, 2);
            pnlFeed.ControlAdded += PnlFeed_ControlAdded;
            newsBox      = new System.Windows.Forms.Panel();
            newsBox.Dock = DockStyle.Fill;
            pnlMainFeed.BringToFront();

            pnlContainer.Controls.Add(pnlFeed, 0, 0);

            this.Controls.Add(pnlContainer);
        }
        private Panel CreatePanel(
            int left,
            int top,
            int width,
            int height,
            string imageResourceName,
            string accessibleName,
            string accessibleDescription,
            EventHandler mouseClickHandler = null,
            MouseEventHandler mouseDownHandler = null)
        {
            // Create a new panel to draw the image on
            var panel = new Panel
                {
                    Left = left,
                    Top = top,
                    Height = height,
                    Width = width,
                    Anchor = AnchorStyles.Bottom | AnchorStyles.Right
                };

            Debug.Assert(imageResourceName != null, "imageResourceName != null");
            var bitmap = new Bitmap(GetType(), imageResourceName);
            var pictureBox = new PictureBox
                {
                    AccessibleName = accessibleName,
                    AccessibleDescription = accessibleDescription,
                    AccessibleRole = AccessibleRole.PushButton
                };

            _themeChangedActions.Add(
                ()
                => pictureBox.Image
                   = ThemeUtils.GetThemedButtonImage(
                       bitmap,
                       EnvironmentColors.ScrollBarBackgroundColorKey));

            if (mouseClickHandler != null)
            {
                pictureBox.Click += mouseClickHandler;
            }

            if (mouseDownHandler != null)
            {
                pictureBox.MouseDown += mouseDownHandler;
            }

            _toolTip.SetToolTip(pictureBox, accessibleDescription);

            panel.Controls.Add(pictureBox);
            panel.BringToFront();
            return panel;
        }