예제 #1
0
        static public bool DrawSinglebar(ToolbarType type)
        {
            Rect rect = GUILayoutUtility.GetRect(4f, 13f, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(true)
            });

            float xMax = rect.xMax;
            float num  = xMax - 8f;

            num -= 25f;

            Rect rect1 = new Rect(num + 4, rect.y - 3f, 25f, 13f);

            GUIContent iconContent = null;

            switch (type)
            {
            case ToolbarType.Plus:
                iconContent = EditorHelper.iconToolbarPlus;
                break;

            case ToolbarType.Minus:
                iconContent = EditorHelper.iconToolbarMinus;
                break;
            }
            return(GUI.Button(rect1, iconContent, EditorHelper.preButtonStyle));
        }
    void OnGUI()
    {
        EditorGUILayout.BeginVertical();
        target = EditorGUILayout.ObjectField("Target: ", target, typeof(GameObject), true) as GameObject;
        EditorGUILayout.Space();
        list.DoLayoutList();
        EditorGUILayout.Space();
        activeToolbar = (ToolbarType)GUILayout.Toolbar((int)activeToolbar, toolbarStrings);
        switch (activeToolbar)
        {
        case ToolbarType.Changed:
            changedScrollPos = EditorGUILayout.BeginScrollView(changedScrollPos);
            ListDetails(changedSprites);
            EditorGUILayout.EndScrollView();
            break;

        case ToolbarType.Missing:
            missingScrollPos = EditorGUILayout.BeginScrollView(missingScrollPos);
            ListDetails(missingSprites);
            EditorGUILayout.EndScrollView();
            break;
        }
        if (GUILayout.Button("Analyze"))
        {
            changedSprites.Clear();
            missingSprites.Clear();
            Analyze();
            GUIUtility.hotControl      = 0;
            GUIUtility.keyboardControl = 0;
        }
        EditorGUILayout.EndVertical();
    }
예제 #3
0
        private void SetUpItemCollection(Dictionary <string, List <IActionHandler> > register,
                                         string key,
                                         ToolStripItemCollection collection,
                                         ToolbarType type)
        {
            List <IActionHandler> actions;

            if (register.TryGetValue(key, out actions))
            {
                List <ToolStripItem> dropDownItems = new List <ToolStripItem>(actions.Count);
                foreach (IActionHandler ah in actions)
                {
                    // TODO ND: Changed
                    ToolStripItem item = CreateItem(ah, type);
                    dropDownItems.Add(item);
                    // TODO ND: Changed
                    if (item is ToolStripDropDownItem)
                    {
                        SetUpItemCollection(register, ah.Id, ((ToolStripDropDownItem)item).DropDownItems, type);
                    }
                }

                //sort by OrderIndex and add to the collection
                dropDownItems.Sort(CompareToolStripItemsBySortOrder);
                collection.AddRange(dropDownItems.ToArray());

                register.Remove(key);
            }
            else
            {
                register.Remove(key);
            }
        }
    public static string GetSunStatusMessage(ToolbarType toolbarType, SunStudyData sunStudyData, string message)
    {
        // Set status message if sun study dials are open
        string statusMessage = toolbarType == ToolbarType.AltitudeAzimuthDial ? AltitudeAzimuthRadialUIController.GetAltAzStatusMessage(sunStudyData) :
                               toolbarType == ToolbarType.TimeOfDayYearDial ? TimeRadialUIController.GetTimeStatusMessage(sunStudyData) : message;

        return(statusMessage);
    }
예제 #5
0
        void OnStateDataChanged(UIStateData stateData)
        {
            if (m_currentActiveToolbar == stateData.activeToolbar)
            {
                return;
            }

            m_OrbitSidebar.SetActive(false);
            m_FlySidebar.SetActive(false);
            m_WalkSidebar.SetActive(false);
            m_ARSidebar.SetActive(false);
            m_ARModelAlignViewSidebar.SetActive(false);
            m_ARInstructionSidebar.SetActive(false);
            m_TimeOfDayYearRadial.Close();
            m_AltitudeAzimuthRadial.Close();
            m_ARScaleRadial.Close();

            switch (stateData.activeToolbar)
            {
            case ToolbarType.FlySidebar:
                m_FlySidebar.SetActive(true);
                break;

            case ToolbarType.WalkSidebar:
                m_WalkSidebar.SetActive(true);
                break;

            case ToolbarType.ARSidebar:
                m_ARSidebar.SetActive(true);
                break;

            case ToolbarType.ARModelAlignSidebar:
                m_ARModelAlignViewSidebar.SetActive(true);
                break;

            case ToolbarType.ARInstructionSidebar:
                m_ARInstructionSidebar.SetActive(true);
                break;

            case ToolbarType.TimeOfDayYearDial:
                m_TimeOfDayYearRadial.Open();
                break;

            case ToolbarType.AltitudeAzimuthDial:
                m_AltitudeAzimuthRadial.Open();
                break;

            case ToolbarType.ARScaleDial:
                m_ARScaleRadial.Open();
                break;

            default:
                m_OrbitSidebar.SetActive(true);
                break;
            }

            m_currentActiveToolbar = stateData.activeToolbar;
        }
