void BuildComponents() { Width = DIALOG_WIDTH; Height = DIALOG_HEIGHT; FormBorderStyle = FormBorderStyle.FixedDialog; MinimizeBox = false; MaximizeBox = false; SuspendLayout(); try { ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Top)); ControlPacker.AddControl(this, BuildMessagePanel()); ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Top)); ControlPacker.AddControl(this, BuildButtonPanel()); ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Bottom)); } finally { ResumeLayout(); } }
void BuildComponents() { SuspendLayout(); try { ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Top)); ControlPacker.AddControl(this, BuildTextInputPanel()); ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Top)); ControlPacker.AddControl(this, BuildButtonsPanel()); ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Top)); ControlPacker.AddControl(this, BuildListBoxPanel()); ControlPacker.AddControl( this, ControlBuilder.CreateVerticalPadding(DockStyle.Bottom)); ControlPacker.AddControl(this, BuildProgressTextPanel()); mProgressControls = new ProgressControls( mProgressLabel, new Control[] { mTextBox, mRemoveButton, mAddButton, mListBox }); } finally { ResumeLayout(); } mAddButton.Click += AddButton_Click; mRemoveButton.Click += RemoveButton_Click; }
Widget BuildProgressTextBox() { HBox result = new HBox(); mProgressLabel = ControlBuilder.CreateSelectableLabel(); ControlPacker.PackProgressLabel(result, mProgressLabel); return(AlignmentBuilder.TopBottomPadding( result, AlignmentBuilder.SMALL_PADDING)); }
Panel BuildProgressTextPanel() { Panel result = ControlBuilder.CreatePanel( ControlBuilder.DefaultControlHeight, DockStyle.Bottom); mProgressLabel = ControlBuilder.CreateLabel(string.Empty, DockStyle.Left); ControlPacker.AddControl(result, ControlBuilder.CreateHorizontalPadding(DockStyle.Left)); ControlPacker.AddControl(result, mProgressLabel); return(result); }
Panel BuildListBoxPanel() { Panel result = ControlBuilder.CreatePanel(DockStyle.Fill); mListBox = ControlBuilder.CreateListBox(DockStyle.Fill); mListBox.SelectionMode = SelectionMode.None; ControlPacker.AddControl(result, ControlBuilder.CreateHorizontalPadding(DockStyle.Left)); ControlPacker.AddControl(result, ControlBuilder.CreateHorizontalPadding(DockStyle.Right)); ControlPacker.AddControl(result, mListBox); return(result); }
Widget BuildListViewBox() { HBox result = new HBox(); result.WidthRequest = LISTBOX_WIDTH; result.HeightRequest = LISTBOX_HEIGHT; mListView = ApplicationWindowListView.Build(); mListView.HeadersVisible = false; ControlPacker.Fill(result, mListView.View); return(AlignmentBuilder.TopBottomPadding( result, AlignmentBuilder.SMALL_PADDING)); }
Widget BuildButtonsBox() { HBox result = new HBox(); mAddButton = ControlBuilder.CreateButton( Localization.GetText(Localization.Name.AddButton)); mRemoveButton = ControlBuilder.CreateButton( Localization.GetText(Localization.Name.RemoveButton)); ControlPacker.PackActionButtons( result, AlignmentBuilder.SMALL_PADDING, mAddButton, mRemoveButton); return(AlignmentBuilder.TopBottomPadding( result, AlignmentBuilder.SMALL_PADDING)); }
Panel BuildButtonPanel() { Panel result = ControlBuilder.CreatePanel( ControlBuilder.DefaultControlHeight, DockStyle.Top); mOkButton = ControlBuilder.CreateButton( Localization.GetText(Localization.Name.Ok), DockStyle.Right); mOkButton.Click += OkButton_Click; CancelButton = mOkButton; ControlPacker.AddControl(result, mOkButton); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Right)); return(result); }
Widget BuildTextEntryBox() { HBox result = new HBox(); Label textEntryLabel = ControlBuilder.CreateLabel( Localization.GetText(Localization.Name.TextInputLabel)); AlignmentBuilder.SetRightAlignment(textEntryLabel); mTextEntry = ControlBuilder.CreateEntry(); ControlPacker.Add(result, AlignmentBuilder.RightPadding( textEntryLabel, AlignmentBuilder.SMALL_PADDING)); ControlPacker.Fill(result, mTextEntry); return(AlignmentBuilder.TopBottomPadding( result, AlignmentBuilder.SMALL_PADDING)); }
Panel BuildTextInputPanel() { Panel result = ControlBuilder.CreatePanel( ControlBuilder.DefaultControlHeight, DockStyle.Top); Label textInputLabel = ControlBuilder.CreateLabel( Localization.GetText(Localization.Name.TextInputLabel), DockStyle.Left); mTextBox = ControlBuilder.CreateTextbox(DockStyle.Fill); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Left)); ControlPacker.AddControl(result, textInputLabel); ControlPacker.AddControl(result, mTextBox); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Right)); return(result); }
Panel BuildButtonsPanel() { Panel result = ControlBuilder.CreatePanel( ControlBuilder.DefaultControlHeight, DockStyle.Top); mRemoveButton = ControlBuilder.CreateButton( Localization.GetText(Localization.Name.RemoveButton), DockStyle.Right); mAddButton = ControlBuilder.CreateButton( Localization.GetText(Localization.Name.AddButton), DockStyle.Right); ControlPacker.AddControl(result, mRemoveButton); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Right)); ControlPacker.AddControl(result, mAddButton); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Right)); return(result); }
Panel BuildMessagePanel() { Panel result = ControlBuilder.CreatePanel(DockStyle.Top); result.Height = 70; PictureBox errorPictureBox = ControlBuilder.CreatePictureBox( SystemIcons.Error.ToBitmap(), DockStyle.Left); mMessageLabel = ControlBuilder.CreateLabel(string.Empty, DockStyle.Fill); mMessageLabel.AutoSize = false; ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Left)); ControlPacker.AddControl(result, errorPictureBox); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Left)); ControlPacker.AddControl(result, mMessageLabel); ControlPacker.AddControl( result, ControlBuilder.CreateHorizontalPadding(DockStyle.Right)); return(result); }
void BuildComponents(string message) { HBox messageBox = new HBox(); mMessageLabel = ControlBuilder.CreateExplanationLabel(message); Image messageImage = Image.NewFromIconName( "dialog-error", IconSize.Dialog); ControlPacker.Add(messageBox, messageImage); ControlPacker.Fill( messageBox, AlignmentBuilder.LeftPadding( mMessageLabel, AlignmentBuilder.SMALL_PADDING)); AddComponents( AlignmentBuilder.TopBottomPadding( messageBox, AlignmentBuilder.SMALL_PADDING)); mOkButton = CreateOkButton( Localization.GetText(Localization.Name.Ok)); DefaultResponse = (ResponseType)GetResponseForWidget(mOkButton); }
void BuildComponents() { VBox result = new VBox(); ControlPacker.Add(result, BuildTextEntryBox()); ControlPacker.Add(result, BuildButtonsBox()); ControlPacker.Fill(result, BuildListViewBox()); ControlPacker.Add(result, BuildProgressTextBox()); mProgressControls = new ProgressControls( mProgressLabel, new Widget[] { mTextEntry, mAddButton, mRemoveButton, mListView.View }); mAddButton.Clicked += AddButton_Clicked; mRemoveButton.Clicked += RemoveButton_Clicked; mListView.Fill(new List <string>() { string.Empty }); Add(AlignmentBuilder.LeftRightPadding( result, AlignmentBuilder.SMALL_PADDING)); }