-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor feature update #162
base: main
Are you sure you want to change the base?
Minor feature update #162
Changes from all commits
ebc961a
bd65db6
7b8ceba
5ef3e83
813788a
6e83ea2
bb60e06
9f5048d
44860c7
2326320
ba45e03
e6472ec
0c97545
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -26,7 +26,9 @@ You should have received a copy of the GNU General Public License | |||||
using System.Windows.Forms; | ||||||
using System.IO; | ||||||
using libEDSsharp; | ||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement; | ||||||
//using static System.Windows.Forms.VisualStyles.VisualStyleElement; | ||||||
//using SourceGrid.Cells.Controllers; | ||||||
//using ToolTip = System.Windows.Forms.ToolTip; | ||||||
|
||||||
namespace ODEditor | ||||||
{ | ||||||
|
@@ -189,6 +191,12 @@ private void openEDSfile(string path,InfoSection.Filetype ft) | |||||
{ | ||||||
EDSsharp eds = new EDSsharp(); | ||||||
|
||||||
if (!File.Exists(path)) | ||||||
{ | ||||||
MessageBox.Show("File " +path + "\ndoes not exist."); | ||||||
return; | ||||||
} | ||||||
|
||||||
eds.Loadfile(path); | ||||||
|
||||||
DeviceView device = new DeviceView(eds, network); | ||||||
|
@@ -327,6 +335,11 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e) | |||||
|
||||||
private void openXDDfile(string path) | ||||||
{ | ||||||
if (!File.Exists(path)) | ||||||
{ | ||||||
MessageBox.Show("File " + path + "\ndoes not exist."); | ||||||
return; | ||||||
} | ||||||
try | ||||||
{ | ||||||
EDSsharp eds; | ||||||
|
@@ -449,13 +462,13 @@ private void Eds_onDataDirty(bool dirty, EDSsharp sender) | |||||
{ | ||||||
foreach(Control c in page.Controls) | ||||||
{ | ||||||
if(c.GetType() == typeof(DeviceView)) | ||||||
if (c.GetType() == typeof(DeviceView)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
{ | ||||||
DeviceView d = (DeviceView)c; | ||||||
if (d.eds.Dirty == true) | ||||||
{ | ||||||
page.BackColor = Color.Tomato; | ||||||
} | ||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
else | ||||||
{ | ||||||
page.BackColor = default(Color); | ||||||
|
@@ -1329,34 +1342,52 @@ private void preferencesToolStripMenuItem_Click(object sender, EventArgs e) | |||||
|
||||||
private void tabControl1_MouseClick(object sender, MouseEventArgs e) | ||||||
{ | ||||||
TabPage tp; | ||||||
if (e.Button == MouseButtons.Right) | ||||||
{ | ||||||
for (int i = 0; i <= tabControl1.TabCount - 1; i++) | ||||||
{ | ||||||
if (tabControl1.GetTabRect(i).Contains(e.Location)) | ||||||
{ | ||||||
tp = tabControl1.TabPages[i]; | ||||||
|
||||||
DialogResult dialogResult = MessageBox.Show(tabControl1.TabPages[i].Text, "Close file?", MessageBoxButtons.YesNo); | ||||||
if (dialogResult == DialogResult.Yes) | ||||||
{ | ||||||
|
||||||
DeviceView device = (DeviceView)tabControl1.TabPages[i].Controls[0]; | ||||||
|
||||||
if (device.eds.Dirty == true) | ||||||
{ | ||||||
if (MessageBox.Show("All unsaved changes will be lost\n continue?", "Unsaved changes", MessageBoxButtons.YesNo) == DialogResult.No) | ||||||
return; | ||||||
} | ||||||
|
||||||
network.Remove(device.eds); | ||||||
|
||||||
tabControl1.TabPages.Remove(tabControl1.TabPages[i]); | ||||||
DeviceView device = (DeviceView)tabControl1.TabPages[i].Controls[0]; | ||||||
if (device.eds.Dirty == true) | ||||||
{ | ||||||
if (MessageBox.Show("All unsaved changes will be lost\n continue?", "Unsaved changes", MessageBoxButtons.YesNo) == DialogResult.No) | ||||||
return; | ||||||
} | ||||||
network.Remove(device.eds); | ||||||
tabControl1.TabPages.Remove(tabControl1.TabPages[i]); | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
private void tabControl1_MouseHover(object sender, EventArgs e) | ||||||
{ | ||||||
|
||||||
TabControl tabControl = sender as TabControl; | ||||||
Point mousePosition = tabControl.PointToClient(Cursor.Position); | ||||||
for (int i = 0; i < tabControl.TabCount; i++) | ||||||
{ | ||||||
Rectangle tabRect = tabControl.GetTabRect(i); | ||||||
if (tabRect.Contains(mousePosition)) | ||||||
{ | ||||||
ToolTip toolTip = new ToolTip(); | ||||||
// Set up the delays for the ToolTip. | ||||||
|
||||||
toolTip.AutoPopDelay = 5000; | ||||||
toolTip.InitialDelay = 1000; | ||||||
toolTip.ReshowDelay = 500; | ||||||
// Force the ToolTip text to be displayed whether or not the form is active. | ||||||
toolTip.ShowAlways = true; | ||||||
DeviceView device = (DeviceView)tabControl1.TabPages[i].Controls[0]; | ||||||
toolTip.SetToolTip(tabControl, device.eds.projectFilename); | ||||||
break; | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,7 @@ | |
gqUTTxJHNd2gfCHts8Z5i7NeLLN6n/yF4ayxvMR1qkHEsYBFyBChoowNFOEgRrtBio0knUst/AOeXyaX | ||
Sq4NMHLMowQdiucH/4Pfs7VzE+N+UlgC2l9c92MYCO0CtYrrfh+7bu0ECD4DV0bDX6oC05+kVxpa9Ajo | ||
2QYurhuaugdc7gD9T6ZiKZ4UpBJyOeD9jL4pA/TeAp2r/tzq5zh9AFI0q8QNcHAIjOQpe63Fuzua5/bn | ||
HW9+kH4AMgFyjcd8GS4AAAAJcEhZcwAACw4AAAsOAUC+4UEAAAAHdElNRQfkCwILIglO4xvLAAAAD3RF | ||
HW9+kH4AMgFyjcd8GS4AAAAJcEhZcwAACwwAAAsMAT9AIsgAAAAHdElNRQfkCwILIglO4xvLAAAAD3RF | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need a little help with the changes here :D |
||
WHRDb21tZW50AENBTm9wZW7cllV1AAAC8UlEQVRYR9WWz2sTQRTHkx6SQy5RxFv1JDGHogiVIkqFEqLE | ||
QigetKY3iSUpPYh/gD8uoQiJIEKJ0UNNRZKjTaQiHozePAk21eagCC20NdW1plTa8X3f7mw3cZNuzSr6 | ||
hQ+8zn6/M29nZts6/hWdIu4T4xZJE2cJ23QvGAyKRCJhCXgp80CN2qNxTAyVP5QZZVXhn6H5mRlGCl5k | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove the commented code?