示例#1
0
 public PanelBase(MainWindow _mainWindow, String _desc, String _image)
 {
     CurrentMainWindow = _mainWindow;
     MainInfoBox = new InfoBox(_desc, _image);
     PackStart(MainInfoBox);
     MarginLeft = 10;
     _initializeComponents();
 }
示例#2
0
        /// <summary>
        /// Init components.
        /// </summary>
        private void _initializeComponents()
        {
            VBox MainContent = new VBox()
            {
                Margin = 0
            };

            // Info window
            InfoBox MainInfoBox = new InfoBox(Director.Properties.Resources.DefaultServerHeaders, DirectorImages.SETTINGS_IMAGE);
            MainContent.PackStart(MainInfoBox);

            // Add header list
            HeaderControl = new HeaderList(ActiveServer.DefaultHeaders)
            {
                BackgroundColor = Colors.White
            };
            MainContent.PackStart(HeaderControl, expand: true, fill: true);

            // Close button
            Buttons.Add(new DialogButton(Director.Properties.Resources.Confirm, Command.Ok));

            // Set content
            Content = MainContent;
        }
示例#3
0
        /// <summary>
        /// Initialize components.
        /// </summary>
        private void _initializeComponents()
        {
            InfoBox _infoBox = new InfoBox(Director.Properties.Resources.ExportDialog, DirectorImages.SERVER_IMAGE);
            VBox _contentBox = new VBox();
            _contentBox.PackStart(_infoBox);

            // Create scenarios frame
            Frame f = new Frame()
            {
                Label = Director.Properties.Resources.SelectScenarios,
                Padding = 10
            };

            // Scenario view
            ScenarioListWidget = new ScenarioList(ActiveServer);
            f.Content = ScenarioListWidget;

            // Add to content box
            _contentBox.PackStart(f);

            // Add Export path
            ExportPath = new TextEntry()
            {
                Sensitive = false,
                HorizontalPlacement = WidgetPlacement.Fill
            };

            // Button for selecting path
            Button SelectPath = new Button("...")
            {
                WidthRequest = 35,
                MinWidth = 35,
                HorizontalPlacement = WidgetPlacement.End
            };
            SelectPath.Clicked += delegate
            {
                SaveFileDialog dlg = new SaveFileDialog(Director.Properties.Resources.DialogSaveScenario)
                {
                    Multiselect = false,
                    InitialFileName = ActiveServer.Name
                };
                dlg.Filters.Add(new FileDialogFilter("Director files", "*.adfe"));
                if (dlg.Run() && dlg.FileNames.Count() == 1) {
                    ExportPath.Text = dlg.FileName;
                    if (Path.GetExtension(dlg.FileName) != ".adfe") {
                        ExportPath.Text += ".adfe";
                    }
                }
            };
            Frame save = new Frame()
            {
                Label = Director.Properties.Resources.DialogSaveScenario,
                Padding = 10
            };
            HBox SaveBox = new HBox();
            SaveBox.PackStart(ExportPath, true, true);
            SaveBox.PackStart(SelectPath, false, false);
            save.Content = SaveBox;
            _contentBox.PackStart(save);

            // Save button
            Button SaveBtn = new Button(Director.Properties.Resources.SaveServer)
            {
                HorizontalPlacement = WidgetPlacement.End,
                ExpandHorizontal = false,
                ExpandVertical = false,
                WidthRequest = (Config.Cocoa) ? 95 : 80,
                MinWidth = (Config.Cocoa) ? 95 : 80,
                Image = Image.FromResource(DirectorImages.SAVE_SCENARIO_ICON)
            };
            SaveBtn.Clicked += SaveBtn_Clicked;

            // Add to form
            _contentBox.PackStart(SaveBtn, false, WidgetPlacement.End, WidgetPlacement.End);

            // Set content box as content
            Content = _contentBox;
        }