This commit is contained in:
Kathy Ruffing 2009-08-18 14:10:31 +00:00
parent 2c80cc2758
commit b0c0a65af8
3 changed files with 389 additions and 0 deletions

View File

@ -0,0 +1,156 @@
namespace Volian.Controls.Library
{
partial class DisplayBookMarks
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupPanelBookMarks = new DevComponents.DotNetBar.Controls.GroupPanel();
this.lbxBookMarks = new System.Windows.Forms.ListBox();
this.btnClrBookMrks = new DevComponents.DotNetBar.ButtonX();
this.btnRmvCurBookMrk = new DevComponents.DotNetBar.ButtonX();
this.btnSetBookMrk = new DevComponents.DotNetBar.ButtonX();
this.superTooltipBookMark = new DevComponents.DotNetBar.SuperTooltip();
this.groupPanelBookMarks.SuspendLayout();
this.SuspendLayout();
//
// groupPanelBookMarks
//
this.groupPanelBookMarks.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelBookMarks.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelBookMarks.Controls.Add(this.lbxBookMarks);
this.groupPanelBookMarks.Controls.Add(this.btnClrBookMrks);
this.groupPanelBookMarks.Controls.Add(this.btnRmvCurBookMrk);
this.groupPanelBookMarks.Controls.Add(this.btnSetBookMrk);
this.groupPanelBookMarks.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupPanelBookMarks.Location = new System.Drawing.Point(0, 0);
this.groupPanelBookMarks.Name = "groupPanelBookMarks";
this.groupPanelBookMarks.Size = new System.Drawing.Size(292, 607);
//
//
//
this.groupPanelBookMarks.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
this.groupPanelBookMarks.Style.BackColorGradientAngle = 90;
this.groupPanelBookMarks.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.groupPanelBookMarks.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupPanelBookMarks.Style.BorderBottomWidth = 1;
this.groupPanelBookMarks.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.groupPanelBookMarks.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupPanelBookMarks.Style.BorderLeftWidth = 1;
this.groupPanelBookMarks.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupPanelBookMarks.Style.BorderRightWidth = 1;
this.groupPanelBookMarks.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
this.groupPanelBookMarks.Style.BorderTopWidth = 1;
this.groupPanelBookMarks.Style.CornerDiameter = 4;
this.groupPanelBookMarks.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
this.groupPanelBookMarks.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
this.groupPanelBookMarks.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.groupPanelBookMarks.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
this.groupPanelBookMarks.TabIndex = 0;
this.groupPanelBookMarks.Text = "Book Marks";
//
// lbxBookMarks
//
this.lbxBookMarks.BackColor = System.Drawing.Color.Cornsilk;
this.lbxBookMarks.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbxBookMarks.FormattingEnabled = true;
this.lbxBookMarks.HorizontalScrollbar = true;
this.lbxBookMarks.ItemHeight = 16;
this.lbxBookMarks.Location = new System.Drawing.Point(0, 87);
this.lbxBookMarks.Name = "lbxBookMarks";
this.lbxBookMarks.Size = new System.Drawing.Size(286, 484);
this.superTooltipBookMark.SetSuperTooltip(this.lbxBookMarks, new DevComponents.DotNetBar.SuperTooltipInfo("List of Bookmarks", "", "Selecting bookmark will make that item the active item in the editor. Also, once" +
" selected, the bookmark can be removed.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.lbxBookMarks.TabIndex = 7;
this.lbxBookMarks.Click += new System.EventHandler(this.lbxBookMarks_Click);
//
// btnClrBookMrks
//
this.btnClrBookMrks.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnClrBookMrks.Dock = System.Windows.Forms.DockStyle.Top;
this.btnClrBookMrks.Location = new System.Drawing.Point(0, 58);
this.btnClrBookMrks.Name = "btnClrBookMrks";
this.btnClrBookMrks.Size = new System.Drawing.Size(286, 29);
this.superTooltipBookMark.SetSuperTooltip(this.btnClrBookMrks, new DevComponents.DotNetBar.SuperTooltipInfo("Clear ALL Bookmarks", "", "Removes all bookmarks in the list.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnClrBookMrks.TabIndex = 6;
this.btnClrBookMrks.Text = "Clear ALL Bookmarks";
this.btnClrBookMrks.ThemeAware = true;
this.btnClrBookMrks.Click += new System.EventHandler(this.btnClrBookMrks_Click);
//
// btnRmvCurBookMrk
//
this.btnRmvCurBookMrk.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnRmvCurBookMrk.Dock = System.Windows.Forms.DockStyle.Top;
this.btnRmvCurBookMrk.Location = new System.Drawing.Point(0, 29);
this.btnRmvCurBookMrk.Name = "btnRmvCurBookMrk";
this.btnRmvCurBookMrk.Size = new System.Drawing.Size(286, 29);
this.superTooltipBookMark.SetSuperTooltip(this.btnRmvCurBookMrk, new DevComponents.DotNetBar.SuperTooltipInfo("Remove Bookmark", "", "Removes the selected bookmark from the list.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnRmvCurBookMrk.TabIndex = 5;
this.btnRmvCurBookMrk.Text = "Remove Bookmark";
this.btnRmvCurBookMrk.ThemeAware = true;
this.btnRmvCurBookMrk.Click += new System.EventHandler(this.btnRmvCurBookMrk_Click);
//
// btnSetBookMrk
//
this.btnSetBookMrk.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSetBookMrk.Dock = System.Windows.Forms.DockStyle.Top;
this.btnSetBookMrk.Location = new System.Drawing.Point(0, 0);
this.btnSetBookMrk.Name = "btnSetBookMrk";
this.btnSetBookMrk.Size = new System.Drawing.Size(286, 29);
this.superTooltipBookMark.SetSuperTooltip(this.btnSetBookMrk, new DevComponents.DotNetBar.SuperTooltipInfo("Set Bookmark", "", "Include currently selected item in the Bookmark list. This list is retained afte" +
"r exiting program. Selecting an item from the list makes it the current edit it" +
"em.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnSetBookMrk.TabIndex = 4;
this.btnSetBookMrk.Text = "Set Bookmark";
this.btnSetBookMrk.ThemeAware = true;
this.btnSetBookMrk.Click += new System.EventHandler(this.btnSetBookMrk_Click);
//
// superTooltipBookMark
//
this.superTooltipBookMark.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
//
// DisplayBookMarks
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupPanelBookMarks);
this.Name = "DisplayBookMarks";
this.Size = new System.Drawing.Size(292, 607);
this.groupPanelBookMarks.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private DevComponents.DotNetBar.Controls.GroupPanel groupPanelBookMarks;
private System.Windows.Forms.ListBox lbxBookMarks;
private DevComponents.DotNetBar.ButtonX btnClrBookMrks;
private DevComponents.DotNetBar.ButtonX btnRmvCurBookMrk;
private DevComponents.DotNetBar.ButtonX btnSetBookMrk;
private DevComponents.DotNetBar.SuperTooltip superTooltipBookMark;
}
}

View File

@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
namespace Volian.Controls.Library
{
public partial class DisplayBookMarks : UserControl
{
#region Properties
private MostRecentItemList _MyBookMarks;
private ItemInfo _CurItemInfo = null;
private bool _Initalizing = false;
private DisplayTabControl _MyDisplayTabControl;
public DisplayTabControl MyDisplayTabControl
{
get { return _MyDisplayTabControl; }
set
{
if (value == null) return;
_MyDisplayTabControl = value;
}
}
private StepRTB _MyRTB;
public StepRTB MyRTB
{
get { return _MyRTB; }
set
{
if (value == null) return;
if (_CurItemInfo != null && _CurItemInfo.ItemID == value.MyItemInfo.ItemID) return;
_MyRTB = value;
_CurItemInfo = MyRTB.MyItemInfo;
}
}
#endregion
#region Constructors
public DisplayBookMarks()
{
InitializeComponent();
SetupBookMarks();
}
private void SetupBookMarks()
{
if (_MyBookMarks == null)_MyBookMarks = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["BookMarks"]));
lbxBookMarks.SelectedValueChanged += new EventHandler(lbxBookMarks_SelectedValueChanged);
RefreshBookMarkData();
//btnPrevPos.Enabled = false;
//lbxBookMarks.Enabled = false;
//_PrevBookMark = null;
}
private void RefreshBookMarkData()
{
lbxBookMarks.DataSource = null;
lbxBookMarks.DisplayMember = "MenuTitle";
lbxBookMarks.DataSource = _MyBookMarks;
btnClrBookMrks.Enabled = (lbxBookMarks.Items.Count > 0);
SaveBookMarks();
}
private void SaveBookMarks()
{
Properties.Settings.Default.BookMarks = _MyBookMarks.ToSettings();
Properties.Settings.Default.Save();
}
void lbxBookMarks_SelectedValueChanged(object sender, EventArgs e)
{
btnRmvCurBookMrk.Enabled = (lbxBookMarks.SelectedIndex >= 0);
}
public void AddBookMark(ItemInfo itm)
{
_MyBookMarks.Add(_CurItemInfo);
RefreshBookMarkData();
}
#endregion
#region Events
private void btnSetBookMrk_Click(object sender, EventArgs e)
{
if (_CurItemInfo == null)
{
MessageBox.Show("Cannot set bookmark on this item.");
return;
}
_MyBookMarks.Add(_CurItemInfo);
RefreshBookMarkData();
}
private void btnRmvCurBookMrk_Click(object sender, EventArgs e)
{
_MyBookMarks.RemoveAt(lbxBookMarks.SelectedIndex);
RefreshBookMarkData();
}
private void btnClrBookMrks_Click(object sender, EventArgs e)
{
_MyBookMarks.Clear();
RefreshBookMarkData();
}
private void lbxBookMarks_Click(object sender, EventArgs e)
{
MostRecentItem itm = lbxBookMarks.SelectedValue as MostRecentItem;
MyDisplayTabControl.OpenItem(itm.MyItemInfo);
}
#endregion
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="superTooltipBookMark.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>