Ejemplo n.º 1
0
        ///<summary>
        /// GetFilterData
        ///</summary>
        ///<returns></returns>
        static public List<UserFilterData> GetFilterData(GridPanel gridPanel)
        {
            if (_filterData != null)
                return (_filterData);

            return (LoadFilterData(gridPanel));
        }
        public void BuildGrid(System.Web.UI.Control parent)
        {
            Assert.ArgumentNotNull(parent, "parent");

            LayoutDefinition layout = null;

            var gridPanel = new GridPanel
            {
                RenderAs = RenderAs.Literal,
                Width = Unit.Parse("100%")
            };

            gridPanel.Attributes["Class"] = Class;
            gridPanel.Attributes["CellSpacing"] = "2";
            gridPanel.Attributes["id"] = ID;
            parent.Controls.Add(gridPanel);

            string @string = StringUtil.GetString(Value);

            if (@string.Length > 0)
            {
                layout = LayoutDefinition.Parse(@string);
            }

            foreach (DeviceItem deviceItem in Client.ContentDatabase.Resources.Devices.GetAll())
            {
                BuildDevice(gridPanel, layout, deviceItem);
            }
        }
 public override void Run()
 {
     if (this.Owner is GridPanel)
     {
         object focusRow = (this.Owner as GridPanel).GetFocusRow();
         if (focusRow != null)
         {
             PropertyInfo property = focusRow.GetType().GetProperty(this.PropertyName);
             if (property != null)
             {
                 GridAttribute ga = null;
                 DisplayNameAttribute attribute2 = null;
                 foreach (Attribute attribute3 in property.GetCustomAttributes(false))
                 {
                     if (attribute3 is GridAttribute)
                     {
                         ga = (GridAttribute) attribute3;
                     }
                     if (attribute3 is DisplayNameAttribute)
                     {
                         attribute2 = (DisplayNameAttribute) attribute3;
                     }
                 }
                 if (ga != null)
                 {
                     GridPanel gp = new GridPanel(ga, property.GetValue(focusRow, null));
                     GridDialog dialog = new GridDialog(gp);
                     dialog.Text = attribute2.DisplayName;
                     dialog.Show();
                 }
             }
         }
     }
 }
        private void CreateControls(Item item, string fields = "")
        {
            var textfields = GetTextFields(item);
            Fields.Controls.Clear();
            
            foreach (var field in textfields)
            {
                var border = new GridPanel()
                {
                    Width = Unit.Percentage(90),
                    Columns = 2
                };
                var checkbox = new Checkbox()
                {                    
                    Header = field.DisplayName,
                    HeaderStyle = "font-weight:bold",                    
                    ID = Control.GetUniqueID("ctl_cb"),                    
                    Checked = fields.Contains(string.Concat("|", field.Name, "|"))
                };
                border.Controls.Add(checkbox);
                border.Controls.Add(new Literal { Text = "<br/>" });
                border.Controls.Add(new HtmlTextArea()
                    {
                        ID = checkbox.ID.Replace("cb","ta"),
                        Rows = 5,
                        Cols = 27,
                        Value = field.Value,
                    }
                    );
                
                Fields.Controls.Add(border);
            }

        }
Ejemplo n.º 5
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     IWindowsFormsEditorService service = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
     if (service != null)
     {
         GridAttribute ga = null;
         DisplayNameAttribute attribute2 = null;
         foreach (Attribute attribute3 in context.PropertyDescriptor.Attributes)
         {
             if (attribute3 is GridAttribute)
             {
                 ga = (GridAttribute) attribute3;
             }
             if (attribute3 is DisplayNameAttribute)
             {
                 attribute2 = (DisplayNameAttribute) attribute3;
             }
         }
         if (ga != null)
         {
             GridPanel gp = new GridPanel(ga, value);
             GridDialog dialog = new GridDialog(gp);
             dialog.Text = attribute2.DisplayName;
             service.ShowDialog(dialog);
         }
     }
     return value;
 }
Ejemplo n.º 6
0
 protected override void RenderBorder(Graphics g,
     GridPanel panel, GridPanelVisualStyle pstyle, Rectangle r)
 {
     using (Pen pen = new Pen(pstyle.HeaderLineColor))
     {
         r.Height--;
         g.DrawLine(pen, r.X, r.Bottom, r.Right - 1, r.Bottom);
     }
 }
        public GridSquare(Point Location, Colors TileColor, Status Occupied)
        {
            panel = new GridPanel(this);
            this.Location = Location;
            this.TileColor = TileColor;
            this.Occupied = Occupied;

            this.Size = defaultTileSize;
        }
Ejemplo n.º 8
0
	    private EEval(GridCell cell, string source, List<GridCell> usedCells)
        {
            _Cell = cell;
            _UsedCells = usedCells;

            if (_Cell != null)
                _GridPanel = cell.GridPanel;

            Source = source;
        }
Ejemplo n.º 9
0
        ///<summary>
        /// CustomFilter
        ///</summary>
        public CustomFilter(GridPanel gridPanel, GridColumn gridColumn, string filterText)
        {
            _GridPanel = gridPanel;
            _GridColumn = gridColumn;

            InitializeComponent();
            InitializeText();
            InitializeFilter(filterText);

            PositionWindow(_GridPanel.SuperGrid);
        }
