public void AppendContextMenuItems(System.Windows.Forms.ContextMenuStrip strip, object context) { PlugInManager compMan = new PlugInManager(); List<IOrder> items = new List<IOrder>(); foreach (XmlNode toolNode in compMan.GetPluginNodes(Plugins.Type.IExTool)) { IContextMenuItem item = compMan.CreateInstance(toolNode) as IContextMenuItem; if (item == null || !item.ShowWith(context) || !(item is IExTool)) continue; ((IExTool)item).OnCreate(_application); items.Add(item); } items.Sort(new SortByIOrder()); int l = -1; foreach (IContextMenuItem item in items) { if (Math.Abs(l - (int)(item.SortOrder / 10)) != 0) { l = item.SortOrder / 10; if (strip.Items.Count > 0) strip.Items.Add(new System.Windows.Forms.ToolStripSeparator()); } ToolMenuItem toolItem = new ToolMenuItem(item as IExTool); toolItem.Click += new EventHandler(ToolButton_Click); strip.Items.Add(toolItem); } }
void SelecteToolMenuItem(ToolMenuItem menuItem) { switch (menuItem.mode) { case (InputMode.DRAW): SetMode(InputMode.DRAW); toolCollection [modeNum].SetColor(menuItem.colorIndex); toolCollection [modeNum].SetScale(menuItem.brushSize); break; case (InputMode.MICROPHONE): break; } }
public Stage GetStage(ToolMenuItem item) { while (item.Owner != null) { item = item.Owner as ToolMenuItem; if (item == null) { break; } if (item.Tag is Stage) { return((Stage)item.Tag); } } return(null); }
public UserLogView() { toolModeGroup = new ToolMenuItem { Name = "Group", Tag = DataLogMode.Group }; toolModeUser = new ToolMenuItem { Name = "User", Tag = DataLogMode.User }; toolMode.DropDownItems.AddRange(new[] { toolModeGroup, toolModeUser }); toolTypeAuthorization = new ToolMenuItem() { Checked = true, Name = "Authorization", Tag = UserRegType.Authorization }; toolTypePassword = new ToolMenuItem { Checked = true, Name = "Password", Tag = UserRegType.Password }; toolTypeStart = new ToolMenuItem { Checked = true, Name = "Start", Tag = UserRegType.Start }; toolTypeStop = new ToolMenuItem { Checked = true, Name = "Stop", Tag = UserRegType.Stop }; toolTypeProcedure = new ToolMenuItem { Checked = true, Name = "Procedure", Tag = UserRegType.Execute }; toolTypeTransaction = new ToolMenuItem { Checked = true, Name = "Transaction", Tag = UserRegType.Transaction }; toolType = new ToolDropDown( toolTypeAuthorization, toolTypePassword, toolTypeStart, toolTypeStop, toolTypeProcedure, toolTypeTransaction) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "LogType" }; toolType.ItemClick += ToolTypeItemClicked; toolMode.InsertAfter(toolType); Name = "UserLog"; }
public TableEditor() : base(new TableLayoutList()) { toolInsert.Remove(); //toolInsertLine = new ToolMenuItem(OnToolInsertLineClick) { Name = "Insert Line", Glyph = GlyphType.ChevronCircleRight }; //toolAdd.DropDownItems.Add(toolInsertLine); toolReference = new ToolDropDown() { Name = "References", Visible = false, DisplayStyle = ToolItemDisplayStyle.Text, DropDown = new Menubar { Name = "References" } }; toolMerge = new ToolMenuItem(OnToolMergeClick) { Name = "Merge", Glyph = GlyphType.PaperPlane }; toolReport = new ToolMenuItem(ToolReportClick) { Name = "Report", Glyph = GlyphType.FileExcelO }; toolParam = new ToolDropDown(toolMerge, toolReport) { Name = "Parameters", Glyph = GlyphType.GearAlias }; loader = new TableLoader(); toolProgress = new ToolTableLoader { Loader = loader }; Bar.Items.Add(toolReference); Bar.Items.Add(toolParam); Bar.Items.Add(toolProgress); List.CellValueWrite += FieldsCellValueChanged; Name = "TableEditor"; question = new QuestionMessage { Text = "Checkout" }; question.Buttons.Add(Command.No); question.Buttons.Add(Command.Yes); }
//public void IntDBSchema() //{ // toolTable.DropDownItems.Clear(); // if (state == SearchState.Edit) // foreach (DBSchema sc in DBService.Schems) // toolTable.DropDownItems.Add(InitSchemaTool(sc)); // else if (state == SearchState.Reference && owner != null) // if (owner.Column.IsPrimaryKey) // { // List<DBRelation> relations = owner.Column.Table.GetChildRelations(); // foreach (DBRelation relation in relations) // toolTable.DropDownItems.Add(InitTableTool(relation.Table)); // } // else if (owner.Column.ReferenceTable != null) // { // toolTable.DropDownItems.Add(InitTableTool(owner.Column.ReferenceTable)); // Table = owner.Column.ReferenceTable; // toolTable.Sensitive = false; // } //} protected ToolMenuItem InitSchemaTool(DBSchema schema) { var item = new ToolMenuItem { Tag = schema, Name = schema.Name, Text = schema.ToString(), DropDown = new Menubar { Name = schema.Name } }; var list = new SelectableList <DBTable>(schema.Tables); list.ApplySortInternal("Name", ListSortDirection.Ascending); foreach (DBTable ts in list) { if (ts.Access.GetFlag(AccessType.Admin, GuiEnvironment.User)) { item.DropDown.Items.Add(InitTableTool(ts)); } } return(item); }
private ToolStripItem ContextMenuConvert(ToolMenuItem menu) { if (menu is ToolMenuItemSeparator) { return(new STToolStripSeparator()); } ToolStripMenuItem toolStripItem = new STToolStipMenuItem(menu.Name); if (menu.Click != null) { toolStripItem.Click += menu.Click; } foreach (var child in menu.Children) { toolStripItem.DropDownItems.Add(ContextMenuConvert(child)); } return(toolStripItem); }
void FlexViewer_PrepareToolMenu(object sender, EventArgs e) { var items = ((C1FlexViewer)sender).ToolMenuItems; for (int i = items.Count - 1; i >= 0; i--) { switch (items[i].Tool) { case FlexViewerTool.PageSettings: case FlexViewerTool.Parameters: items.RemoveAt(i); break; } } items.Insert(0, new ToolMenuItem("\xE155", FlexViewerTool.CustomTool1, Strings.OpenToolLabel)); _useSystemRenderingToolItem = new ToolMenuItem(_pdfDocSource.UseSystemRendering ? c_CheckedGlyph : c_UncheckedGlyph, FlexViewerTool.CustomTool3, Strings.UseSystemRenderingToolLabel); items.Add(_useSystemRenderingToolItem); _closeToolItem = new ToolMenuItem("\xE10A", FlexViewerTool.CustomTool2, Strings.CloseToolLabel); items.Add(_closeToolItem); }
public void Initialize(IDBTableView view, DBItem row, DBColumn ownColumn, TableEditorMode openmode, bool readOnly) { TableView = view; OwnerColumn = ownColumn; OwnerRow = row; if (Table == null) { return; } ReadOnly = readOnly; OpenMode = openmode; Name = Table.Name.Replace(" ", "_") + ownColumn; Text = GetText(this); // toolInsert.DropDownItems.Clear(); if (openmode == TableEditorMode.Referencing) { foreach (var cs in Table.Columns.GetIsReference()) { if (cs.ReferenceTable != null && cs.Name.ToLower() != baseColumn.Name.ToLower()) { var item = new ToolMenuItem { Tag = cs, Name = cs.Name, Text = cs.ToString() }; toolAdd.DropDownItems.Add(item); } } //toolInsert.Add(new SeparatorToolItem ()); } }
public void AppendContextMenuItems(global::System.Windows.Forms.ContextMenuStrip strip, object context) { PlugInManager compMan = new PlugInManager(); List <IOrder> items = new List <IOrder>(); foreach (var toolType in compMan.GetPlugins(gView.Framework.system.Plugins.Type.IExTool)) { IContextMenuItem item = compMan.TryCreateInstance <IContextMenuItem>(toolType); if (item == null || !item.ShowWith(context) || !(item is IExTool)) { continue; } ((IExTool)item).OnCreate(_application); items.Add(item); } items.Sort(new SortByIOrder()); int l = -1; foreach (IContextMenuItem item in items) { if (Math.Abs(l - item.SortOrder / 10) != 0) { l = item.SortOrder / 10; if (strip.Items.Count > 0) { strip.Items.Add(new global::System.Windows.Forms.ToolStripSeparator()); } } ToolMenuItem toolItem = new ToolMenuItem(item as IExTool); toolItem.Click += new EventHandler(ToolButton_Click); strip.Items.Add(toolItem); } }
void FlexViewer_PrepareToolMenu(object sender, EventArgs e) { var tmi = new ToolMenuItem("\xE773", FlexViewerTool.CustomTool1, Strings.CatalogToolLabel); flexViewer.ToolMenuItems.Insert(0, tmi); }
public DocumentSender() { styleComplete.Alternate = false; styleComplete.BackBrush.Color = Colors.Green.WithAlpha(80 / 255); styleComplete.BackBrush.ColorSelect = Colors.Green.WithAlpha(150 / 255); styleDefault.Alternate = false; styleDefault.BackBrush.Color = Colors.White.WithAlpha(80 / 255); styleDefault.BackBrush.ColorSelect = Colors.White.WithAlpha(150 / 255); styleError.Alternate = false; styleError.BackBrush.Color = Colors.Red.WithAlpha(80 / 255); styleError.BackBrush.ColorSelect = Colors.Red.WithAlpha(150 / 255); listUsers = new FlowTree() { AllowCheck = true, CheckRecursive = false, CheckClearBase = true, ShowUser = true }; toolNext = new ToolMenuItem { Name = "Next", DropDown = new Menubar { Name = "Next" } }; toolNext.ItemClick += ToolNextItemClick; toolForward = new ToolMenuItem { Name = "Forward" }; toolReturn = new ToolMenuItem { Name = "Return" }; toolComplete = new ToolMenuItem { Name = "Complete" }; toolRecovery = new ToolMenuItem() { Name = "Recovery" }; toolType = new ToolDropDown( toolNext, toolForward, toolReturn, toolComplete, toolRecovery) { Name = "Type", DisplayStyle = ToolItemDisplayStyle.Text }; toolType.ItemClick += ToolTypeItemClicked; toolAccept.Name = "Send"; toolPrint = new ToolItem(ToolPrintClick) { Name = "Print", DisplayStyle = ToolItemDisplayStyle.Text }; toolProgress = new ToolProgressBar() { Name = "Progress", Visible = false }; bar.Items[0].InsertAfter(new ToolItem[] { toolType, toolProgress }); listDocuments = new DocumentLayoutList() { EditState = EditListState.ReadOnly, GenerateToString = false, GenerateColumns = false, Name = "Documents", ReadOnly = true, ListInfo = new LayoutListInfo( new LayoutColumn() { Name = "Document", Width = 250 }, new LayoutColumn() { Name = "Work", Width = 150 }, new LayoutColumn() { Name = "Message", FillWidth = true }) { StyleRow = styleDefault }, ListSource = new SelectableListView <DocumentSendItem>(items) }; listDocuments.GetCellStyle += OnListDocumentsGetCellStyle; groupBox = new GroupBox( new GroupBoxItem() { Widget = listDocuments, Name = "Documents", FillHeight = true, FillWidth = true }, new GroupBoxItem() { Widget = listUsers, Name = "Users", FillHeight = true, FillWidth = true, Row = 1 }) { Name = "GroupMap" }; Mode = ToolShowMode.Dialog; Name = "DocumentSender"; Target = groupBox; Size = new Size(640, 640); }
// Update is called once per frame public override void Update() { //touchGuide.UpdateIndicatorPosition (touchPosition); base.Update(); // For Debuging, manually trigger the buttons. if (Input.GetKeyDown(KeyCode.DownArrow)) { OnSwipe(GVRSwipeDirection.down); } if (Input.GetKeyDown(KeyCode.UpArrow)) { OnSwipe(GVRSwipeDirection.up); } if (Input.GetKeyDown(KeyCode.RightArrow)) { OnSwipe(GVRSwipeDirection.right); } if (Input.GetKeyDown(KeyCode.LeftArrow)) { OnSwipe(GVRSwipeDirection.left); } if (Input.GetKeyDown(KeyCode.Alpha4)) { AppButtonDown(); } if (Input.GetKeyDown(KeyCode.Alpha5)) { ButtonOpetionLT(); } if (Input.GetKeyDown(KeyCode.Alpha6)) { ButtonOptionLB(); } if (Input.GetKeyDown(KeyCode.Alpha7)) { ButtonOptionRT(); } if (Input.GetKeyDown(KeyCode.Alpha8)) { ButtonOptionRB(); } if (Input.GetMouseButtonDown(0)) { OnButtonDown(); } if (Input.GetMouseButtonUp(0)) { OnButtonUp(); } if (Input.GetKeyUp(KeyCode.Alpha9)) { modeNum--; UpdateMode(); } if (Input.GetKeyUp(KeyCode.Alpha0)) { modeNum++; UpdateMode(); } if (Input.GetKeyDown(KeyCode.M)) { SetMode(InputMode.MICROPHONE); } if (Input.GetKeyDown(KeyCode.P)) { SetMode(InputMode.DRAW); } RaycastHit hit; if (Physics.Linecast(controllerPivot.transform.position, endOfLineRef.position + controllerPivot.transform.forward, out hit, detectionMask) && !drawingOnBackground) { if (currentInputMode == InputMode.MICROPHONE && activeNode != null) { lineRenderer.enabled = false; } else { lineRenderer.enabled = true; lineRenderer.SetPosition(1, hit.point); } selectedObject = hit.collider.gameObject; if (activeNode == null && selectedObject.GetComponent <Node> () != null) { rayHitRef.position = hit.point + (hit.normal).normalized * 0.5f; rayHitRef.forward = hit.normal; if (currentInputMode != InputMode.MOVE) { lastInputMode = currentInputMode; } toolCollection [(int)InputMode.MOVE].SetMoveTarget(rayHitRef); SetMode(InputMode.MOVE); } else if (selectedObject.GetComponent <ToolMenuItem> () != null) { ToolMenuItem toolItem = selectedObject.GetComponent <ToolMenuItem> (); toolItem.HighLight(); activeMenuItem = toolItem; SetMode(toolItem.mode); } rayHitRef.gameObject.SetActive(true); } else { activeMenuItem = null; lineRenderer.SetPosition(1, endOfLineRef.position); rayHitRef.position = endOfLineRef.position + controllerPivot.transform.forward * 5; if (activeMove == null) { rayHitRef.gameObject.SetActive(false); if (currentInputMode == InputMode.MOVE) { SetMode(lastInputMode); } if (isDrawing && activeNode != null) { EndDrawStroke(); } selectedObject = null; } } if (activeStroke != null) { activeStroke.UpdateBrushPos(rayHitRef); } Color brushColor = toolCollection [(int)InputMode.DRAW].GetComponent <Pen> ().GetBrushColor(); lineRenderer.material.color = brushColor; }
public DataLogView() { toolModeDefault = new ToolMenuItem { Name = "Default", Tag = DataLogMode.Default }; toolModeDocument = new ToolMenuItem { Name = "Document", Tag = DataLogMode.Document }; toolModeTable = new ToolMenuItem { Name = "Table", Tag = DataLogMode.Table }; toolMode = new ToolDropDown( toolModeDefault, toolModeDocument, toolModeTable) { DisplayStyle = ToolItemDisplayStyle.Text, Name = "LogMode", Text = "Mode: Default" }; toolMode.ItemClick += ToolModeClick; toolRollback = new ToolItem(ToolRollbackClick) { Name = "Rollback", DisplayStyle = ToolItemDisplayStyle.Text }; toolAccept = new ToolItem(ToolAcceptClick) { Name = "Accept", DisplayStyle = ToolItemDisplayStyle.Text }; toolCheck = new ToolItem() { Name = "Check", DisplayStyle = ToolItemDisplayStyle.Text }; toolDetails = new ToolItem(ToolDetailsClick) { Name = "Details", DisplayStyle = ToolItemDisplayStyle.Text }; dateField = new ToolFieldEditor() { Editor = new CellEditorDate { TwoDate = true, DataType = typeof(DateInterval) }, Name = "Date", ContentMinWidth = 200 }; dateField.Field.BindData(this, nameof(Date)); dataField = new ToolFieldEditor() { Editor = new CellEditorDataTree { DataType = typeof(DBTable) }, Name = "Table", ContentMinWidth = 200 }; dataField.Field.BindData(this, nameof(Table)); toolProgress = new ToolTableLoader() { }; bar = new Toolsbar( toolRollback, toolMode, toolDetails, new ToolSeparator { FillWidth = true }, dateField, dataField, toolProgress) { Name = "BarLog" }; list = new LayoutList() { AllowEditColumn = false, EditMode = EditModes.None, EditState = EditListState.Edit, GenerateToString = false, Mode = LayoutListMode.List, Name = "list", ListSource = listSource = new SelectableList <DBLogItem>() }; list.GenerateColumns = true; list.CellMouseClick += ListCellMouseClick; list.CellDoubleClick += ListCellDoubleClick; list.SelectionChanged += ListSelectionChanged; //if (logs.Table != null) // logs.ApplySort(new DBRowComparer(logs.Table.DateKey, ListSortDirection.Ascending)); detailList = new TableLayoutList() { GenerateToString = false, GenerateColumns = false, ReadOnly = true, EditMode = EditModes.ByClick }; detailList.ListInfo.Columns.Add("Column", 120).Editable = false; detailList.ListInfo.Columns.Add("OldFormat", 100).FillWidth = true; detailList.ListInfo.Columns.Add("NewFormat", 100).FillWidth = true; detailList.ListInfo.StyleRowName = "ChangeRow"; detailList.ListInfo.HeaderVisible = false; detailRow = new TableLayoutList(); map = new GroupBox( new GroupBoxItem { Name = "Details", Widget = detailList, Column = 0, FillWidth = true, FillHeight = true }, //new GroupBoxItem { Name = "Difference", Widget = detailText, Col = 1, FillWidth = true, FillHeight = true }, new GroupBoxItem { Name = "Record", Widget = detailRow, Column = 2, FillWidth = true, FillHeight = true }); //list.ListInfo.Columns.Add(list.BuildColumn(null, "Text")); split = new VPaned(); split.Panel1.Content = list; //split.Panel2.Content = map; PackStart(bar, false, false); PackStart(split, true, true); Name = "DataLog"; }