ScrollableControl.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2004 Novell, Inc.
  21. //
  22. // Authors:
  23. // Peter Bartok [email protected]
  24. //
  25. //
  26. // $Revision: 1.1 $
  27. // $Modtime: $
  28. // $Log: ScrollableControl.cs,v $
  29. // Revision 1.1 2004/07/09 05:21:25 pbartok
  30. // - Initial check-in
  31. //
  32. //
  33. // NOT COMPLETE
  34. using System;
  35. using System.ComponentModel;
  36. using System.Drawing;
  37. namespace System.Windows.Forms {
  38. public class ScrollableControl : Control {
  39. #region Public Constructors
  40. public ScrollableControl() {
  41. }
  42. #endregion // Public Constructors
  43. #region Protected Static Fields
  44. protected const int ScrollStateAutoScrolling = 1;
  45. protected const int ScrollStateFullDrag = 16;
  46. protected const int ScrollStateHScrollVisible = 2;
  47. protected const int ScrollStateUserHasScrolled = 8;
  48. protected const int ScrollStateVScrollVisible= 4;
  49. #endregion // Protected Static Fields
  50. #region Subclass DockPaddingEdges
  51. public class DockPaddingEdges : ICloneable {
  52. // Local Variables;
  53. private int all;
  54. private int left;
  55. private int right;
  56. private int top;
  57. private int bottom;
  58. // Public Instance Properties
  59. public int All {
  60. get {
  61. return all;
  62. }
  63. set {
  64. all=value;
  65. }
  66. }
  67. public int Bottom {
  68. get {
  69. return bottom;
  70. }
  71. set {
  72. bottom=value;
  73. }
  74. }
  75. public int Left {
  76. get {
  77. return left;
  78. }
  79. set {
  80. left=value;
  81. }
  82. }
  83. public int Right {
  84. get {
  85. return right;
  86. }
  87. set {
  88. right=value;
  89. }
  90. }
  91. public int Top {
  92. get {
  93. return top;
  94. }
  95. set {
  96. top=value;
  97. }
  98. }
  99. public static bool operator == (DockPaddingEdges obj_a, DockPaddingEdges obj_b) {
  100. if ( (obj_a.all == obj_b.all) && (obj_a.left == obj_b.left) &&
  101. (obj_a.right == obj_b.right) && (obj_a.top == obj_b.top) &&
  102. (obj_a.bottom == obj_b.bottom)) {
  103. return true;
  104. }
  105. return false;
  106. }
  107. public static bool operator != (DockPaddingEdges obj_a, DockPaddingEdges obj_b) {
  108. return !(obj_a==obj_b);
  109. }
  110. // Public Instance Methods
  111. public override bool Equals(object other) {
  112. if (! (other is DockPaddingEdges)) {
  113. return false;
  114. }
  115. return (this==(DockPaddingEdges)other);
  116. }
  117. public override int GetHashCode() {
  118. return all*top*bottom*right*left;
  119. }
  120. public override string ToString() {
  121. return "All = "+all.ToString()+" Top = "+top.ToString()+" Left = "+left.ToString()+" Bottom = "+bottom.ToString()+" Right = "+right.ToString();
  122. }
  123. object ICloneable.Clone() {
  124. DockPaddingEdges padding_edge;
  125. padding_edge=new DockPaddingEdges();
  126. padding_edge.all=all;
  127. padding_edge.left=left;
  128. padding_edge.right=right;
  129. padding_edge.top=top;
  130. padding_edge.bottom=bottom;
  131. return padding_edge;
  132. }
  133. }
  134. #endregion
  135. #region Subclass DockPaddingEdgesConverter
  136. public class DockPaddingEdgesConverter : System.ComponentModel.TypeConverter {
  137. // Public Constructors
  138. public DockPaddingEdgesConverter() {
  139. }
  140. // Public Instance Methods
  141. public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes) {
  142. throw new NotImplementedException();
  143. }
  144. public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
  145. throw new NotImplementedException();
  146. }
  147. }
  148. #endregion
  149. #region Public Instance Properties
  150. public virtual bool AutoScroll {
  151. get {
  152. throw new NotImplementedException();
  153. }
  154. set {
  155. throw new NotImplementedException();
  156. }
  157. }
  158. public Size AutoScrollMargin {
  159. get {
  160. throw new NotImplementedException();
  161. }
  162. set {
  163. throw new NotImplementedException();
  164. }
  165. }
  166. public Size AutoScrollMinSize {
  167. get {
  168. throw new NotImplementedException();
  169. }
  170. set {
  171. throw new NotImplementedException();
  172. }
  173. }
  174. public Point AutoScrollPosition {
  175. get {
  176. throw new NotImplementedException();
  177. }
  178. set {
  179. throw new NotImplementedException();
  180. }
  181. }
  182. public override Rectangle DisplayRectangle {
  183. get {
  184. throw new NotImplementedException();
  185. }
  186. }
  187. public DockPaddingEdges DockPadding {
  188. get {
  189. throw new NotImplementedException();
  190. }
  191. }
  192. #endregion // Public Instance Properties
  193. #region Protected Instance Methods
  194. protected override CreateParams CreateParams {
  195. get {
  196. return base.CreateParams;
  197. }
  198. }
  199. protected bool HScroll {
  200. get {
  201. throw new NotImplementedException();
  202. }
  203. set {
  204. throw new NotImplementedException();
  205. }
  206. }
  207. protected bool VScroll {
  208. get {
  209. throw new NotImplementedException();
  210. }
  211. set {
  212. throw new NotImplementedException();
  213. }
  214. }
  215. #endregion // Protected Instance Methods
  216. #region Public Instance Methods
  217. public void ScrollControlIntoView(Control activeControl) {
  218. }
  219. public void SetAutoScrollMargin(int x, int y) {
  220. }
  221. #endregion // Public Instance Methods
  222. #region Protected Instance Methods
  223. protected virtual void AdjustFormScrollbars(bool displayScrollbars) {
  224. }
  225. protected bool GetScrollState(int bit) {
  226. throw new NotImplementedException();
  227. }
  228. protected override void OnLayout(LayoutEventArgs levent) {
  229. throw new NotImplementedException();
  230. }
  231. protected override void OnMouseWheel(MouseEventArgs e) {
  232. throw new NotImplementedException();
  233. }
  234. protected override void OnVisibleChanged(EventArgs e) {
  235. throw new NotImplementedException();
  236. }
  237. protected override void ScaleCore(float dx, float dy) {
  238. throw new NotImplementedException();
  239. }
  240. protected void SetDisplayRectLocation(int x, int y) {
  241. throw new NotImplementedException();
  242. }
  243. protected void SetScrollState(int bit, bool value) {
  244. throw new NotImplementedException();
  245. }
  246. protected override void WndProc(ref Message m) {
  247. base.WndProc(ref m);
  248. }
  249. #endregion // Protected Instance Methods
  250. }
  251. }