Пример #1
0
        void init()
        {
            V_Data.AddTitleImageCheckColumn(15, Titles.check.ToString());
            V_Data.AddTitleTextBoxColumn(100, Titles.name.ToString(), "Name", true);
            V_Data.AddTitleButtonColumn(30, Titles.edit_button.ToString(), "edit", "edit");
            V_Data.AddTitleButtonColumn(30, Titles.send.ToString(), "send", "send");
            V_Data.AddTitleCloseButtonColumn(15, Titles.close.ToString(), "X", "X");
            V_Data.AddTitleTextBoxColumn(-1, Titles.comment.ToString(), "Comment", true);

            V_Data.E_CellClicked        += new FormAdders.EasyGridViewCollections.CellClickEventHandler(V_Data_E_CellClicked);
            V_Data.E_TextChanged        += new FormAdders.CellTextChangedEventHandler(V_Data_E_TextChanged);
            V_Data.E_TextEditFinished   += new FormAdders.CellTextChangedEventHandler(V_Data_E_TextEditFinished);
            V_Data.E_ListRowRemoving    += new CellClickEventHandler(V_Data_E_ListRowRemoving);
            V_Data.E_ListRowRemoved     += new CellClickEventHandler(V_Data_E_ListRowRemoved);
            V_Data.E_ContextMenuClicked += new FormAdders.EasyGridViewCollections.EasyGridMenuClickHandler(V_Data_E_ContextMenuClicked);
            V_Data.ActionOnRightClicked  = FormAdders.EasyGridViewCollections.Actions.ContextMenu;
            V_Data.ActionOnClicked       = Actions.Nothing;

            V_Data.AddContextMenuItem(new String[] { "SetAsStartPoint", "Copy This", "Delete Lines", "Make New Msg" });
            V_Data.E_CheckBoxChanged    += new FormAdders.CellCheckedEventHandler(V_Data_E_CheckBoxChanged);
            V_Data.E_RowPositionChanged += new RowPositionChangedHandler(V_Data_E_RowPositionChanged);
            //_baseDir = Directory.GetCurrentDirectory();

            V_Contents.AddTitleTextBoxColumn(40, contentTitles.name.ToString(), "Name", true);
            V_Contents.AddTitleComboBoxColumn(50, contentTitles.type.ToString(), "Type", _types, 1);
            V_Contents.AddTitleTextBoxColumn(-1, contentTitles.value.ToString(), "Value", true);
            V_Contents.AddTitleComboBoxColumn(40, contentTitles.swap.ToString(), "Swap", _swapYn, 1);

            V_Contents.E_TextChanged     += new CellTextChangedEventHandler(V_Contents_E_TextChanged);
            V_Contents.E_ComboBoxChanged += new CellComboBoxEventHandler(V_Contents_E_ComboBoxChanged);

            B_HideButton.Click += new EventHandler(B_HideButton_Click);
            B_Save.Click       += new EventHandler(B_Save_Click);
            initList();
        }
Пример #2
0
        void viewContent(CPacketStruct cp)
        {
            _selectedParser = cp;
            V_Contents.ClearData();
            V_Contents.RefreshList();
            for (int i = 0; i < cp.Count; i++)
            {
                for (int v = 0; v < cp.Items[i].InitValues.Length; v++)
                {
                    Dictionary <String, object> infos = new Dictionary <string, object>();
                    infos[rowInfos.itemIndex.ToString()]  = i;
                    infos[rowInfos.valueIndex.ToString()] = v;
                    infos[rowInfos.parser.ToString()]     = cp;
                    String name = cp.Items[i].Name;
                    if (cp.Items[i].InitValues.Length > 1)
                    {
                        name += "[" + v + "]";
                    }
                    V_Contents.AddARow(infos, new object[] {
                        name.Trim(),
                        _types.ToList().IndexOf(cp.Items[i].TypeString),
                        cp.Items[i].InitValues[v].Trim(),
                        _swapYn.ToList().IndexOf((cp.Items[i].IsSwap)?"y" : "n")
                    });
                }
            }
            float height = V_Contents.Rows.Count * V_Contents.BaseRowHeight + V_Contents.ColumnHeaderHeight + 5;//

            if (height > 500)
            {
                height = 500f;
            }
            if (height < 200)
            {
                height = 200f;
            }
            P_Table.RowStyles[1] = new RowStyle(System.Windows.Forms.SizeType.Absolute, 15);//hide button
            P_Table.RowStyles[2] = new RowStyle(System.Windows.Forms.SizeType.Absolute, height);
        }