예제 #6
0
 private Editor(String controlName, String content, String width, String height, String editorPath, ToolbarType toolbarType)
 {
     _controlName = String.Format("{0}", controlName);
     _content     = content;
     _width       = width;
     _height      = height;
     _editorPath  = editorPath;
     _Toolbar     = toolbarType;
 }
예제 #7
0
 private Editor( String controlName, String content, String width, String height, String editorPath, ToolbarType toolbarType )
 {
     _controlName = String.Format( "{0}", controlName );
     _content = content;
     _width = width;
     _height = height;
     _editorPath = editorPath;
     _Toolbar = toolbarType;
 }
예제 #8
0
        void OnStateDataChanged(UIStateData data)
        {
            m_HourDialControl.selectedValue  = GetFloatFromMin(data.sunStudyData.timeOfDay);
            m_MonthDialControl.selectedValue = GetFloatFromDay(data.sunStudyData.timeOfYear);

            if (data.activeToolbar != ToolbarType.TimeOfDayYearDial && data.activeToolbar != ToolbarType.AltitudeAzimuthDial)
            {
                m_previousToolbar = data.activeToolbar;
            }
        }
예제 #9
0
 private static void ApplyVisualStyle(ToolStrip strip, ToolbarType type)
 {
     if (type == ToolbarType.Menu)
     {
         //hide grip to avoid ability of moving the toolbar
         strip.GripStyle = ToolStripGripStyle.Hidden;
         //stretch the toolbar accross the whole available space of its parent container
         strip.Stretch = true;
     }
     else
     {
         //TODO set normal toolbar specific style
     }
 }
예제 #10
0
        static public bool DrawSinglebar(ToolbarType type, Rect rect)
        {
            float xMax = rect.xMax;
            float num  = xMax;

            num -= 25f;
            Rect       rect1       = new Rect(num + 4, rect.y - 3f, 25f, 13f);
            GUIContent iconContent = null;

            switch (type)
            {
            case ToolbarType.Plus:
                iconContent = EditorHelper.iconToolbarPlus;
                break;

            case ToolbarType.Minus:
                iconContent = EditorHelper.iconToolbarMinus;
                break;
            }
            return(GUI.Button(rect1, iconContent, EditorHelper.preButtonStyle));
        }
예제 #11
0
 public void Awake()
 {
     if (Instance == null)
         Instance = this;
     // Get the toolbar type from the settings
     Type = getTypeFromString(Main.Settings.get<string>("ToolbarType"));
     if (Type == ToolbarType.NONE) { return; }
     else if (Type == ToolbarType.STOCK || (Type == ToolbarType.BLIZZY && !ToolbarManager.ToolbarAvailable))
     {
         if (ApplicationLauncher.Ready)
             onGUIApplicationLauncherReady();
         else
             GameEvents.onGUIApplicationLauncherReady.Add(onGUIApplicationLauncherReady);
     }
     else
     {
         IButton _button = ToolbarManager.Instance.add("ClampsBeGone", "ClampsBeGone");
         _button.TexturePath = "iPeer/ClampsBeGone/Texturees/000";
         _button.OnClick += (e) => { Main.GUIManager.toggleGUI(); };
     }
 }
예제 #12
0
        private EditorToolbar GetToolbar(EditorType eType, EditorConfiguration config, EditorSettings settings, ModuleEditorSettings mSettings)
        {
            ToolbarType tType = View.Toolbar;

            if (tType == ToolbarType.bySettings)
            {
                tType = (mSettings != null) ? mSettings.ToolbarType : (settings != null) ? settings.ToolbarType : config.DefaultEditor.ToolbarType;
                switch (eType)
                {
                case EditorType.none:
                case EditorType.textarea:
                    tType = ToolbarType.none;
                    break;

                case EditorType.lite:
                    tType = (tType == ToolbarType.full || tType == ToolbarType.advanced) ? ToolbarType.simple : tType;
                    break;
                }
            }
            View.Toolbar = tType;
            return(config.AvailableToolbars.Where(t => t.ToolbarType == tType && t.EditorType == eType).FirstOrDefault());
        }
