/// <summary> /// Initializes the entire widget and lays out the class. /// </summary> /// <param name="selectorTreeStore">The selector tree store.</param> private void InitializeWidget(TreeStore selectorTreeStore) { // Set up the configurator area. configuratorArea = new ConfiguratorsSelectorEditorComposite( selectorTreeStore); VBox.PackStart(configuratorArea, true, true, 0); // Depending on the mood determines the buttons we'll have. Response += OnResponse; if (configuratorArea.ApplyMode == ApplyMode.Explicit) { // For explict apply, add in the apply, cancel, and ok buttons. AddButton("Apply", ResponseType.Apply); AddButton("Cancel", ResponseType.Cancel); AddButton("Ok", ResponseType.Ok); } else { // For instant apply, just have a close button. AddButton("Close", ResponseType.Close); } // Set up spacing. BorderWidth = 6; VBox.Spacing = 12; ActionArea.Spacing = 12; ActionArea.BorderWidth = 6; }
/// <summary> /// Initializes the entire widget and lays out the class. /// </summary> /// <param name="selectorTreeStore">The selector tree store.</param> /// <param name="showCloseButton">if set to <c>true</c> [show close button].</param> private void InitializeWidget( TreeStore selectorTreeStore, bool showCloseButton) { // Start by doing the VBox stuff to arrange the top levels, a // separator bar, and the button bar below. var verticalLayout = new VBox(); // Set up the configurator area. configuratorArea = new ConfiguratorsSelectorEditorComposite( selectorTreeStore); verticalLayout.PackStart(configuratorArea, true, true, 0); // Create the button bar on the bottom. Widget buttonBar = CreateButtonBar(showCloseButton); if (buttonBar != null) { // Create the vertical separator. The 12 pixel spacing comes from // the Gnome HIG. verticalLayout.PackStart(new HSeparator(), false, false, 12); // Add the buttons to the list. verticalLayout.PackStart(buttonBar, false, false, 0); } // Add the vertical layout to the bin. PackStart(verticalLayout); }