예제 #1
0
        protected Tab InsertButton(int index, string label, BaseViewContent viewContent)
        {
            CheckCreateSubViewToolbar();
            updating = true;

            var addedContent = (index == 0 || subViewToolbar.TabCount == 0) && IdeApp.Workbench.ActiveDocument == Document;
            var widgetBox    = new Gtk.VBox();
            var tab          = new Tab(subViewToolbar, label)
            {
                Tag = viewContent
            };

            if (tab.Accessible != null)
            {
                tab.Accessible.Help = viewContent.TabAccessibilityDescription;
            }

            // If this is the current displayed document we need to add the control immediately as the tab is already active.
            if (addedContent)
            {
                widgetBox.Add(viewContent.Control);
                widgetBox.Show();
            }

            subViewToolbar.InsertTab(index, tab);
            subViewNotebook.InsertPage(widgetBox, new Gtk.Label(), index);
            tab.Activated += (sender, e) => {
                if (!addedContent)
                {
                    widgetBox.Add(viewContent.Control);
                    widgetBox.Show();
                    addedContent = true;
                }

                int page = viewContents.IndexOf((BaseViewContent)tab.Tag);
                SetCurrentView(page);
                QueueDraw();
            };

            EnsureToolbarBoxSeparator();
            updating = false;

            if (index == 0)
            {
                ShowPage(0);
            }

            return(tab);
        }
예제 #2
0
        private Gtk.Widget MakeViewPage()
        {
            Gtk.VBox vbox = new Gtk.VBox(false, 0);
            vbox.BorderWidth = 6;

            textLabel              = new Gtk.Label();
            textLabel.Xalign       = 0;
            textLabel.UseUnderline = false;
            textLabel.Justify      = Gtk.Justification.Left;
            textLabel.Wrap         = true;
            textLabel.Text         = text;
            textLabel.Show();
            vbox.PackStart(textLabel, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            deleteButton          = new Gtk.Button(Gtk.Stock.Delete);
            deleteButton.Clicked += OnDeleteButtonClicked;
            deleteButton.Show();
            hButtonBox.PackStart(deleteButton, false, false, 0);

            editButton          = new Gtk.Button(Gtk.Stock.Edit);
            editButton.Clicked += OnEditButtonClicked;
            editButton.Show();
            hButtonBox.PackStart(editButton, false, false, 0);

            hButtonBox.Show();
            vbox.PackStart(hButtonBox, false, false, 0);

            vbox.Show();
            return(vbox);
        }
예제 #3
0
        public GlToggleButton(GdkGL.Config config)
        {
            // VBox.
            VBox vbox = new VBox (false, 0);
            vbox.BorderWidth = 10;

            // Drawing area for drawing OpenGL scene.
            DrawingArea drawing_area = new DrawingArea ();
            drawing_area.SetSizeRequest (200, 200);

            // Set OpenGL-capability to the widget.
            m_gl = new GlWidget (drawing_area, config);
            drawing_area.Realized += new EventHandler (Realize);
            drawing_area.ConfigureEvent += new ConfigureEventHandler (Configure);
            drawing_area.ExposeEvent += new ExposeEventHandler (Expose);
            drawing_area.Unrealized += new EventHandler (Unrealize);
            drawing_area.VisibilityNotifyEvent += new VisibilityNotifyEventHandler (VisibilityNotify);

            vbox.PackStart (drawing_area, true, true, 0);
            drawing_area.Show ();

            // Label.
            Label label = new Label ("Toggle Animation");
            vbox.PackStart (label, false, false, 10);
            label.Show ();

            Toggled += new EventHandler (ToggleAnimation);

            // Add VBox.
            vbox.Show ();
            Add (vbox);
        }
예제 #4
0
파일: AudioView.cs 프로젝트: GNOME/banter
        public AudioView()
        {
            //			this.WidthRequest = 500; //250;
            //			this.HeightRequest = 375; //187;

            Frame frame = new Frame();
            frame.BorderWidth = 5;
            frame.Show();

            VBox vbox = new VBox(false, 0);
            frame.Add(vbox);
            vbox.Show();

            Label label = new Label(Catalog.GetString("Audio Chat in progress..."));

            label.Show();
            vbox.PackStart(label, false, true, 5);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseAudioClicked;
            button.Show();
            vbox.PackStart(button, false, true, 5);

            this.Add(frame);
        }
예제 #5
0
    private void createButton()
    {
        Gtk.VBox vbox = new Gtk.VBox();

        Gtk.Image image = new Gtk.Image();
        addUserPhotoIfExists(image);
        image.HeightRequest = 150;
        image.Visible       = true;

        Gtk.Label label_select = new Gtk.Label("Select !");
        label_select.Visible = false;         //hide this to the user until button is clicked first time

        Gtk.Label label_id = new Gtk.Label(personID.ToString());
        label_id.Visible = false;         //hide this to the user

        Gtk.Viewport viewport = new Gtk.Viewport();
        UtilGtk.ViewportColorDefault(viewport);
        Gtk.Label label_name = new Gtk.Label(personName);
        label_name.Visible = true;
        label_name.Show();
        viewport.Add(label_name);
        viewport.Show();

        vbox.PackStart(image);                                  //0
        vbox.PackStart(label_id);                               //1
        vbox.PackEnd(viewport, false, false, 1);                //2 (contains label_name)

        vbox.Show();

        button = new Button(vbox);
        button.WidthRequest  = 150;
        button.HeightRequest = 170;
    }
예제 #6
0
		public SdiWorkspaceWindow (DefaultWorkbench workbench, IViewContent content, Notebook tabControl, TabLabel tabLabel) : base ()
		{
			this.workbench = workbench;
			this.tabControl = tabControl;
			this.content = content;
			this.tabLabel = tabLabel;
			this.tabPage = content.Control;
			
			content.WorkbenchWindow = this;
			
			content.ContentNameChanged += new EventHandler(SetTitleEvent);
			content.DirtyChanged       += new EventHandler(SetTitleEvent);
			content.BeforeSave         += new EventHandler(BeforeSave);
			content.ContentChanged     += new EventHandler (OnContentChanged);
			
			ShadowType = ShadowType.None;
			box = new VBox ();
			box.PackStart (content.Control);
			Add (box);
			box.Show ();
			
			SetTitleEvent(null, null);
			
			commandHandler = new ViewCommandHandlers (this);
			Show ();
		}
예제 #7
0
        public NewSearchPage()
            : base(0.5f, 0.5f, 0f, 0f)
        {
            base.SetPadding(36, 36, 36, 36);
            base.FocusGrabbed += base_FocusGrabbed;

            mainVBox = new VBox();

            Label label = new Label();
            label.Xalign = 0;
            label.Markup = "<span size=\"x-large\" weight=\"bold\">Search for files...</span>";
            mainVBox.PackStart(label, false, false, 0);
            label.Show();

            searchEntry = new FileSearchEntry();
            searchEntry.WidthRequest = 400;
            mainVBox.PackStart(searchEntry, false, false, 6);
            searchEntry.Show();

            searchButton = new Button("_Search");
            searchButton.Image = new Image(Stock.Find, IconSize.Button);
            searchButton.Clicked += searchButton_Clicked;
            searchButton.Show();

            HButtonBox buttonBox = new HButtonBox();
            buttonBox.Layout = ButtonBoxStyle.End;
            buttonBox.PackStart(searchButton, false, false, 0);
            mainVBox.PackStart(buttonBox, false, false, 0);
            buttonBox.Show();

            base.Add(mainVBox);
            mainVBox.Show();
        }
예제 #8
0
        public static int Main(string[] args)
        {
            Gtk.Application.Init (ref args);
            GtkGL.Application.Init (ref args);

            /*
            * Query OpenGL extension version.
            */
            int major, minor;
            Query.Version (out major, out minor);
            Console.WriteLine ("\nOpenGL extension version - {0}.{1}", major, minor);

            // * Configure OpenGL-capable visual.
            // Try double-buffered visual
            GdkGL.Config glconfig = new GdkGL.Config (GdkGL.ConfigMode.Rgb | GdkGL.ConfigMode.Double);
            if (glconfig == null) {
              		Console.WriteLine ("*** Cannot find the double-buffered visual.\n*** Trying single-buffered visual.");
                glconfig = new GdkGL.Config (GdkGL.ConfigMode.Rgb);
                if (glconfig == null) {
                      Console.WriteLine ("*** Cannot find any OpenGL-capable visual.");
                      return 1;
                }
            }

            GlUtilities.WriteOutConfig (glconfig);

            // Top-level window.
            Window window = new Window (WindowType.Toplevel);
            window.Title = "shapes";

            // Get automatically redrawn if any of their children changed allocation.
            window.ReallocateRedraws = true;
            window.DeleteEvent += new DeleteEventHandler (OnDelete);

            // VBox.
            VBox vbox = new VBox (false, 0);
            window.Add (vbox);
            vbox.Show ();

            // Drawing area for drawing OpenGL scene.
            ShapesArea drawing_area = new ShapesArea (glconfig);
            drawing_area.SetSizeRequest (300, 300);

            vbox.PackStart (drawing_area, true, true, 0);
            drawing_area.Show ();

            // Simple quit button.
            Button button = new Button ("Quit");
            button.Clicked += new EventHandler (OnQuit);
            vbox.PackStart (button, false, false, 0);
            button.Show ();

            // Show window.
            window.Show ();

            //
            Gtk.Application.Run ();
            return 0;
        }
예제 #9
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Label      label;
            Gtk.SpinButton menuNoteCountSpinner;
            Gtk.Alignment  align;
            int            menuNoteCount;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            Gtk.Table table = new Gtk.Table(1, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();
            align.Add(table);


            // Menu Note Count option
            label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)"));

            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();

            table.Attach(label, 0, 1, 0, 1);

            menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            // we have a hard limit of 18 set, thus not allowing anything bigger than 18
            menuNoteCountSpinner       = new Gtk.SpinButton(1, 18, 1);
            menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;

            menuNoteCountSpinner.Show();
            table.Attach(menuNoteCountSpinner, 1, 2, 0, 1);

            menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
예제 #10
0
		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");
			
			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();
			
			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			opts_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Menu Note Count option
			label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
예제 #11
0
파일: VideoView.cs 프로젝트: GNOME/banter
        public VideoView()
        {
            preview_pos = PreviewPos.ButtonRight;

            VBox vbox = new VBox(false, 0);
            vbox.Show();

            Frame frame = new Frame();
            //frame.BorderWidth = 5;
            frame.Show();

            vbox.Add(frame);

            mainView = new Gtk.EventBox();
            mainView.WidthRequest = 400;
            mainView.HeightRequest = 300;
            mainView.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255,255,255));
            mainView.ModifyBg (Gtk.StateType.Active, new Gdk.Color (255,255,255));
            mainView.Show();

            //this.WidthRequest = 333; // 500; //250;
            //this.HeightRequest = 250; // 375; //187; 250
            preview = new Gtk.DrawingArea ();
            preview.WidthRequest = 120; // 75; //150;
            preview.HeightRequest = 90; // 56; //112;
            preview.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0,0,0));
            preview.ModifyBg (Gtk.StateType.Active, new Gdk.Color (0,0,0));
            preview.Show();

            fix = new Gtk.Fixed ();
            fix.Put (preview, space, space);
            fix.Show();
            mainView.Add(fix);

            frame.Add(mainView);

            //			Label label = new Label(Catalog.GetString("Video Chat in progress..."));

            //			label.Show();
            //			vbox.PackStart(label, false, true, 0);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseVideoClicked;
            button.Show();
            vbox.PackStart(button, false, false, 5);

            this.Add(vbox);
            mainView.SizeAllocated += OnSizeAllocated;
            //			this.SizeRequested += OnsizeRequested;
            this.QueueResize ();
            MovePreview ();
        }
    void showWidgets(Constants.BellModes bellMode, Constants.EncoderVariablesCapture encoderMainVariable, EncoderRhythm encoderRhythm)
    {
        frame_best_and_worst.Hide();
        frame_conditions.Hide();
        hbox_jump_best_worst.Hide();
        hbox_run_best_worst.Hide();
        hbox_jump_conditions.Hide();
        hbox_run_conditions.Hide();
        frame_encoder_automatic_conditions.Hide();
        vbox_encoder_manual.Hide();
        notebook_encoder_conditions.Hide();
        vbox_encoder_stuff.Hide();

        notebook_main.GetNthPage(RHYTHMPAGE).Hide();
        notebook_main.ShowTabs = false;

        if (bellMode == Constants.BellModes.JUMPS)
        {
            frame_best_and_worst.Show();
            hbox_jump_best_worst.Show();
            hbox_jump_conditions.Show();
            frame_conditions.Show();
        }
        else if (bellMode == Constants.BellModes.RUNS)
        {
            frame_best_and_worst.Show();
            hbox_run_best_worst.Show();
            hbox_run_conditions.Show();
            frame_conditions.Show();
        }
        else             //encoder (grav and inertial)
        {
            vbox_encoder_stuff.Show();
            frame_encoder_automatic_conditions.Show();
            notebook_main.ShowTabs = true;

            vbox_encoder_manual.Show();
            if (checkbutton_encoder_show_manual_feedback.Active)
            {
                notebook_encoder_conditions.Show();
            }

            combo_encoder_main_variable.Active = UtilGtk.ComboMakeActive(combo_encoder_main_variable,
                                                                         Constants.GetEncoderVariablesCapture(encoderMainVariable));

            notebook_main.GetNthPage(RHYTHMPAGE).Show();
            encoder_rhythm_set_values(encoderRhythm);
        }

        label_test_sound_result.Text = "";
    }
