/// <summary> /// Renders this display object and flushes it to the screen. /// </summary> public override void Invalidate() { // We must do this because the keyboard's width and height only match the art dimensions. // The actual size runs the whole screen length. Render(); Glide.Flush(Parent.X + X, Parent.Y + Y, Glide.LCD.Width, Height); }
/// <summary> /// Handles the touch move event. /// </summary> /// <param name="e">Touch event arguments.</param> /// <returns>Touch event arguments.</returns> public override TouchEventArgs OnTouchMove(TouchEventArgs e) { // The pressed state only triggers when touches occur within this UI element's boundaries. // This check guarantees whether we need to process move events or not. if (!_pressed) { return(e); } if (!_moving) { if (_ignoredTouchMoves < _maxIgnoredTouchMoves) { _ignoredTouchMoves++; } else { _moving = true; } } else { int dragDistance = e.Point.Y - _lastPressY; _listY = _lastListY - dragDistance; _listY = GlideUtils.Math.MinMax(_listY, 0, _listMaxY); Graphics.DrawImage(X, Y, _bitmap, 0, _listY, Width, Height); Glide.Flush(this); } e.StopPropagation(); return(e); }
/// <summary> /// Renders and flushes the specified key within the current view. /// </summary> /// <param name="index"></param> public void DrawKeyDown(int index) { if (index > -1 && index < _keyValues.Length) { Rectangle keyCoord = _keyCoords[index]; Parent.Graphics.DrawRectangle(0, 0, keyCoord.X, keyCoord.Y, keyCoord.Width, keyCoord.Height, 0, 0, 0, 0, 0, 0, 0, 0, 100); Glide.Flush(keyCoord); } else { string currentView = String.Empty; switch (_view) { case View.Letters: currentView = "Letters"; break; case View.Numbers: currentView = "Numbers"; break; case View.Symbols: currentView = "Symbols"; break; } throw new ArgumentOutOfRangeException("index", "Index does not exist within the " + currentView + " view."); } }
/// <summary> /// Renders this display object and flushes it to the screen. /// </summary> public virtual void Invalidate() { Render(); Glide.Flush(this); }