- Timestamp:
- Mar 20, 2011, 3:22:11 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs
r1095 r1106 24 24 private bool m_bDrawWalkIns = true; 25 25 private bool m_bGridEnter; 26 private bool m_bInitialUpdate;26 //private bool m_bInitialUpdate; 27 27 private bool m_bMouseDown; 28 28 private bool m_bScroll; … … 49 49 private StringFormat m_sfRight; 50 50 private ArrayList m_sResourcesArray; 51 private Timer m_Timer; // Time er used in Drag and Drop Operations51 private Timer m_Timer; // Timer used in Drag and Drop Operations 52 52 private ToolTip m_toolTip; 53 53 private const int WM_HSCROLL = 0x114; // Horizontal Scrolling Windows Message 54 54 private const int WM_VSCROLL = 0x115; // Vertical Scrolling Windows Message 55 55 private const int WM_MOUSEWHEEL = 0x20a; // Windows Mouse Scrolling Message 56 private System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch(); 57 56 58 57 59 public delegate void CGAppointmentChangedHandler(object sender, CGAppointmentChangedArgs e); … … 90 92 this.m_sfHour.LineAlignment = StringAlignment.Center; 91 93 this.m_sfHour.Alignment = StringAlignment.Far; 92 this.m_bInitialUpdate = false;94 // this.m_bInitialUpdate = false; 93 95 } 94 96 … … 113 115 { 114 116 this.m_Timer.Stop(); 117 this.m_Timer.Tick -= new EventHandler(this.tickEventHandler); 115 118 this.m_Timer.Dispose(); 116 119 this.m_Timer = null; … … 232 235 private void CalendarGrid_MouseDown(object sender, MouseEventArgs e) 233 236 { 237 //watch.Restart(); 234 238 if (e.Button == MouseButtons.Left) 235 239 { … … 247 251 private void CalendarGrid_MouseMove(object Sender, MouseEventArgs e) 248 252 { 253 //test 254 //System.Diagnostics.Debug.Write(watch.ElapsedMilliseconds + "\n"); 255 //test 256 257 //if the left mouse button is down and we are moving the mouse... 249 258 if (this.m_bMouseDown) 250 259 { 260 //if Y axis is outside the top or bottom 251 261 if ((e.Y >= base.ClientRectangle.Bottom) || (e.Y <= base.ClientRectangle.Top)) 252 262 { 263 //start auto scrolling. m_bScrollDown decides whether we scroll up or down. 253 264 this.m_bScrollDown = e.Y >= base.ClientRectangle.Bottom; 254 } 265 AutoDragStart(); 266 } 267 268 //if Y axis within client rectagle, stop dragging (whether you started or not) 255 269 if ((e.Y < base.ClientRectangle.Bottom) && (e.Y > base.ClientRectangle.Top)) 256 270 { 257 bool bAutoDrag = this.m_bAutoDrag;271 AutoDragStop(); 258 272 } 259 273 if (this.m_bSelectingRange) … … 278 292 else 279 293 { 294 //test 295 AutoDragStop(); //is this needed? 296 //test 280 297 int y = e.Y - base.AutoScrollPosition.Y; 281 298 int x = e.X - base.AutoScrollPosition.X; … … 348 365 { 349 366 this.DrawGrid(e.Graphics); 367 /* 350 368 if (!this.m_bInitialUpdate) 351 369 { … … 354 372 this.m_bInitialUpdate = true; 355 373 } 374 */ 356 375 } 357 376 } … … 602 621 if (this.m_sResourcesArray.Count > 0) 603 622 { 623 //IMP 624 //this is the place where we the selected cells are drawn in Light Light Blue. 625 //IMP 604 626 if (this.m_selectedRange.CellIsInRange(cellFromRowCol)) 605 627 { 606 628 g.FillRectangle(Brushes.Aquamarine, r); 629 //g.FillRectangle(Brushes.AntiqueWhite, r); 607 630 } 608 631 else … … 1142 1165 } 1143 1166 1167 /// <summary> 1168 /// Handles scrolling when the mouse button is down 1169 /// </summary> 1170 /// <param name="o"></param> 1171 /// <param name="e"></param> 1144 1172 private void tickEventHandler(object o, EventArgs e) 1145 1173 { 1174 //if there are still WM_TIME messages in the Queue after the timer is dead, don't do anything. 1175 if (this.m_Timer == null) return; 1176 1146 1177 Point point = new Point(base.AutoScrollPosition.X, base.AutoScrollPosition.Y); 1147 1178 int x = point.X; 1148 1179 int num = point.Y * -1; 1149 num = this.m_bScrollDown ? (num + 5) : (num - 5);1180 num = this.m_bScrollDown ? (num + 2) : (num - 2); 1150 1181 point.Y = num; 1151 1182 base.AutoScrollPosition = point;
Note:
See TracChangeset
for help on using the changeset viewer.