Ejemplo n.º 10
0
        private GridPanel CreateSubPanel(int begin, int end)
        {
            GridPanel backgroundPanel = new GridPanel(Simulator.Scene, Vector3.Zero, new Vector2(500, 500), Preferences.PrioriteGUIPanneauGeneral, Color.White)
            {
                NbColumns = 4,
                OnlyShowWidgets = true
            };

            for (int i = begin; i <= end; i++)
                backgroundPanel.AddWidget("background" + i, new ImageWidget("background" + i, 0.1f));

            return backgroundPanel;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Constructor
        /// </summary>
        public FilterPopup(GridPanel panel)
        {
            _Panel = panel;

            _PopupControl = new PopupControl();

            _PopupControl.Opened += PopupControlOpened;
            _PopupControl.Closed += PopupControlClosed;

            _PopupControl.UserResize += PopupControlUserResize;

            _PopupControl.PreRenderGripBar += PopupControlPreRenderGripBar;
            _PopupControl.PostRenderGripBar += PopupControlPostRenderGripBar;
        }
Ejemplo n.º 12
0
        public void ShowCell(int row, int column)
        {
            var graph    = GridPanel.CreateGraphics();
            var cellSize = GridPanel.Width / _board.Dimension;

            if (_board.GetValue(row, column) == true)
            {
                graph.FillRectangle(_farbeLebend, new Rectangle(row * cellSize + 1, column * cellSize + 1, cellSize - 1, cellSize - 1));
            }
            else if (_board.GetValue(row, column) == false)
            {
                graph.FillRectangle(_farbeTot, new Rectangle(row * cellSize + 1, column * cellSize + 1, cellSize - 1, cellSize - 1));
            }
        }
        public GridSquare(Point Location, Colors TileColor, Status Occupied, int n, int m)
        {
            panel = new GridPanel(this);
            this.Location = Location;
            this.TileColor = TileColor;
            this.Occupied = Occupied;

            this.PositionX = n;
            this.PositionY = m;

            this.Size = defaultTileSize;

               // Draw();
        }
Ejemplo n.º 14
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            GridPanel panel = dsbn.PrimaryGrid;

            panel.Rows.Clear();

            switch (type)
            {
            case TypeBN.BNHienTinh:
            {
                List <HT_ThongTinNguoiHienTinh> nhts = dbHT.GetAllNguoiHienTinh();
                List <HT_ThongTinNguoiHienTinh> nhtsBeforeFilters = GetPatientAfterFilter(nhts);

                dsbn.BeginUpdate();
                foreach (var bn in nhtsBeforeFilters)
                {
                    object[] ob1 = new object[]
                    {
                        bn.MaBN, bn.HoVaTen, RTTenTinh(bn.Tinh_ThanhPho), bn.SoCMND, bn.NgaySinh.ToString("dd-MM-yyyy"), bn.SoDienThoai
                    };

                    panel.Rows.Add(new GridRow(ob1));
                }
                dsbn.EndUpdate();

                break;
            }

            case TypeBN.BNHienNoan:
            {
                List <HN_ThongTinNguoiHienNoan> nhns = dbHN.GetAllNguoiHienNoan();
                List <HN_ThongTinNguoiHienNoan> nhtsBeforeFilters = GetPatientAfterFilter(nhns);

                dsbn.BeginUpdate();
                foreach (var bn in nhtsBeforeFilters)
                {
                    object[] ob1 = new object[]
                    {
                        bn.MaBN, bn.HoVaTen, RTTenTinh(bn.Tinh_ThanhPho), bn.SoCMND, bn.NgaySinh.ToString("dd-MM-yyyy"), bn.SoDienThoai
                    };

                    panel.Rows.Add(new GridRow(ob1));
                }
                dsbn.EndUpdate();

                break;
            }
            }
        }
    // Initialize controls
    public override void InitShadow(System.Web.UI.WebControls.ContentPlaceHolder oContentPage)
    {
        #region begin

        lblSite     = (Hidden)oContentPage.FindControl("lblSite");
        lblBu       = (Hidden)oContentPage.FindControl("lblBu");
        lblBuilding = (Hidden)oContentPage.FindControl("lblBuilding");


        txtFormNo   = (TextField)oContentPage.FindControl("txtFormNo");
        txtCustomer = (TextField)oContentPage.FindControl("txtCustomer");
        txtDate     = (TextField)oContentPage.FindControl("txtDate");
        txtNotes    = (TextArea)oContentPage.FindControl("txtNotes");

        cmbPhase      = (ComboBox)oContentPage.FindControl("cmbPhase");
        cmbPlant      = (ComboBox)oContentPage.FindControl("cmbPlant");
        cbProductType = (ComboBox)oContentPage.FindControl("cbProductType");
        txtModel      = (TextField)oContentPage.FindControl("txtModel");;
        cmbLayout     = (MultiCombo)oContentPage.FindControl("cmbLayout");;

        txtPM    = (TextField)oContentPage.FindControl("txtPM");
        txtRD    = (TextField)oContentPage.FindControl("txtRD");
        txtSales = (TextField)oContentPage.FindControl("txtSales");
        txtNextStage_BeginDate = (DateField)oContentPage.FindControl("txtNextStage_BeginDate");
        ConAttachment          = (Container)oContentPage.FindControl("ConAttachment");


        cmbPM       = (ComboBox)oContentPage.FindControl("cmbPM");
        cmbRD       = (ComboBox)oContentPage.FindControl("cmbRD");
        cmbSales    = (ComboBox)oContentPage.FindControl("cmbSales");
        txtPMExt    = (NumberField)oContentPage.FindControl("txtPMExt");
        txtRDExt    = (NumberField)oContentPage.FindControl("txtRDExt");
        txtSalesExt = (NumberField)oContentPage.FindControl("txtSalesExt");

        pnlCountersign    = (Panel)oContentPage.FindControl("pnlCountersign");
        grdResult         = (GridPanel)oContentPage.FindControl("grdResult");
        btnDelete         = (Button)oContentPage.FindControl("btnDelete");
        cmbAttachmentType = (ComboBox)oContentPage.FindControl("cmbAttachmentType");
        btnDelete         = (Button)oContentPage.FindControl("btnDelete");
        grdAttachment     = (GridPanel)oContentPage.FindControl("grdAttachment");

        pnlResult         = (Panel)oContentPage.FindControl("pnlResult");
        rgResult          = (RadioGroup)oContentPage.FindControl("rgResult");
        txtReslutOpinion  = (TextArea)oContentPage.FindControl("txtReslutOpinion");
        rdResultY         = (Radio)oContentPage.FindControl("rdResultY");
        rdResultN         = (Radio)oContentPage.FindControl("rdResultN");
        rdReulutCondition = (Radio)oContentPage.FindControl("rdReulutCondition");
        #endregion
    }
Ejemplo n.º 16
0
        private void CreateLendPanel(GridRowHeaderDoubleClickEventArgs e, SQLiteConnection conn)
        {
            GridPanel     panel = ArchiveGrid.PrimaryGrid;
            GridRow       row   = (GridRow)panel.Rows[e.GridRow.RowIndex];
            SQLiteCommand cmd   = new SQLiteCommand();

            cmd.Connection = conn;
            try
            {
                int    archId = int.Parse(row.Cells[1].Value.ToString());
                string strsql = string.Format("select * from LendArchive where ArchId ={0} order by LendDate desc", archId);
                cmd.CommandText = strsql;
                SQLiteDataReader reader = cmd.ExecuteReader();
                if (reader.HasRows)
                {
                    GridPanel subPanel = new GridPanel();
                    SetLendPanelColumn(subPanel);
                    while (reader.Read())
                    {
                        GridRow gr = new GridRow();
                        gr.Cells.Add(new GridCell(reader.GetInt16(0)));
                        gr.Cells.Add(new GridCell(reader.GetString(1)));
                        if (!reader.IsDBNull(2))
                        {
                            gr.Cells.Add(new GridCell(Convert.ToDateTime(reader.GetString(2))));
                        }
                        gr.Cells.Add(new GridCell(reader.GetInt16(3)));
                        gr.Cells.Add(new GridCell(reader.IsDBNull(4) ? "" : reader.GetString(4)));
                        gr.Cells.Add(new GridCell(reader.IsDBNull(5) ? "" : reader.GetString(5)));
                        gr.Cells.Add(new GridCell(reader.IsDBNull(9) ? "" : reader.GetString(9)));
                        gr.Cells.Add(new GridCell(reader.IsDBNull(7) ? "" : reader.GetString(7)));
                        if (!reader.IsDBNull(8))
                        {
                            gr.Cells.Add(new GridCell(Convert.ToDateTime(reader.GetString(8))));
                        }
                        gr.Cells.Add(new GridCell(reader.IsDBNull(6) ? "" : reader.GetString(6)));
                        gr.Cells.Add(new GridCell(reader.IsDBNull(10) ? "" : reader.GetString(10)));
                        gr.Cells.Add(new GridCell(reader.IsDBNull(11) ? "" : reader.GetString(11)));
                        subPanel.Rows.Add(gr);
                    }
                    e.GridRow.Rows.Add(subPanel);
                    e.GridRow.Expanded = true;
                }
            }
            catch (System.Data.SQLite.SQLiteException E)
            {
                throw new Exception(E.Message);
            }
        }
