/// <summary> /// Affichage de l'énigme 9 points /// </summary> public NinePointsEnigmaPanel() { this.Height = 800; //change la taille du panel "parent" /*Initialise la PictureBox*/ pcbCase9Points.Size = this.Size; pcbCase9Points.BackgroundImage = Properties.Resources.NinePoints; pcbCase9Points.Click += new System.EventHandler(MouseClick_Affiche9Points); pcbCase9Points.MouseMove += new MouseEventHandler(MouseMove_Afficher9Points); pcbCase9Points.Paint += new PaintEventHandler(Paint_pcbCase9Points); Controls.Add(pcbCase9Points); /*Initialise bouton recommencer*/ Button btnRecommencer = new Button(); btnRecommencer.Font = new Font("Microsoft Sans Serif", 19); btnRecommencer.Text = "Recommencer"; btnRecommencer.AutoSize = true; btnRecommencer.Click += new EventHandler(MouseClick_btnRecommencer); btnRecommencer.Location = new Point(this.Left + 10, this.Top + 750); Controls.Add(btnRecommencer); btnRecommencer.BringToFront(); /*Initialise les positions du centre des points*/ for (int i = 0, iX = 200, iY = 200; i < tCentrePoint.Length; i++, iX += 200) { if (i % 3 == 0 && i != 0) //permet de changer de ligne dans un axe x, y { iY += 200; iX = 200; } tCentrePoint[i] = new Point(iX, iY); } }
private void frmPrintPreviewDialog_Load(object sender, System.EventArgs e) { m_cmdPrintCurrent.BringToFront(); if (MDIParent.s_ObjCurrentPatient != null && MDIParent.s_ObjCurrentPatient.m_IntCharacter == 1) { if (Static::clsEMR_StaticObject.s_ObjCurrentEmployee.m_strRoleNameArr != null) { int intRolesCount = Static::clsEMR_StaticObject.s_ObjCurrentEmployee.m_strRoleNameArr.Length; for (int i = 0; i < intRolesCount; i++) { if (Static::clsEMR_StaticObject.s_ObjCurrentEmployee.m_strRoleNameArr[i] == "病案室") { m_blnIsCase = true; break; } } } if (!m_blnIsCase) { this.m_lblCoverPrinter.Visible = true; return; } } m_blnCheckPrinter(); }
private void _MakeButtonClose() { closeButton = new formSystemButton(); closeButton.Anchor = AnchorStyles.Right; closeButton.Text = ""; if (uwfAppOwner.Resources != null && uwfAppOwner.Resources.Close != null) { closeButton.Image = uwfAppOwner.Resources.Close; } else { closeButton.Text = "X"; } closeButton.Location = new Point(Width - 32, 1); closeButton.Name = "buttonClose"; closeButton.BackColor = Color.FromArgb(0, 238, 238, 242); closeButton.Size = new Size(24, 16); closeButton.ForeColor = Color.FromArgb(64, 64, 64); closeButton.uwfBorderColor = Color.Transparent; closeButton.uwfBorderHoverColor = Color.Transparent; closeButton.uwfHoverColor = Color.FromArgb(64, 252, 252, 252); closeButton.uwfImageColor = Color.FromArgb(64, 64, 64); closeButton.uwfImageHoverColor = Color.FromArgb(128, 128, 128); closeButton.BringToFront(); closeButton.Click += OnCloseButtonOnClick; Controls.Add(closeButton); }
private void InitSendDisclosuresButton(Panel buttonsPanel) { SendDisclosuresButton = new System.Windows.Forms.Button(); SendDisclosuresButton.Name = "WcmDisclosures"; this.SendDisclosuresButton.Text = "Send!"; SendDisclosuresButton.TextAlign = ContentAlignment.MiddleRight; SendDisclosuresButton.Size = new Size(70, 24); this.SendDisclosuresButton.Image = global::CommunityPlugin.Properties.Resources.wcmLogoButton; this.SendDisclosuresButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; SendDisclosuresButton.Click += new EventHandler(SendDisclosuresButton_Click); SendDisclosuresButton.Location = new Point(0, 25); // SP - if override field to view the KM button is enabled, // move our WCM button over to see KM button if (EncompassApplication.CurrentLoan.Fields["CX.BLEND.SHOW.KM.SENDDOCS.BT"].ToString() .Equals("Y", StringComparison.OrdinalIgnoreCase)) { SendDisclosuresButton.Location = new Point(SendDisclosuresButton.Location.X + 30, SendDisclosuresButton.Location.Y); } SendDisclosuresButton.Visible = true; SendDisclosuresButton.Enabled = true; SendDisclosuresButton.BringToFront(); buttonsPanel.Controls.Add((Control)SendDisclosuresButton); buttonsPanel.Refresh(); }
private Button CreateDynamicButton(string sName, string sText, int sTag, Point pLocation) { Button dynamicButton = new System.Windows.Forms.Button(); dynamicButton.Name = sName; dynamicButton.Location = new System.Drawing.Point(pLocation.X, pLocation.Y); dynamicButton.Text = sText; dynamicButton.TextAlign = ContentAlignment.MiddleLeft; dynamicButton.Tag = sTag; dynamicButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); dynamicButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dynamicButton.Size = new System.Drawing.Size(550, 54); dynamicButton.UseVisualStyleBackColor = true; dynamicButton.Visible = true; dynamicButton.BackColor = Color.White; dynamicButton.FlatStyle = FlatStyle.Flat; dynamicButton.FlatAppearance.MouseOverBackColor = Color.White; dynamicButton.FlatAppearance.BorderColor = Color.White; behaviorMap1.Add(dynamicButton, new EyeXFramework.GazeAwareBehavior(OnGaze)); dynamicButton.Click += new System.EventHandler(this.dynamicButton_click); dynamicButton.MouseEnter += new System.EventHandler(this.dynamicButton_mouseEnter); this.splitContainer1.Panel2.Controls.Add(dynamicButton); dynamicButton.BringToFront(); return(dynamicButton); }
private void button1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { button1.BringToFront(); button1.Capture = false; if (this.Controls.Contains(CSharpTracker)) { this.Controls.Remove(CSharpTracker); } CSharpTracker = new RectTracker(button1); this.Controls.Add(CSharpTracker); CSharpTracker.BringToFront(); CSharpTracker.Draw(); }
private void BuildDialog_Load(object sender, System.EventArgs e) { moveItemControl1.OnMoveItems += new MoveItemControl.MoveItemsEvent(OnMoveItems); moveItemControl1.OnNudgeItems += new MoveItemControl.NudgeItemsEvent(OnNudgeItems); Connection.OnBusy += new Connection.ClientBusyEvent(OnClientBusy); Connection.OnConnect += new Connection.ConnectEvent(OnConnection); Connection.OnDisconnect += new Connection.DisconnectEvent(OnDisconnection); Connection.OnReady += new Connection.ClientReadyEvent(OnClientReady); SetPosition(); UpdateControlStates(); btnGetZ.BringToFront(); }
// TODO: fix button creation using ImageList, and resize images to other size, tooltips. // Yes, we doesn't use any *Strip controls, 'cause from one side they are really buggy, and from other side - this code more similar to GTK port. private Button CreateButton(string title, string stockImage, EventHandler action, DockStyle dockStyle = DockStyle.Left) { var button = new Button(); button.Image = Image.FromStream(GetImageStream(stockImage)); button.Width = 36; // button.Image.Width; button.Height = 36; // button.Image.Height; button.Text = ""; button.TextImageRelation = TextImageRelation.Overlay; button.ImageAlign = ContentAlignment.MiddleCenter; button.TextAlign = ContentAlignment.MiddleCenter; button.Parent = this; button.Dock = dockStyle; button.BringToFront(); button.Click += action; return button; }
public static void MinimizeButton(Button currentButton) { try { Point currentLocation = new System.Drawing.Point(currentButton.Location.X, currentButton.Location.Y); currentButton.Width = currentButton.Width - maximizeValue; currentButton.Height = currentButton.Height - maximizeValue; currentLocation.X = currentLocation.X + (maximizeValue / 2); currentLocation.Y = currentLocation.Y + (maximizeValue / 2); currentButton.Location = currentLocation; currentButton.BringToFront(); } catch (Exception) { } }
private Button AddToolboxButton(int x, int y, Bitmap pic, byte?caveByte = null, float scale = 1.0f) { System.Windows.Forms.Button but = new System.Windows.Forms.Button { Top = y, Left = x, Height = Constants.TOOLBOX_TILE_SIZE, Width = Convert.ToInt32(Constants.TOOLBOX_TILE_SIZE * scale), BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch, FlatStyle = System.Windows.Forms.FlatStyle.Flat, BackgroundImage = pic, Tag = new ButtonTag(x, y, -1, caveByte) }; but.MouseEnter += new System.EventHandler(this.button_MapTileMouseEnter); but.MouseLeave += new System.EventHandler(this.button_MapTileMouseLeave); this.Controls.Add(but); but.BringToFront(); return(but); }
public Ship(int number, int ship_length, string name) { on_playboard = false; length = ship_length; horizontal = true; System.Windows.Forms.Button button1 = new System.Windows.Forms.Button(); button1.Location = new System.Drawing.Point(100, 30*number); button1.Text = "S_" + length; button1.Name = name; button1.Size = new System.Drawing.Size(25*length, 25); button1.TabIndex = 0; button1.MouseClick += new System.Windows.Forms.MouseEventHandler(ship_Click); location = button1.Location; button = button1; MainForm.mainform.Controls.Add(button1); button1.BringToFront(); }
private void MakeButton(int x, int y) { int box_Width = 130; int box_Height = 30; OKButton = new System.Windows.Forms.Button(); OKButton.Name = "OKButton"; OKButton.Text = "範囲を決定する"; OKButton.FlatStyle = FlatStyle.Flat; OKButton.FlatAppearance.BorderSize = 2; OKButton.Location = new Point(x - box_Width, y + 5); OKButton.Size = new System.Drawing.Size(box_Width, box_Height); OKButton.Click += new EventHandler(button1_Click); Controls.Add(this.OKButton); OKButton.BringToFront(); }
private void ModificaInterfaceGrafica() { m_gbGeral.Controls.Clear(); int nPosXBotao = -1; int nPosYBotao = -1; int nIncrementoPosXBotao = 5; int nWidthBotao = 80; int nHeightBotao = 40; // Inserindo a Pergunta System.Windows.Forms.Label m_lbPergunta = new System.Windows.Forms.Label(); m_lbPergunta.Name = "m_lbPergunta"; m_lbPergunta.Text = m_strPergunta; m_lbPergunta.Location = new System.Drawing.Point(10, 8); m_lbPergunta.Size = new System.Drawing.Size(m_gbGeral.Width - (m_gbGeral.Location.X + 10), m_gbGeral.Height - (m_gbGeral.Location.Y + 50)); m_lbPergunta.Font = new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Bold); m_lbPergunta.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; m_gbGeral.Controls.Add(m_lbPergunta); // Setando posicoes do botao int nEspacoOcupar = (m_arlBotoes.Count * nWidthBotao) + ((m_arlBotoes.Count - 1) * nIncrementoPosXBotao); nPosXBotao = (int)((m_gbGeral.Width - nEspacoOcupar) / 2); nPosYBotao = m_gbGeral.Height - (m_gbGeral.Location.Y + 45); // Botoes for (int nCont = 0; nCont < m_arlBotoes.Count; nCont++) { System.Windows.Forms.Button m_btBotao = new System.Windows.Forms.Button(); m_btBotao.Name = m_arlBotoesTexts[nCont].ToString(); m_btBotao.Text = m_arlBotoesTexts[nCont].ToString(); m_btBotao.Location = new System.Drawing.Point(nPosXBotao, nPosYBotao); m_btBotao.Size = new System.Drawing.Size(nWidthBotao, nHeightBotao); m_btBotao.Cursor = System.Windows.Forms.Cursors.Hand; m_btBotao.Font = new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Bold); m_gbGeral.Controls.Add(m_btBotao); m_btBotao.BringToFront(); m_btBotao.Click += new System.EventHandler(BotaoClicado); nPosXBotao += (nIncrementoPosXBotao + nWidthBotao); } }
private Button CreateDynamicButton(string sName, string sText, string sTag, Point pLocation) { Button dynamicButton = new System.Windows.Forms.Button(); dynamicButton.Name = sName; dynamicButton.Location = new System.Drawing.Point(pLocation.X, pLocation.Y); dynamicButton.Text = sText; dynamicButton.Tag = sTag; dynamicButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); dynamicButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dynamicButton.Size = new System.Drawing.Size(195, 54); dynamicButton.UseVisualStyleBackColor = true; dynamicButton.Visible = false; dynamicButton.MouseEnter += new System.EventHandler(this.dynamicButton_MouseEnter); this.Controls.Add(dynamicButton); dynamicButton.BringToFront(); return(dynamicButton); }
private void InitAdminAnalyzeDisclosuresButton(Panel buttonsPanel) { var analyzeDisclosuresBtn = new System.Windows.Forms.Button(); analyzeDisclosuresBtn.Name = "analyzeDisclosuresAdmin"; analyzeDisclosuresBtn.Text = "Analyze Disclosures"; analyzeDisclosuresBtn.TextAlign = ContentAlignment.MiddleRight; analyzeDisclosuresBtn.Size = new Size(70, 24); analyzeDisclosuresBtn.ImageAlign = System.Drawing.ContentAlignment.BottomLeft; analyzeDisclosuresBtn.Click += new EventHandler(AnalyzeDisclosuresBtn_Click); analyzeDisclosuresBtn.Location = new Point(75, 25); analyzeDisclosuresBtn.Visible = true; analyzeDisclosuresBtn.Enabled = true; analyzeDisclosuresBtn.BringToFront(); buttonsPanel.Controls.Add((Control)analyzeDisclosuresBtn); buttonsPanel.Refresh(); }
private void CreateMidiEventDemoButton(int x, int y, int i) { Label label = new Label(); label.ForeColor = System.Drawing.Color.RoyalBlue; label.Location = new System.Drawing.Point(x + 1, y + 4); label.Size = new System.Drawing.Size(26, 14); label.Text = "rest"; this.Controls.Add(label); _restLabels.Add(label); label.SendToBack(); Button b = new Button(); b.Location = new System.Drawing.Point(x, y); b.Size = new System.Drawing.Size(27, 24); //b.TabIndex = 82 + i; b.Text = (i + 1).ToString(); b.UseVisualStyleBackColor = true; b.Click += new EventHandler(MidiEventDemoButton_Click); this.Controls.Add(b); _midiEventDemoButtons.Add(b); b.BringToFront(); }
private void CreateMidiChordFormButton(int x, int y, int i) { Button b = new Button(); b.Location = new System.Drawing.Point(x, y); b.Size = new System.Drawing.Size(27, 24); b.Tag = i; //b.UseVisualStyleBackColor = false; b.Text = (i + 1).ToString(); b.MouseDown += new MouseEventHandler(PaletteChordFormButton_MouseDown); this.Controls.Add(b); _paletteChordFormButtons.Add(b); b.BringToFront(); }
private void CreateAudioSampleButton(int x, int y, int i) { Button b = new Button(); b.Location = new System.Drawing.Point(x, y); b.Size = new System.Drawing.Size(27, 24); b.Tag = new MoritzMediaPlayer(PlayerHasStopped); // the associated media player b.Image = global::Moritz.Globals.Properties.Resources.noFile23x20; b.UseVisualStyleBackColor = false; b.MouseDown += new MouseEventHandler(AudioSampleButton_MouseDown); this.Controls.Add(b); _audioSampleButtons.Add(b); b.BringToFront(); }
public void updateImagesMap(int debut, int fin) { // affiche toutes les images dans la période passée en paramètre foreach (Button but in maListeBouttons) { this.Controls.Remove(but); } for (int i = debut; i < fin; i++) { Journee jour = maFenetrePrec.maMission.monPlanning.monTableauJournees[i-1]; foreach (Activite act in jour.maListeActivites) { if (act.enExterieur == true) { Button btnImg = new Button(); btnImg.Text = ""; btnImg.Width = 22; btnImg.Height = 22; btnImg.Visible = true; btnImg.Enabled = true; btnImg.Location = new System.Drawing.Point(686 + -8 + 700/3 + act.monLieu.maPosX / 3, 25 - 8 + 1000/3 + act.monLieu.maPosY / 3); //btnImg.Location = new System.Drawing.Point(480,25); btnImg.Click += new System.EventHandler(img_click); Bitmap image = (Bitmap)Image.FromFile(@"..//..//Images//vehiculePasse.png", true); btnImg.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter; if (jour.monNumero < maFenetrePrec.maMission.monJourJ) { // activités passées if (act.monNom == "Vehicle") { image = (Bitmap)Image.FromFile(@"..//..//Images//vehiculePasse.png", true); } else if (act.monNom == "Space suit") { image = (Bitmap)Image.FromFile(@"..//..//Images//astroPasse.png", true); } else if (act.monNom == "Outside experiment") { image = (Bitmap)Image.FromFile(@"..//..//Images//expePasse.png", true); } } else { if (act.monNom == "Vehicle") { image = (Bitmap)Image.FromFile(@"..//..//Images//vehiculeFutur.png", true); } else if (act.monNom == "Space suit") { image = (Bitmap)Image.FromFile(@"..//..//Images//astroFutur.png", true); } else if (act.monNom == "Outside experiment") { image = (Bitmap)Image.FromFile(@"..//..//Images//expeFutur.png", true); } } btnImg.Image = image; btnImg.BringToFront(); btnImg.Name = monNbActExtTrouve.ToString(); maListeBouttons.Add(btnImg); maListeActivite.Add(act); maListeJours.Add(jour.monNumero); monNbActExtTrouve++; this.Controls.Add(btnImg); } } } foreach (Button but in maListeBouttons) { but.Visible = true; but.Enabled = true; but.BringToFront(); } }
///// <summary> ///// When the control is made visible, make the OK button the default button for the parent form, ///// and make the Cancel button the... well, you know. ///// </summary> ///// <remarks> ///// Unfortunately this does not seem to work properly because the buttons involved need to be ///// direct children of the Form. ///// </remarks> ///// <param name="e"></param> //protected override void OnVisibleChanged(EventArgs e) //{ // Form form = TopLevelControl as Form; // base.OnVisibleChanged(e); // if (AutoCancelButton) // { // form.AcceptButton = _BtnOK; // } // if (AutoCancelButton) // { // form.CancelButton = _BtnCancel; // } //} /// <summary> /// Creates the embedded controls. /// </summary> private void CreateControls() { if (_btnCancel == null) { _btnCancel = new Button(); _btnCancel.TabIndex = 1; _btnCancel.Text = DefaultCancelButtonText; _btnCancel.Dock = DockStyle.Right; _btnCancel.Click += new EventHandler(_Btn_Click); _btnCancel.MouseDown += new MouseEventHandler(OnCancelMouseDown); _btnCancel.MouseUp += new MouseEventHandler(OnCancelMouseUp); Controls.Add(_btnCancel); } if (_btnOK == null) { _btnOK = new Button(); _btnOK.TabIndex = 0; _btnOK.Text = DefaultOKButtonText; _btnOK.Dock = DockStyle.Right; _btnOK.Click += new EventHandler(_Btn_Click); _btnOK.MouseDown += new MouseEventHandler(OnAcceptMouseDown); _btnOK.MouseUp += new MouseEventHandler(OnAcceptMouseUp); Controls.Add(_btnOK); _btnOK.BringToFront(); } }
private void AddCopyButton(CollectionForm collectionForm) { _CopyButton = new Button(); _CopyButton.Size = new Size(23, 24); _CopyButton.Enabled = false; _CopyButton.Click += CopyButton_Click; ResourceManager rm = Resources.ResourceManager; _CopyButton.Image = (Image)rm.GetObject("Copy"); collectionForm.Controls.Add(_CopyButton); _CopyButton.Location = new Point(208, 85); _CopyButton.BringToFront(); _ToolTip = new ToolTip(); _ToolTip.SetToolTip(_CopyButton, "Clone the selected item"); }
public void Update(TagsIntersectionCondition newTagsCombination) { int leftLocation = 0; int correction = 0; string OrString = "|"; string AndString = "&&"; Button btn; Label lbl; // First, clear old controls this.Controls.Clear(); // Now, paint each control according with the new tags combination foreach (TagsUnionCondition tagsUnion in newTagsCombination.UnionConditions) { // Paint '(' if (tagsUnion.Count > 1) { lbl = this.CreateLabel("(", 16, 0); lbl.Left = leftLocation; this.Controls.Add(lbl); leftLocation = lbl.Right - correction; } foreach (InversableTag invTag in tagsUnion.InversableTags) { // Paint the button for the tag btn = new Button(); btn.Click += new EventHandler(this.btn_Click); btn.MouseUp += new MouseEventHandler(this.btn_MouseUp); btn.Tag = new TagsCombinationViewerEventArgs(invTag); btn.Left = leftLocation; btn.Top = 3; btn.AutoSizeMode = AutoSizeMode.GrowAndShrink; btn.AutoSize = true; btn.Text = invTag.Inverse ? "Not " + invTag.Tag.Value : invTag.Tag.Value; this.Controls.Add(btn); btn.BringToFront(); leftLocation = btn.Right; // Paint OR char: '|' if (invTag != tagsUnion.InversableTags.Last()) { lbl = this.CreateLabel(OrString, 8, 7); lbl.Left = leftLocation; this.Controls.Add(lbl); leftLocation = lbl.Right; } } // Paint ')' bool closeBracesExists = false; if (tagsUnion.Count > 1) { lbl = this.CreateLabel(")", 16, 0); lbl.Left = leftLocation - correction; this.Controls.Add(lbl); leftLocation = lbl.Right - correction; closeBracesExists = true; } // Paint AND char: '&' if (tagsUnion != newTagsCombination.UnionConditions.Last()) { lbl = this.CreateLabel(AndString, 16, 0); if (closeBracesExists) lbl.Left = leftLocation; else lbl.Left = leftLocation - correction; this.Controls.Add(lbl); leftLocation = lbl.Right - correction; } } }
public void Update(TagsCombinaton newTagsCombination) { int leftLocation = 0; int correction = 0; string OrString = "|"; string AndString = "&&"; Button btn; Label lbl; // First, clear old controls for (int c = this.Controls.Count - 1; c >= 0; c--) { if (this.Controls[c] is Button || this.Controls[c] is Label) this.Controls.RemoveAt(c); } // Now, paint each control according with the new tags combination for (int i = 0; i < newTagsCombination.Count; i++) { // Paint '(' if (newTagsCombination[i].Count > 1) { lbl = this.CreateLabel("(", 16, 0); lbl.Left = leftLocation; this.Controls.Add(lbl); leftLocation = lbl.Right - correction; } for (int j = 0; j < newTagsCombination[i].Count; j++) { // Paint the button for the tag btn = new Button(); btn.Click += new EventHandler(this.btn_Click); btn.MouseUp += new MouseEventHandler(this.btn_MouseUp); btn.Tag = new TagsCombinationViewerEventArgs(i, j); btn.Left = leftLocation; btn.Top = 3; btn.AutoSizeMode = AutoSizeMode.GrowAndShrink; btn.AutoSize = true; btn.Text = newTagsCombination[i][j].Inverse? "Not " + newTagsCombination[i][j].Value: newTagsCombination[i][j].Value; this.Controls.Add(btn); btn.BringToFront(); leftLocation = btn.Right; // Paint OR char: '|' if (j < newTagsCombination[i].Count - 1) { lbl = this.CreateLabel(OrString, 8, 7); lbl.Left = leftLocation; this.Controls.Add(lbl); leftLocation = lbl.Right; } } // Paint ')' bool closeBracesExists = false; if (newTagsCombination[i].Count > 1) { lbl = this.CreateLabel(")", 16, 0); lbl.Left = leftLocation - correction; this.Controls.Add(lbl); leftLocation = lbl.Right - correction; closeBracesExists = true; } // Paint AND char: '&' if (i < newTagsCombination.Count - 1) { lbl = this.CreateLabel(AndString, 16, 0); if (closeBracesExists) lbl.Left = leftLocation; else lbl.Left = leftLocation - correction; this.Controls.Add(lbl); leftLocation = lbl.Right - correction; } } }
private void DibujarPictureBox(string _filename, string _displayname) {try { PictureBox Pic1 = new PictureBox(); Pic1.Location = new System.Drawing.Point(XLocation + XMargen, YLocation + YMargen); Pic1.Name = "PictureBox" + i; i++; Pic1.Size = new System.Drawing.Size(PicWidth, PicHeight); Pic1.TabIndex = 0; Pic1.TabStop = false; Pic1.BorderStyle = BorderStyle.None; this.ttip.SetToolTip(Pic1, _filename); Pic1.MouseEnter += Pic1_MouseEnter; Pic1.MouseLeave += Pic1_MouseLeave; Pic1.Click += Pic1_Click; Pic1.Image = Image.FromFile(_filename); Pic1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.Controls.Add(Pic1); Label lb = new Label(); //Label en el que se muetra el nombre lb.Visible = labels; lb.Name = "Label" + Pic1.Name; lb.Text = _displayname; lb.BackColor = this.BackColor; lb.Location = new System.Drawing.Point(XLocation + XMargen, YLocation + YMargen + Pic1.Height); lb.Click += Lb_Click; this.Controls.Add(lb); //Label en el que se guarda la ruta Label lbFullName = new Label(); lbFullName.Location = new System.Drawing.Point(XLocation + XMargen, YLocation + YMargen + Pic1.Height); lbFullName.Text = _filename; lbFullName.Visible = false; lbFullName.Name = "LabelFull" + Pic1.Name; this.Controls.Add(lbFullName); if (btnEliminar) { //Boton para eliminar la imagen de la grilla Button btn = new Button(); btn.Name = "btn" + Pic1.Name; btn.Location = new System.Drawing.Point(XLocation + XMargen + 2, YLocation + YMargen + 2); btn.Width = 15; btn.Height = 15; btn.Font = new Font(this.Font.Name, 6, FontStyle.Bold); btn.TextAlign = ContentAlignment.TopCenter; btn.Text = "X"; btn.FlatStyle = FlatStyle.Flat; btn.FlatAppearance.BorderSize = 0; btn.Click += btn_Click; this.Controls.Add(btn); btn.BringToFront(); btn.Visible = true; } XLocation = XLocation + XMargen + PicWidth; if ((XLocation + XMargen + PicWidth) >= CtrlWidth) { XLocation = 0; YLocation = YLocation + YMargen + PicHeight + (labels ? lb.Height : 0); } } catch(Exception) { //REVISAR } }
public popContactPlayer( byte player, byte other) { /* this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;*/ platformSpec.setFloatingWindow.before( this ); platformSpec.manageWindows.setUserInputSize( this ); this.ControlBox = false; #region heart this.Text = "Contact"; this.player = player; this.other = other; int ySpaces = 8, butHeight = 24, butWidth = 100; byte butPos = 0; this.Width = butWidth + 2 * ySpaces; Button cmdNegotiate = new Button(); cmdNegotiate.Text = "Negotiate"; cmdNegotiate.Width = butWidth; cmdNegotiate.Height = butHeight; cmdNegotiate.Left = this.Width / 2 - cmdNegotiate.Width / 2; cmdNegotiate.Top = butPos * ( butHeight + ySpaces ) + ySpaces; //this.Height * butPos / 5 - cmdNegotiate.Height / 2 + 11; cmdNegotiate.Click += new EventHandler( cmdNegotiate_Click ); #if !CF cmdNegotiate.FlatStyle = FlatStyle.System; #endif butPos++; if ( Form1.game.playerList[ player ].foreignRelation[ other ].politic != (byte)Form1.relationPolType.war ) { Button cmdDeclareWar = new Button(); cmdDeclareWar.Text = "Declare war!"; cmdDeclareWar.Width = butWidth; cmdDeclareWar.Height = butHeight; cmdDeclareWar.Left = this.Width / 2 - cmdDeclareWar.Width / 2; cmdDeclareWar.Top = butPos * ( butHeight + ySpaces ) + ySpaces; //this.Height * butPos / 5 - cmdDeclareWar.Height / 2 + 11; cmdDeclareWar.Click += new EventHandler( cmdDeclareWar_Click ); #if !CF cmdDeclareWar.FlatStyle = FlatStyle.System; #endif butPos++; this.Controls.Add( cmdDeclareWar ); } Button cmdCancel = new Button(); cmdCancel.Text = "Cancel"; cmdCancel.Width = butWidth; cmdCancel.Height = butHeight; cmdCancel.Left = this.Width / 2 - cmdCancel.Width / 2; cmdCancel.Top = butPos * ( butHeight + ySpaces ) + ySpaces; //this.Height * 4 / 5 - cmdCancel.Height / 2 + 11; cmdCancel.Click += new EventHandler( cmdCancel_Click ); #if !CF cmdCancel.FlatStyle = FlatStyle.System; #endif this.Controls.Add( cmdNegotiate ); this.Controls.Add( cmdCancel ); cmdNegotiate.BringToFront(); cmdCancel.BringToFront(); /* Size cs = new Size( (int)(butWidth + 2 * ySpaces), (int)(cmdCancel.Bottom + ySpaces) ); this.ClientSize = cs;*/ /* int tempW = (int)(butWidth + 2 * ySpaces); int tempH = (int)(); = tempW; this.Width = tempH;*/ this.Height = cmdCancel.Bottom + ySpaces; #endregion platformSpec.setFloatingWindow.after( this ); #region floating /* // Mémorise la zone cliente avant le changement de style Size aireAvant = this.ClientSize; // Récupèrer le handle de la fenêtre IntPtr hWnd = Win32Window.FromControl( this ); // Liste des styles à enlever (voir article) int enleves = (int)( Win32Window.WindowStyle.WS_SYSMENU | Win32Window.WindowStyle.WS_MINIMIZEBOX | Win32Window.WindowStyle.WS_MAXIMIZEBOX ); // Liste des styles à ajouter int ajoutes = (int)( Win32Window.WindowStyle.WS_CAPTION | Win32Window.WindowStyle.WS_POPUP ); // Mise à jour du style de la fenêtre Win32Window.UpdateWindowStyle( hWnd, enleves, ajoutes ); // Mesure l'aide cliente après le changement de style Size aireApres = this.ClientSize; // Restitue la taille de l'aire cliente aireApres.Width += aireAvant.Width - aireApres.Width; aireApres.Height += aireAvant.Height - aireApres.Height; this.ClientSize = aireApres; this.Left = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2; this.Top = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2; */ #endregion }
private void AddDestBlockFieldItem(ListViewItem ViewItem, TBlockFieldItem SourceItem) { TBlockFieldItem BlockFieldItem = new TBlockFieldItem(); BlockFieldItem.DataField = SourceItem.DataField; BlockFieldItem.Description = SourceItem.Description; BlockFieldItem.DataType = SourceItem.DataType; BlockFieldItem.IsKey = SourceItem.IsKey; BlockFieldItem.CheckNull = SourceItem.CheckNull; BlockFieldItem.DefaultValue = SourceItem.DefaultValue; BlockFieldItem.Length = SourceItem.Length; BlockFieldItem.ControlType = SourceItem.ControlType; BlockFieldItem.QueryMode = SourceItem.QueryMode; BlockFieldItem.EditMask = SourceItem.EditMask; /* InfoCommand command1 = new InfoCommand(FDatabaseType); command1.Connection = FConnection; string[] textArray1 = new string[] { "Select TABLE_NAME, FIELD_NAME, IS_KEY, FIELD_LENGTH, CHECK_NULL, DEFAULT_VALUE from COLDEF where TABLE_NAME = '", FTableName, "' and FIELD_NAME = '", BlockFieldItem.DataField, "'" }; command1.CommandText = string.Concat(textArray1); IDbDataAdapter adapter1 = WzdUtils.AllocateDataAdapter(FDatabaseType); adapter1.SelectCommand = command1.GetInternalCommand(); DataSet set1 = new DataSet(); WzdUtils.FillDataAdapter(FDatabaseType, adapter1, set1, "COLDEF"); DataRow[] rowArray1 = set1.Tables[0].Select("FIELD_NAME = '" + BlockFieldItem.DataField + "'"); if (rowArray1.Length == 1) { BlockFieldItem.IsKey = rowArray1[0].ItemArray[2].ToString().ToUpper() == "Y"; if (rowArray1[0].ItemArray[3] != null) BlockFieldItem.Length = int.Parse(rowArray1[0].ItemArray[3].ToString()); BlockFieldItem.CheckNull = rowArray1[0].ItemArray[4].ToString().ToUpper(); BlockFieldItem.DefaultValue = rowArray1[0].ItemArray[5].ToString(); } */ if (FDestListView.Columns.Count == 3) { ListViewItem.ListViewSubItem LVSI = ViewItem.SubItems.Add(""); Button B = new Button(); B.Parent = FDestListView; if (FRearrangeRefValButtonFunc != null) FRearrangeRefValButtonFunc(B, LVSI.Bounds); B.BackColor = Color.Silver; B.BringToFront(); LVSI.Tag = B; B.Tag = ViewItem; ViewItem.Tag = BlockFieldItem; B.Click += new EventHandler(FRefValClickEvent); B.Text = "..."; } if (FDetailItem != null) FDetailItem.BlockFieldItems.Add(BlockFieldItem); }
private void moveButton(Button toMove, int PoleIndex) { Point startPoint = toMove.Location; Point endPoint = new Point(); switch (PoleIndex) { case 1: endPoint= new Point(160 + ((200 - toMove.Size.Width) / 2), 470 - ((Pole1.Count()) * 30)); break; case 2: endPoint = new Point(366 + ((200 - toMove.Size.Width) / 2), 470 - ((Pole2.Count()) * 30)); break; case 3: endPoint = new Point(572 + ((200 - toMove.Size.Width) / 2), 470 - ((Pole3.Count()) * 30)); break; default: break; } for (int i = 0; i <= 5; i++) { toMove.Location = new Point(startPoint.X + Convert.ToInt16((Convert.ToDecimal(endPoint.X) - startPoint.X) / 5 * i), startPoint.Y + (endPoint.Y - startPoint.Y) / 5 * i); // Converts are for decimal divides toMove.BringToFront(); this.Refresh(); Thread.Sleep(20); } }
public GoalPanel(MissionInfoPanel P) { this.Size = new Size(260, 85); this.BackColor = GV.activeGoalColor; this.MouseDown += new MouseEventHandler(panel_mouseDown); this.MouseMove +=new MouseEventHandler(panel_mouseMove); this.MouseUp +=new MouseEventHandler(panel_mouseUp); this.AllowDrop = false; parent = P; this.Location = P.panelStartingLocation; Label goalTypeLabel = new Label(); goalTypeLabel.Name = "goalTypeLabel"; goalTypeLabel.Text = "Orbit"; goalTypeLabel.BackColor = Color.Transparent; goalTypeLabel.AutoSize = true; goalTypeLabel.Location = new Point(9, 9); goalTypeLabel.Font = GV.generalFont; goalTypeLabel.MouseDown += new MouseEventHandler(panel_mouseDown); goalTypeLabel.MouseMove += new MouseEventHandler(panel_mouseMove); this.Controls.Add(goalTypeLabel); Label rewardLabel = new Label(); rewardLabel.Name = "rewardLabel"; rewardLabel.AutoSize = true; rewardLabel.Location = new Point(120 - rewardLabel.PreferredWidth / 2, 65); rewardLabel.TextAlign = (ContentAlignment)HorizontalAlignment.Center; rewardLabel.Font = GV.generalFont; rewardLabel.MouseDown += new MouseEventHandler(panel_mouseDown); rewardLabel.MouseMove += new MouseEventHandler(panel_mouseMove); rewardLabel.Text = "0 K"; rewardLabel.MaximumSize = new Size(100, 50); this.Controls.Add(rewardLabel); rewardLabel.BringToFront(); //need to give icon up arrow Button upButton = new Button(); upButton.Name = "goalUpButton"; upButton.Location = new Point(226, 30); upButton.Size = new Size(25, 25); upButton.Font = GV.generalFont; upButton.Click += new EventHandler(goalChange_Click); upButton.BackgroundImage = GV.upArrowIcon; upButton.BackgroundImageLayout = ImageLayout.Stretch; upButton.BackColor = Color.Transparent; this.Controls.Add(upButton); upButton.BringToFront(); //need to give this down arrow Icon Button downButton = new Button(); downButton.Name = "goalDownButton"; downButton.Location = new Point(226, 57); downButton.Size = new Size(25, 25); downButton.Font = GV.generalFont; downButton.Click += new EventHandler(goalChange_Click); downButton.BackgroundImage = GV.downArrowIcon; downButton.BackgroundImageLayout = ImageLayout.Stretch; downButton.BackColor = Color.Transparent; this.Controls.Add(downButton); downButton.BringToFront(); Button removeButton = new Button(); removeButton.Name = "removeButton"; removeButton.Location = new Point(226, 5); removeButton.Size = new Size(25, 25); removeButton.Font = GV.generalFont; removeButton.Click += new EventHandler(removeGoal_Click); removeButton.BackgroundImage = GV.removeIcon; removeButton.BackgroundImageLayout = ImageLayout.Stretch; removeButton.BackColor = Color.Transparent; this.Controls.Add(removeButton); removeButton.BringToFront(); }
private void AddButton(string name, string file) { if (_cButtons == null) _cButtons = new Dictionary<string, string>(); if (_cButtons.Keys.Contains(name)) return; _cButtons.Add(name, file); // -- for tracking purposes.. var newButton = new Button { Text = name, Location = new Point(_curX, _curY), Size = new Size(110, 23), Visible = true, Enabled = true }; newButton.BringToFront(); newButton.Click += HandleButtons; Controls.Add(newButton); tabPage9.Controls.Add(newButton); if (_curY == 235) { _curY = 3; if (_curX == 583) { MessageBox.Show("That's a lot of LUAS, you've reached the limit!"); return; } _curX += 116; } else { _curY += 29; } }
private void CreateRefValButton(ListViewItem Item, ListViewItem.ListViewSubItem SubItem, EventHandler ClickEvent) { System.Windows.Forms.Button B = new System.Windows.Forms.Button(); B.Parent = Item.ListView; RearrangeRefValButton(B, SubItem.Bounds); B.BackColor = Color.Silver; B.BringToFront(); SubItem.Tag = B; B.Tag = Item; B.Click += new EventHandler(ClickEvent); B.Text = "..."; }
private void SelectFields(ListView lvSrc, ListView lvDes, Boolean All) { int I; ListViewItem Item; ListViewItem.ListViewSubItem LVSI; for (I = 0; I < lvSrc.Items.Count; I++) { if (lvSrc.Items[I].Selected || All) { Item = new ListViewItem(lvSrc.Items[I].Text); Item.Tag = lvSrc.Items[I].Tag; if (lvSrc.Items[I].SubItems.Count > 1) Item.SubItems.Add(lvSrc.Items[I].SubItems[1]); else Item.SubItems.Add(""); lvDes.Items.Add(Item); if (lvDes.Columns.Count == 3) { LVSI = Item.SubItems.Add(""); System.Windows.Forms.Button B = new System.Windows.Forms.Button(); B.Parent = lvDes; RearrangeRefValButton(B, LVSI.Bounds); B.BackColor = Color.Silver; B.BringToFront(); LVSI.Tag = B; B.Tag = Item; B.Click += new EventHandler(btnRefVal_Click); B.Text = "..."; } } } for (I = lvSrc.Items.Count - 1; I >= 0; I--) { if (lvSrc.Items[I].Selected || All) { if (lvSrc.Columns.Count == 3) { LVSI = lvSrc.Items[I].SubItems[2]; if (LVSI != null) { if (LVSI.Tag != null) { ((System.Windows.Forms.Button)LVSI.Tag).Dispose(); } } } lvSrc.Items[I].Remove(); } } if (lvSrc.Columns.Count == 3) { foreach (ListViewItem LVI in lvSrc.Items) { LVSI = LVI.SubItems[2]; if (LVSI.Tag != null) RearrangeRefValButton((System.Windows.Forms.Button)LVSI.Tag, LVSI.Bounds); } } }
private void beginEditIncludeDir() { if(_editingIncludes) { endEditIncludeDir(true); } _editingIncludes = true; _dialog.unsetCancelButton(); if(_editingIndex != -1) { _txtIncludeDir = new TextBox(); _txtIncludeDir.Text = sliceIncludeList.Items[sliceIncludeList.SelectedIndex].ToString(); _editingIncludeDir = _txtIncludeDir.Text; sliceIncludeList.SelectionMode = SelectionMode.One; Rectangle rect = sliceIncludeList.GetItemRectangle(sliceIncludeList.SelectedIndex); _txtIncludeDir.Location = new Point(sliceIncludeList.Location.X + 2, sliceIncludeList.Location.Y + rect.Y); _txtIncludeDir.Width = sliceIncludeList.Width - 50; _txtIncludeDir.Parent = sliceIncludeList; _txtIncludeDir.KeyDown += new KeyEventHandler(includeDirKeyDown); _txtIncludeDir.KeyUp += new KeyEventHandler(includeDirKeyUp); groupBox1.Controls.Add(_txtIncludeDir); _btnSelectInclude = new Button(); _btnSelectInclude.Text = "..."; _btnSelectInclude.Location = new Point(sliceIncludeList.Location.X + _txtIncludeDir.Width, sliceIncludeList.Location.Y + rect.Y); _btnSelectInclude.Width = 49; _btnSelectInclude.Height = _txtIncludeDir.Height; _btnSelectInclude.Click += new EventHandler(selectIncludeClicked); groupBox1.Controls.Add(_btnSelectInclude); _txtIncludeDir.Show(); _txtIncludeDir.BringToFront(); _txtIncludeDir.Focus(); _btnSelectInclude.Show(); _btnSelectInclude.BringToFront(); } }
private void Menu_Load(object sender, EventArgs e) { label16.Text = RipLeech.Properties.Settings.Default.buildvers; if (RipLeech.Properties.Settings.Default.theme == "steamthemes") { settheme("steamthemes"); radioButton7.Checked = true; } else if (RipLeech.Properties.Settings.Default.theme == "nicoding") { settheme("nicoding"); radioButton8.Checked = true; } else { settheme("default"); radioButton4.Checked = true; } try { string updateurl = "http://nicoding.com/api.php?app=ripleech&update=check"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(updateurl); WebResponse response = request.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252")); string pluginsavail = sr.ReadToEnd(); label18.Text = pluginsavail; if (label16.Text != label18.Text) { label18.ForeColor = Color.Red; } } catch { label18.Text = "Unknown"; } if (!Directory.Exists(@"C:\RipLeech\Temp\")) { Directory.CreateDirectory(@"C:\RipLeech\Temp\"); } else { if (DirectoryIsEmpty(@"C:\RipLeech\Temp\") == false) { Directory.Delete(@"C:\RipLeech\Temp", true); Directory.CreateDirectory(@"C:\RipLeech\Temp\"); } } //timer2.Start(); try { string updateurl = "https://dl.dropbox.com/u/22054429/RipLeech/changelog.txt"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(updateurl); WebResponse response = request.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252")); textBox3.Text = sr.ReadToEnd(); } catch { textBox3.Text = "Unable to get changelog at this time."; } try { string updateurl = "http://nicoding.com/api.php?app=ripleech&plugin=all&info=name"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(updateurl); WebResponse response = request.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252")); string pluginsavail = sr.ReadToEnd(); string[] lines = Regex.Split(pluginsavail, "<br>"); foreach (string line in lines) { listBox3.Items.Add(line); } } catch { listBox3.Items.Add("Unable to get plugins at this time."); } if (!String.IsNullOrEmpty(RipLeech.Properties.Settings.Default.videosavepath)) { textBox1.Text = RipLeech.Properties.Settings.Default.videosavepath; } if (!String.IsNullOrEmpty(RipLeech.Properties.Settings.Default.audiosavepath)) { textBox2.Text = RipLeech.Properties.Settings.Default.audiosavepath; } if (!String.IsNullOrEmpty(RipLeech.Properties.Settings.Default.audioquality)) { if (RipLeech.Properties.Settings.Default.audioquality == "128") { radioButton1.Checked = true; } else if (RipLeech.Properties.Settings.Default.audioquality == "256") { radioButton2.Checked = true; } else if (RipLeech.Properties.Settings.Default.audioquality == "320") { radioButton3.Checked = true; } } if (RipLeech.Properties.Settings.Default.betaupdates == true) { checkBox1.Checked = true; } if (File.Exists(installdir + "updater.temp")) { if (File.Exists(installdir + "updater.exe")) { File.Delete(installdir + "updater.exe"); File.Copy(installdir + "updater.temp", "updater.exe"); File.Delete(installdir + "updater.temp"); } else { File.Copy(installdir + "updater.temp", "updater.exe"); File.Delete(installdir + "updater.temp"); } } if (!Directory.Exists(plugindir)) { Directory.CreateDirectory(plugindir); } #region checkforaddons try { int plgcnt = 0; string[] fileEntries = Directory.GetFiles(plugindir, "*.dll"); DirectoryInfo addonnfo = new DirectoryInfo(plugindir); if (addonnfo.Exists) { if (IsDirectoryEmpty(plugindir) == false) { int i = 0; foreach (string fileName in fileEntries) { assembly = fileName; string totalfilename = Path.GetFileNameWithoutExtension(fileName); Button btnPlay = new Button(); btnPlay.Name = totalfilename; plgcnt++; if (i <= 1) { btnPlay.Top = button1.Top + 30; btnPlay.Left = button1.Left; btnPlay.Width = 189; btnPlay.Height = 23; btnPlay.Text = (btnPlay.Name.ToString()); btnPlay.Click += new EventHandler(btnPlay_Click); tabPage2.Controls.Add(btnPlay); btnPlay.BringToFront(); i++; } else { int btntop = 30 * i; btnPlay.Top = button1.Top + btntop; btnPlay.Left = button1.Left; btnPlay.Width = 189; btnPlay.Height = 23; btnPlay.Text = (btnPlay.Name.ToString()); btnPlay.Click += new EventHandler(btnPlay_Click); tabPage2.Controls.Add(btnPlay); btnPlay.BringToFront(); } i++; } } } if (plgcnt > 0) { label20.Text = plgcnt.ToString(); } else { label20.Text = "0"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } #endregion if (File.Exists(@"C:\RipLeech\Temp\newvid.tmp")) { youtube yt = new youtube(); yt.Show(); } if (RipLeech.Properties.Settings.Default.surveyshown == false) { survey srvy = new survey(); srvy.Show(); } #region regstuff /* //here we write the reg file for the protocol. string dir = @"C:\RipLeech\Temp\protocol.reg"; if (RipLeech.Properties.Settings.Default.reginstalled == false) { if (!File.Exists(dir)) { System.IO.File.WriteAllText(dir, RipLeech.Properties.Resources.protocol); Process regeditProcess = Process.Start("regedit.exe", "/s " + dir); regeditProcess.WaitForExit(); if (System.IO.File.Exists(dir)) { System.IO.File.Delete(dir); } RipLeech.Properties.Settings.Default.reginstalled = true; RipLeech.Properties.Settings.Default.Save(); restart(); } } */ #endregion timer4.Start(); }
private void InvokeDelegate(System.Windows.Forms.Button bt) { Controls.Add(bt); bt.BringToFront(); }
public void AddTimelineTrack(string name) { if (!_timeline_tracks.ContainsKey(name)) { Button b = new Button(); b.Height = TickHeight; TrackPanel.VerticalScroll.SmallChange = TickHeight; TrackPanel.VerticalScroll.LargeChange = TickHeight; b.Text = name; b.MouseClick += new MouseEventHandler(this.TimelineTrackClicked); b.TextAlign = ContentAlignment.MiddleCenter; b.Parent = TrackPanel; b.Dock = DockStyle.Top; b.BringToFront(); b.Show(); _timeline_tracks.Add(b.Text, new EventTimeline(b.Text, b, new SortedDictionary<int, RectangleF>())); SelectTimelineTrack(name); } else { MessageBox.Show("The requested Track exists already.", "Error adding Timeline Track", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
void eventHandler_ShowCloseButton(object sender, WebBrowserDocumentCompletedEventArgs e) { if (buttonHelpEnd != null) return; buttonHelpEnd = new Button(); buttonHelpEnd.Parent = this; int size = Math.Min(this.Width, this.Height) / 12; buttonHelpEnd.Top = 0; buttonHelpEnd.Left = this.Width - 2 * size; buttonHelpEnd.Width = size; buttonHelpEnd.Height = size; buttonHelpEnd.Text = "X"; buttonHelpEnd.Click += HelpEndClick; buttonHelpEnd.BringToFront(); }
//delegate_UpdateListOfNotes UpdateListOfNotes; public void CreateParent(LayoutPanelBase _Layout) { ParentNotePanel = new NotePanel (this); //ParentNotePanel.Visible = false; // ParentNotePanel.SuspendLayout (); ParentNotePanel.Visible = true; ParentNotePanel.Location = Location; ParentNotePanel.Dock = System.Windows.Forms.DockStyle.None; ParentNotePanel.Height = Height; ParentNotePanel.Width = Width; ParentNotePanel.Dock = this.Dock; try { _Layout.NoteCanvas.Controls.Add (ParentNotePanel); } catch (Exception ex) { lg.Instance.Line ("CreateParent", ProblemType.EXCEPTION, "Unable to create note after changing properties" + ex.ToString ()); throw new Exception ("Failed to add control"); } CaptionLabel = new ToolStrip (); // must be false for height to matter CaptionLabel.AutoSize = false; // CaptionLabel.SuspendLayout (); CaptionLabel.Click += (object sender, EventArgs e) => BringToFrontAndShow (); // CaptionLabel.DoubleClick += HandleCaptionLabelDoubleClick; CaptionLabel.MouseDown += HandleMouseDown; CaptionLabel.MouseUp += HandleMouseUp; CaptionLabel.MouseLeave += HandleMouseLeave; CaptionLabel.MouseMove += HandleMouseMove; CaptionLabel.Parent = ParentNotePanel; CaptionLabel.BackColor = Color.Green; CaptionLabel.Dock = DockStyle.Fill; CaptionLabel.GripStyle = ToolStripGripStyle.Hidden; captionLabel = new ToolStripLabel (this.Caption); captionLabel.ToolTipText = Loc.Instance.GetString ("TIP: Doubleclick this to set the note to its regular size"); captionLabel.MouseDown += HandleMouseDown; captionLabel.MouseUp += HandleMouseUp; //captionLabel.MouseLeave += HandleMouseLeave; captionLabel.MouseMove += HandleMouseMove; captionLabel.DoubleClickEnabled = true; captionLabel.DoubleClick+= HandleCaptionLabelDoubleClick; CaptionLabel.Items.Add (captionLabel); //if (Caption == "") NewMessage.Show ("Caption is blank"); properties = new ToolStripDropDownButton (""); properties.Image = CoreUtilities.FileUtils.GetImage_ForDLL ("application_form_edit.png"); CaptionLabel.Items.Add (properties); MinimizeButton = new ToolStripButton (); //MinimizeButton.Text = "--"; MinimizeButton.Image = CoreUtilities.FileUtils.GetImage_ForDLL ("application_put.png"); MinimizeButton.ToolTipText = "Hides the note. Bring it back by using the List or a Tab"; MinimizeButton.Click += HandleMinimizeButtonClick; MaximizeButton = new ToolStripButton (); //MaximizeButton.Text = "[ ]"; MaximizeButton.Image = CoreUtilities.FileUtils.GetImage_ForDLL ("application_xp.png"); MaximizeButton.ToolTipText = Loc.Instance.GetString ("Fills available screen"); MaximizeButton.Click += HandleMaximizeButtonClick; if (true == IsSystemNote) { // not really a delete, more of a close ToolStripButton closeButton = new ToolStripButton (); //closeButton.Text = " X "; closeButton.Image = CoreUtilities.FileUtils.GetImage_ForDLL ("delete_x.png"); closeButton.Click += HandleCloseClick; ; CaptionLabel.Items.Add (closeButton); //closeButton.Anchor = AnchorStyles.Right; closeButton.Alignment = ToolStripItemAlignment.Right; // ToolStripItem item = new ToolStripItem(); //item.ToolStripItemAlignment = ToolStripItemAlignment.Right; //closeButton.Dock = DockStyle.Right; } if (false == IsSystemNote) { ToolStripTextBox captionEditor = new ToolStripTextBox (); captionEditor.Text = Caption; captionEditor.TextChanged += HandleCaptionTextChanged; captionEditor.KeyDown += HandleCaptionEditorKeyDown; properties.DropDownItems.Add (captionEditor); } CaptionLabel.Items.Add (MaximizeButton); MaximizeButton.Alignment = ToolStripItemAlignment.Right; CaptionLabel.Items.Add (MinimizeButton); MinimizeButton.Alignment = ToolStripItemAlignment.Right; //contextMenu = new ContextMenuStrip(); ToolStripButton BringToFront = new ToolStripButton (); BringToFront.Text = Loc.Instance.Cat.GetString ("Bring to Front"); BringToFront.Click += HandleBringToFrontClick; properties.DropDownItems.Add (BringToFront); properties.DropDownItems.Add (new ToolStripSeparator ()); if (false == IsSystemNote) { ReadOnlyButton = new ToolStripButton (); ReadOnlyButton.CheckOnClick = true; ReadOnlyButton.Checked = this.ReadOnly; ReadOnlyButton.Text = Loc.Instance.Cat.GetString ("Read Only"); ReadOnlyButton.Click += HandleReadOnlyClick; properties.DropDownItems.Add (ReadOnlyButton); } // // // APPEARANCE // // AppearanceSet = new ToolStripMenuItem (); ContextMenuStrip AppearanceMenu = new ContextMenuStrip (); ToolStripLabel empty = new ToolStripLabel ("BB"); AppearanceMenu.Items.Add (empty); AppearanceSet.DropDown = AppearanceMenu; AppearanceMenu.Opening += HandleAppearanceMenuOpening; properties.DropDownItems.Add (AppearanceSet); // // // DOCK STYLE // // ToolStripComboBox DockPicker = new ToolStripComboBox (); DockPicker.ToolTipText = Loc.Instance.GetString ("Set Docking Behavior For Note"); DockPicker.DropDownStyle = ComboBoxStyle.DropDownList; //DockPicker.DropDown+= HandleDockDropDown; (DockPicker).Items.Clear (); int found = -1; int count = -1; // this loop does not affect performance foreach (string s in Enum.GetNames(typeof(DockStyle))) { count++; (DockPicker).Items.Add (s); if (s == this.Dock.ToString ()) { found = count; } } if (found > -1) DockPicker.SelectedIndex = found; DockPicker.SelectedIndexChanged += HandleDockStyleSelectedIndexChanged; properties.DropDownItems.Add (DockPicker); // // // LOCK // // ToolStripButton LockState = new ToolStripButton (); LockState.Text = Loc.Instance.GetString ("Lock"); LockState.Checked = this.LockState; LockState.CheckOnClick = true; LockState.Click += HandleLockStateClick; properties.DropDownItems.Add (LockState); // // // FOLDER // // if (false == IsSystemNote) { ToolStripMenuItem menuFolder = new ToolStripMenuItem (); menuFolder.Text = Loc.Instance.Cat.GetString ("Folder"); properties.DropDownItems.Add (menuFolder); // just here to make sure that there's a dropdown singal before populating menuFolder.DropDownItems.Add (""); menuFolder.DropDownOpening += HandleFolderDropDownOpening; // menuFolder.MouseEnter += HandleMenuFolderMouseEnter; } if (false == IsSystemNote) { ToolStripButton deleteNote = new ToolStripButton (); deleteNote.Text = Loc.Instance.GetString ("Delete This Note"); properties.DropDownItems.Add (deleteNote); deleteNote.Click += HandleDeleteNoteClick; } else if (true == IsSystemNote) { // add a way to DELETE a Layout? ToolStripButton deleteNote = new ToolStripButton (); deleteNote.Text = Loc.Instance.GetString ("Delete This Layout"); properties.DropDownItems.Add (deleteNote); deleteNote.Click += HandleDeleteLayoutClick; } if (true == IsLinkable) { ToolStripButton linkNote = new ToolStripButton (); linkNote.Text = Loc.Instance.GetString ("Create a Link To This Note"); properties.DropDownItems.Add (linkNote); linkNote.Click += HandleLinkNoteClick; } ToolStripButton copyNote = new ToolStripButton (); copyNote.Text = Loc.Instance.GetString ("Copy Note"); properties.DropDownItems.Add (copyNote); copyNote.Click += (object sender, EventArgs e) => Layout.CopyNote (this); properties.DropDownItems.Add (new ToolStripSeparator ()); ToolStripButton menuProperties = new ToolStripButton (); menuProperties.Text = Loc.Instance.Cat.GetString ("Properties"); properties.DropDownItems.Add (menuProperties); menuProperties.Click += HandlePropertiesClick; // 04/11/2014 // TODO REMOVE // If I ever build a cleaner system for setting up notedocks this can be removed // but for now we display the GUID as a clickable button // that puts in on the clipboard ToolStripButton menuGUIDButton = new ToolStripButton(); menuGUIDButton.Text = this.GuidForNote; menuGUIDButton.Click+= (object sender, EventArgs e) => { Clipboard.SetText(this.GuidForNote); }; properties.DropDownItems.Add (menuGUIDButton); PropertyPanel = new Panel (); PropertyPanel.Visible = false; PropertyPanel.Parent = ParentNotePanel; PropertyPanel.Height = 300; PropertyPanel.Dock = DockStyle.Top; PropertyPanel.AutoScroll = true; Button CommitChanges = new Button (); CommitChanges.Text = Loc.Instance.Cat.GetString ("Update Note"); CommitChanges.Parent = PropertyPanel; CommitChanges.Dock = DockStyle.Bottom; CommitChanges.Click += HandleCommitChangesClick; CommitChanges.BringToFront (); ParentNotePanel.Visible = this.Visible; // CaptionLabel.ResumeLayout(); this did not seem to help // ParentNotePanel.ResumeLayout(); // Set up delegates GetAvailableFolders = _Layout.GetAvailableFolders; MoveNote = _Layout.MoveNote; SetSaveRequired = _Layout.SetSaveRequired; DeleteNote = _Layout.DeleteNote; Layout = _Layout; ToolStripMenuItem TokenItem = LayoutDetails.BuildMenuPropertyEdit (Loc.Instance.GetString("Note Dock String: {0}"), this.Notedocks, Loc.Instance.GetString ("example: note1*44159e01-b2c6-4b1f-9b68-8d3c85755f14*[[chapter1]]."), HandleTokenChange,25 ); properties.DropDownItems.Add (TokenItem); BuildNoteDocks(); // February 17 2013 - needed to ensure that children build their controls before Updateappearance is called DoBuildChildren(_Layout); UpdateAppearance (); }
/// <summary> /// Добавляет проект в список создаваемых проектов. /// </summary> /// <param name="project">Создаваемый проект.</param> private void AddProject(IProjectMenuItem project) { if (project == null) throw new ArgumentNullException("Добавляемый проект не может быть неопределенным"); if (!(project is UserControl)) throw new ArgumentException("Проект должен являться пользовательским элементом"); _projects.Add(project); Button btn = new Button(); btn.Text = project.ProjectName; btn.ForeColor = Color.Black; btn.BackColor = Color.WhiteSmoke; btn.UseVisualStyleBackColor = true; btn.Dock = DockStyle.Top; btn.Height = GetItemHeight(); btn.Tag = project; btn.Click += btn_Click; itemsHolder.Controls.Add(btn); btn.TabIndex = createBtn.TabIndex + _projects.Count; btn.BringToFront(); if (_selected == null) SetSelected(project); }
private void CreateAudioSampleButton(int x, int y, int i) { Button b = new Button(); b.Location = new System.Drawing.Point(x, y); b.Size = new System.Drawing.Size(27, 24); b.Image = _paletteForm.PaletteButtonsControl.AudioSampleButtons[i].Image; b.UseVisualStyleBackColor = false; b.MouseDown += new MouseEventHandler(AudioSampleButton_MouseDown); this.Controls.Add(b); _audioSampleButtons.Add(b); b.BringToFront(); }
public void ShowInfoPage() { this.SuspendLayout(); WebBrowser webStart = new WebBrowser(); PNLlist.Controls.Add(webStart); webStart.Visible = false; webStart.ScriptErrorsSuppressed = true; webStart.ScrollBarsEnabled = false; webStart.Dock = DockStyle.Fill; webStart.BringToFront(); Button btnClose = new Button(); this.Controls.Add(btnClose); btnClose.Visible = false; btnClose.Size = new Size(PNLlist.Width - 6, 35); btnClose.Location = new Point(15, PNLlist.Height - 39 + 39); btnClose.FlatAppearance.BorderColor = Color.Gray; btnClose.BackColor = Color.FromArgb(64, 64, 64); btnClose.ForeColor = Color.WhiteSmoke; btnClose.Text = "Close"; btnClose.FlatStyle = FlatStyle.Flat; btnClose.BringToFront(); this.ResumeLayout(); btnClose.Click += (e, s) => { PNLlist.Controls.Remove(webStart); this.Controls.Remove(btnClose); }; webStart.Navigated += (e, s) => { if (!webStart.Document.ToString().ToLower().Contains("checking your")) { webStart.Show(); btnClose.Show(); } }; webStart.Navigate("http://www.realmbot.xyz/hello.html"); }
public bool CreatePanel(IntPtr panelHandle, int backColor, int foreColor) { // panelHandle will only be set if you set about.ConfigurationPanelHeight to a non-zero value // keep in mind the panel width is scaled according to the font the user has selected if (panelHandle != IntPtr.Zero) { _backColor = backColor; _foreColor = foreColor; Panel configPanel = (Panel) Control.FromHandle(panelHandle); ToolTip tpOpenContext = new ToolTip(); _textBox = new TextBox(); tpOpenContext.SetToolTip(_textBox, "Tag indentifiers that can be used are: <Artist>, <AlbumArtist>, <Title>, <Year>, <Album> and <Duration>"); Label patternBoxLabel = new Label { Bounds = new Rectangle(0, 0, configPanel.Width, 22), Text = "The pattern to be displayed:" }; CheckBox nowPlayingCheck = new CheckBox { Bounds = new Rectangle(0, _textBox.Bottom + 30, configPanel.Right, _textBox.Height), Checked = SettingsManager.DisplayNowPlayingString, Text = "Display \"Now Playing:\" text in front of the pattern", FlatStyle = FlatStyle.Flat, AutoSize = true }; //Text Box _textBox.Text = SettingsManager.NowPlayingPattern; _textBox.Bounds = new Rectangle(0, patternBoxLabel.Height + 2, configPanel.Width - 50, _textBox.Height); _textBox.BackColor = Color.FromArgb(backColor); _textBox.ForeColor = Color.FromArgb(foreColor); _textBox.BorderStyle = BorderStyle.FixedSingle; _textBox.HideSelection = false; //Button Creation _openContext = new Button { Bounds = new Rectangle(_textBox.Width + 2, patternBoxLabel.Height + 2, _textBox.Height + 10, _textBox.Height) }; _openContext.BringToFront(); _openContext.TextAlign = ContentAlignment.MiddleCenter; _openContext.Text = "..."; configPanel.Controls.AddRange(new Control[] { patternBoxLabel, _textBox, _openContext, nowPlayingCheck }); //EventHandlers Created. _openContext.MouseClick += OpenContextMouseClick; _textBox.TextChanged += TextBoxTextChanged; nowPlayingCheck.CheckedChanged += NowPlayingCheckChanged; } return false; }
private void createLeftButtons() { //CREATE THE LEFT BUTTON tutorialButton = new Button(); tutorialButton.Location = new Point(15, 510); tutorialButton.Size = new System.Drawing.Size(200, 30); tutorialButton.Text = "How do I PLAY?!"; tutorialButton.FlatStyle = FlatStyle.Flat; tutorialButton.Click += new EventHandler(showHowToPlay); this.Controls.Add(tutorialButton); tutorialButton.BringToFront(); sessionLabel.BringToFront(); }