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)); }
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)); }