Beispiel #1
0
        private void BuildPlatformView()
        {
            _sPlatformView                  = new SiteListView();
            _sPlatformView.MySortBrush      = SystemBrushes.ControlLight;
            _sPlatformView.MyHighlightBrush = Brushes.Khaki;
            _sPlatformView.GridLines        = true;
            _sPlatformView.MultiSelect      = false;
            _sPlatformView.Dock             = DockStyle.Fill;
            _sPlatformView.ControlPadding   = 4;
            _sPlatformView.HeaderStyle      = ColumnHeaderStyle.Nonclickable;

            _sPlatformView.Columns.Add(new EXColumnHeader("Test Category", 100));

            EXBoolColumnHeader boolcol = new EXBoolColumnHeader("Test Selected?", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);

            boolcol.Editable = false;
            _sPlatformView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Test Referred?", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);
            boolcol.Editable = false;
            _sPlatformView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Has Instrument?", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);
            boolcol.Editable = false;
            _sPlatformView.Columns.Add(boolcol);

            _sPlatformView.Columns.Add(new EXColumnHeader("# Instrument", 80));
            _sPlatformView.Columns.Add(new EXColumnHeader("Remarks", 300));

            _sPlatformView.DoubleClick += new EventHandler(sListView_DoubleClick);

            tabInstrument.Controls.Add(_sPlatformView);
        }
Beispiel #2
0
        private void LoadSiteListView()
        {
            _sListView                  = new SiteListView();
            _sListView.MySortBrush      = SystemBrushes.ControlLight;
            _sListView.MyHighlightBrush = Brushes.Goldenrod;
            _sListView.GridLines        = true;
            _sListView.MultiSelect      = false;
            _sListView.Dock             = DockStyle.Fill;
            _sListView.ControlPadding   = 4;
            _sListView.HeaderStyle      = ColumnHeaderStyle.Nonclickable;

            //add SmallImageList to ListView - images will be shown in ColumnHeaders
            var colimglst = new ImageList();

            colimglst.Images.Add("down", trueFalseImageList.Images[2]);
            colimglst.Images.Add("up", trueFalseImageList.Images[3]);
            colimglst.ColorDepth      = ColorDepth.Depth32Bit;
            colimglst.ImageSize       = new Size(20, 20); // this will affect the row height
            _sListView.SmallImageList = colimglst;

            //add columns and items
            _sListView.Columns.Add(new EXColumnHeader("Category/Region", 150));
            _sListView.Columns.Add(new EXColumnHeader("ART Site", 150));
            _sListView.Columns.Add(new EXEditableColumnHeader("% pediatrics", 80));

            int month = _forecast.StartBudgetPeriod;

            if (month - 1 == 0)
            {
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[11], 80));
            }
            else
            {
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 2], 80));
            }

            for (int i = 1; i <= 12; i++)
            {
                if (month > 12)
                {
                    month = 1;
                }
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 1], 80));
                month++;
            }

            _sListView.Columns.Add(new EXEditableColumnHeader("Growth Target", 80));

            var boolcol = new EXBoolColumnHeader("Apply Growth", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80)
            {
                Editable = true
            };

            _sListView.Columns.Add(boolcol);

            _sListView.BoolListViewSubItemValueChanged     += new EventHandler <EXBoolListViewSubItemEventArgs>(sListView_BoolListViewSubItemValueChanged);
            _sListView.EditableListViewSubitemValueChanged += new EventHandler <EXEditableListViewSubitemEventArgs>(_sListView_EditableListViewSubitemValueChanged);
            _sListView.SelectedIndexChanged += new EventHandler(sListView_SelectedIndexChanged);
            splitContainer1.Panel2.Controls.Add(_sListView);
        }
