private void addTable() { i += 1; Table t = new Table(); t.NUMBER = i; t.AVAILABLE = 0; t.SIZE = "65;65"; t.LOC = "5;5"; t.STATUS = 3; TableUIAdmin tab = new TableUIAdmin(); tab.Size = Databases.getSize(t.SIZE); tab.Location = Databases.getLocation(t.LOC); tab.Table = t; tab.Text = t.NUMBER + ""; tab.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tab.MinimumSize = new Size(10, 10); tab.DoubleClick += (sender2, e2) => removebut(sender2, e2, tab); ControlMoverOrResizer.Init(tab); panel1.Controls.Add(tab); TableManager.saveTable(t); tables.Add(tab); }
public VBlock() { InitializeComponent(); ControlMoverOrResizer.Init(this);//This Allows the Controls to be movable and resizable ControlMoverOrResizer.WorkType = ControlMoverOrResizer.MoveOrResize.Resize; }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { editing = !editing; toolStripMenuItem1.Checked = editing; if (editing) { ControlMoverOrResizer.Init(txt_1); ControlMoverOrResizer.Init(txt_2); ControlMoverOrResizer.Init(txt_3); ControlMoverOrResizer.Init(txt_4); ControlMoverOrResizer.Init(txt_5); ControlMoverOrResizer.Init(txt_6); ControlMoverOrResizer.Init(pictureBox1); } if (!editing) { ControlMoverOrResizer.Unload(txt_1); ControlMoverOrResizer.Unload(txt_2); ControlMoverOrResizer.Unload(txt_3); ControlMoverOrResizer.Unload(txt_4); ControlMoverOrResizer.Unload(txt_5); ControlMoverOrResizer.Unload(txt_6); ControlMoverOrResizer.Unload(pictureBox1); txt_1.Cursor = Cursors.IBeam; txt_2.Cursor = Cursors.IBeam; txt_3.Cursor = Cursors.IBeam; txt_4.Cursor = Cursors.IBeam; txt_5.Cursor = Cursors.IBeam; txt_6.Cursor = Cursors.IBeam; this.CreateGraphics().Clear(this.BackColor); } }
public Form1() { InitializeComponent(); progressBar1.Maximum = _totalIterations; ControlMoverOrResizer.Init(shadowPanel1); }
private void Form1_Load(object sender, EventArgs e) { ControlMoverOrResizer.Init(button1); ControlMoverOrResizer.Init(groupBox1); ControlMoverOrResizer.Init(textBox1); ControlMoverOrResizer.Init(button2, panel1); cboWorkType.SelectedIndex = 0; }
private void loadTables() { ControlMoverOrResizer.WorkType = ControlMoverOrResizer.MoveOrResize.MoveAndResize; foreach (TableUIAdmin t in TableManager.makeTablesAdmin()) { t.DoubleClick += (sender2, e2) => removebut(sender2, e2, t); panel1.Controls.Add(t); tables.Add(t); ControlMoverOrResizer.Init(t); } }
//디지탈 이미지 private void DigitalImage_Add(object sender, EventArgs e) { string strtemp = FilePath(); PictureBox pb = new PictureBox(); pb.Name = "Digital"; pb.Image = new Bitmap(strtemp); pb.SizeMode = PictureBoxSizeMode.StretchImage; pb.Left = ClickMousePoint.X; pb.Top = ClickMousePoint.Y; pb.Tag = DateTime.Now.ToString("yyyyMMddHHmmssfff"); pb.BackColor = Color.Transparent; ControlMoverOrResizer.Init(pb); this.Controls.Add(pb); this.Refresh(); }
//아날로그 텍스트 private void AnalogueText_Add(object sender, EventArgs e) { TextBox tb = new TextBox(); tb.Name = "analogue"; tb.Text = "Tag Text"; tb.Left = ClickMousePoint.X; tb.Top = ClickMousePoint.Y; tb.ForeColor = Color.White; tb.BackColor = Color.Black; //tb.BackColor = Color.FromArgb(0, 0, 0, 0); 텍스트박스는 투명해지지 않는다! tb.Tag = DateTime.Now.ToString("yyyyMMddHHmmssfff"); ControlMoverOrResizer.Init(tb); this.Controls.Add(tb); this.Refresh(); }
private Ctrl.SubtitleCtrl AddSubtitleText() { // Settings to generate a New TextBox Ctrl.SubtitleCtrl txt = new Ctrl.SubtitleCtrl(); // Create the Variable for TextBox _currentFocus = txt; ChangeTxtAttr(txt); //txt.TextChanged += new System.EventHandler(txt_TextChanged); txt.Click += Txt_Click; txt.Tag = _txtIndex; _txtIndex++; // Create Variables to Define "X" and "Y" Locations //var txtLocX = txt.Location.X; //var txtLocY = txt.Location.Y; //Set your TextBox Location Here //txt.Location.X = x; //txt.Location.Y = y; //txt.Location = new Point(x, y); //txt.TextWrapping = TextWrapping.Wrap; //txt.WordWrap = true; //txt.Multiline = true; //txt.Height = h; //txt.Width = w; txt.AutoSize = false; //txt.AcceptsReturn = true; //txt.Margin = new Thickness(10, 15, 950, 0); // This adds a new TextBox //txt.MouseDown += new MouseEventHandler(textbox_MouseDown); //txt.MouseMove += new MouseEventHandler(textbox_MouseMove); //txt.MouseUp += new MouseEventHandler(textbox_MouseUp); //txt.MouseLeave += delegate (object sender, EventArgs e) //{ // Cursor = Cursors.Default; //}; ControlMoverOrResizer.Init(txt); this.pScreen.Controls.Add(txt); return(txt); }
//스태틱 이미지 public void StaticImage_Add(object sender, EventArgs e) { string strtemp = FilePath(); PictureBox pb = new PictureBox(); pb.Name = "static"; pb.Image = new Bitmap(strtemp); pb.SizeMode = PictureBoxSizeMode.StretchImage; pb.Left = ClickMousePoint.X; pb.Top = ClickMousePoint.Y; pb.BackColor = Color.Transparent; pb.Tag = string.Format(""); pb.ImageLocation = strtemp; //key down event ControlMoverOrResizer.Init(pb); this.Controls.Add(pb); this.Refresh(); }
private void Form1_Load(object sender, EventArgs e) { ControlMoverOrResizer.Init(button1, Resize_panel1); }
///FORM private void FormLeafEditor_Load(object sender, EventArgs e) { //setup datagrids with proper formatting InitializeTracks(trackEditor); InitializeTracks(lvlSeqObjs); InitializeTracks(lvlLeafList); InitializeTracks(masterLvlList); InitializeTracks(gateLvlList); InitializeTracks(workingfolderFiles); InitializeLvlStuff(); InitializeMasterStuff(); InitializeGateStuff(); //_formactive is the panel that was last set to Max _formactive = panelLeaf; //set panels to be resizeable ControlMoverOrResizer.Init(panelLeaf); ControlMoverOrResizer.Init(panelLevel); ControlMoverOrResizer.Init(panelMaster); ControlMoverOrResizer.Init(panelGate); ControlMoverOrResizer.Init(panelWorkingFolder); ControlMoverOrResizer.Init(workingfolderFiles, panelWorkingFolder); ControlMoverOrResizer.WorkType = ControlMoverOrResizer.MoveOrResize.MoveAndResize; ///import help text helptext = JsonConvert.DeserializeObject(Properties.Resources.helptext); ///Create directory for leaf templates if (!Directory.Exists(@"templates")) { Directory.CreateDirectory(@"templates"); File.WriteAllText(@"templates\leaf_singletrack.txt", Properties.Resources.leaf_singletrack); File.WriteAllText(@"templates\leaf_multitrack.txt", Properties.Resources.leaf_multitrack); } ///import selectable objects from file and parse them into lists for manipulation //splits input at "###". Each section is a collection of param_paths if (!File.Exists(@"templates\track_objects.txt")) { File.WriteAllText(@"templates\track_objects.txt", Properties.Resources.track_objects); } var import = (File.ReadAllText(@"templates\track_objects.txt")).Replace("\r\n", "\n").Split(new string[] { "###\n" }, StringSplitOptions.None).ToList(); for (int x = 0; x < import.Count; x++) { //split each section into individual lines var import2 = import[x].Split('\n').ToList(); //initialise class so we can add to it Object_Params objpar = new Object_Params() { //name of object is the first line of every set obj_displayname = import2[0], obj_name = new List <string>(), param_displayname = new List <string>(), param_path = new List <string>(), trait_type = new List <string>(), step = new List <string>(), def = new List <string>(), footer = new List <JArray>() }; for (int y = 2; y < import2.Count - 1; y++) { //split each line by ';'. Now each property is separated var import3 = import2[y].Split(';'); try { objpar.obj_name.Add(import3[0]); objpar.param_displayname.Add(import3[1]); objpar.param_path.Add(import3[2]); objpar.trait_type.Add(import3[3]); objpar.step.Add(import3[4]); objpar.def.Add(import3[5]); objpar.footer.Add(JArray.Parse(import3[6])); } catch { _errorlog += "failed to import all properties of param_path " + import3[0] + " of object " + objpar.obj_name + ".\n"; } } //finally, add complete object and values to list _objects.Add(objpar); } //show errors to user if any imports failed if (_errorlog.Length > 1) { MessageBox.Show(_errorlog); } _errorlog = ""; //customize combobox to display the correct content dropObjects.DisplayMember = "obj_displayname"; dropObjects.ValueMember = "obj_displayname"; dropObjects.DataSource = _objects; dropParamPath.Enabled = false; //set timesig datasource dropTimeSig.DataSource = _timesig; // SaveLeaf(true); ///set a bunch of tool tips //Leaf tooltips toolTip1.SetToolTip(btnTrackClear, "Clears the selected track of data"); //Lvl tooltips toolTip1.SetToolTip(btnLvlSeqClear, "Clears the selected track of data"); //Master tooltips toolTip1.SetToolTip(btnMasterOpenCheckpoint, "Opens the selected checkpoint in the Lvl Editor"); toolTip1.SetToolTip(btnMasterOpenIntro, "Opens the selected intro lvl in the Lvl Editor"); toolTip1.SetToolTip(btnMasterOpenLeader, "Opens the selected leader lvl in the Lvl Editor"); toolTip1.SetToolTip(btnMasterOpenRest, "Opens the selected rest lvl in the Lvl Editor"); //Gate tooltips toolTip1.SetToolTip(btnGateOpenPre, "Opens the selected Pre lvl in the Lvl Editor"); toolTip1.SetToolTip(btnGateOpenPost, "Opens the selected Post lvl in the Lvl Editor"); toolTip1.SetToolTip(btnGateOpenRestart, "Opens the selected Restart lvl in the Lvl Editor"); //load size and location data for panels panelLeaf.Size = Properties.Settings.Default.leafeditorsize; panelLeaf.Location = Properties.Settings.Default.leafeditorloc; panelLevel.Location = Properties.Settings.Default.lvleditorloc; panelLevel.Size = Properties.Settings.Default.lvleditorsize; panelGate.Location = Properties.Settings.Default.gateeditorloc; panelGate.Size = Properties.Settings.Default.gateeditorsize; panelMaster.Location = Properties.Settings.Default.mastereditorloc; panelMaster.Size = Properties.Settings.Default.mastereditorsize; panelWorkingFolder.Location = Properties.Settings.Default.folderloc; panelWorkingFolder.Size = Properties.Settings.Default.foldersize; }
private void montacontrole(string control, int indice, int top, int left, int width, int height, Color backcolor, int maxlength, string texto) { controles elemento = new controles(control, indice, height, width, left, top, backcolor, texto, maxlength); controle.Add(elemento); switch (control) { case "pan": // anyControl = btn to Add Button { panArray[indice].Left = left; panArray[indice].Top = top; panArray[indice].Width = width; panArray[indice].Height = height; panArray[indice].BackColor = backcolor; grbArray[indice].Controls.Add(panArray[indice]); ControlMoverOrResizer.Init(panArray[indice], grbArray[0]); break; } case "btn": // anyControl = btn to Add Button { btnArray[indice].Left = left; btnArray[indice].Top = top; btnArray[indice].Width = width; btnArray[indice].Height = height; btnArray[indice].Text = texto; panel1.Controls.Add(btnArray[indice]); ControlMoverOrResizer.Init(btnArray[indice]); break; } case "lbl": // anyControl = lbl to Add Label { lblArray[indice].Left = left; lblArray[indice].Top = top; lblArray[indice].Width = width; lblArray[indice].Text = texto; panel1.Controls.Add(lblArray[indice]); ControlMoverOrResizer.Init(lblArray[indice]); break; } case "txt": // anyControl = txt to Add TextBox { txtArray[indice].Left = left; txtArray[indice].Top = top; txtArray[indice].MaxLength = maxlength; txtArray[indice].Width = width; panel1.Controls.Add(txtArray[indice]); ControlMoverOrResizer.Init(txtArray[indice]); break; } case "lblpsq": // anyControl = lbl to Add Label { lblpsqArray[indice].Left = left; lblpsqArray[indice].Top = top; lblpsqArray[indice].Width = width; lblpsqArray[indice].Text = texto; panArray[0].Controls.Add(lblpsqArray[indice]); ControlMoverOrResizer.Init(lblpsqArray[indice]); break; } case "txtpsq": // anyControl = txt to Add TextBox { txtpsqArray[indice].Left = left; txtpsqArray[indice].Top = top; txtpsqArray[indice].Width = width; txtpsqArray[indice].MaxLength = maxlength; panArray[0].Controls.Add(txtpsqArray[indice]); ControlMoverOrResizer.Init(txtpsqArray[indice]); break; } case "dtv": // anyControl = txt to Add TextBox { dtvArray[indice].Left = left; dtvArray[indice].Top = top; dtvArray[indice].Width = width; dtvArray[indice].Height = height; panel1.Controls.Add(dtvArray[indice]); ControlMoverOrResizer.Init(dtvArray[indice]); break; } case "grb": // anyControl = txt to Add TextBox { grbArray[indice].Left = left; grbArray[indice].Top = top; grbArray[indice].Width = width; grbArray[indice].Height = height; grbArray[indice].BackColor = backcolor; panel1.Controls.Add(grbArray[indice]); ControlMoverOrResizer.Init(grbArray[indice]); break; } } }