Ejemplo n.º 17
0
 public void DropStaff(GridPanel TargetPanel)
 {
     if (InGrid)
     {
         return;
     }
     InGrid             = true;
     Attatched          = true;
     transform.rotation = GridRotation;
     transform.position = TargetPanel.transform.position;
     GridPosition       = TargetPanel.position;
     TargetPanel.SetItem(this);
     panel = TargetPanel;
     transform.SetParent(null);
 }
Ejemplo n.º 18
0
        /// <summary>
        /// This routine is called to retrieve application provided
        /// cell style information. The style being presented in this
        /// call is the Effective Style (style used after applying
        /// all base styles).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void SuperGridControl1GetCellStyle(object sender, GridGetCellStyleEventArgs e)
        {
            GridPanel panel = e.GridPanel;

            if (panel.Name.Equals("Customers") == true)
            {
                if (e.GridCell.GridColumn.Name.Equals("ContactTitle") == true)
                {
                    if (((string)e.GridCell.Value).Equals("Owner") == true)
                    {
                        e.Style.TextColor = Color.Red;
                    }
                }
            }
        }
Ejemplo n.º 19
0
        private void AddGridRow([NotNull] IStrength strength, [NotNull] GridPanel panel)
        {
            var row = new GridRow(
                strength.Id,
                strength.Name,
                strength.Description);

            ((INotifyPropertyChanged)strength).PropertyChanged += OnStrengthPropertyChanged;
            row.Tag = strength;
            for (int i = 0; i < row.Cells.Count; i++)
            {
                row.Cells[i].PropertyChanged += OnPropertyChanged;
            }
            panel.Rows.Add(row);
        }
Ejemplo n.º 20
0
        public LevelsPanel(Scene scene, Vector3 position, Vector2 size, double visualPriority, Color color)
            : base(scene, position, size, visualPriority, color)
        {
            SelectedLevelLabel = new Label(new Text("Selected level: none", @"Pixelite") { SizeX = 2 });
            PushButtons = new Dictionary<LevelDescriptor, PushButton>();

            Levels = new GridPanel(scene, position, size, visualPriority, color)
            {
                NbColumns = 10
            };
            Levels.OnlyShowWidgets = true;

            AddWidget("SelectedLevel", SelectedLevelLabel);
            AddWidget("Levels", Levels);
        }
Ejemplo n.º 21
0
        private void btnLend_Click(object sender, EventArgs e)
        {
            GridPanel panel = LendGrid.PrimaryGrid;

            panel.Columns["gcArchName"].EditorType = typeof(ArchiveDropDownEditControl);
            List <string> Archives = GetArchiveList();

            panel.Columns["gcArchName"].EditorParams = new object[] { Archives };

            GridRow gr = LendGrid.PrimaryGrid.NewRow();

            gr.Cells["gcArchName"].Value = CurrentArchiveInfo.ArchiveName;
            gr.Cells["gcArchId"].Value   = CurrentArchiveInfo.Id;
            LendGrid.PrimaryGrid.Rows.Add(gr);
        }
