Beispiel #1
2
        /// <summary>
        /// 功能菜单树节点赋值
        /// </summary>
        /// <param name="list"></param>
        /// <param name="tree"></param>
        /// <param name="expandFunctionType"></param>
        public static void FillData(List <SysFunction> list, UltraTree tree, string expandFunctionType)
        {
            UltraTreeNode       node  = null;
            TreeNodesCollection nodes = tree.Nodes;

            nodes.Clear();
            //获取根节点(代表系统)
            List <SysFunction> sysFunctions = list.FindAll(f => string.IsNullOrEmpty(f.ParentId));

            foreach (SysFunction sysFun in sysFunctions)
            {
                node      = new UltraTreeNode();
                node.Key  = sysFun.FunctionId;
                node.Text = sysFun.FunctionName;
                node.Tag  = sysFun;
                if (String.Compare(expandFunctionType, sysFun.FunctionType) > 0)
                {
                    node.Expanded = true;
                }
                if (!String.IsNullOrEmpty(sysFun.Image))
                {
                    node.LeftImages.Add(Image.FromFile("./resource/image/mainMenu/" + sysFun.Image + ".png"));
                }
                nodes.Add(node);

                FillData(list, node, expandFunctionType);
            }
        }
Beispiel #2
0
        private ArrayList GetAuthorFunctionList(UltraTree tree)
        {
            ArrayList           funList  = new ArrayList();
            short               level    = 0;
            IList <IEnumerator> nodeList = new List <IEnumerator>();

            nodeList.Add(tree.Nodes.GetEnumerator());
            while (level >= 0)
            {
                IEnumerator enumer = nodeList[level];
                if (enumer.MoveNext())
                {
                    UltraTreeNode node = (UltraTreeNode)enumer.Current;
                    SysFunction   fun  = new SysFunction();
                    fun.FunctionId   = node.Key;
                    fun.FunctionName = node.Text;
                    fun.ParentId     = node.Parent != null ? node.Parent.Key : null;
                    fun.Seq          = (short)(node.Index + 1);
                    funList.Add(fun);
                    if (node.Nodes.Count > 0)
                    {
                        level++;
                        nodeList.Add(node.Nodes.GetEnumerator());
                    }
                }
                else
                {
                    nodeList.RemoveAt(level);
                    level--;
                }
            }
            return(funList);
        }
Beispiel #3
0
        public static string OznaceneOJ(UltraTree ultratree1)
        {
            StringBuilder builder = new StringBuilder();

            Infragistics.Win.UltraWinTree.NodeEnumerator enumerator = ultratree1.Nodes.GetEnumerator();
            while (enumerator.MoveNext())
            {
                UltraTreeNode current = enumerator.Current;
                if (current.Key == "ORGJED")
                {
                    Infragistics.Win.UltraWinTree.NodeEnumerator enumerator2 = current.Nodes.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        UltraTreeNode node2 = enumerator2.Current;
                        if (node2.CheckedState == CheckState.Checked)
                        {
                            if (builder.Length > 0)
                            {
                                builder.Append(",");
                            }
                            DataRow tag = (DataRow)node2.Tag;
                            builder.Append(RuntimeHelpers.GetObjectValue(tag["idorgjed"]));
                        }
                    }
                }
            }
            return(builder.ToString());
        }
        private void utv_MouseDown(object sender, MouseEventArgs e)
        {
            //Aqui eu verifico se o click é com o direito ou esquerdo do mouse.
            if (e.Button == MouseButtons.Left)
            {
                UltraTree tree           = sender as UltraTree;
                UIElement controlElement = tree != null ? tree.UIElement : null;
                UIElement elementAtPoint = controlElement != null?controlElement.ElementFromPoint(e.Location) : null;

                NodeSelectableAreaUIElement noSelecionado = null;

                while (elementAtPoint != null)
                {
                    noSelecionado = elementAtPoint as NodeSelectableAreaUIElement;
                    if (noSelecionado != null)
                    {
                        break;
                    }

                    elementAtPoint = elementAtPoint.Parent;
                }

                //  Se o usuário clicou na célula SELECIONAR, a condição abaixo é verdadeira. Se ele
                //clicar em qualquer outra coluna, o texto abaixo fica "Selecionar\<Próximas colunas>".
                if (noSelecionado != null && noSelecionado.Node.FullPath.ToUpper().Trim() == "SELECIONAR")
                {
                    mRotaSelecionada = noSelecionado.Node.Cells[(int)e_SkaColunas.NomeRota].Value.ToString();
                    btnVoltar_Click(new object(), new EventArgs());
                }
            }
        }