예제 #13
0
    public static void Main()
    {
        Gtk.Window window;
        Gtk.VBox   vbox;
        Crumbs     crumbs;

        Application.Init ();

        // Outer Window
        window = new Gtk.Window ("Crumbs Test");
        window.BorderWidth = 12;
        window.Destroyed += OnDestroy;

        // Main VBox
        vbox = new Gtk.VBox ();
        window.Add(vbox);
        vbox.Show ();

        // Crumbs widget
        crumbs = new Crumbs ();
        vbox.PackStart (crumbs, false, false, 0);

        // Home Button
        crumbs.Add (new Gtk.Image (Gtk.Stock.Home, Gtk.IconSize.Menu));

        // Folder1
        HBox hbox1 = new HBox ();
        hbox1.Spacing = 3;
        Gtk.Image img1 = new Gtk.Image (Stock.Directory, IconSize.Menu);
        hbox1.PackStart (img1, false, true, 0);
        hbox1.PackStart (new Label ("Documents"));
        hbox1.ShowAll ();
        crumbs.Add (hbox1);

        // Folder2
        HBox hbox2 = new HBox ();
        hbox2.Spacing = 3;
        Gtk.Image img2 = new Gtk.Image (Stock.Directory, IconSize.Menu);
        hbox2.PackStart (img2, false, true, 0);
        hbox2.PackStart (new Label ("Spreadsheets"));
        hbox2.ShowAll ();
        crumbs.Add (hbox2);

        // Worksheet
        crumbs.Add (new Label ("Worksheet"));

        crumbs.ShowAll ();
        window.Show ();

        Application.Run ();
    }
예제 #14
0
		public WelcomePageFrame (Gtk.Widget w)
		{
			VBox box = new VBox ();
			box.Show ();
			projectBar = new WelcomePageProjectBar ();
			box.PackStart (projectBar, false, false, 0);

			box.PackStart (w, true, true, 0);
			CanFocus = true;

			Add (box);
			Show ();
			UpdateProjectBar ();
		}
예제 #15
0
 public TypeKindChooserDialog()
     : base(GettextCatalog.GetString ("Choose a type"))
 {
     Gtk.HBox hbox = new Gtk.HBox();
     base.VBox.Add (hbox);
     Gtk.VBox vbox;
     // box 1
     vbox = new Gtk.VBox ();
     hbox.Add (vbox);
     AddButton (vbox, GettextCatalog.GetString ("Activity"), SetActivity);
     _selection = "Activity";
     AddButton (vbox, GettextCatalog.GetString ("Actor"), SetActor);
     AddButton (vbox, GettextCatalog.GetString ("Artifact"), SetArtifact);
     AddButton (vbox, GettextCatalog.GetString ("Association"), SetAssociation);
     AddButton (vbox, GettextCatalog.GetString ("AssociationClass"), SetAssociationClass);
     AddButton (vbox, GettextCatalog.GetString ("Class"), SetClass);
     AddButton (vbox, GettextCatalog.GetString ("Collaboration"), SetCollaboration);
     vbox.Show ();
     // box 2
     vbox = new Gtk.VBox();
     hbox.Add (vbox);
     AddButton (vbox, GettextCatalog.GetString ("CommunicationPath"), SetCommunicationPath);
     AddButton (vbox, GettextCatalog.GetString ("Component"), SetComponent);
     AddButton (vbox, GettextCatalog.GetString ("DataType"), SetDataType);
     AddButton (vbox, GettextCatalog.GetString ("DeploymentSpecification"), SetDeploymentSpecification);
     AddButton (vbox, GettextCatalog.GetString ("Device"), SetDevice);
     AddButton (vbox, GettextCatalog.GetString ("Enumeration"), SetEnumeration);
     AddButton (vbox, GettextCatalog.GetString ("ExecutionEnvironment"), SetExecutionEnvironment);
     vbox.Show ();
     // box 3
     vbox = new Gtk.VBox ();
     hbox.Add (vbox);
     AddButton (vbox, GettextCatalog.GetString ("Extension"), SetExtension);
     AddButton (vbox, GettextCatalog.GetString ("InformationItem"), SetInformationItem);
     AddButton (vbox, GettextCatalog.GetString ("Interaction"), SetInteraction);
     AddButton (vbox, GettextCatalog.GetString ("Interface"), SetInterface);
     AddButton (vbox, GettextCatalog.GetString ("Node"), SetNode);
     AddButton (vbox, GettextCatalog.GetString ("PrimitiveType"), SetPrimitiveType);
     AddButton (vbox, GettextCatalog.GetString ("ProtocolStateMachine"), SetProtocolStateMachine);
     vbox.Show ();
     // box 4
     vbox = new Gtk.VBox ();
     hbox.Add (vbox);
     AddButton (vbox, GettextCatalog.GetString ("Signal"), SetSignal);
     AddButton (vbox, GettextCatalog.GetString ("StateMachine"), SetStateMachine);
     AddButton (vbox, GettextCatalog.GetString ("Stereotype"), SetStereotype);
     AddButton (vbox, GettextCatalog.GetString ("UseCase"), SetUseCase);
     vbox.Show ();
     hbox.Show ();
 }
		public CombinedDesignView (IViewContent content)
		{
			this.content = content;
			if (content is IEditableTextBuffer) {
				((IEditableTextBuffer)content).CaretPositionSet += delegate {
					ShowPage (0);
				};
			}
			content.ContentChanged += new EventHandler (OnTextContentChanged);
			content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
			
			notebook = new Gtk.Notebook ();
			
			// Main notebook
			
			notebook.TabPos = Gtk.PositionType.Bottom;
			notebook.ShowTabs = false;
			notebook.ShowBorder = false;
			notebook.Show ();
			box = new VBox ();
			
			// Bottom toolbar
			
			toolbar = new Toolbar ();
			toolbar.IconSize = IconSize.SmallToolbar;
			toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			toolbar.ShowArrow = false;
			
			CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
			crc.Show ();
			AddButton (GettextCatalog.GetString ("Source Code"), crc).Active = true;
			
			toolbar.ShowAll ();
			
			box.PackStart (notebook, true, true, 0);
			box.PackStart (toolbar, false, false, 0);
			
			box.Show ();
			
			IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged);
			content.Control.Realized += delegate {
				if (content != null && content.WorkbenchWindow != null) 
					content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
			};
			notebook.SwitchPage += delegate {
				if (content != null && content.WorkbenchWindow != null) 
					content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
			};
		}
