Ejemplo n.º 1
0
            public void buildGui()
            {
                AstEngine.HostPanel.clear();

                var topPanel = AstEngine.HostPanel.add_1x1("Methods & Parameters", "Source Code", true, 400);

                //CodeViewer = topPanel[1].add_SourceCodeViewer();

                var tabControl = topPanel[1].add_TabControl();

                CodeViewer = tabControl.add_Tab("Source Code").add_SourceCodeViewer();

                CodeStreamTreeViewTab = tabControl.add_Tab("CodeStream TreeView");
                CodeStreamGraphTab    = tabControl.add_Tab("CodeStream Graph");
                CodeStreamCodeViewer  = CodeStreamTreeViewTab.add_SourceCodeViewer();
                CodeStreamTreeView    = CodeStreamCodeViewer.insert_Left <TreeView>(200);
                CodeStreamGraphPanel  = CodeStreamGraphTab.add_Panel().backColor(Color.White);
                CodeStreamGraph       = CodeStreamGraphPanel.add_Graph();
                CodeStreamGraphScript = CodeStreamGraphPanel.insert_Below <Panel>().add_Script();
                CodeStreamTreeView.afterSelect <O2CodeStreamNode>
                    ((streamNode) => CodeStreamCodeViewer.editor().setSelectionText(streamNode.INode.StartLocation, streamNode.INode.EndLocation));

                MethodsTreeView = topPanel[0].add_TreeView()
                                  .sort()
                                  .showSelection();

                MethodsTreeView.insert_Above <TextBox>(20).onTextChange_AlertOnRegExFail()
                .onEnter((value) => {
                    MethodsFilter = value;
                    loadDataInGui();
                });
                MethodsTreeView.afterSelect <IMethod>(
                    (iMethod) =>
                {
                    createMethodStreamAndShowInGui(iMethod);
                });

                var optionsPanel = MethodsTreeView.insert_Below <Panel>(25);

                optionsPanel.add_CheckBox("Open Graph in New Window", 0, 0, (value) => ShowGraphInNewWindow = value)
                .autoSize();

                optionsPanel.add_CheckBox("Join Graph Data", 0, 200, (value) => JoinGraphData = value)
                .autoSize().bringToFront();

                ParametersTreeView    = MethodsTreeView.insert_Below <TreeView>(100);
                MethodsCalledTreeView = ParametersTreeView.insert_Right <TreeView>(200);

                AstData_MethodStream.afterSelect_ShowInSourceCodeEditor(MethodsCalledTreeView, CodeViewer.editor());
                AstData_MethodStream.afterSelect_ShowInSourceCodeEditor(ParametersTreeView, CodeViewer.editor());

                MethodsCalledTreeView.afterSelect <INode>((iNode) => createAndShowCodeStream(iNode));
                ParametersTreeView.afterSelect <INode>((iNode) => createAndShowCodeStream(iNode));

                MethodsTreeView.beforeExpand_PopulateWithList <ISpecial>();
            }
Ejemplo n.º 2
0
            public void loadDataInGui()
            {
                var iMethods = AstEngine.AstData.iMethods();

                MethodsTreeView.visible(false);
                MethodsTreeView.clear();

                foreach (var iMethod in iMethods)
                {
                    var fullName = iMethod.fullName();
                    var name     = iMethod.name();
                    if (MethodsFilter.valid().isFalse() || name.regEx(MethodsFilter))
                    {
                        MethodsTreeView.add_Node(name, iMethod).toolTip(fullName);
                    }
                }
                //MethodsTreeView.showToolTip();
                MethodsTreeView.visible(true);
            }