ScrollableControl.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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.2 $
  27. // $Modtime: $
  28. // $Log: ScrollableControl.cs,v $
  29. // Revision 1.2 2004/08/11 22:20:59 pbartok
  30. // - Signature fixes
  31. //
  32. // Revision 1.1 2004/07/09 05:21:25 pbartok
  33. // - Initial check-in
  34. //
  35. //
  36. // NOT COMPLETE
  37. using System;
  38. using System.ComponentModel;
  39. using System.Drawing;
  40. namespace System.Windows.Forms {
  41. public class ScrollableControl : Control {
  42. #region Public Constructors
  43. public ScrollableControl() {
  44. }
  45. #endregion // Public Constructors
  46. #region Protected Static Fields
  47. protected const int ScrollStateAutoScrolling = 1;
  48. protected const int ScrollStateFullDrag = 16;
  49. protected const int ScrollStateHScrollVisible = 2;
  50. protected const int ScrollStateUserHasScrolled = 8;
  51. protected const int ScrollStateVScrollVisible= 4;
  52. #endregion // Protected Static Fields
  53. #region Subclass DockPaddingEdges
  54. public class DockPaddingEdges : ICloneable {
  55. #region DockPaddingEdges Local Variables
  56. private int all;
  57. private int left;
  58. private int right;
  59. private int top;
  60. private int bottom;
  61. #endregion // DockPaddingEdges Local Variables
  62. #region DockPaddingEdges Constructor
  63. private DockPaddingEdges() {
  64. }
  65. #endregion // DockPaddingEdges Constructor
  66. #region DockPaddingEdges Public Instance Properties
  67. public int All {
  68. get {
  69. return all;
  70. }
  71. set {
  72. all=value;
  73. }
  74. }
  75. public int Bottom {
  76. get {
  77. return bottom;
  78. }
  79. set {
  80. bottom=value;
  81. }
  82. }
  83. public int Left {
  84. get {
  85. return left;
  86. }
  87. set {
  88. left=value;
  89. }
  90. }
  91. public int Right {
  92. get {
  93. return right;
  94. }
  95. set {
  96. right=value;
  97. }
  98. }
  99. public int Top {
  100. get {
  101. return top;
  102. }
  103. set {
  104. top=value;
  105. }
  106. }
  107. #endregion // DockPaddingEdges Public Instance Properties
  108. // Public Instance Methods
  109. public override bool Equals(object other) {
  110. if (! (other is DockPaddingEdges)) {
  111. return false;
  112. }
  113. if ( (this.all == ((DockPaddingEdges)other).all) && (this.left == ((DockPaddingEdges)other).left) &&
  114. (this.right == ((DockPaddingEdges)other).right) && (this.top == ((DockPaddingEdges)other).top) &&
  115. (this.bottom == ((DockPaddingEdges)other).bottom)) {
  116. return true;
  117. }
  118. return false;
  119. }
  120. public override int GetHashCode() {
  121. return all*top*bottom*right*left;
  122. }
  123. public override string ToString() {
  124. return "All = "+all.ToString()+" Top = "+top.ToString()+" Left = "+left.ToString()+" Bottom = "+bottom.ToString()+" Right = "+right.ToString();
  125. }
  126. object ICloneable.Clone() {
  127. DockPaddingEdges padding_edge;
  128. padding_edge=new DockPaddingEdges();
  129. padding_edge.all=all;
  130. padding_edge.left=left;
  131. padding_edge.right=right;
  132. padding_edge.top=top;
  133. padding_edge.bottom=bottom;
  134. return padding_edge;
  135. }
  136. }
  137. #endregion
  138. #region Subclass DockPaddingEdgesConverter
  139. public class DockPaddingEdgesConverter : System.ComponentModel.TypeConverter {
  140. // Public Constructors
  141. public DockPaddingEdgesConverter() {
  142. }
  143. // Public Instance Methods
  144. public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes) {
  145. throw new NotImplementedException();
  146. }
  147. public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
  148. throw new NotImplementedException();
  149. }
  150. }
  151. #endregion
  152. #region Public Instance Properties
  153. public virtual bool AutoScroll {
  154. get {
  155. throw new NotImplementedException();
  156. }
  157. set {
  158. throw new NotImplementedException();
  159. }
  160. }
  161. public Size AutoScrollMargin {
  162. get {
  163. throw new NotImplementedException();
  164. }
  165. set {
  166. throw new NotImplementedException();
  167. }
  168. }
  169. public Size AutoScrollMinSize {
  170. get {
  171. throw new NotImplementedException();
  172. }
  173. set {
  174. throw new NotImplementedException();
  175. }
  176. }
  177. public Point AutoScrollPosition {
  178. get {
  179. throw new NotImplementedException();
  180. }
  181. set {
  182. throw new NotImplementedException();
  183. }
  184. }
  185. public override Rectangle DisplayRectangle {
  186. get {
  187. return base.DisplayRectangle;
  188. throw new NotImplementedException();
  189. }
  190. }
  191. public DockPaddingEdges DockPadding {
  192. get {
  193. throw new NotImplementedException();
  194. }
  195. }
  196. #endregion // Public Instance Properties
  197. #region Protected Instance Methods
  198. protected override CreateParams CreateParams {
  199. get {
  200. return base.CreateParams;
  201. }
  202. }
  203. protected bool HScroll {
  204. get {
  205. throw new NotImplementedException();
  206. }
  207. set {
  208. throw new NotImplementedException();
  209. }
  210. }
  211. protected bool VScroll {
  212. get {
  213. throw new NotImplementedException();
  214. }
  215. set {
  216. throw new NotImplementedException();
  217. }
  218. }
  219. #endregion // Protected Instance Methods
  220. #region Public Instance Methods
  221. public void ScrollControlIntoView(Control activeControl) {
  222. }
  223. public void SetAutoScrollMargin(int x, int y) {
  224. }
  225. #endregion // Public Instance Methods
  226. #region Protected Instance Methods
  227. protected virtual void AdjustFormScrollbars(bool displayScrollbars) {
  228. }
  229. protected bool GetScrollState(int bit) {
  230. throw new NotImplementedException();
  231. }
  232. protected override void OnLayout(LayoutEventArgs levent) {
  233. base.OnLayout(levent);
  234. return;
  235. throw new NotImplementedException();
  236. }
  237. protected override void OnMouseWheel(MouseEventArgs e) {
  238. throw new NotImplementedException();
  239. }
  240. protected override void OnVisibleChanged(EventArgs e) {
  241. throw new NotImplementedException();
  242. }
  243. protected override void ScaleCore(float dx, float dy) {
  244. throw new NotImplementedException();
  245. }
  246. protected void SetDisplayRectLocation(int x, int y) {
  247. throw new NotImplementedException();
  248. }
  249. protected void SetScrollState(int bit, bool value) {
  250. throw new NotImplementedException();
  251. }
  252. protected override void WndProc(ref Message m) {
  253. base.WndProc(ref m);
  254. }
  255. #endregion // Protected Instance Methods
  256. }
  257. }