示例#1
0
        public UIMenuItem AddItem(string text)
        {
            int ys = 15;

            if (subp != null)
            {
                foreach (var i in Sub[0].Sub)
                {
                    ys += 25;
                }
            }

            UIMenuItem ni = new UIMenuItem(text, subp, false)
            {
                WidY = ys,
                WidW = UISys.Skin().SmallFont.Width(text) + 5,
                WidH = 25
            };

            if (ni.WidY < 25)
            {
                ni.WidY = 25;
            }

            AppResize(App.AppInfo.W, App.AppInfo.H);
            return(ni);
        }
示例#2
0
        public UIMenuItem AddItem(string text)
        {
            int xs = 0;

            foreach (var i in Sub)
            {
                xs += (int)i.WidW + 5;
                // i.WidW = UISys.Skin().SmallFont.Width(i.Name) + 5;
                //i.WidH = 25;
            }

            UIMenuItem ni = new UIMenuItem(text, null, true)
            {
                WidX = (int)0,

                WidW = UISys.Skin().SmallFont.Width(text) + 10,
                WidH = 22
            };
            UIPanel np = new UIPanel(10 + xs, 2, (int)ni.WidW, 22, "", this);

            np.Flat = true;
            np.AddWidget(ni);


            return(ni);
        }