예제 #1
0
        /// <summary>Enable theming of the ListView2</summary>
        /// <param name="Widget">The ListView2 that needs to be themized</param>
        /// <param name="Selector">The selector pattern</param>
        public void Stylize(ListView2 Widget, string Selector = "FileList")
        {
            Stylize(Widget as Xwt.Widget, Selector);
            Selector all   = CSS[Selector];
            Selector row1  = CSS[Selector + "RowA"];
            Selector row2  = CSS[Selector + "RowB"];
            Selector sel   = CSS[Selector + "Row:checked"];
            Selector point = CSS[Selector + "Row:active"];

            if (all.Declarations["font-family"].Value != "inherit")
            {
                Widget.Font = Xwt.Drawing.Font.FromName(
                    all.Declarations["font-family"].Value
                    );
            }
            if (all.Declarations["background-color"].Value != "inherit")
            {
                Widget.BackgroundColor = Utilities.GetXwtColor(all.Declarations["background-color"].Value);
            }
            if (row1.Declarations["background-color"].Value != "inherit")
            {
                Widget.NormalBgColor1 = Utilities.GetXwtColor(row1.Declarations["background-color"].Value);
            }
            if (row2.Declarations["background-color"].Value != "inherit")
            {
                Widget.NormalBgColor2 = Utilities.GetXwtColor(row2.Declarations["background-color"].Value);
            }
            if (row1.Declarations["color"].Value != "inherit")
            {
                Widget.NormalFgColor1 = Utilities.GetXwtColor(row1.Declarations["color"].Value);
            }
            if (row2.Declarations["color"].Value != "inherit")
            {
                Widget.NormalFgColor2 = Utilities.GetXwtColor(row2.Declarations["color"].Value);
            }
            if (point.Declarations["background-color"].Value != "inherit")
            {
                Widget.PointedBgColor = Utilities.GetXwtColor(point.Declarations["background-color"].Value);
            }
            if (point.Declarations["color"].Value != "inherit")
            {
                Widget.PointedFgColor = Utilities.GetXwtColor(point.Declarations["color"].Value);
            }
            if (sel.Declarations["background-color"].Value != "inherit")
            {
                Widget.SelectedBgColor = Utilities.GetXwtColor(sel.Declarations["background-color"].Value);
            }
            if (sel.Declarations["color"].Value != "inherit")
            {
                Widget.SelectedFgColor = Utilities.GetXwtColor(sel.Declarations["color"].Value);
            }

            Widget.BorderVisible = GetBorder(all.Declarations["border-style"].Value);
        }
예제 #2
0
        /// <summary>Creates a new ListView2Item</summary>
        /// <param name="RowNumber">Number of owning row</param>
        /// <param name="ColNumber">Number of owning collumn</param>
        /// <param name="RowTag">The item's tag</param>
        /// <param name="Collumns">Array of collumn information</param>
        /// <param name="Data">The data that should be shown in this LV2I</param>
        public ListView2Item(int RowNumber, int ColNumber, string RowTag, ListView2.CollumnInfo[] Collumns, List<Object> Data)
        {
            //this.BackgroundColor = Xwt.Drawing.Colors.GreenYellow;
            this.Content = Layout;
            this.ExpandHorizontal = true;

            _Values = Data.ToArray();
            _Cols = Collumns;
            Tag = RowTag;
            RowNo = RowNumber;
            ColNo = ColNumber;
            Rebuild();
        }
예제 #3
0
파일: Stylist.cs 프로젝트: kekekeks/fcmd
        /// <summary>Enable theming of the ListView2</summary>
        /// <param name="Widget">The ListView2 that needs to be themized</param>
        /// <param name="Selector">The selector pattern</param>
        public void Stylize(ListView2 Widget, string Selector = "FileList")
        {
            Stylize(Widget as Xwt.Widget,Selector);
            Selector all = CSS[Selector];
            Selector row1 = CSS[Selector+"RowA"];
            Selector row2 = CSS[Selector+"RowB"];
            Selector sel = CSS[Selector+"Row:checked"];
            Selector point = CSS[Selector+"Row:active"];
            if (all.Declarations["font-family"].Value != "inherit")
                Widget.Font = Xwt.Drawing.Font.FromName(
                    all.Declarations["font-family"].Value
                );
            if (all.Declarations["background-color"].Value != "inherit")
                Widget.BackgroundColor = Utilities.GetXwtColor(all.Declarations["background-color"].Value);
            if (row1.Declarations["background-color"].Value != "inherit")
                Widget.NormalBgColor1 = Utilities.GetXwtColor(row1.Declarations["background-color"].Value);
            if (row2.Declarations["background-color"].Value != "inherit")
                Widget.NormalBgColor2 = Utilities.GetXwtColor(row2.Declarations["background-color"].Value);
            if (row1.Declarations["color"].Value != "inherit")
                Widget.NormalFgColor1 = Utilities.GetXwtColor(row1.Declarations["color"].Value);
            if (row2.Declarations["color"].Value != "inherit")
                Widget.NormalFgColor2 = Utilities.GetXwtColor(row2.Declarations["color"].Value);
            if (point.Declarations["background-color"].Value != "inherit")
                Widget.PointedBgColor = Utilities.GetXwtColor(point.Declarations["background-color"].Value);
            if (point.Declarations["color"].Value != "inherit")
                Widget.PointedFgColor = Utilities.GetXwtColor(point.Declarations["color"].Value);
            if (sel.Declarations["background-color"].Value != "inherit")
                Widget.SelectedBgColor = Utilities.GetXwtColor(sel.Declarations["background-color"].Value);
            if (sel.Declarations["color"].Value != "inherit")
                Widget.SelectedFgColor = Utilities.GetXwtColor(sel.Declarations["color"].Value);

            Widget.BorderVisible = GetBorder(all.Declarations["border-style"].Value);
        }