예제 #13
0
        private void FormMain_MouseClick(object sender, MouseEventArgs e)
        {
            if (ScreenshotStatus != ScreenshotStatus.Screenshoting)
            {
                return;
            }

            if (OperatorStatus == OperatorStatus.FinishedSelect && MoveSelectRectState == MoveSelectRectState.None)
            {
                if (toolbarRect.Contains(e.Location))
                {
                    int         toolbarHeight = 40;
                    int         count         = (e.Location.X - toolbarRect.Left) / toolbarHeight;
                    ToolbarType toolbarType   = (ToolbarType)count;

                    switch (toolbarType)
                    {
                    case ToolbarType.Save:
                        toolbarSave_Click();
                        break;

                    case ToolbarType.Cancel:
                        toolbarCancele_Click();
                        break;

                    case ToolbarType.OK:
                        toolbarOK_Click();
                        break;

                    case ToolbarType.Edit:
                        toolbarEdit_Click();
                        break;
                    }
                }
            }
        }
예제 #14
0
        /// <summary>
        /// 创建编辑器(页面中第一个)
        /// </summary>
        /// <param name="controlName"></param>
        /// <param name="content"></param>
        /// <param name="height"></param>
        /// <param name="editorPath"></param>
        /// <param name="jsVersion"></param>
        /// <param name="toolbarType"></param>
        /// <returns></returns>
        public static Editor NewOne(String controlName, String content, String height, String editorPath, String jsVersion, ToolbarType toolbarType)
        {
            Editor result = new Editor(controlName, content, "100%", height, editorPath, toolbarType);

            result._isUnique  = true;
            result._jsVersion = jsVersion;
            return(result);
        }
예제 #15
0
		public ToolBase AddTool(string key, string caption, ToolbarType type, int index, string parentTool, bool addSeparator)
		{
            return AddTool(key, caption, type, index, parentTool, addSeparator, null, null);
		}
예제 #16
0
        private void FillStrip(ToolStrip strip, ICollection <IActionHandler> actions, ToolbarType type, bool ignoreParents)
        {
            Dictionary <string, List <IActionHandler> > itemRegister =
                new Dictionary <string, List <IActionHandler> >();

            if (actions.Count > 0)
            {
                if (ignoreParents)
                {
                    foreach (IActionHandler ah in actions)
                    {
                        if (ah != null)
                        {
                            if (!string.IsNullOrEmpty(ah.RetargetId) && ah.ActionType.Equals(ActionHandlerType.Standard))
                            {
                                // do nothing, because then this action will be encapsulated by an RetargetActionHandler
                            }
                            else
                            {
                                strip.Items.Add(CreateItem(ah, type));
                            }
                        }
                    }
                }
                else
                {
                    foreach (IActionHandler ah in actions)
                    {
                        if (ah != null)
                        {
                            List <IActionHandler> children;
                            if (itemRegister.TryGetValue(ah.Parent, out children))
                            {
                                children.Add(ah);
                            }
                            else
                            {
                                children = new List <IActionHandler>();
                                children.Add(ah);
                                itemRegister.Add(ah.Parent, children);
                            }
                        }
                    }

                    SetUpItemCollection(itemRegister, string.Empty, strip.Items, type);
                    ApplyVisualStyle(strip, type);
                }

                //the following Block removes all previously added items, sorts them and adds them again.
                //TODO:better add them in the right order in the first run (see big if statement above) -PJR-

                List <ToolStripItem> itemList = new List <ToolStripItem>();
                foreach (ToolStripItem item in strip.Items)
                {
                    itemList.Add(item);
                }
                //itemList.Sort(CompareToolStripItemsBySortOrder);
                strip.Items.Clear();
                strip.Items.AddRange(itemList.ToArray());
            }
        }