Beispiel #3
0
        private void LoadSiteListView()
        {
            _sListView                  = new SiteListView();
            _sListView.MySortBrush      = SystemBrushes.ControlLight;
            _sListView.MyHighlightBrush = Brushes.Goldenrod;
            _sListView.GridLines        = true;
            _sListView.MultiSelect      = false;
            _sListView.Dock             = DockStyle.Fill;
            _sListView.ControlPadding   = 4;
            _sListView.HeaderStyle      = ColumnHeaderStyle.Nonclickable;
            _sListView.Scrollable       = true;

            //add SmallImageList to ListView - images will be shown in ColumnHeaders
            ImageList colimglst = new ImageList();

            colimglst.Images.Add("down", trueFalseImageList.Images[2]);
            colimglst.Images.Add("up", trueFalseImageList.Images[3]);
            colimglst.ColorDepth      = ColorDepth.Depth32Bit;
            colimglst.ImageSize       = new Size(20, 20); // this will affect the row height
            _sListView.SmallImageList = colimglst;

            //add columns and items
            _sListView.Columns.Add(new EXColumnHeader("Category/Region", 100));
            _sListView.Columns.Add(new EXColumnHeader("ART Site", 150));
            _sListView.Columns.Add(new EXColumnHeader("Site Type", 80));

            EXBoolColumnHeader boolcol = new EXBoolColumnHeader("VCT", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);

            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("CD4", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Chemistry", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Hematology", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Viral Load", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Other Test", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol          = new EXBoolColumnHeader("Consumable", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);
            _sListView.BoolListViewSubItemValueChanged += new EventHandler <EXBoolListViewSubItemEventArgs>(sListView_BoolListViewSubItemValueChanged);
            _sListView.SelectedIndexChanged            += new EventHandler(sListView_SelectedIndexChanged);

            panSites.Controls.Add(_sListView);
        }
        private void LoadSiteListView()
        {
            _sListView                  = new SiteListView();
            _sListView.MySortBrush      = SystemBrushes.ControlLight;
            _sListView.MyHighlightBrush = Brushes.Goldenrod;
            _sListView.GridLines        = true;
            _sListView.MultiSelect      = false;
            _sListView.Dock             = DockStyle.Fill;
            _sListView.ControlPadding   = 4;
            _sListView.HeaderStyle      = ColumnHeaderStyle.Nonclickable;

            //add columns and items
            _sListView.Columns.Add(new EXColumnHeader("Category/Region", 150));
            _sListView.Columns.Add(new EXColumnHeader("ART Site", 150));
            _sListView.Columns.Add(new EXEditableColumnHeader("% pediatrics", 80));

            int month = _forecast.StartBudgetPeriod;

            if (month - 1 == 0)
            {
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[11], 80));
            }
            else
            {
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 2], 80));
            }

            for (int i = 1; i <= 12; i++)
            {
                if (month > 12)
                {
                    month = 1;
                }
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 1], 80));
                month++;
            }

            _sListView.Columns.Add(new EXEditableColumnHeader("Growth Target", 80));

            EXBoolColumnHeader boolcol = new EXBoolColumnHeader("Apply Growth", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);

            boolcol.Editable = true;

            _sListView.Columns.Add(boolcol);

            _sListView.BoolListViewSubItemValueChanged     += new EventHandler <EXBoolListViewSubItemEventArgs>(sListView_BoolListViewSubItemValueChanged);
            _sListView.EditableListViewSubitemValueChanged += new EventHandler <EXEditableListViewSubitemEventArgs>(_sListView_EditableListViewSubitemValueChanged);
            _sListView.SelectedIndexChanged += new EventHandler(sListView_SelectedIndexChanged);
            splitContainer1.Panel2.Controls.Add(_sListView);
        }
 public override int DoDraw(DrawListViewSubItemEventArgs e, int x, EXColumnHeader ch)
 {
     EXBoolColumnHeader boolcol = (EXBoolColumnHeader)ch;
     
     Image boolimg;
     if (this.BoolValue == true)
     {
         boolimg = boolcol.TrueImage;
     }
     else
     {
         boolimg = boolcol.FalseImage;
     }
     int imgy = e.Bounds.Y + ((int)(e.Bounds.Height / 2)) - ((int)(boolimg.Height / 2));
     e.Graphics.DrawImage(boolimg, x, imgy, boolimg.Width, boolimg.Height);
     x += boolimg.Width + 2;
     return x;
 }
        private void this_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            EXListViewItem lstvItem = this.GetItemAt(e.X, e.Y) as EXListViewItem;
            if (lstvItem == null) 
                return;
            _clickeditem = lstvItem;
            int x = lstvItem.Bounds.Left;
            int i;
            for (i = 0; i < this.Columns.Count; i++)
            {
                x = x + this.Columns[i].Width;
                if (x > e.X)
                {
                    x = x - this.Columns[i].Width;
                    _clickedsubitem = lstvItem.SubItems[i];
                    _col = i;
                    break;
                }
            }
            
            if (!(this.Columns[i] is EXColumnHeader)) 
                return;
            
            EXColumnHeader col = (EXColumnHeader)this.Columns[i];
            if (col.GetType() == typeof(EXEditableColumnHeader))
            {
                EXEditableColumnHeader editcol = (EXEditableColumnHeader) col;
                if (editcol.MyControl != null)
                {
                    Control c = editcol.MyControl;
                    if (c.Tag != null)
                    {
                        this.Controls.Add(c);
                        c.Tag = null;
                        if (c is ComboBox)
                        {
                            ((ComboBox)c).SelectedValueChanged += new EventHandler(cmbx_SelectedValueChanged);
                        }
                        c.Leave += new EventHandler(c_Leave);
                    }

                    if (c is ComboBox)
                    {
                        if(ComboBoxBeforeVisible != null)
                            ComboBoxBeforeVisible(this, new EXEditableListViewComboBoxEventArgs(_clickeditem, (EXListViewSubItem)_clickedsubitem) );
                    }

                    c.Location = new Point(x, this.GetItemRect(this.Items.IndexOf(lstvItem)).Y);
                    c.Width = this.Columns[i].Width;
                    if (c.Width > this.Width) c.Width = this.ClientRectangle.Width;
                    c.Text = _clickedsubitem.Text;
                    c.Visible = true;
                    c.BringToFront();
                    c.Focus();
                }
                else
                {
                    txtbx.Location = new Point(x, this.GetItemRect(this.Items.IndexOf(lstvItem)).Y);
                    txtbx.Width = this.Columns[i].Width;
                    if (txtbx.Width > this.Width) txtbx.Width = this.ClientRectangle.Width;
                    txtbx.Text = _clickedsubitem.Text;
                    txtbx.Visible = true;
                    txtbx.BringToFront();
                    txtbx.Focus();
                }
            }
            else if (col.GetType() == typeof(EXBoolColumnHeader))
            {
                EXBoolColumnHeader boolcol = (EXBoolColumnHeader)col;
                if (boolcol.Editable)
                {
                    EXBoolListViewSubItem boolsubitem = (EXBoolListViewSubItem)_clickedsubitem;
                    if (boolsubitem.BoolValue == true)
                    {
                        boolsubitem.BoolValue = false;
                    }
                    else
                    {
                        boolsubitem.BoolValue = true;
                    }

                    if (BoolListViewSubItemValueChanged != null)
                    {
                        BoolListViewSubItemValueChanged(this, new EXBoolListViewSubItemEventArgs(_clickeditem, boolsubitem));
                    }
                    this.Invalidate(boolsubitem.Bounds);
                }
            }
        }
