PageRenderTime 103ms CodeModel.GetById 61ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/Scenes/UserInterfaces/Controls/TODOToolTipPopup.cs

#
C# | 279 lines | 3 code | 32 blank | 244 comment | 0 complexity | ebe0b26b8e82942b51dbe6252aa2a7a8 MD5 | raw file
  1
  2namespace Delta.Scenes.UserInterfaces.Controls
  3{
  4	// This class is disabled and probably not needed anymore
  5
  6
  7	///// <summary>
  8	///// Tool tip
  9	///// </summary>
 10	///// <returns>ISave binary</returns>
 11	//public class ToolTipPopup : ISaveLoadBinary
 12	//{
 13	//  #region Public
 14	//  #region Text
 15	//  /// <summary>
 16	//  /// Text
 17	//  /// </summary>
 18	//  public string Text
 19	//  {
 20	//    get { return popupControl.Text; } // get
 21	//    set { popupControl.Text = value; } // set
 22	//  } // Text
 23	//  #endregion
 24
 25	//  /// <summary>
 26	//  /// Defines the minimum wait time (in seconds) before the ToolTip pops up.
 27	//  /// </summary>
 28	//  public float MinWaitTime { get; set; } // MinWaitTime
 29
 30	//  #region RemainingTime (LOOK)
 31	//  ///// <summary>
 32	//  ///// Life time
 33	//  ///// </summary>
 34	//  //public float LifeTime { get; set; } // LifeTime
 35
 36	//  ///// <summary>
 37	//  ///// Remaining time
 38	//  ///// </summary>
 39	//  //public float RemainingTime { get; set; } // RemainingTime
 40	//  #endregion
 41
 42	//  #region Fade (LOOK)
 43	//  ///// <summary>
 44	//  ///// Life time
 45	//  ///// </summary>
 46	//  //public float FadeOut { get; set; } // LifeTime
 47
 48	//  ///// <summary>
 49	//  ///// Fade in
 50	//  ///// </summary>
 51	//  //public float FadeIn { get; set; } // FadeIn
 52	//  #endregion
 53	//  #endregion
 54
 55	//  #region Private
 56	//  /// <summary>
 57	//  /// Popup control
 58	//  /// </summary>
 59	//  private Label popupControl;
 60
 61	//  /// <summary>
 62	//  /// The UI control where this ToolTip belongs to and will be shown.
 63	//  /// </summary>
 64	//  private BaseControl owner;
 65
 66	//  /// <summary>
 67	//  /// Represents the time (in seconds) that the mouse is over the owner
 68	//  /// control.
 69	//  /// </summary>
 70	//  private float ownerPointingTime;
 71
 72	//  /// <summary>
 73	//  /// Is active
 74	//  /// </summary>
 75	//  private bool isActive;
 76
 77	//  #region ShouldBeShown
 78	//  /// <summary>
 79	//  /// Returns 'true' if the ToolTip should be shown resp. drawn right now
 80	//  /// (Just for internal rendering management in "BaseControl")
 81	//  /// </summary>
 82	//  internal bool ShouldBeShown
 83	//  {
 84	//    get
 85	//    {
 86	//      return ownerPointingTime >= MinWaitTime &&
 87	//        String.IsNullOrEmpty(popupControl.Text) == false;
 88	//    } // get
 89	//  } // ShouldBeShown
 90	//  #endregion
 91	//  #endregion
 92
 93	//  #region Constructors
 94	//  /// <summary>
 95	//  /// Create tool tip control
 96	//  /// </summary>
 97	//  public ToolTipPopup()
 98	//  {
 99	//    popupControl = new Label
100	//    {
101	//      AnchorPoint = AnchorType.Middle,
102	//      //// We use here the "Text" layer, because we need a layer which is
103	//      //// rendered above the UI to make sure that a tooltip is always above
104	//      //// the parent control
105	//      //DrawLayer = RenderLayer.Text,
106	//    };
107
108	//    MinWaitTime = 1.0f; // seconds
109	//    isActive = false;
110	//  } // ToolTipPopup()
111
112	//  /// <summary>
113	//  /// Create tool tip popup
114	//  /// </summary>
115	//  /// <param name="reader">Reader</param>
116	//  public ToolTipPopup(BinaryReader reader)
117	//    : this()
118	//  {
119	//    Load(reader);
120	//  } // ToolTipPopup(reader)
121	//  #endregion
122
123	//  #region Methods
124	//  #region Attach (LOOK update positioning)
125	//  /// <summary>
126	//  /// Attaches resp. "registers" the ToolTip to the given UI control.
127	//  /// </summary>
128	//  /// <param name="setOwner">Set owner</param>
129	//  internal void Attach(BaseControl setOwner)
130	//  {
131	//    owner = setOwner;
132	//    //owner.Entered += OnOwnerEntered;
133	//    //owner.CursorMove += OnOwnerCursorMove;
134	//    //owner.Leaved += OnOwnerLeaved;
135	//  } // Attach(setOwner)
136	//  #endregion
137
138	//  #region Event handling methods
139	//  /// <summary>
140	//  /// On owner entered
141	//  /// </summary>
142	//  /// <param name="sender">Sender</param>
143	//  /// <param name="info">Info</param>
144	//  private void OnOwnerEntered(BaseControl sender, UIEventInfo info)
145	//  {
146	//    ownerPointingTime = 0.0f;
147	//    isActive = true;
148	//    popupControl.LocalPosition = Input.Mouse.Position +
149	//      new Point(0.0f, 0.025f);
150
151	//    // uneeded: info.IsHandled = true
152	//    // -> we just use that event "silently"
153	//  } // OnOwnerEntered(sender, info)
154
155	//  /// <summary>
156	//  /// On owner cursor move
157	//  /// </summary>
158	//  /// <param name="sender">Sender</param>
159	//  /// <param name="info">Info</param>
160	//  private void OnOwnerCursorMove(BaseControl sender, UIEventInfo info)
161	//  {
162	//    if (isActive)
163	//    {
164	//      popupControl.LocalPosition = info.AbsoluteEventPosition;
165	//    } // if
166
167	//    // uneeded: info.IsHandled = true
168	//    // -> we just use that event "silently"
169	//  } // OnOwnerCursorMove(sender, info)
170
171	//  /// <summary>
172	//  /// On owner leaved
173	//  /// </summary>
174	//  /// <param name="sender">Sender</param>
175	//  /// <param name="info">Info</param>
176	//  private void OnOwnerLeaved(BaseControl sender, UIEventInfo info)
177	//  {
178	//    ownerPointingTime = 0.0f;
179	//    isActive = false;
180
181	//    // uneeded: info.IsHandled = true
182	//    // -> we just use that event "silently"
183	//  } // OnOwnerLeaved(sender, info)
184	//  #endregion
185
186	//  #region Update
187	//  /// <summary>
188	//  /// Update
189	//  /// </summary>
190	//  internal void Update()
191	//  {
192	//    if (isActive)
193	//    {
194	//      ownerPointingTime += Time.Delta;
195	//    } // if
196
197	//    popupControl.Update();
198
199	//    //if (IsStarted)
200	//    //{
201	//    //  float time = Time.Total - startTime;
202	//    //  RemainingTime = LifeTime - time;
203	//    //  if (RemainingTime > 0)
204	//    //  {
205	//    //    if (FadeIn - time > 0)
206	//    //    {
207	//    //      currentAlpha = 1 - ((FadeIn - time) / FadeIn);
208	//    //      BlendColor = new Color(BlendColor, currentAlpha);
209	//    //    } // if
210	//    //    else if (LifeTime - FadeOut < time)
211	//    //    {
212	//    //      float currentAlpha = 1 - (time - (LifeTime - FadeOut)) / 
213	//    //                          (LifeTime - FadeIn);
214	//    //      BlendColor = new Color(BlendColor, currentAlpha);
215	//    //    } // else if
216	//    //  } // if
217	//    //} // if
218	//  } // Update()
219	//  #endregion
220
221	//  #region Show
222	//  /// <summary>
223	//  /// Shows the ToolTip.
224	//  /// </summary>
225	//  internal void Show()
226	//  {
227	//    popupControl.Draw();
228	//  } // Show()
229	//  #endregion
230
231	//  #region Dispose
232	//  /// <summary>
233	//  /// Disposes resp. "unregisters" the ToolTip from owner again.
234	//  /// </summary>
235	//  internal void Dispose()
236	//  {
237	//    // Just ignore that call if this ToolTip control is already disposed
238	//    if (owner == null)
239	//    {
240	//      return;
241	//    } // if
242
243	//    //owner.Entered -= OnOwnerEntered;
244	//    //owner.CursorMove -= OnOwnerCursorMove;
245	//    //owner.Leaved -= OnOwnerLeaved;
246	//    owner = null;
247	//  } // Dispose()
248	//  #endregion
249
250	//  #region ISaveLoadBinary Members
251	//  /// <summary>
252	//  /// Is outdated
253	//  /// </summary>
254	//  public bool IsOutdated
255	//  {
256	//    get { throw new NotImplementedException(); } // get
257	//  } // IsOutdated
258
259	//  /// <summary>
260	//  /// Save
261	//  /// </summary>
262	//  /// <param name="writer">Writer</param>
263	//  public void Save(BinaryWriter writer)
264	//  {
265	//    throw new NotImplementedException();
266	//  } // Save(writer)
267
268	//  /// <summary>
269	//  /// Load
270	//  /// </summary>
271	//  /// <param name="reader">Reader</param>
272	//  public void Load(BinaryReader reader)
273	//  {
274	//    throw new NotImplementedException();
275	//  } // Load(reader)
276	//  #endregion
277	//  #endregion
278	//}
279}