ScrollableControl.cs 7.1 KB

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