예제 #17
0
        public static void Main(string[] args)
        {
            Application.Init();

            var window = new Gtk.Window(Gtk.WindowType.Toplevel)
            {
                Title       = "Treemap Example",
                BorderWidth = 0,                //12,
            };

            window.SetDefaultSize(640, 480);
            window.DeleteEvent += delegate {
                Gtk.Application.Quit();
            };
            window.Show();

            var vbox = new Gtk.VBox(false, 6);

            window.Add(vbox);
            vbox.Show();

            var treemap = new TreeMap.TreeMap()
            {
                Model        = BuildModel(),
                TextColumn   = 0,
                WeightColumn = 1,
                Title        = "Treemap Example",
            };

            vbox.PackStart(treemap, true, true, 0);
            treemap.Show();

            var buttonbox = new Gtk.HButtonBox();

            buttonbox.BorderWidth = 12;
            buttonbox.Layout      = Gtk.ButtonBoxStyle.End;
            vbox.PackStart(buttonbox, false, true, 0);
            buttonbox.Show();

            var close = new Gtk.Button(Gtk.Stock.Close);

            close.CanDefault = true;
            close.Clicked   += delegate { Gtk.Application.Quit(); };
            buttonbox.PackStart(close, false, true, 0);
            window.Default = close;
            close.Show();

            Application.Run();
        }
예제 #18
0
        protected Tab AddButton(string label, IBaseViewContent viewContent)
        {
            CheckCreateSubViewToolbar();
            updating = true;

            var addedContent = subViewToolbar.TabCount == 0 && IdeApp.Workbench.ActiveDocument == Document;
            var widgetBox    = new Gtk.VBox();
            var tab          = new Tab(subViewToolbar, label)
            {
                Tag = subViewToolbar.TabCount
            };

            // If this is the current displayed document we need to add the control immediately as the tab is already active.
            if (addedContent)
            {
                widgetBox.Add(viewContent.Control);
                widgetBox.Show();
            }

            subViewToolbar.AddTab(tab);
            subViewNotebook.AppendPage(widgetBox, new Gtk.Label());
            tab.Activated += (sender, e) => {
                if (!addedContent)
                {
                    widgetBox.Add(viewContent.Control);
                    widgetBox.Show();
                }
                addedContent = true;
                SetCurrentView((int)((Tab)sender).Tag);
                QueueDraw();
            };

            EnsureToolbarBoxSeparator();
            updating = false;
            return(tab);
        }
예제 #19
0
		public ExceptionCaughtDialog (ExceptionInfo ex, ExceptionCaughtMessage msg)
			: base (WindowType.Toplevel)
		{
			this.Child = VBox = new VBox ();
			VBox.Show ();
			this.Name = "wizard_dialog";
			this.ApplyTheme ();
			selected = exception = ex;
			message = msg;

			Build ();
			UpdateDisplay ();

			exception.Changed += ExceptionChanged;
		}
예제 #20
0
        public StatusView(string filepath, VersionControlSystem vc)
            : base(Path.GetFileName(filepath) + " Status")
        {
            this.vc = vc;
            this.filepath = filepath;

            main = new VBox(false, 5);
            widget = main;
            main.Show();

            commandbar = new HBox(false, 5);
            main.PackStart(commandbar, false, false, 5);

            showRemoteStatus = new Button("Show Remote Status");
            commandbar.PackEnd(showRemoteStatus, false, false, 0);
            showRemoteStatus.Clicked += new EventHandler(OnShowRemoteStatusClicked);

            buttonCommit = new Button("Commit...");
            commandbar.PackEnd(buttonCommit, false, false, 0);
            buttonCommit.Clicked += new EventHandler(OnCommitClicked);

            boxCommit = new VBox(false, 2);
            textCommitMessage = new TextView();
            HBox boxCommitButtons = new HBox(false, 2);
            buttonCommitCancel = new Button("Cancel");
            buttonCommitCommit = new Button("Commit");
            textCommitMessage.Show();
            buttonCommitCancel.Show();
            buttonCommitCommit.Show();
            boxCommit.PackStart(textCommitMessage, true, true, 0);
            boxCommit.PackStart(boxCommitButtons, false, false, 0);
            boxCommitButtons.PackEnd(buttonCommitCancel, false, false, 0);
            boxCommitButtons.PackEnd(buttonCommitCommit, false, false, 0);
            buttonCommitCancel.Clicked += new EventHandler(OnCommitCancelClicked);
            buttonCommitCommit.Clicked += new EventHandler(OnCommitCommitClicked);

            ScrolledWindow scroller = new ScrolledWindow();
            Viewport viewport = new Viewport();
            box = new VBox(false, 5);
            main.Add(scroller);

            viewport.Add(box);
            scroller.Add(viewport);

            main.ShowAll();

            StartUpdate();
        }
예제 #21
0
		public WelcomePageFrame (Gtk.Widget w)
		{
			VBox box = new VBox ();
			box.Show ();
			projectBar = new WelcomePageProjectBar ();
			box.PackStart (projectBar, false, false, 0);

			box.PackStart (w, true, true, 0);
			CanFocus = true;

			Add (box);
			Show ();
			UpdateProjectBar ();

			IdeApp.Workbench.GuiLocked += HandleGuiLocked;
			IdeApp.Workbench.GuiUnlocked += HandleGuiUnlocked;
		}
예제 #22
0
        public HmPreferencesWidget()
            : base()
        {
            HmBackend.LoadCredentials (out this.username, out this.password);

            //Fixme Please ! I look UGLY!
            VBox mainVBox = new VBox(false, 12);
            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            HBox usernameBox = new HBox(false, 12);
            Gtk.Label emailLabel = new Label ("Email Address");
            usernameBox.Add (emailLabel);
            emailEntry = new Entry(username);
            usernameBox.Add (emailEntry);
            usernameBox.ShowAll();
            mainVBox.PackStart (usernameBox, false, false, 0);

            HBox passwordBox = new HBox(false, 12);
            Gtk.Label passwordLabel = new Label ("Password");
            passwordBox.Add (passwordLabel);
            passwordEntry = new Entry(password);
            passwordBox.Add (passwordEntry);
            passwordBox.ShowAll();
            mainVBox.PackStart (passwordBox, false, false, 0);

            // Status message label
            statusLabel = new Label();
            statusLabel.Justify = Gtk.Justification.Center;
            statusLabel.Wrap = true;
            statusLabel.LineWrap = true;
            statusLabel.Show();
            statusLabel.UseMarkup = true;
            statusLabel.UseUnderline = false;

            mainVBox.PackStart(statusLabel, false, false, 0);

            authButton = new LinkButton("Click Here to Connect");
            authButton.Show();
            mainVBox.PackStart(authButton, false, false, 0);
            mainVBox.ShowAll();

            authButton.Clicked += OnAuthButtonClicked;
        }
예제 #23
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            /*
             * If you want to add new settings to the Advanced tab - follow the steps below:
             *      1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs);
             *      2) define property/method for that class that returns the widget you want to place onto the tab;
             *      3) (similar to the below) instantiate object of your class and PackStart its widget to opts_list;
             *      It's expected that the returned widget is already within Gtk.Alignment, so no further alignment done.
             */

            // TODO: More elegant way of implementing this would be to create a collection of "prefs" objects
            // and iterate over them adding them to opts_list (fewer lines to add upon adding new setting).

            // Instantiate class for Menu Min/Max Note Count setting
            MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference();

            // Add the widget for this setting to the Advanced tab
            opts_list.PackStart(menuNoteCountPref.Widget, false, false, 0);

            //Instantiate class for Enable Startup Notes setting
            EnableStartupNotesPreference enableStartupNotesPref = new EnableStartupNotesPreference();

            // Add the widget to the Advanced tab
            opts_list.PackStart(enableStartupNotesPref.Widget, false, false, 0);

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
예제 #24
0
		Widget CreateExceptionInfoHeader ()
		{
			ExceptionMessageLabel = new Label () { Selectable = true, Wrap = true, WidthRequest = 500, Xalign = 0.0f };
			ExceptionTypeLabel = new Label () { UseMarkup = true, Xalign = 0.0f };

			ExceptionMessageLabel.Show ();
			ExceptionTypeLabel.Show ();

			var frame = new InfoFrame (ExceptionMessageLabel);
			frame.Show ();

			var vbox = new VBox (false, 6);
			vbox.PackStart (ExceptionTypeLabel, false, true, 0);
			vbox.PackStart (frame, true, true, 0);
			vbox.Show ();

			return vbox;
		}
