StatusBarPanel.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //
  2. // System.Windows.Forms.StatusBarPanel
  3. //
  4. // Author:
  5. // stubbed out by Richard Baumann ([email protected])
  6. // Dennis Hayes ([email protected])
  7. //
  8. // (C) Ximian, Inc., 2002
  9. //
  10. using System;
  11. using System.ComponentModel;
  12. using System.Drawing;
  13. namespace System.Windows.Forms {
  14. /// <summary>
  15. /// Represents a panel in a StatusBar control.
  16. /// </summary>
  17. public class StatusBarPanel : Component, ISupportInitialize {
  18. //
  19. // --- Private Fields
  20. //
  21. private HorizontalAlignment alignment;
  22. private StatusBarPanelAutoSize autoSize;
  23. private StatusBarPanelBorderStyle borderStyle;
  24. private Icon icon;
  25. private int minWidth;
  26. private StatusBar parent;
  27. private StatusBarPanelStyle style;
  28. private string text;
  29. private string toolTipText;
  30. private int width;
  31. //
  32. // --- Constructors/Destructors
  33. //
  34. StatusBarPanel() : base()
  35. {
  36. alignment = HorizontalAlignment.Left;
  37. autoSize = StatusBarPanelAutoSize.None;
  38. borderStyle = StatusBarPanelBorderStyle.Sunken;
  39. icon = null;
  40. minWidth = 10;
  41. style = StatusBarPanelStyle.Text;
  42. text = "";
  43. toolTipText = "";
  44. width = 100;
  45. }
  46. //
  47. // --- Public Methods
  48. //
  49. [MonoTODO]
  50. public void BeginInit()
  51. {
  52. throw new NotImplementedException ();
  53. }
  54. [MonoTODO]
  55. public void EndInit()
  56. {
  57. throw new NotImplementedException ();
  58. }
  59. public override string ToString()
  60. {
  61. return text;
  62. }
  63. //
  64. // --- Protected Methods
  65. //
  66. //inherited
  67. //protected override void Dispose(bool disposing)
  68. //{
  69. // throw new NotImplementedException ();
  70. //}
  71. //
  72. // --- Public Properties
  73. //
  74. public HorizontalAlignment Alignment {
  75. get { return alignment; }
  76. set { alignment = value; }
  77. }
  78. public StatusBarPanelAutoSize AutoSize {
  79. get { return autoSize; }
  80. set
  81. {
  82. if (value != StatusBarPanelAutoSize.None && value != StatusBarPanelAutoSize.Contents && value != StatusBarPanelAutoSize.Spring) {
  83. throw new InvalidEnumArgumentException("System.Windows.Forms.StatusBarPanel::set_AutoSize(StatusBarPanelAutoSize) " +
  84. "value is not a valid StatusBarPanelAutoSize value");
  85. }
  86. autoSize = value;
  87. }
  88. }
  89. public StatusBarPanelBorderStyle BorderStyle {
  90. get { return borderStyle; }
  91. set { borderStyle = value; }
  92. }
  93. public Icon Icon {
  94. get { return icon; }
  95. set { icon = value; }
  96. }
  97. public int MinWidth {
  98. get { return minWidth; }
  99. set { minWidth = value; }
  100. }
  101. public StatusBar Parent {
  102. get { return parent; }
  103. set { parent = value; }
  104. }
  105. public StatusBarPanelStyle Style {
  106. get { return style; }
  107. set { style = value; }
  108. }
  109. public string Text {
  110. get { return text; }
  111. set { text = value; }
  112. }
  113. public string ToolTipText {
  114. get { return toolTipText; }
  115. set { toolTipText = value; }
  116. }
  117. public int Width {
  118. get { return width; }
  119. set { width = value; }
  120. }
  121. }
  122. }