예제 #17
0
        private ToolStripItem CreateItem(IActionHandler actionHandler, ToolbarType type, object contextObject)
        {
            ToolStripItem item;

            switch (actionHandler.Style)
            {
            case ActionStyle.MenuItem:
                item = new ToolStripMenuItem();
                break;

            case ActionStyle.Push:
                item        = new ToolStripMenuItem();
                item.Click += RunAction;
                break;

            case ActionStyle.Radio:
                //TODO: create Radio button ...
                item = new ToolStripMenuItem();                         //HACK
                break;

            case ActionStyle.Toggle:
                //TODO: create Checkbox ...
                item = new ToolStripMenuItem();                         //HACK
                ((ToolStripMenuItem)item).CheckOnClick = true;
                break;

            case ActionStyle.Pulldown:
                //TODO: create ListBox ...
                item = new ToolStripMenuItem();                         //HACK
                break;

            case ActionStyle.Separator:
                item = new ToolStripSeparator();
                break;

            default:
                item = new ToolStripMenuItem();
                return(item);
            }

            item.Tag  = actionHandler;
            item.Text = actionHandler.Label;
            if (!string.IsNullOrEmpty(actionHandler.IconId))
            {
                item.Image = m_IconResourceService.GetBitmap(actionHandler.IconId);
            }

            switch (type)
            {
            case ToolbarType.Menu:
            {
                item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                break;
            }

            case ToolbarType.Toolbar:
            {
                item.DisplayStyle = ToolStripItemDisplayStyle.Image;
                break;
            }

            default:
            {
                item.DisplayStyle = ToolStripItemDisplayStyle.Image;
                break;
            }
            }

            return(item);
        }
예제 #18
0
 private ToolStripItem CreateItem(IActionHandler actionHandler, ToolbarType type)
 {
     return(CreateItem(actionHandler, type, null));
 }
예제 #19
0
		public ToolBase AddTool(string key, string caption, ToolbarType type, string parentTool)
		{
			return AddTool(key, caption, type, int.MinValue, parentTool, false);
		}
예제 #20
0
		public ToolBase AddTool(string key, ToolbarType type, int index)
		{
			return AddTool(key, key, type, index, string.Empty, false);
		}
예제 #21
0
		public ToolBase AddTool(string key, string caption, ToolbarType type)
		{
			return AddTool(key, caption, type, string.Empty);
		}
예제 #22
0
		private ToolBase getTool(string key, ToolbarType type)
		{
            ToolBase _tool;

            if (_toolbarsManager.Tools.Exists(key))
                _tool = _toolbarsManager.Tools[key];
            else
            {
                switch (type)
                {
                    case ToolbarType.Button:
                        _tool = new ButtonTool(key);
                        break;
                    case ToolbarType.PopUpMenu:
                        _tool = new PopupMenuTool(key);
                        break;
                    case ToolbarType.RibbonTab:
                        _tool = new ButtonTool(key);
                        break;
                    default:
                        _tool = new ButtonTool(key);
                        break;
                }

                _toolbarsManager.Tools.Add(_tool);
            }

            return _tool;
		}
예제 #23
0
        public void Init( String propertyName, String propertyValue, String height, Editor.ToolbarType toolbar )
        {
            _controlName = propertyName;
            _content = propertyValue;
            _height = height;
            _Toolbar = toolbar;

            _width = "100%";
            _editorPath = sys.Path.Editor;

            _isUnique = true;
            _jsVersion = MvcConfig.Instance.JsVersion;
        }
예제 #24
0
 public Toolbar(string id, ToolbarType toolbarType) : this(id)
 {
     this.toolbarType = toolbarType;
 }
예제 #25
0
 public int typeAsInt(ToolbarType type)
 {
     switch (type)
     {
         case ToolbarType.STOCK:
             return 1;
         case ToolbarType.BLIZZY:
             return 2;
         default:
             return 0;
     }
 }
예제 #26
0
 /// <summary>
 /// �����༭��(ҳ���е�һ��)
 /// </summary>
 /// <param name="controlName"></param>
 /// <param name="content"></param>
 /// <param name="height"></param>
 /// <param name="editorPath"></param>
 /// <param name="jsVersion"></param>
 /// <param name="toolbarType"></param>
 /// <returns></returns>
 public static Editor NewOne( String controlName, String content, String height, String editorPath, String jsVersion, ToolbarType toolbarType )
 {
     Editor result = new Editor( controlName, content, "100%", height, editorPath, toolbarType );
     result._isUnique = true;
     result._jsVersion = jsVersion;
     return result;
 }
