Esempio n. 1
0
        public MasterDetailMenuPageView()
        {
            Icon            = "settings.png";
            Title           = "menu";
            BackgroundColor = Color.FromHex("FFFFFF");
            var list = new XListView();

            list.BackgroundColor = Color.Transparent;

            list.SetBinding(ListView.ItemsSourceProperty, "Items");
            list.SetBinding(ListView.SelectedItemProperty, "SelectedItem");

            var headerPane = new ContentView();

            headerPane.BackgroundColor = Color.FromHex("333333");
            headerPane.Padding         = new Thickness(10, 30, 10, 10);


            var stack = new StackLayout();

            stack.Children.Add(headerPane);


            stack.Children.Add(list);
            Content = stack;
        }
Esempio n. 2
0
    unsafe public void Create()
    {
        xc.XInitXCGUI("");
        int hWindow = XWnd.Create(0, 0, 500, 300, "xcgui", 0, 15);

        int hListView = XListView.Create(0, 0, 400, 200, hWindow);

        XListView.SetItemTemplateXML(hListView, "..\\..\\ListView_Item.xml");

        int hAdapter = XAdapterListView.Create();

        XListView.BindAdapter(hListView, hAdapter);
        XAdapterListView.Group_AddColumn(hAdapter, "name3");

        int nGroup = XAdapterListView.Group_AddItemText(hAdapter, "dasemimi");


        XAdapterListView.Item_AddColumn(hAdapter, "name");
        XAdapterListView.Item_AddColumn(hAdapter, "name2");
        int hImage = XImage.LoadFile("..\\..\\2.png", false);
        int nItem  = XAdapterListView.Item_AddItemImage(hAdapter, nGroup, hImage);

        XAdapterListView.Item_SetText(hAdapter, nGroup, nItem, 1, "哇咔咔");

        XWnd.ShowWindow(hWindow, 5);
        xc.XRunXCGUI();
        xc.XExitXCGUI();
    }
Esempio n. 3
0
        public LongListView()
        {
            var l = new XListView();

            l.SetBinding(ListView.ItemsSourceProperty, "Items");
            l.SetBinding(XListView.MoreDataCommandProperty, "MoreDataCommand");
            Content = l;
        }
        public bool SetSelectCell ( ref XListView lst , int LineNo , int ColNo , string strCell )
        {
            int nMaxCol = lst.Columns.Count;
            if ( ColNo >= nMaxCol )
                return false ;

            int nMaxLine = lst.Items.Count;
            if ( LineNo >= nMaxLine )
                return false ;

            lst.Items [ LineNo ].SubItems [ ColNo ].Text = strCell ;
            return true ;
        }
        public string GetSelectCell ( ref XListView lst , int LineNo , int ColNo )
        {
            string strCell = "";

            int nMaxCol = lst.Columns.Count;
            if ( ColNo >= nMaxCol )
                return String.Empty;

            int nMaxLine = lst.Items.Count;
            if ( LineNo >= nMaxLine )
                return String.Empty;

            strCell = lst.Items [ LineNo ].SubItems [ ColNo ].Text;
            return strCell;
        }
        public bool SetSelectCell ( ref XListView lst , int ColNo , string strCell )
        {
            int nMaxCol = lst.Columns.Count;
            if ( ColNo >= nMaxCol )
                return false;

            if ( lst.SelectedIndices.Count <= 0 )       //没有选中任何行.
                return false;

            int index = lst.SelectedIndices [ 0 ];
            lst.Items [ index ].SubItems [ ColNo ].Text = strCell ;
            return true ;
        }
        /*
        public void SetFontSize ( ref XControl.ListViewEx lst , int nFontSize )
        {
            lst.Font = new System.Drawing.Font ( "宋体" , nFontSize , System.Drawing.FontStyle.Regular , System.Drawing.GraphicsUnit.Pixel );
        }
        */

        public string GetSelectCell ( ref XListView lst , int ColNo )
        {
            string strCell = "";
            
            int nMaxCol = lst.Columns.Count;
            if ( ColNo >= nMaxCol )
                return String.Empty ;

            if ( lst.SelectedIndices.Count <= 0 )       //没有选中任何行.
                return String.Empty;

            int index = lst.SelectedIndices [ 0 ];
            strCell = lst.Items [ index ].SubItems [ ColNo ].Text;
            return strCell;
        }
 public void SetFontSize ( ref XListView lst , int nFontSize )
 {
     lst.Font = new System.Drawing.Font ( "宋体" , nFontSize , System.Drawing.FontStyle.Regular , System.Drawing.GraphicsUnit.Pixel );
 }
 public void SetLineHeight ( ref XListView lst , int nHeight )
 {
     ImageList imgList = new ImageList ();
     imgList.ImageSize = new Size ( 1 , nHeight );//分别是宽和高
     lst.SmallImageList = imgList;   //这里设置listView的SmallImageList ,用imgList将其撑大
 }
        public int GetAllColWidth ( ref XListView lv )
        {
            int nAllW = 0;
            int count = lv.Columns.Count;
            for ( int i = 0 ; i < count ; i++ )
            {
                nAllW += lv.Columns [ i ].Width;
            }

            return nAllW;
        }