mirror of
https://github.com/dgis/xsddiagram.git
synced 2024-09-11 18:47:19 +03:00
Fix a small issue on Linux with Mono, and more.
This commit is contained in:
parent
fec9ca0aaa
commit
97f914ff80
22
MainForm.Designer.cs
generated
22
MainForm.Designer.cs
generated
@ -515,6 +515,7 @@ namespace XSDDiagram
|
||||
this.toolStripButtonShowReferenceBoundingBox.Size = new System.Drawing.Size(23, 22);
|
||||
this.toolStripButtonShowReferenceBoundingBox.Text = "References";
|
||||
this.toolStripButtonShowReferenceBoundingBox.ToolTipText = "Show the bounding box for the referenced elements";
|
||||
this.toolStripButtonShowReferenceBoundingBox.Visible = false;
|
||||
this.toolStripButtonShowReferenceBoundingBox.Click += new System.EventHandler(this.toolStripButtonShowReferenceBoundingBox_Click);
|
||||
//
|
||||
// toolStripButtonShowDocumentation
|
||||
@ -895,14 +896,14 @@ namespace XSDDiagram
|
||||
this.removeAllToolStripMenuItem,
|
||||
this.expandOneLevelToolStripMenuItem});
|
||||
this.contextMenuStripDiagram.Name = "contextMenuStripDiagram";
|
||||
this.contextMenuStripDiagram.Size = new System.Drawing.Size(234, 142);
|
||||
this.contextMenuStripDiagram.Size = new System.Drawing.Size(265, 142);
|
||||
this.contextMenuStripDiagram.Opened += new System.EventHandler(this.contextMenuStripDiagram_Opened);
|
||||
//
|
||||
// gotoXSDFileToolStripMenuItem
|
||||
//
|
||||
this.gotoXSDFileToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Move;
|
||||
this.gotoXSDFileToolStripMenuItem.Name = "gotoXSDFileToolStripMenuItem";
|
||||
this.gotoXSDFileToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.gotoXSDFileToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
|
||||
this.gotoXSDFileToolStripMenuItem.Text = "&Goto XSD File";
|
||||
this.gotoXSDFileToolStripMenuItem.Click += new System.EventHandler(this.gotoXSDFileToolStripMenuItem_Click);
|
||||
//
|
||||
@ -910,29 +911,28 @@ namespace XSDDiagram
|
||||
//
|
||||
this.expandToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Expand;
|
||||
this.expandToolStripMenuItem.Name = "expandToolStripMenuItem";
|
||||
this.expandToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Space)));
|
||||
this.expandToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.expandToolStripMenuItem.Text = "E&xpand / Collapse";
|
||||
this.expandToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
|
||||
this.expandToolStripMenuItem.Text = "E&xpand / Collapse [SPACE or RIGHT]";
|
||||
this.expandToolStripMenuItem.Click += new System.EventHandler(this.expandToolStripMenuItem_Click);
|
||||
//
|
||||
// removeFromDiagramToolStripMenuItem
|
||||
//
|
||||
this.removeFromDiagramToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Minus;
|
||||
this.removeFromDiagramToolStripMenuItem.Name = "removeFromDiagramToolStripMenuItem";
|
||||
this.removeFromDiagramToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.removeFromDiagramToolStripMenuItem.Text = "&Remove From Diagram";
|
||||
this.removeFromDiagramToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
|
||||
this.removeFromDiagramToolStripMenuItem.Text = "&Remove From Diagram [DEL]";
|
||||
this.removeFromDiagramToolStripMenuItem.Click += new System.EventHandler(this.removeFromDiagramToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(230, 6);
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(261, 6);
|
||||
//
|
||||
// addAllToolStripMenuItem
|
||||
//
|
||||
this.addAllToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.PlusPlus;
|
||||
this.addAllToolStripMenuItem.Name = "addAllToolStripMenuItem";
|
||||
this.addAllToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.addAllToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
|
||||
this.addAllToolStripMenuItem.Text = "Add &All";
|
||||
this.addAllToolStripMenuItem.Click += new System.EventHandler(this.toolStripButtonAddAllToDiagram_Click);
|
||||
//
|
||||
@ -940,7 +940,7 @@ namespace XSDDiagram
|
||||
//
|
||||
this.removeAllToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Delete;
|
||||
this.removeAllToolStripMenuItem.Name = "removeAllToolStripMenuItem";
|
||||
this.removeAllToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.removeAllToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
|
||||
this.removeAllToolStripMenuItem.Text = "&Remove All";
|
||||
this.removeAllToolStripMenuItem.Click += new System.EventHandler(this.toolStripButtonRemoveAllFromDiagram_Click);
|
||||
//
|
||||
@ -948,7 +948,7 @@ namespace XSDDiagram
|
||||
//
|
||||
this.expandOneLevelToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Expand;
|
||||
this.expandOneLevelToolStripMenuItem.Name = "expandOneLevelToolStripMenuItem";
|
||||
this.expandOneLevelToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
|
||||
this.expandOneLevelToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
|
||||
this.expandOneLevelToolStripMenuItem.Text = "&Expand All One Level";
|
||||
this.expandOneLevelToolStripMenuItem.Click += new System.EventHandler(this.expandOneLevelToolStripMenuItem_Click);
|
||||
//
|
||||
|
42
MainForm.cs
42
MainForm.cs
@ -147,6 +147,14 @@ namespace XSDDiagram
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (Options.IsRunningOnMono)
|
||||
{
|
||||
// Prevent exception with Linux on Mono
|
||||
object[] toolStripMenuItems = new object[] { this.fileToolStripMenuItem, this.fileToolStripMenuItem, this.openToolStripMenuItem, this.openToolStripMenuItem, this.openURLToolStripMenuItem, this.openURLToolStripMenuItem, this.saveDiagramToolStripMenuItem, this.saveDiagramToolStripMenuItem, this.validateXMLFileToolStripMenuItem, this.validateXMLFileToolStripMenuItem, this.recentFilesToolStripMenuItem, this.recentFilesToolStripMenuItem, this.closeToolStripMenuItem, this.closeToolStripMenuItem, this.toolStripMenuItem2, this.pageToolStripMenuItem, this.pageToolStripMenuItem, this.printPreviewToolStripMenuItem, this.printPreviewToolStripMenuItem, this.printToolStripMenuItem, this.printToolStripMenuItem, this.toolStripMenuItem1, this.exitToolStripMenuItem, this.exitToolStripMenuItem, this.toolsToolStripMenuItem, this.toolsToolStripMenuItem, this.windowsExplorerRegistrationToolStripMenuItem, this.windowsExplorerRegistrationToolStripMenuItem, this.registerToolStripMenuItem, this.registerToolStripMenuItem, this.unregisterToolStripMenuItem, this.unregisterToolStripMenuItem, this.windowToolStripMenuItem, this.windowToolStripMenuItem, this.nextTabToolStripMenuItem, this.nextTabToolStripMenuItem, this.previousTabToolStripMenuItem, this.previousTabToolStripMenuItem, this.helpToolStripMenuItem, this.helpToolStripMenuItem, this.aboutToolStripMenuItem, this.aboutToolStripMenuItem, this.toolStripMenuItemAttributesCopyLine, this.toolStripMenuItemAttributesCopyLine, this.toolStripMenuItemAttributesCopyList, this.toolStripMenuItemAttributesCopyList, this.toolStripMenuItemEnumerateCopyLine, this.toolStripMenuItemEnumerateCopyLine, this.toolStripMenuItemEnumerateCopyList, this.toolStripMenuItemEnumerateCopyList, this.addToDiagrammToolStripMenuItem, this.addToDiagrammToolStripMenuItem, this.toolStripMenuItem4, this.toolStripMenuItemElementsCopyLine, this.toolStripMenuItemElementsCopyLine, this.toolStripMenuItemElementsCopyList, this.toolStripMenuItemElementsCopyList, this.gotoXSDFileToolStripMenuItem, this.gotoXSDFileToolStripMenuItem, this.expandToolStripMenuItem, this.expandToolStripMenuItem, this.removeFromDiagramToolStripMenuItem, this.removeFromDiagramToolStripMenuItem, this.toolStripMenuItem3, this.addAllToolStripMenuItem, this.addAllToolStripMenuItem, this.removeAllToolStripMenuItem, this.removeAllToolStripMenuItem, this.expandOneLevelToolStripMenuItem, this.expandOneLevelToolStripMenuItem };
|
||||
foreach (var toolStripMenuItem in toolStripMenuItems)
|
||||
GC.SuppressFinalize(toolStripMenuItem);
|
||||
}
|
||||
|
||||
if (disposing)
|
||||
{
|
||||
if (components != null)
|
||||
@ -323,16 +331,29 @@ namespace XSDDiagram
|
||||
{
|
||||
XSDObject xsdObject = this.toolStripComboBoxSchemaElement.SelectedItem as XSDObject;
|
||||
if (xsdObject != null)
|
||||
this.diagram.Add(xsdObject.Tag, xsdObject.NameSpace);
|
||||
{
|
||||
DiagramItem diagramItem = this.diagram.Add(xsdObject.Tag, xsdObject.NameSpace);
|
||||
if(diagramItem != null)
|
||||
SelectDiagramElement(diagramItem, true);
|
||||
else
|
||||
UpdateDiagram();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void toolStripButtonAddAllToDiagram_Click(object sender, EventArgs e)
|
||||
{
|
||||
DiagramItem firstDiagramItem = null;
|
||||
foreach (XSDObject xsdObject in this.schema.ElementsByName.Values)
|
||||
if (xsdObject != null)
|
||||
this.diagram.Add(xsdObject.Tag, xsdObject.NameSpace);
|
||||
{
|
||||
DiagramItem diagramItem = this.diagram.Add(xsdObject.Tag, xsdObject.NameSpace);
|
||||
if (firstDiagramItem == null && diagramItem != null)
|
||||
firstDiagramItem = diagramItem;
|
||||
}
|
||||
if(firstDiagramItem != null)
|
||||
SelectDiagramElement(firstDiagramItem, true);
|
||||
else
|
||||
UpdateDiagram();
|
||||
}
|
||||
|
||||
@ -565,11 +586,10 @@ namespace XSDDiagram
|
||||
this.textBoxElementPath.Text = path;
|
||||
}
|
||||
|
||||
if (element != this.diagram.SelectedElement)
|
||||
this.diagram.SelectElement(element);
|
||||
UpdateDiagram();
|
||||
if (scrollToElement)
|
||||
this.panelDiagram.ScrollTo(this.diagram.ScalePoint(element.Location), true);
|
||||
UpdateDiagram();
|
||||
}
|
||||
|
||||
private void SelectSchemaElement(XSDObject xsdObject)
|
||||
@ -1437,10 +1457,15 @@ namespace XSDDiagram
|
||||
{
|
||||
if (this.listViewElements.SelectedItems.Count > 0)
|
||||
{
|
||||
DiagramItem firstDiagramItem = null;
|
||||
|
||||
foreach (ListViewItem lvi in this.listViewElements.SelectedItems)
|
||||
{
|
||||
XSDObject xsdObject = lvi.Tag as XSDObject;
|
||||
this.diagram.Add(xsdObject.Tag as XMLSchema.openAttrs, xsdObject.NameSpace);
|
||||
DiagramItem diagramItem = this.diagram.Add(xsdObject.Tag as XMLSchema.openAttrs, xsdObject.NameSpace);
|
||||
if (firstDiagramItem == null && diagramItem != null)
|
||||
firstDiagramItem = diagramItem;
|
||||
|
||||
//switch (xsdObject.Type)
|
||||
//{
|
||||
// case "element":
|
||||
@ -1457,6 +1482,9 @@ namespace XSDDiagram
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
if (firstDiagramItem != null)
|
||||
SelectDiagramElement(firstDiagramItem, true);
|
||||
else
|
||||
UpdateDiagram();
|
||||
}
|
||||
}
|
||||
@ -1507,11 +1535,15 @@ namespace XSDDiagram
|
||||
}
|
||||
|
||||
private void toolStripButtonRemoveAllFromDiagram_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult dialogResult = MessageBox.Show("Are you sure to remove everything?", "Remove All", MessageBoxButtons.YesNo);
|
||||
if (dialogResult == DialogResult.Yes)
|
||||
{
|
||||
this.diagram.RemoveAll();
|
||||
UpdateDiagram();
|
||||
this.panelDiagram.VirtualPoint = new Point(0, 0);
|
||||
this.panelDiagram.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void listView_AfterLabelEdit(object sender, LabelEditEventArgs e)
|
||||
|
@ -1,6 +1,6 @@
|
||||
XSD Diagram is a free xml schema definition diagram viewer (http://regis.cosnier.free.fr).
|
||||
|
||||
Version 1.0alpha Copyright (c) 2006-2016 Regis Cosnier, All Rights Reserved.
|
||||
Version 1.0 Copyright (c) 2006-2016 Regis Cosnier, All Rights Reserved.
|
||||
|
||||
This program is free software and may be distributed
|
||||
according to the terms of the GNU General Public License (GPL).
|
||||
@ -121,8 +121,8 @@ TODO LIST:
|
||||
|
||||
CHANGES:
|
||||
|
||||
version 1.0a (Not released yet)
|
||||
- Add the documentation in the diagram (experimental).
|
||||
version 1.0 (2016-02-28)
|
||||
- Add the documentation in the diagram.
|
||||
- Add a close entry in the File menu.
|
||||
- Add a recently opened list.
|
||||
- Add the selection of an element in the diagram and allow to move from one element to another with the arrow key.
|
||||
|
BIN
XSDDiagram.exe
BIN
XSDDiagram.exe
Binary file not shown.
Binary file not shown.
@ -633,9 +633,9 @@ namespace XSDDiagram.Rendering
|
||||
if (_documentationBox != null)
|
||||
{
|
||||
if(_diagram.Alignement == DiagramAlignement.Far)
|
||||
_documentationBox.Offset(_location.X - _padding.Height / 2, _location.Y - _documentationBox.Height - _padding.Height);
|
||||
_documentationBox.Offset(_location.X, _location.Y - _documentationBox.Height - _padding.Height);
|
||||
else
|
||||
_documentationBox.Offset(_location.X - _padding.Height / 2, _location.Y + _elementBox.Height + _padding.Height);
|
||||
_documentationBox.Offset(_location.X, _location.Y + _elementBox.Height + _padding.Height);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user