Ejemplo n.º 1
0
        public static swc.PageRangeSelection ToSWC(this PrintSelection value)
        {
            switch (value)
            {
            case PrintSelection.AllPages:
                return(swc.PageRangeSelection.AllPages);

            case PrintSelection.SelectedPages:
                return(swc.PageRangeSelection.UserPages);

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 2
0
        public static Gtk.PrintPages ToGtk(this PrintSelection value)
        {
            switch (value)
            {
            case PrintSelection.AllPages:
                return(Gtk.PrintPages.All);

            case PrintSelection.SelectedPages:
                return(Gtk.PrintPages.Ranges);

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 3
0
        public static sdp.PrintRange ToSDP(this PrintSelection value)
        {
            switch (value)
            {
            case PrintSelection.AllPages:
                return(sdp.PrintRange.AllPages);

            case PrintSelection.SelectedPages:
                return(sdp.PrintRange.SomePages);

            case PrintSelection.Selection:
                return(sdp.PrintRange.Selection);

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 4
0
        protected void PrintGUI()
        {
            //Top Space
            EditorGUILayout.Space();

            //Header
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(new GUIContent("Projections", "The possible Projections to print & the method used to select amongst them."), GUILayout.MaxWidth(120));
            GUILayout.FlexibleSpace();
            int printSize = EditorGUILayout.IntSlider(new GUIContent("", "The number of projections available to print"), prints.Length, 1, 10, GUILayout.MaxWidth(120));

            if (printLayers == null || printLayers.Length != printSize)
            {
                if (printLayers == null)
                {
                    printLayers = new LayerMask[printSize];
                }
                else
                {
                    printLayers = printLayers.Resize(printSize);
                }
            }
            if (printTags == null || printTags.Length != printSize)
            {
                if (printTags == null)
                {
                    printTags = new string[printSize];
                }
                else
                {
                    printTags = printTags.Resize(printSize);
                }
            }
            if (prints == null || prints.Length != printSize)
            {
                if (prints == null)
                {
                    prints = new ProjectionRenderer[printSize];
                }
                else
                {
                    prints = prints.Resize(printSize);
                }
            }
            EditorGUILayout.EndHorizontal();

            //Body
            EditorGUI.indentLevel++;
            //Selection method is only relevant if theres more than 1 print to choose from
            if (prints.Length > 1)
            {
                printMethod = (PrintSelection)EditorGUILayout.EnumPopup(new GUIContent("Selection Method"), printMethod);
                EditorGUILayout.Space();
            }

            //Prints
            for (int i = 0; i < prints.Length; i++)
            {
                if (prints.Length > 1 && printLayers.Length > 1 && printMethod == PrintSelection.Layer)
                {
                    EditorGUILayout.BeginHorizontal();
                    prints[i]      = (ProjectionRenderer)EditorGUILayout.ObjectField(new GUIContent("", "Projection to print"), prints[i], typeof(ProjectionRenderer), false);
                    printLayers[i] = EditorGUILayout.LayerField(new GUIContent("", "Layer to print on"), printLayers[i], GUILayout.Width(100));
                    EditorGUILayout.EndHorizontal();
                }
                else if (prints.Length > 1 && printLayers.Length > 1 && printMethod == PrintSelection.Tag)
                {
                    EditorGUILayout.BeginHorizontal();
                    prints[i] = (ProjectionRenderer)EditorGUILayout.ObjectField(new GUIContent("", "Projection to print"), prints[i], typeof(ProjectionRenderer), false);
                    if (i == 0)
                    {
                        EditorGUILayout.LabelField(new GUIContent("Default", "Tag to print on"), GUILayout.Width(100));
                    }
                    else
                    {
                        printTags[i] = EditorGUILayout.TagField(new GUIContent("", "Tag to print on"), printTags[i], GUILayout.Width(100));
                    }
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    prints[i] = (ProjectionRenderer)EditorGUILayout.ObjectField(new GUIContent("", "Projection to print"), prints[i], typeof(ProjectionRenderer), false);
                }
            }
            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
        }