Probably Broke something...

This commit is contained in:
lewd-alt
2025-05-06 21:11:32 -07:00
parent 14fdcaf152
commit 449b976f0c
11 changed files with 114 additions and 188 deletions

View File

@@ -1,20 +1,18 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Forms;
namespace _2DGAMELIB;
public class UI : Form
public class UI //: Form
{
private Med Med;
private IContainer components;
private WPFImage wpfImage1;
private GlImage wpfImage1;
private System.Windows.Controls.Image hostedComponent1;
@@ -24,14 +22,15 @@ public class UI : Form
public UI(Med Med)
{
InitializeComponent();
this.Med = Med;
this.Med = Med;
InitializeComponent();
}
private void UI_Load(object sender, EventArgs e)
{
base.ClientSize = Med.Setting(wpfImage1);
base.ClientSize = new Size(1024, 768);
//base.ClientSize =
Med.Setting(wpfImage1);
//base.ClientSize = new Size(1024, 768);
try
{
if (!File.Exists(ConfigPath))
@@ -50,7 +49,7 @@ public class UI : Form
}
if (BigWindow)
{
base.ClientSize = new Size(1280, 960);
//base.ClientSize = new Size(1280, 960);
}
UI_Resize(null, null);
}
@@ -62,11 +61,12 @@ public class UI : Form
private void UI_Resize(object sender, EventArgs e)
{
wpfImage1.ImageSetting();
wpfImage1.Image.Width = (double)base.ClientSize.Width * Med.DpiX;
wpfImage1.Image.Height = (double)base.ClientSize.Height * Med.DpiY;
//wpfImage1.ImageSetting();
//wpfImage1.Image.Width = (double)base.ClientSize.Width * Med.DpiX;
//wpfImage1.Image.Height = (double)base.ClientSize.Height * Med.DpiY;
}
/*
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
@@ -74,15 +74,17 @@ public class UI : Form
components.Dispose();
}
base.Dispose(disposing);
}
}*/
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(_2DGAMELIB.UI));
this.wpfImage1 = new _2DGAMELIB.WPFImage();
this.wpfImage1 = new GlImage();
this.hostedComponent1 = new System.Windows.Controls.Image();
base.SuspendLayout();
//base.SuspendLayout();
/*
this.wpfImage1.BackColor = System.Drawing.Color.Black;
this.wpfImage1.Dock = System.Windows.Forms.DockStyle.Fill;
this.wpfImage1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
@@ -90,24 +92,29 @@ public class UI : Form
this.wpfImage1.Name = "wpfImage1";
this.wpfImage1.Text = "wpfImage1";
this.wpfImage1.TabIndex = 0;
this.wpfImage1.Child = this.hostedComponent1;
this.Text = "UI";
this.wpfImage1.Child = this.hostedComponent1;*/
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.Controls.Add(this.wpfImage1);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
base.Name = "UI";
base.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
//this.Text = "UI";
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(UI_FormClosing);
//base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
//base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
//base.Controls.Add(this.wpfImage1);
//base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
//base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
//base.Name = "UI";
//base.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
//base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(UI_FormClosing);
//beauty
this.wpfImage1.gl_img.Closing = delegate () { UI_FormClosing(null, null); };
this.wpfImage1.Closing = delegate () { UI_FormClosing(null, null); };
base.Load += new System.EventHandler(UI_Load);
base.Resize += new System.EventHandler(UI_Resize);
base.ResumeLayout(false);
//TODO fix?
//base.Load += new System.EventHandler(UI_Load);
UI_Load(null, null);
//base.Resize += new System.EventHandler(UI_Resize);
//base.ResumeLayout(false);
}
}