Beispiel #7
0
        private void BuildPlatformView()
        {
            _sPlatformView = new SiteListView();
            _sPlatformView.MySortBrush = SystemBrushes.ControlLight;
            _sPlatformView.MyHighlightBrush = Brushes.Khaki;
            _sPlatformView.GridLines = true;
            _sPlatformView.MultiSelect = false;
            _sPlatformView.Dock = DockStyle.Fill;
            _sPlatformView.ControlPadding = 4;
            _sPlatformView.HeaderStyle = ColumnHeaderStyle.Nonclickable;

            _sPlatformView.Columns.Add(new EXColumnHeader("Test Category", 100));

            EXBoolColumnHeader boolcol = new EXBoolColumnHeader("Test Selected?", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);
            boolcol.Editable = false;
            _sPlatformView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Test Referred?", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);
            boolcol.Editable = false;
            _sPlatformView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Has Instrument?", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);
            boolcol.Editable = false;
            _sPlatformView.Columns.Add(boolcol);

            _sPlatformView.Columns.Add(new EXColumnHeader("# Instrument", 80));
            _sPlatformView.Columns.Add(new EXColumnHeader("Remarks", 300));

            _sPlatformView.DoubleClick += new EventHandler(sListView_DoubleClick);

            tabInstrument.Controls.Add(_sPlatformView);
        }
        private void LoadSiteListView()
        {
            _sListView = new SiteListView();
            _sListView.MySortBrush = SystemBrushes.ControlLight;
            _sListView.MyHighlightBrush = Brushes.Goldenrod;
            _sListView.GridLines = true;
            _sListView.MultiSelect = false;
            _sListView.Dock = DockStyle.Fill;
            _sListView.ControlPadding = 4;
            _sListView.HeaderStyle = ColumnHeaderStyle.Nonclickable;

            //add SmallImageList to ListView - images will be shown in ColumnHeaders
            var colimglst = new ImageList();
            colimglst.Images.Add("down", trueFalseImageList.Images[2]);
            colimglst.Images.Add("up", trueFalseImageList.Images[3]);
            colimglst.ColorDepth = ColorDepth.Depth32Bit;
            colimglst.ImageSize = new Size(20, 20); // this will affect the row height
            _sListView.SmallImageList = colimglst;

            //add columns and items
            _sListView.Columns.Add(new EXColumnHeader("Category/Region", 150));
            _sListView.Columns.Add(new EXColumnHeader("ART Site", 150));
            _sListView.Columns.Add(new EXEditableColumnHeader("% pediatrics", 80));

            int month = _forecast.StartBudgetPeriod;

            if (month - 1 == 0)
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[11], 80));
            else
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 2], 80));

            for (int i = 1; i <= 12; i++)
            {
                if (month > 12)
                    month = 1;
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 1], 80));
                month++;
            }

            _sListView.Columns.Add(new EXEditableColumnHeader("Growth Target", 80));

            var boolcol = new EXBoolColumnHeader("Apply Growth", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80)
            {
                Editable = true
            };

            _sListView.Columns.Add(boolcol);

            _sListView.BoolListViewSubItemValueChanged += new EventHandler<EXBoolListViewSubItemEventArgs>(sListView_BoolListViewSubItemValueChanged);
            _sListView.EditableListViewSubitemValueChanged += new EventHandler<EXEditableListViewSubitemEventArgs>(_sListView_EditableListViewSubitemValueChanged);
            _sListView.SelectedIndexChanged += new EventHandler(sListView_SelectedIndexChanged);
            splitContainer1.Panel2.Controls.Add(_sListView);
        }