Beispiel #5
0
 public void MostrarItems()
 {
     uebContenedor.Groups.Clear();
     foreach (ItemContenedor Item in Contenedor.Items)
     {
         if (Item.EsContenedor)
         {
             UltraExplorerBarGroup            Group     = new UltraExplorerBarGroup();
             UltraExplorerBarContainerControl Container = new UltraExplorerBarContainerControl();
             UltraTree Tree = new UltraTree();
             uebContenedor.Controls.Add(Container);
             Tree.Dock = DockStyle.Fill;
             Tree.NodeConnectorStyle = NodeConnectorStyle.None;
             Tree.ViewStyle          = Infragistics.Win.UltraWinTree.ViewStyle.Standard;
             Tree.DisplayStyle       = UltraTreeDisplayStyle.WindowsVista;
             Tree.AfterSelect       += Tree_AfterSelect;
             Container.Controls.Add(Tree);
             Group.Text = Item.Nombre;
             Group.Settings.AppearancesLarge.HeaderAppearance.Image = ilMain.Images[Item.Imagen];
             Group.Tag            = Item;
             Group.Container      = Container;
             Group.Settings.Style = GroupStyle.ControlContainer;
             uebContenedor.Groups.Add(Group);
             AddNodesToTree(Tree.Nodes, Item);
             Tree.ExpandAll();
         }
     }
 }
Beispiel #6
0
        private void treeViewExamples_DoubleClick(object sender, EventArgs e)
        {
            UltraTree tree    = (UltraTree)sender;
            UIElement element = tree.UIElement.LastElementEntered;

            if (element == null)
            {
                return;
            }

            UltraTreeNode node = element.GetContext(typeof(UltraTreeNode)) as UltraTreeNode;

            if (node == null)
            {
                return;
            }
            Form form = null;

            switch (node.Key)
            {
            case "GridHybridColumnsLayout":
                form = new InfragisticsDev.Win.GridControl.GroupsLayout.Form3();
                break;

            default:
                break;
            }
            if (form != null)
            {
                form.ShowDialog();
            }
        }
Beispiel #7
0
 public void ConstruirContenedores()
 {
     ObtenerContenedor();
     if (m_Contenedor != null)
     {
         uebMain.Groups.Clear();
         foreach (ItemContenedor Item in m_Contenedor.Items)
         {
             if (Item.EsContenedor)
             {
                 UltraExplorerBarGroup            Group     = new UltraExplorerBarGroup();
                 UltraExplorerBarContainerControl Container = new UltraExplorerBarContainerControl();
                 UltraTree Tree = new UltraTree();
                 uebMain.Controls.Add(Container);
                 Tree.Dock = DockStyle.Fill;
                 Tree.NodeConnectorStyle = NodeConnectorStyle.None;
                 Tree.ViewStyle          = Infragistics.Win.UltraWinTree.ViewStyle.Standard;
                 Tree.DisplayStyle       = UltraTreeDisplayStyle.WindowsVista;
                 Tree.Override.ActiveNodeAppearance.FontData.Bold = DefaultableBoolean.True;
                 Tree.AfterSelect += Tree_AfterSelect;
                 Tree.Click       += Tree_Click;
                 Container.Controls.Add(Tree);
                 Group.Text = Item.Nombre;
                 Group.Settings.NavigationPaneCollapsedGroupAreaText    = Item.Nombre;
                 Group.Settings.AppearancesLarge.HeaderAppearance.Image = ilMain.Images[Item.Imagen];
                 Group.Tag            = Item;
                 Group.Container      = Container;
                 Group.Settings.Style = GroupStyle.ControlContainer;
                 uebMain.Groups.Add(Group);
                 AddNodesToTree(Tree.Nodes, Item);
                 Tree.ExpandAll();
             }
         }
     }
 }
