private void MainForm_Load(object sender, EventArgs e) { SQLiteDatabase db = new SQLiteDatabase("ffxiv_job_bar.db"); DataTable settings; String query = "Select * from settings;"; settings = db.GetDataTable(query); int x = 0, y = 0; foreach (DataRow r in settings.Rows) { switch (r["variable"].ToString()) { case "opacity": this.Opacity = Convert.ToDouble(r["value"].ToString()) / 100; break; case "locationX": x = Convert.ToInt32(r["value"].ToString()); break; case "locationY": y = Convert.ToInt32(r["value"].ToString()); break; case "actionwait": this.actionWait = Convert.ToInt16(r["value"].ToString()); break; case "hotkeysenabled": this.hotkeysEnabled = Convert.ToBoolean(r["value"].ToString()); break; } } this.Location = new Point(x, y); this.Refresh(); // Create all the job buttons sf = new SettingsForm(this); jcf = new JobConfigureForm(); this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown); sf.ItemDataChanged += new ItemDataChangedHandler(jcf.LoadItemData); Point point = new Point(0, 10); for (int i = 0; i < 20; i++) { JobButton b = new JobButton(this); if ((i > 0) && ((i % 10) == 0)) { point.Y += 20; point.X = 0; } else if (i > 0) { point.X += 34; } b.Font = new System.Drawing.Font("Arial", 5.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); b.Location = point; b.Name = "JobButton" + (i + 1); b.Size = new System.Drawing.Size(35, 21); b.TabIndex = i; b.UseVisualStyleBackColor = true; panel2.Controls.Add(b); b.LoadSettings(); } }
public void SetOwner(JobButton owner) { this.owner = owner; }
public JobConfigureForm() { InitializeComponent(); owner = null; LoadButtonSettings(); }