/Scenes/UserInterfaces/Controls/TODOToolTipPopup.cs
# · C# · 279 lines · 3 code · 32 blank · 244 comment · 0 complexity · ebe0b26b8e82942b51dbe6252aa2a7a8 MD5 · raw file
- namespace Delta.Scenes.UserInterfaces.Controls
- {
- // This class is disabled and probably not needed anymore
-
-
- ///// <summary>
- ///// Tool tip
- ///// </summary>
- ///// <returns>ISave binary</returns>
- //public class ToolTipPopup : ISaveLoadBinary
- //{
- // #region Public
- // #region Text
- // /// <summary>
- // /// Text
- // /// </summary>
- // public string Text
- // {
- // get { return popupControl.Text; } // get
- // set { popupControl.Text = value; } // set
- // } // Text
- // #endregion
-
- // /// <summary>
- // /// Defines the minimum wait time (in seconds) before the ToolTip pops up.
- // /// </summary>
- // public float MinWaitTime { get; set; } // MinWaitTime
-
- // #region RemainingTime (LOOK)
- // ///// <summary>
- // ///// Life time
- // ///// </summary>
- // //public float LifeTime { get; set; } // LifeTime
-
- // ///// <summary>
- // ///// Remaining time
- // ///// </summary>
- // //public float RemainingTime { get; set; } // RemainingTime
- // #endregion
-
- // #region Fade (LOOK)
- // ///// <summary>
- // ///// Life time
- // ///// </summary>
- // //public float FadeOut { get; set; } // LifeTime
-
- // ///// <summary>
- // ///// Fade in
- // ///// </summary>
- // //public float FadeIn { get; set; } // FadeIn
- // #endregion
- // #endregion
-
- // #region Private
- // /// <summary>
- // /// Popup control
- // /// </summary>
- // private Label popupControl;
-
- // /// <summary>
- // /// The UI control where this ToolTip belongs to and will be shown.
- // /// </summary>
- // private BaseControl owner;
-
- // /// <summary>
- // /// Represents the time (in seconds) that the mouse is over the owner
- // /// control.
- // /// </summary>
- // private float ownerPointingTime;
-
- // /// <summary>
- // /// Is active
- // /// </summary>
- // private bool isActive;
-
- // #region ShouldBeShown
- // /// <summary>
- // /// Returns 'true' if the ToolTip should be shown resp. drawn right now
- // /// (Just for internal rendering management in "BaseControl")
- // /// </summary>
- // internal bool ShouldBeShown
- // {
- // get
- // {
- // return ownerPointingTime >= MinWaitTime &&
- // String.IsNullOrEmpty(popupControl.Text) == false;
- // } // get
- // } // ShouldBeShown
- // #endregion
- // #endregion
-
- // #region Constructors
- // /// <summary>
- // /// Create tool tip control
- // /// </summary>
- // public ToolTipPopup()
- // {
- // popupControl = new Label
- // {
- // AnchorPoint = AnchorType.Middle,
- // //// We use here the "Text" layer, because we need a layer which is
- // //// rendered above the UI to make sure that a tooltip is always above
- // //// the parent control
- // //DrawLayer = RenderLayer.Text,
- // };
-
- // MinWaitTime = 1.0f; // seconds
- // isActive = false;
- // } // ToolTipPopup()
-
- // /// <summary>
- // /// Create tool tip popup
- // /// </summary>
- // /// <param name="reader">Reader</param>
- // public ToolTipPopup(BinaryReader reader)
- // : this()
- // {
- // Load(reader);
- // } // ToolTipPopup(reader)
- // #endregion
-
- // #region Methods
- // #region Attach (LOOK update positioning)
- // /// <summary>
- // /// Attaches resp. "registers" the ToolTip to the given UI control.
- // /// </summary>
- // /// <param name="setOwner">Set owner</param>
- // internal void Attach(BaseControl setOwner)
- // {
- // owner = setOwner;
- // //owner.Entered += OnOwnerEntered;
- // //owner.CursorMove += OnOwnerCursorMove;
- // //owner.Leaved += OnOwnerLeaved;
- // } // Attach(setOwner)
- // #endregion
-
- // #region Event handling methods
- // /// <summary>
- // /// On owner entered
- // /// </summary>
- // /// <param name="sender">Sender</param>
- // /// <param name="info">Info</param>
- // private void OnOwnerEntered(BaseControl sender, UIEventInfo info)
- // {
- // ownerPointingTime = 0.0f;
- // isActive = true;
- // popupControl.LocalPosition = Input.Mouse.Position +
- // new Point(0.0f, 0.025f);
-
- // // uneeded: info.IsHandled = true
- // // -> we just use that event "silently"
- // } // OnOwnerEntered(sender, info)
-
- // /// <summary>
- // /// On owner cursor move
- // /// </summary>
- // /// <param name="sender">Sender</param>
- // /// <param name="info">Info</param>
- // private void OnOwnerCursorMove(BaseControl sender, UIEventInfo info)
- // {
- // if (isActive)
- // {
- // popupControl.LocalPosition = info.AbsoluteEventPosition;
- // } // if
-
- // // uneeded: info.IsHandled = true
- // // -> we just use that event "silently"
- // } // OnOwnerCursorMove(sender, info)
-
- // /// <summary>
- // /// On owner leaved
- // /// </summary>
- // /// <param name="sender">Sender</param>
- // /// <param name="info">Info</param>
- // private void OnOwnerLeaved(BaseControl sender, UIEventInfo info)
- // {
- // ownerPointingTime = 0.0f;
- // isActive = false;
-
- // // uneeded: info.IsHandled = true
- // // -> we just use that event "silently"
- // } // OnOwnerLeaved(sender, info)
- // #endregion
-
- // #region Update
- // /// <summary>
- // /// Update
- // /// </summary>
- // internal void Update()
- // {
- // if (isActive)
- // {
- // ownerPointingTime += Time.Delta;
- // } // if
-
- // popupControl.Update();
-
- // //if (IsStarted)
- // //{
- // // float time = Time.Total - startTime;
- // // RemainingTime = LifeTime - time;
- // // if (RemainingTime > 0)
- // // {
- // // if (FadeIn - time > 0)
- // // {
- // // currentAlpha = 1 - ((FadeIn - time) / FadeIn);
- // // BlendColor = new Color(BlendColor, currentAlpha);
- // // } // if
- // // else if (LifeTime - FadeOut < time)
- // // {
- // // float currentAlpha = 1 - (time - (LifeTime - FadeOut)) /
- // // (LifeTime - FadeIn);
- // // BlendColor = new Color(BlendColor, currentAlpha);
- // // } // else if
- // // } // if
- // //} // if
- // } // Update()
- // #endregion
-
- // #region Show
- // /// <summary>
- // /// Shows the ToolTip.
- // /// </summary>
- // internal void Show()
- // {
- // popupControl.Draw();
- // } // Show()
- // #endregion
-
- // #region Dispose
- // /// <summary>
- // /// Disposes resp. "unregisters" the ToolTip from owner again.
- // /// </summary>
- // internal void Dispose()
- // {
- // // Just ignore that call if this ToolTip control is already disposed
- // if (owner == null)
- // {
- // return;
- // } // if
-
- // //owner.Entered -= OnOwnerEntered;
- // //owner.CursorMove -= OnOwnerCursorMove;
- // //owner.Leaved -= OnOwnerLeaved;
- // owner = null;
- // } // Dispose()
- // #endregion
-
- // #region ISaveLoadBinary Members
- // /// <summary>
- // /// Is outdated
- // /// </summary>
- // public bool IsOutdated
- // {
- // get { throw new NotImplementedException(); } // get
- // } // IsOutdated
-
- // /// <summary>
- // /// Save
- // /// </summary>
- // /// <param name="writer">Writer</param>
- // public void Save(BinaryWriter writer)
- // {
- // throw new NotImplementedException();
- // } // Save(writer)
-
- // /// <summary>
- // /// Load
- // /// </summary>
- // /// <param name="reader">Reader</param>
- // public void Load(BinaryReader reader)
- // {
- // throw new NotImplementedException();
- // } // Load(reader)
- // #endregion
- // #endregion
- //}
- }