2
0

ScrollableControl.cs 7.1 KB

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