portaj.blogg.se

Xojo focus set control
Xojo focus set control









xojo focus set control
  1. #Xojo focus set control full#
  2. #Xojo focus set control plus#

Returning False means the key reaches the control. This would be useful if you want to override the behavior of the tab key for example. Returning True means the key is intercepted, preventing the key from actually reaching the control at all. How KeyDown works depends on the type of control. The user has pressed the Key passed while the control has the focus.

#Xojo focus set control full#

On macOS, controls other than text fields and lists will accept focus only if the full keyboard access option is enabled in System Preferences/Keyboard. The type of file that it can handle needs to have been specified in a call to AcceptFileDrop prior to the drop, for example, in the Opening event. The following DropObject event handler can handle either a dropped picture or a dropped file. The Action parameter specifies the type of drag action. The Obj parameter is the object being dragged. The item represented by Obj has been dropped on the control. The Action parameter specifies the type of drag action, which is typically done by holding down a modifier key (Shift, Alt, Option, Command, etc.) while doing the drag.ĭropObject(Obj As DragItem, Action As DragItem.Types) Return True from this event to prevent the drop from occurring. The coordinates x and y are relative to the DesktopUIControl. The Action parameter specifies the type of drag action.ĭragOver(x As Integer, y As Integer, obj As DragItem, Action As DragItem.Types) As Booleanįires when the DragItem is over the DesktopUIControl.

xojo focus set control

The Obj parameter is the item being dragged. IsFolder Then Return TrueĭragExit(obj As DragItem, Action As DragItem.Types)įires when the passed DragItem exits the DesktopUIControl. This simple event handler displays the value of the selected menu item. By returning False you can handle them all in a single event. This can be handy if you have the same contextual menu for several controls who share the same Parent (several on the same window for example). Returning False will cause the control's parent to execute its ContextualMenuAction event. Return True if this event has handled the item the user chose from the contextual menu. See the example of a contextual menu in the examples for the DesktopUIControl class. Use this in conjunction with ConstructContextualMenu if you have not specified the MenuItemSelected event or the Menu Handler for the items on the contextual menu. This event gives you a chance to handle the menu selection by inspecting the menuitem's Text or Tag properties to see which item was selected. TextSeparator )) Return TrueĭesktopUIControl.ContextualMenuItemSelectedĬontextualMenuItemSelected(HitItem As DesktopMenuItem) As Booleanįires when a contextual menuitem selectedItem was selected but the MenuItemSelected event and the MenuHandler for the DesktopMenuItem did not handle the menu selection. AddMenu ( New DesktopMenuItem ( DesktopMenuItem. AddMenu ( submenu ) // Add a Separator base. AddMenu ( New DesktopMenuItem ( "SubMenu Test 3" )) base. AddMenu ( New DesktopMenuItem ( "SubMenu Test 2" )) submenu. AddMenu ( New DesktopMenuItem ( "SubMenu Test 1" )) submenu. TextSeparator )) // Add a sub menu Var submenu As New DesktopMenuItem ( "SubMenu" ) submenu.

xojo focus set control

AddMenu ( New DesktopMenuItem ( "Test 3" )) // Add a Separator base. AddMenu ( New DesktopMenuItem ( "Test 2" )) base. AddMenu ( New DesktopMenuItem ( "Test 1" )) base.

#Xojo focus set control plus#

The following ConstructContextualMenu event handler builds a menu with three menu items plus a submenu with three additional menu items. See the example of a contextual menu in the following section. If the event was fired because of a non-mouse event, then x and y are both set to -1. The parameters x and y are the mouse locations. If you return True, the contextual menu is displayed. If you return False, the event is passed up the parent hierarchy. Any items you add to Base will be shown as menu items. Depending on platform, it might be in the MouseUp or MouseDown event and it might be a right+click or by pressing the contextual menu key on the keyboard, for example.īase is analogous to the menu bar for the contextual menu. This event handler is the recommended way to handle contextual menus because this event figures out whether the user has requested the contextual menu, regardless of how they did it. This event is called when it is appropriate to display a contextual menu for the control. Reporting bugs and making feature requestsĬonstructContextualMenu(Base As DesktopMenuItem, x As Integer, y As Integer) As Boolean.











Xojo focus set control