protected void Page_Load(object sender, EventArgs e) { ContextMenuControl contextMenuControl = new ContextMenuControl(); contextMenuControl.dirsFromText = "Desde aquí"; contextMenuControl.dirsToText = "Hasta aquí"; contextMenuControl.addDestinationText = "Añadir destino"; contextMenuControl.centerMapText = "Centrar mapa"; contextMenuControl.removePointText = "Eliminar punto"; contextMenuControl.whatsHereText = "¿Qué hay aquí?"; contextMenuControl.zoomInText = "Acercar"; contextMenuControl.zoomOutText = "Alejar"; contextMenuControl.fromText = "desde aquí hasta"; contextMenuControl.toText = "hasta aquí desde"; contextMenuControl.startAddressText = "Dirección inicial"; contextMenuControl.endAddressText = "Dirección final"; contextMenuControl.byCarText = "En coche"; contextMenuControl.avoidHighwaysText = "Evitar autopistas"; contextMenuControl.dragOrText = "Arrastrar o"; contextMenuControl.removeThisPointText = "eliminar este punto"; contextMenuControl.getDirectionText = "Buscar"; contextMenuControl.directionText = "Dirección"; contextMenuControl.previousText = "previo"; contextMenuControl.nextText = "posterior"; contextMenuControl.addressText = "Dirección"; GMap1.Add(new GControl(contextMenuControl)); }
public WorldMapGump() : base(400, 400, 100, 100, 0, 0) { CanMove = true; AcceptMouseInput = true; CanCloseWithRightClick = false; GameActions.Print("WorldMap loading...", 0x35); Load(); OnResize(); ContextMenuControl contextMenu = new ContextMenuControl(); contextMenu.Add("Flip map", () => _flipMap = !_flipMap, true, _flipMap); contextMenu.Add("Top Most", () => TopMost = !TopMost, true, _isTopMost); contextMenu.Add("Free view", () => { _freeView = !_freeView; if (!_freeView) { _isScrolling = false; CanMove = true; } }, true, _freeView); contextMenu.Add("Show party members", () => { _showPartyMembers = !_showPartyMembers; }, true, _showPartyMembers); contextMenu.Add("", null); contextMenu.Add("Close", Dispose); Add(contextMenu); }
public void CreateContextMenu(ContextMenuControlProperties props, string id, string title, string description, string maxWidth) { ContextMenu menu = new ContextMenu(this, id, title, description, null); if (props == null) { props = new ContextMenuControlProperties(); } props.CommandMenuOpen = ContextMenuRootProperties.CommandMenuOpen; props.CommandMenuClose = ContextMenuRootProperties.CommandMenuClose; ContextMenuControl control = new ContextMenuControl( this, id + "Launcher", props, menu); _createdMenuControls[id] = control; ContextMenuDock dock = new ContextMenuDock(this, "dock" + id); dock.AddChild(control.CreateComponentForDisplayMode("Menu")); this.AddChild(dock); this.Refresh(); }
/// <summary> /// Launch this MenuLauncher's Menu at given x and y /// </summary> public void ShowContextMenuAt(string id, HtmlElement elmHadFocus, int x, int y) { ContextMenuControl control = GetContextMenuControl(id); if (CUIUtility.IsNullOrUndefined(control)) { throw new ArgumentNullException("The context menu \"" + id + "\" does not exist"); } control.LaunchContextMenuAt(elmHadFocus, x, y); }
/// <summary> /// Obsolete API will be removed soon /// </summary> public void ShowContextMenu(string id, HtmlElement focusedElement, HtmlEvent triggeringEvent) { ContextMenuControl control = GetContextMenuControl(id); if (CUIUtility.IsNullOrUndefined(control)) { throw new ArgumentNullException("The context menu \"" + id + "\" does not exist"); } control.LaunchContextMenu(focusedElement, triggeringEvent); }
private void BuildGump() { ContextMenu?.Dispose(); ContextMenu = null; ContextMenu = new ContextMenuControl(); ContextMenu.Add("Flip map", () => _flipMap = !_flipMap, true, _flipMap); ContextMenu.Add("Top Most", () => TopMost = !TopMost, true, _isTopMost); ContextMenu.Add("Free view", () => { FreeView = !FreeView; }, true, _freeView); ContextMenu.Add("Show party members", () => { _showPartyMembers = !_showPartyMembers; }, true, _showPartyMembers); ContextMenu.Add("", null); ContextMenu.Add("Close", Dispose); }
private void BuildGump() { ContextMenu?.Dispose(); ContextMenu = null; ContextMenu = new ContextMenuControl(); ContextMenu.Add(LanguageManager.Current.UI_WorldMap_Flip, () => _flipMap = !_flipMap, true, _flipMap); ContextMenu.Add(LanguageManager.Current.UI_WorldMap_TopMost, () => TopMost = !TopMost, true, _isTopMost); ContextMenu.Add(LanguageManager.Current.UI_WorldMap_FreeView, () => { FreeView = !FreeView; }, true, _freeView); ContextMenu.Add(LanguageManager.Current.UI_WorldMap_ShowPartyMembers, () => { _showPartyMembers = !_showPartyMembers; }, true, _showPartyMembers); ContextMenu.Add("", null); ContextMenu.Add(LanguageManager.Current.UI_WorldMap_Close, Dispose); }
public CounterItem(int x, int y, int w, int h) { AcceptMouseInput = true; WantUpdateSize = false; CanMove = true; CanCloseWithRightClick = false; X = x; Y = y; Width = w; Height = h; _image = new ImageWithText(); Add(_image); ContextMenu = new ContextMenuControl(); ContextMenu.Add(ResGumps.UseObject, Use); ContextMenu.Add(ResGumps.Remove, RemoveItem); }
public CounterItem(int x, int y, int w, int h) { AcceptMouseInput = true; WantUpdateSize = false; CanMove = true; CanCloseWithRightClick = false; X = x; Y = y; Width = w; Height = h; _image = new ImageWithText(); Add(_image); ContextMenu = new ContextMenuControl(); ContextMenu.Add("Use object (Double click)", Use); ContextMenu.Add("Remove (ALT + Right click)", RemoveItem); }
public BehaviorTreeControl( ) : base() { m_nodes = new List <BehaviorNodeControl>(); m_nodeCache = new EditorNodeTypeCache(); m_nodeCache.CacheAvailableNodes(); AddDecorator(new Scrollbars()); m_canvas = ( GraphicsCanvas )AddDecorator(new GraphicsCanvas()); m_linkLine = ( BezierCurve )m_canvas.AddShape(new BezierCurve(Vector2.zero, Vector2.zero, Color.red, 1.0f, BezierCurve.TangentMode.AutoY, Vector2.zero, Vector2.zero)); m_linkLine.Tangents = BezierCurve.TangentMode.AutoY; ContextMenuControl ctx = new ContextMenuControl(); foreach (EditorCachedNode node in m_nodeCache.Cache) { ctx.Menu.AddItem(new GUIContent(node.displayName), false, AddNode, node); } ctx.Positionless = true; AddChild(ctx); }