Beispiel #8
0
        /// <summary>
        /// Called as we double click a row in the list - this effectively causes this item to be expanded
        /// in the tree view and hence here
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void auditGridView_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
        {
            // Get the DataObject from the grid as this helps identify the item being double clicked.
            object dataObject = e.Row.Cells["DataObject"].Value;

            // OK - what is it?
            // In general the dataObject may be one of:
            //	UltraTreeNode - most items - this simply holds the parent item from the tree.
            //	Asset - used only in All Assets view
            //	FileSystemFile - terminus of a File System branch identifies a specific file
            //
            //  If we double click an UltraTreeNode this causes it to be expanded
            if (dataObject is UltraTreeNode)
            {
                UltraTreeNode treeNode = dataObject as UltraTreeNode;

                // ...and cause it to be expanded
                treeNode.Expanded = true;

                // ...and select it also
                UltraTree treeControl = treeNode.Control as UltraTree;
                treeNode.BringIntoView(true);
                _displayedNode.Selected = false;
                treeNode.Selected       = true;
            }

            // Double-click on a FileSystemFile displays it's properties
            else if (dataObject is FileSystemFile)
            {
                propertiesToolStripMenuItem_Click(sender, null);
            }
        }
Beispiel #9
0
        private void ultraTree1_AfterActivate(object sender, NodeEventArgs e)
        {
            UltraTree tree = sender as UltraTree;

            if (tree.ActiveNode != null)
            {
                FunctionNodeClick(tree.ActiveNode);
            }
        }
Beispiel #10
0
        private void ultraTree1_AfterActivate(object sender, Infragistics.Win.UltraWinTree.NodeEventArgs e)
        {
            UltraTree tree = sender as UltraTree;

            if (tree.ActiveNode != null)
            {
                QueryPost((tree.ActiveNode.Tag as SysOrganization).OrganizationId);
            }
        }