예제 #27
0
        public ToolBase AddTool(string key, string caption, ToolbarType type, int index, string parentTool, bool addSeparator, object imageSmall, object imageLarge)
        {
            ToolBase tool = getTool(key, type);
            if (type == ToolbarType.Button || type == ToolbarType.PopUpMenu)
            {
                if (!_toolbarsManager.Toolbars[_toolbarName].Tools.Exists(key))
                {
                    if (parentTool == string.Empty)
                    {
                        tool.SharedProps.Caption = caption;
                        tool.SharedProps.Category = "Generale";

                        if (addSeparator)
                            tool.InstanceProps.IsFirstInGroup = true;
                        if (!_toolbarsManager.Tools.Exists(key))
                            _toolbarsManager.Tools.Add(tool);
                        if (index == int.MinValue)
                            _toolbarsManager.Toolbars[_toolbarName].Tools.AddTool(key);
                        else
                            _toolbarsManager.Toolbars[_toolbarName].Tools.InsertTool(index, key);
                        _toolbarsManager.Toolbars[_toolbarName].Tools[key].InstanceProps.IsFirstInGroup = addSeparator;
                        if (imageSmall != null)
                            tool.SharedProps.AppearancesSmall.Appearance.Image = imageSmall;
                        if (imageLarge != null)
                            tool.SharedProps.AppearancesLarge.Appearance.Image = imageLarge;
                    }
                    else
                    {
                        tool.SharedProps.Caption = caption;
                        tool.SharedProps.Category = "Generale";

                        if (!((Infragistics.Win.UltraWinToolbars.PopupMenuTool)_toolbarsManager.Tools[parentTool]).Tools.Exists(key))
                            ((Infragistics.Win.UltraWinToolbars.PopupMenuTool)_toolbarsManager.Tools[parentTool]).Tools.Add(tool);
                        ((Infragistics.Win.UltraWinToolbars.PopupMenuTool)_toolbarsManager.Tools[parentTool]).Tools[key].InstanceProps.IsFirstInGroup = addSeparator;
                        if (imageSmall != null)
                            tool.SharedProps.AppearancesSmall.Appearance.Image = imageSmall;
                        if (imageLarge != null)
                            tool.SharedProps.AppearancesLarge.Appearance.Image = imageLarge;
                    }
                }
            }
            else
            {
                RibbonGroup group = null;
                if (!_toolbarsManager.Ribbon.Tabs[_toolbarName].Groups.Exists(_panelName))
                {
                    group = new RibbonGroup(_panelName);
                    group.Caption = _panelName;
                    _toolbarsManager.Ribbon.Tabs[_toolbarName].Groups.Add(group);
                }
                else
                    group = _toolbarsManager.Ribbon.Tabs[_toolbarName].Groups[_panelName];
                if (!group.Tools.Exists(key))
                {
                    tool = group.Tools.AddTool(key);
                    group.LayoutDirection = RibbonGroupToolLayoutDirection.Horizontal;
                    group.PreferredToolSize = RibbonToolSize.Large;
                    tool.SharedProps.AppearancesLarge.Appearance.Image = imageLarge;
                    tool.SharedProps.AppearancesSmall.Appearance.Image = imageSmall;
                }
                else
                    tool = group.Tools[key];
            }

            return tool;
        }
예제 #28
0
		public ToolBase AddTool(string key, ToolbarType type, string parentTool, bool addSeparator)
		{
			return AddTool(key, key, type, int.MinValue, parentTool, addSeparator);
		}
예제 #29
0
		public ToolBase AddTool(string key, ToolbarType type)
		{
			return AddTool(key, key, type, string.Empty);
		}
예제 #30
0
 public Toolbar(ToolbarType toolbarType) : this()
 {
     this.toolbarType = toolbarType;
 }
예제 #31
0
        internal string GetToolbarHtml(ToolbarType toolbarType)
        {

            if (m_CustomToolbars == null || m_CustomToolbars.Count == 0)
            {
                switch (toolbarType)
                {
                    case ToolbarType.ToolbarDetailBottom:
                        return ToolbarDetailBottom;
                    case ToolbarType.ToolbarGridBottom:
                        return ToolbarGridBottom;
                    case ToolbarType.ToolbarDetailTop:
                    case ToolbarType.ToolbarGridTop:
                        return null;
                }
            }

            if (m_CustomToolbars != null)
            {
                ToolbarItem mytoolbar = m_CustomToolbars.Find(delegate(ToolbarItem toolbar)
                                                                  {
                                                                      return toolbar != null && toolbar.ToolbarType == toolbarType;
                                                                  });
                if (mytoolbar != null)
                    return mytoolbar.GetControlsContent();
            }
            switch (toolbarType)
            {
                case ToolbarType.ToolbarDetailBottom:
                    return ToolbarDetailBottom;
                case ToolbarType.ToolbarGridBottom:
                    return ToolbarGridBottom;
                case ToolbarType.ToolbarDetailTop:
                case ToolbarType.ToolbarGridTop:
                    return null;
            }
            return null;
        }