Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
DrawCommand.cs
Package: ProgressBar_src.rar [view]
Upload User: nnpulika
Upload Date: 2013-02-15
Package Size: 597k
Code Size: 3k
Category:
StatusBar
Development Platform:
C#
- using System;
- using System.Drawing;
- namespace UtilityLibrary.Menus
- {
- internal class DrawCommand
- {
- #region Class Variables
- protected int row;
- protected int col;
- protected char mnemonic;
- protected bool enabled;
- protected bool subMenu;
- protected bool expansion;
- protected bool separator;
- protected bool vertSeparator;
- protected bool chevron;
- protected Rectangle drawRect;
- protected MenuCommand menuCommand;
- #endregion
- #region Constructors
- public DrawCommand(Rectangle drawRect)
- {
- row = -1;
- col = -1;
- mnemonic = '0';
- enabled = true;
- subMenu = false;
- expansion = false;
- separator = false;
- vertSeparator = false;
- chevron = true;
- this.drawRect = drawRect;
- menuCommand = null;
- }
- public DrawCommand(Rectangle drawRect, bool expansion)
- {
- row = -1;
- col = -1;
- mnemonic = '0';
- enabled = true;
- subMenu = false;
- expansion = expansion;
- separator = !expansion;
- vertSeparator = !expansion;
- chevron = false;
- this.drawRect = drawRect;
- menuCommand = null;
- }
- public DrawCommand(MenuCommand command, Rectangle drawRect)
- {
- InternalConstruct(command, drawRect, -1, -1);
- }
- public DrawCommand(MenuCommand command, Rectangle drawRect, int row, int col)
- {
- InternalConstruct(command, drawRect, row, col);
- }
- public void InternalConstruct(MenuCommand command, Rectangle drawRect, int row, int col)
- {
- row = row;
- col = col;
- enabled = command.Enabled;
- expansion = false;
- vertSeparator = false;
- this.drawRect = drawRect;
- menuCommand = command;
- chevron = false;
- // Is this MenuCommand a separator?
- separator = (menuCommand.Text == "-");
- // Does this MenuCommand contain a submenu?
- subMenu = (menuCommand.MenuCommands.Count > 0);
- // Find position of first mnemonic character
- if ( command.Text == null || command.Text == string.Empty )
- return;
- int position = command.Text.IndexOf('&');
- // Did we find a mnemonic indicator?
- if (position != -1)
- {
- // Must be a character after the indicator
- if (position < (command.Text.Length - 1))
- {
- // Remember the character
- mnemonic = char.ToUpper(command.Text[position + 1]);
- }
- }
- }
- #endregion
- #region Properties
- public Rectangle DrawRect
- {
- get { return drawRect; }
- set { drawRect = value; }
- }
- public MenuCommand MenuCommand
- {
- get { return menuCommand; }
- }
- public bool Separator
- {
- get { return separator; }
- }
- public bool VerticalSeparator
- {
- get { return vertSeparator; }
- }
- public bool Expansion
- {
- get { return expansion; }
- }
- public bool SubMenu
- {
- get { return subMenu; }
- }
- public char Mnemonic
- {
- get { return mnemonic; }
- }
- public bool Enabled
- {
- get { return enabled; }
- }
- public int Row
- {
- get { return row; }
- }
- public int Col
- {
- get { return col; }
- }
- public bool Chevron
- {
- get { return chevron; }
- }
- #endregion
- }
- }