Beispiel #9
0
        private void LoadSiteListView()
        {
            _sListView = new SiteListView();
            _sListView.MySortBrush = SystemBrushes.ControlLight;
            _sListView.MyHighlightBrush = Brushes.Goldenrod;
            _sListView.GridLines = true;
            _sListView.MultiSelect = false;
            _sListView.Dock = DockStyle.Fill;
            _sListView.ControlPadding = 4;
            _sListView.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            _sListView.Scrollable = true;

            //add SmallImageList to ListView - images will be shown in ColumnHeaders
            ImageList colimglst = new ImageList();
            colimglst.Images.Add("down", trueFalseImageList.Images[2]);
            colimglst.Images.Add("up", trueFalseImageList.Images[3]);
            colimglst.ColorDepth = ColorDepth.Depth32Bit;
            colimglst.ImageSize = new Size(20, 20); // this will affect the row height
            _sListView.SmallImageList = colimglst;

            //add columns and items
            _sListView.Columns.Add(new EXColumnHeader("Category/Region", 100));
            _sListView.Columns.Add(new EXColumnHeader("ART Site", 150));
            _sListView.Columns.Add(new EXColumnHeader("Site Type", 80));

            EXBoolColumnHeader boolcol = new EXBoolColumnHeader("VCT",trueFalseImageList.Images[0],trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("CD4", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Chemistry", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Hematology", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Viral Load", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Other Test", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);

            boolcol = new EXBoolColumnHeader("Consumable", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 60);
            boolcol.Editable = true;
            _sListView.Columns.Add(boolcol);
            _sListView.BoolListViewSubItemValueChanged += new EventHandler<EXBoolListViewSubItemEventArgs>(sListView_BoolListViewSubItemValueChanged);
            _sListView.SelectedIndexChanged += new EventHandler(sListView_SelectedIndexChanged);

            panSites.Controls.Add(_sListView);
        }
        private void LoadSiteListView()
        {
            _sListView = new SiteListView();
            _sListView.MySortBrush = SystemBrushes.ControlLight;
            _sListView.MyHighlightBrush = Brushes.Goldenrod;
            _sListView.GridLines = true;
            _sListView.MultiSelect = false;
            _sListView.Dock = DockStyle.Fill;
            _sListView.ControlPadding = 4;
            _sListView.HeaderStyle = ColumnHeaderStyle.Nonclickable;

            //add columns and items
            _sListView.Columns.Add(new EXColumnHeader("Category/Region", 150));
            _sListView.Columns.Add(new EXColumnHeader("ART Site", 150));
            _sListView.Columns.Add(new EXEditableColumnHeader("% pediatrics", 80));

            int month = _forecast.StartBudgetPeriod;
            if (month - 1 == 0)
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[11], 80));
            else
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 2], 80));

            for (int i = 1; i <= 12; i++)
            {
                if (month > 12)
                    month = 1;
                _sListView.Columns.Add(new EXColumnHeader(LqtUtil.Months[month - 1], 80));
                month++;
            }

            _sListView.Columns.Add(new EXEditableColumnHeader("Growth Target", 80));

            EXBoolColumnHeader boolcol = new EXBoolColumnHeader("Apply Growth", trueFalseImageList.Images[0], trueFalseImageList.Images[1], 80);
            boolcol.Editable = true;

            _sListView.Columns.Add(boolcol);

            _sListView.BoolListViewSubItemValueChanged += new EventHandler<EXBoolListViewSubItemEventArgs>(sListView_BoolListViewSubItemValueChanged);
            _sListView.EditableListViewSubitemValueChanged += new EventHandler<EXEditableListViewSubitemEventArgs>(_sListView_EditableListViewSubitemValueChanged);
            _sListView.SelectedIndexChanged += new EventHandler(sListView_SelectedIndexChanged);
            splitContainer1.Panel2.Controls.Add(_sListView);
        }