void DoOperationsToolbar( WorkspaceInfo wkInfo, bool isGluonMode, GenericMenu advancedDropdownMenu, bool isOperationRunning) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); GUISpace.ForToolbar(); using (new GuiEnabled(!isOperationRunning)) { if (DrawActionButton.For(PlasticLocalization.GetString( PlasticLocalization.Name.CheckinChanges))) { UpdateIsCommentWarningNeeded(CommentText); if (!mIsCommentWarningNeeded) { CheckinForMode(wkInfo, isGluonMode, mKeepItemsLocked); } } if (DrawActionButton.For(PlasticLocalization.GetString( PlasticLocalization.Name.UndoChanges))) { UndoForMode(wkInfo, isGluonMode); } if (isGluonMode) { mKeepItemsLocked = EditorGUILayout.ToggleLeft( PlasticLocalization.GetString(PlasticLocalization.Name.KeepLocked), mKeepItemsLocked, GUILayout.Width(UnityConstants.EXTRA_LARGE_BUTTON_WIDTH)); } //TODO: Codice - beta: hide the advanced menu until the behavior is implemented /*else * { * var dropDownContent = new GUIContent(string.Empty); * var dropDownRect = GUILayoutUtility.GetRect( * dropDownContent, EditorStyles.toolbarDropDown); * * if (EditorGUI.DropdownButton(dropDownRect, dropDownContent, * FocusType.Passive, EditorStyles.toolbarDropDown)) * advancedDropdownMenu.DropDown(dropDownRect); * }*/ } if (mIsCommentWarningNeeded) { GUILayout.Space(5); DoCheckinWarningMessage(); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
public override void Initialize(ScreenInfo parent) { // Create the space to make the left and right side menus // and add the generated GUIMenu objects into it. List<GUIObject> find = FindObjectsOfType(typeof(GUIMenu)); if (find.Count > 0) lmenu = find[0] as GUIMenu; find = FindObjectsOfType(typeof(GUIScrollMenu)); if (find.Count > 0) rmenu = find[0] as GUIScrollMenu; find = FindObjectsOfType(typeof(GUILabel)); if (find.Count > 0) { title = find[0] as GUILabel; if (interactObject != null) title.text = interactObject.prettyname; } find.Clear(); Elements.Clear(); GUIVerticalCommand vert = new GUIVerticalCommand(); vert.Elements = new List<GUIObject>(); Elements.Add(vert); if (title != null ) vert.Elements.Add(title); GUISpace space = new GUISpace(); space.pixels = 5; vert.Elements.Add(space); if (lmenu != null && rmenu != null) { GUIHorizontalCommand hc = new GUIHorizontalCommand(); hc.Elements = new List<GUIObject>(); hc.Elements.Add(lmenu); hc.Elements.Add(rmenu); vert.Elements.Add(hc); } base.Initialize(parent); patient = Patient.FindObjectOfType(typeof(Patient)) as Patient; Object[] temp = ObjectInteraction.FindObjectsOfType(typeof(ObjectInteraction)); foreach (Object obj in temp) { if (obj == patient) continue; roomObjects.Add(obj as ObjectInteraction); } listings = new Listings(); listings.category = "root"; current = listings; }
public void SetType( string guiName, GUIEditObject.GUITypes guiType ) { // create based on type if ( guiType == GUITypes.Screen ) { guiScreen = new GUIScreen(); guiScreen.name = guiName; } if ( guiType == GUITypes.Area ) { guiObject = new GUIArea(); guiObject.name = guiName; } if ( guiType == GUITypes.Label ) { guiObject = new GUILabel(); guiObject.name = guiName; } if ( guiType == GUITypes.Button ) { guiObject = new GUIButton(); guiObject.name = guiName; } if ( guiType == GUITypes.Horizontal ) { guiObject = new GUIHorizontalCommand(); guiObject.name = guiName; } if ( guiType == GUITypes.Vertical ) { guiObject = new GUIVerticalCommand(); guiObject.name = guiName; } if ( guiType == GUITypes.Scrollview ) { guiObject = new GUIScrollView(); guiObject.name = guiName; } if ( guiType == GUITypes.Toggle ) { guiObject = new GUIToggle(); guiObject.name = guiName; } if ( guiType == GUITypes.Space ) { guiObject = new GUISpace(); guiObject.name = guiName; } if ( guiType == GUITypes.EditBox ) { guiObject = new GUIEditbox(); guiObject.name = guiName; } if ( guiType == GUITypes.Box ) { guiObject = new GUIBox(); guiObject.name = guiName; } if ( guiType == GUITypes.HorizontalSlider ) { guiObject = new GUIHorizontalSlider(); guiObject.name = guiName; } if ( guiType == GUITypes.VerticalSlider ) { guiObject = new GUIVerticalSlider(); guiObject.name = guiName; } if ( guiType == GUITypes.Movie ) { guiObject = new GUIMovie(); guiObject.name = guiName; } }
static void DoOperationsToolbar( PlasticGUIClient plasticClient, bool isGluonMode, GenericMenu advancedDropdownMenu, IRefreshableView refreshableView, ProgressControlsForViews progressControls) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); GUISpace.ForToolbar(); using (new GuiEnabled(!progressControls.IsOperationRunning())) { using (new GuiEnabled(!plasticClient.IsCommentWarningNeeded)) { if (DoOperationButton("Checkin changes")) { LaunchOperation.CheckinForMode( isGluonMode, plasticClient.KeepItemsLocked, plasticClient); } } if (DoOperationButton("Undo changes")) { LaunchOperation.UndoForMode(isGluonMode, plasticClient); } if (isGluonMode) { plasticClient.KeepItemsLocked = EditorGUILayout.ToggleLeft( PlasticLocalization.GetString(PlasticLocalization.Name.KeepLocked), plasticClient.KeepItemsLocked, GUILayout.Width(UnityConstants.EXTRA_LARGE_BUTTON_WIDTH)); } //TO DO: Codice - beta: hide the advanced menu until the behavior is implemented /*else * { * var dropDownContent = new GUIContent(string.Empty); * var dropDownRect = GUILayoutUtility.GetRect( * dropDownContent, EditorStyles.toolbarDropDown); * * if (EditorGUI.DropdownButton(dropDownRect, dropDownContent, * FocusType.Passive, EditorStyles.toolbarDropDown)) * advancedDropdownMenu.DropDown(dropDownRect); * }*/ } if (plasticClient.IsCommentWarningNeeded) { GUILayout.Space(5); DoCheckinWarningMessage(); } if (progressControls.IsOperationRunning()) { DrawProgressForViews.ForIndeterminateProgress( progressControls.ProgressData); } GUILayout.FlexibleSpace(); DoRefreshButton( refreshableView, progressControls.IsOperationRunning()); EditorGUILayout.EndHorizontal(); }