Пример #1
0
        ///<summary>Returns true if the given directXFormat works for a DirectX tooth chart on the local computer.</summary>
        public static bool TestDirectXFormat(Form callingForm, string directXFormat)
        {
            ToothChartWrapper toothChartTest = new ToothChartWrapper();

            toothChartTest.Visible = false;
            //We add the invisible tooth chart to our form so that the device context will initialize properly
            //and our device creation test will then be accurate.
            callingForm.Controls.Add(toothChartTest);
            toothChartTest.DeviceFormat = new ToothChartDirectX.DirectXDeviceFormat(directXFormat);
            toothChartTest.DrawMode     = DrawingMode.DirectX;      //Creates the device.
            if (toothChartTest.DrawMode == DrawingMode.Simple2D)
            {
                //The chart is set back to 2D mode when there is an error initializing.
                callingForm.Controls.Remove(toothChartTest);
                toothChartTest.Dispose();
                return(false);
            }
            //Now we check to be sure that one can draw and retrieve a screen shot from a DirectX control
            //using the specified device format.
            try {
                Bitmap screenShot = toothChartTest.GetBitmap();
                screenShot.Dispose();
            }
            catch {
                callingForm.Controls.Remove(toothChartTest);
                toothChartTest.Dispose();
                return(false);
            }
            callingForm.Controls.Remove(toothChartTest);
            toothChartTest.Dispose();
            return(true);
        }
Пример #2
0
 public static void InitializeOnStartup(ContrChart contrChart, TabControl tabProc, ODGrid gridProg, Panel panelEcw,
                                        TabControl tabControlImages, Size ClientSize,
                                        ODGrid gridPtInfo, ToothChartWrapper toothChart, RichTextBox textTreatmentNotes, OpenDental.UI.Button butECWup,
                                        OpenDental.UI.Button butECWdown, TabPage tabPatInfo, TrackBar trackBar, Label textTrack)
 {
     tabProc.SelectedIndex = 0;
     tabProc.Height        = 259;
     if (UsingEcwTightOrFull())
     {
         toothChart.Location         = new Point(524 + 2, 26);
         trackBar.Location           = new Point(524 + 2 + textTrack.Width, toothChart.Bottom + 1);
         textTrack.Location          = new Point(524 + 2, toothChart.Bottom + 1);
         textTreatmentNotes.Location = new Point(524 + 2, trackBar.Bottom + 1);
         textTreatmentNotes.Size     = new Size(411, 40);         //make it a bit smaller than usual
         gridPtInfo.Visible          = false;
         panelEcw.Visible            = true;
         panelEcw.Location           = new Point(524 + 2, textTreatmentNotes.Bottom + 1);
         panelEcw.Size       = new Size(411, tabControlImages.Top - panelEcw.Top + 1);
         butECWdown.Location = butECWup.Location;              //they will be at the same location, but just hide one or the other.
         butECWdown.Visible  = false;
         tabProc.Location    = new Point(0, 28);
         gridProg.Location   = new Point(0, tabProc.Bottom + 2);
         gridProg.Height     = ClientSize.Height - gridProg.Location.Y - 2;
     }
     else              //normal:
     {
         toothChart.Location         = new Point(0, 26);
         trackBar.Location           = new Point(0 + textTrack.Width, toothChart.Bottom + 1);
         textTrack.Location          = new Point(0, toothChart.Bottom + 1);
         textTreatmentNotes.Location = new Point(0, trackBar.Bottom + 1);
         textTreatmentNotes.Size     = new Size(411, 71);
         gridPtInfo.Visible          = true;
         gridPtInfo.Location         = new Point(0, textTreatmentNotes.Bottom + 1);
         panelEcw.Visible            = false;
         tabProc.Location            = new Point(415, 28);
         gridProg.Location           = new Point(415, tabProc.Bottom + 2);
         gridProg.Height             = ClientSize.Height - gridProg.Location.Y - 2;
         SetToothChartVisibleHelper(toothChart, textTreatmentNotes, trackBar, textTrack);
     }
     if (Programs.UsingOrion)
     {
         textTreatmentNotes.Visible = false;
         contrChart.Controls.Remove(gridPtInfo);
         gridPtInfo.Visible  = true;
         gridPtInfo.Location = new Point(0, 0);
         gridPtInfo.Size     = new Size(tabPatInfo.ClientSize.Width, tabPatInfo.ClientSize.Height);
         gridPtInfo.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
         tabPatInfo.Controls.Add(gridPtInfo);
         tabProc.SelectedTab     = tabPatInfo;
         tabProc.Height          = toothChart.Height - 1;
         gridProg.Location       = new Point(0, trackBar.Bottom + 2);
         gridProg.HScrollVisible = true;
         gridProg.Height         = ClientSize.Height - gridProg.Location.Y - 2;
         gridProg.Width          = ClientSize.Width - gridProg.Location.X - 1; //full width
     }
     else
     {
         tabProc.TabPages.Remove(tabPatInfo);
     }
 }
