Пример #1
0
 public MainUIWindow()
 {
     Glade.XML app = new Glade.XML("./gtksharptest.glade", "window1", "");
     app.Autoconnect(this);
     raiselower.Activate();
     commandqueue = UICommandQueue.GetInstance();
 }
Пример #2
0
        public ConfigurationDialog(AlbumArtWriterService service) : base(AddinManager.CurrentLocalizer.GetString("Album Art Writer Configuration"))
        {
            this.service = service;

            Frame artframe = new Frame("artbox_frame");

            artframe.Label = AddinManager.CurrentLocalizer.GetString("Output File Name (No Extension)");
            HBox artname_box = new HBox();

            artname_box.PackStart(new Label(AddinManager.CurrentLocalizer.GetString("File Name:")), false, false, 0);
            artname_entry = new Entry();
            artname_box.PackStart(artname_entry, true, true, 3);

            artframe.Add(artname_box);
            artframe.ShadowType = (ShadowType)4;

            VBox.PackStart(artframe, false, false, 3);

            Frame fileframe = new Frame("artbox_frame");

            fileframe.Label = AddinManager.CurrentLocalizer.GetString("Output File type");
            HBox image_radio_button_h_box = new HBox();

            jpg = new RadioButton(null, "JPG File");
            png = new RadioButton(jpg, "PNG File");
            image_radio_button_h_box.PackStart(jpg, false, false, 3);
            image_radio_button_h_box.PackStart(png, false, false, 3);
            fileframe.Add(image_radio_button_h_box);
            fileframe.ShadowType = (ShadowType)4;
            VBox.PackStart(fileframe, false, false, 3);
            AddDefaultCloseButton();
            ShowAll();

            // initialize values
            artname_entry.Text = service.ArtName;
            if (service.JPG)
            {
                jpg.Activate();
            }
            else if (service.PNG)
            {
                png.Activate();
            }

            // attach change handlers
            artname_entry.Changed += new EventHandler(on_ArtName_Changed);
            jpg.Toggled           += new EventHandler(on_Radio_Clicked);
            png.Toggled           += new EventHandler(on_Radio_Clicked);
        }