public IActionResult Plovdiv(UiControl control) { if (control != null) { if (control.Plovdiv == null) { var noSeaReport = new Report("NoSeaSide", 1, 1); reportConnector.Send(noSeaReport); } if (control.Plovdiv != null) { var plovdivReport = new Report("Plovdiv", control.Plovdiv == "A" ? 0 : 1, 1); reportConnector.Send(plovdivReport); } if (control.NoSeaSide != null) { var noSeaReport = new Report("NoSeaSide", control.NoSeaSide == "A" ? 0 : 1, 1); reportConnector.Send(noSeaReport); var seaReport = new Report("SeaSide", control.NoSeaSide == "A" ? 0 : 1, 0); reportConnector.Send(seaReport); } } return(View()); }
public IActionResult Burgas(UiControl control) { if (control != null) { if (control.Burgas == null) { var seaReport = new Report("SeaSide", 1, 1); reportConnector.Send(seaReport); } if (control.Burgas != null) { var burgasReport = new Report("Burgas", control.Burgas == "A" ? 0 : 1, 1); reportConnector.Send(burgasReport); } } if (control.SeaSide != null) { var seaReport = new Report("SeaSide", control.SeaSide == "A" ? 0 : 1, 1); reportConnector.Send(seaReport); var nonSeaReport = new Report("NoSeaSide", control.NoSeaSide == "A" ? 0 : 1, 0); reportConnector.Send(nonSeaReport); } return(View()); }
public BlinkModifier(UiControl control, TimeSpan blinkRate, Color endColor) : base(control) { TimeForFullFade = TimeSpan.FromMilliseconds(blinkRate.TotalMilliseconds / 2f); EndColor = endColor; StartColor = control.Color; }
private void OnMouseInputEvent(Vector2 pixelPosition, MouseButton button, InputEventType type, float value = 0) { // The mouse wheel event are still received even when the mouse cursor is out of the control boundaries. Discard the event in this case. if (type == InputEventType.Wheel && !UiControl.ClientRectangle.Contains(UiControl.PointToClient(Control.MousePosition))) { return; } // the mouse events series has been interrupted because out of the window. if (type == InputEventType.Up && !MouseButtonCurrentlyDown[(int)button]) { return; } CurrentMousePosition = NormalizeScreenPosition(pixelPosition); var mouseInputEvent = new MouseInputEvent { Type = type, MouseButton = button, Value = value }; lock (MouseInputEvents) MouseInputEvents.Add(mouseInputEvent); if (type != InputEventType.Wheel) { var buttonId = (int)button; MouseButtonCurrentlyDown[buttonId] = type == InputEventType.Down; HandlePointerEvents(buttonId, CurrentMousePosition, InputEventTypeToPointerState(type), PointerType.Mouse); } }
private void InitializeFromWindowsForms(GameContext <Control> uiContext) { UiControl = uiContext.Control; pointerClock.Restart(); if (UseRawInput) { BindRawInputKeyboard(UiControl); } else { defaultWndProc = Win32Native.GetWindowLong(UiControl.Handle, Win32Native.WindowLongType.WndProc); // This is needed to prevent garbage collection of the delegate. inputWndProc = WndProc; var inputWndProcPtr = Marshal.GetFunctionPointerForDelegate(inputWndProc); Win32Native.SetWindowLong(UiControl.Handle, Win32Native.WindowLongType.WndProc, inputWndProcPtr); } UiControl.GotFocus += (_, e) => OnUiControlGotFocus(); UiControl.LostFocus += (_, e) => OnUiControlLostFocus(); UiControl.MouseMove += (_, e) => OnMouseMoveEvent(new Vector2(e.X, e.Y)); UiControl.MouseDown += (_, e) => { UiControl.Focus(); OnMouseInputEvent(new Vector2(e.X, e.Y), ConvertMouseButton(e.Button), InputEventType.Down); }; UiControl.MouseUp += (_, e) => OnMouseInputEvent(new Vector2(e.X, e.Y), ConvertMouseButton(e.Button), InputEventType.Up); UiControl.MouseWheel += (_, e) => OnMouseInputEvent(new Vector2(e.X, e.Y), MouseButton.Middle, InputEventType.Wheel, e.Delta); UiControl.MouseCaptureChanged += (_, e) => OnLostMouseCaptureWinForms(); UiControl.SizeChanged += UiControlOnSizeChanged; ControlWidth = UiControl.ClientSize.Width; ControlHeight = UiControl.ClientSize.Height; }
protected override void SetMousePosition(Vector2 normalizedPosition) { var newPos = UiControl.PointToScreen( new System.Windows.Point((int)(ClientWidth(UiControl) * normalizedPosition.X), (int)(ClientHeight(UiControl) * normalizedPosition.Y))); Cursor.Position = new System.Drawing.Point((int)newPos.X, (int)newPos.Y); }
public override void Initialize(GameContext <AndroidXenkoGameView> gameContext) { var viewListener = new ViewListener(this); UiControl = gameContext.Control; UiControl.SetOnTouchListener(viewListener); UiControl.SetOnKeyListener(viewListener); UiControl.Resize += GameViewOnResize; GameViewOnResize(null, EventArgs.Empty); // Get the android sensors sensorManager = (SensorManager)PlatformAndroid.Context.GetSystemService(Context.SensorService); androidAccelerometer = sensorManager.GetDefaultSensor(SensorType.Accelerometer); androidGyroscope = sensorManager.GetDefaultSensor(SensorType.Gyroscope); androidUserAcceleration = sensorManager.GetDefaultSensor(SensorType.LinearAcceleration); androidGravity = sensorManager.GetDefaultSensor(SensorType.Gravity); androidRotationVector = sensorManager.GetDefaultSensor(SensorType.RotationVector); // Determine which sensor is available on the device Accelerometer.IsSupported = androidAccelerometer != null; Compass.IsSupported = androidRotationVector != null; Gyroscope.IsSupported = androidGyroscope != null; UserAcceleration.IsSupported = androidUserAcceleration != null; Gravity.IsSupported = androidGravity != null; Orientation.IsSupported = androidRotationVector != null; }
/// <summary> /// Send a keypress to the application if it's running /// </summary> /// <param name="key">The keypress to send</param> /// <param name="isSelectedTab">True when this tab is currently selected in the UI</param> /// <returns>True when sent, false otherwise</returns> public virtual bool SendKey(CecKeypress key, bool isSelectedTab) { if (isSelectedTab) { UiControl.SelectKeypressRow(UiControl, CecButtonGridView, key); } if (isSelectedTab && SuppressKeypressWhenSelected.Value) { return(false); } if (!ControlApplication.Value) { return(false); } var mappedButton = ButtonConfig[key]; if (mappedButton == null || mappedButton.Value.Empty()) { return(false); } var controlWindow = ProcessName == "" ? IntPtr.Zero : FindInstance(); if ((ProcessName == "" || controlWindow != IntPtr.Zero) && (key.Duration == 0 || key.Duration > 500)) { return(mappedButton.Value.Transmit(controlWindow)); } return(false); }
public IActionResult Varna(UiControl control) { if (control != null) { if (control.Varna == null) { var seaReport = new Report("SeaSide", 0, 1); reportConnector.Send(seaReport); } if (control.Varna != null) { var varnaReport = new Report("Varna", control.Varna == "A" ? 0 : 1, 1); reportConnector.Send(varnaReport); } if (control.SeaSide != null) { var seaReport = new Report("SeaSide", control.SeaSide == "A" ? 0 : 1, 1); reportConnector.Send(seaReport); var nonSeaReport = new Report("NoSeaSide", control.NoSeaSide == "A" ? 0 : 1, 0); reportConnector.Send(nonSeaReport); } } return(View()); }
protected override void SetMousePosition(Vector2 normalizedPosition) { var newPos = UiControl.PointToScreen( new System.Drawing.Point((int)(UiControl.ClientRectangle.Width * normalizedPosition.X), (int)(UiControl.ClientRectangle.Height * normalizedPosition.Y))); Cursor.Position = newPos; }
public ControlPrefab(string _typeName, UiControl _prefab = null, UiControlLevel _controlLevel = UiControlLevel.Any) { targetTypes = TargetTypes.Custom; controlLevel = _controlLevel; typeName = _typeName; prefab = _prefab; type = null; }
public ControlPrefab(TargetTypes _targetTypes, UiControl _prefab = null, Type _type = null, UiControlLevel _controlLevel = UiControlLevel.Any) { targetTypes = _targetTypes; controlLevel = _controlLevel; typeName = string.Empty; prefab = _prefab; type = _type; }
public bool GetButtonPress(string buttonName) { UiControl uiControl = GetUiControl(buttonName); if (uiControl != null) { return(uiControl.IsEitherPress()); } return(false); }
public UiControl GetUiControl(string name) { foreach (Container container in containerList) { UiControl uiControl = container.GetUiControl(name); if (uiControl != null) { return(uiControl); } } return(null); }
private void Start() { enemy.SetActive(false); resetCount = 0; unitControl = UnitControl.singleton; //enemyControl = EnemyControl.singleton; uiControl = UiControl.singleton; levelEditor = LevelEditor.singleton; levelEditor.Init(this); ChangeState(GameState.mainMenu); levelEditor.FindAllLevels(); }
private void CheckApplicationEnabled() { var isRunning = IsRunning(); if (isRunning != _applicationRunning && ApplicationRunningChanged != null) { ApplicationRunningChanged(isRunning); } _applicationRunning = isRunning; UiControl.SetStartButtonEnabled(!isRunning && !SuppressApplicationStart); }
public override bool BeginPick(Vector2 mousePos, out UiControl control) { foreach (UiControl ctrl in Controls) { if (ctrl.BeginPick(mousePos, out control)) { return true; } } control = null; return false; }
public IActionResult Index() { var control = new UiControl() { Burgas = connector.GetValue("Burgas"), NoSeaSide = connector.GetValue("NoSeaSide"), Plovdiv = connector.GetValue("Plovdiv"), SeaSide = connector.GetValue("SeaSide"), Sofia = connector.GetValue("Sofia"), Varna = connector.GetValue("Varna") }; return(View(control)); }
public void AddAllLevels() { UiControl ui = UiControl.singleton; for (int i = 0; i < availableLevels.Count; i++) { GameObject g = Instantiate(levelTemplate); g.transform.SetParent(ui.levelGrid); g.SetActive(true); g.GetComponentInChildren <UnityEngine.UI.Text>().text = availableLevels[i]; UILevelButton u = g.GetComponentInChildren <UILevelButton>(); u.targetLevel = availableLevels[i]; levelObjs.Add(g); } }
public override bool BeginPick(SlimDX.Vector2 mousePos, out UiControl control) { control = null; foreach (MenuBarItem item in Items) { if (item.IsVisible == false) { continue; } if (item.BeginPick(mousePos, out control) == true) { return true; } } return false; }
public BlinkModifier(UiControl control, TimeSpan blinkRate) : this(control, blinkRate, Color.White.ToOpacity(0f)) { }
internal void InitVariables(FormTreeView form) { FxTreeview = form; UiControl.Init(form); }
void Awake() { singleton = this; }
public void OnMouseUp(View3D view, Vector2 mousePosition, System.Windows.Forms.MouseButtons mouseButtons, out bool shouldUpdate) { Vector2 mousePositionCorrected = mousePosition + view.ViewportOffset; // new Vector2(view.Viewport.X, view.Viewport.Y); shouldUpdate = false; if (m_Focused != null) { if (m_Focused is UiSubScene) { bool shouldSubUpdate; (m_Focused as UiSubScene).OnMouseUp(view, mousePosition, mouseButtons, out shouldSubUpdate); m_MouseState = MouseState.Hovering; m_Control_ClickStart = null; } else { if (m_MouseState == MouseState.Dragging || m_MouseState == MouseState.DragStart) { m_MouseState = MouseState.DragEnd; m_Focused.DoMouseInteraction(m_MouseState, m_MouseButtons, mousePositionCorrected, out shouldUpdate); m_Control_ClickStart = null; } else if (m_MouseState == MouseState.ClickStart) { m_MouseState = MouseState.ClickEnd; m_Focused.DoMouseInteraction(m_MouseState, m_MouseButtons, mousePositionCorrected, out shouldUpdate); m_Control_ClickStart = null; } else { m_MouseState = MouseState.Hovering; m_Control_ClickStart = null; } } } else { m_MouseState = MouseState.None; m_Control_ClickStart = null; } }
void Update() { if (currentTetromino == null) //the tetromino is never generated on its own, it is cloned from the next tetromino { StopAllCoroutines(); currentTetromino = TetrominoControls.cloneTetromino(nextTetromino, field); TetrominoControls.CreateGhost(currentTetromino); blockControl.blk_cnj_clear(nextTetromino.GetBlocks()); nextTetromino = TetrominoControls.createTetromino(next); StartCoroutine(goDown()); changeColor(currentTetromino.GetBlocks()); } if (Input.GetKeyDown("d")) // Moves to the right { if (blockControl.blk_cnj_foreach(blockControl.blk_solo_checkRight, currentTetromino.GetBlocks(), 0)) { blockControl.blk_cnj_foreach(blockControl.blk_solo_moveRight, currentTetromino.GetBlocks(), 0); currentTetromino.SetLocation(new Vector2Int(1, 0)); TetrominoControls.CreateGhost(currentTetromino); } } if (Input.GetKeyDown("a"))// Moves to the left { if (blockControl.blk_cnj_foreach(blockControl.blk_solo_checkLeft, currentTetromino.GetBlocks(), 0)) { blockControl.blk_cnj_foreach(blockControl.blk_solo_moveLeft, currentTetromino.GetBlocks(), 0); currentTetromino.SetLocation(new Vector2Int(-1, 0)); TetrominoControls.CreateGhost(currentTetromino); } } if (Input.GetKeyDown("s"))// Moves Down { if (currentTetromino != null) { StopAllCoroutines(); tick = 0.05f; StartCoroutine(goDown()); } } if (Input.GetKeyUp("s"))// Moves Down { StopAllCoroutines(); tick = 1f; StartCoroutine(goDown()); } if (Input.GetKeyDown("w")) { rotation(); TetrominoControls.CreateGhost(currentTetromino); } if (Input.GetKeyDown("f")) { TetrominoControls.fitPiece(currentTetromino, currentTetromino.GetField()); UiControl.scr_add(score, 36); checkDown(currentTetromino); } if (Input.GetKeyDown("c") && recentlyChanged == false) { Tetromino cloneAux = null; if (holdTetromino != null) { cloneAux = holdTetromino; blockControl.blk_cnj_clear(holdTetromino.GetBlocks()); } holdTetromino = TetrominoControls.cloneTetromino(currentTetromino, hold); blockControl.blk_cnj_clear(currentTetromino.GetBlocks()); blockControl.blk_cnj_clear(currentTetromino.GetGhost().GetBlocks()); currentTetromino = TetrominoControls.cloneTetromino(cloneAux, field); TetrominoControls.CreateGhost(currentTetromino); recentlyChanged = true; } }
/// <summary> /// Invoke the method specified by the /// <see cref="CloudPact.MowblyFramework.Core.Features.JSMessage">JSMessage</see> object /// </summary> /// <param name="message"> /// <see cref="CloudPact.MowblyFramework.Core.Features.JSMessage">JSMessage</see> object /// </param> internal async override void InvokeAsync(JSMessage message) { UiDispatcher.BeginInvoke(() => { switch (message.Method) { case "alert": if (activeControl == UiControl.None) { // Read args string alertOptionsStr = message.Args[0] as string; JObject alertOptions = JObject.Parse(alertOptionsStr); string alertTitle = (string)alertOptions[KEY_TITLE]; string alertMsg = (string)alertOptions[KEY_MESSAGE]; string alertCallbackId = (string)alertOptions[KEY_CALLBACK_ID]; // Create alert prompt MessagePrompt alertPrompt = new MessagePrompt(); alertPrompt.Title = alertTitle; alertPrompt.Message = alertMsg; // Subscribe to OnCompleted event EventHandler <PopUpEventArgs <string, PopUpResult> > onAlertPromptCompleted = null; onAlertPromptCompleted = (sender, e) => { // Set active control none if (activeControl != UiControl.Progress) { activeControl = UiControl.None; } prompt = null; UiDispatcher.BeginInvoke(() => { // Notify JS layer InvokeCallbackJavascript(alertCallbackId, new MethodResult()); // Unsubscrivbe from OnCompleted event alertPrompt.Completed -= onAlertPromptCompleted; }); }; alertPrompt.Completed += onAlertPromptCompleted; // Show the alert prompt alertPrompt.Show(); // Set active control activeControl = UiControl.Alert; prompt = alertPrompt; } break; case "confirm": if (activeControl == UiControl.None) { // Read args string confirmOptionsStr = message.Args[0] as string; JObject confirmOptions = JObject.Parse(confirmOptionsStr); List <Dictionary <string, string> > confirmButtons = confirmOptions["buttons"].ToObject <List <Dictionary <string, string> > >(); if (confirmButtons.Count >= 2) { string confirmTitle = (string)confirmOptions[KEY_TITLE]; string confirmMsg = (string)confirmOptions[KEY_MESSAGE]; string confirmCallbackId = (string)confirmOptions[KEY_CALLBACK_ID]; // Create confirm prompt MessagePrompt confirmPrompt = new MessagePrompt(); confirmPrompt.Title = confirmTitle; confirmPrompt.Message = confirmMsg; confirmPrompt.IsCancelVisible = true; // Subscribe to OnCompleted event // Required if the user cancels the confirm dialog using device back key press EventHandler <PopUpEventArgs <string, PopUpResult> > onConfirmPromptCompleted = null; onConfirmPromptCompleted = (sender, e) => { // Set active control none activeControl = UiControl.None; prompt = null; UiDispatcher.BeginInvoke(() => { // Notify JS layer InvokeCallbackJavascript(confirmCallbackId, -1); // Unsubscribe from OnCompleted event confirmPrompt.Completed -= onConfirmPromptCompleted; }); }; confirmPrompt.Completed += onConfirmPromptCompleted; // Function to return the button click handler encapsulating the index of the button Func <int, RoutedEventHandler> GetButtonClickHandler = (btnIndex) => { return(new RoutedEventHandler((o, args) => { // Unsubscribe from OnCompleted event // Not required as JS layer will be notified from here confirmPrompt.Completed -= onConfirmPromptCompleted; // Notify JS layer InvokeCallbackJavascript(confirmCallbackId, btnIndex); // Hide the confirm prompt confirmPrompt.Hide(); // Set active control none activeControl = UiControl.None; prompt = null; })); }; // Remove the default buttons confirmPrompt.ActionPopUpButtons.Clear(); // Create confirm buttons and add it to confirm prompt int index = 0; foreach (Dictionary <string, string> buttonDict in confirmButtons) { Button button = new Button { Content = buttonDict["label"] }; button.Click += GetButtonClickHandler(index); confirmPrompt.ActionPopUpButtons.Add(button); index++; } // Show the alert prompt confirmPrompt.Show(); // Set active control activeControl = UiControl.Confirm; prompt = confirmPrompt; } } break; case "hideProgress": if (activeControl == UiControl.Progress) { CloudPact.MowblyFramework.Core.Controls.ProgressOverlay.Instance.Hide(); // Set active control none activeControl = UiControl.None; } break; case "showProgress": if (activeControl != UiControl.Progress) { string progressMsg = message.Args[1] as string; CloudPact.MowblyFramework.Core.Controls.ProgressOverlay.Instance.Show(progressMsg); // Set active control activeControl = UiControl.Progress; } break; case "toast": if (activeControl == UiControl.None) { string toastMsg = message.Args[0] as string; int duration = DURATION_TOAST_LONG; if (message.Args.Length > 1) { duration = Convert.ToInt32(message.Args[1]); duration = (duration == 0) ? DURATION_TOAST_SHORT : DURATION_TOAST_LONG; } ToastPrompt toastPrompt = new ToastPrompt { Message = toastMsg, MillisecondsUntilHidden = duration }; toastPrompt.Show(); } break; default: Logger.Error("Feature " + Name + " does not support method " + message.Method); break; } }); await Task.FromResult(0); }
public string this[UiControl c] { get { switch (c) { // Setup case UiControl.LoginDetails: return(Get("/new_account/login_details", "FTP login details")); case UiControl.Protocol: return(Get("/main_form/mode", "Protocol") + ":"); case UiControl.Encryption: return(Get("/new_account/encryption", "Encryption") + ":"); case UiControl.Host: return(Get("/main_form/host", "Host") + ":"); case UiControl.Port: return(Get("/main_form/port", "Port") + ":"); case UiControl.Username: return(Get("/main_form/username", "Username") + ":"); case UiControl.Password: return(Get("/main_form/password", "Password") + ":"); case UiControl.AskForPassword: return(Get("/new_account/ask_for_password", "Always ask for password")); case UiControl.Authentication: return(Get("/setup/authentication", "Authentication") + ":"); case UiControl.LocalFolder: return(Get("/paths/local_folder", "Local folder")); case UiControl.DefaultLocalFolder: return(Get("/paths/default_local", "I want to use the default local folder")); case UiControl.CustomLocalFolder: return(Get("/paths/custom_local", "I want to select a local folder")); case UiControl.Browse: return(Get("/paths/browse", "Browse")); case UiControl.RemotePath: return(Get("/main_form/remote_path", "Remote Path")); case UiControl.FullRemotePath: return(Get("/paths/full_path", "Full path") + ":"); case UiControl.SelectiveSync: return(Get("/main_form/selective", "Selective Sync")); case UiControl.SyncAllFiles: return(Get("/setup/sync_all_files", "I want to synchronize all files")); case UiControl.SyncSpecificFiles: return(Get("/setup/sync_specific_files", "I want to select what files will be synchronized")); case UiControl.UncheckFiles: return(Get("/main_form/selective_info", "Uncheck the items you don't want to sync") + ":"); case UiControl.Previous: return(Get("/setup/previous", "Previous")); case UiControl.Next: return(Get("/setup/next", "Next")); case UiControl.Finish: return(Get("/new_account/done", "Done")); // Options case UiControl.Options: return(Get("/main_form/options", "Options")); case UiControl.General: return(Get("/main_form/general", "General")); case UiControl.Links: return(Get("/main_form/links", "Links")); case UiControl.FullAccountPath: return(Get("/main_form/account_full_path", "Account's full path") + ":"); case UiControl.WhenRecentFileClicked: return(Get("/main_form/when_not_clicked", "When tray notification or recent file is clicked") + ":"); case UiControl.OpenUrl: return(Get("/main_form/open_in_browser", "Open link in default browser")); case UiControl.CopyUrl: return(Get("/main_form/copy", "Copy link to clipboard")); case UiControl.OpenLocal: return(Get("/main_form/open_local", "Open the local file")); case UiControl.Application: return(Get("/main_form/application", "Application")); case UiControl.ShowNotifications: return(Get("/main_form/show_nots", "Show notifications")); case UiControl.StartOnStartup: return(Get("/main_form/start_on_startup", "Start on system start-up")); case UiControl.EnableLogging: return(Get("/main_form/enable_logging", "Enable Logging")); case UiControl.ViewLog: return(Get("/main_form/view_log", "View Log")); case UiControl.AddShellMenu: return(Get("/main_form/shell_menus", "Add to context menu")); case UiControl.Account: return(Get("/main_form/account", "Account")); case UiControl.Profile: return(Get("/main_form/profile", "Profile")); case UiControl.Add: return(Get("/new_account/add", "Add")); case UiControl.Remove: return(Get("/main_form/remove", "Remove")); case UiControl.Details: return(Get("/main_form/details", "Details")); case UiControl.WebUi: return(Get("/web_interface/web_int", "Web Interface")); case UiControl.UseWebUi: return(Get("/web_interface/use_webint", "Use the Web Interface")); case UiControl.ViewInBrowser: return(Get("/web_interface/view", "(View in browser)")); case UiControl.WayOfSync: return(Get("/main_form/way_of_sync", "Way of synchronization") + ":"); case UiControl.LocalToRemoteSync: return(Get("/main_form/local_to_remote", "Local to remote only")); case UiControl.RemoteToLocalSync: return(Get("/main_form/remote_to_local", "Remote to local only")); case UiControl.BothWaysSync: return(Get("/main_form/both_ways", "Both ways")); case UiControl.TempNamePrefix: return(Get("/main_form/temp_file_prefix", "Temporary file prefix") + ":"); case UiControl.Filters: return(Get("/main_form/file_filters", "Filters")); case UiControl.Configure: return(Get("/main_form/configure", "Configure")); case UiControl.Refresh: return(Get("/main_form/refresh", "Refresh")); case UiControl.IgnoredExtensions: return(Get("/main_form/ignored_extensions", "Ignored Extensions")); case UiControl.AlsoIgnore: return(Get("/main_form/also_ignore", "Also ignore") + ":"); case UiControl.Dotfiles: return(Get("/main_form/dotfiles", "dotfiles")); case UiControl.TempFiles: return(Get("/main_form/temp_files", "Temporary Files")); case UiControl.FilesModifiedBefore: return(Get("/main_form/old_files", "Files modified before") + ":"); case UiControl.Bandwidth: return(Get("/main_form/bandwidth", "Bandwidth")); case UiControl.SyncFrequency: return(Get("/main_form/sync_freq", "Sync Frequency")); case UiControl.SyncWhen: return(Get("/main_form/sync_when", "Synchronize remote files")); case UiControl.AutoEvery: return(Get("/main_form/auto", "automatically every")); case UiControl.Seconds: return(Get("/main_form/seconds", "seconds")); case UiControl.Manually: return(Get("/main_form/manually", "manually")); case UiControl.SpeedLimits: return(Get("/main_form/speed_limits", "Speed Limits")); case UiControl.DownLimit: return(Get("/main_form/limit_download", "Limit Download Speed")); case UiControl.UpLimit: return(Get("/main_form/limit_upload", "Limit Upload Speed")); case UiControl.NoLimits: return(Get("/main_form/no_limits", "( set to 0 for no limits )")); case UiControl.Language: return(Get("/main_form/language", "Language")); case UiControl.About: return(Get("/main_form/about", "About")); case UiControl.TheTeam: return(Get("/main_form/team", "The Team") + ":"); case UiControl.Website: return(Get("/main_form/website", "Official Website") + ":"); case UiControl.Contact: return(Get("/main_form/contact", "Contact") + ":"); case UiControl.CodedIn: return(Get("/main_form/coded_in", "Coded in") + ":"); case UiControl.Notes: return(Get("/main_form/notes", "Notes")); case UiControl.Contribute: return(Get("/main_form/contribute", "Contribute")); case UiControl.FreeAndAll: return(Get("/main_form/ftpbox_is_free", "- FTPbox is free and open-source")); case UiControl.GetInTouch: return(Get("/main_form/contact_me", "- Feel free to contact me for anything.")); case UiControl.ReportBug: return(Get("/main_form/report_bug", "Report a bug")); case UiControl.RequestFeature: return(Get("/main_form/request_feature", "Request a feature")); case UiControl.Donate: return(Get("/main_form/donate", "Donate") + ":"); case UiControl.RecentFiles: return(Get("/tray/recent_files", "Recent Files")); case UiControl.Modified: return(Get("/tray/modified", "Modified")); case UiControl.StartSync: return(Get("/tray/start_syncing", "Start Syncing")); case UiControl.Exit: return(Get("/tray/exit", "Exit")); // New Version Form case UiControl.UpdateAvailable: return(Get("/new_version/update_available", "Update Available")); case UiControl.NewVersionAvailable: return(Get("/new_version/new_v_available", "New version of FTPbox is available")); case UiControl.CurrentVersion: return(Get("/new_version/current_version", "Current Version")); case UiControl.NewVersion: return(Get("/new_version/new_ver", "New Version")); case UiControl.AskDownload: return(Get("/new_version/wanna_download", "Do you want to download the new version now")); case UiControl.DownloadNow: return(Get("/new_version/download", "Update Now")); case UiControl.LearnMore: return(Get("/new_version/learn_more", "Learn More")); case UiControl.RemindLater: return(Get("/new_version/remind_me_next_time", "Not this time")); default: return(string.Empty); } } }
public void UnhoverControls() { if (m_Hovered != null) { m_Hovered.EndPick(new Vector2(-1, -1), PickType.UnHover, null); if (m_Hovered is UiSubScene) { (m_Hovered as UiSubScene).UnhoverControls(); } m_Hovered = null; m_MouseState = MouseState.None; m_MouseButtons = System.Windows.Forms.MouseButtons.None; m_HasBeenInvalidated = true; } }
public void OnMouseDown(View3D view, Vector2 mousePosition, System.Windows.Forms.MouseButtons mouseButtons, out bool shouldUpdate) { Vector2 mousePositionCorrected = mousePosition + view.ViewportOffset; // new Vector2(view.Viewport.X, view.Viewport.Y); shouldUpdate = false; UiControl foundTopMost = null; foreach (UiControl control in Controls) { UiControl found = null; if (control.IsVisible == true) { control.BeginPick(mousePositionCorrected, out found); } if (found != null) { if (foundTopMost == null) { foundTopMost = found; } else if (foundTopMost.ZIndex < found.ZIndex) { foundTopMost = found; } } } if (m_Focused != null && foundTopMost != null) { if (m_Focused != foundTopMost) { m_Focused.EndPick(mousePositionCorrected, PickType.UnFocus, foundTopMost); if (m_Focused is UiSubScene) { (m_Focused as UiSubScene).UnfocusControls(); } m_Focused = foundTopMost; m_Focused.EndPick(mousePositionCorrected, PickType.Focus, m_Focused); shouldUpdate = true; } } else if (foundTopMost != null) { m_Focused = foundTopMost; m_Focused.EndPick(mousePositionCorrected, PickType.Focus, m_Focused); shouldUpdate = true; } else if (m_Focused != null && foundTopMost == null) { m_Focused.EndPick(mousePositionCorrected, PickType.UnFocus, null); if (m_Focused is UiSubScene) { (m_Focused as UiSubScene).UnfocusControls(); } m_Focused = null; shouldUpdate = true; } if (m_Focused != null) { if (m_Focused is UiSubScene) { bool shouldSubUpdate; (m_Focused as UiSubScene).OnMouseDown(view, mousePosition, mouseButtons, out shouldSubUpdate); m_MouseState = MouseState.Hovering; m_MouseButtons = System.Windows.Forms.MouseButtons.None; } else { if ((m_Focused.InteractionType & ControlInteractionType.Drag) == ControlInteractionType.Drag) { m_MouseState = MouseState.DragStart; m_MouseButtons = mouseButtons; m_Focused.DoMouseInteraction(m_MouseState, m_MouseButtons, mousePositionCorrected, out shouldUpdate); } else if ((m_Focused.InteractionType & ControlInteractionType.Click) == ControlInteractionType.Click) { m_MouseState = MouseState.ClickStart; m_MouseButtons = mouseButtons; m_Control_ClickStart = m_Focused; m_Focused.DoMouseInteraction(m_MouseState, m_MouseButtons, mousePositionCorrected, out shouldUpdate); } else { m_MouseState = MouseState.Hovering; m_MouseButtons = System.Windows.Forms.MouseButtons.None; m_Focused.DoMouseInteraction(m_MouseState, m_MouseButtons, mousePositionCorrected, out shouldUpdate); } } } else { m_MouseState = MouseState.None; m_MouseButtons = System.Windows.Forms.MouseButtons.None; m_Control_ClickStart = null; } }
public UiControlModifier(UiControl control) { Control = control; }
public void OnMouseMoved(View3D view, Vector2 mousePosition, out bool shouldUpdate) { Vector2 mousePositionCorrected = mousePosition + view.ViewportOffset; // new Vector2(view.Viewport.X, view.Viewport.Y); shouldUpdate = false; if (m_Focused != null && (m_MouseState == MouseState.Dragging || m_MouseState == MouseState.DragStart)) { m_MouseState = MouseState.Dragging; m_Focused.DoMouseInteraction(m_MouseState, m_MouseButtons, mousePositionCorrected, out shouldUpdate); } else { UiControl foundTopMost = null; foreach (UiControl control in Controls) { UiControl found = null; if (control.IsVisible == true) { control.BeginPick(mousePositionCorrected, out found); } if (found != null) { if (foundTopMost == null) { foundTopMost = found; } else if (foundTopMost.ZIndex < found.ZIndex) { foundTopMost = found; } } } if (foundTopMost != null && m_Control_ClickStart == foundTopMost) { m_MouseState = MouseState.ClickStart; } else { if (m_Hovered != null && foundTopMost != m_Hovered && m_Hovered is UiSubScene) { bool shouldSubUpdate; (m_Hovered as UiSubScene).OnMouseMoved(view, mousePosition, out shouldSubUpdate); } if (m_Hovered != null && foundTopMost != null) { if (m_Hovered != foundTopMost) { m_Hovered.EndPick(mousePositionCorrected, PickType.UnHover, foundTopMost); if (m_Hovered is UiSubScene) { (m_Hovered as UiSubScene).UnhoverControls(); } m_Hovered = foundTopMost; m_Hovered.EndPick(mousePositionCorrected, PickType.Hover, m_Hovered); shouldUpdate = true; } } else if (foundTopMost != null) { m_Hovered = foundTopMost; m_Hovered.EndPick(mousePositionCorrected, PickType.Hover, m_Hovered); shouldUpdate = true; } else if (m_Hovered != null && foundTopMost == null) { m_Hovered.EndPick(mousePositionCorrected, PickType.UnHover, null); if (m_Hovered is UiSubScene) { (m_Hovered as UiSubScene).UnhoverControls(); } m_Hovered = null; shouldUpdate = true; } if (m_Hovered != null && m_Hovered is UiSubScene) { bool shouldSubUpdate; (m_Hovered as UiSubScene).OnMouseMoved(view, mousePosition, out shouldSubUpdate); } if (m_Hovered != null) { m_MouseState = MouseState.Hovering; } else { m_MouseState = MouseState.Moving; } } } }
/// <summary> /// This function creates initialize test case and test data. /// </summary> /// <param name="applicationClass">Application class.</param> /// <value>Application class value.</value> public static void LoadUiControls(ApplicationClass applicationClass) { try { var workbook = WorkBookUtility.OpenWorkBook(applicationClass, TestCase.RootFilePath + ConfigurationManager.AppSettings.Get(Entities.Constants.AppSetting.UiControlFile)); dynamic worksheet = workbook.Worksheets[1]; var rowsCount = worksheet.UsedRange.Rows.Count; var cellCount = worksheet.UsedRange.Columns.Count + 1; for (var rowIndex = 2; rowIndex <= rowsCount; rowIndex++) { if (string.IsNullOrEmpty(worksheet.Cells[rowIndex, 1].value)) { break; // reading the sheet untill the first empty row } var objUiControl = new UiControl(); for (var cellIndex = 1; cellIndex <= cellCount; cellIndex++) { string headerValue = Convert.ToString(worksheet.Cells[1, cellIndex].value); string dataValue = Convert.ToString(worksheet.Cells[rowIndex, cellIndex].value); if (string.IsNullOrEmpty(headerValue)) { TestCase.UiControls.Add(objUiControl); break; } switch (headerValue.ToUpper()) { case Entities.Constants.UiControls.UiControlId: objUiControl.UiControlId = dataValue; break; case Entities.Constants.UiControls.UiControlType: objUiControl.UiControlType = dataValue; break; case Entities.Constants.UiControls.UiControlSearchProperty: objUiControl.UiControlSearchProperty = dataValue; break; case Entities.Constants.UiControls.UiControlSearchValue: objUiControl.UiControlSearchValue = dataValue; break; default: if (headerValue.Length > 0) { throw new Exception(string.Format(Entities.Constants.Messages.UiControlSheetError, headerValue)); } TestCase.UiControls.Add(objUiControl); break; } } } WorkBookUtility.CloseWorkBook(workbook); } catch (Exception ex) { LogHelper.ErrorLog(ex, Entities.Constants.ClassName.Data, MethodBase.GetCurrentMethod().Name); throw; } }
public override void EndPick(SlimDX.Vector2 mousePos, PickType pickType, UiControl control) { base.EndPick(mousePos, pickType, control); }
public string this[UiControl c] { get { switch (c) { // Setup case UiControl.LoginDetails: return(Get("/new/login_details", "Détail de connexion")); case UiControl.Protocol: return(Get("/main_form/mode", "Protocole") + ":"); case UiControl.Encryption: return(Get("/new_account/encryption", "Encryption") + ":"); case UiControl.Host: return(Get("/main_form/host", "Adresse de l'interface") + ":"); case UiControl.Port: return(Get("/main_form/port", "Port") + ":"); case UiControl.Username: return(Get("/main_form/username", "Nom d'utilisateur") + ":"); case UiControl.Password: return(Get("/main_form/password", "Mot de passe") + ":"); case UiControl.AskForPassword: return(Get("/new_account/ask_for_password", "Toujours demander le mot de passe")); case UiControl.Authentication: return(Get("/setup/authentication", "Authentication") + ":"); case UiControl.LocalFolder: return(Get("/paths/local_folder", "Dossier local")); case UiControl.DefaultLocalFolder: return(Get("/paths/default_local", "Je veux utiliser le dossier local par défaut")); case UiControl.CustomLocalFolder: return(Get("/paths/custom_local", "Je veux selectionner mon dossier local")); case UiControl.Browse: return(Get("/paths/browse", "Chercher")); case UiControl.RemotePath: return(Get("/main_form/remote_path", "Fichiers distants")); case UiControl.FullRemotePath: return(Get("/paths/full_path", "Chemin d'accès complet") + ":"); case UiControl.SelectiveSync: return(Get("/main_form/selective", "Synchronisation séléctive")); case UiControl.SyncAllFiles: return(Get("/setup/sync_all_files", "Je veux synchroniser tous les fichiers")); case UiControl.SyncSpecificFiles: return(Get("/setup/sync_specific_files", "Je veux séléctionner les fichiers à synchroniser")); case UiControl.UncheckFiles: return(Get("/main_form/selective_info", "Désélectionner les fichiers que vous ne voullez pas synchroniser") + ":"); case UiControl.Previous: return(Get("/setup/previous", "Précédent")); case UiControl.Next: return(Get("/setup/next", "Suivant")); case UiControl.Finish: return(Get("/new_account/done", "Terminer")); // Options case UiControl.Options: return(Get("/main_form/options", "Options")); case UiControl.General: return(Get("/main_form/general", "Général")); case UiControl.Links: return(Get("/main_form/links", "Liens")); case UiControl.FullAccountPath: return(Get("/main_form/account_full_path", "Account's full path") + ":"); case UiControl.WhenRecentFileClicked: return(Get("/main_form/when_not_clicked", "Lorque vous cliquez sur une notification") + ":"); case UiControl.OpenUrl: return(Get("/main_form/open_in_browser", "Ouvrir le lien dans le navigateur par defaut")); case UiControl.CopyUrl: return(Get("/main_form/copy", "Copier le lien dans le presse papier")); case UiControl.OpenLocal: return(Get("/main_form/open_local", "Ouvrir le fichier local")); case UiControl.Application: return(Get("/main_form/application", "Application")); case UiControl.ShowNotifications: return(Get("/main_form/show_nots", "Afficher les notifications relative à l'activité d'iwit sync")); case UiControl.StartOnStartup: return(Get("/main_form/start_on_startup", "Démarrer au lancement de Windows")); case UiControl.EnableLogging: return(Get("/main_form/enable_logging", "Activer l'authentification")); case UiControl.ViewLog: return(Get("/main_form/view_log", "Voir le fichier Log")); case UiControl.AddShellMenu: return(Get("/main_form/shell_menus", "Ajouter au menu contextuel")); case UiControl.Account: return(Get("/main_form/account", "Avancé")); case UiControl.Profile: return(Get("/main_form/profile", "Profile")); case UiControl.Add: return(Get("/new_account/add", "Ajouter")); case UiControl.Remove: return(Get("/main_form/remove", "Supprimer")); case UiControl.Details: return(Get("/main_form/details", "Détails")); case UiControl.WebUi: return(Get("/web_interface/web_int", "Interface web")); case UiControl.UseWebUi: return(Get("/web_interface/use_webint", "Utiliser l'interface web")); case UiControl.ViewInBrowser: return(Get("/web_interface/view", "(Voir dans le navigateur)")); case UiControl.WayOfSync: return(Get("/main_form/way_of_sync", "Style de synchronisation") + ":"); case UiControl.LocalToRemoteSync: return(Get("/main_form/local_to_remote", "Local to remote only")); case UiControl.RemoteToLocalSync: return(Get("/main_form/remote_to_local", "Remote to local only")); case UiControl.BothWaysSync: return(Get("/main_form/both_ways", "Dans les deux sens")); case UiControl.TempNamePrefix: return(Get("/main_form/temp_file_prefix", "Préfixe des fichiers temporaires") + ":"); case UiControl.Filters: return(Get("/main_form/file_filters", "Filtres")); case UiControl.Configure: return(Get("/main_form/configure", "Configurer")); case UiControl.Refresh: return(Get("/main_form/refresh", "Recharger")); case UiControl.IgnoredExtensions: return(Get("/main_form/ignored_extensions", "Extension ignorées")); case UiControl.AlsoIgnore: return(Get("/main_form/also_ignore", "Ignorer également") + ":"); case UiControl.Dotfiles: return(Get("/main_form/dotfiles", "Dot")); case UiControl.TempFiles: return(Get("/main_form/temp_files", "Fichiers temporaires")); case UiControl.FilesModifiedBefore: return(Get("/main_form/old_files", "Fichiers modifiés précédements") + ":"); case UiControl.Bandwidth: return(Get("/main_form/bandwidth", "Bande passante")); case UiControl.SyncFrequency: return(Get("/main_form/sync_freq", "Fréquence de synchronisation")); case UiControl.SyncWhen: return(Get("/main_form/sync_when", "Synchroniser les fichiers distants")); case UiControl.AutoEvery: return(Get("/main_form/auto", "Automatique toutes les")); case UiControl.Seconds: return(Get("/main_form/seconds", "secondes")); case UiControl.Manually: return(Get("/main_form/manually", "Manuel")); case UiControl.SpeedLimits: return(Get("/main_form/speed_limits", "Régulation de la bande passante")); case UiControl.DownLimit: return(Get("/main_form/limit_download", "Limite de téléchargement")); case UiControl.UpLimit: return(Get("/main_form/limit_upload", "Limite d'envoi")); case UiControl.NoLimits: return(Get("/main_form/no_limits", "( 0 pour aucune limite )")); case UiControl.Language: return(Get("/main_form/language", "Langage")); case UiControl.About: return(Get("/main_form/about", "À propos")); case UiControl.TheTeam: return(Get("/main_form/team", "L'équipe") + ":"); case UiControl.Website: return(Get("/main_form/website", "Site officiel") + ":"); case UiControl.Contact: return(Get("/main_form/contact", "Contact") + ":"); case UiControl.CodedIn: return(Get("/main_form/coded_in", "Codé en") + ":"); case UiControl.Notes: return(Get("/main_form/notes", "Notes")); case UiControl.Contribute: return(Get("/main_form/contribute", "Contribute")); case UiControl.FreeAndAll: return(Get("/main_form/ftpbox_is_free", "- iwit sync is provided by Iwit Systems")); case UiControl.GetInTouch: return(Get("/main_form/contact_me", "- Feel free to contact us for anything.")); case UiControl.ReportBug: return(Get("/main_form/report_bug", "Reporter un problème")); case UiControl.RequestFeature: return(Get("/main_form/request_feature", "Request a feature")); case UiControl.Donate: return(Get("/main_form/donate", "") + ":"); case UiControl.RecentFiles: return(Get("/tray/recent_files", "Fichier récent")); case UiControl.Modified: return(Get("/tray/modified", "Modifié")); case UiControl.StartSync: return(Get("/tray/start_syncing", "Synchroniser")); case UiControl.Exit: return(Get("/tray/exit", "Quitter")); // New Version Form case UiControl.UpdateAvailable: return(Get("/new_version/update_available", "Mise à jour disponible")); case UiControl.NewVersionAvailable: return(Get("/new_version/new_v_available", "New version of iwit sync is available")); case UiControl.CurrentVersion: return(Get("/new_version/current_version", "Current Version")); case UiControl.NewVersion: return(Get("/new_version/new_ver", "New Version")); case UiControl.AskDownload: return(Get("/new_version/wanna_download", "Do you want to download the new version now")); case UiControl.DownloadNow: return(Get("/new_version/download", "Update Now")); case UiControl.LearnMore: return(Get("/new_version/learn_more", "Learn More")); case UiControl.RemindLater: return(Get("/new_version/remind_me_next_time", "Not this time")); default: return(string.Empty); } } }
public string this[UiControl c] { get { switch(c) { // Setup case UiControl.LoginDetails: return Get("/new_account/login_details", "FTP login details"); case UiControl.Protocol: return Get("/main_form/mode", "Protocol") + ":"; case UiControl.Encryption: return Get("/new_account/encryption", "Encryption") + ":"; case UiControl.Host: return Get("/main_form/host", "Host") + ":"; case UiControl.Port: return Get("/main_form/port", "Port") + ":"; case UiControl.Username: return Get("/main_form/username", "Username") + ":"; case UiControl.Password: return Get("/main_form/password", "Password") + ":"; case UiControl.AskForPassword: return Get("/new_account/ask_for_password", "Always ask for password"); case UiControl.Authentication: return Get("/setup/authentication", "Authentication") + ":"; case UiControl.LocalFolder: return Get("/paths/local_folder", "Local folder"); case UiControl.DefaultLocalFolder: return Get("/paths/default_local", "I want to use the default local folder"); case UiControl.CustomLocalFolder: return Get("/paths/custom_local", "I want to select a local folder"); case UiControl.Browse: return Get("/paths/browse", "Browse"); case UiControl.RemotePath: return Get("/main_form/remote_path", "Remote Path"); case UiControl.FullRemotePath: return Get("/paths/full_path", "Full path") + ":"; case UiControl.SelectiveSync: return Get("/main_form/selective", "Selective Sync"); case UiControl.SyncAllFiles: return Get("/setup/sync_all_files", "I want to synchronize all files"); case UiControl.SyncSpecificFiles: return Get("/setup/sync_specific_files", "I want to select what files will be synchronized"); case UiControl.UncheckFiles: return Get("/main_form/selective_info", "Uncheck the items you don't want to sync") + ":"; case UiControl.Previous: return Get("/setup/previous", "Previous"); case UiControl.Next: return Get("/setup/next", "Next"); case UiControl.Finish: return Get("/new_account/done", "Done"); // Options case UiControl.Options: return Get("/main_form/options", "Options"); case UiControl.General: return Get("/main_form/general", "General"); case UiControl.Links: return Get("/main_form/links", "Links"); case UiControl.FullAccountPath: return Get("/main_form/account_full_path", "Account's full path") + ":"; case UiControl.WhenRecentFileClicked: return Get("/main_form/when_not_clicked", "When tray notification or recent file is clicked") + ":"; case UiControl.OpenUrl: return Get("/main_form/open_in_browser", "Open link in default browser"); case UiControl.CopyUrl: return Get("/main_form/copy", "Copy link to clipboard"); case UiControl.OpenLocal: return Get("/main_form/open_local", "Open the local file"); case UiControl.Application: return Get("/main_form/application", "Application"); case UiControl.ShowNotifications: return Get("/main_form/show_nots", "Show notifications"); case UiControl.StartOnStartup: return Get("/main_form/start_on_startup", "Start on system start-up"); case UiControl.EnableLogging: return Get("/main_form/enable_logging", "Enable Logging"); case UiControl.ViewLog: return Get("/main_form/view_log", "View Log"); case UiControl.Account: return Get("/main_form/account", "Account"); case UiControl.Profile: return Get("/main_form/profile", "Profile") + ":"; case UiControl.Add: return Get("/new_account/add", "Add"); case UiControl.Remove: return Get("/main_form/remove", "Remove"); case UiControl.Details: return Get("/main_form/details", "Details"); case UiControl.WebUi: return Get("/web_interface/web_int", "Web Interface"); case UiControl.UseWebUi: return Get("/web_interface/use_webint", "Use the Web Interface"); case UiControl.ViewInBrowser: return Get("/web_interface/view", "(View in browser)"); case UiControl.Filters: return Get("/main_form/file_filters", "Filters"); case UiControl.Configure: return Get("/main_form/configure", "Configure"); case UiControl.Refresh: return Get("/main_form/refresh", "Refresh"); case UiControl.IgnoredExtensions: return Get("/main_form/ignored_extensions", "Ignored Extensions"); case UiControl.AlsoIgnore: return Get("/main_form/also_ignore", "Also ignore") + ":"; case UiControl.Dotfiles: return Get("/main_form/dotfiles", "dotfiles"); case UiControl.TempFiles: return Get("/main_form/temp_files", "Temporary Files"); case UiControl.FilesModifiedBefore: return Get("/main_form/old_files", "Files modified before") + ":"; case UiControl.Bandwidth: return Get("/main_form/bandwidth", "Bandwidth"); case UiControl.SyncFrequency: return Get("/main_form/sync_freq", "Sync Frequency"); case UiControl.SyncWhen: return Get("/main_form/sync_when", "Synchronize remote files"); case UiControl.AutoEvery: return Get("/main_form/auto", "automatically every"); case UiControl.Seconds: return Get("/main_form/seconds", "seconds"); case UiControl.Manually: return Get("/main_form/manually", "manually"); case UiControl.SpeedLimits: return Get("/main_form/speed_limits", "Speed Limits"); case UiControl.DownLimit: return Get("/main_form/limit_download", "Limit Download Speed"); case UiControl.UpLimit: return Get("/main_form/limit_upload", "Limit Upload Speed"); case UiControl.NoLimits: return Get("/main_form/no_limits", "( set to 0 for no limits )"); case UiControl.Language: return Get("/main_form/language", "Language"); case UiControl.About: return Get("/main_form/about", "About"); case UiControl.TheTeam: return Get("/main_form/team", "The Team") + ":"; case UiControl.Website: return Get("/main_form/website", "Official Website") + ":"; case UiControl.Contact: return Get("/main_form/contact", "Contact") + ":"; case UiControl.CodedIn: return Get("/main_form/coded_in", "Coded in") + ":"; case UiControl.Notes: return Get("/main_form/notes", "Notes"); case UiControl.Contribute: return Get("/main_form/contribute", "Contribute"); case UiControl.FreeAndAll: return Get("/main_form/ftpbox_is_free", "- FTPbox is free and open-source"); case UiControl.GetInTouch: return Get("/main_form/contact_me", "- Feel free to contact me for anything."); case UiControl.ReportBug: return Get("/main_form/report_bug", "Report a bug"); case UiControl.RequestFeature: return Get("/main_form/request_feature", "Request a feature"); case UiControl.Donate: return Get("/main_form/donate", "Donate") + ":"; case UiControl.RecentFiles: return Get("/tray/recent_files", "Recent Files"); case UiControl.StartSync: return Get("/tray/start_syncing", "Start Syncing"); case UiControl.Exit: return Get("/tray/exit", "Exit"); // New Version Form case UiControl.UpdateAvailable: return Get("/new_version/update_available", "Update Available"); case UiControl.NewVersionAvailable: return Get("/new_version/new_v_available", "New version of FTPbox is available"); case UiControl.CurrentVersion: return Get("/new_version/current_version", "Current Version"); case UiControl.NewVersion: return Get("/new_version/new_ver", "New Version"); case UiControl.AskDownload: return Get("/new_version/wanna_download", "Do you want to download the new version now"); case UiControl.DownloadNow: return Get("/new_version/download", "Update Now"); case UiControl.LearnMore: return Get("/new_version/learn_more", "Learn More"); case UiControl.RemindLater: return Get("/new_version/remind_me_next_time", "Not this time"); default: return string.Empty; } } }
public static SlimDX.Color4 GetControlLineColor(UiControl control) { return new Color4(0.5f, 1f, 1f, 1f); }
public override void EndPick(Vector2 mousePos, PickType pickType, UiControl control) { }
public static SlimDX.Color4 GetControlTextColor(UiControl control, DisplayMode mode) { if (mode == DisplayMode.Hovering || (mode == DisplayMode.Auto && control.IsHovering == true)) { return new Color4(1f, 1f, 1f, 1f); } else if (mode == DisplayMode.Focused || (mode == DisplayMode.Auto && control.IsFocused == true)) { return new Color4(1f, 0f, 0f, 0f); } else if (mode == DisplayMode.Open) { return new Color4(1f, 0f, 0f, 0f); } else { return new Color4(1f, 1f, 1f, 1f); } }
public override bool BeginPick(SlimDX.Vector2 mousePos, out UiControl control) { control = null; return false; }
public void Press() { UiControl uiControl = UiControl.singleton; if (uiControl.isLoading) { return; } switch (bType) { case EditButtonType.erase: if (uiControl.isTextureUI) { return; } LevelEditor.singleton.editState = LevelEditor.EditState.remove; Color c = Color.white; c.a = 0; LevelEditor.singleton.targetColor = c; break; case EditButtonType.save: if (uiControl.isTextureUI) { return; } LevelEditor.singleton.SaveLevel(); break; case EditButtonType.load: if (uiControl.isTextureUI) { return; } LevelEditor.singleton.LoadLevel(); break; case EditButtonType.clearall: if (uiControl.isTextureUI) { return; } GameControl.singleton.InitLevelEditor(); break; case EditButtonType.startgame: if (uiControl.isTextureUI) { return; } GameControl.singleton.ChangeState(GameState.playGame); LevelEditor.singleton.editState = LevelEditor.EditState.paint; break; case EditButtonType.leveleditor: if (uiControl.isTextureUI) { return; } GameControl.singleton.ChangeState(GameState.levelEditor); LevelEditor.singleton.editState = LevelEditor.EditState.paint; break; case EditButtonType.mainmenu: if (uiControl.isTextureUI) { return; } GameControl.singleton.ChangeState(GameState.mainMenu); break; case EditButtonType.backbutton: if (uiControl.isTextureUI) { return; } GameControl.singleton.BackButton(); LevelEditor.singleton.editState = LevelEditor.EditState.paint; break; case EditButtonType.closeloadtextureui: uiControl.CloseLoadTextureUI(); break; case EditButtonType.openloadtextureui: if (uiControl.isTextureUI) { return; } uiControl.OpenLoadTextureUI(); break; case EditButtonType.loadtexturefromwww: uiControl.LoadTextureFromWWW(); break; case EditButtonType.createspawn: LevelEditor.singleton.editState = LevelEditor.EditState.spawnpoint; break; case EditButtonType.createexit: LevelEditor.singleton.editState = LevelEditor.EditState.exitpoint; break; /*case EditButtonType.createenemyspawn: * LevelEditor.singleton.editState = LevelEditor.EditState.enemyspawnpoint; * break;*/ case EditButtonType.exitgame: Application.Quit(); break; default: break; } }
public abstract void Changed(UiControl control);
public override void EndPick(SlimDX.Vector2 mousePos, PickType pickType, UiControl control) { base.EndPick(mousePos, pickType, control); UiControl par = Parent; switch (pickType) { case PickType.Focus: /* if (DoClick() == false) { Open(); } else { Close(); }*/ break; case PickType.UnFocus: if (control == null || control.IsDescendantOf(this) == false) { Close(); } break; default: break; } }