Ignore:
Timestamp:
Mar 20, 2011, 3:22:11 AM (13 years ago)
Author:
Sam Habiel
Message:

CalendarGrid:

  • Support for Autoscrolling corrected.
  • A little optimization: Grid is only drawn once now when starting, not twice (don't know why original code did that).

CGAppointment:

  • Added member Patient (new Class)

CGDocument:

  • OnOpenDocument now accepts input of DateTime to decide where to open document.
  • SlotsAvailable algorithm now includes code for scaling according to timescale and code to merge Blocks if they are adjacent.

CGDocumentManager:

  • Fix bug having to do with canceling log-in after first retry. BMX lib threw an exception which was not caught.

CGView: Many changes:

  • SlotsAvailable signature changed in CGDocument. All references to it had to be changed.
  • Opening a node in the tvSchedules by clicking on the plus sign did not select it. Code changes to make it select it.
  • UpdateStatusBar now uses a string builder; and shows a more comprehensive message on the availability in the Status Bar.
  • Focus issues on various controls.
  • Support for printing a slip after an appointment is made automatically has been added.

CustomPrinting:

  • now includes a method to print a single appointment slip

DAppointPage:

  • Checkbox to decide whether to print appt slip added.
  • New readonly property to get the appointment that has been made (of type CGAppointment).

DApptSearch:

  • StartDate and EndDate now autoadjust based on each other.
  • lblMessage added to show user message if no appointments are found.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs

    r1095 r1106  
    2424        private bool m_bDrawWalkIns = true;
    2525        private bool m_bGridEnter;
    26         private bool m_bInitialUpdate;
     26        //private bool m_bInitialUpdate;
    2727        private bool m_bMouseDown;
    2828        private bool m_bScroll;
     
    4949        private StringFormat m_sfRight;
    5050        private ArrayList m_sResourcesArray;
    51         private Timer m_Timer;                  // Timeer used in Drag and Drop Operations
     51        private Timer m_Timer;                  // Timer used in Drag and Drop Operations
    5252        private ToolTip m_toolTip;
    5353        private const int WM_HSCROLL = 0x114;       // Horizontal Scrolling Windows Message
    5454        private const int WM_VSCROLL = 0x115;       // Vertical Scrolling Windows Message
    5555        private const int WM_MOUSEWHEEL = 0x20a;    // Windows Mouse Scrolling Message
     56        private System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
     57
    5658
    5759        public delegate void CGAppointmentChangedHandler(object sender, CGAppointmentChangedArgs e);
     
    9092            this.m_sfHour.LineAlignment = StringAlignment.Center;
    9193            this.m_sfHour.Alignment = StringAlignment.Far;
    92             this.m_bInitialUpdate = false;
     94            // this.m_bInitialUpdate = false;
    9395        }
    9496
     
    113115            {
    114116                this.m_Timer.Stop();
     117                this.m_Timer.Tick -= new EventHandler(this.tickEventHandler);
    115118                this.m_Timer.Dispose();
    116119                this.m_Timer = null;
     
    232235        private void CalendarGrid_MouseDown(object sender, MouseEventArgs e)
    233236        {
     237            //watch.Restart();
    234238            if (e.Button == MouseButtons.Left)
    235239            {
     
    247251        private void CalendarGrid_MouseMove(object Sender, MouseEventArgs e)
    248252        {
     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...
    249258            if (this.m_bMouseDown)
    250259            {
     260                //if Y axis is outside the top or bottom
    251261                if ((e.Y >= base.ClientRectangle.Bottom) || (e.Y <= base.ClientRectangle.Top))
    252262                {
     263                    //start auto scrolling. m_bScrollDown decides whether we scroll up or down.
    253264                    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)
    255269                if ((e.Y < base.ClientRectangle.Bottom) && (e.Y > base.ClientRectangle.Top))
    256270                {
    257                     bool bAutoDrag = this.m_bAutoDrag;
     271                    AutoDragStop();
    258272                }
    259273                if (this.m_bSelectingRange)
     
    278292            else
    279293            {
     294                //test
     295                AutoDragStop(); //is this needed?
     296                //test
    280297                int y = e.Y - base.AutoScrollPosition.Y;
    281298                int x = e.X - base.AutoScrollPosition.X;
     
    348365            {
    349366                this.DrawGrid(e.Graphics);
     367                /*
    350368                if (!this.m_bInitialUpdate)
    351369                {
     
    354372                    this.m_bInitialUpdate = true;
    355373                }
     374                 */
    356375            }
    357376        }
     
    602621                        if (this.m_sResourcesArray.Count > 0)
    603622                        {
     623                            //IMP
     624                            //this is the place where we the selected cells are drawn in Light Light Blue.
     625                            //IMP
    604626                            if (this.m_selectedRange.CellIsInRange(cellFromRowCol))
    605627                            {
    606628                                g.FillRectangle(Brushes.Aquamarine, r);
     629                                //g.FillRectangle(Brushes.AntiqueWhite, r);
    607630                            }
    608631                            else
     
    11421165        }
    11431166
     1167        /// <summary>
     1168        /// Handles scrolling when the mouse button is down
     1169        /// </summary>
     1170        /// <param name="o"></param>
     1171        /// <param name="e"></param>
    11441172        private void tickEventHandler(object o, EventArgs e)
    11451173        {
     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
    11461177            Point point = new Point(base.AutoScrollPosition.X, base.AutoScrollPosition.Y);
    11471178            int x = point.X;
    11481179            int num = point.Y * -1;
    1149             num = this.m_bScrollDown ? (num + 5) : (num - 5);
     1180            num = this.m_bScrollDown ? (num + 2) : (num - 2);
    11501181            point.Y = num;
    11511182            base.AutoScrollPosition = point;
Note: See TracChangeset for help on using the changeset viewer.