Changeset 821 for Scheduling/trunk/cs/bsdx0200GUISourceCode
- Timestamp:
- Jul 4, 2010, 1:25:13 AM (14 years ago)
- Location:
- Scheduling/trunk/cs/bsdx0200GUISourceCode
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r614 r821 27 27 public int m_nTimeUnits; 28 28 private string m_sDocName; 29 public ArrayList m_sResourcesArray; 29 public ArrayList m_sResourcesArray; //keeps the resources 30 30 public ScheduleType m_ScheduleType; 31 31 private DateTime m_dSelectedDate; //Holds the user's selection from the dtpicker … … 201 201 DataTable rAppointmentSchedule; 202 202 203 //Nice to know that it gets set here!!! 203 204 m_dLastRefresh = DateTime.Now; 204 205 205 206 this.m_appointments.ClearAllAppointments(); 206 207 208 // calls RPC to (presumably--not sure yet) get appointments 207 209 rAppointmentSchedule = CGSchedLib.CreateAppointmentSchedule(m_DocManager, m_sResourcesArray, this.m_dStartDate, this.m_dEndDate); 208 CGSchedLib.OutputArray(rAppointmentSchedule, "rAppointmentSchedule"); 209 foreach (DataRow r in rAppointmentSchedule.Rows) 210 211 // Datatable dumper into Debug Log (nice to know that this exists) 212 CGSchedLib.OutputArray(rAppointmentSchedule, "rAppointmentSchedule"); 213 214 215 foreach (DataRow r in rAppointmentSchedule.Rows) 210 216 { 211 217 … … 279 285 // DateTime dDate = new DateTime(2001,12,05); //Testing line 280 286 DateTime dDate = DateTime.Today; 287 288 //smh: Question: Where does bRet get used? It's a useless varaible so far. 281 289 bool bRet = this.WeekNeedsRefresh(2,dDate, out this.m_dStartDate, out this.m_dEndDate); 282 290 -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r802 r821 236 236 m_ds.Refresh(); 237 237 this.Activate(); 238 System.Configuration.ConfigurationManager.GetSection("appSettings");238 // smh--not used System.Configuration.ConfigurationManager.GetSection("appSettings"); 239 239 m_ds.SetStatus("Connecting to VistA Server..."); 240 240 m_ds.Refresh(); … … 262 262 do 263 263 { 264 // login crap 264 265 try 265 266 { 267 // Not my code 266 268 if (bReLogin == true) 267 269 { … … 269 271 _current.m_ConnectInfo.LoadConnectInfo("", ""); 270 272 } 273 // My code -- buts looks so ugly! 271 274 else 272 275 { … … 337 340 } 338 341 342 //smh -- why get handles? 339 343 System.IntPtr pHandle = this.Handle; 340 344 System.IntPtr pConnHandle = this.ConnectInfo.Handle; … … 376 380 #if DEBUG 377 381 // Print console messages to console if launched from console 382 // Note: Imported From kernel32.dll 378 383 AttachConsole(ATTACH_PARENT_PROCESS); 379 384 #endif -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
r804 r821 140 140 this.Document = doc; 141 141 this.Appointments = cgAppts; 142 this.Text = this.DocManager.ConnectInfo.UserName; 142 143 // Set username and division up top 144 this.Text = this.DocManager.ConnectInfo.UserName; 143 145 if (sText != null) 144 146 this.Text += " - " + sText; … … 269 271 this.lblResource = new System.Windows.Forms.Label(); 270 272 this.panelCenter = new System.Windows.Forms.Panel(); 273 this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid(); 271 274 this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu(); 272 275 this.ctxCalGridAdd = new System.Windows.Forms.MenuItem(); … … 280 283 this.ctxCalGridWalkin = new System.Windows.Forms.MenuItem(); 281 284 this.menuItem10 = new System.Windows.Forms.MenuItem(); 285 this.ctxCalGridReprintRoutingSlip = new System.Windows.Forms.MenuItem(); 282 286 this.panelBottom = new System.Windows.Forms.Panel(); 283 287 this.statusBar1 = new System.Windows.Forms.StatusBar(); … … 285 289 this.splitter2 = new System.Windows.Forms.Splitter(); 286 290 this.printRoutingSlip = new System.Drawing.Printing.PrintDocument(); 287 this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();288 this.ctxCalGridReprintRoutingSlip = new System.Windows.Forms.MenuItem();289 291 this.panelRight.SuspendLayout(); 290 292 this.panelClip.SuspendLayout(); … … 795 797 this.panelCenter.Size = new System.Drawing.Size(668, 321); 796 798 this.panelCenter.TabIndex = 7; 797 //798 // ctxCalendarGrid799 //800 this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {801 this.ctxCalGridAdd,802 this.ctxCalGridEdit,803 this.ctxCalGridDelete,804 this.ctxCalGridCheckIn,805 this.menuItem2,806 this.ctxCalGridNoShow,807 this.ctxCalGridNoShowUndo,808 this.menuItem9,809 this.ctxCalGridWalkin,810 this.menuItem10,811 this.ctxCalGridReprintRoutingSlip});812 this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);813 //814 // ctxCalGridAdd815 //816 this.ctxCalGridAdd.Index = 0;817 this.ctxCalGridAdd.Text = "Add Appointment";818 this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);819 //820 // ctxCalGridEdit821 //822 this.ctxCalGridEdit.Index = 1;823 this.ctxCalGridEdit.Text = "Edit Appointment";824 this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);825 //826 // ctxCalGridDelete827 //828 this.ctxCalGridDelete.Index = 2;829 this.ctxCalGridDelete.Text = "Cancel Appointment";830 this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);831 //832 // ctxCalGridCheckIn833 //834 this.ctxCalGridCheckIn.Index = 3;835 this.ctxCalGridCheckIn.Text = "Check In Patient";836 this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);837 //838 // menuItem2839 //840 this.menuItem2.Index = 4;841 this.menuItem2.Text = "-";842 //843 // ctxCalGridNoShow844 //845 this.ctxCalGridNoShow.Index = 5;846 this.ctxCalGridNoShow.Text = "Mark as No Show";847 this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);848 //849 // ctxCalGridNoShowUndo850 //851 this.ctxCalGridNoShowUndo.Index = 6;852 this.ctxCalGridNoShowUndo.Text = "Undo NoShow";853 this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);854 //855 // menuItem9856 //857 this.menuItem9.Index = 7;858 this.menuItem9.Text = "-";859 //860 // ctxCalGridWalkin861 //862 this.ctxCalGridWalkin.Index = 8;863 this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";864 this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);865 //866 // menuItem10867 //868 this.menuItem10.Index = 9;869 this.menuItem10.Text = "-";870 //871 // panelBottom872 //873 this.panelBottom.Controls.Add(this.statusBar1);874 this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;875 this.panelBottom.Location = new System.Drawing.Point(136, 345);876 this.panelBottom.Name = "panelBottom";877 this.panelBottom.Size = new System.Drawing.Size(668, 24);878 this.panelBottom.TabIndex = 8;879 //880 // statusBar1881 //882 this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;883 this.statusBar1.Location = new System.Drawing.Point(0, 0);884 this.statusBar1.Name = "statusBar1";885 this.statusBar1.Size = new System.Drawing.Size(668, 24);886 this.statusBar1.SizingGrip = false;887 this.statusBar1.TabIndex = 0;888 //889 // splitter1890 //891 this.splitter1.Location = new System.Drawing.Point(128, 24);892 this.splitter1.Name = "splitter1";893 this.splitter1.Size = new System.Drawing.Size(8, 345);894 this.splitter1.TabIndex = 9;895 this.splitter1.TabStop = false;896 //897 // splitter2898 //899 this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;900 this.splitter2.Location = new System.Drawing.Point(804, 24);901 this.splitter2.Name = "splitter2";902 this.splitter2.Size = new System.Drawing.Size(3, 345);903 this.splitter2.TabIndex = 10;904 this.splitter2.TabStop = false;905 //906 // printRoutingSlip907 //908 this.printRoutingSlip.DocumentName = "Routing Slip";909 this.printRoutingSlip.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRoutingSlip_PrintPage);910 799 // 911 800 // calendarGrid1 … … 937 826 this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded); 938 827 // 828 // ctxCalendarGrid 829 // 830 this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 831 this.ctxCalGridAdd, 832 this.ctxCalGridEdit, 833 this.ctxCalGridDelete, 834 this.ctxCalGridCheckIn, 835 this.menuItem2, 836 this.ctxCalGridNoShow, 837 this.ctxCalGridNoShowUndo, 838 this.menuItem9, 839 this.ctxCalGridWalkin, 840 this.menuItem10, 841 this.ctxCalGridReprintRoutingSlip}); 842 this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup); 843 // 844 // ctxCalGridAdd 845 // 846 this.ctxCalGridAdd.Index = 0; 847 this.ctxCalGridAdd.Text = "Add Appointment"; 848 this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click); 849 // 850 // ctxCalGridEdit 851 // 852 this.ctxCalGridEdit.Index = 1; 853 this.ctxCalGridEdit.Text = "Edit Appointment"; 854 this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click); 855 // 856 // ctxCalGridDelete 857 // 858 this.ctxCalGridDelete.Index = 2; 859 this.ctxCalGridDelete.Text = "Cancel Appointment"; 860 this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click); 861 // 862 // ctxCalGridCheckIn 863 // 864 this.ctxCalGridCheckIn.Index = 3; 865 this.ctxCalGridCheckIn.Text = "Check In Patient"; 866 this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click); 867 // 868 // menuItem2 869 // 870 this.menuItem2.Index = 4; 871 this.menuItem2.Text = "-"; 872 // 873 // ctxCalGridNoShow 874 // 875 this.ctxCalGridNoShow.Index = 5; 876 this.ctxCalGridNoShow.Text = "Mark as No Show"; 877 this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click); 878 // 879 // ctxCalGridNoShowUndo 880 // 881 this.ctxCalGridNoShowUndo.Index = 6; 882 this.ctxCalGridNoShowUndo.Text = "Undo NoShow"; 883 this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click); 884 // 885 // menuItem9 886 // 887 this.menuItem9.Index = 7; 888 this.menuItem9.Text = "-"; 889 // 890 // ctxCalGridWalkin 891 // 892 this.ctxCalGridWalkin.Index = 8; 893 this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment"; 894 this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click); 895 // 896 // menuItem10 897 // 898 this.menuItem10.Index = 9; 899 this.menuItem10.Text = "-"; 900 // 939 901 // ctxCalGridReprintRoutingSlip 940 902 // … … 942 904 this.ctxCalGridReprintRoutingSlip.Text = "&Reprint Routing Slip"; 943 905 this.ctxCalGridReprintRoutingSlip.Click += new System.EventHandler(this.ctxCalGridReprintRoutingSlip_Click); 906 // 907 // panelBottom 908 // 909 this.panelBottom.Controls.Add(this.statusBar1); 910 this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom; 911 this.panelBottom.Location = new System.Drawing.Point(136, 345); 912 this.panelBottom.Name = "panelBottom"; 913 this.panelBottom.Size = new System.Drawing.Size(668, 24); 914 this.panelBottom.TabIndex = 8; 915 // 916 // statusBar1 917 // 918 this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill; 919 this.statusBar1.Location = new System.Drawing.Point(0, 0); 920 this.statusBar1.Name = "statusBar1"; 921 this.statusBar1.Size = new System.Drawing.Size(668, 24); 922 this.statusBar1.SizingGrip = false; 923 this.statusBar1.TabIndex = 0; 924 // 925 // splitter1 926 // 927 this.splitter1.Location = new System.Drawing.Point(128, 24); 928 this.splitter1.Name = "splitter1"; 929 this.splitter1.Size = new System.Drawing.Size(8, 345); 930 this.splitter1.TabIndex = 9; 931 this.splitter1.TabStop = false; 932 // 933 // splitter2 934 // 935 this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; 936 this.splitter2.Location = new System.Drawing.Point(804, 24); 937 this.splitter2.Name = "splitter2"; 938 this.splitter2.Size = new System.Drawing.Size(3, 345); 939 this.splitter2.TabIndex = 10; 940 this.splitter2.TabStop = false; 941 // 942 // printRoutingSlip 943 // 944 this.printRoutingSlip.DocumentName = "Routing Slip"; 945 this.printRoutingSlip.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRoutingSlip_PrintPage); 944 946 // 945 947 // CGView … … 2291 2293 { 2292 2294 Debug.Assert(this.InvokeRequired == false,"CGView.UpdateArrays InvokeRequired"); 2295 // This is where you set how the grid will look 2293 2296 try 2294 2297 { 2295 2298 this.calendarGrid1.AvailabilityArray = this.m_Document.AvailabilityArray; 2296 2299 this.calendarGrid1.Resources = this.m_Document.Resources; 2297 this.calendarGrid1.OnUpdateArrays(); 2300 // this.calendarGrid1.Columns = 7; //test 2301 this.calendarGrid1.StartDate = DateTime.Parse("10-10-2007"); // another test 2302 this.calendarGrid1.OnUpdateArrays(); // this draws the Calendar 2298 2303 this.lblResource.Text = this.m_Document.DocName; 2299 2304 this.calendarGrid1.Invalidate(); -
Scheduling/trunk/cs/bsdx0200GUISourceCode/CalendarGrid.cs
r622 r821 10 10 using System.Windows.Forms; 11 11 /// <summary> 12 /// This class was regenerated from Calendargrid.dll using Reflector.exe 13 /// by Sam Habiel for WorldVista. The original source code is lost. 12 /// This class is reponsible for rendering the Calendar Grid. 14 13 /// </summary> 15 14 public class CalendarGrid : Panel 16 15 { 17 private Container components;16 private IContainer components; 18 17 private Font fontArial10; 19 18 private Font fontArial8; … … 49 48 private StringFormat m_sfRight; 50 49 private ArrayList m_sResourcesArray; 51 private Timer m_Timer; 50 private Timer m_Timer; // Timeer used in Drag and Drop Operations 52 51 private ToolTip m_toolTip; 53 private const int WM_HSCROLL = 0x114; 54 private const int WM_VSCROLL = 0x115; 52 private const int WM_HSCROLL = 0x114; // Horizontal Scrolling Windows Message 53 private const int WM_VSCROLL = 0x115; // Vertical Scrolling Windows Message 55 54 56 55 public event CGAppointmentChangedHandler CGAppointmentAdded; … … 70 69 this.m_selectedRange = new CGRange(); 71 70 this.m_SelectedAppointments = new CGAppointments(); 72 this.m_dtStart = new DateTime( 0x7d3, 1, 0x1b);71 this.m_dtStart = new DateTime(2003, 1, 27); 73 72 this.m_ApptOverlapTable = new Hashtable(); 74 73 this.m_ColumnInfoTable = new Hashtable(); … … 123 122 int nColumns = this.m_nColumns; 124 123 int num2 = 60 / this.m_nTimeScale; 125 int num3 = 0x18* num2;124 int num3 = 24 * num2; 126 125 nColumns++; 127 126 num3++; … … 287 286 } 288 287 this.m_toolTip.RemoveAll(); 288 289 ////smh new code -- select cell 290 //int nRow = -1; 291 //int nCol = -1; 292 293 ////Is the mouse over a known cell? If so, highlight cell 294 //if (this.HitTest(x, y, ref nRow, ref nCol)) 295 //{ 296 // CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol); 297 // if (cellFromRowCol != null) 298 // { 299 // this.m_currentCell = cellFromRowCol; 300 // this.m_selectedRange.StartCell = null; 301 // this.m_selectedRange.EndCell = null; 302 // this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol); 303 // this.m_bSelectingRange = true; 304 // cellFromRowCol.IsSelected = true; 305 // base.Invalidate(this.m_currentCell.CellRectangle); 306 // //base.Invalidate(); 307 // } 308 //} 309 310 289 311 } 290 312 } … … 418 440 private void DrawGrid(Graphics g) 419 441 { 420 try 421 { 422 Pen pen = new Pen(Color.Black); 423 SizeF ef = g.MeasureString("Test", this.m_fCell); 424 int num = 10; 425 this.m_cellHeight = ((int) ef.Height) + num; 426 int nColumns = this.m_nColumns; 427 int num3 = 60 / this.m_nTimeScale; 428 int num4 = 0x18 * num3; 429 nColumns++; 430 num4++; 431 this.m_cellWidth = 600 / nColumns; 432 if (base.ClientRectangle.Width > 600) 433 { 434 this.m_cellWidth = (base.ClientRectangle.Width - this.m_col0Width) / (nColumns - 1); 435 } 436 if (this.m_nColumns == 1) 437 { 438 this.m_cellWidth = base.ClientRectangle.Width - this.m_col0Width; 439 } 440 base.AutoScrollMinSize = new Size(600, this.m_cellHeight * num4); 441 g.FillRectangle(Brushes.LightGray, base.ClientRectangle); 442 int num5 = 0; 443 int num6 = 0; 444 bool flag = this.m_gridCells.CellCount == 0; 445 g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y); 446 for (int i = 1; i < num4; i++) 447 { 448 int x = 0; 449 Point point = new Point(x, i * this.m_cellHeight); 450 Rectangle rectangle2 = new Rectangle(point.X, point.Y, this.m_cellWidth, this.m_cellHeight); 451 Rectangle rect = new Rectangle(0, rectangle2.Y, this.m_col0Width, rectangle2.Height * num3); 452 int height = rect.Height; 453 height = (height > (this.m_col0Width / 4)) ? (this.m_col0Width / 4) : height; 454 if (num5 == 0) 455 { 456 g.FillRectangle(Brushes.LightGray, rect); 457 g.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); 458 string str = string.Format("{0}", num6).PadLeft(2, '0'); 459 Font font = new Font("Arial", (float) height, FontStyle.Bold, GraphicsUnit.Pixel); 460 Rectangle rectangle3 = new Rectangle(rect.X, rect.Y, rect.Width / 2, rect.Height); 461 g.DrawString(str, font, Brushes.Black, rectangle3, this.m_sfHour); 462 num6++; 463 font.Dispose(); 464 } 465 string s = string.Format("{0}", num5); 466 s = ":" + s.PadLeft(2, '0'); 467 Rectangle layoutRectangle = new Rectangle(rect.X + ((rect.Width * 2) / 3), rectangle2.Top, rect.Width / 3, rectangle2.Height); 468 g.DrawString(s, this.m_fCell, Brushes.Black, layoutRectangle, this.m_sfRight); 469 Point point2 = new Point(rect.X + ((rect.Width * 2) / 3), rectangle2.Bottom); 470 Point point3 = new Point(rect.Right, rectangle2.Bottom); 471 g.DrawLine(pen, point2, point3); 472 num5 += this.m_nTimeScale; 473 num5 = (num5 >= 60) ? 0 : num5; 474 if ((i == (num4 - 1)) && !this.m_bScroll) 475 { 476 g.TranslateTransform((float) -base.AutoScrollPosition.X, (float) -base.AutoScrollPosition.Y); 477 rect = new Rectangle(0, 0, this.m_col0Width, this.m_cellHeight); 478 g.FillRectangle(Brushes.LightGray, rect); 479 g.DrawRectangle(pen, rect); 480 g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y); 481 } 482 } 483 for (int j = num4; j > -1; j--) 484 { 485 for (int k = 1; k < nColumns; k++) 486 { 487 int num12 = 0; 488 if (k == 1) 489 { 490 num12 = this.m_col0Width; 491 } 492 if (k > 1) 493 { 494 num12 = this.m_col0Width + (this.m_cellWidth * (k - 1)); 495 } 496 Point point4 = new Point(num12, j * this.m_cellHeight); 497 Rectangle r = new Rectangle(point4.X, point4.Y, this.m_cellWidth, this.m_cellHeight); 498 if (j != 0) 499 { 500 CGCell cellFromRowCol = null; 501 if (flag) 442 //Default color of grid lines is black 443 Pen pen = new Pen(Color.Black); 444 445 //each cell's height is Height of Arial Font 10pt + 10 pixels (by default 26 pixels) 446 SizeF ef = g.MeasureString("Test", this.m_fCell); 447 int num = 10; 448 this.m_cellHeight = ((int) ef.Height) + num; 449 450 // Number of columns is dynamic based on user of Grid. See Property Columns. Default 5 in init. 451 int nColumns = this.m_nColumns; 452 453 //Time scale is also dynamic. Property TimeScale. Default 20 (minutes) 454 //num3 stands for number of cells per hour 455 int num3 = 60 / this.m_nTimeScale; 456 //num4 stands for number of cells per day (aka rows in the grid) 457 int num4 = 24 * num3; 458 //Add extra column to hold time in the left hand corner 459 nColumns++; 460 //add extra row to represent dates or resources (depending on which view we are in) 461 //Not sure of which variable controls view yet. 462 num4++; 463 464 // 100 px is reserved no matter our column sizes for displaying the time scale 465 466 // Minimum cell width is 600/columns (100 px by default) 467 this.m_cellWidth = 600 / nColumns; 468 469 // if we happen to have more than 600 pixels in our Client Window then cell 470 // is (Width-100) / (number of date columns) 471 if (base.ClientRectangle.Width > 600) 472 { 473 this.m_cellWidth = (base.ClientRectangle.Width - this.m_col0Width) / (nColumns - 1); 474 } 475 476 // If we have one column, the cell width is the itself - 100 477 if (this.m_nColumns == 1) 478 { 479 this.m_cellWidth = base.ClientRectangle.Width - this.m_col0Width; 480 } 481 482 // Our rectangle will start scrolling if width is less than 600 and height less than height of all cells comb 483 // Of course Height will scroll all the time unless you have a humungous screen 484 base.AutoScrollMinSize = new Size(600, this.m_cellHeight * num4); 485 486 // Default Rectangle is Gray 487 g.FillRectangle(Brushes.LightGray, base.ClientRectangle); 488 489 int num5 = 0; //Minutes (start at 0) 490 int num6 = 0; //Hour (starts at 0) 491 492 // flag is true only if there are no cells what so ever in the screen 493 // Only true when no resource is selected. 494 bool flag = this.m_gridCells.CellCount == 0; 495 496 // Move the base point from the client screen to the scrolling region top-left corner. 497 g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y); 498 499 // For each row except the first one (i starts from 1 rather than zero) 500 for (int i = 1; i < num4; i++) 501 { 502 int x = 0; 503 //point is (0, 1st Cell Start) then (0, 2nd Cell Start) until we run out 504 Point point = new Point(x, i * this.m_cellHeight); 505 //rectangle2 represents each cell rectangle 506 Rectangle rectangle2 = new Rectangle(point.X, point.Y, this.m_cellWidth, this.m_cellHeight); 507 //rect stands for the time scale rectangle; width is 100px; Height is length of the hour on grid 508 Rectangle rect = new Rectangle(0, rectangle2.Y, this.m_col0Width, rectangle2.Height * num3); 509 //height is length of hour 510 int height = rect.Height; 511 //Min font height is 25 pixels (100/4)--see below where it's used 512 height = (height > (this.m_col0Width / 4)) ? (this.m_col0Width / 4) : height; 513 514 //if we are the top of the time scale (at hour:00) -- num5 is min 515 if (num5 == 0) 516 { 517 // Fill time scale triangle with Gray (remember, this is the whole hour!) 518 g.FillRectangle(Brushes.LightGray, rect); 519 // Draw Rectangle 520 g.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height); 521 //Pad time with at least one zero to make it 2 digits 522 string str = string.Format("{0}", num6).PadLeft(2, '0'); 523 //Font height using pixels. Min is 25 pixels 524 Font font = new Font("Arial", (float) height, FontStyle.Bold, GraphicsUnit.Pixel); 525 // rectangle3 is the left half of the time rectangle 526 Rectangle rectangle3 = new Rectangle(rect.X, rect.Y, rect.Width / 2, rect.Height); 527 // In this left half, draw the hours (m_sfHour is the stringformat: 528 // Horizontal Center and Right Justified to rectangle3 529 g.DrawString(str, font, Brushes.Black, rectangle3, this.m_sfHour); 530 // Increment hour 531 num6++; 532 font.Dispose(); 533 } 534 535 // Pad minutes with zeros to be 2 digits long 536 string s = string.Format("{0}", num5); 537 s = ":" + s.PadLeft(2, '0'); 538 // Rectangle starts at 539 // X: 2/3rds of width of Time Rectangle 540 // Y: Top of the current time slot cell 541 // Width: 1/3rd of the width of the Time Rectangle 542 // Height: Height of a time slot 543 Rectangle layoutRectangle = new Rectangle(rect.X + ((rect.Width * 2) / 3), rectangle2.Top, rect.Width / 3, rectangle2.Height); 544 // At in this rectangle, write the minutes. Horizontal Ctr and Right Justified to Rectangle 545 g.DrawString(s, this.m_fCell, Brushes.Black, layoutRectangle, this.m_sfRight); 546 Point point2 = new Point(rect.X + ((rect.Width * 2) / 3), rectangle2.Bottom); 547 Point point3 = new Point(rect.Right, rectangle2.Bottom); 548 g.DrawLine(pen, point2, point3); 549 num5 += this.m_nTimeScale; 550 num5 = (num5 >= 60) ? 0 : num5; 551 if ((i == (num4 - 1)) && !this.m_bScroll) 552 { 553 g.TranslateTransform((float) -base.AutoScrollPosition.X, (float) -base.AutoScrollPosition.Y); 554 rect = new Rectangle(0, 0, this.m_col0Width, this.m_cellHeight); 555 g.FillRectangle(Brushes.LightGray, rect); 556 g.DrawRectangle(pen, rect); 557 g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y); 558 } 559 } 560 for (int j = num4; j > -1; j--) 561 { 562 for (int k = 1; k < nColumns; k++) 563 { 564 int num12 = 0; 565 if (k == 1) 566 { 567 num12 = this.m_col0Width; 568 } 569 if (k > 1) 570 { 571 num12 = this.m_col0Width + (this.m_cellWidth * (k - 1)); 572 } 573 Point point4 = new Point(num12, j * this.m_cellHeight); 574 Rectangle r = new Rectangle(point4.X, point4.Y, this.m_cellWidth, this.m_cellHeight); 575 if (j != 0) 576 { 577 CGCell cellFromRowCol = null; 578 if (flag) 579 { 580 cellFromRowCol = new CGCell(r, j, k); 581 this.m_gridCells.AddCell(cellFromRowCol); 582 } 583 else 584 { 585 cellFromRowCol = this.m_gridCells.GetCellFromRowCol(j, k); 586 cellFromRowCol.CellRectangle = r; 587 } 588 if (this.m_sResourcesArray.Count > 0) 589 { 590 if (this.m_selectedRange.CellIsInRange(cellFromRowCol)) 502 591 { 503 cellFromRowCol = new CGCell(r, j, k); 504 this.m_gridCells.AddCell(cellFromRowCol); 592 g.FillRectangle(Brushes.Aquamarine, r); 505 593 } 506 594 else 507 595 { 508 cellFromRowCol = this.m_gridCells.GetCellFromRowCol(j, k); 509 cellFromRowCol.CellRectangle = r; 596 g.FillRectangle(cellFromRowCol.AppointmentTypeColor, r); 510 597 } 511 if (this.m_sResourcesArray.Count > 0) 598 g.DrawRectangle(pen, r.X, r.Y, r.Width, r.Height); 599 if (j == 1) 512 600 { 513 if (this.m_selectedRange.CellIsInRange(cellFromRowCol)) 601 this.DrawAppointments(g, this.m_col0Width, this.m_cellWidth, this.m_cellHeight); 602 } 603 } 604 continue; 605 } 606 if (!this.m_bScroll) 607 { 608 g.TranslateTransform(0f, (float) -base.AutoScrollPosition.Y); 609 Rectangle rectangle6 = r; 610 g.FillRectangle(Brushes.LightBlue, rectangle6); 611 g.DrawRectangle(pen, rectangle6.X, rectangle6.Y, rectangle6.Width, rectangle6.Height); 612 string str3 = ""; 613 if (this.m_sResourcesArray.Count > 1) 614 { 615 foreach (DictionaryEntry entry in this.m_ColumnInfoTable) 616 { 617 int num13 = (int) entry.Value; 618 num13++; 619 if (num13 == k) 514 620 { 515 g.FillRectangle(Brushes.Aquamarine, r); 516 } 517 else 518 { 519 g.FillRectangle(cellFromRowCol.AppointmentTypeColor, r); 520 } 521 g.DrawRectangle(pen, r.X, r.Y, r.Width, r.Height); 522 if (j == 1) 523 { 524 this.DrawAppointments(g, this.m_col0Width, this.m_cellWidth, this.m_cellHeight); 621 str3 = entry.Key.ToString(); 622 break; 525 623 } 526 624 } 527 continue; 528 } 529 if (!this.m_bScroll) 530 { 531 g.TranslateTransform(0f, (float) -base.AutoScrollPosition.Y); 532 Rectangle rectangle6 = r; 533 g.FillRectangle(Brushes.LightBlue, rectangle6); 534 g.DrawRectangle(pen, rectangle6.X, rectangle6.Y, rectangle6.Width, rectangle6.Height); 535 string str3 = ""; 536 if (this.m_sResourcesArray.Count > 1) 625 } 626 else 627 { 628 DateTime dtStart = this.m_dtStart; 629 if (k > 1) 537 630 { 538 foreach (DictionaryEntry entry in this.m_ColumnInfoTable) 539 { 540 int num13 = (int) entry.Value; 541 num13++; 542 if (num13 == k) 543 { 544 str3 = entry.Key.ToString(); 545 break; 546 } 547 } 631 dtStart = dtStart.AddDays((double) (k - 1)); 548 632 } 549 else 550 { 551 DateTime dtStart = this.m_dtStart; 552 if (k > 1) 553 { 554 dtStart = dtStart.AddDays((double) (k - 1)); 555 } 556 string format = "ddd, MMM d"; 557 str3 = dtStart.ToString(format, DateTimeFormatInfo.InvariantInfo); 558 } 559 g.DrawString(str3, this.m_fCell, Brushes.Black, rectangle6, this.m_sf); 560 g.TranslateTransform(0f, (float) base.AutoScrollPosition.Y); 561 } 562 } 563 } 564 this.m_bScroll = false; 565 pen.Dispose(); 566 } 567 catch (Exception) 568 { 569 } 633 string format = "ddd, MMM d"; 634 str3 = dtStart.ToString(format, DateTimeFormatInfo.InvariantInfo); 635 } 636 g.DrawString(str3, this.m_fCell, Brushes.Black, rectangle6, this.m_sf); 637 g.TranslateTransform(0f, (float) base.AutoScrollPosition.Y); 638 } 639 } 640 } 641 this.m_bScroll = false; 642 pen.Dispose(); 570 643 } 571 644 … … 776 849 private void InitializeComponent() 777 850 { 851 this.components = new System.ComponentModel.Container(); 852 this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); 853 this.SuspendLayout(); 854 // 855 // CalendarGrid 856 // 778 857 this.AutoScroll = true; 779 base.AutoScrollMinSize = new Size(600, 400); 780 this.BackColor = SystemColors.Window; 781 base.Paint += new PaintEventHandler(this.CalendarGrid_Paint); 782 base.MouseDown += new MouseEventHandler(this.CalendarGrid_MouseDown); 783 base.MouseUp += new MouseEventHandler(this.CalendarGrid_MouseUp); 784 base.MouseMove += new MouseEventHandler(this.CalendarGrid_MouseMove); 785 base.DragEnter += new DragEventHandler(this.CalendarGrid_DragEnter); 786 base.DragDrop += new DragEventHandler(this.CalendarGrid_DragDrop); 787 this.m_toolTip = new ToolTip(); 858 this.AutoScrollMinSize = new System.Drawing.Size(600, 400); 859 this.BackColor = System.Drawing.SystemColors.Window; 860 this.Paint += new System.Windows.Forms.PaintEventHandler(this.CalendarGrid_Paint); 861 this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.CalendarGrid_MouseMove); 862 this.DragDrop += new System.Windows.Forms.DragEventHandler(this.CalendarGrid_DragDrop); 863 this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CalendarGrid_MouseDown); 864 this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.CalendarGrid_MouseUp); 865 this.DragEnter += new System.Windows.Forms.DragEventHandler(this.CalendarGrid_DragEnter); 866 this.ResumeLayout(false); 867 788 868 } 789 869 790 870 private int MinSince80(DateTime d) 791 871 { 792 DateTime time = new DateTime( 0x7bc, 1, 1, 0, 0, 0);872 DateTime time = new DateTime(1980, 1, 1, 0, 0, 0); 793 873 TimeSpan span = (TimeSpan) (d - time); 794 874 return (int) span.TotalMinutes; … … 995 1075 this.m_ApptOverlapTable.Add(num4, 0); 996 1076 } 1077 // Here it draws the Dates on Top 997 1078 if (this.m_ApptOverlapTable.Count != 0) 998 1079 { … … 1062 1143 } 1063 1144 1145 /// <summary> 1146 /// The purpose of this is to properly draw the date boxes at the top of the calendar grid. 1147 /// Otherwise, when scrolling, it gets garbled. 1148 /// </summary> 1149 /// <param name="msg">Handles two messages: 1150 /// WM_VSCROLL (0x115 - Vertical Scrolling) 1151 /// WM_HSCROLL (0x114 - Horizontal Scrolling) 1152 /// </param> 1064 1153 protected override void WndProc(ref Message msg) 1065 1154 { 1066 1155 try 1067 1156 { 1068 if (msg.Msg == 0x115)1157 if (msg.Msg == WM_VSCROLL) 1069 1158 { 1070 1159 this.m_bScroll = true; … … 1072 1161 this.m_bScroll = false; 1073 1162 } 1074 if (msg.Msg == 0x114)1163 if (msg.Msg == WM_HSCROLL) 1075 1164 { 1076 1165 base.Invalidate(false); … … 1273 1362 } 1274 1363 } 1364 1275 1365 } 1276 1366 } -
Scheduling/trunk/cs/bsdx0200GUISourceCode/DCheckIn.cs
r804 r821 238 238 if (nRow.Length > 0) nFind = m_dtProvider.Rows.IndexOf(nRow[0]); 239 239 cboProvider.SelectedIndex = nFind; 240 241 //an experiment: LINQ 242 var defProv = from Provider in m_dtProvider.AsEnumerable() 243 where 244 Provider["DEFAULT"] == "YES" 245 select Provider; 246 240 247 } 241 248 //otherwise, just use the default provider table -
Scheduling/trunk/cs/bsdx0200GUISourceCode/bin/Release/ClinicalScheduling.XML
r804 r821 46 46 <member name="T:IndianHealthService.ClinicalScheduling.CalendarGrid"> 47 47 <summary> 48 This class was regenerated from Calendargrid.dll using Reflector.exe 49 by Sam Habiel for WorldVista. The original source code is lost. 50 </summary> 48 This class is reponsible for rendering the Calendar Grid. 49 </summary> 50 </member> 51 <member name="M:IndianHealthService.ClinicalScheduling.CalendarGrid.WndProc(System.Windows.Forms.Message@)"> 52 <summary> 53 The purpose of this is to properly draw the date boxes at the top of the calendar grid. 54 Otherwise, when scrolling, it gets garbled. 55 </summary> 56 <param name="msg">Handles two messages: 57 WM_VSCROLL (0x115 - Vertical Scrolling) 58 WM_HSCROLL (0x114 - Horizontal Scrolling) 59 </param> 51 60 </member> 52 61 <member name="T:IndianHealthService.ClinicalScheduling.DPatientLookup">
Note:
See TracChangeset
for help on using the changeset viewer.