예제 #25
0
        public static void Main(string[] args)
        {
            Application.Init ();

            var window = new Gtk.Window (Gtk.WindowType.Toplevel) {
                Title       = "Treemap Example",
                BorderWidth = 0,//12,
            };
            window.SetDefaultSize (640, 480);
            window.DeleteEvent += delegate {
                Gtk.Application.Quit ();
            };
            window.Show ();

            var vbox = new Gtk.VBox (false, 6);
            window.Add (vbox);
            vbox.Show ();

            var treemap = new TreeMap.TreeMap () {
                Model        = BuildModel (),
                TextColumn   = 0,
                WeightColumn = 1,
                Title        = "Treemap Example",
            };
            vbox.PackStart (treemap, true, true, 0);
            treemap.Show ();

            var buttonbox = new Gtk.HButtonBox ();
            buttonbox.BorderWidth = 12;
            buttonbox.Layout = Gtk.ButtonBoxStyle.End;
            vbox.PackStart (buttonbox, false, true, 0);
            buttonbox.Show ();

            var close = new Gtk.Button (Gtk.Stock.Close);
            close.CanDefault = true;
            close.Clicked += delegate { Gtk.Application.Quit (); };
            buttonbox.PackStart (close, false, true, 0);
            window.Default = close;
            close.Show ();

            Application.Run ();
        }
		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");

			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();

			/*
			If you want to add new settings to the Advanced tab - follow the steps below:
				1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs);
				2) define property/method for that class that returns the widget you want to place onto the tab;
				3) (similar to the below) instantiate object of your class and PackStart its widget to opts_list;
				It's expected that the returned widget is already within Gtk.Alignment, so no further alignment done.
			*/

			// TODO: More elegant way of implementing this would be to create a collection of "prefs" objects
			// and iterate over them adding them to opts_list (fewer lines to add upon adding new setting).

			// Instantiate class for Menu Min/Max Note Count setting
			MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference();
			// Add the widget for this setting to the Advanced tab
			opts_list.PackStart(menuNoteCountPref.Widget, false, false, 0);

			//Instantiate class for Enable Startup Notes setting
			EnableStartupNotesPreference enableStartupNotesPref = new EnableStartupNotesPreference();
			// Add the widget to the Advanced tab
			opts_list.PackStart (enableStartupNotesPref.Widget, false, false, 0);

			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