Пример #3
0
 ///<summary>If medical only, this will hide the tooth chart and fill the space with the treatement notes text box.  Not for eCWTightOrFull.
 ///This is made public so that it can be called from ContrChart.</summary>
 public static void SetToothChartVisibleHelper(ToothChartWrapper toothChart, RichTextBox textTreatmentNotes, TrackBar trackBar, Label textTrack)
 {
     if (Clinics.IsMedicalPracticeOrClinic(Clinics.ClinicNum))
     {
         toothChart.Visible          = false;
         trackBar.Visible            = false;
         textTrack.Visible           = false;
         textTreatmentNotes.Location = new Point(0, toothChart.Top);
         textTreatmentNotes.Height   = toothChart.Height + 72;          //textTreatmentNotes height is 71, +1 for distance between toothChart and textTreatmentNotes
     }
     else
     {
         toothChart.Visible          = true;
         trackBar.Visible            = true;
         textTrack.Visible           = true;
         textTreatmentNotes.Location = new Point(0, trackBar.Bottom + 1);
         textTreatmentNotes.Height   = 71;
     }
 }
Пример #4
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     SparksToothChart.ToothChartData toothChartData1          = new SparksToothChart.ToothChartData();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormToothChartingBig));
     this.toothChart = new SparksToothChart.ToothChartWrapper();
     this.SuspendLayout();
     //
     // toothChart
     //
     this.toothChart.AutoFinish                 = false;
     this.toothChart.ColorBackground            = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(145)))), ((int)(((byte)(152)))));
     this.toothChart.Cursor                     = System.Windows.Forms.Cursors.Default;
     this.toothChart.CursorTool                 = SparksToothChart.CursorTool.Pointer;
     this.toothChart.DeviceFormat               = null;
     this.toothChart.Dock                       = System.Windows.Forms.DockStyle.Fill;
     this.toothChart.DrawMode                   = OpenDentBusiness.DrawingMode.Simple2D;
     this.toothChart.Location                   = new System.Drawing.Point(0, 0);
     this.toothChart.Name                       = "toothChart";
     this.toothChart.PerioMode                  = false;
     this.toothChart.PreferredPixelFormatNumber = 0;
     this.toothChart.Size                       = new System.Drawing.Size(926, 858);
     this.toothChart.TabIndex                   = 0;
     toothChartData1.SizeControl                = new System.Drawing.Size(926, 858);
     this.toothChart.TcData                     = toothChartData1;
     this.toothChart.UseHardware                = false;
     //
     // FormToothChartingBig
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(926, 858);
     this.Controls.Add(this.toothChart);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name          = "FormToothChartingBig";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.WindowState   = System.Windows.Forms.FormWindowState.Maximized;
     this.FormClosed   += new System.Windows.Forms.FormClosedEventHandler(this.FormToothChartingBig_FormClosed);
     this.Load         += new System.EventHandler(this.FormToothChartingBig_Load);
     this.ResizeEnd    += new System.EventHandler(this.FormToothChartingBig_ResizeEnd);
     this.ResumeLayout(false);
 }
Пример #5
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     SparksToothChart.ToothChartData toothChartData1 = new SparksToothChart.ToothChartData();
     this.toothChart = new SparksToothChart.ToothChartWrapper();
     this.SuspendLayout();
     //
     // toothChart
     //
     this.toothChart.AutoFinish                 = false;
     this.toothChart.ColorBackground            = System.Drawing.Color.Empty;
     this.toothChart.CursorTool                 = SparksToothChart.CursorTool.Pointer;
     this.toothChart.Dock                       = System.Windows.Forms.DockStyle.Fill;
     this.toothChart.DrawMode                   = OpenDentBusiness.DrawingMode.Simple2D;
     this.toothChart.Location                   = new System.Drawing.Point(0, 0);
     this.toothChart.Name                       = "toothChart";
     this.toothChart.PerioMode                  = false;
     this.toothChart.PreferredPixelFormatNumber = 0;
     this.toothChart.Size                       = new System.Drawing.Size(926, 858);
     this.toothChart.TabIndex                   = 0;
     toothChartData1.SizeControl                = new System.Drawing.Size(926, 858);
     this.toothChart.TcData                     = toothChartData1;
     this.toothChart.UseHardware                = false;
     //
     // FormToothChartingBig
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(926, 858);
     this.Controls.Add(this.toothChart);
     this.Name          = "FormToothChartingBig";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.WindowState   = System.Windows.Forms.FormWindowState.Maximized;
     this.Load         += new System.EventHandler(this.FormToothChartingBig_Load);
     this.FormClosed   += new System.Windows.Forms.FormClosedEventHandler(this.FormToothChartingBig_FormClosed);
     this.ResizeEnd    += new System.EventHandler(this.FormToothChartingBig_ResizeEnd);
     this.ResumeLayout(false);
 }
