Пример #1
0
        ///<summary>This is, of course, called when module refreshed.  But it's also called when user sets missing teeth or tooth movements.  In that case, the Progress notes are not refreshed, so it's a little faster.  This also fills in the movement amounts.</summary>
        private void FillToothChart()
        {
            Cursor = Cursors.WaitCursor;
            toothChart.SuspendLayout();
            List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ChartGraphicColors);

            toothChart.ColorBackground    = listDefs[10].ItemColor;
            toothChart.ColorText          = listDefs[11].ItemColor;
            toothChart.ColorTextHighlight = listDefs[12].ItemColor;
            toothChart.ColorBackHighlight = listDefs[13].ItemColor;
            //remember which teeth were selected
            List <string> selectedTeeth = new List <string>(toothChart.SelectedTeeth);

            //ArrayList selectedTeeth=new ArrayList();//integers 1-32
            //for(int i=0;i<toothChart.SelectedTeeth.Length;i++) {
            //	selectedTeeth.Add(Tooth.ToInt(toothChart.SelectedTeeth[i]));
            //}
            toothChart.ResetTeeth();

            /*if(PatCur==null) {
             *      toothChart.ResumeLayout();
             *      FillMovementsAndHidden();
             *      Cursor=Cursors.Default;
             *      return;
             * }*/
            if (ShowBySelectedTeeth)
            {
                for (int i = 0; i < selectedTeeth.Count; i++)
                {
                    toothChart.SetSelected(selectedTeeth[i], true);
                }
            }
            //first, primary.  That way, you can still set a primary tooth missing afterwards.
            for (int i = 0; i < ToothInitialList.Count; i++)
            {
                if (ToothInitialList[i].InitialType == ToothInitialType.Primary)
                {
                    toothChart.SetPrimary(ToothInitialList[i].ToothNum);
                }
            }
            for (int i = 0; i < ToothInitialList.Count; i++)
            {
                switch (ToothInitialList[i].InitialType)
                {
                case ToothInitialType.Missing:
                    toothChart.SetMissing(ToothInitialList[i].ToothNum);
                    break;

                case ToothInitialType.Hidden:
                    toothChart.SetHidden(ToothInitialList[i].ToothNum);
                    break;

                //case ToothInitialType.Primary:
                //	break;
                case ToothInitialType.Rotate:
                    toothChart.MoveTooth(ToothInitialList[i].ToothNum, ToothInitialList[i].Movement, 0, 0, 0, 0, 0);
                    break;

                case ToothInitialType.TipM:
                    toothChart.MoveTooth(ToothInitialList[i].ToothNum, 0, ToothInitialList[i].Movement, 0, 0, 0, 0);
                    break;

                case ToothInitialType.TipB:
                    toothChart.MoveTooth(ToothInitialList[i].ToothNum, 0, 0, ToothInitialList[i].Movement, 0, 0, 0);
                    break;

                case ToothInitialType.ShiftM:
                    toothChart.MoveTooth(ToothInitialList[i].ToothNum, 0, 0, 0, ToothInitialList[i].Movement, 0, 0);
                    break;

                case ToothInitialType.ShiftO:
                    toothChart.MoveTooth(ToothInitialList[i].ToothNum, 0, 0, 0, 0, ToothInitialList[i].Movement, 0);
                    break;

                case ToothInitialType.ShiftB:
                    toothChart.MoveTooth(ToothInitialList[i].ToothNum, 0, 0, 0, 0, 0, ToothInitialList[i].Movement);
                    break;

                case ToothInitialType.Drawing:
                    toothChart.AddDrawingSegment(ToothInitialList[i].Copy());
                    break;
                }
            }
            DrawProcGraphics();
            toothChart.ResumeLayout();
            //FillMovementsAndHidden();
            Cursor = Cursors.Default;
        }