예제 #27
0
        private Gtk.Widget MakeEditPage()
        {
            Gtk.VBox vbox = new Gtk.VBox(false, 0);
            vbox.BorderWidth = 6;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType       = Gtk.ShadowType.EtchedIn;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;

            textView             = new Gtk.TextView();
            textView.WrapMode    = Gtk.WrapMode.Word;
            textView.Editable    = true;
            textView.Buffer.Text = text;
            textView.CanFocus    = true;
            textView.NoShowAll   = true;
            textView.SetSizeRequest(-1, 60);
            sw.Add(textView);
            sw.Show();
            vbox.PackStart(sw, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            cancelButton           = new Gtk.Button(Gtk.Stock.Cancel);
            cancelButton.Clicked  += OnEditCanceled;
            cancelButton.NoShowAll = true;
            hButtonBox.PackStart(cancelButton, false, false, 0);

            saveButton           = new Gtk.Button(Gtk.Stock.Save);
            saveButton.Clicked  += OnSaveButtonClicked;
            saveButton.NoShowAll = true;
            hButtonBox.PackStart(saveButton, false, false, 0);

            hButtonBox.Show();
            vbox.PackStart(hButtonBox, false, false, 6);

            vbox.Show();
            return(vbox);
        }
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Alignment align;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            /*
             * If you want to add new settings to the Advanced tab - follow the steps below:
             *      1) define a class which implements the functionality (see e.g. MenuMinMaxNoteCountPreference.cs);
             *      2) define property/method for that class that returns the widget you want to place onto the tab;
             *      3) (similar to the below) instantiate object of your class and add its widget to the "align" widget;
             */
            // Instantiate class for Menu Min/Max Note Count setting
            MenuMinMaxNoteCountPreference menuNoteCountPref = new MenuMinMaxNoteCountPreference();

            // Add the widget for this setting to the Advanced tab
            align.Add(menuNoteCountPref.Widget);

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
		public ScriptEditor(object @object, PropertyInfo info) : base(@object, info) {
			VBox box = new VBox(false, 3);
			
			ScrolledWindow window = new ScrolledWindow();
			
			this.mEditor = new TextView();
			this.mEditor.Show();
			this.mEditor.Buffer.Changed += this.OnEditorChanged;
			this.mEditor.ModifyFont(Pango.FontDescription.FromString("monospace"));
			
			this.mErrorTag = new TextTag("compile error");
			this.mErrorTag.Underline = Pango.Underline.Error;
			
			this.mEditor.Buffer.TagTable.Add(this.mErrorTag);
			
			window.Add(this.mEditor);
			window.Show();
			window.ShadowType = ShadowType.In;
			
			this.mErrorLabel = new Label();
			this.mErrorLabel.Selectable = true;
			this.mErrorLabel.LineWrap = true;
			this.mErrorLabel.Xalign = 0;
			
			this.mErrorLabel.Style.FontDescription.Weight = Pango.Weight.Bold;
			this.mErrorLabel.ModifyFont(this.mErrorLabel.Style.FontDescription);
			
			box.Add(window);
			box.Add(this.mErrorLabel);
			box.Show();
			
			box.SizeAllocated += this.OnBoxSizeAllocated;
			
			this.SetSizeRequest(1, -1);
			
			this.Add(box);
			
			this.Revert();
		}
예제 #30
0
    public Gtk.Button CreateButton()
    {
        Gtk.VBox vbox = new Gtk.VBox();

        Gtk.Image image     = new Gtk.Image();
        string    photoFile = Util.GetPhotoFileName(true, p.UniqueID);

        if (photoFile != "" && File.Exists(photoFile))
        {
            try {
                Pixbuf pixbuf = new Pixbuf(photoFile);                  //from a file
                image.Pixbuf  = pixbuf;
                image.Visible = true;
            }
            catch {
                LogB.Warning("catched while adding photo");
            }
        }

        Gtk.Label label_id = new Gtk.Label(p.UniqueID.ToString());
        label_id.Visible = false;         //hide this to the user

        Gtk.Label label_name = new Gtk.Label(p.Name);
        label_name.Visible = true;

        vbox.PackStart(image);
        vbox.PackStart(label_id);
        vbox.PackEnd(label_name, false, false, 1);

        vbox.Show();

        Button b = new Button(vbox);

        b.WidthRequest = 150;

        return(b);
    }
예제 #31
0
    void showWidgets(Constants.BellModes bellMode)
    {
        frame_best_and_worst.Hide();
        frame_conditions.Hide();
        hbox_jump_best_worst.Hide();
        hbox_run_best_worst.Hide();
        hbox_jump_conditions.Hide();
        hbox_run_conditions.Hide();
        frame_encoder_automatic_conditions.Hide();
        vbox_encoder_manual.Hide();
        notebook_encoder_conditions.Hide();

        if (bellMode == Constants.BellModes.JUMPS)
        {
            frame_best_and_worst.Show();
            hbox_jump_best_worst.Show();
            hbox_jump_conditions.Show();
            frame_conditions.Show();
        }
        else if (bellMode == Constants.BellModes.RUNS)
        {
            frame_best_and_worst.Show();
            hbox_run_best_worst.Show();
            hbox_run_conditions.Show();
            frame_conditions.Show();
        }
        else                                             //encoder
        {
            notebook_encoder_conditions.CurrentPage = 3; //power
            frame_encoder_automatic_conditions.Show();
            vbox_encoder_manual.Show();
            if (checkbutton_encoder_show_manual_feedback.Active)
            {
                notebook_encoder_conditions.Show();
            }
        }
    }
예제 #32
0
		internal void SetFloatMode (Gdk.Rectangle rect)
		{
			if (floatingWindow == null) {
				ResetMode ();
				SetRegionStyle (frame.GetRegionStyleForItem (this));

				floatingWindow = new DockFloatingWindow ((Window)frame.Toplevel, GetWindowTitle ());

				VBox box = new VBox ();
				box.Show ();
				box.PackStart (TitleTab, false, false, 0);
				box.PackStart (Widget, true, true, 0);
				floatingWindow.Add (box);
				floatingWindow.DeleteEvent += delegate (object o, DeleteEventArgs a) {
					if (behavior == DockItemBehavior.CantClose)
						Status = DockItemStatus.Dockable;
					else
						Visible = false;
					a.RetVal = true;
				};
			}
			floatingWindow.Move (rect.X, rect.Y);
			floatingWindow.Resize (rect.Width, rect.Height);
			floatingWindow.Show ();
			if (titleTab != null)
				titleTab.UpdateBehavior ();
			Widget.Show ();
		}
예제 #33
0
		void CreatePageWidget (SectionPage page)
		{
			List<PanelInstance> boxPanels = new List<PanelInstance> ();
			List<PanelInstance> tabPanels = new List<PanelInstance> ();
			
			foreach (PanelInstance pi in page.Panels) {
				if (pi.Widget == null) {
					pi.Widget = pi.Panel.CreatePanelWidget ();
					//HACK: work around bug 469427 - broken themes match on widget names
					if (pi.Widget.Name.IndexOf ("Panel") > 0)
						pi.Widget.Name = pi.Widget.Name.Replace ("Panel", "_");
				}
				else if (pi.Widget.Parent != null)
					((Gtk.Container) pi.Widget.Parent).Remove (pi.Widget);
					
				if (pi.Node.Grouping == PanelGrouping.Tab)
					tabPanels.Add (pi);
				else
					boxPanels.Add (pi);
			}
			
			// Try to fit panels with grouping=box or auto in the main page.
			// If they don't fit. Move auto panels to its own tab page.
			
			int mainPageSize;
			bool fits;
			do {
				PanelInstance lastAuto = null;
				mainPageSize = 0;
				foreach (PanelInstance pi in boxPanels) {
					if (pi.Node.Grouping == PanelGrouping.Auto)
						lastAuto = pi;
					// HACK: This we are parenting/unparenting the widget here as a workaround
					// for a layout issue. To properly calculate the size of the widget, the widget
					// needs to have the style that it will have when added to the window.
					pi.Widget.Parent = this;
					mainPageSize += pi.Widget.SizeRequest ().Height + 6;
					pi.Widget.Unparent ();
				}
				fits = mainPageSize <= pageFrame.Allocation.Height;
				if (!fits) {
					if (lastAuto != null && boxPanels.Count > 1) {
						boxPanels.Remove (lastAuto);
						tabPanels.Insert (0, lastAuto);
					} else {
						fits = true;
					}
				}
			} while (!fits);
			
			Gtk.VBox box = new VBox (false, 12);
			box.Show ();
			for (int n=0; n<boxPanels.Count; n++) {
				if (n != 0) {
					HSeparator sep = new HSeparator ();
					sep.Show ();
					box.PackStart (sep, false, false, 0);
				}
				PanelInstance pi = boxPanels [n];
				box.PackStart (pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
				pi.Widget.Show ();
			}
			
			box.BorderWidth = 12;

			if (tabPanels.Count > 0) {
				/*				SquaredNotebook nb = new SquaredNotebook ();
				nb.Show ();
				nb.AddTab (box, GettextCatalog.GetString ("General"));
				foreach (PanelInstance pi in tabPanels) {
					Gtk.Alignment a = new Alignment (0, 0, 1, 1);
					a.BorderWidth = 9;
					a.Show ();
					a.Add (pi.Widget);
					nb.AddTab (a, GettextCatalog.GetString (pi.Node.Label));
					pi.Widget.Show ();
				}*/
				Gtk.Notebook nb = new Notebook ();
				nb.Show ();
				Gtk.Label blab = new Gtk.Label (GettextCatalog.GetString ("General"));
				blab.Show ();
				box.BorderWidth = 9;
				nb.InsertPage (box, blab, -1);
				foreach (PanelInstance pi in tabPanels) {
					Gtk.Label lab = new Gtk.Label (GettextCatalog.GetString (pi.Node.Label));
					lab.Show ();
					Gtk.Alignment a = new Alignment (0, 0, 1, 1);
					a.BorderWidth = 9;
					a.Show ();
					a.Add (pi.Widget);
					nb.InsertPage (a, lab, -1);
					pi.Widget.Show ();
				}
				page.Widget = nb;
				nb.BorderWidth = 12;
			} else {
				page.Widget = box;
			}
		}
예제 #34
0
		private void Init()
		{
			Logger.Debug("Called Init");
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			this.Title = string.Format ("Giver Preferences");	
			
			//this.DefaultSize = new Gdk.Size (300, 500); 	
			this.VBox.Spacing = 0;
			this.VBox.BorderWidth = 0;
			this.SetDefaultSize (450, 100);


			this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
            this.DefaultResponse = ResponseType.Ok;


			// Start with an event box to paint the background white
			EventBox eb = new EventBox();
			eb.Show();
			eb.BorderWidth = 0;
            eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));

			VBox mainVBox = new VBox();
			mainVBox.BorderWidth = 10;
			mainVBox.Spacing = 5;
			mainVBox.Show ();
			eb.Add(mainVBox);
			this.VBox.PackStart(eb);

			Label label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>";
			mainVBox.PackStart(label, true, true, 0);

			// Name Box at the top of the Widget
			HBox nameBox = new HBox();
			nameBox.Show();
			nameEntry = new Entry();
			nameEntry.Show();
			nameBox.PackStart(nameEntry, true, true, 0);
			nameBox.Spacing = 10;
			mainVBox.PackStart(nameBox, false, false, 0);
	
			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>";
			mainVBox.PackStart(label, true, true, 0);
		
			Gtk.Table table = new Table(4, 3, false);
			table.Show();
			// None Entry
			noneButton = new RadioButton((Gtk.RadioButton)null);
			noneButton.Show();
			table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			VBox vbox = new VBox();
			vbox.Show();
			Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("None");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 0 ,1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			table.Attach(vbox, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			// Local Entry
			localButton = new RadioButton(noneButton);
			localButton.Show();
			table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			localImage = new Image(Utilities.GetIcon("stock_person", 48));
			localImage.Show();
			vbox.PackStart(localImage, false, false, 0);
			label = new Label("File");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 1 ,2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			photoButton = new Button("Change Photo");
			photoButton.Show();
			table.Attach(photoButton, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

			// Web Entry
			webButton = new RadioButton(noneButton);
			webButton.Show();
			table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			image = new Image(Utilities.GetIcon("web-browser", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("Web Link");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 2 ,3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			webEntry = new Entry();
			webEntry.Show();
			table.Attach(webEntry, 2,3,2,3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			// Gravatar Entry
			gravatarButton = new RadioButton(noneButton);
			gravatarButton.Show();
			table.Attach(gravatarButton, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			image = new Image(Utilities.GetIcon("gravatar", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("Gravatar");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 3 ,4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			gravatarEntry = new Entry();
			gravatarEntry.Show();
			table.Attach(gravatarEntry, 2,3,3,4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			mainVBox.PackStart(table, true, true, 0);


			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your File Location</span>";
			mainVBox.PackStart(label, true, true, 0);
	
			fileLocationButton = new FileChooserButton("Select storage location",
			    FileChooserAction.SelectFolder);
			fileLocationButton.Show();

			mainVBox.PackStart(fileLocationButton, true, true, 0);

			table = new Table(2, 3, false);
			table.Show();

			// Port number section
			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Port Number</span>";
			mainVBox.PackStart(label, true, true, 0);

			// any port Entry
			anyPortButton = new RadioButton((Gtk.RadioButton)null);
			anyPortButton.Show();
			table.Attach(anyPortButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			vbox = new VBox();
			vbox.Show();

			label = new Label ();
			label.Show ();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "Any available port";
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			// fixed port Entry
			fixedPortButton = new RadioButton(anyPortButton);
			fixedPortButton.Show();
			table.Attach(fixedPortButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			label = new Label ();
			label.Show ();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "Use a fixed port";
			table.Attach(label, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			portNumberEntry = new Entry();
			portNumberEntry.Show();
			table.Attach(portNumberEntry, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			mainVBox.PackStart(table, true, true, 0);

			DeleteEvent += WindowDeleted;
		}
예제 #35
0
        public void ShowCalendar()
        {
            popup = new Window(WindowType.Popup);
            popup.Screen = parent.Screen;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

            box.PackStart(calAlignment, false, false, 0);

            //Requisition req = SizeRequest();

            parent.GdkWindow.GetOrigin(out xPos, out yPos);
            //			popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
            popup.Move(xPos, yPos);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                     Gdk.EventMask.ButtonPressMask
                                     | Gdk.EventMask.ButtonReleaseMask
                                     | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success) {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

                if (grabbed != Gdk.GrabStatus.Success) {
                    Grab.Remove(popup);
                    popup.Destroy();
                    popup = null;
                }
            } else {
                Grab.Remove(popup);
                popup.Destroy();
                popup = null;
            }

            cal.DaySelected += OnCalendarDaySelected;
            cal.MonthChanged += OnCalendarMonthChanged;

            cal.Date = date;
        }
예제 #36
0
		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultWidth = 500;
			DefaultHeight = 500;
			HeightRequest = 350;
			WidthRequest = 350;
			VBox.Foreach (VBox.Remove);
			VBox.PackStart (CreateExceptionHeader (), false, true, 0);
			paned = new VPanedThin ();
			paned.GrabAreaSize = 10;
			paned.Pack1 (CreateStackTraceTreeView (), true, false);
			paned.Pack2 (CreateExceptionValueTreeView (), true, false);
			paned.Show ();
			var vbox = new VBox (false, 0);
			var whiteBackground = new EventBox ();
			whiteBackground.Show ();
			whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ());
			whiteBackground.Add (vbox);
			hadInnerException = HasInnerException ();
			if (hadInnerException) {
				vbox.PackStart (new VBox (), false, false, 6);
				vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0);
				vbox.ShowAll ();
			}
			vbox.PackStart (paned, true, true, 0);
			vbox.Show ();

			if (hadInnerException) {
				var box = new HBox ();
				box.PackStart (CreateInnerExceptionsTree (), false, false, 0);
				box.PackStart (whiteBackground, true, true, 0);
				box.Show ();
				VBox.PackStart (box, true, true, 0);
				DefaultWidth = 900;
				DefaultHeight = 700;
				WidthRequest = 550;
				HeightRequest = 450;
			} else {
				VBox.PackStart (whiteBackground, true, true, 0);
			}
			var actionArea = new HBox (false, 0) { BorderWidth = 14 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();
			OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels
			actionArea.ShowAll ();

			VBox.PackStart (actionArea, false, true, 0);
		}
예제 #37
0
		Widget CreateStackTraceTreeView ()
		{
			var store = new ListStore (typeof (ExceptionStackFrame), typeof (string), typeof (bool));
			StackTraceTreeView = new TreeView (store);
			StackTraceTreeView.SearchColumn = -1; // disable the interactive search
			StackTraceTreeView.FixedHeightMode = false;
			StackTraceTreeView.HeadersVisible = false;
			StackTraceTreeView.ShowExpanders = false;
			StackTraceTreeView.RulesHint = false;
			StackTraceTreeView.Show ();

			var renderer = new StackFrameCellRenderer (StackTraceTreeView.PangoContext);

			StackTraceTreeView.AppendColumn ("", renderer, (CellLayoutDataFunc)StackFrameLayout);

			StackTraceTreeView.RowActivated += StackFrameActivated;

			var scrolled = new ScrolledWindow {
				HeightRequest = 180,
				HscrollbarPolicy = PolicyType.Never,
				VscrollbarPolicy = PolicyType.Automatic
			};
			scrolled.ShadowType = ShadowType.None;
			scrolled.Add (StackTraceTreeView);
			scrolled.Show ();
			var vbox = new VBox ();
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.PackStart (scrolled, true, true, 0);
			vbox.Show ();

			var vbox2 = new VBox ();
			expanderStacktrace = WrapInExpander (GettextCatalog.GetString ("Stacktrace"), vbox);
			vbox2.PackStart (new VBox (), false, false, 5);
			vbox2.PackStart (expanderStacktrace, true, true, 0);
			vbox2.ShowAll ();
			return vbox2;
		}
예제 #38
0
        protected TaskListWindow(TaskManager manager)
            : base(Catalog.GetString("To Do List"))
        {
            this.manager  = manager;
            this.IconName = "tomboy";
            this.SetDefaultSize(500, 300);
            this.sort_column = SortColumn.CompletionDate;

            AddAccelGroup(Tomboy.ActionManager.UI.AccelGroup);

            action_group = new Gtk.ActionGroup("TaskList");
            action_group.Add(new Gtk.ActionEntry [] {
                new Gtk.ActionEntry("TaskListFileMenuAction", null,
                                    Catalog.GetString("_File"), null, null, null),

                new Gtk.ActionEntry("NewTaskAction", Gtk.Stock.New,
                                    Catalog.GetString("New _Task"), "<Control>T",
                                    Catalog.GetString("Create a new task"), null),

                new Gtk.ActionEntry("OpenTaskAction", String.Empty,
                                    Catalog.GetString("_Options..."), "<Control>O",
                                    Catalog.GetString("Open the selected task"), null),

                new Gtk.ActionEntry("CloseTaskListWindowAction", Gtk.Stock.Close,
                                    Catalog.GetString("_Close"), "<Control>W",
                                    Catalog.GetString("Close this window"), null),

                new Gtk.ActionEntry("TaskListEditMenuAction", null,
                                    Catalog.GetString("_Edit"), null, null, null),

                new Gtk.ActionEntry("DeleteTaskAction", Gtk.Stock.Preferences,
                                    Catalog.GetString("_Delete"), "Delete",
                                    Catalog.GetString("Delete the selected task"), null),

                new Gtk.ActionEntry("OpenOriginNoteAction", null,
                                    Catalog.GetString("Open Associated _Note"), null,
                                    Catalog.GetString("Open the note containing the task"), null),

                new Gtk.ActionEntry("TaskListViewMenuAction", null,
                                    Catalog.GetString("_View"), null, null, null),

                new Gtk.ActionEntry("TaskListHelpMenuAction", null,
                                    Catalog.GetString("_Help"), null, null, null),

                new Gtk.ActionEntry("ShowTaskHelpAction", Gtk.Stock.Help,
                                    Catalog.GetString("_Contents"), "F1",
                                    Catalog.GetString("Tasks Help"), null)
            });

            action_group.Add(new Gtk.ToggleActionEntry [] {
                new Gtk.ToggleActionEntry("ShowCompletedTasksAction", null,
                                          Catalog.GetString("Show _Completed Tasks"), null,
                                          Catalog.GetString("Show completed tasks in the list"), null, true),

                new Gtk.ToggleActionEntry("ShowDueDateColumnAction", null,
                                          Catalog.GetString("Show _Due Date Column"), null,
                                          Catalog.GetString("Show the due date column in the list"), null, true),

                new Gtk.ToggleActionEntry("ShowPriorityColumnAction", null,
                                          Catalog.GetString("Show _Priority Column"), null,
                                          Catalog.GetString("Show the priority column in the list"), null, true)
            });

            Tomboy.ActionManager.UI.InsertActionGroup(action_group, 0);

            menu_bar = CreateMenuBar();

            MakeTasksTree();
            tree.Show();

            // Update on changes to tasks
            TaskManager.TaskAdded         += OnTaskAdded;
            TaskManager.TaskDeleted       += OnTaskDeleted;
            TaskManager.TaskStatusChanged += OnTaskStatusChanged;

            tasks_sw                  = new Gtk.ScrolledWindow();
            tasks_sw.ShadowType       = Gtk.ShadowType.In;
            tasks_sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            tasks_sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;

            // Reign in the window size if there are notes with long
            // names, or a lot of notes...

            Gtk.Requisition tree_req = tree.SizeRequest();
            if (tree_req.Height > 420)
            {
                tasks_sw.HeightRequest = 420;
            }

            if (tree_req.Width > 480)
            {
                tasks_sw.WidthRequest = 480;
            }

            tasks_sw.Add(tree);
            tasks_sw.Show();

            task_count        = new Gtk.Label();
            task_count.Xalign = 0;
            task_count.Show();

            Gtk.HBox status_box = new Gtk.HBox(false, 8);
            status_box.PackStart(task_count, true, true, 0);
            status_box.Show();

            Gtk.VBox vbox = new Gtk.VBox(false, 8);
            vbox.BorderWidth = 6;
            vbox.PackStart(tasks_sw, true, true, 0);
            vbox.PackStart(status_box, false, false, 0);
            vbox.Show();

            // Use another VBox to place the MenuBar
            // right at thetop of the window.
            content_vbox = new Gtk.VBox(false, 0);
            content_vbox.PackStart(menu_bar, false, false, 0);
            content_vbox.PackStart(vbox, true, true, 0);
            content_vbox.Show();

            this.Add(content_vbox);
            this.DeleteEvent   += OnDelete;
            this.KeyPressEvent += OnKeyPressed;             // For Escape

            SetUpTreeModel();
        }
예제 #39
0
        public ProgressBarSample()
        {
            Gtk.HSeparator  separator;
            Gtk.Table       table;
            Gtk.Button      button;
            Gtk.CheckButton check;
            Gtk.VBox        vbox;

            //Application.Init ();

            /* Allocate memory for the data that is passed to the callbacks*/
            pdata = new ProgressData();
            pdata.activity_mode    = false;
            pdata.window           = new Gtk.Window(Gtk.WindowType.Toplevel);
            pdata.window.Resizable = true;

            pdata.window.DeleteEvent += destroy_progress;
            pdata.window.Title        = "GtkProgressBar";
            pdata.window.BorderWidth  = 0;

            vbox             = new Gtk.VBox(false, 5);
            vbox.BorderWidth = 10;
            pdata.window.Add(vbox);
            vbox.Show();

            /* Create a centering alignment object */
            Gtk.Alignment align = new Gtk.Alignment(1, 1, 0, 0);
            vbox.PackStart(align, false, false, 5);
            align.Show();

            /* Create the GtkProgressBar */
            pdata.pbar      = new Gtk.ProgressBar();
            pdata.pbar.Text = "";
            align.Add(pdata.pbar);
            pdata.pbar.Show();

            /* Add a timer callback to update the value of the progress bar*/
            pdata.timer = GLib.Timeout.Add(10000, new GLib.TimeoutHandler(progress_timeout));


            separator = new Gtk.HSeparator();
            vbox.PackStart(separator, false, false, 0);
            separator.Show();

            /* rows, columns, homogeneous */
            table = new Gtk.Table(2, 3, false);
            vbox.PackStart(table, false, true, 0);
            table.Show();

            /* Add a check button to select displaying of the trough text*/
            check = new Gtk.CheckButton("Query cada 1 minuto");
            table.Attach(check, 0, 1, 0, 1,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_show_text;
            check.Show();

            /* Add a check button to toggle activity mode */
            check = new Gtk.CheckButton("Activity mode");
            table.Attach(check, 0, 1, 1, 2,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_activity_mode;
            check.Active   = true;
            check.Show();

            /* Add a check button to toggle orientation */
            check = new Gtk.CheckButton("Right to Left");
            table.Attach(check, 0, 1, 2, 3,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_orientation;
            check.Show();

            /* Add a button to exit the program */
            button          = new Gtk.Button("close");
            button.Clicked += button_click;
            vbox.PackStart(button, false, false, 0);

            /* This makes it so the button is the default. */
            button.CanDefault = true;

            /* This grabs this button to be the default button. Simply hitting
             * the "Enter" key will cause this button to activate. */
            button.GrabDefault();
            button.Show();

            pdata.window.ShowAll();

            //Application.Run ();
        }
예제 #40
0
		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultHeight = 350;
			DefaultWidth = 500;
			VBox.Spacing = 0;

			VBox.PackStart (CreateExceptionHeader (), false, true, 0);

			var vbox = new VBox (false, 0);

			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.PackStart (CreateExceptionValueTreeView (), true, true, 0);
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.PackStart (CreateStackTraceTreeView (), true, true, 0);
			vbox.PackStart (CreateSeparator (), false, true, 0);
			vbox.Show ();

			VBox.PackStart (vbox, true, true, 0);

			var actionArea = new HBox (false, 12) { BorderWidth = 6 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.Show ();

			VBox.PackStart (actionArea, false, true, 0);
			ActionArea.Hide ();
		}
예제 #41
0
        public HIGMessageDialog(Gtk.Window parent,
					 Gtk.DialogFlags flags,
					 Gtk.MessageType type,
					 Gtk.ButtonsType buttons,
					 string          title,
					 string          header,
					 string          msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = false;
            Title = title;

            VBox.Spacing = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            accel_group = new Gtk.AccelGroup ();
            AddAccelGroup (accel_group);

            Gtk.HBox hbox = new Gtk.HBox (false, 12);
            hbox.BorderWidth = 5;
            hbox.Show ();
            VBox.PackStart (hbox, false, false, 0);

            Gtk.Image image = null;

            switch (type) {
            case Gtk.MessageType.Error:
                image = new Gtk.Image (Gtk.Stock.DialogError,
                               Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Question:
                image = new Gtk.Image (Gtk.Stock.DialogQuestion,
                               Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Info:
                image = new Gtk.Image (Gtk.Stock.DialogInfo,
                               Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Warning:
                image = new Gtk.Image (Gtk.Stock.DialogWarning,
                               Gtk.IconSize.Dialog);
                break;
            }

            image.Show ();
            image.Yalign = 0;
            hbox.PackStart (image, false, false, 0);

            label_vbox = new Gtk.VBox (false, 8);
            label_vbox.Show ();
            hbox.PackStart (label_vbox, true, true, 0);

            string message = String.Format ("<span weight='bold' size='larger'>{0}" +
                              "</span>\n",
                              header);

            Gtk.Label label;

            label = new Gtk.Label (message);
            label.UseMarkup = true;
            label.Justify = Gtk.Justification.Left;
            label.LineWrap = true;
            label.SetAlignment (0.0f, 0.5f);
            label.Show ();
            label_vbox.PackStart (label, false, false, 0);

            label = new Gtk.Label (msg);
            label.UseMarkup = true;
            label.Justify = Gtk.Justification.Left;
            label.LineWrap = true;
            label.SetAlignment (0.0f, 0.5f);
            label.Show ();
            label_vbox.PackStart (label, false, false, 0);

            switch (buttons) {
            case Gtk.ButtonsType.None:
                break;
            case Gtk.ButtonsType.Ok:
                AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            case Gtk.ButtonsType.Close:
                AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;
            case Gtk.ButtonsType.Cancel:
                AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;
            case Gtk.ButtonsType.YesNo:
                AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;
            case Gtk.ButtonsType.OkCancel:
                AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
                TransientFor = parent;

            if ((int) (flags & Gtk.DialogFlags.Modal) != 0)
                Modal = true;

            if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
                DestroyWithParent = true;
        }
예제 #42
0
        // TODO: Possible to make Tomboy not crash if quit while dialog is up?
        public SyncDialog()
            : base(string.Empty,
                   null,
                   Gtk.DialogFlags.DestroyWithParent)
        {
            progressBarTimeoutId = 0;

            SetSizeRequest(400, -1);
            HasSeparator = false;

            // Outer box. Surrounds all of our content.
            VBox outerVBox = new VBox(false, 12);

            outerVBox.BorderWidth = 6;
            outerVBox.Show();
            VBox.PackStart(outerVBox, true, true, 0);

            // Top image and label
            HBox hbox = new HBox(false, 12);

            hbox.Show();
            outerVBox.PackStart(hbox, false, false, 0);

            image        = new Image(GuiUtils.GetIcon("tomboy", 48));
            image.Xalign = 0;
            image.Yalign = 0;
            image.Show();
            hbox.PackStart(image, false, false, 0);

            // Label header and message
            VBox vbox = new VBox(false, 6);

            vbox.Show();
            hbox.PackStart(vbox, true, true, 0);

            headerLabel              = new Label();
            headerLabel.UseMarkup    = true;
            headerLabel.Xalign       = 0;
            headerLabel.UseUnderline = false;
            headerLabel.LineWrap     = true;
            headerLabel.Show();
            vbox.PackStart(headerLabel, false, false, 0);

            messageLabel              = new Label();
            messageLabel.Xalign       = 0;
            messageLabel.UseUnderline = false;
            messageLabel.LineWrap     = true;
            messageLabel.SetSizeRequest(250, -1);
            messageLabel.Show();
            vbox.PackStart(messageLabel, false, false, 0);

            progressBar                = new Gtk.ProgressBar();
            progressBar.Orientation    = Gtk.ProgressBarOrientation.LeftToRight;
            progressBar.BarStyle       = ProgressBarStyle.Continuous;
            progressBar.ActivityBlocks = 30;
            progressBar.Show();
            outerVBox.PackStart(progressBar, false, false, 0);

            progressLabel              = new Label();
            progressLabel.UseMarkup    = true;
            progressLabel.Xalign       = 0;
            progressLabel.UseUnderline = false;
            progressLabel.LineWrap     = true;
            progressLabel.Wrap         = true;
            progressLabel.Show();
            outerVBox.PackStart(progressLabel, false, false, 0);

            // Expander containing TreeView
            expander            = new Gtk.Expander(Catalog.GetString("Details"));
            expander.Spacing    = 6;
            expander.Activated += OnExpanderActivated;
            expander.Show();
            outerVBox.PackStart(expander, true, true, 0);

            // Contents of expander
            Gtk.VBox expandVBox = new Gtk.VBox();
            expandVBox.Show();
            expander.Add(expandVBox);

            // Scrolled window around TreeView
            Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow();
            scrolledWindow.ShadowType = Gtk.ShadowType.In;
            scrolledWindow.SetSizeRequest(-1, 200);
            scrolledWindow.Show();
            expandVBox.PackStart(scrolledWindow, true, true, 0);

            // Create model for TreeView
            model = new Gtk.TreeStore(typeof(string), typeof(string));

            // Create TreeView, attach model
            Gtk.TreeView treeView = new Gtk.TreeView();
            treeView.Model         = model;
            treeView.RowActivated += OnRowActivated;
            treeView.Show();
            scrolledWindow.Add(treeView);

            // Set up TreeViewColumns
            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn(
                Catalog.GetString("Note Title"),
                new Gtk.CellRendererText(), "text", 0);
            column.SortColumnId = 0;
            column.Resizable    = true;
            treeView.AppendColumn(column);

            column = new Gtk.TreeViewColumn(
                Catalog.GetString("Status"),
                new Gtk.CellRendererText(), "text", 1);
            column.SortColumnId = 1;
            column.Resizable    = true;
            treeView.AppendColumn(column);

            // Button to close dialog.
            closeButton           = (Gtk.Button)AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);
            closeButton.Sensitive = false;
        }
예제 #43
0
        private void BuildPrimaryLayout ()
        {
            primary_vbox = new VBox ();

            BuildHeader ();
            BuildViews ();
            BuildFooter ();

            search_entry_align = new Alignment (1.0f, 0.5f, 0f, 0f);
            var box = new HBox () { Spacing = 2 };
            var grabber = new GrabHandle ();
            grabber.ControlWidthOf (view_container.SearchEntry, 150, 350, false);
            box.PackStart (grabber, false, false, 0);
            box.PackStart (view_container.SearchEntry, false, false, 0);
            search_entry_align.Child = box;

            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SearchEntry", search_entry_align);
            search_entry_align.Visible = view_container.SearchSensitive = true;
            search_entry_align.ShowAll ();

            primary_vbox.Show ();
            Add (primary_vbox);
        }
        public void LoadWidgets(ProjectBackend project)
        {
            if (project == null)
            {
                box.Hide();
                return;
            }

            box.Show();

            foreach (PaletteGroup g in groups.Values)
            {
                box.Remove(g);
                g.Destroy();
            }

            groups.Clear();

            foreach (string[] grp in visibleGroups)
            {
                AddOrGetGroup(grp[0], grp[1]);
            }

            ArrayList classes = new ArrayList();

            if (libraries == null)
            {
                foreach (ClassDescriptor klass in Registry.AllClasses)
                {
                    if (klass.SupportsGtkVersion(project.TargetGtkVersion))
                    {
                        classes.Add(klass);
                    }
                }
            }
            else if (project != null)
            {
                foreach (WidgetLibrary lib in libraries)
                {
                    bool isInternalLib = project.IsInternalLibrary(lib.Name);
                    foreach (ClassDescriptor cd in lib.AllClasses)
                    {
                        if (!cd.Deprecated && cd.Category.Length > 0 && (isInternalLib || !cd.IsInternal) && cd.SupportsGtkVersion(project.TargetGtkVersion))
                        {
                            classes.Add(cd);
                        }
                    }
                }
            }

            classes.Sort(this);

            foreach (ClassDescriptor klass in classes)
            {
                if (!groups.Contains(klass.Category))
                {
                    continue;
                }

                WidgetFactory factory;
                if (klass.Category == "window")
                {
                    factory = new WindowFactory(project, klass);
                }
                else
                {
                    factory = new WidgetFactory(project, klass);
                }

                AddOrGetGroup(klass.Category).Append(factory);
            }

            if (localActionsBox != null)
            {
                localActionsBox.Destroy();
            }
            if (globalActionsBox != null)
            {
                globalActionsBox.Destroy();
            }

            PaletteGroup widgetGroup = AddOrGetGroup("actions", Catalog.GetString("Actions"));

            localActionsBox  = new ActionGroupBox();
            globalActionsBox = new ActionGroupBox();
            widgetGroup.Append(localActionsBox);
            widgetGroup.Append(globalActionsBox);

            if (project != null)
            {
                widgetGroup.Sensitive = true;
                localActionsBox.SetActionGroups(selection != null ? selection.LocalActionGroups : null);
                globalActionsBox.SetActionGroups(project.ActionGroups);
            }
            else
            {
                widgetGroup.Sensitive = false;
                localActionsBox.SetActionGroups(null);
                globalActionsBox.SetActionGroups(null);
            }

            // This is a workaround. In looks like the palette is not correctly
            // redrawn if it is rebuilt while it is not visible (the dock is hidden in MD).
            GLib.Idle.Add(delegate
            {
                ShowAll();
                return(false);
            });
        }
예제 #45
0
		// TODO: Possible to make Tomboy not crash if quit while dialog is up?
		public SyncDialog ()
: base (string.Empty,
		        null,
		        Gtk.DialogFlags.DestroyWithParent)
		{
			progressBarTimeoutId = 0;

			SetSizeRequest (400, -1);
			HasSeparator = false;

			// Outer box. Surrounds all of our content.
			VBox outerVBox = new VBox (false, 12);
			outerVBox.BorderWidth = 6;
			outerVBox.Show ();
			VBox.PackStart (outerVBox, true, true, 0);

			// Top image and label
			HBox hbox = new HBox (false, 12);
			hbox.Show ();
			outerVBox.PackStart (hbox, false, false, 0);

			image = new Image (GuiUtils.GetIcon ("tomboy", 48));
			image.Xalign = 0;
			image.Yalign = 0;
			image.Show ();
			hbox.PackStart (image, false, false, 0);

			// Label header and message
			VBox vbox = new VBox (false, 6);
			vbox.Show ();
			hbox.PackStart (vbox, true, true, 0);

			headerLabel = new Label ();
			headerLabel.UseMarkup = true;
			headerLabel.Xalign = 0;
			headerLabel.UseUnderline = false;
			headerLabel.LineWrap = true;
			headerLabel.Show ();
			vbox.PackStart (headerLabel, false, false, 0);

			messageLabel = new Label ();
			messageLabel.Xalign = 0;
			messageLabel.UseUnderline = false;
			messageLabel.LineWrap = true;
			messageLabel.SetSizeRequest (250, -1);
			messageLabel.Show ();
			vbox.PackStart (messageLabel, false, false, 0);

			progressBar = new Gtk.ProgressBar ();
			progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight;
			progressBar.BarStyle = ProgressBarStyle.Continuous;
			progressBar.ActivityBlocks = 30;
			progressBar.Show ();
			outerVBox.PackStart (progressBar, false, false, 0);

			progressLabel = new Label ();
			progressLabel.UseMarkup = true;
			progressLabel.Xalign = 0;
			progressLabel.UseUnderline = false;
			progressLabel.LineWrap = true;
			progressLabel.Wrap = true;
			progressLabel.Show ();
			outerVBox.PackStart (progressLabel, false, false, 0);

			// Expander containing TreeView
			expander = new Gtk.Expander (Catalog.GetString ("Details"));
			expander.Spacing = 6;
			expander.Activated += OnExpanderActivated;
			expander.Show ();
			outerVBox.PackStart (expander, true, true, 0);

			// Contents of expander
			Gtk.VBox expandVBox = new Gtk.VBox ();
			expandVBox.Show ();
			expander.Add (expandVBox);

			// Scrolled window around TreeView
			Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow ();
			scrolledWindow.ShadowType = Gtk.ShadowType.In;
			scrolledWindow.SetSizeRequest (-1, 200);
			scrolledWindow.Show ();
			expandVBox.PackStart (scrolledWindow, true, true, 0);

			// Create model for TreeView
			model = new Gtk.TreeStore (typeof (string), typeof (string));

			// Create TreeView, attach model
			Gtk.TreeView treeView = new Gtk.TreeView ();
			treeView.Model = model;
			treeView.RowActivated += OnRowActivated;
			treeView.Show ();
			scrolledWindow.Add (treeView);

			// Set up TreeViewColumns
			Gtk.TreeViewColumn column = new Gtk.TreeViewColumn (
			        Catalog.GetString ("Note Title"),
			        new Gtk.CellRendererText (), "text", 0);
			column.SortColumnId = 0;
			column.Resizable = true;
			treeView.AppendColumn (column);

			column = new Gtk.TreeViewColumn (
			        Catalog.GetString ("Status"),
			        new Gtk.CellRendererText (), "text", 1);
			column.SortColumnId = 1;
			column.Resizable = true;
			treeView.AppendColumn (column);

			// Button to close dialog.
			closeButton = (Gtk.Button) AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close);
			closeButton.Sensitive = false;
		}
예제 #46
0
public SyncTitleConflictDialog (Note existingNote, IList<string> noteUpdateTitles) :
		base (Catalog.GetString ("Note Conflict"), null, Gtk.DialogFlags.Modal)
		{
			this.existingNote = existingNote;
			this.noteUpdateTitles = noteUpdateTitles;

			// Suggest renaming note by appending " (old)" to the existing title
			string suggestedRenameBase = existingNote.Title + Catalog.GetString (" (old)");
			string suggestedRename = suggestedRenameBase;
			for (int i = 1; !IsNoteTitleAvailable (suggestedRename); i++)
				suggestedRename = suggestedRenameBase + " " + i.ToString();

			VBox outerVBox = new VBox (false, 12);
			outerVBox.BorderWidth = 12;
			outerVBox.Spacing = 8;

			HBox hbox = new HBox (false, 8);
			Image image = new Image (GuiUtils.GetIcon (Gtk.Stock.DialogWarning, 48)); // TODO: Is this the right icon?
			image.Show ();
			hbox.PackStart (image, false, false, 0);

			VBox vbox = new VBox (false, 8);

			headerLabel = new Label ();
			headerLabel.UseMarkup = true;
			headerLabel.Xalign = 0;
			headerLabel.UseUnderline = false;
			headerLabel.Show ();
			vbox.PackStart (headerLabel, false, false, 0);

			messageLabel = new Label ();
			messageLabel.Xalign = 0;
			messageLabel.UseUnderline = false;
			messageLabel.LineWrap = true;
			messageLabel.Wrap = true;
			messageLabel.Show ();
			vbox.PackStart (messageLabel, false, false, 0);

			vbox.Show ();
			hbox.PackStart (vbox, true, true, 0);

			hbox.Show ();
			outerVBox.PackStart (hbox);
			VBox.PackStart (outerVBox);

			Gtk.HBox renameHBox = new Gtk.HBox ();
			renameRadio = new Gtk.RadioButton (Catalog.GetString ("Rename local note:"));
			renameRadio.Toggled += radio_Toggled;
			Gtk.VBox renameOptionsVBox = new Gtk.VBox ();

			renameEntry = new Gtk.Entry (suggestedRename);
			renameEntry.Changed += renameEntry_Changed;
			renameUpdateCheck = new Gtk.CheckButton (Catalog.GetString ("Update links in referencing notes"));
			renameOptionsVBox.PackStart (renameEntry);
			//renameOptionsVBox.PackStart (renameUpdateCheck); // This seems like a superfluous option
			renameHBox.PackStart (renameRadio);
			renameHBox.PackStart (renameOptionsVBox);
			VBox.PackStart (renameHBox);

			deleteExistingRadio = new Gtk.RadioButton (renameRadio, Catalog.GetString ("Overwrite local note"));
			deleteExistingRadio.Toggled += radio_Toggled;
			VBox.PackStart (deleteExistingRadio);

			alwaysDoThisCheck = new Gtk.CheckButton (Catalog.GetString ("Always perform this action"));
			VBox.PackStart (alwaysDoThisCheck);

			continueButton = (Gtk.Button) AddButton (Gtk.Stock.GoForward, Gtk.ResponseType.Accept);

			// Set initial dialog text
			HeaderText = Catalog.GetString ("Note conflict detected");
			MessageText = string.Format (Catalog.GetString ("The server version of \"{0}\" conflicts with your local note."
			                             + "  What do you want to do with your local note?"),
			                             existingNote.Title);

			ShowAll ();
		}
예제 #47
0
파일: Util.cs 프로젝트: MrJoe/lat
        public HIGMessageDialog(Gtk.Window parent,
                                Gtk.DialogFlags flags,
                                Gtk.MessageType type,
                                Gtk.ButtonsType buttons,
                                string header,
                                string msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth  = 5;
            Resizable    = false;
            Title        = "";

            VBox.Spacing      = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            accel_group = new Gtk.AccelGroup();
            AddAccelGroup(accel_group);

            Gtk.HBox hbox = new Gtk.HBox(false, 12);
            hbox.BorderWidth = 5;
            hbox.Show();
            VBox.PackStart(hbox, false, false, 0);

            Gtk.Image image = null;

            switch (type)
            {
            case Gtk.MessageType.Error:
                image = new Gtk.Image(Gtk.Stock.DialogError,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Question:
                image = new Gtk.Image(Gtk.Stock.DialogQuestion,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Info:
                image = new Gtk.Image(Gtk.Stock.DialogInfo,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Warning:
                image = new Gtk.Image(Gtk.Stock.DialogWarning,
                                      Gtk.IconSize.Dialog);
                break;
            }

            image.Show();
            hbox.PackStart(image, false, false, 0);

            Gtk.VBox label_vbox = new Gtk.VBox(false, 0);
            label_vbox.Show();
            hbox.PackStart(label_vbox, true, true, 0);

            string title = String.Format("<span weight='bold' size='larger'>{0}" +
                                         "</span>\n",
                                         header);

            Gtk.Label label;

            label           = new Gtk.Label(title);
            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            label           = new Gtk.Label(msg);
            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            switch (buttons)
            {
            case Gtk.ButtonsType.None:
                break;

            case Gtk.ButtonsType.Ok:
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;

            case Gtk.ButtonsType.Close:
                AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;

            case Gtk.ButtonsType.Cancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;

            case Gtk.ButtonsType.YesNo:
                AddButton(Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton(Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;

            case Gtk.ButtonsType.OkCancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
            {
                TransientFor = parent;
            }

            if ((int)(flags & Gtk.DialogFlags.Modal) != 0)
            {
                Modal = true;
            }

            if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0)
            {
                DestroyWithParent = true;
            }
        }
예제 #48
0
 void on_radiobutton_dist_different_toggled(object o, EventArgs args)
 {
     hbox_distance_fixed.Hide();
     vbox_distance_variable.Show();
     combo_distance_different_tracks.Sensitive = true;
 }