Ejemplo n.º 22
0
 private static GridPanel GetCategoryPanel(RelationInfo link)
 {
   CategoryItem categoryItem = new CategoryItem(Client.ContentDatabase.GetItem(link.Category));
   GridPanel categoryPanel = new GridPanel();
   string categoryFullName = categoryItem.CategoryName;
   string categoryName = categoryItem.DisplayName;
   categoryPanel.Controls.Add(new Literal(string.Format("{0} ({1:F0}%)", categoryName, link.Weight))
                                {Class = "categoryName"});
   categoryPanel.Controls.Add(
     new Literal(string.Format("{0}",
                               categoryFullName.Substring(0, categoryFullName.Length - categoryName.Length - 1)))
       {Class = "categoryPath"});
   categoryPanel.Attributes["class"] = "categoryPanel";
   return categoryPanel;
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Customizes the CustomerPanel
        /// </summary>
        /// <param name="panel"></param>
        private void CustomizeCustomerPanel(GridPanel panel)
        {
            panel.FrozenColumnCount      = 1;
            panel.ColumnHeader.RowHeight = 30;

            panel.Columns["Region"].NullString = "<no locale>";

            panel.Columns[0].CellStyles.Default.Background =
                new Background(Color.AliceBlue);

            foreach (GridColumn column in panel.Columns)
            {
                column.ColumnSortMode = ColumnSortMode.Multiple;
            }
        }
Ejemplo n.º 24
0
 void Fase2()
 {
     CreatePlaneArea(8, 6);
     int[,] poss = new int[, ] {
         { 0, 1 }, { 1, 1 }, { 2, 1 }, { 5, 1 }, { 6, 1 }, { 7, 1 }, { 6, 0 }, { 6, 2 }, { 6, 3 }, { 6, 4 }, { 6, 5 }
     };
     CreateWalls(poss);
     SpawnObj(Target, 2, 0, false, Objcolor.GREEN);
     //	SpawnObj(Glass, 4, 1, false);
     SpawnObj(Reflector, 5, 0, true);
     SpawnObj(Reflector, 2, 5, true);
     CreatePressure(2, 3, new PressureObj[] { new PressureObj(Wall, 3, 1, false), new PressureObj(Glass, 4, 1, false) });
     Instantiate(tutorials[1], canvas.transform);
     InitialPanel = grid.thisgrid.panellist[1, 4];
 }
Ejemplo n.º 25
0
        public FrmEntrega(String Co_usuario)
        {
            Co_usu = Co_usuario;
            InitializeComponent();

            GridPanel panel = superGridControl1.PrimaryGrid;

            panel.AutoGenerateColumns = false;
            panel.Name         = "pPedidosAlm";
            panel.ShowToolTips = true;
            panel.MinRowHeight = 20;
            panel.DefaultVisualStyles.GroupByStyles.Default.Background = _Background1;
            panel.SelectionGranularity             = SelectionGranularity.Cell;
            superGridControl1.DataBindingComplete += SuperGridControl1DataBindingComplete;
        }
Ejemplo n.º 26
0
 void Fase3()
 {
     CreatePlaneArea(8, 6);
     int[,] poss = new int[, ] {
         { 4, 0 }, { 4, 1 }, { 6, 0 }, { 6, 1 }
     };
     CreateWalls(poss);
     SpawnObj(Target, 5, 5, false, Objcolor.GREEN);
     SpawnObj(Target, 5, 0, false, Objcolor.RED);
     SpawnObj(Double, 7, 2, true);
     SpawnObj(Glass, 3, 0, true);
     SpawnObj(Glass, 1, 5, true);
     CreatePressure(1, 3, new PressureObj[] { new PressureObj(Wall, 5, 1, true) });
     InitialPanel = grid.thisgrid.panellist[1, 3];
 }
Ejemplo n.º 27
0
    private void BuildRelatedCategories(IOrderedEnumerable<RelationInfo> categories, GridPanel categoriesPanel, RelationInfo originCategory)
    {
        IEnumerable<RelationInfo> calculatedCategories = (from category in categories
                                                          where
                                                            (
                                                             (category.RelatedCategory.IndexOf(originCategory.Category) > -1))
                                                          select category);

      foreach (RelationInfo calculatedCategory in calculatedCategories)
      {
        categoriesPanel.Controls.Add(GetSeparator());
        categoriesPanel.Controls.Add(GetCategoryPanel(calculatedCategory));
        BuildRelatedCategories(categories, categoriesPanel, calculatedCategory);
      }
    }
Ejemplo n.º 28
0
        public static void ArrangeInputs(GridPanel actualGridPanel, int[,] array)
        {
            for (var row = 0; row <= actualGridPanel.MaxRows; row++)
            {
                for (var column = 0; column <= actualGridPanel.MaxColumns; column++)
                {
                    var location = new Location()
                    {
                        Row = row, Column = column
                    };

                    actualGridPanel[location] = array[row, column];
                }
            }
        }
Ejemplo n.º 29
0
        private void CustomizeOrdersPanel(GridPanel panel)
        {
            panel.ShowRowGridIndex       = true;
            panel.ShowRowDirtyMarker     = true;
            panel.ColumnHeader.RowHeight = 30;

            panel.Columns[1].CellStyles.Default.Background =
                new Background(Color.Beige);

            panel.Columns["PK"].Visible            = false;
            panel.Columns["valorMonedaID"].Visible = false;
            panel.Columns["Orden"].Visible         = false;

            panel.Columns["Moneda"].ReadOnly = true;
            panel.Columns["Moneda"].Width    = 80;

            panel.Columns["Descripcion"].HeaderText = "";
            panel.Columns["Descripcion"].ReadOnly   = true;
            panel.Columns["Descripcion"].Width      = 100;

            panel.Columns["NroDoc"].HeaderText = "NroDoc. / Pag.";
            panel.Columns["NroDoc"].ReadOnly   = true;
            panel.Columns["NroDoc"].Width      = 90;
            panel.Columns["NroDoc"].CellStyles.Default.Alignment = Alignment.MiddleCenter;

            panel.Columns["Total"].HeaderText = "Total / Pag.";
            panel.Columns["Total"].ReadOnly   = true;
            panel.Columns["Total"].Width      = 80;
            panel.Columns["Total"].CellStyles.Default.Alignment = Alignment.MiddleRight;

            panel.Columns["NroDocSOC"].HeaderText = "NroDoc. / Socio";
            panel.Columns["NroDocSOC"].ReadOnly   = true;
            panel.Columns["NroDocSOC"].Width      = 90;
            panel.Columns["NroDocSOC"].CellStyles.Default.Alignment = Alignment.MiddleCenter;

            panel.Columns["TotalSOC"].HeaderText = "Total / Socio";
            panel.Columns["TotalSOC"].ReadOnly   = true;
            panel.Columns["TotalSOC"].Width      = 80;
            panel.Columns["TotalSOC"].CellStyles.Default.Alignment = Alignment.MiddleRight;

            panel.Caption = new GridCaption();

            //panel.Caption.Text = String.Format("Orders ({0}) for customer <font color=\"Maroon\"><i>\"{1}</i>\"</font>",
            //    panel.Rows.Count, ((GridRow)panel.Parent)["Moneda"].Value);

            panel.DefaultVisualStyles.CaptionStyles.Default.Alignment  = Alignment.MiddleLeft;
            panel.DefaultVisualStyles.GroupByStyles.Default.Background = _Background2;
        }
Ejemplo n.º 30
0
        private void InitLendArchiveGrid()
        {
            GridPanel panel = LendGrid.PrimaryGrid;

            panel.Rows.Clear();
            panel.EnableColumnFiltering = true;
            panel.ShowCheckBox          = !Authority.AllowDelete;
            panel.CheckBoxes            = Authority.AllowDelete;
            panel.ShowTreeButtons       = true;
            panel.ShowTreeLines         = true;
            panel.ShowRowGridIndex      = true;
            panel.EnableColumnFiltering = true;
            panel.DefaultVisualStyles.CellStyles.Default.Font = new Font("宋体", 11f);
            panel.Caption.Text = CurrentArchiveInfo.Project.ProjectName;

            panel.FilterLevel     = FilterLevel.AllConditional;
            panel.FilterMatchType = FilterMatchType.RegularExpressions;

            panel.Columns["gcArchName"].EditorType = typeof(ArchiveDropDownEditControl);
            List <string> Archives = GetArchiveList();

            panel.Columns["gcArchName"].EditorParams = new object[] { Archives };

            panel.Columns[2].EditorType             = typeof(GridDateTimePickerEditControl);
            panel.Columns[2].RenderType             = typeof(GridDateTimePickerEditControl);
            panel.Columns[2].DefaultNewRowCellValue = DateTime.Now;

            panel.Columns[3].EditorType = typeof(GridDoubleIntInputEditControl);
            GridDoubleIntInputEditControl de = (GridDoubleIntInputEditControl)panel.Columns[3].EditControl;

            panel.Columns[3].DataType = typeof(int);
            panel.Columns[3].CellStyles.Default.Background.BackColorBlend.Colors = new Color[1] {
                Color.LightGray
            };
            de.MinValue = 0;

            GridColumn gc = panel.Columns["gcRebackDate"];

            gc.EditorType             = typeof(GridDateTimePickerEditControl);
            gc.RenderType             = typeof(GridDateTimePickerEditControl);
            gc.DefaultNewRowCellValue = DateTime.Now;

            GridColumn nr = panel.Columns["gcNeedReturn"];

            nr.EditorType             = typeof(ArchiveDropDownEditControl);
            nr.EditorParams           = new object[] { NeedReturnArgs };
            nr.DefaultNewRowCellValue = NeedReturnArgs[0];
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Initializes the default grid
        /// </summary>
        private void InitializeGrid()
        {
            GridPanel panel = superGridControl1.PrimaryGrid;

            // Use MyGridBubbleBarEditControl so that we can easily
            // give the BubbleBar EditorControl our small and large
            // ImageLists.

            GridColumn column = panel.Columns["BubbleBar"];

            column.EditorType   = typeof(MyGridBubbleBarEditControl);
            column.EditorParams = new object[] { imageList1, imageList2 };

            // Set the MicroChart1's RenderControl to have a Gray LineColor

            column = panel.Columns["MicroChart1"];
            GridMicroChartEditControl mc = (GridMicroChartEditControl)column.RenderControl;

            mc.LineChartStyle.LineColor = Color.Gray;

            // Set the MicroChart2's EditorType to MyGridMicroChartEditControl,
            // which just simply sets the ChartType to a Bar.

            column            = panel.Columns["MicroChart2"];
            column.EditorType = typeof(MyGridMicroChartEditControl);

            // Add a new Column - a Gauge Control column

            column = new GridColumn("Gauge");

            column.Width      = 300;
            column.EditorType = typeof(MyGridGaugeEditControl);

            panel.Columns.Add(column);

            // Add 30 rows for the user to play with

            for (int i = 0; i < 30; i++)
            {
                AddNewRow(panel);
            }

            // Hook onto the cell double-click event so that we can set the
            // cell editor type to a TextBoxX control and permit the user to
            // edit the chart points.

            superGridControl1.CellDoubleClick += SuperGridControl1CellDoubleClick;
        }
Ejemplo n.º 32
0
        /// <summary>
        /// Populates the grid with the current
        /// discoverable system drives
        /// </summary>
        private void PopulateDriveRows()
        {
            GridPanel panel = superGridControl1.PrimaryGrid;

            foreach (DriveInfo drive in DriveInfo.GetDrives())
            {
                if (drive.DriveType == DriveType.Fixed)
                {
                    // Allocate a new GridRow for the drive, with the
                    // first cell allocated and set to the drive name.

                    GridRow drow = new GridRow(drive.Name);

                    // Let the height auto-size

                    drow.RowHeight = 0;

                    // The RowsUnresolved property is a convenient mechanism
                    // to tell the grid that the row may have nested rows, but
                    // that fact has not yet been determined.
                    //
                    // Later, when the user clicks on the row's expand button, the
                    // application then can then resolve the row state by doing 2 things:
                    //
                    // 1 - Clear the RowsUnresolved property (as, whether there are nested
                    //     rows or not) it is now resolved.
                    //
                    // 2 - Determine whether there are in fact any nested rows or
                    //     not and load them into the grid if there are.

                    drow.RowsUnresolved = true;

                    // Save the root directory path for use later if
                    // the user clicks on the expand button

                    drow.Tag = drive.RootDirectory.FullName;

                    // Set the cell image to the drive icon

                    drow.Cells[0].CellStyles.Default.Image =
                        ShellServices.GetFileImage(drive.Name, true, false);

                    // Add the row to the panel

                    panel.Rows.Add(drow);
                }
            }
        }
Ejemplo n.º 33
0
        /// <summary>
        /// This function will be called after
        /// every selection change in the grid.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">GridEventArgs</param>
        void SuperGridControl1SelectionChanged(object sender, GridEventArgs e)
        {
            GridPanel panel1 = superGridControl1.PrimaryGrid;
            GridPanel panel2 = superGridControl2.PrimaryGrid;

            superGridControl1.Update();

            // Clear all the rows in the right-hand grid.

            panel2.Rows.Clear();

            // Populate the right-hand grid with the selected files
            // from the left-hand grid.  At the same time, sum up the
            // total size of the selected files.

            int  count = 0;
            long size  = 0;

            foreach (GridCell cell in panel1.SelectedCells)
            {
                string path = (string)cell.GridRow.Tag;

                FileInfo info = new FileInfo(path);

                if ((info.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
                {
                    size += PopulateDirectoryInfo(path, panel2, ref count);
                }

                if (count % 20 == 0)
                {
                    superGridControl2.Update();
                }
            }

            // Set the right-hand grid's footer to a string
            // showing the total size of all the selected files.

            string s = string.Empty;

            if (count > 0)
            {
                s = String.Format("{0:N0} file{1}, Size: {2:N0} KB",
                                  count, (count == 1 ? "" : "s"), Math.Ceiling((double)size / 1024));
            }

            panel2.Footer.Text = s;
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Initializes the default grid
        /// </summary>
        private void InitializeGrid()
        {
            GridPanel panel = superGridControl1.PrimaryGrid;

            panel.Name         = "Customers";
            panel.ShowToolTips = true;

            panel.MinRowHeight        = 20;
            panel.AutoGenerateColumns = true;

            panel.SelectionGranularity = SelectionGranularity.Cell;

            superGridControl1.CellValueChanged    += SuperGridControl1CellValueChanged;
            superGridControl1.GetCellStyle        += SuperGridControl1GetCellStyle;
            superGridControl1.DataBindingComplete += SuperGridControl1DataBindingComplete;
        }
Ejemplo n.º 35
0
 void Fase4()
 {
     CreatePlaneArea(8, 6);
     SpawnObj(Double, 7, 0, true);
     SpawnObj(Double, 0, 5, true);
     SpawnObj(Double, 7, 5, true);
     SpawnObj(Target, 2, 5, false, Objcolor.GREEN);
     SpawnObj(Target, 0, 1, false, Objcolor.MAGENTA);
     SpawnObj(Target, 7, 3, false, Objcolor.BLUE);
     SpawnObj(Target, 7, 1, false, Objcolor.RED);
     SpawnObj(Glass, 2, 4, false);
     SpawnObj(Glass, 6, 3, false);
     SpawnObj(Glass, 2, 2, false);
     SpawnObj(Glass, 1, 1, false);
     InitialPanel = grid.thisgrid.panellist[0, 0];
 }
Ejemplo n.º 36
0
        private void button2_Click(object sender, EventArgs e)
        {
            PointP position = new PointP();
            Point  point    = GridPanel.PointToClient(Cursor.Position);

            //mouse position is relative to panel
            position = system.grid.returnMousePosition(point);
            foreach (Component c in system.Components)
            {
                // checks if  a component with the current location exists
                if (c.location.X == p.X && c.location.Y == p.Y)
                {
                    label2.Text = c.Flow.ToString();
                }
            }
        }
Ejemplo n.º 37
0
        /// <summary>
        /// 初始化Grid控件
        /// </summary>
        private void InitializeGrid()
        {
            dgvTradeInfoSummary.AutoGenerateColumns = false;
            GridPanel panel = sGridTradeDetail.PrimaryGrid;

            panel.Name                = "Register";
            panel.MinRowHeight        = 20;
            panel.AutoGenerateColumns = true;
            panel.ShowCheckBox        = false;
            panel.ShowRowInfo         = false;
            panel.ShowRowGridIndex    = true;
            panel.Caption.Visible     = false;
            panel.GroupByRow.Visible  = false;

            sGridTradeDetail.DataBindingComplete += SuperGridControl1DataBindingComplete;
        }
Ejemplo n.º 38
0
        public void TestHorizontalRemove2()
        {
            var panel = new GridPanel {
                Orientation = Orientation.Horizontal
            };
            var element1 = new UIElement();
            var element2 = new FrameworkElement();

            panel.Children.Add(element1);
            panel.Children.Add(element2);
            panel.ColumnDefinitions.Count.Should().Be(2);
            panel.Children.Remove(element1);
            panel.ColumnDefinitions.Count.Should().Be(1);

            Grid.GetColumn(element2).Should().Be(0);
        }
Ejemplo n.º 39
0
        public void TestHorizontalInsert2()
        {
            var panel = new GridPanel {
                Orientation = Orientation.Horizontal
            };
            var element1 = new UIElement();
            var element2 = new FrameworkElement();
            var element3 = new Control();

            panel.Children.Add(element1);
            panel.Children.Insert(0, element2);
            panel.Children.Insert(1, element3);
            Grid.GetColumn(element1).Should().Be(2);
            Grid.GetColumn(element2).Should().Be(0);
            Grid.GetColumn(element3).Should().Be(1);
        }
Ejemplo n.º 40
0
        public void TestHorizontalAdd2()
        {
            var panel = new GridPanel {
                Orientation = Orientation.Horizontal
            };
            var element1 = new UIElement();
            var element2 = new FrameworkElement();

            panel.Children.Add(element1);
            panel.Children.Add(element2);
            panel.ColumnDefinitions.Count.Should().Be(2);
            panel.ColumnDefinitions[0].Width.Should().Be(new GridLength(1, GridUnitType.Star));
            panel.ColumnDefinitions[1].Width.Should().Be(new GridLength(1, GridUnitType.Star));
            Grid.GetColumn(element1).Should().Be(0);
            Grid.GetColumn(element2).Should().Be(1);
        }
Ejemplo n.º 41
0
        /// <summary>
        /// Handles ImageEditSizeMode changes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CbxSizeModeSelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbxSizeMode.SelectedIndex >= 0)
            {
                GridPanel  panel  = superGridControl1.PrimaryGrid;
                GridColumn column = panel.Columns["ImageEdit"];

                ImageSizeMode sizeMode = (ImageSizeMode)Enum.Parse(
                    typeof(ImageSizeMode), (string)cbxSizeMode.SelectedItem);

                SetNewSizeMode(column.EditControl as GridImageEditControl, sizeMode);
                SetNewSizeMode(column.RenderControl as GridImageEditControl, sizeMode);

                column.InvalidateRender();
            }
        }
Ejemplo n.º 42
0
        public QuanLyBenhNhanNhanMau(AppsLIST app)
        {
            InitializeComponent();

            this.app = app;
            listNHTs = new List <HT_ThongTinNguoiHienTinh>();
            listNHNs = new List <HN_ThongTinNguoiHienNoan>();

            panel = QL_sgQuanLyNguoiNhan.PrimaryGrid;

            LoadItemSelect();

            dbQL = new QuanLyNguoiNhanDB();

            FillData();
        }
Ejemplo n.º 43
0
        ///<summary>
        /// CustomFilter
        ///</summary>
        public CustomFilterEx(GridPanel gridPanel,
            GridColumn gridColumn, string filterText)
        {
            _GridPanel = gridPanel;
            _GridColumn = gridColumn;

            InitializeComponent();
            InitializeText();
            InitializeFilter(filterText);

            PositionWindow(_GridPanel.SuperGrid);

            FormClosing += CustomFilterExFormClosing;

            filterExprEdit1.InputTextChanged += FilterExprEdit1InputTextChanged;
        }
Ejemplo n.º 44
0
        /// <summary>
        /// Customizes the OrdersPanel
        /// </summary>
        /// <param name="panel"></param>
        private void CustomizeOrdersPanel(GridPanel panel)
        {
            panel.ShowRowGridIndex       = true;
            panel.ShowRowDirtyMarker     = true;
            panel.ColumnHeader.RowHeight = 30;

            panel.Columns[0].CellStyles.Default.Background =
                new Background(Color.Beige);

            panel.Caption = new GridCaption();

            panel.Caption.Text = String.Format("Orders ({0}) for customer <font color=\"Maroon\"><i>\"{1}</i>\"</font>",
                                               panel.Rows.Count, ((GridRow)panel.Parent)["CompanyName"].Value);

            panel.DefaultVisualStyles.CaptionStyles.Default.Alignment = Alignment.MiddleLeft;
        }
 /// <summary>
 /// Compare the master item and web item
 /// </summary>
 /// <param name="diffView"></param>
 /// <param name="gridPanel"></param>
 /// <param name="masterItem"></param>
 /// <param name="webItem"></param>
 private void CompareItems(DiffView diffView, GridPanel gridPanel, Item masterItem, Item webItem)
 {
     Assert.ArgumentNotNull(diffView, "diffView");
     Assert.ArgumentNotNull(gridPanel, "gridPanel");
     Assert.ArgumentNotNull(masterItem, "itemOne");
     Assert.ArgumentNotNull(webItem, "itemTwo");
     //diffView.Compare(gridPanel, masterItem, webItem, string.Empty);
     if (IsOneColumnSelected())
     {
         ItemCompareView.CompareTwoColumnView(gridPanel, masterItem, webItem, string.Empty);
     }
     else
     {
         ItemCompareView.CompareTwoColumnView(gridPanel, masterItem, webItem, string.Empty);
     }
 }
Ejemplo n.º 46
0
        private void AddGridRow([NotNull] ITrustBoundary tb, [NotNull] GridPanel panel)
        {
            var row = new GridRow(
                tb.Name);

            ((INotifyPropertyChanged)tb).PropertyChanged += OnTrustBoundaryPropertyChanged;
            row.Tag = tb;
            row.Cells[0].CellStyles.Default.Image = tb.GetImage(ImageSize.Small);
            for (int i = 0; i < row.Cells.Count; i++)
            {
                row.Cells[i].PropertyChanged += OnPropertyChanged;
            }
            AddSuperTooltipProvider(tb, row.Cells[0]);

            panel.Rows.Add(row);
        }
Ejemplo n.º 47
0
        ///<summary>
        /// FilterData
        ///</summary>
        ///<param name="panel"></param>
        internal static void FilterData(GridPanel panel)
        {
            if (_lockFilter == true)
                return;

            if (panel.SuperGrid.DoDataFilteringStartEvent(panel) == false)
            {
                _lockFilter = true;

                try
                {
                    if (panel.EnableFiltering == true &&
                        panel.FilterLevel != FilterLevel.None)
                    {
                        bool rowFiltered = IsRowFiltered(panel);
                        bool colFiltered = IsColumnFiltered(panel);

                        if (rowFiltered == true || colFiltered == true)
                        {
                            if (rowFiltered == true)
                                rowFiltered = UpdateRowFilter(panel);

                            if (colFiltered == true)
                                UpdateColumnFilter(panel);

                            UpdateFilterState(panel, rowFiltered, colFiltered);

                            return;
                        }
                    }

                    UpdateFilterState(panel, false, false);
                }
                finally
                {
                    _lockFilter = false;

                    panel.UpdateVisibleRowCount();
                    panel.SuperGrid.DoDataFilteringCompleteEvent(panel);
                }
            }
            else
            {
                panel.UpdateVisibleRowCount();
            }
        }
Ejemplo n.º 48
0
        private static bool UpdateRowFilter(GridPanel panel)
        {
            if (panel.FilterEval == null)
            {
                try
                {
                    panel.FilterEval = new FilterEval(
                        panel, null, panel.GetFilterMatchType(), panel.FilterExpr);
                }
                catch
                {
                    return (false);
                }
            }

            return (true);
        }
Ejemplo n.º 49
0
 public GridDialog(GridPanel gp)
 {
     try
     {
         base.Icon = ResourceService.GetIcon("Icons.SkyMapSoftIcon");
     }
     catch
     {
         try
         {
             base.Icon = ResourceService.GetIcon("Dialog.Grid.Icon");
         }
         catch
         {
         }
     }
     gp.Dock = DockStyle.Fill;
     base.Size = new Size((3 * Screen.PrimaryScreen.WorkingArea.Width) / 4, (2 * Screen.PrimaryScreen.WorkingArea.Height) / 3);
     base.Controls.Add(gp);
 }
        public ActionResult GetGrid(string id)
        {
            List<object> data = new List<object>();
            for (int i = 1; i <= 10; i++)
            {
                data.Add(new { ID = "P" + i, Name = "Product " + i });
            }

            GridPanel grid = new GridPanel
            {
                Height = 200,
                EnableColumnHide = false,
                Store =
                {
                    new Store
                    {
                        Model =
                        {
                            new Model {
                                IDProperty = "ID",
                                Fields = {
                                    new ModelField("ID"),
                                    new ModelField("Name")
                                }
                            }
                        },
                        DataSource = data
                    }
                },
                ColumnModel =
                {
                    Columns =
                    {
                        new Column { Text = "Products's Name", DataIndex = "Name", Width = 150 }
                    }
                }
            };

            return this.ComponentConfig(grid);
        }
Ejemplo n.º 51
0
    protected override void OnLoad(System.EventArgs e)
    {
      base.OnLoad(e);
      UrlHandle handle = UrlHandle.Get();
      string itemId = handle["itemId"];
      string taxonomyValue = handle["taxonomyValue"];
      List<string> listValue = taxonomyValue.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList();
      listValue.RemoveAll(str => str.Contains(Sitecore.Data.ID.Null.ToString()));
      taxonomyValue = String.Join("|", listValue.ToArray<string>());
      if (!string.IsNullOrEmpty(taxonomyValue) && !string.IsNullOrEmpty(itemId) && Sitecore.Data.ID.IsID(itemId))
      {

        Item currentItem = Client.ContentDatabase.GetItem(new ID(itemId));
        IOrderedEnumerable<RelationInfo> categories =
          TaxonomyEngine.GetAllCategories(currentItem, taxonomyValue).Values.OrderBy(info => info.Weight);
        IEnumerable<RelationInfo> setCategories = (from category in categories
                                                   where !category.Calculated
                                                   select category);


            foreach (RelationInfo link in setCategories)
            {
                GridPanel categoriesPanel = new GridPanel();
                ResultBox.Controls.Add(categoriesPanel);
                categoriesPanel.Attributes["class"] = "categoriesPanel";
                categoriesPanel.Columns = 100;
                categoriesPanel.Controls.Add(GetCategoryPanel(link));
                BuildRelatedCategories(categories, categoriesPanel, link);
            }
      }
      else
      {
        Literal noDataLiteral = new Literal("No taxonomy data could be retrieved.");
        ResultBox.Controls.Add(noDataLiteral);
      }
    }
        protected override void OnLoad(EventArgs args)
        {
            if (!Sitecore.Context.ClientPage.IsEvent)
             {
            SetProperties();
            GridPanel gridPanel = new GridPanel();
            Controls.Add(gridPanel);
            gridPanel.Columns = 4;
            GetControlAttributes();

            foreach (string text2 in base.Attributes.Keys)
            {
               gridPanel.Attributes.Add(text2, base.Attributes[text2]);
            }

            gridPanel.Style["margin"] = "0px 0px 4px 0px";
            SetViewStateString("ID", ID);
            Sitecore.Web.UI.HtmlControls.Literal literal = new Sitecore.Web.UI.HtmlControls.Literal("All");
            literal.Class = ("scContentControlMultilistCaption");

            gridPanel.Controls.Add(literal);
            gridPanel.SetExtensibleProperty(literal, "Width", "50%");
            gridPanel.SetExtensibleProperty(literal, "Row.Height", "20px");

            LiteralControl spacer = new LiteralControl(Images.GetSpacer(24, 1));
            gridPanel.Controls.Add(spacer);
            gridPanel.SetExtensibleProperty(spacer, "Width", "24px");

            literal = new Sitecore.Web.UI.HtmlControls.Literal("Selected");
            literal.Class = "scContentControlMultilistCaption";

            gridPanel.Controls.Add(literal);
            gridPanel.SetExtensibleProperty(literal, "Width", "50%");

            spacer = new LiteralControl(Images.GetSpacer(24, 1));
            gridPanel.Controls.Add(spacer);
            gridPanel.SetExtensibleProperty(spacer, "Width", "24px");

            Scrollbox scrollbox = new Scrollbox();
            scrollbox.ID = GetUniqueID("S");

            gridPanel.Controls.Add(scrollbox);
            scrollbox.Style["border"] = "3px window-inset";
            gridPanel.SetExtensibleProperty(scrollbox, "rowspan", "2");

            DataTreeview dataTreeView = new DataTreeview();
            dataTreeView.ID = ID + "_all";
            scrollbox.Controls.Add(dataTreeView);
            dataTreeView.DblClick = ID + ".Add";

            ImageBuilder builderRight = new ImageBuilder();
            builderRight.Src = "Applications/16x16/nav_right_blue.png";
            builderRight.ID = ID + "_right";
            builderRight.Width = 0x10;
            builderRight.Height = 0x10;
            builderRight.Margin = "2";
            builderRight.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Add");

            ImageBuilder builderLeft = new ImageBuilder();
            builderLeft.Src = "Applications/16x16/nav_left_blue.png";
            builderLeft.ID = ID + "_left";
            builderLeft.Width = 0x10;
            builderLeft.Height = 0x10;
            builderLeft.Margin = "2";
            builderLeft.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Remove");

            LiteralControl literalControl = new LiteralControl(builderRight.ToString() + "<br/>" + builderLeft.ToString());
            gridPanel.Controls.Add(literalControl);
            gridPanel.SetExtensibleProperty(literalControl, "Width", "30");
            gridPanel.SetExtensibleProperty(literalControl, "Align", "center");
            gridPanel.SetExtensibleProperty(literalControl, "VAlign", "top");
            gridPanel.SetExtensibleProperty(literalControl, "rowspan", "2");

            Sitecore.Web.UI.HtmlControls.Listbox listbox = new Listbox();
                listBox = listbox;
            gridPanel.SetExtensibleProperty(listbox, "VAlign", "top");
            gridPanel.SetExtensibleProperty(listbox, "Height", "100%");

            gridPanel.Controls.Add(listbox);
            listbox.ID = ID + "_selected";
            listbox.DblClick = ID + ".Remove";
            listbox.Style["width"] = "100%";
            listbox.Size = "10";
            listbox.Attributes["onchange"] = "javascript:document.getElementById('" + this.ID + "_help').innerHTML=this.selectedIndex>=0?this.options[this.selectedIndex].innerHTML:''";
            listbox.Attributes["class"] = "scContentControlMultilistBox";

            dataTreeView.Disabled = ReadOnly;
            listbox.Disabled = ReadOnly;

            ImageBuilder builderUp = new ImageBuilder();
            builderUp.Src = "Applications/16x16/nav_up_blue.png";
            builderUp.ID = ID + "_up";
            builderUp.Width = 0x10;
            builderUp.Height = 0x10;
            builderUp.Margin = "2px";
            builderUp.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Up");

            ImageBuilder builderDown = new ImageBuilder();
            builderDown.Src = "Applications/16x16/nav_down_blue.png";
            builderDown.ID = ID + "_down";
            builderDown.Width = 0x10;
            builderDown.Height = 0x10;
            builderDown.Margin = "2";
            builderDown.OnClick = Sitecore.Context.ClientPage.GetClientEvent(ID + ".Down");

            literalControl = new LiteralControl(builderUp.ToString() + "<br/>" + builderDown.ToString());
            gridPanel.Controls.Add(literalControl);
            gridPanel.SetExtensibleProperty(literalControl, "Width", "30");
            gridPanel.SetExtensibleProperty(literalControl, "Align", "center");
            gridPanel.SetExtensibleProperty(literalControl, "VAlign", "top");
            gridPanel.SetExtensibleProperty(literalControl, "rowspan", "2");
            gridPanel.Controls.Add(new LiteralControl("<div style=\"border:1px solid #999999;font:8pt tahoma;padding:2px;margin:4px 0px 4px 0px;height:14px\" id=\"" + this.ID + "_help\"></div>"));

            DataContext treeContext = new DataContext();
            gridPanel.Controls.Add(treeContext);
            treeContext.ID = GetUniqueID("D");
            treeContext.Filter = FormTemplateFilterForDisplay();
            dataTreeView.DataContext = treeContext.ID;
            treeContext.DataViewName = "Master";
            if (!string.IsNullOrEmpty(this.SourceDatabaseName))
            {
               treeContext.Parameters = "databasename=" + this.SourceDatabaseName;
            }
            treeContext.Root = DataSource;
            dataTreeView.EnableEvents();

            listbox.Size = "10";
            gridPanel.Fixed = true;
            dataTreeView.AutoUpdateDataContext = true;
            dataTreeView.ShowRoot = true;
            listbox.Attributes["class"] = "scContentControlMultilistBox";

            gridPanel.SetExtensibleProperty(scrollbox, "Height", "100%");
            RestoreState();
             }
             base.OnLoad(args);
        }
Ejemplo n.º 53
0
        protected virtual void RenderRowHeader(Graphics g,
            GridPanel panel, GridPanelVisualStyle pstyle, Rectangle r)
        {
            if (CanShowRowHeader(panel) == true)
            {
                r.X -= panel.RowHeaderWidth;
                r.Width = panel.RowHeaderWidth - 1;

                TextRowVisualStyle style = GetEffectiveRowHeaderStyle();

                using (Brush br = style.RowHeaderStyle.Background.GetBrush(r))
                    g.FillRectangle(br, r);

                using (Pen pen = new Pen(style.RowHeaderStyle.BorderHighlightColor))
                {
                    g.DrawLine(pen, r.X, r.Y, r.Right, r.Y);
                    g.DrawLine(pen, r.X, r.Y, r.X, r.Bottom);
                }

                using (Pen pen = new Pen(pstyle.HeaderLineColor))
                {
                    g.DrawLine(pen, r.X, r.Y - 1, r.Right, r.Y - 1);
                    g.DrawLine(pen, r.X, r.Bottom - 1, r.Right, r.Bottom - 1);
                    g.DrawLine(pen, r.Right, r.Y, r.Right, r.Bottom - 1);
                }
            }
        }
Ejemplo n.º 54
0
        private void RenderRowImage(Graphics g,
            GridPanel panel, TextRowVisualStyle style, Rectangle r)
        {
            if (r.Width > 0 && r.Height > 0)
            {
                Image image = style.GetImage(panel);

                if (image != null)
                    g.DrawImageUnscaledAndClipped(image, r);
            }
        }
Ejemplo n.º 55
0
 protected virtual void RenderBorder(Graphics g,
     GridPanel panel, GridPanelVisualStyle pstyle, Rectangle r)
 {
     using (Pen pen = new Pen(pstyle.HeaderLineColor))
     {
         g.DrawLine(pen, r.X, r.Y - 1, r.Right - 1, r.Y - 1);
         g.DrawLine(pen, r.X, r.Bottom - 1, r.Right - 1, r.Bottom - 1);
     }
 }
Ejemplo n.º 56
0
        private Rectangle GetItemBounds(GridPanel panel, Image image,
            TextRowVisualStyle style, Rectangle r, out Rectangle tb, out Rectangle ib)
        {
            Rectangle v = ViewRect;

            if (panel.IsSubPanel == false)
            {
                r.X = Math.Max(r.X, v.X);
                r.Width = v.Width;
            }

            if (CanShowRowHeader(panel) == true)
            {
                r.X += panel.RowHeaderWidth;
                r.Width -= panel.RowHeaderWidth;
            }

            tb = GetAdjustedBounds(style, style.GetNonImageBounds(image, r));
            ib = style.GetImageBounds(image, tb);

            return (r);
        }
Ejemplo n.º 57
0
        protected virtual void RenderRow(
            GridRenderInfo renderInfo, GridPanel panel, Rectangle r)
        {
            Graphics g = renderInfo.Graphics;

            TextRowVisualStyle style = GetEffectiveStyle();
            GridPanelVisualStyle pstyle = panel.GetEffectiveStyle();

            Image image = style.GetImage(panel);

            Rectangle tb, ib;
            r = GetItemBounds(panel, image, style, r, out tb, out ib);

            if (SuperGrid.DoPreRenderTextRowEvent(g, this, RenderParts.Background, r) == false)
            {
                RenderRowBackground(g, style, r);
                SuperGrid.DoPostRenderTextRowEvent(g, this, RenderParts.Background, r);
            }

            RenderBorder(g, panel, pstyle, r);

            if (SuperGrid.DoPreRenderTextRowEvent(g, this, RenderParts.Border, r) == false)
            {
                RenderRowBorder(g, style, r);
                SuperGrid.DoPostRenderTextRowEvent(g, this, RenderParts.Border, r);
            }

            if (style.ImageOverlay != ImageOverlay.Top)
                RenderRowImage(g, panel, style, ib);

            if (SuperGrid.DoPreRenderTextRowEvent(g, this, RenderParts.Content, r) == false)
            {
                RenderRowText(g, style, tb);
                SuperGrid.DoPostRenderTextRowEvent(g, this, RenderParts.Content, tb);
            }

            if (style.ImageOverlay == ImageOverlay.Top)
                RenderRowImage(g, panel, style, ib);

            if (SuperGrid.DoPreRenderTextRowEvent(g, this, RenderParts.RowHeader, r) == false)
            {
                RenderRowHeader(g, panel, pstyle, r);
                SuperGrid.DoPostRenderTextRowEvent(g, this, RenderParts.RowHeader, r);
            }
        }
Ejemplo n.º 58
0
        protected TextRowVisualStyle GetSizingStyle(GridPanel panel)
        {
            StyleType style = panel.GetSizingStyle();

            if (style == StyleType.NotSet)
                style = StyleType.Default;

            return (GetEffectiveStyle(style));
        }
Ejemplo n.º 59
0
        private Rectangle GetRowHeaderBounds(GridPanel panel)
        {
            if (panel.ShowRowHeaders == true)
            {
                Rectangle r = BoundsRelative;
                r.Location = panel.PointToScroll(r.Location);
                r.Width = panel.RowHeaderWidth + 2;

                return (r);
            }

            return (Rectangle.Empty);
        }
Ejemplo n.º 60
0
        protected virtual bool CanShowRowHeader(GridPanel panel)
        {
            switch (_RowHeaderVisibility)
            {
                case RowHeaderVisibility.Always:
                    return (true);

                case RowHeaderVisibility.PanelControlled:
                    return (panel.ShowRowHeaders);
            }

            return (false);
        }