Пример #6
0
 public static void Resize(ODGrid gridProg, Panel panelImages, Panel panelEcw, TabControl tabControlImages, Size ClientSize, ODGrid gridPtInfo, ToothChartWrapper toothChart, TextBox textTreatmentNotes)
 {
     if (ProgramC.HListIsNull())
     {
         return;
     }
     if (UsingEcwTight())
     {
         //gridProg.Width=524;
         if (gridProg.Columns != null && gridProg.Columns.Count > 0)
         {
             int gridW = 0;
             for (int i = 0; i < gridProg.Columns.Count; i++)
             {
                 gridW += gridProg.Columns[i].ColWidth;
             }
             if (gridW < 524)                   //for example, if not very many columns
             {
                 gridW = 524;
             }
             if (gridW + 20 + toothChart.Width < ClientSize.Width)                 //if space is big enough to allow full width
             {
                 gridProg.Width = gridW + 20;
             }
             else
             {
                 if (ClientSize.Width > 0)                       //prevents an error
                 {
                     if (ClientSize.Width - toothChart.Width - 1 < 524)
                     {
                         gridProg.Width = 524;
                     }
                     else
                     {
                         gridProg.Width = ClientSize.Width - toothChart.Width - 1;
                     }
                 }
             }
             //now, bump the other controls over
             toothChart.Location         = new Point(gridProg.Width + 2, 26);
             textTreatmentNotes.Location = new Point(gridProg.Width + 2, toothChart.Bottom + 1);
             panelEcw.Location           = new Point(gridProg.Width + 2, textTreatmentNotes.Bottom + 1);
         }
         if (panelImages.Visible)
         {
             panelEcw.Height = tabControlImages.Top - panelEcw.Top + 1 - (panelImages.Height + 2);
         }
         else
         {
             panelEcw.Height = tabControlImages.Top - panelEcw.Top + 1;
         }
         return;
     }
     if (Programs.UsingOrion)             //full width
     {
         gridProg.Width = ClientSize.Width - gridProg.Location.X - 1;
     }
     else if (gridProg.Columns != null && gridProg.Columns.Count > 0)
     {
         int gridW = 0;
         for (int i = 0; i < gridProg.Columns.Count; i++)
         {
             gridW += gridProg.Columns[i].ColWidth;
         }
         if (gridProg.Location.X + gridW + 20 < ClientSize.Width)             //if space is big enough to allow full width
         {
             gridProg.Width = gridW + 20;
         }
         else
         {
             if (ClientSize.Width > gridProg.Location.X)                   //prevents an error
             {
                 gridProg.Width = ClientSize.Width - gridProg.Location.X - 1;
             }
         }
     }
     if (Programs.UsingOrion)
     {
         //gridPtInfo is up in the tabs and does not need to be resized.
     }
     else
     {
         gridPtInfo.Height = tabControlImages.Top - gridPtInfo.Top;
     }
 }
Пример #7
0
 public static void SetGridProgWidth(ODGrid gridProg, Size ClientSize, Panel panelEcw, TextBox textTreatmentNotes, ToothChartWrapper toothChart)
 {
     if (UsingEcwTight())
     {
         //gridProg.Width=524;
         if (gridProg.Columns != null && gridProg.Columns.Count > 0)
         {
             int gridW = 0;
             for (int i = 0; i < gridProg.Columns.Count; i++)
             {
                 gridW += gridProg.Columns[i].ColWidth;
             }
             if (gridW < 524)                   //for example, if not very many columns
             {
                 gridW = 524;
             }
             if (gridW + 20 + toothChart.Width < ClientSize.Width)                 //if space is big enough to allow full width
             {
                 gridProg.Width = gridW + 20;
             }
             else
             {
                 if (ClientSize.Width > 0)                       //prevents an error
                 {
                     if (ClientSize.Width - toothChart.Width - 1 < 524)
                     {
                         gridProg.Width = 524;
                     }
                     else
                     {
                         gridProg.Width = ClientSize.Width - toothChart.Width - 1;
                     }
                 }
             }
             //now, bump the other controls over
             toothChart.Location         = new Point(gridProg.Width + 2, 26);
             textTreatmentNotes.Location = new Point(gridProg.Width + 2, toothChart.Bottom + 1);
             panelEcw.Location           = new Point(gridProg.Width + 2, textTreatmentNotes.Bottom + 1);
         }
         else
         {
             gridProg.Width = 524;
         }
         return;
     }
     if (Programs.UsingOrion)             //full width
     {
         gridProg.Width = ClientSize.Width - gridProg.Location.X - 1;
     }
     else if (gridProg.Columns != null && gridProg.Columns.Count > 0)
     {
         int gridW = 0;
         for (int i = 0; i < gridProg.Columns.Count; i++)
         {
             gridW += gridProg.Columns[i].ColWidth;
         }
         if (gridProg.Location.X + gridW + 20 < ClientSize.Width)             //if space is big enough to allow full width
         {
             gridProg.Width = gridW + 20;
         }
         else
         {
             gridProg.Width = ClientSize.Width - gridProg.Location.X - 1;
         }
     }
 }