public static void SwitchToViewMode(AppViewMode mode, bool bForceUpdate = false) { if (bForceUpdate == false && CurrentViewMode == mode) { return; } // cannot change view if tool is active if (CC.ActiveContext.ToolManager.HasActiveTool(ToolSide.Right)) { return; } _view_mode = mode; if (mode == AppViewMode.PrintView) { SwitchToPrintView(); } else if (mode == AppViewMode.RepairView) { SwitchToRepairView(); } else if (mode == AppViewMode.ModelView) { SwitchToModelView(); } }
public void Update() { if (highlighted != CCActions.CurrentViewMode) { highlighted = CCActions.CurrentViewMode; set_highlight(highlighted); } }
// Use this for initialization public void Start() { printModeButton = UnityUIUtil.FindButtonAndAddClickHandler("PrintButton", on_print_mode); repairModeButton = UnityUIUtil.FindButtonAndAddClickHandler("RepairButton", on_repair_mode); modelModeButton = UnityUIUtil.FindButtonAndAddClickHandler("ModelButton", on_model_mode); set_highlight(AppViewMode.PrintView); highlighted = AppViewMode.PrintView; }
public ShakeListEditorView(ShakeList editList, bool isAClon = false) { __presenter = new ShakeListEditorPresenter(this, editList); __mode = (isAClon) ? AppViewMode.New : AppViewMode.Edit; this.EdgesForExtendedLayout = UIRectEdge.None; this.View.BackgroundColor = UIColor.White; }
public ShakeListEditorView() { __presenter = new ShakeListEditorPresenter(this); __mode = AppViewMode.New; //This is required so the parent UINavigationController doesn't resize this UIViewController like he wants this.EdgesForExtendedLayout = UIRectEdge.None; this.View.BackgroundColor = UIColor.White; }
void set_highlight(AppViewMode mode) { if (mode == AppViewMode.PrintView) { UnityUIUtil.SetColors(printModeButton, highlightColor, disabledColor); UnityUIUtil.SetColors(repairModeButton, normalColor, disabledColor); UnityUIUtil.SetColors(modelModeButton, normalColor, disabledColor); } else if (mode == AppViewMode.RepairView) { UnityUIUtil.SetColors(printModeButton, normalColor, disabledColor); UnityUIUtil.SetColors(repairModeButton, highlightColor, disabledColor); UnityUIUtil.SetColors(modelModeButton, normalColor, disabledColor); } else if (mode == AppViewMode.ModelView) { UnityUIUtil.SetColors(printModeButton, normalColor, disabledColor); UnityUIUtil.SetColors(repairModeButton, normalColor, disabledColor); UnityUIUtil.SetColors(modelModeButton, highlightColor, disabledColor); } }