Exemple #1
0
        private void layGraphicSelection(int index)
        {
            Dictionary <int, StSelection> selection = mItems[index].Selections;
            List <UserControl>            list      = new List <UserControl>();

            GRAPH_SIZE size = mTest.GetTestAttribute().SelectionSize;

            for (int i = 0; i < selection.Count; i++)
            {
                CompGraph cg = new CompGraph(size, ref mExtractor);

                int resID = mItems[index].Selections[i].ResID;

                cg.SetGraph(resID);
                cg.SetText(mItems[index].Selections[i].Casual);

                mMainWindow.amCanvas.Children.Add(cg);

                list.Add(cg);
            }

            placeComGraphSelections(CompGraph.GetVarSize(size) + 10, list);

            mMainWindow.amCanvas.Height = mVerTaken + CompGraph.GetVarSize(size) + 150;
            mSelGrp.Set(list);
        }
Exemple #2
0
        private void layGraphicCasual(int index)
        {
            GRAPH_SIZE size = mTest.GetTestAttribute().CasualSize;
            CompGraph  cg   = new CompGraph(size, ref mExtractor);

            int resID = mItems[index].ResID;

            cg.SetGraph(resID);
            cg.SetText(mItems[index].Casual);

            mMainWindow.amCanvas.Children.Add(cg);
            Canvas.SetTop(cg, 0);
            Canvas.SetLeft(cg, (mMainWindow.Width - cg.Width) / 2);

            mVerTaken += (int)cg.Height + CASUAL_ITEM_GAP;
        }
Exemple #3
0
        public static GRAPH_SIZE Str2Size(string src)
        {
            GRAPH_SIZE ret = GRAPH_SIZE.UNKNOWN;

            if (src.Equals("SMALL"))
            {
                ret = GRAPH_SIZE.SMALL;
            }
            else if (src.Equals("MEDIUM"))
            {
                ret = GRAPH_SIZE.MEDIUM;
            }
            else if (src.Equals("LARGE"))
            {
                ret = GRAPH_SIZE.LARGE;
            }

            return(ret);
        }
Exemple #4
0
        public static int Size2Number(GRAPH_SIZE size)
        {
            int retval = -1;

            switch (size)
            {
            case GRAPH_SIZE.SMALL:
                retval = 50;
                break;

            case GRAPH_SIZE.MEDIUM:
                retval = 100;
                break;

            case GRAPH_SIZE.LARGE:
                retval = 200;
                break;
            }

            return(retval);
        }
Exemple #5
0
        public static int GetVarSize(GRAPH_SIZE size)
        {
            int VAR_SIZE = 0;

            switch (size)
            {
            case GRAPH_SIZE.SMALL:
                VAR_SIZE = SIZE_SMALL;
                break;

            case GRAPH_SIZE.MEDIUM:
                VAR_SIZE = SIZE_MEDIUM;
                break;

            case GRAPH_SIZE.LARGE:
                VAR_SIZE = SIZE_LARGE;
                break;
            }

            return(VAR_SIZE);
        }
Exemple #6
0
        public CompGraph(GRAPH_SIZE size, ref ResExtractor extractor)
        {
            InitializeComponent();

            mExtractor = extractor;

            int VAR_SIZE = GetVarSize(size);

            amImage.Width  = VAR_SIZE;
            amImage.Height = VAR_SIZE;
            amLabel.Width  = VAR_SIZE;
            amLabel.Height = TEXTFIELD_HEIGHT;

            this.Height = VAR_SIZE + TEXTFIELD_HEIGHT + EDGE;
            this.Width  = VAR_SIZE + EDGE;

            Canvas.SetLeft(amImage, 0);
            Canvas.SetTop(amImage, 0);
            Canvas.SetLeft(amLabel, 0);
            Canvas.SetTop(amLabel, VAR_SIZE);

            BorderBrush = new SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 255, 255));
        }