- myneoreport_bin.zip
- Designer
- app.config
- BuildInfo.cs
- Docs
- Forms
- FwDetector.cs
- Icons
- barcode.ico
- bringtofront.ico
- bullet.ico
- checksql_24.png
- config2_16.ico
- connection.ico
- copyToClipboard.ico
- custom.ico
- databarcode.ico
- dataimage.ico
- db.ico
- dblabel.ico
- Details.ico
- download.ico
- error.ico
- error_tl.ico
- fileassociation.ico
- folder.ICO
- Group.ico
- GroupSection.ico
- i16.ico
- image.ico
- label16.ico
- movedown.ico
- moveitem.ico
- moveup.ico
- MyDesigner.ico
- MyReport.ico
- MyReport2.ico
- MyViewer.ico
- PageFooter.ico
- PageHeader.ico
- print.ico
- Props16.ico
- redo.ico
- Refresh.ico
- Remove.ico
- report.ico
- ReportFooter.ico
- ReportHeader.ico
- save16.ico
- Section.ico
- SectionTemplate.ico
- sendtoback.ico
- shape.ico
- table.ico
- Thumbs.db
- undo.ico
- w16.ico
- x16.ico
- MyDesigner.ico
- MyNRDesigner.csproj
- MyNRDesigner.sln
- Program.cs
- Properties
- Settings.cs
- UI
- Undo
- Mr6UpdateSupport
- NeoDataType.LiveCodeEngine.dll
- NeoDataType.MyNeoReport.dll
- NeoDataType.Serialization.1.2.dll
- readme.txt
- UpdateMr5.exe
- MyNRDesigner.exe
- MyNRViewer.exe
- neodatatype.license.txt
- NeoDataType.LiveCodeEngine.dll
- NeoDataType.MyNeoReport.dll
- NeoDataType.MyNeoReport.XML
- upgradeinfo.txt
- myneoreport_designers_src.zip
|
/////////////////////////////////////////////////////////////////////////////////
// MyNeoReport Designer
// --------------------
// Project Copyright (C) : Fabio Zanetta, email: neofz@interfree.it
// Portions Copyright (C) : Microsoft Corporation. All Rights Reserved.
// License : docs/license.txt
// ------------------------------------------------------------------------------
// File created by : Fabio Zanetta, email: neofz@interfree.it
// ------------------------------------------------------------------------------
// Please, if you modify some parts of this file mark them as described in
// docs/modify_guidelines.txt
/////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic ;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Reflection;
namespace MyNRDesigner.UI
{
/// <summary>
/// Descrizione di riepilogo per MyTreeView.
/// </summary>
public class MyTreeView : System.Windows.Forms.TreeView
{
/// <summary>
/// Variabile di progettazione necessaria.
/// </summary>
private System.ComponentModel.Container components = null;
private List<TreeNode> _selected = new List<TreeNode>();
public event TreeViewCancelEventHandler ValidateSelect;
public MyTreeView()
{
// Chiamata richiesta da Progettazione form Windows.Forms.
InitializeComponent();
// TODO: aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent.
}
/// <summary>
/// Pulire le risorse in uso.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Codice generato da Progettazione componenti
/// <summary>
/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
/// il contenuto del metodo con l'editor di codice.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
private MyTreeNode _GetNode(TreeNodeCollection ns , object item)
{
MyTreeNode _node = null;
foreach (MyTreeNode n in ns)
{
if (n.Nodes.Count > 0)
_node = _GetNode(n.Nodes, item);
if (_node == null)
{
if (n.Item.Equals(item))
{
return n;
}
} else return _node;
}
return null;
}
public MyTreeNode GetNode(object item)
{
return _GetNode(this.Nodes, item);
}
//public new MyTreeNode SelectedNode
//{
// get { return (MyTreeNode)base.SelectedNode; }
// set { base.SelectedNode = value; }
//}
public void Select(TreeNode node)
{
if ((node != null) && (!_selected.Contains(node)))
{
node.BackColor = SystemColors.Highlight;
node.ForeColor = SystemColors.HighlightText;
_selected.Add(node);
//this.OnAfterSelect(new TreeViewEventArgs(node));
}
}
public void DeSelect(TreeNode node)
{
if (_selected.Contains(node))
{
node.BackColor = Color.Transparent;
node.ForeColor = SystemColors.WindowText;
_selected.Remove(node);
//this.OnAfterSelect(new TreeViewEventArgs(node));
}
}
public void DeSelectAll()
{
DeselectNode(Nodes[0]);
}
public TreeNode[] SelectedNodes
{
get { return _selected.ToArray(); }
}
void DeselectNode(TreeNode node)
{
node.BackColor = Color.Transparent;
node.ForeColor = SystemColors.WindowText;
_selected.Remove(node);
//Console.WriteLine(node.Text);
foreach (TreeNode n in node.Nodes)
{
//n.BackColor = Color.Transparent;
//n.ForeColor = SystemColors.WindowText;
//_selected.Remove(n);
//if (n.Nodes.Count > 0)
{
DeselectNode(n);
}
}
}
protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
{
SelectedNode = null;
// this avoid the treeview to process
// the selection message
e.Cancel = true;
base.OnBeforeSelect(e);
}
protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
{
base.OnNodeMouseClick(e);
if (_selected.Count > 0)
{
if ((_selected[0].Level != e.Node.Level) || ((ModifierKeys & Keys.Control) == Keys.None))
{
DeSelectAll();
//foreach (TreeNode n in Nodes)
// DeselectNode(n);
}
}
TreeViewCancelEventArgs cea = new TreeViewCancelEventArgs(e.Node, false, TreeViewAction.Unknown);
if (ValidateSelect != null)
{
ValidateSelect(this, cea);
}
if (!cea.Cancel)
{
if (_selected.Contains(e.Node))
{
DeSelect(e.Node);
}
else
{
Select(e.Node);
}
}
this.OnAfterSelect(new TreeViewEventArgs(e.Node));
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.