protected override void OnKeyDown(UIKeyEventArgs e) { //handle special keydown if (e.Ctrl) { //control switch (e.KeyCode) { case UIKeys.V: { this.DesignBoardModule.PasteClipboardData(); } break; case UIKeys.Z: { //undo this.DesignBoardModule.UndoLastAction(); } break; case UIKeys.Y: { //redo } break; } } base.OnKeyDown(e); }
void simpleBox_KeyDown(object sender, UIKeyEventArgs e) { if (selectedItem != null && ListItemKeyboardEvent != null) { e.UIEventName = UIEventName.KeyDown; ListItemKeyboardEvent(this, e); } //switch (e.KeyCode) //{ // case UIKeys.Down: // { // e.CancelBubbling = true; // SelectedIndex++; // } break; // case UIKeys.Up: // { // e.CancelBubbling = true; // SelectedIndex--; // } break; // case UIKeys.Enter: // { // //accept selected item? // if (selectedItem != null && ListItemKeyboardEvent != null) // { // ListItemKeyboardEvent(this, e); // } // } // break; // case UIKeys.Escape: // // // break; //} }
protected override bool OnProcessDialogKey(UIKeyEventArgs e) { if (_gridSelectionSession != null && _gridSelectionSession.Started) { switch (e.KeyCode) { case UIKeys.Left: _gridSelectionSession.MoveLeft(); break; case UIKeys.Right: _gridSelectionSession.MoveRight(); break; case UIKeys.Up: _gridSelectionSession.MoveUp(); break; case UIKeys.Down: _gridSelectionSession.MoveDown(); break; } } return(false); }
internal static void NofitySplitNewLine(TextSurfaceEventListener listener, UIKeyEventArgs e) { if (listener.SplitedNewLine != null) { listener.SplitedNewLine(listener, e); } }
void sgBox_ListItemKeyboardEvent(object sender, UIKeyEventArgs e) { //keyboard event occurs on list item in suggestion box // switch (e.UIEventName) { case UIEventName.KeyDown: { switch (e.KeyCode) { case UIKeys.Down: _sgBox.SelectedIndex++; e.CancelBubbling = true; break; case UIKeys.Up: _sgBox.SelectedIndex--; e.CancelBubbling = true; break; case UIKeys.Enter: //use select some item sgBox_UserConfirmSelectedItem(null, EventArgs.Empty); e.CancelBubbling = true; break; default: _textbox.Focus(); break; } } break; } }
void listView_ListItemKeyboardEvent(object sender, UIKeyEventArgs e) { if (ListItemKeyboardEvent != null) { ListItemKeyboardEvent(this, e); } }
bool ITopWindowEventRoot.RootProcessDialogKey(int keyData) { UI.UIKeys k = (UIKeys)keyData; if (_currentKbFocusElem == null) { //set _lastKeydownWithShift = ((k & UIKeys.Shift) == UIKeys.Shift); _lastKeydownWithAlt = ((k & UIKeys.Alt) == UIKeys.Alt); _lastKeydownWithControl = ((k & UIKeys.Control) == UIKeys.Control); return(false); } StopCaretBlink(); UIKeyEventArgs e = GetFreeKeyEvent(); e.KeyData = (int)keyData; e.SetEventInfo( (int)keyData, _lastKeydownWithShift = ((k & UIKeys.Shift) == UIKeys.Shift), _lastKeydownWithAlt = ((k & UIKeys.Alt) == UIKeys.Alt), _lastKeydownWithControl = ((k & UIKeys.Control) == UIKeys.Control)); bool result = false; e.ExactHitObject = e.SourceHitElement = _currentKbFocusElem; result = _currentKbFocusElem.ListenProcessDialogKey(e); ReleaseKeyEvent(e); return(result); }
bool IEventPortal.PortalProcessDialogKey(UIKeyEventArgs e) { e.CurrentContextElement = this; var result = GetInputEventAdapter().ProcessDialogKey(e, htmlRenderBox.CssBox); return(result); }
public static void SetEventInfo(this UIKeyEventArgs e, bool shift, bool alt, bool control, UIEventName eventName) { e.Shift = shift; e.Alt = alt; e.Ctrl = control; e._eventName = eventName; }
protected override void OnKeyDown(UIKeyEventArgs e) { if (_gridSelectionSession != null && _gridSelectionSession.Started) { switch (e.KeyCode) { case UIKeys.Home: _gridSelectionSession.MoveHome(); break; case UIKeys.End: _gridSelectionSession.MoveEnd(); break; case UIKeys.A: if (e.Ctrl) { //ctrl+a _gridSelectionSession.SelectAll(); } break; } } base.OnKeyDown(e); }
public override void HandleKeyUp(UIKeyEventArgs e) { this.SetCaretVisible(true); if (_textSurfaceEventListener != null) { TextSurfaceEventListener.NotifyKeyDown(_textSurfaceEventListener, e);; } }
protected override void OnKeyDown(UIKeyEventArgs e) { if (_selectedItem != null && ListItemKeyboardEvent != null) { ListItemKeyboardEvent(this, e); } base.OnKeyDown(e); }
void simpleBox_KeyDown(object sender, UIKeyEventArgs e) { if (selectedItem != null && ListItemKeyboardEvent != null) { e.UIEventName = UIEventName.KeyDown; ListItemKeyboardEvent(this, e); } }
protected override bool OnProcessDialogKey(UIKeyEventArgs e) { if (textEditRenderElement.OnProcessDialogKey(e)) { e.CancelBubbling = true; return(true); } return(false); }
public override void HandleKeyPress(UIKeyEventArgs e) { this.SetCaretVisible(true); //------------------------ if (e.IsControlCharacter) { HandleKeyDown(e); return; } e.CancelBubbling = true; InvalidateGraphicOfCurrentSelectionArea(); bool preventDefault = false; if (_textSurfaceEventListener != null && !(preventDefault = TextSurfaceEventListener.NotifyPreviewKeyPress(_textSurfaceEventListener, e))) { _editSession.UpdateSelectionRange(); } if (preventDefault) { return; } if (_isEditable) { int insertAt = _editSession.CurrentLineCharIndex; _editSession.AddCharToCurrentLine(e.KeyChar); if (_textSurfaceEventListener != null) { //TODO: review this again *** if (_editSession.SelectionRange != null) { TextSurfaceEventListener.NotifyCharacterReplaced(_textSurfaceEventListener, e.KeyChar); } else { TextSurfaceEventListener.NotifyCharacterAdded(_textSurfaceEventListener, insertAt, e.KeyChar); } } } EnsureCaretVisible(); if (_textSurfaceEventListener != null) { TextSurfaceEventListener.NotifyKeyDown(_textSurfaceEventListener, e);; } }
public void OnKeyPress(UIKeyEventArgs e) { this.SetCaretState(true); //------------------------ if (e.IsControlCharacter) { OnKeyDown(e); return; } char c = e.KeyChar; e.CancelBubbling = true; if (internalTextLayerController.SelectionRange != null && internalTextLayerController.SelectionRange.IsValid) { InvalidateGraphicLocalArea(this, GetSelectionUpdateArea()); } bool preventDefault = false; if (textSurfaceEventListener != null && !(preventDefault = TextSurfaceEventListener.NotifyPreviewKeydown(textSurfaceEventListener, c))) { internalTextLayerController.UpdateSelectionRange(); } if (preventDefault) { return; } if (internalTextLayerController.SelectionRange != null) { internalTextLayerController.AddCharToCurrentLine(c); if (textSurfaceEventListener != null) { TextSurfaceEventListener.NotifyCharactersReplaced(textSurfaceEventListener, e.KeyChar); } } else { internalTextLayerController.AddCharToCurrentLine(c); if (textSurfaceEventListener != null) { TextSurfaceEventListener.NotifyCharacterAdded(textSurfaceEventListener, e.KeyChar); } } EnsureCaretVisible(); if (textSurfaceEventListener != null) { TextSurfaceEventListener.NotifyKeyDown(textSurfaceEventListener, e.KeyCode); } }
void ITopWindowEventRoot.RootKeyPress(char c) { if (_currentKbFocusElem == null) { return; } StopCaretBlink(); UIKeyEventArgs e = GetFreeKeyEvent(); e.SetKeyChar(c); e.ExactHitObject = e.SourceHitElement = _currentKbFocusElem; _currentKbFocusElem.ListenKeyPress(e); _iTopBoxEventPortal.PortalKeyPress(e); ReleaseKeyEvent(e); }
//------------------- protected override bool OnProcessDialogKey(UIKeyEventArgs e) { if (KeyDown != null) { KeyDown(this, e); } //return true if you want to stop event bubble to other if (e.CancelBubbling) { return(true); } else { return(base.OnProcessDialogKey(e)); } }
void ITopWindowEventRoot.RootKeyDown(int keydata) { if (_currentKbFocusElem == null) { return; } UIKeyEventArgs e = GetFreeKeyEvent(); SetKeyData(e, keydata); StopCaretBlink(); e.ExactHitObject = e.SourceHitElement = _currentKbFocusElem; _currentKbFocusElem.ListenKeyDown(e); _iTopBoxEventPortal.PortalKeyDown(e); ReleaseKeyEvent(e); }
public virtual void HandleKeyPress(UIKeyEventArgs e) { //------------------------ if (e.IsControlCharacter) { HandleKeyDown(e); return; } #if DEBUG char c = e.KeyChar; #endif e.CancelBubbling = true; InvalidateGraphicOfCurrentSelectionArea(); _editSession.UpdateSelectionRange(); EnsureCaretVisible(); }
protected override void OnKeyUp(UIKeyEventArgs e) { if (e.Ctrl) { switch (e.KeyCode) { case UIKeys.C: { //ctrl+ c => copy to clipboard StringBuilder stbuilder = new StringBuilder(); this.myHtmlCont.CopySelection(stbuilder); LayoutFarm.UI.Clipboard.SetText(stbuilder.ToString()); } break; } } e.CurrentContextElement = this; }
void ITopWindowEventRoot.RootKeyUp(int keydata) { if (currentKbFocusElem == null) { return; } StopCaretBlink(); UIKeyEventArgs e = GetFreeKeyEvent(); SetKeyData(e, keydata); //---------------------------------------------------- e.ExactHitObject = e.SourceHitElement = currentKbFocusElem; currentKbFocusElem.ListenKeyUp(e); iTopBoxEventPortal.PortalKeyUp(e); //---------------------------------------------------- ReleaseKeyEvent(e); StartCaretBlink(); }
protected override void OnKeyDown(UIKeyEventArgs e) { if (e.Ctrl) { switch (e.KeyCode) { case UIKeys.C: { //copy this box to a clipboard*** //copy this content to clipboard this.DesignBoardModule.CopyToClipBoard(this.TargetBox as IDesignBox); } break; } } else { switch (e.KeyCode) { case UIKeys.Delete: { //------------------------------------- //add action history to design board? //------------------------------------- //remove the target and its controller var masterCollectionSet = this.MasterSelectionSet; this.RelaseTargetAndRemoveSelf(); if (masterCollectionSet != null) { //remove other from selection set too! masterCollectionSet.NotifyRemoveUIElement(this); } } break; } } base.OnKeyDown(e); }
void ITopWindowEventRoot.RootKeyUp(int keydata) { if (_currentKbFocusElem == null) { _lastKeydownWithShift = _lastKeydownWithAlt = _lastKeydownWithControl = false; return; } StopCaretBlink(); UIKeyEventArgs e = GetFreeKeyEvent(); SetKeyData(e, keydata); //---------------------------------------------------- e.ExactHitObject = e.SourceHitElement = _currentKbFocusElem; _currentKbFocusElem.ListenKeyUp(e); _iTopBoxEventPortal.PortalKeyUp(e); //---------------------------------------------------- ReleaseKeyEvent(e); StartCaretBlink(); _lastKeydownWithShift = _lastKeydownWithControl = _lastKeydownWithAlt = false; }
//------------------------------------------------------------ protected virtual void OnKeyDown(UIKeyEventArgs e) { }
protected virtual bool OnProcessDialogKey(UIKeyEventArgs e) { return(false); }
protected virtual void OnKeyPress(UIKeyEventArgs e) { }
protected virtual void OnKeyUp(UIKeyEventArgs e) { }
void IEventListener.ListenKeyPress(UIKeyEventArgs e) { OnKeyPress(e); }
bool IEventListener.ListenProcessDialogKey(UIKeyEventArgs e) { return(OnProcessDialogKey(e)); }
protected virtual bool OnProcessDialogKey(UIKeyEventArgs e) { return false; }
void IEventListener.ListenKeyDown(UIKeyEventArgs e) { OnKeyDown(e); }
void IEventListener.ListenKeyUp(UIKeyEventArgs e) { OnKeyUp(e); }
bool IEventListener.ListenProcessDialogKey(UIKeyEventArgs e) { return OnProcessDialogKey(e); }