public static StackLayout CreateStackLayout(Orientation orientation, int padding, int spacing, params StackLayoutItem[] items) { var res = new DefStackLayout(); res.Orientation = orientation; res.Padding = new Padding(padding); res.Spacing = spacing; foreach (var itm in items) { //itm.VerticalAlignment = VerticalAlignment.Center; res.Items.Add(itm); } return(res); }
public GKSheetList(Panel owner) { if (owner == null) { throw new ArgumentNullException("owner"); } fBtnMoveDown = new Button(); fBtnMoveDown.Image = UIHelper.LoadResourceImage("Resources.btn_down.gif"); fBtnMoveDown.Size = UIHelper.ShortButtonSize; fBtnMoveDown.ToolTip = LangMan.LS(LSID.LSID_RecordMoveDown); fBtnMoveDown.Click += ItemMoveDown; fBtnMoveUp = new Button(); fBtnMoveUp.Image = UIHelper.LoadResourceImage("Resources.btn_up.gif"); fBtnMoveUp.Size = UIHelper.ShortButtonSize; fBtnMoveUp.ToolTip = LangMan.LS(LSID.LSID_RecordMoveUp); fBtnMoveUp.Click += ItemMoveUp; fBtnLinkJump = new Button(); fBtnLinkJump.Image = UIHelper.LoadResourceImage("Resources.btn_jump.gif"); fBtnLinkJump.Size = UIHelper.ShortButtonSize; fBtnLinkJump.ToolTip = LangMan.LS(LSID.LSID_RecordGoto); fBtnLinkJump.Click += ItemJump; fBtnDelete = new Button(); fBtnDelete.Image = UIHelper.LoadResourceImage("Resources.btn_rec_delete.gif"); fBtnDelete.Size = UIHelper.ShortButtonSize; fBtnDelete.ToolTip = LangMan.LS(LSID.LSID_MIRecordDelete); fBtnDelete.Click += ItemDelete; fBtnEdit = new Button(); fBtnEdit.Image = UIHelper.LoadResourceImage("Resources.btn_rec_edit.gif"); fBtnEdit.Size = UIHelper.ShortButtonSize; fBtnEdit.ToolTip = LangMan.LS(LSID.LSID_MIRecordEdit); fBtnEdit.Click += ItemEdit; fBtnAdd = new Button(); fBtnAdd.Image = UIHelper.LoadResourceImage("Resources.btn_rec_new.gif"); fBtnAdd.Size = UIHelper.ShortButtonSize; fBtnAdd.ToolTip = LangMan.LS(LSID.LSID_MIRecordAdd); fBtnAdd.Click += ItemAdd; fList = new GKListView(); fList.MouseDoubleClick += List_DoubleClick; fList.KeyDown += List_KeyDown; SuspendLayout(); var toolbar = new DefStackLayout(Orientation.Vertical, 4, fBtnAdd, fBtnEdit, fBtnDelete, fBtnLinkJump, fBtnMoveUp, fBtnMoveDown); var tab = new TableLayout(2, 1); tab.Spacing = new Size(4, 4); tab.SetColumnScale(0, true); tab.SetColumnScale(1, false); tab.Add(fList, 0, 0); tab.Add(toolbar, 1, 0); Content = tab; ResumeLayout(); owner.SuspendLayout(); owner.Content = this; owner.ResumeLayout(); fButtons = EnumSet <SheetButton> .Create(SheetButton.lbAdd, SheetButton.lbEdit, SheetButton.lbDelete); fListModel = null; }