Beispiel #11
0
        private void WfloadTree(string pAdm02, UltraTree pUltraTree, UltraTreeNode pUltraTreeNode)
        {
            StringBuilder sbSql;
            DataTable     dtAdm;
            UltraTreeNode utn;
            string        ado02, ado07, adm01, adm02;

            try
            {
                sbSql = new StringBuilder();
                sbSql.AppendLine("SELECT * FROM adm_tb");
                sbSql.AppendLine("LEFT JOIN ado_tb ON adm02=ado01");
                sbSql.AppendLine(string.Format("WHERE adm01='{0}'", pAdm02));
                //sbSql.AppendLine("  AND ado07='P'");
                sbSql.AppendLine("ORDER BY adm03");
                dtAdm = BoSecurity.OfGetDataTable(sbSql.ToString(), null);
                if (dtAdm == null || dtAdm.Rows.Count == 0)
                {
                    return;
                }

                foreach (DataRow drAdm in dtAdm.Rows)
                {
                    ado02 = GlobalFn.isNullRet(drAdm["ado02"], "");
                    ado07 = GlobalFn.isNullRet(drAdm["ado07"], "");
                    adm01 = GlobalFn.isNullRet(drAdm["adm01"], "");
                    adm02 = GlobalFn.isNullRet(drAdm["adm02"], "");
                    if (pUltraTreeNode == null)
                    {
                        utn = pUltraTree.Nodes.Add();
                    }
                    else
                    {
                        utn = pUltraTreeNode.Nodes.Add();
                    }

                    utn.Key = adm02;
                    if (ado07.ToLower() == "m")//menu
                    {
                        utn.Text = ado02;
                        utn.Override.ActiveNodeAppearance.Image = ImgList.Images[GlobalPictuer.MENU_TREE_FOLDER_ACTIVE];
                        utn.Override.NodeAppearance.Image       = ImgList.Images[GlobalPictuer.MENU_TREE_FOLDER];
                        WfloadTree(adm02, pUltraTree, utn);
                    }
                    else
                    {
                        utn.Text = ado02 + " -" + adm02;
                        utn.Override.ActiveNodeAppearance.Image = ImgList.Images[GlobalPictuer.MENU_TREE_FORM_ACTIVE];
                        utn.Override.NodeAppearance.Image       = ImgList.Images[GlobalPictuer.MENU_TREE_FORM];
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #12
0
        private void ultraTree1_AfterSelect(object sender, SelectEventArgs e)
        {
            UltraTree tree = sender as UltraTree;

            if (tree.SelectedNodes.Count > 0)
            {
                UltraTreeNode node = (sender as UltraTree).SelectedNodes[0];
                activeOrganizationId = node.Key;
                QueryEmployees(activeOrganizationId);
            }
        }
Beispiel #13
0
        public SummaryTabView([ServiceDependency] WorkItem workItem)
        {
            this.workItem = workItem as LaytonWorkItem;
            InitializeComponent();
            InitializeUserDefinedCategoryTabs();
            _listAssetTypes.Populate();
            tree   = new UltraTree();
            bApply = false;
            m_objSupportContract = new SupportContract();

            //LoadForm();
        }
Beispiel #14
0
        public void Add(ExplorerBarTreeItem item)
        {
            object obj2 = null;

            if (this.m_Parent is UltraExplorerBar)
            {
                UltraExplorerBarGroup group = new UltraExplorerBarGroup {
                    Text = item.Text
                };
                ((UltraExplorerBar)this.m_Parent).Groups.Add(group);
                obj2 = group;
            }
            else if (this.m_Parent is UltraExplorerBarGroup)
            {
                UltraExplorerBarGroup parent = this.m_Parent as UltraExplorerBarGroup;
                if (item.IsTreeGroup)
                {
                    UltraExplorerBarContainerControl control = new UltraExplorerBarContainerControl();
                    parent.Container      = control;
                    parent.Settings.Style = GroupStyle.ControlContainer;
                    parent.ExplorerBar.Controls.Add(control);
                    UltraTree tree = new UltraTree {
                        Dock      = DockStyle.Fill,
                        ImageList = parent.ExplorerBar.ImageListSmall
                    };
                    control.Controls.Add(tree);
                    UltraTreeNode node = new UltraTreeNode {
                        Text = item.Text
                    };
                    tree.Nodes.Add(node);
                    obj2 = node;
                }
                else
                {
                    UltraExplorerBarItem item2 = new UltraExplorerBarItem {
                        Text = item.Text
                    };
                    parent.Items.Add(item2);
                    obj2 = item2;
                }
            }
            else if (this.m_Parent is UltraTree)
            {
                UltraTree     tree2 = this.m_Parent as UltraTree;
                UltraTreeNode node2 = new UltraTreeNode {
                    Text = item.Text
                };
                tree2.Nodes.Add(node2);
                obj2 = node2;
            }
            item.Control = obj2;
            this.m_List.Add(item);
        }
Beispiel #15
0
        // IMessageFilter impl.
        public virtual bool PreFilterMessage(ref Message m)
        {
            // Listen for operating system messages
            switch (m.Msg)
            {
            case NativeMethods.WM_MOUSEWHEEL:

                // don't handle all (e.g. Ctrl-MouseWheel: zoom feature in IE)
                if (Control.ModifierKeys != Keys.None)
                {
                    return(false);
                }

                // get position (better debug support than calling Control.MousePosition in GetTopmostVisibleChild):
                Point screenPoint = new Point(m.LParam.ToInt32());
                // redirect the wheel message to the topmost child control
                Control child = GetTopmostVisibleChild(_parent, screenPoint);

                if (child != null)
                {
                    if (m.HWnd == child.Handle && child.Focused)
                    {
                        return(false);                                  // control is focused, so it should handle the wheel itself
                    }
                    // thanks to http://sourceforge.net/users/kevindente/:
                    if (child is IEControl.HtmlControl)
                    {
                        return(ScrollHtmlControl(child as IEControl.HtmlControl, m));
                    }

                    if (child is UltraTree)
                    {
                        //HACK: because of no managed support, but works...
                        UltraTree tree = child as UltraTree;
                        // get the wheel delta:
                        int delta = SignedHIWORD(m.WParam);
                        return(TreeHelper.InvokeDoVerticalScroll(tree, delta));
                    }

                    if (m.HWnd != child.Handle)                                 // no recursion, please. Redirect message...
                    {
                        NativeMethods.PostMessage(child.Handle, NativeMethods.WM_MOUSEWHEEL, m.WParam, m.LParam);
                        return(true);
                    }

                    return(false);
                }
                break;
            }
            return(false);
        }
Beispiel #16
0
        public static UltraTreeNode GetNodeByTag(this UltraTree tree, string tag)
        {
            UltraTreeNode ultraTreeNode1 = (UltraTreeNode)null;

            foreach (UltraTreeNode node in tree.Nodes)
            {
                UltraTreeNode ultraTreeNode2 = TreeExtensions.SearchChildNodes(node, tag);
                if (ultraTreeNode2 != null)
                {
                    ultraTreeNode1 = ultraTreeNode2;
                }
            }
            return(ultraTreeNode1);
        }
Beispiel #17
0
        /// <summary>
        /// Handles the UltraTree's MouseUp event
        /// </summary>
        private void locationsTree_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            UltraTree     ultraTree    = sender as UltraTree;
            Point         pointClicked = new Point(e.X, e.Y);
            UltraTreeNode nodeAtPoint  = ultraTree.GetNodeFromPoint(pointClicked);

            if (nodeAtPoint != null && nodeAtPoint.Expanded == false)
            {
                Infragistics.Win.UltraWinTree.ExpansionIndicatorUIElement expansionIndicatorElement = null;
                expansionIndicatorElement = ultraTree.UIElement.ElementFromPoint(pointClicked) as Infragistics.Win.UltraWinTree.ExpansionIndicatorUIElement;
                if (expansionIndicatorElement == null)
                {
                    nodeAtPoint.Expanded = true;
                }
            }
        }
Beispiel #18
0
        private void CreateGroupTree(WorkItem workItem, UICommandDefinition entry)
        {
            UltraExplorerBarGroup uiElement = new UltraExplorerBarGroup {
                Text = entry.Text
            };

            uiElement.Settings.Style = GroupStyle.ControlContainer;
            workItem.UIExtensionSites[entry.Site].Add <UltraExplorerBarGroup>(uiElement);
            UltraTree tree = new UltraTree {
                Dock      = DockStyle.Fill,
                ImageList = uiElement.ExplorerBar.ImageListSmall
            };

            uiElement.Container.Controls.Add(tree);
            workItem.UIExtensionSites.RegisterSite(entry.Site + "." + entry.Name, tree.Nodes);
        }
Beispiel #19
0
        /// <summary>
        /// 角色树节点赋值
        /// </summary>
        /// <param name="list"></param>
        /// <param name="tree"></param>
        /// <param name="expandFunctionType"></param>
        public static void FillData(List <SysRole> list, UltraTree tree)
        {
            UltraTreeNode       node  = null;
            TreeNodesCollection nodes = tree.Nodes;

            nodes.Clear();

            List <SysRole> roleList = list.FindAll(o => string.IsNullOrEmpty(o.ParentId));

            foreach (SysRole role in roleList)
            {
                node      = new UltraTreeNode();
                node.Key  = role.RoleId;
                node.Text = role.RoleName;
                node.Tag  = role;
                nodes.Add(node);

                FillData(list, node);
            }
        }
Beispiel #20
0
        private void BilancaSmartPart_Load(object sender, EventArgs e)
        {
            this.POCETNI = mipsed.application.framework.Application.Pocetni;
            this.ZAVRSNI = mipsed.application.framework.Application.Zavrsni;
            this.RadioButton3.Checked = true;
            this.dtPocetni.Value      = this.POCETNI;
            this.dtZavrsni.Value      = this.ZAVRSNI;
            new ORGJEDDataAdapter().Fill(this.OrgjedDataSet1);
            new MJESTOTROSKADataAdapter().Fill(this.MjestotroskaDataSet1);
            new DOKUMENTDataAdapter().Fill(this.DokumentDataSet1);
            InfraCustom.PostaviSelectAllSvimEditKontrolama(this);
            InfraCustom.PostaviEnterUTabSvimEditKontrolama(this);
            this.PopulateTree();
            this.Oznaci();
            this.UltraTree1.ExpandAll(ExpandAllType.OnlyNodesWithChildren);
            this.UltraTree1.Focus();
            UltraTree tree = this.UltraTree1;

            tree.Appearance.BackColor = Color.WhiteSmoke;
            tree.ExpandAll();
            NodeEnumerator enumerator = tree.Nodes.GetEnumerator();

            while (enumerator.MoveNext())
            {
                UltraTreeNode current = enumerator.Current;
                if (current.HasNodes)
                {
                    current.Override.NodeAppearance.FontData.Bold         = DefaultableBoolean.True;
                    current.Override.NodeAppearance.FontData.Name         = "Verdana";
                    current.Override.NodeAppearance.FontData.SizeInPoints = 8f;
                    NodeEnumerator enumerator2 = current.Nodes.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        UltraTreeNode node2 = enumerator2.Current;
                        node2.Override.NodeAppearance.FontData.Bold         = DefaultableBoolean.False;
                        node2.Override.NodeAppearance.FontData.Name         = "Verdana";
                        node2.Override.NodeAppearance.FontData.SizeInPoints = 7f;
                    }
                }
            }
        }
    public BondStructureFolderNode(UltraTree owningTree_, BondStructureFolder folder_, BondStructureFolderTreeDisplayMode mode_, bool readTree_=true)
    {
      m_folder = folder_;
      Text = folder_.FolderName;
      m_mode = mode_;
      Owner = owningTree_;
      if (readTree_)
      {
        foreach (var folder in m_folder.SubFolders.OrderBy(x => x.FolderName))
          Nodes.Add(new BondStructureFolderNode(owningTree_, folder, mode_, readTree_));

        if(m_mode==BondStructureFolderTreeDisplayMode.Full)
          foreach (var item in m_folder.Items.OrderBy(x=>x.Name))
            Nodes.Add(new StructureNode(item));
      }

      LeftImages.Add(BSAResources.folder_icon_16black);

      subscribeToFolder();

    }
Beispiel #22
0
        /// <summary>
        /// 构建树
        /// </summary>
        /// <param name="uTree"></param>
        /// <param name="images"></param>
        /// <param name="needUpdate">是否需要从数据库更新数据</param>
        /// <param name="exp"></param>
        public void BuildTree(ref UltraTree uTree, ImageList.ImageCollection images, LinkedList <string> needUpdate,
                              Expression <Func <T, bool> > exp = null)
        {
            InitialDic();
            var children = Dal.Get(exp);
            var root     = uTree.TopNode;

            if (root == null)
            {
                root = new UltraTreeNode("root", "项目"); //此处默认称为项目
                if (!images.IsNullOrEmpty() && images.Count > 2)
                {
                    root.LeftImages.Clear();
                    root.LeftImages.Add(images[2]);
                }

                uTree.Nodes.Clear();
                uTree.Nodes.Add(root);
            }

            root.Nodes.Clear();
            BuildSubTree(root, children, images);
            root.Expanded = true;
        }
        private CustomExplorer()
        {
            SetExplorer();
            if (mDesExpCtrl == null)
            {
                throw new InstanceNotFoundException("Can't find Design Explorer!!");
            }

            mSelectedElements = new List <UltraTreeNode>();

            mUltraTree = mDesExpCtrl.Controls.OfType <UltraTree>().First();


            try
            {
                IEnumerable <UltraTreeNode> readonlySites = mUltraTree.Nodes[0].Nodes.Cast <UltraTreeNode>().
                                                            Where(node => ((DbElement)node.Tag).GetBool(DbAttributeInstance.DBWRIT) == false);
                foreach (UltraTreeNode node in readonlySites)
                {
                    node.Override.NodeAppearance.Image = Properties.Resources.Readonly;
                }
            }
            catch (Exception ee) { }


            //mUltraTree.AfterNodeUpdate += mUltraTree_AfterNodeUpdate;
            mUltraTree.BeforeExpand       += mUltraTree_BeforeExpand;
            mUltraTree.InitializeDataNode += mUltraTree_InitializeDataNode;

            //mUltraTree.BeforeNodeUpdate += mUltraTree_BeforeNodeUpdate;
            //mUltraTree.FontChanged += mUltraTree_FontChanged;
            //mUltraTree.AfterDataNodesCollectionPopulated += mUltraTree_AfterDataNodesCollectionPopulated;
            //mUltraTree.BeforeActivate += mUltraTree_BeforeActivate;
            //mUltraTree.Update();
            //mUltraTree.Nodes.SubObjectPropChanged += Nodes_SubObjectPropChanged;
        }
        private void applicationsGridView_DoubleClickRow(object sender, DoubleClickRowEventArgs e)
        {
            // Do not allow double -click on the group by row
            if (e.Row is UltraGridGroupByRow)
            {
                return;
            }

            // Get the DataObject from the grid as this helps identify the item being double clicked.
            object dataObject = e.Row.Cells["ApplicationObject"].Value;

            //  If we double click an UltraTreeNode this causes it to be expanded
            if (dataObject is UltraTreeNode)
            {
                UltraTreeNode treeNode = dataObject as UltraTreeNode;

                // ...and cause it to be expanded
                treeNode.Expanded = true;

                // ...and select it also
                UltraTree treeControl = treeNode.Control as UltraTree;
                treeNode.BringIntoView(true);
                _displayedNode.Selected = false;
                treeNode.Selected       = true;
            }

            else
            {
                // If not an UltraTreeNode then try and display the items properties
                applicationsGridView.Selected.Rows.Clear();
                applicationsGridView.Selected.Rows.Add(e.Row);

                // ...and get it's properties
                ShowProperties();
            }
        }
Beispiel #25
0
 public void BuildTree(ref UltraTree uTree, ImageList.ImageCollection images)
 {
     _projBll.BuildTree(ref uTree, images, null, p => p.IsMain);
 }
Beispiel #26
0
 public void ConstruirContenedores()
 {
     ObtenerContenedor();
     if (m_Contenedor != null)
     {
         uebMain.Groups.Clear();
         foreach (ItemContenedor Item in m_Contenedor.Items)
         {
             if (Item.EsContenedor)
             {
                 UltraExplorerBarGroup Group = new UltraExplorerBarGroup();
                 UltraExplorerBarContainerControl Container = new UltraExplorerBarContainerControl();
                 UltraTree Tree = new UltraTree();
                 uebMain.Controls.Add(Container);
                 Tree.Dock = DockStyle.Fill;
                 Tree.NodeConnectorStyle = NodeConnectorStyle.None;
                 Tree.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.Standard;
                 Tree.DisplayStyle = UltraTreeDisplayStyle.WindowsVista;
                 Tree.Override.ActiveNodeAppearance.FontData.Bold = DefaultableBoolean.True;
                 Tree.AfterSelect += Tree_AfterSelect;
                 Tree.Click += Tree_Click;
                 Container.Controls.Add(Tree);
                 Group.Text = Item.Nombre;
                 Group.Settings.NavigationPaneCollapsedGroupAreaText = Item.Nombre;
                 Group.Settings.AppearancesLarge.HeaderAppearance.Image = ilMain.Images[Item.Imagen];
                 Group.Tag = Item;
                 Group.Container = Container;
                 Group.Settings.Style = GroupStyle.ControlContainer;
                 uebMain.Groups.Add(Group);
                 AddNodesToTree(Tree.Nodes, Item);
                 Tree.ExpandAll();
             }
         }
     }
 }
Beispiel #27
0
        private void WfLoadMenu()
        {
            StringBuilder sbSql;
            DataTable     dtAdm;

            Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarContainerControl uebcc;
            Infragistics.Win.UltraWinTree.UltraTree ut;
            ImageList imgModules;
            string    imgModuleKey;

            try
            {
                imgModules = YR.Util.GlobalPictuer.LoadModuleImage();

                sbSql = new StringBuilder();
                sbSql.AppendLine("SELECT * FROM adm_tb");
                sbSql.AppendLine("LEFT JOIN ado_tb ON adm02=ado01");
                sbSql.AppendLine("WHERE adm01='menu'");
                sbSql.AppendLine("  AND ado07='M'");
                sbSql.AppendLine("ORDER BY adm03");
                dtAdm = BoSecurity.OfGetDataTable(sbSql.ToString(), null);
                if (dtAdm == null || dtAdm.Rows.Count == 0)
                {
                    return;
                }
                var i = 0;
                foreach (DataRow drAdm in dtAdm.Rows)
                {
                    UltraExplorerBarGroup uebg = new UltraExplorerBarGroup();
                    uebcc = new UltraExplorerBarContainerControl();

                    ut             = new UltraTree();
                    ut.BorderStyle = Infragistics.Win.UIElementBorderStyle.None;
                    ut.ShowLines   = true;
                    //ut.Appearance.BackColor = GetStyleLibrary.TreeBackGroundColor;
                    ut.ImageList = ImgList;
                    //ut.Font = new Font(ut.Font.FontFamily, 11);
                    ut.Font = GetStyleLibrary.FontControlNormal;

                    ut.DoubleClick   += new EventHandler(UltraTree_DoubleClick);
                    ut.AfterActivate += ut_AfterActivate;
                    ut.KeyDown       += new System.Windows.Forms.KeyEventHandler(UltraTree_KeyDown);

                    uebg.Key  = drAdm["adm02"].ToString();
                    uebg.Text = drAdm["ado02"].ToString();
                    if (i == 0)//第一筆時要顯示流程圖
                    {
                        WfShowFlowByAdo01(uebg.Key);
                    }

                    uebg.Settings.Style = Infragistics.Win.UltraWinExplorerBar.GroupStyle.ControlContainer;

                    UebMenu.Groups.Add(uebg);
                    //設定header圖檔,先簡單處理
                    imgModuleKey = "module_" + uebg.Key + "_32";
                    try
                    {
                        uebg.Settings.AppearancesSmall.HeaderAppearance.Image = imgModules.Images[imgModuleKey];
                    }
                    catch
                    {
                    }

                    WfloadTree(uebg.Key, ut, null);
                    if (ut != null)
                    {
                        uebg.Container = uebcc;

                        uebg.Settings.ItemAreaInnerMargins.Bottom = 0;
                        uebg.Settings.ItemAreaInnerMargins.Left   = 0;
                        uebg.Settings.ItemAreaInnerMargins.Right  = 0;
                        uebg.Settings.ItemAreaInnerMargins.Top    = 0;

                        uebg.Settings.ItemAreaOuterMargins.Bottom = 5;
                        uebg.Settings.ItemAreaOuterMargins.Left   = 5;
                        uebg.Settings.ItemAreaOuterMargins.Right  = 5;
                        uebg.Settings.ItemAreaOuterMargins.Top    = 5;
                        ut.Dock = DockStyle.Fill;
                        uebcc.Controls.Add(ut);
                        UebMenu.Controls.Add(uebcc);
                        UebMenu.Groups[0].ExplorerBar.Appearance.BackColor = Color.Red;
                    }
                    i++;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #28
0
 public FormFindAsset(UltraTree explorerTree)
 {
     InitializeComponent();
     _explorerTree = explorerTree;
 }
Beispiel #29
0
 public static void RejectChanges(this UltraTree tree)
 {
     UltraTreeExtender.ApplyAction(tree.Nodes, ChangesAction.RejectChanges);
 }
 public SummaryTabViewPresenter()
 {
     tree = new UltraTree();
 }
Beispiel #31
0
 /// <summary>
 /// 组织结构树节点赋值
 /// </summary>
 /// <param name="list"></param>
 /// <param name="tree"></param>
 /// <param name="expandFunctionType"></param>
 public static void FillData(List <SysOrganization> list, UltraTree tree, string expandOrgType, bool showIcon)
 {
     FillData(list, tree.Nodes, expandOrgType, showIcon);
 }
Beispiel #32
0
 public void MostrarItems() {
     uebContenedor.Groups.Clear();
     foreach (ItemContenedor Item in Contenedor.Items)
     {
         if (Item.EsContenedor)
         {
             UltraExplorerBarGroup Group = new UltraExplorerBarGroup();
             UltraExplorerBarContainerControl Container = new UltraExplorerBarContainerControl();
             UltraTree Tree = new UltraTree();
             uebContenedor.Controls.Add(Container);
             Tree.Dock = DockStyle.Fill;
             Tree.NodeConnectorStyle = NodeConnectorStyle.None;
             Tree.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.Standard;
             Tree.DisplayStyle = UltraTreeDisplayStyle.WindowsVista;
             Tree.AfterSelect += Tree_AfterSelect;
             Container.Controls.Add(Tree);
             Group.Text = Item.Nombre;
             Group.Settings.AppearancesLarge.HeaderAppearance.Image = ilMain.Images[Item.Imagen];
             Group.Tag = Item;
             Group.Container = Container;
             Group.Settings.Style = GroupStyle.ControlContainer;
             uebContenedor.Groups.Add(Group);
             AddNodesToTree(Tree.Nodes, Item);
             Tree.ExpandAll();
         }
     }
 }
Beispiel #33
0
 public UltraTreeNode FindNode(UltraTree uTree, Project proj)
 {
     return(_projBll.FindNode(uTree, proj));
 }