ColorPickerDropDown.cs
上传用户:nnpulika
上传日期:2013-02-15
资源大小:597k
文件大小:23k
源码类别:

状态条

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Windows.Forms;
  7. using System.Diagnostics;
  8. using UtilityLibrary.General;
  9. using UtilityLibrary.WinControls;
  10. using UtilityLibrary.Win32;
  11. namespace UtilityLibrary.WinControls
  12. {
  13. #region Delegates
  14. public delegate void ColorChangeEventHandler(object sender, ColorChangeArgs e);
  15. #endregion
  16. #region Helper Classes
  17. [ToolboxItem(false)]
  18. public class ColorChangeArgs: EventArgs
  19. {
  20. #region Class Variables
  21. Color newColor;
  22. string senderName;
  23. #endregion
  24. #region Constructors
  25. public ColorChangeArgs(Color newColor,  string senderName)
  26. {
  27. this.newColor = newColor;
  28. this.senderName = senderName;
  29. }
  30. #endregion
  31. #region Properties
  32. public Color NewColor
  33. {
  34. get { return newColor;}
  35. }
  36. public string SenderName
  37. {
  38. get { return senderName;}
  39. }
  40. #endregion
  41. }
  42. #endregion
  43. /// <summary>
  44. /// Summary description for ColorPickerDropDown.
  45. /// </summary>
  46. public class ColorPickerDropDown : System.Windows.Forms.Form
  47. {
  48. #region Events
  49. public event ColorChangeEventHandler ColorChanged;
  50. #endregion
  51. #region Class Variables
  52. private System.Windows.Forms.TabControl tabControl;
  53. private ColorListBox webColorsList;
  54. private ColorListBox systemColorsList;
  55. private System.Windows.Forms.TabPage customColorsPage;
  56. private System.Windows.Forms.TabPage webColorsPage;
  57. private System.Windows.Forms.TabPage systemColorsPage;
  58. private const int CUSTOM_COLORS_COUNT = 64;
  59. private const int CUSTOM_COLOR_WIDTH = 20;
  60. private const int CUSTOM_COLOR_HEIGHT = 20;
  61. private const int CUSTOM_COLORS_HORIZ_ITEMS = 8;
  62. private const int CUSTOM_COLORS_VERT_ITEMS = 8;
  63. private const int USED_ROWS = 6;
  64. private const int USED_COLS = 8;
  65. private bool customColorsRectsSaved = false;
  66. private bool rightButtonDown = false;
  67. private int currentCustomColorIndex = 0;
  68. private Color currentColor;
  69. private bool exitLoop = false;
  70. Control parent = null;
  71. static Rectangle[] customColorsRects = new Rectangle[64];
  72.         #region Custom Colors Array
  73. static Color[] customColors = {
  74.   Color.FromArgb(255,255,255), Color.FromArgb(224,224,224), Color.FromArgb(192,192,192),
  75.   Color.FromArgb(128,128,128), Color.FromArgb(64,64,64), Color.FromArgb(0,0,0),
  76.   Color.White, Color.White,
  77.   Color.FromArgb(255,192,192), Color.FromArgb(255,128,128), Color.FromArgb(255,0,0),
  78.   Color.FromArgb(192,0,0), Color.FromArgb(128,0,0), Color.FromArgb(64,0,0),
  79.   Color.White, Color.White,
  80.   Color.FromArgb(255,224,192), Color.FromArgb(255,192,128), Color.FromArgb(255,128,0),
  81.   Color.FromArgb(192,64,0), Color.FromArgb(128,64,0), Color.FromArgb(128,64,64),
  82.   Color.White, Color.White,
  83.   Color.FromArgb(255,255,192), Color.FromArgb(255,255,128), Color.FromArgb(255,255,0),
  84.   Color.FromArgb(192,192,0), Color.FromArgb(128,128,0), Color.FromArgb(64,64,0),
  85.   Color.White, Color.White,
  86.   Color.FromArgb(192,255,192), Color.FromArgb(128,255,128), Color.FromArgb(0,255,0),
  87.   Color.FromArgb(0,192,0), Color.FromArgb(0,128,0), Color.FromArgb(0,64,0),
  88.   Color.White, Color.White,
  89.   Color.FromArgb(192,255,255), Color.FromArgb(128,255,255), Color.FromArgb(0,255,255),
  90.   Color.FromArgb(0,192,192), Color.FromArgb(0,128,128), Color.FromArgb(0,64,64),
  91.   Color.White, Color.White,
  92.   Color.FromArgb(192,192,255), Color.FromArgb(128,128,255), Color.FromArgb(0,0,255),
  93.   Color.FromArgb(0,0,192), Color.FromArgb(0,0,128), Color.FromArgb(0,0,64),
  94.   Color.White, Color.White,
  95.   Color.FromArgb(255,192,255), Color.FromArgb(255,128,255), Color.FromArgb(255,0,255),
  96.   Color.FromArgb(192,0,192), Color.FromArgb(128,0,128), Color.FromArgb(64,0,64),
  97.   Color.White, Color.White};
  98. #endregion
  99. /// <summary> 
  100. /// Required designer variable.
  101. /// </summary>
  102. private System.ComponentModel.Container components = null;
  103. #endregion
  104. #region Constructors
  105. public ColorPickerDropDown()
  106. {
  107.  Initialize(null);
  108. }
  109. public ColorPickerDropDown(Control parent)
  110. {
  111. Initialize(parent);
  112. }
  113. /// <summary> 
  114. /// Clean up any resources being used.
  115. /// </summary>
  116. protected override void Dispose( bool disposing )
  117. {
  118. if( disposing )
  119. {
  120. if(components != null)
  121. {
  122. components.Dispose();
  123. }
  124. }
  125. base.Dispose( disposing );
  126. }
  127. void Initialize(Control parent)
  128. {
  129. webColorsList = new ColorListBox();
  130. systemColorsList = new ColorListBox();
  131. this.parent = parent;
  132. StartPosition = FormStartPosition.Manual;
  133. // This call is required by the Windows.Forms Form Designer.
  134. InitializeComponent();
  135. InitializeListBoxes();
  136. }
  137. #endregion
  138. #region Overrides
  139. protected override void OnPaint(PaintEventArgs pe)
  140. {
  141. base.OnPaint(pe);
  142. Graphics g = pe.Graphics;
  143. Rectangle rc = ClientRectangle;
  144. g.DrawRectangle(Pens.Black, rc.Left, rc.Top, rc.Width-1, rc.Height-1);
  145. }
  146. protected override void OnDeactivate(EventArgs e)
  147. {
  148. base.OnDeactivate(e);
  149. exitLoop = true;
  150. Visible = false;
  151. }
  152. protected override void OnResize(EventArgs e)
  153. {
  154. base.OnResize(e);
  155. // Size tab control
  156. Rectangle rc = ClientRectangle;
  157. tabControl.Left = 2;
  158. tabControl.Top = 2;
  159. tabControl.Width = rc.Width-3;
  160. tabControl.Height = rc.Height-3;
  161. // Size customColorsPage
  162. customColorsPage.Left = 0;
  163. customColorsPage.Top = 0;
  164. customColorsPage.Width = rc.Width-3;
  165. customColorsPage.Height = rc.Height-3;
  166. // Size webColorsPage
  167. webColorsPage.Left = 0;
  168. webColorsPage.Top = 0;
  169. webColorsPage.Width = rc.Width-3;
  170. webColorsPage.Height = rc.Height-3;
  171. //  Size listbox in webcolorPage
  172. webColorsList.Left = 0;
  173. webColorsList.Top = 0;
  174. webColorsList.Width = rc.Width-15;
  175. webColorsList.Height = rc.Height-26;
  176. // Size systemColorsPage
  177. systemColorsPage.Left = 0;
  178. systemColorsPage.Top = 0;
  179. systemColorsPage.Width = rc.Width-3;
  180. systemColorsPage.Height = rc.Height-3;
  181. systemColorsList.Left = 0;
  182. systemColorsList.Top = 0;
  183. systemColorsList.Width = rc.Width-15;
  184. systemColorsList.Height = rc.Height-26;
  185. }
  186. protected override  void WndProc(ref Message m)
  187. {
  188. bool callBase = true;
  189. switch(m.Msg)
  190. {
  191. case ((int)Msg.WM_PAINT):
  192. callBase = false;
  193. base.WndProc(ref m);
  194. exitLoop = false;
  195. // Let any message directed to children
  196. // to be process before we start our loop
  197. Application.DoEvents();
  198. StartPeekMessageLoop();
  199. break;
  200. default:
  201. break;
  202. }
  203. if ( callBase )
  204. base.WndProc(ref m);
  205. }
  206. #endregion
  207. #region Properties
  208. public Color CurrentColor
  209. {
  210. set
  211. {
  212. currentColor = value;
  213. }
  214. }
  215. #endregion
  216. #region Methods
  217. public new void Show()
  218. {
  219. // Show color picker dropdown control
  220. Point point = new Point(0,0);
  221. if ( parent != null )
  222. {
  223. // If there is parent, then we are going to calculate where
  224. // to display the color picker drop down, otherwise, the user has to do it
  225. CalculateSafeDisplayPoint(ref point);
  226. DesktopBounds = new Rectangle(point.X, point.Y, ClientRectangle.Width, ClientRectangle.Height);
  227. }
  228. base.Show();
  229. }
  230. public void Show(Point showPos)
  231. {
  232. DesktopBounds = new Rectangle(showPos.X, showPos.Y, ClientRectangle.Width, ClientRectangle.Height);
  233. base.Show();
  234. }
  235. #endregion
  236. #region Implementation
  237. protected void OnColorChanged(ColorChangeArgs e)
  238. {
  239. currentColor = e.NewColor;
  240. if ( ColorChanged != null ) 
  241. ColorChanged(this, e);
  242. }
  243. void InitializeListBoxes()
  244. {
  245. webColorsList.ColorArray = ColorUtil.KnownColorNames;
  246. systemColorsList.ColorArray = ColorUtil.SystemColorNames;
  247. // 
  248. // customColorsPage
  249. // 
  250. this.customColorsPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  251. this.customColorsPage.Location = new System.Drawing.Point(4, 22);
  252. this.customColorsPage.Name = "customColorsPage";
  253. this.customColorsPage.Size = new System.Drawing.Size(178, 188);
  254. this.customColorsPage.TabIndex = 0;
  255. this.customColorsPage.Text = "Custom";
  256. this.customColorsPage.Click += new System.EventHandler(this.customColorsPage_Click);
  257. this.customColorsPage.Paint += new System.Windows.Forms.PaintEventHandler(this.customColorsPage_Paint);
  258. this.customColorsPage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.customColorsPage_MouseDown);
  259. // 
  260. // webColorsList
  261. // 
  262. this.webColorsList.BorderStyle = System.Windows.Forms.BorderStyle.None;
  263. this.webColorsList.Location = new System.Drawing.Point(6, 4);
  264. this.webColorsList.Name = "webColorsList";
  265. this.webColorsList.Size = new System.Drawing.Size(178, 188);
  266. this.webColorsList.TabIndex = 0;
  267. this.webColorsList.Click += new System.EventHandler(this.webColorsList_Click);
  268. this.webColorsPage.Controls.AddRange(new System.Windows.Forms.Control[] {
  269. this.webColorsList});
  270. // 
  271. // systemColorsList
  272. // 
  273. this.systemColorsList.BorderStyle = System.Windows.Forms.BorderStyle.None;
  274. this.systemColorsList.Location = new System.Drawing.Point(8, 8);
  275. this.systemColorsList.Name = "systemColorsList";
  276. this.systemColorsList.Size = new System.Drawing.Size(178, 188);
  277. this.systemColorsList.TabIndex = 0;
  278. this.systemColorsList.Click += new System.EventHandler(this.systemColorsList_Click);
  279. this.systemColorsPage.Controls.AddRange(new System.Windows.Forms.Control[] {
  280.    this.systemColorsList});
  281. }
  282. void customColorsPage_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  283. {
  284. // Paint custom colors
  285.             Graphics g = e.Graphics;
  286. Rectangle rc = customColorsPage.ClientRectangle;
  287. rc.Inflate(-2, -2);
  288. int gap = 3;
  289. int index;
  290. for ( int i = 0; i < CUSTOM_COLORS_HORIZ_ITEMS; i++ ) 
  291. {
  292. int Left = rc.Left + (CUSTOM_COLOR_WIDTH*i)+ i*gap;
  293. int Top = rc.Top;
  294. for ( int j = 0; j < CUSTOM_COLORS_VERT_ITEMS; j++ )
  295. {
  296. Top = rc.Top + (CUSTOM_COLOR_HEIGHT*j) + (j*gap);
  297. index = i*8 + j;
  298. ControlPaint.DrawBorder3D(g, Left, Top, CUSTOM_COLOR_WIDTH, CUSTOM_COLOR_HEIGHT, Border3DStyle.Sunken);
  299. g.FillRectangle(new SolidBrush(customColors[index]),Left+1, Top+1, CUSTOM_COLOR_WIDTH-2, CUSTOM_COLOR_HEIGHT-2);
  300. if ( !customColorsRectsSaved )
  301. {
  302. customColorsRects[index] = new Rectangle(Left+1, Top+1, CUSTOM_COLOR_WIDTH-2, CUSTOM_COLOR_HEIGHT-2);
  303. }
  304. if ( currentCustomColorIndex == index ) 
  305. {
  306. Rectangle reverseRect = new Rectangle(Left-1, Top-1, CUSTOM_COLOR_WIDTH+3, CUSTOM_COLOR_HEIGHT+3);
  307. reverseRect = customColorsPage.RectangleToScreen(reverseRect);
  308. ControlPaint.DrawReversibleFrame(reverseRect, SystemColors.Control, FrameStyle.Thick);
  309. }
  310. }
  311. }
  312. customColorsRectsSaved = true;
  313. }
  314. void customColorsPage_Click(object sender, System.EventArgs e)
  315. {
  316. // Get current mouse position
  317. Point screenMousePos = Control.MousePosition;
  318. // Convert mouse position to client coordinates
  319. Point clientMousePos = customColorsPage.PointToClient(screenMousePos);
  320. if ( rightButtonDown == true ) 
  321. {  
  322. // Check if we need to show the custom color color picker dialog
  323. int index = -1;
  324. if ( IsSpareColor(clientMousePos, ref index)) 
  325. {
  326. CustomColorDlg dlg = new CustomColorDlg();
  327. dlg.CurrentColor = customColors[index];
  328. if ( dlg.ShowDialog(this) == DialogResult.OK )
  329. {
  330. customColors[index] = dlg.CurrentColor;
  331. ColorChangeArgs ca = new ColorChangeArgs(dlg.CurrentColor, "CustomTab");
  332. OnColorChanged(ca);
  333. }
  334. }
  335. rightButtonDown = false;
  336. return;
  337. }
  338. Graphics g = customColorsPage.CreateGraphics();
  339. Color clickedColor = ColorUtil.ColorFromPoint(g, clientMousePos.X, clientMousePos.Y);
  340. g.Dispose();
  341. Color color = FindCustomColor(clientMousePos);
  342. if ( color != Color.Empty )
  343. {
  344. ColorChangeArgs ca = new ColorChangeArgs(color, "CustomTab");
  345. OnColorChanged(ca);
  346. // Hide the dropdown 
  347. exitLoop = true;
  348. Visible = false;
  349. }
  350. }
  351. Color FindCustomColor(Point point)
  352. {
  353. Color color = Color.Empty;
  354. for ( int i = 0 ; i < CUSTOM_COLORS_COUNT; i++) 
  355. {
  356. if ( customColorsRects[i].Contains(point) )
  357. {
  358. color = customColors[i];
  359. currentCustomColorIndex = i;
  360. return color;
  361. }
  362. }
  363. // Did not find the color
  364. // Should only happen if the user click between colors
  365. return color;
  366. }
  367. bool IsSpareColor(Point p, ref int index)
  368. {
  369. for ( int i = 0; i < CUSTOM_COLORS_HORIZ_ITEMS; i++ ) 
  370. {
  371. for ( int j = (CUSTOM_COLORS_VERT_ITEMS-2); j < CUSTOM_COLORS_VERT_ITEMS; j++ )
  372. {
  373. if ( customColorsRects[i*8 + j].Contains(p) )
  374. {
  375. index = i*8 + j;
  376. currentCustomColorIndex = index;
  377. return true;
  378. }
  379. }
  380. }
  381. return false;
  382. }
  383. void customColorsPage_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
  384. {
  385. if ( e.Button == MouseButtons.Right ) 
  386. {
  387. rightButtonDown = true;
  388. }
  389. }
  390. void tabControl_SelectedIndexChanged(object sender, System.EventArgs e)
  391. {
  392. int index = tabControl.SelectedIndex;
  393. if ( index == 1 )
  394. webColorsList.Focus();
  395. else if ( index == 2)
  396. systemColorsList.Focus();
  397. }
  398. void webColorsList_Click(object sender, System.EventArgs e)
  399. {
  400.             Color color = Color.FromName(webColorsList.Text);
  401. ColorChangeArgs ca = new ColorChangeArgs(color, "WebTab");
  402. OnColorChanged(ca);
  403. exitLoop = true;
  404. Visible = false;
  405. }
  406. void systemColorsList_Click(object sender, System.EventArgs e)
  407. {
  408. Color color = Color.FromName(systemColorsList.Text);
  409. currentColor = color;
  410. ColorChangeArgs ca = new ColorChangeArgs(color, "SystemTab");
  411. OnColorChanged(ca);
  412. exitLoop = true;
  413. Visible = false;
  414. }
  415. int GetCustomColorIndex(Color color)
  416. {
  417. for ( int i = 0; i < CUSTOM_COLORS_COUNT; i++ )
  418. {
  419. if ( customColors[i].Equals(color) )
  420. return i;
  421. }
  422. // Should not happen
  423. return -1;
  424. }
  425. bool GetSystemColorIndex(Color color, out int index)
  426. {
  427. index = -1;
  428. string colorName = color.Name;
  429. index = systemColorsList.FindStringExact(colorName);
  430. if ( index != ListBox.NoMatches )
  431. {
  432. systemColorsList.SelectedIndex = index;
  433. return true;
  434. }
  435.             return false;
  436. }
  437. bool GetWebColorIndex(Color color, out int index)
  438. {
  439. index = -1;
  440. string colorName = color.Name;
  441. index = webColorsList.FindStringExact(colorName);
  442. if ( index != ListBox.NoMatches )
  443. {
  444. webColorsList.SelectedIndex = index;
  445. return true;
  446. }
  447.             return false;
  448. }
  449. void ColorPickerDropDown_VisibleChanged(object sender, System.EventArgs e)
  450. {
  451. if ( !Visible ) 
  452. return;
  453. // Select tab base on current color index
  454. int index;
  455. bool isNamed = currentColor.IsNamedColor;
  456. if ( !isNamed ) 
  457. {
  458. // It got to be a custom color
  459. index = GetCustomColorIndex(currentColor);
  460. currentCustomColorIndex = index;
  461. tabControl.SelectedIndex = 0;
  462. return;
  463. }
  464. bool isSystemColor = GetSystemColorIndex(currentColor, out index);
  465. if ( isSystemColor )
  466. {
  467. tabControl.SelectedIndex = 2;
  468. return;
  469. }
  470. bool isWebColor = GetWebColorIndex(currentColor, out index);
  471. if ( isWebColor )
  472. {
  473. tabControl.SelectedIndex = 1;
  474. }
  475. }
  476. bool IsChild(IntPtr hWnd)
  477. {
  478. // Consider a child the tab control itself
  479. // the tab pages, or the list controls in the tab pages
  480. if ( tabControl.Handle == hWnd )
  481. return true;
  482. else if ( webColorsList.Handle == hWnd )
  483. return true;
  484. else if ( systemColorsList.Handle == hWnd )
  485. return true;
  486. else if ( customColorsPage.Handle == hWnd )
  487. return true;
  488. else if ( webColorsPage.Handle == hWnd )
  489. return true;
  490. else if ( systemColorsPage.Handle == hWnd )
  491. return true;
  492. return false;
  493. }
  494. void StartPeekMessageLoop()
  495. {
  496. // Create an object for storing windows message information
  497. Win32.MSG msg = new Win32.MSG();
  498. bool leaveMsg = false;
  499. // Process messages until exit condition recognised
  500. while(!exitLoop)
  501. {
  502. // Suspend thread until a windows message has arrived
  503. if (WindowsAPI.WaitMessage())
  504. {
  505. // Take a peek at the message details without removing from queue
  506. while(!exitLoop && WindowsAPI.PeekMessage(ref msg, 0, 0, 0, Win32.PeekMessageFlags.PM_NOREMOVE))
  507. {
  508. //Console.WriteLine("Track {0} {1}", this.Handle, ((Msg)msg.message).ToString());
  509. //Console.WriteLine("Message is for {0 }", msg.hwnd); 
  510. // Mouse was pressed in a window of this application
  511. if ((msg.message == (int)Msg.WM_LBUTTONDOWN) ||
  512. (msg.message == (int)Msg.WM_MBUTTONDOWN) ||
  513. (msg.message == (int)Msg.WM_RBUTTONDOWN) ||
  514. (msg.message == (int)Msg.WM_NCLBUTTONDOWN) ||
  515. (msg.message == (int)Msg.WM_NCMBUTTONDOWN) ||
  516. (msg.message == (int)Msg.WM_NCRBUTTONDOWN))
  517. {
  518. // Is the mouse event for this popup window?
  519. if (msg.hwnd != this.Handle && !IsChild(msg.hwnd) )
  520. {
  521. // No, then we need to exit the popup menu tracking
  522. exitLoop = true;
  523. // DO NOT process the message, leave it on the queue
  524. // and let the real destination window handle it.
  525. leaveMsg = true;
  526. }
  527. }
  528. else
  529. {
  530. // Mouse move occured
  531. if ( msg.message == (int)Msg.WM_MOUSEMOVE  ) 
  532. {
  533. // Is the mouse event for this popup window?
  534. if ((msg.hwnd != this.Handle && !IsChild(msg.hwnd)) )
  535. {
  536. // Eat the message to prevent the destination getting it
  537. Win32.MSG eat = new Win32.MSG();
  538. WindowsAPI.GetMessage(ref eat, 0, 0, 0);
  539. // Do not attempt to pull a message off the queue as it has already
  540. // been eaten by us in the above code
  541. leaveMsg = true;
  542. }
  543. }
  544. }
  545. // Should the message we pulled from the queue?
  546. if (!leaveMsg)
  547. {
  548. if (WindowsAPI.GetMessage(ref msg, 0, 0, 0))
  549. {
  550. WindowsAPI.TranslateMessage(ref msg);
  551. WindowsAPI.DispatchMessage(ref msg);
  552. }
  553. }
  554. else
  555. leaveMsg = false;
  556. }
  557. }
  558. }
  559. }
  560. void CalculateSafeDisplayPoint(ref Point point)
  561. {
  562. if ( parent == null )
  563. return;
  564. Rectangle rc = parent.ClientRectangle;
  565. rc = parent.RectangleToScreen(rc);
  566. int screenWidth = Screen.PrimaryScreen.Bounds.Width;
  567. int screenHeight = Screen.PrimaryScreen.Bounds.Height;
  568. // Correct x coordinate if necessary
  569. point.X = rc.Right - Width;
  570. if ( point.X < 0 )
  571. point.X = 0;
  572. else if ( point.X + Width  > screenWidth ) 
  573. point.X = screenWidth - Width;
  574.             
  575. // Correct y coordinate if necessary
  576. point.Y = rc.Bottom+1;
  577. if ( point.Y < 0 ) 
  578. point.Y = 0;
  579. else if ( point.Y + Height  > screenHeight )
  580. point.Y = rc.Top -1 - Height;
  581. }
  582. #endregion
  583. #region Component Designer generated code
  584. /// <summary> 
  585. /// Required method for Designer support - do not modify 
  586. /// the contents of this method with the code editor.
  587. /// </summary>
  588. private void InitializeComponent()
  589. {
  590. this.tabControl = new System.Windows.Forms.TabControl();
  591. this.customColorsPage = new System.Windows.Forms.TabPage();
  592. this.webColorsPage = new System.Windows.Forms.TabPage();
  593. this.systemColorsPage = new System.Windows.Forms.TabPage();
  594. this.tabControl.SuspendLayout();
  595. this.SuspendLayout();
  596. // 
  597. // tabControl
  598. // 
  599. this.tabControl.Controls.AddRange(new System.Windows.Forms.Control[] {
  600.  this.customColorsPage,
  601.  this.webColorsPage,
  602.  this.systemColorsPage});
  603. this.tabControl.Cursor = System.Windows.Forms.Cursors.Default;
  604. this.tabControl.Location = new System.Drawing.Point(0, 4);
  605. this.tabControl.Name = "tabControl";
  606. this.tabControl.SelectedIndex = 0;
  607. this.tabControl.Size = new System.Drawing.Size(200, 188);
  608. this.tabControl.TabIndex = 0;
  609. this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
  610. // 
  611. // customColorsPage
  612. // 
  613. this.customColorsPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  614. this.customColorsPage.Location = new System.Drawing.Point(4, 22);
  615. this.customColorsPage.Name = "customColorsPage";
  616. this.customColorsPage.Size = new System.Drawing.Size(192, 162);
  617. this.customColorsPage.TabIndex = 0;
  618. this.customColorsPage.Text = "Custom";
  619. this.customColorsPage.Click += new System.EventHandler(this.customColorsPage_Click);
  620. this.customColorsPage.Paint += new System.Windows.Forms.PaintEventHandler(this.customColorsPage_Paint);
  621. this.customColorsPage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.customColorsPage_MouseDown);
  622. // 
  623. // webColorsPage
  624. // 
  625. this.webColorsPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  626. this.webColorsPage.Location = new System.Drawing.Point(4, 22);
  627. this.webColorsPage.Name = "webColorsPage";
  628. this.webColorsPage.Size = new System.Drawing.Size(192, 162);
  629. this.webColorsPage.TabIndex = 1;
  630. this.webColorsPage.Text = "Web";
  631. // 
  632. // systemColorsPage
  633. // 
  634. this.systemColorsPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  635. this.systemColorsPage.Location = new System.Drawing.Point(4, 22);
  636. this.systemColorsPage.Name = "systemColorsPage";
  637. this.systemColorsPage.Size = new System.Drawing.Size(192, 162);
  638. this.systemColorsPage.TabIndex = 2;
  639. this.systemColorsPage.Text = "System";
  640. // 
  641. // ColorPickerDropDown
  642. // 
  643. this.AutoScale = false;
  644. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  645. this.ClientSize = new System.Drawing.Size(198, 215);
  646. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  647.   this.tabControl});
  648. this.ForeColor = System.Drawing.SystemColors.Control;
  649. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  650. this.Name = "ColorPickerDropDown";
  651. this.ShowInTaskbar = false;
  652. this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
  653. this.VisibleChanged += new System.EventHandler(this.ColorPickerDropDown_VisibleChanged);
  654. this.tabControl.ResumeLayout(false);
  655. this.ResumeLayout(false);
  656. }
  657. #endregion
  658. }
  659. }