private void InitializeForm(long?prodId)
        {
            Image icon = FormHelper.LoadImage("Icons.Production32.png");

            evbIcon.Add(icon);
            icon.Show();

            LocationVisible              = true;
            UserVisible                  = true;
            DateVisible                  = true;
            GridDescriptionVisible       = true;
            SecondGridDescriptionVisible = true;
            SecondGridVisible            = true;
            btnImport.Visible            = BusinessDomain.DataImporters.Count > 0;

            btnLoadRecipe          = new PictureButton();
            btnLoadRecipe.Clicked += btnLoadRecipe_Clicked;
            btnLoadRecipe.SetImage(FormHelper.LoadImage("Icons.RecipeLoad24.png"));
            btnLoadRecipe.SetText(Translator.GetString("Load Recipe"));
            vbxAdditionalButtons.PackStart(btnLoadRecipe, false, true, 0);

            btnSaveRecipe          = new PictureButton();
            btnSaveRecipe.Clicked += btnSaveRecipe_Clicked;
            btnSaveRecipe.SetImage(FormHelper.LoadImage("Icons.RecipeSave24.png"));
            btnSaveRecipe.SetText(Translator.GetString("Save Recipe"));
            vbxAdditionalButtons.PackStart(btnSaveRecipe, false, true, 0);
            algAdditionalButtons.ShowAll();

            highlight = new PangoStyle {
                Color = Colors.Blue
            };

            ReInitializeForm(prodId);
        }
Beispiel #2
0
		public Tile (Hit hit, Query query) : base ()
		{
			base.AboveChild = true;
			base.AppPaintable = true;
			base.CanFocus = true;

			this.hit = hit;
			this.query = query;
			this.timestamp = hit.Timestamp;
			this.score = hit.Score;

			Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targets,
					    Gdk.DragAction.Copy | Gdk.DragAction.Move);

			int pad = (int)StyleGetProperty ("focus-line-width") + (int)StyleGetProperty ("focus-padding") + 1;

			hbox = new Gtk.HBox (false, 5);
			hbox.BorderWidth = (uint)(pad + Style.Xthickness);
			hbox.Show ();

			icon = new Gtk.Image ();
			icon.Show ();
			hbox.PackStart (icon, false, false, 0);

			Add (hbox);
		}
Beispiel #3
0
	private void ShowField(Field field) {
		FieldRenderer renderer = new FieldRenderer(field, null);
		FieldRegion region = new FieldRegion();
		Pixbuf pixbuf;

		region.Left = region.Bottom = 0;
		region.Top = field.Height - 1;
		region.Right = field.Width - 1;
		pixbuf = renderer.RenderToPixbuf(region, null);

		if (pixbuf.Width > DEFAULT_WIDTH || pixbuf.Height > DEFAULT_HEIGHT) {
			int w, h;

			CalculateOptimalDimensions(pixbuf, out w, out h);
			pixbuf = pixbuf.ScaleSimple(w, h, InterpType.Tiles);
		}

		if (image == null) {
			image = new Gtk.Image(pixbuf);
			image.Show();
			Add(image);
		} else {
			image.Pixbuf = pixbuf;
		}
	}
Beispiel #4
0
        public PlayPauseButton(string playXPM, string pauseXPM)
        {
            _paused = true;
            _playImage = new Pixbuf(playXPM);
            _pauseImage = new Pixbuf(pauseXPM);

            _image = new Gtk.Image();
            _image.Pixbuf = _playImage;

            Add(_image);
            _image.Show();

            this.ButtonPressEvent+=	 delegate(object o, ButtonPressEventArgs args) {
                if (_paused)
                    _image.Pixbuf = _pauseImage;
                else
                    _image.Pixbuf = _playImage;

                _paused = !_paused;

                if (Clicked != null)
                    Clicked(this, new PlayPauseButtonEventArgs(){ IsPaused = _paused });
            };

            this.WidthRequest = _image.Pixbuf.Width;
        }
Beispiel #5
0
        protected override void InitializeForm()
        {
            base.InitializeForm();

            Image icon = FormHelper.LoadImage("Icons.Goods16.png");

            dlgChooseEdit.Icon = icon.Pixbuf;
            icon.Show();

            icon = FormHelper.LoadImage("Icons.Goods32.png");
            algDialogIcon.Add(icon);
            icon.Show();

            tblFilter.Remove(btnClear);
            tblFilter.Attach(btnClear, 3, 4, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            chkAvailable          = new CheckButton(Translator.GetString("Only available"));
            chkAvailable.Toggled += chkAvailable_Toggled;
            tblFilter.Attach(chkAvailable, 2, 3, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            tblFilter.ShowAll();

            newAllowed          = BusinessDomain.RestrictionTree.GetRestriction("mnuEditGoodsbtnNew") == UserRestrictionState.Allowed;
            editAllowed         = BusinessDomain.RestrictionTree.GetRestriction("mnuEditGoodsbtnEdit") == UserRestrictionState.Allowed;
            deleteAllowed       = BusinessDomain.RestrictionTree.GetRestriction("mnuEditGoodsbtnDelete") == UserRestrictionState.Allowed;
            btnImport.Sensitive = BusinessDomain.RestrictionTree.GetRestriction("mnuEditGoodsbtnImport") == UserRestrictionState.Allowed;
            btnExport.Sensitive = BusinessDomain.RestrictionTree.GetRestriction("mnuEditGoodsbtnExport") == UserRestrictionState.Allowed;
            btnImport.Visible   = BusinessDomain.DataImporters.Count > 0;
            btnExport.Visible   = BusinessDomain.DataExporters.Count > 0;

            btnLocation.Visible  = !BusinessDomain.LoggedUser.HideItemsAvailability;
            btnLocation.Clicked += btnLocation_Clicked;

            dlgChooseEdit.WidthRequest  = 800;
            dlgChooseEdit.HeightRequest = 480;

            InitializeFormStrings();
            InitializeGrid();

            if (Location.TryGetLocked(ref location))
            {
                btnLocation.Sensitive = false;
            }

            ShowLocationAvailability();
            btnGroups_Toggled(null, null);
        }
        private static bool SetChildImage(Widget mainWidget, Image image, int currentDepth, string childWidgetName)
        {
            bool ret = false;

            if (mainWidget is Image && (childWidgetName == string.Empty || childWidgetName == mainWidget.Name))
            {
                SetImage((Image)mainWidget, image);
                ret = true;
            }
            else if (currentDepth > 0)
            {
                if (mainWidget is Container)
                {
                    Container cont = mainWidget as Container;
                    --currentDepth;
                    if (cont.Children.Length == 0)
                    {
                        cont.Add(image);
                        image.Show();
                        ret = true;
                    }
                    else if (cont.Children.Length == 1 && cont.Children [0] is Image)
                    {
                        cont.Remove(cont.Children [0]);
                        cont.Add(image);
                        image.Show();
                        ret = true;
                    }
                    else
                    {
                        foreach (Widget child in cont.Children)
                        {
                            ret = SetChildImage(child, image, currentDepth, childWidgetName);
                            if (ret)
                            {
                                break;
                            }
                        }
                    }
                }
            }

            return(ret);
        }
        public ToolBarButton(string image, string label, string tooltip) : base(null, label)
        {
            Gtk.Image i = new Gtk.Image(GetIcon(image));
            i.Show();
            this.IconWidget = i;

            TooltipText = tooltip;

            Show();
        }
Beispiel #8
0
            public CommandMapButton(string category_name, Gtk.Action action) : this(category_name)
            {
                action.ConnectProxy(this);

                TooltipText   = action.Label;
                Label         = action.Label;
                Image         = new Gtk.Image(action.StockId, IconSize.Button);
                ImagePosition = PositionType.Top;
                Image.Show();
            }
        public ToolBarButton(string image, string label, string tooltip)
            : base(null, label)
        {
            Gtk.Image i = new Gtk.Image ( GetIcon (image));
            i.Show ();
            this.IconWidget = i;

            TooltipText = tooltip;

            Show ();
        }
		public ActionMenuItem (TileAction action) : base (action.Name)
		{
			this.action_delegate = action.Action;

			if (action.Stock != null) {
				Gtk.Image image = new Gtk.Image ();
				image.SetFromStock (action.Stock, IconSize.Menu);
				image.Show ();
				this.Image = image;
			}
		}
Beispiel #11
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        radioButtons.Add(this.radTest1);
        radioButtons.Add(this.radTest2);
        radioButtons.Add(this.radiobutton1);
        radioButtons.Add(this.radiobutton2);

        string uiaQaPath = UiaAtkBridgeTest.Misc.LookForParentDir("*.gif");

        Gtk.Image img1 = new Gtk.Image();
        img1.File = System.IO.Path.Combine(uiaQaPath, "opensuse60x38.gif");
        img1.Show();
        this.btnWithImg.Image = img1;

        Gtk.Image img2 = new Gtk.Image();
        img2.File = System.IO.Path.Combine(uiaQaPath, "soccerball.gif");
        img2.Show();
        this.checkbutton1.Image = img2;

        Gtk.Image img3 = new Gtk.Image();
        img3.File = System.IO.Path.Combine(uiaQaPath, "apple-red.png");
        img3.Show();
        this.radTest2.Image = img3;

        this.imgTest1.File = System.IO.Path.Combine(uiaQaPath, "goalie.gif");

        this.imgTest2.File = System.IO.Path.Combine(uiaQaPath, "apple-red.png");

        this.maskedEntry.Visibility = false;


        this.hscrollbar1.Adjustment.Lower         = 0;   //Value tested in AtkTester.InterfaceValue
        this.hscrollbar1.Adjustment.Upper         = 100; //Value tested in AtkTester.InterfaceValue
        this.hscrollbar1.Adjustment.PageSize      = 1;
        this.hscrollbar1.Adjustment.StepIncrement = 1;

        this.vscrollbar1.Adjustment.Lower         = 0;   //Value tested in AtkTester.InterfaceValue
        this.vscrollbar1.Adjustment.Upper         = 100; //Value tested in AtkTester.InterfaceValue
        this.vscrollbar1.Adjustment.PageSize      = 1;
        this.vscrollbar1.Adjustment.StepIncrement = 1;

        //Used when testing Atk.Action.GetKeybinding
        this.btnWithImg.UseUnderline = true;
        this.btnTest1.UseUnderline   = true;

        this.WindowPosition = WindowPosition.CenterAlways;

        Gtk.ToolItem item = new Gtk.ToolItem();
        item.Add(new Gtk.Entry("TEST TEXT"));
        this.toolbar1.Insert(item, 3);
        this.toolbar1.ShowAll();
    }
Beispiel #12
0
	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{
		Build ();
		
		radioButtons.Add (this.radTest1);
		radioButtons.Add (this.radTest2);
		radioButtons.Add (this.radiobutton1);
		radioButtons.Add (this.radiobutton2);
		
		string uiaQaPath = UiaAtkBridgeTest.Misc.LookForParentDir ("*.gif");
		Gtk.Image img1 = new Gtk.Image ();
		img1.File = System.IO.Path.Combine (uiaQaPath, "opensuse60x38.gif");
		img1.Show ();
		this.btnWithImg.Image = img1;
		
		Gtk.Image img2 = new Gtk.Image ();
		img2.File = System.IO.Path.Combine (uiaQaPath, "soccerball.gif");
		img2.Show ();
		this.checkbutton1.Image = img2;

		Gtk.Image img3 = new Gtk.Image ();
		img3.File = System.IO.Path.Combine (uiaQaPath, "apple-red.png");
		img3.Show ();
		this.radTest2.Image = img3;

		this.imgTest1.File = System.IO.Path.Combine (uiaQaPath, "goalie.gif");

		this.imgTest2.File = System.IO.Path.Combine (uiaQaPath, "apple-red.png");

		this.maskedEntry.Visibility = false;

		 
		this.hscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue
		this.hscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue
		this.hscrollbar1.Adjustment.PageSize = 1;
		this.hscrollbar1.Adjustment.StepIncrement = 1;

		this.vscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue
		this.vscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue
		this.vscrollbar1.Adjustment.PageSize = 1;
		this.vscrollbar1.Adjustment.StepIncrement = 1;

		//Used when testing Atk.Action.GetKeybinding
		this.btnWithImg.UseUnderline = true;
		this.btnTest1.UseUnderline = true;

		this.WindowPosition = WindowPosition.CenterAlways;

		Gtk.ToolItem item = new Gtk.ToolItem ();
		item.Add (new Gtk.Entry ("TEST TEXT"));
		this.toolbar1.Insert (item, 3);
		this.toolbar1.ShowAll ();
	}
Beispiel #13
0
        public ActionMenuItem(TileAction action) : base(action.Name)
        {
            this.action_delegate = action.Action;

            if (action.Stock != null)
            {
                Gtk.Image image = new Gtk.Image();
                image.SetFromStock(action.Stock, IconSize.Menu);
                image.Show();
                this.Image = image;
            }
        }
        protected virtual void InitializeForm()
        {
            XML form = FormHelper.LoadGladeXML("WbpPrintPreview.glade", "hboPrintPreviewRoot");

            form.Autoconnect(this);

            btnSave.SetChildImage(FormHelper.LoadImage("Icons.Ok24.png"));
            btnClose.SetChildImage(FormHelper.LoadImage("Icons.Cancel24.png"));
            btnPrint.SetChildImage(FormHelper.LoadImage("Icons.Print24.png"));
            tcPages = new SizeChooser(maxAutoColumns, maxAutoRows,
                                      DataHelper.ResourcesAssembly,
                                      FormHelper.GetResourceName("Icons.Page24.png"));
            tcPages.SizeChanged += tcPages_SizeChanged;
            algPages.Add(tcPages);

            btnDocumentDesigner.SetChildImage(FormHelper.LoadImage("Icons.DesignDoc24.png"));
            btnExport.SetChildImage(FormHelper.LoadImage("Icons.Export24.png"));

            Image icon = FormHelper.LoadImage("Icons.Report32.png");

            algPrintPreviewIcon.Add(icon);
            icon.Show();

            Add(hboPrintPreviewRoot);
            hboPrintPreviewRoot.KeyPressEvent += WbpPrintPreview_KeyPressEvent;
            OuterKeyPressed += WbpPrintPreview_KeyPressEvent;

            cboZoom.Changed         += cboZoom_Changed;
            spbPage.ValueChanged    += spbPage_Changed;
            spbPage.Adjustment.Lower = 1d;

            CreatePreview();
            algPrintPreview.Add(currentPreview);

            hboPrintPreviewRoot.ShowAll();

            btnPrint.Sensitive          = BusinessDomain.AppConfiguration.IsPrinterAvailable(Printer);
            btnExport.Visible           = BusinessDomain.DocumentExporters.Count > 0;
            btnSave.Visible             = false;
            btnDocumentDesigner.Visible = documentDesigner != null;

            tbtnPortrait.Toggled -= tbtnPortrait_Toggled;
            tbtnLandscape.Active  = BusinessDomain.AppConfiguration.IsPrinterAvailable(Printer) && PrintDocument.FormToPrint.Landscape;

            tbtnPortrait.Active   = !tbtnLandscape.Active;
            tbtnPortrait.Toggled += tbtnPortrait_Toggled;

            tbtnPortrait.Image  = FormHelper.LoadImage("Icons.Portrait.png");
            tbtnLandscape.Image = FormHelper.LoadImage("Icons.Landscape.png");

            InitializeStrings();
        }
Beispiel #15
0
 public SplashScreenForm()
     : base(Gtk.WindowType.Popup)
 {
     this.Decorated = false;
         this.WindowPosition = WindowPosition.Center;
         this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
         Gdk.Pixbuf bitmap = new Gdk.Pixbuf(Assembly.GetEntryAssembly(), "lifelets.jpg");
         DefaultWidth = bitmap.Width;
         DefaultHeight = bitmap.Height;
         Gtk.Image image = new Gtk.Image (bitmap);
         image.Show ();
         this.Add (image);
 }
Beispiel #16
0
    void on_entries_required_changed(object o, EventArgs args)
    {
        bool allOk = true;

        if (UtilGtk.ComboGetActive(combo_test_types) != Catalog.GetString(Constants.UndefinedDefault))
        {
            image_test_type.Hide();
            combo_tests.Sensitive     = true;
            combo_variables.Sensitive = true;
        }
        else
        {
            image_test_type.Show();
            combo_tests.Sensitive     = false;
            combo_variables.Sensitive = false;
            allOk = false;
        }

        //a continent cannot be searched without selecting the country
        if (UtilGtk.ComboGetActive(combo_continents) == Catalog.GetString(Constants.Any))
        {
            combo_countries.Sensitive = false;
            image_country.Hide();
        }
        else
        {
            combo_countries.Sensitive = true;
            if (UtilGtk.ComboGetActive(combo_countries) == Catalog.GetString(Constants.UndefinedDefault))
            {
                image_country.Show();
                allOk = false;
            }
            else
            {
                image_country.Hide();
            }
        }


        if (allOk)
        {
            textViewUpdate(sqlBuildSelect(false));
            button_search.Sensitive = true;
        }
        else
        {
            textViewUpdate("");
            button_search.Sensitive = false;
        }
    }
Beispiel #17
0
 void LoadImage(Stream s)
 {
     using (s) {
         Gdk.PixbufLoader loader = new Gdk.PixbufLoader(s);
         Gdk.Pixbuf       pix    = image.Pixbuf = loader.Pixbuf;
         loader.Dispose();
         if (pix.Width > 250)
         {
             Gdk.Pixbuf spix = pix.ScaleSimple(250, (250 * pix.Height) / pix.Width, Gdk.InterpType.Hyper);
             pix.Dispose();
             pix = spix;
         }
         image.Pixbuf = pix;
         image.Show();
     }
 }
Beispiel #18
0
        private Gtk.Button StockButton(string stockid, string label)
        {
            Gtk.HBox button_contents = new HBox(false, 0);
            button_contents.Show();
            Gtk.Widget button_image = new Gtk.Image(stockid, Gtk.IconSize.Button);
            button_image.Show();
            button_contents.PackStart(button_image, false, false, 1);
            Gtk.Label button_label = new Gtk.Label(label);
            button_label.Show();
            button_contents.PackStart(button_label, false, false, 1);

            Gtk.Button button = new Gtk.Button();
            button.Add(button_contents);

            return(button);
        }
Beispiel #19
0
    private void initialize(string title, Constants.MessageTypes type, string message)
    {
        LogB.Information("Dialog message: " + message);

        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_message.glade", "dialog_message", "chronojump");
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(dialog_message);

        //with this, user doesn't see a moving/changing creation window
        //if uncommented, then does weird bug in windows not showing dialog as its correct size until window is moves
        //dialog_message.Hide();

        if (title != "")
        {
            dialog_message.Title = title;
        }

        label_message.Text      = message;
        label_message.UseMarkup = true;

        switch (type)
        {
        case Constants.MessageTypes.WARNING:
            image_warning.Show();
            image_info.Hide();
            image_help.Hide();
            break;

        case Constants.MessageTypes.INFO:
            image_warning.Hide();
            image_info.Show();
            image_help.Hide();
            break;

        case Constants.MessageTypes.HELP:
            image_warning.Hide();
            image_info.Hide();
            image_help.Show();
            break;
        }

        label_message.Show();
        dialog_message.Show();
    }
Beispiel #20
0
    private void on_button_send_log_clicked(object o, EventArgs args)
    {
        string email = entry_send_log.Text.ToString();

        //email can be validated with Util.IsValidEmail(string)
        //or other methods, but maybe there's no need of complexity now

        //1st save email on sqlite
        if (email != null && email != "" && email != "0" && email != emailStored)
        {
            SqlitePreferences.Update("email", email, false);
        }

        //2nd add language as comments
        string language = get_send_log_language();

        SqlitePreferences.Update("crashLogLanguage", language, false);
        string comments = "Answer in: " + language + "\n";

        //3rd if there are comments, add them at the beginning of the file
        comments += textview_comments.Buffer.Text;

        //4th send Json
        Json js      = new Json();
        bool success = js.PostCrashLog(email, comments);

        if (success)
        {
            button_send_log.Label     = Catalog.GetString("Thanks");
            button_send_log.Sensitive = false;

            image_send_log_yes.Show();
            image_send_log_no.Hide();
            LogB.Information(js.ResultMessage);
        }
        else
        {
            button_send_log.Label = Catalog.GetString("Try again");

            image_send_log_yes.Hide();
            image_send_log_no.Show();
            LogB.Error(js.ResultMessage);
        }

        label_send_log_message.Text = js.ResultMessage;
    }
Beispiel #21
0
        public void Append(string tip)
        {
            uint row = table.NRows;

            Gtk.Image image = new Gtk.Image(arrow);
            image.Show();
            table.Attach(image, 0, 1, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            Gtk.Label label = new Gtk.Label();
            label.Markup   = tip;
            label.LineWrap = true;
            label.Justify  = Justification.Fill;
            label.SetAlignment(0.0f, 0.5f);
            label.ModifyFg(Gtk.StateType.Normal, label.Style.Foreground(Gtk.StateType.Insensitive));
            label.Show();
            table.Attach(label, 1, 2, row, row + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0, 0);
        }
Beispiel #22
0
		public void Append (string tip)
		{
			uint row = table.NRows;

			Gtk.Image image = new Gtk.Image (arrow);
			image.Show ();
			table.Attach (image, 0, 1, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

			Gtk.Label label = new Gtk.Label ();
			label.Markup = tip;
			label.LineWrap = true;
			label.Justify = Justification.Fill;
			label.SetAlignment (0.0f, 0.5f);
			label.ModifyFg (Gtk.StateType.Normal, label.Style.Foreground (Gtk.StateType.Insensitive));
			label.Show ();
			table.Attach (label, 1, 2, row, row + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0, 0);
		}
Beispiel #23
0
        protected override void InitializeForm()
        {
            XML form = FormHelper.LoadGladeXML("Dialogs.ImportObjectsMapping.glade", "dlgImportObjectsMapping");

            form.Autoconnect(this);

            dlgImportObjectsMapping.Icon = FormHelper.LoadImage("Icons.Import24.png").Pixbuf;
            btnOK.SetChildImage(FormHelper.LoadImage("Icons.Ok24.png"));
            btnCancel.SetChildImage(FormHelper.LoadImage("Icons.Cancel24.png"));
            btnReset.SetChildImage(FormHelper.LoadImage("Icons.Clear24.png"));

            Image img = FormHelper.LoadImage("Icons.Import24.png");

            algDialogIcon.Add(img);
            img.Show();

            base.InitializeForm();

            InitializeFormStrings();
            InitializeFields();
        }
Beispiel #24
0
        protected virtual void Build()
        {
            Alignment label_align;

            caption   = "";
            highlight = "";

            vbox             = new VBox(false, 4);
            vbox.BorderWidth = 6;
            Add(vbox);

            vbox.Show();

            empty_pixbuf = new Pixbuf(Colorspace.Rgb, true, 8, icon_size, icon_size);
            empty_pixbuf.Fill(uint.MinValue);

            image = new Gtk.Image();
            vbox.PackStart(image, false, false, 0);
            image.Show();

            label           = new Label();
            label.Ellipsize = Pango.EllipsizeMode.End;
            label.ModifyFg(StateType.Normal, Style.White);
            label_align = new Alignment(1.0F, 0.0F, 0, 0);
            label_align.SetPadding(0, 2, 2, 2);
            label_align.Add(label);
            vbox.PackStart(label_align, false, false, 0);
            label.Show();
            label_align.Show();

            image.SetSizeRequest(icon_size, icon_size);
            label.SetSizeRequest(icon_size / 4 * 5, -1);
            // SetSizeRequest (icon_size * 2, icon_size * 2);

            DrawFrame  = DrawFill = true;
            FrameColor = FillColor = new Color(byte.MaxValue, byte.MaxValue, byte.MaxValue);

            Realized += OnRealized;
            UpdateFocus();
        }
Beispiel #25
0
        protected virtual ToggleToolButton CreateToolButton()
        {
            Gtk.Image i2 = new Gtk.Image(PintaCore.Resources.GetIcon(Icon));
            i2.Show();

            ToggleToolButton tool_item = new ToggleToolButton();

            tool_item.IconWidget = i2;
            tool_item.Show();
            tool_item.Label = Name;

            if (ShortcutKey != (Gdk.Key) 0)
            {
                tool_item.TooltipText = string.Format("{0}\n{2}: {1}\n\n{3}", Name, ShortcutKey.ToString().ToUpperInvariant(), Catalog.GetString("Shortcut key"), StatusBarText);
            }
            else
            {
                tool_item.TooltipText = Name;
            }

            return(tool_item);
        }
		public MenuButton (string label, Menu menu, ArrowType arrow_type) : base ()
		{
			HBox hbox = new HBox ();
			
			this.image = new Image ();
			hbox.PackStart (this.image, false, false, 1);
			image.Show ();

			this.label = new Label (label);
			this.label.Xalign = 0;
			hbox.PackStart (this.label, true, true, 1);
			this.label.Show ();

			this.arrow = new Arrow (arrow_type, ShadowType.None);
			hbox.PackStart (arrow, false, false, 1);
			arrow.Show ();

			Menu = menu;

			this.Add (hbox);
			hbox.Show ();
		}
Beispiel #27
0
        public MenusToolButton(Gtk.Menu menu, string icon) : base(null, null)       // base (icon)
        {
            HBox box = new HBox(false, 0);

            box.BorderWidth = 2;

            /* Now on to the image stuff */

            Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(icon, Gtk.IconSize.SmallToolbar));
            Gtk.Arrow arrow = new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.None);
            /* Create a label for the button */
            Label label = new Label("label_text");

            /* Pack the image and label into the box */
            box.PackStart(image, false, false, 3);
            box.PackStart(arrow, false, false, 3);

            image.Show();
            label.Show();

            this.IconWidget = box;

            this.menu = menu;
            //this.Menu = menu;
            this.Events  = Gdk.EventMask.AllEventsMask;
            Child.Events = Gdk.EventMask.AllEventsMask;

            this.Clicked += delegate(object sender, EventArgs e) {
                this.menu.Popup(null, null, new Gtk.MenuPositionFunc(OnPosition), 3, Gtk.Global.CurrentEventTime);
            };

            if (string.IsNullOrEmpty(icon))
            {
                this.Expand      = false;
                this.Homogeneous = false;
                this.IconWidget  = new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.None);
            }
        }
Beispiel #28
0
        // base (icon)
        public MenusToolButton(Gtk.Menu menu, string icon)
            : base(null,null)
        {
            HBox box = new HBox(false, 0);
                        box.BorderWidth =  2;

                        /* Now on to the image stuff */

                        Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(icon, Gtk.IconSize.SmallToolbar));
            Gtk.Arrow arrow = new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.None);
                        /* Create a label for the button */
                        Label label = new Label ("label_text");

                        /* Pack the image and label into the box */
                        box.PackStart (image, false, false, 3);
                        box.PackStart(arrow , false, false, 3);

                        image.Show();
                        label.Show();

            this.IconWidget = box;

            this.menu = menu;
            //this.Menu = menu;
            this.Events = Gdk.EventMask.AllEventsMask;
            Child.Events = Gdk.EventMask.AllEventsMask;

            this.Clicked+= delegate(object sender, EventArgs e) {
                this.menu.Popup (null, null, new Gtk.MenuPositionFunc (OnPosition), 3, Gtk.Global.CurrentEventTime);
            };

            if (string.IsNullOrEmpty (icon)) {
                this.Expand = false;
                this.Homogeneous = false;
                this.IconWidget = new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.None);
            }
        }
        public SplashScreenForm()
            : base(Gtk.WindowType.Popup)
        {
            this.Decorated = false;
            this.WindowPosition = WindowPosition.Center;
            this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
            Gdk.Pixbuf bitmap = new Gdk.Pixbuf(Assembly.GetEntryAssembly(), "SplashScreen.png");
            Gtk.Image image = new Gtk.Image (bitmap);
            image.Show ();

            HBox hbox = new HBox();
            Alignment align = new Alignment (0.5f, 1.0f, 0.90f, 1.0f);
            progress = new ProgressBar();
            progress.Fraction = 0.00;
            align.Add (progress);
            hbox.PackStart (align, true, true, 0);
            hbox.ShowAll();

            vbox = new VBox();
            vbox.PackStart(image, true, true, 0);
            vbox.PackStart(hbox, false, true, 5);

            this.Add (vbox);
        }
Beispiel #30
0
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            Build ();

            Requisition req = new Requisition ();
            req.Height = 600;
            req.Width = 800;
            drawingarea1.Requisition = req;

            // Initialize interface things
            PintaCore.Actions.AccelGroup = new AccelGroup ();
            this.AddAccelGroup (PintaCore.Actions.AccelGroup);

            PintaCore.Initialize (tooltoolbar, label5, drawingarea1, treeview1, this);
            colorpalettewidget1.Initialize ();

            PintaCore.Chrome.StatusBarTextChanged += new EventHandler<TextChangedEventArgs> (Chrome_StatusBarTextChanged);
            PintaCore.History.HistoryItemAdded += new EventHandler<HistoryItemAddedEventArgs> (History_HistoryItemAdded);
            PintaCore.History.HistoryItemRemoved += new EventHandler<HistoryItemRemovedEventArgs> (History_HistoryItemRemoved);
            PintaCore.Workspace.CanvasInvalidated += new EventHandler<CanvasInvalidatedEventArgs> (Workspace_CanvasInvalidated);
            PintaCore.Workspace.CanvasSizeChanged += new EventHandler (Workspace_CanvasSizeChanged);
            CreateToolBox ();

            PintaCore.Actions.CreateMainMenu (menubar1);
            PintaCore.Actions.CreateToolBar (toolbar1);
            PintaCore.Actions.Layers.CreateLayerWindowToolBar (toolbar4);
            PintaCore.Actions.Edit.CreateHistoryWindowToolBar (toolbar2);

            Gtk.Image i = new Gtk.Image (PintaCore.Resources.GetIcon ("StatusBar.CursorXY.png"));
            i.Show ();

            statusbar1.Add (i);
            Gtk.Box.BoxChild box = (Gtk.Box.BoxChild)statusbar1[i];
            box.Position = 2;
            box.Fill = false;
            box.Expand = false;

            this.Icon = PintaCore.Resources.GetIcon ("Pinta.png");

            dialog_handler = new DialogHandlers (this);

            // Create a blank document
            Layer background = PintaCore.Layers.AddNewLayer ("Background");

            using (Cairo.Context g = new Cairo.Context (background.Surface)) {
                g.SetSourceRGB (255, 255, 255);
                g.Paint ();
            }

            PintaCore.Workspace.Filename = "Untitled1";
            PintaCore.Workspace.IsDirty = false;

            PintaCore.Workspace.Invalidate ();

            treeview1.Model = new ListStore (typeof (Pixbuf), typeof (string));
            treeview1.HeadersVisible = false;
            treeview1.RowActivated += HandleTreeview1RowActivated;
            AddColumns (treeview1);

            PintaCore.Actions.View.ZoomToWindow.Activated += new EventHandler (ZoomToWindow_Activated);
            DeleteEvent += new DeleteEventHandler (MainWindow_DeleteEvent);

            EffectsAction.Visible = false;
            WindowAction.Visible = false;
        }
Beispiel #31
0
        private void ShowAttrIcons(CacheAttribute[] attrs, StringBuilder bldr)
        {
            Gtk.Table.TableChild props;
            bool isFirst  = true;
            uint colCount = 0;

            foreach (CacheAttribute attr in attrs)
            {
                Pixbuf buf;
                if (attr.Include)
                {
                    buf = IconManager.GetYAttrIcon(attr.AttrValue);
                }
                else
                {
                    buf = IconManager.GetNAttrIcon(attr.AttrValue);
                }
                if (buf != null)
                {
                    Gtk.Image img = new Gtk.Image();
                    img.Pixbuf      = buf;
                    img.TooltipText = Catalog.GetString(attr.AttrValue);
                    attrTable.Add(img);
                    props              = ((Gtk.Table.TableChild)(this.attrTable[img]));
                    props.TopAttach    = 0;
                    props.LeftAttach   = colCount;
                    props.RightAttach  = colCount + 1;
                    props.BottomAttach = 1;
                    props.XOptions     = AttachOptions.Shrink;
                    img.Show();
                    colCount++;
                    continue;
                }

                if (isFirst)
                {
                    isFirst = false;
                }
                else
                {
                    bldr.Append(", ");
                }
                if (!attr.Include)
                {
                    bldr.Append("<span fgcolor='red' strikethrough='true'>");
                    bldr.Append(attr.AttrValue);
                    bldr.Append("</span>");
                }
                else
                {
                    bldr.Append(attr.AttrValue);
                }
            }
            Label filler = new Label("");

            attrTable.Add(filler);
            props              = ((Gtk.Table.TableChild)(this.attrTable[filler]));
            props.TopAttach    = 0;
            props.LeftAttach   = colCount;
            props.RightAttach  = colCount + 1;
            props.BottomAttach = 1;
            props.XOptions     = AttachOptions.Expand;
            filler.Show();

            if (bldr.Length > 0)
            {
                attrTable.Add(attrLabel);
                props              = ((Gtk.Table.TableChild)(this.attrTable[attrLabel]));
                props.TopAttach    = 1;
                props.LeftAttach   = 0;
                props.RightAttach  = colCount + 1;
                props.BottomAttach = 2;
                attrLabel.Markup   = bldr.ToString();
                attrLabel.Show();
            }
        }
Beispiel #32
0
        public QueryWidget(PhotoQuery query, Db db)
            : base(new HBox())
        {
            box = Child as HBox;
            box.Spacing = 6;
            box.BorderWidth = 2;

            tips.Enable ();

            this.query = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label (Catalog.GetString ("Find: "));
            label.Show ();
            label.Ypad = 9;
            box.PackStart (label, false, false, 0);

            untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
            untagged.Visible = false;
            box.PackStart (untagged, false, false, 0);

            comma1_label = new Gtk.Label (", ");
            comma1_label.Visible = false;
            box.PackStart (comma1_label, false, false, 0);

            rated = new Gtk.Label (Catalog.GetString ("Rated photos"));
            rated.Visible = false;
            box.PackStart (rated, false, false, 0);

            comma2_label = new Gtk.Label (", ");
            comma2_label.Visible = false;
            box.PackStart (comma2_label, false, false, 0);

            // Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
            rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));
            rollfilter.Visible = false;
            box.PackStart (rollfilter, false, false, 0);

            folder_query_widget = new FolderQueryWidget (query);
            folder_query_widget.Visible = false;
            box.PackStart (folder_query_widget, false, false, 0);

            logic_widget = new LogicWidget (query, db.Tags);
            logic_widget.Show ();
            box.PackStart (logic_widget, true, true, 0);

            warning_box = new Gtk.HBox ();
            warning_box.PackStart (new Gtk.Label (System.String.Empty));

            Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
            warning_image.Show ();
            warning_box.PackStart (warning_image, false, false, 0);

            clear_button = new Gtk.Button ();
            clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked += HandleClearButtonClicked;
            clear_button.Relief = Gtk.ReliefStyle.None;
            box.PackEnd (clear_button, false, false, 0);
            tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);

            refresh_button = new Gtk.Button ();
            refresh_button.Add (new Gtk.Image ("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked += HandleRefreshButtonClicked;
            refresh_button.Relief = Gtk.ReliefStyle.None;
            box.PackEnd (refresh_button, false, false, 0);
            tips.SetTip (refresh_button, Catalog.GetString("Refresh search"), null);

            Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
            warning_box.PackStart (warning, false, false, 0);
            warning_box.ShowAll ();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd (warning_box, false, false, 0);

            warning_box.Visible = false;
        }
        protected override void InitializeForm(long?saleId)
        {
            XML form = FormHelper.LoadGladeXML("WbpTradePoint.glade", "vboxButtons");

            form.Autoconnect(this);

            base.InitializeForm(saleId);

            evbIcon.DestroyChild();
            Image icon = FormHelper.LoadImage("Icons.TradePoint32.png");

            evbIcon.Add(icon);
            icon.Show();

            DateVisible          = false;
            hboxBigTotal.Visible = true;
            tblTotal.Visible     = false;

            btnCash.SetChildImage(FormHelper.LoadImage("Icons.Cash24.png"));
            btnCard.SetChildImage(FormHelper.LoadImage("Icons.Card24.png"));
            btnBank.SetChildImage(FormHelper.LoadImage("Icons.Bank24.png"));
            btnReports.SetChildImage(FormHelper.LoadImage("Icons.Report24.png"));

            btnCash.SetChildLabelText(Translator.GetString("In cash"));
            btnCard.SetChildLabelText(Translator.GetString("Card"));
            btnBank.SetChildLabelText(Translator.GetString("By bank"));
            btnReports.SetChildLabelText(Translator.GetString("Reports"));

            foreach (Widget widget in vboxButtons.Children)
            {
                widget.Unparent();
                vbxAdditionalButtons.PackStart(widget, false, true, 0);
            }
            algAdditionalButtons.ShowAll();

            foreach (Button button in new [] { btnCash, btnCard, btnBank, btnReports })
            {
                KeyShortcuts.SetAccelPath(button, FrmMain.AccelGroup, "mnuOperTradeObject/" + button.Name);
            }

            btnCash.Visible    = BusinessDomain.RestrictionTree.GetRestriction("mnuOperTradeObjectCash") == UserRestrictionState.Allowed;
            btnCard.Visible    = BusinessDomain.RestrictionTree.GetRestriction("mnuOperTradeObjectCard") == UserRestrictionState.Allowed;
            btnBank.Visible    = BusinessDomain.RestrictionTree.GetRestriction("mnuOperTradeObjectBank") == UserRestrictionState.Allowed;
            btnReports.Visible = BusinessDomain.RestrictionTree.GetRestriction("mnuOperTradeObjectReports") == UserRestrictionState.Allowed;

            algSave.Visible = !btnCash.Visible && !btnCard.Visible && !btnBank.Visible;

            lblSimpleView.SetText("W");
            int width;
            int height;

            lblSimpleView.Layout.GetPixelSize(out width, out height);
            lblSimpleView.HeightRequest = height;
            lblSimpleView.SetText(string.Empty);

            evbSimpleView.ModifyBg(StateType.Normal, new Color(255, 255, 255));
            algSimpleView.Visible   = true;
            btnAddRemoveVAT.Visible = false;
            btnImport.Visible       = false;

            SetUser(BusinessDomain.LoggedUser);
            if (PresentationDomain.ScreenResolution < ScreenResolution.Normal)
            {
                UserVisible      = false;
                btnClose.Visible = false;
            }
        }
        private void ShowAttrIcons(CacheAttribute[] attrs, StringBuilder bldr)
        {
            Gtk.Table.TableChild props;
            bool isFirst = true;
            uint colCount = 0;
            foreach (CacheAttribute attr in attrs) {
                Pixbuf buf;
                if (attr.Include)
                    buf = IconManager.GetYAttrIcon (attr.AttrValue);
                else
                    buf = IconManager.GetNAttrIcon (attr.AttrValue);
                if (buf != null) {
                    Gtk.Image img = new Gtk.Image ();
                    img.Pixbuf = buf;
                    img.TooltipText = Catalog.GetString (attr.AttrValue);
                    attrTable.Add (img);
                    props = ((Gtk.Table.TableChild)(this.attrTable[img]));
                    props.TopAttach = 0;
                    props.LeftAttach = colCount;
                    props.RightAttach = colCount + 1;
                    props.BottomAttach = 1;
                    props.XOptions = AttachOptions.Shrink;
                    img.Show ();
                    colCount++;
                    continue;
                }

                if (isFirst)
                    isFirst = false;
                else
                    bldr.Append (", ");
                if (!attr.Include) {
                    bldr.Append ("<span fgcolor='red' strikethrough='true'>");
                    bldr.Append (attr.AttrValue);
                    bldr.Append ("</span>");
                } else {
                    bldr.Append (attr.AttrValue);
                }
            }
            Label filler = new Label ("");
            attrTable.Add (filler);
            props = ((Gtk.Table.TableChild)(this.attrTable[filler]));
            props.TopAttach = 0;
            props.LeftAttach = colCount;
            props.RightAttach = colCount + 1;
            props.BottomAttach = 1;
            props.XOptions = AttachOptions.Expand;
            filler.Show ();

            if (bldr.Length > 0) {
                attrTable.Add (attrLabel);
                props = ((Gtk.Table.TableChild)(this.attrTable[attrLabel]));
                props.TopAttach = 1;
                props.LeftAttach = 0;
                props.RightAttach = colCount + 1;
                props.BottomAttach = 2;
                attrLabel.Markup = bldr.ToString ();
                attrLabel.Show ();
            }
        }
        public TableVisualizer()
        {
            grid = new ListView();
            grid.Show();

            scrolledWindow = new ScrolledWindow {
                HscrollbarPolicy = PolicyType.Automatic, VscrollbarPolicy = PolicyType.Automatic
            };
            scrolledWindow.Add(grid);
            scrolledWindow.Show();

            imgLoading = FormHelper.LoadAnimation("Icons.Loading66.gif");
            imgLoading.Show();

            lblNoData = new Label {
                Text = Translator.GetString("No data available.")
            };
            lblNoData.Show();

            lblError = new Label {
                Ellipsize = EllipsizeMode.End, Xalign = 0.5f
            };
            lblError.Show();

            tblCalculating = new Table(4, 3, false)
            {
                RowSpacing = 3
            };
            VBox daSpace = new VBox();

            daSpace.Show();
            tblCalculating.Attach(daSpace, 0, 3, 0, 1,
                                  AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            daSpace = new VBox();
            daSpace.Show();
            tblCalculating.Attach(daSpace, 0, 3, 3, 4,
                                  AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            daSpace = new VBox();
            daSpace.Show();
            tblCalculating.Attach(daSpace, 0, 1, 1, 3,
                                  AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            daSpace = new VBox();
            daSpace.Show();
            tblCalculating.Attach(daSpace, 2, 3, 1, 3,
                                  AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            Label lblMessage = new Label {
                Markup = new PangoStyle {
                    Bold = true, Text = Translator.GetString("Calculating totals in progress...")
                }, Xalign = 0
            };

            lblMessage.Show();
            tblCalculating.Attach(lblMessage, 1, 2, 1, 2,
                                  AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            prgCalculating = new ProgressBar();
            prgCalculating.Show();
            tblCalculating.Attach(prgCalculating, 1, 2, 2, 3,
                                  AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);
        }
Beispiel #36
0
		public DocumentToolButton (string stockId, string label)
		{
			Label = label;
			Image = new Gtk.Image (stockId, IconSize.Menu);
			Image.Show ();
		}
Beispiel #37
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;
		}
Beispiel #38
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;
        }
Beispiel #39
0
        protected virtual ToggleToolButton CreateToolButton()
        {
            Gtk.Image i2 = new Gtk.Image (PintaCore.Resources.GetIcon (Icon));
            i2.Show ();

            ToggleToolButton tool_item = new ToggleToolButton ();
            tool_item.IconWidget = i2;
            tool_item.Show ();
            tool_item.Label = Name;

            if (ShortcutKey != (Gdk.Key)0)
                tool_item.TooltipText = string.Format ("{0}\n{2}: {1}\n\n{3}", Name, ShortcutKey.ToString ().ToUpperInvariant (), Catalog.GetString ("Shortcut key"), StatusBarText);
            else
                tool_item.TooltipText = Name;

            return tool_item;
        }
Beispiel #40
0
            public CommandMapButton(string category_name, Gtk.Action action)
                : this(category_name)
            {
                action.ConnectProxy (this);

                TooltipText = action.Label;
                Label = action.Label;
                Image = new Gtk.Image (action.StockId, IconSize.Button);
                ImagePosition = PositionType.Top;
                Image.Show ();
            }
Beispiel #41
0
        public XPMButton(string defaultXPM, string pressedXPM)
        {
            _defaultImage = new Pixbuf(defaultXPM);
            _pressedImage = new Pixbuf(pressedXPM);

            _image = new Gtk.Image();
            _image.Pixbuf = _defaultImage;

            Add(_image);
            _image.Show();

            this.ButtonPressEvent+=	 delegate(object o, ButtonPressEventArgs args) {
                _image.Pixbuf = _pressedImage;
            };

            this.ButtonReleaseEvent+= delegate(object o, ButtonReleaseEventArgs args) {
                _image.Pixbuf = _defaultImage;
                if (Clicked != null)
                    Clicked(this, args);
            };

            this.WidthRequest = _image.Pixbuf.Width;
        }
Beispiel #42
0
		private Gtk.Button StockButton (string stockid, string label)
		{
			Gtk.HBox button_contents = new HBox (false, 0);
			button_contents.Show ();
			Gtk.Widget button_image = new Gtk.Image (stockid, Gtk.IconSize.Button);
			button_image.Show ();
			button_contents.PackStart (button_image, false, false, 1);
			Gtk.Label button_label = new Gtk.Label (label);
			button_label.Show ();
			button_contents.PackStart (button_label, false, false, 1);
			
			Gtk.Button button = new Gtk.Button ();
			button.Add (button_contents);

			return button;
		}
Beispiel #43
0
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            Build ();

            Requisition req = new Requisition ();
            req.Height = 600;
            req.Width = 800;
            drawingarea1.Requisition = req;

            // Initialize interface things
            PintaCore.Actions.AccelGroup = new AccelGroup ();
            this.AddAccelGroup (PintaCore.Actions.AccelGroup);

            PintaCore.Initialize (tooltoolbar, label5, drawingarea1, treeview1, this);
            colorpalettewidget1.Initialize ();

            PintaCore.Chrome.StatusBarTextChanged += new EventHandler<TextChangedEventArgs> (Chrome_StatusBarTextChanged);
            PintaCore.History.HistoryItemAdded += new EventHandler<HistoryItemAddedEventArgs> (History_HistoryItemAdded);
            PintaCore.History.HistoryItemRemoved += new EventHandler<HistoryItemRemovedEventArgs> (History_HistoryItemRemoved);
            PintaCore.Workspace.CanvasInvalidated += new EventHandler<CanvasInvalidatedEventArgs> (Workspace_CanvasInvalidated);
            PintaCore.Workspace.CanvasSizeChanged += new EventHandler (Workspace_CanvasSizeChanged);
            CreateToolBox ();

            PintaCore.Actions.CreateMainMenu (menubar1);
            PintaCore.Actions.CreateToolBar (toolbar1);
            PintaCore.Actions.Layers.CreateLayerWindowToolBar (toolbar4);
            PintaCore.Actions.Edit.CreateHistoryWindowToolBar (toolbar2);

            Gtk.Image i = new Gtk.Image (PintaCore.Resources.GetIcon ("StatusBar.CursorXY.png"));
            i.Show ();

            statusbar1.Add (i);
            Gtk.Box.BoxChild box = (Gtk.Box.BoxChild)statusbar1[i];
            box.Position = 2;
            box.Fill = false;
            box.Expand = false;

            this.Icon = PintaCore.Resources.GetIcon ("Pinta.png");

            dialog_handler = new DialogHandlers (this);

            // Create a blank document
            Layer background = PintaCore.Layers.AddNewLayer ("Background");

            using (Cairo.Context g = new Cairo.Context (background.Surface)) {
                g.SetSourceRGB (255, 255, 255);
                g.Paint ();
            }

            PintaCore.Workspace.Filename = "Untitled1";
            PintaCore.Workspace.IsDirty = false;

            PintaCore.Workspace.Invalidate ();

            treeview1.Model = new ListStore (typeof (Pixbuf), typeof (string));
            treeview1.HeadersVisible = false;
            treeview1.RowActivated += HandleTreeview1RowActivated;
            AddColumns (treeview1);

            PintaCore.Actions.View.ZoomToWindow.Activated += new EventHandler (ZoomToWindow_Activated);
            DeleteEvent += new DeleteEventHandler (MainWindow_DeleteEvent);

            WindowAction.Visible = false;

            if (Platform.GetOS () == Platform.OS.Mac)
            {
                try {
                    //enable the global key handler for keyboard shortcuts
                    IgeMacMenu.GlobalKeyHandlerEnabled = true;

                    //Tell the IGE library to use your GTK menu as the Mac main menu
                    IgeMacMenu.MenuBar = menubar1;
                    /*
                    //tell IGE which menu item should be used for the app menu's quit item
                    IgeMacMenu.QuitMenuItem = yourQuitMenuItem;
                    */
                    //add a new group to the app menu, and add some items to it
                    var appGroup = IgeMacMenu.AddAppMenuGroup();
                    MenuItem aboutItem = (MenuItem) PintaCore.Actions.Help.About.CreateMenuItem();
                    appGroup.AddMenuItem(aboutItem, Mono.Unix.Catalog.GetString ("About"));

                    menubar1.Hide();
                } catch {
                    // If things don't work out, just use a normal menu.
                }
            }
        }
Beispiel #44
0
        public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences) : base()
        {
            if (backend == null)
            {
                throw new ArgumentNullException("backend");
            }
            if (preferences == null)
            {
                throw new ArgumentNullException("preferences");
            }
            this.backend     = backend;
            this.preferences = preferences;

            LoadPreferences();

            BorderWidth = 0;

            // We're using an event box so we can paint the background white
            EventBox imageEb = new EventBox();

            imageEb.BorderWidth = 0;
            imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
            imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255, 255, 255));
            imageEb.Show();

            VBox mainVBox = new VBox(false, 0);

            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            // Add the rtm logo
            image = new Gtk.Image(normalPixbuf);
            image.Show();
            //make the dialog box look pretty without hard coding total size and
            //therefore clipping displays with large fonts.
            Alignment spacer = new Alignment((float)0.5, 0, 0, 0);

            spacer.SetPadding(0, 0, 125, 125);
            spacer.Add(image);
            spacer.Show();
            imageEb.Add(spacer);
            mainVBox.PackStart(imageEb, true, true, 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;

            authButton = new LinkButton(Catalog.GetString("Click Here to Connect"));

            authButton.Clicked += OnAuthButtonClicked;

            if (isAuthorized)
            {
                statusLabel.Text = "\n\n" +
                                   Catalog.GetString("You are currently connected");
                string userName = preferences.Get(PreferencesKeys.UserNameKey);
                if (userName != null && userName.Trim() != string.Empty)
                {
                    statusLabel.Text = "\n\n" +
                                       Catalog.GetString("You are currently connected as") +
                                       "\n" + userName.Trim();
                }
            }
            else
            {
                statusLabel.Text = "\n\n" +
                                   Catalog.GetString("You are not connected");
                authButton.Show();
            }
            mainVBox.PackStart(statusLabel, false, false, 0);
            mainVBox.PackStart(authButton, false, false, 0);

            Label blankLabel = new Label("\n");

            blankLabel.Show();
            mainVBox.PackStart(blankLabel, false, false, 0);
        }
Beispiel #45
0
		public DocumentToolButton (string stockId)
		{
			Image = new Gtk.Image (stockId, IconSize.Menu);
			Image.Show ();
		}
Beispiel #46
0
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            Build ();

            Requisition req = new Requisition ();
            req.Height = 600;
            req.Width = 800;
            drawingarea1.Requisition = req;

            // Initialize interface things
            PintaCore.Actions.AccelGroup = new AccelGroup ();
            this.AddAccelGroup (PintaCore.Actions.AccelGroup);

            progress_dialog = new ProgressDialog ();

            PintaCore.Initialize (tooltoolbar, label5, drawingarea1, history_treeview, this, progress_dialog, (Gtk.Viewport)table1.Parent);
            colorpalettewidget1.Initialize ();

            PintaCore.Chrome.StatusBarTextChanged += new EventHandler<TextChangedEventArgs> (Chrome_StatusBarTextChanged);
            PintaCore.Workspace.CanvasInvalidated += new EventHandler<CanvasInvalidatedEventArgs> (Workspace_CanvasInvalidated);
            PintaCore.Workspace.CanvasSizeChanged += new EventHandler (Workspace_CanvasSizeChanged);
            CreateToolBox ();

            PintaCore.Actions.CreateMainMenu (menubar1);
            PintaCore.Actions.CreateToolBar (toolbar1);
            PintaCore.Actions.Layers.CreateLayerWindowToolBar (toolbar4);
            PintaCore.Actions.Edit.CreateHistoryWindowToolBar (toolbar2);

            Gtk.Image i = new Gtk.Image (PintaCore.Resources.GetIcon ("StatusBar.CursorXY.png"));
            i.Show ();

            statusbar1.Add (i);
            Gtk.Box.BoxChild box = (Gtk.Box.BoxChild)statusbar1[i];
            box.Position = 2;
            box.Fill = false;
            box.Expand = false;

            this.Icon = PintaCore.Resources.GetIcon ("Pinta.png");

            dialog_handler = new DialogHandlers (this);

            // Create a blank document
            Layer background = PintaCore.Layers.AddNewLayer ("Background");

            using (Cairo.Context g = new Cairo.Context (background.Surface)) {
                g.SetSourceRGB (255, 255, 255);
                g.Paint ();
            }

            PintaCore.Workspace.Filename = "Untitled1";
            PintaCore.History.PushNewItem (new BaseHistoryItem ("gtk-new", "New Image"));
            PintaCore.Workspace.IsDirty = false;
            PintaCore.Workspace.Invalidate ();

            //History
            history_treeview.Model = PintaCore.History.ListStore;
            history_treeview.HeadersVisible = false;
            history_treeview.Selection.Mode = SelectionMode.Single;
            history_treeview.Selection.SelectFunction = HistoryItemSelected;

            Gtk.TreeViewColumn icon_column = new Gtk.TreeViewColumn ();
            Gtk.CellRendererPixbuf icon_cell = new Gtk.CellRendererPixbuf ();
            icon_column.PackStart (icon_cell, true);

            Gtk.TreeViewColumn text_column = new Gtk.TreeViewColumn ();
            Gtk.CellRendererText text_cell = new Gtk.CellRendererText ();
            text_column.PackStart (text_cell, true);

            text_column.SetCellDataFunc (text_cell, new Gtk.TreeCellDataFunc (HistoryRenderText));
            icon_column.SetCellDataFunc (icon_cell, new Gtk.TreeCellDataFunc (HistoryRenderIcon));

            history_treeview.AppendColumn (icon_column);
            history_treeview.AppendColumn (text_column);

            PintaCore.History.HistoryItemAdded += new EventHandler<HistoryItemAddedEventArgs> (OnHistoryItemsChanged);
            PintaCore.History.ActionUndone += new EventHandler (OnHistoryItemsChanged);
            PintaCore.History.ActionRedone += new EventHandler (OnHistoryItemsChanged);

            PintaCore.Actions.View.ZoomToWindow.Activated += new EventHandler (ZoomToWindow_Activated);
            DeleteEvent += new DeleteEventHandler (MainWindow_DeleteEvent);

            PintaCore.LivePreview.RenderUpdated += LivePreview_RenderUpdated;

            WindowAction.Visible = false;

            hruler = new HRuler ();
            hruler.Metric = MetricType.Pixels;
            table1.Attach (hruler, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0);

            vruler = new VRuler ();
            vruler.Metric = MetricType.Pixels;
            table1.Attach (vruler, 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink | AttachOptions.Fill, 0, 0);

            UpdateRulerRange ();

            PintaCore.Actions.View.ZoomComboBox.ComboBox.Changed += HandlePintaCoreActionsViewZoomComboBoxComboBoxChanged;

            gr = new GridRenderer (cr);

            if (Platform.GetOS () == Platform.OS.Mac) {
                try {
                    //enable the global key handler for keyboard shortcuts
                    IgeMacMenu.GlobalKeyHandlerEnabled = true;

                    //Tell the IGE library to use your GTK menu as the Mac main menu
                    IgeMacMenu.MenuBar = menubar1;
                    /*
                    //tell IGE which menu item should be used for the app menu's quit item
                    IgeMacMenu.QuitMenuItem = yourQuitMenuItem;
                    */
                    //add a new group to the app menu, and add some items to it
                    var appGroup = IgeMacMenu.AddAppMenuGroup ();
                    MenuItem aboutItem = (MenuItem)PintaCore.Actions.Help.About.CreateMenuItem ();
                    appGroup.AddMenuItem (aboutItem, Mono.Unix.Catalog.GetString ("About"));

                    menubar1.Hide ();
                } catch {
                    // If things don't work out, just use a normal menu.
                }
            }
        }
Beispiel #47
0
 public DockToolButton(string stockId, string label)
 {
     Label = label;
     Image = new Gtk.Image(stockId, IconSize.Menu);
     Image.Show();
 }
Beispiel #48
0
Datei: Util.cs Projekt: 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;
            }
        }
Beispiel #49
0
        /* Create a new hbox with an image and a label packed into it
                 * and return the box. */
        static Widget xpm_label_box(string xpm_filename, string label_text )
        {
            /* Create box for image and label */
                        HBox box = new HBox(false, 0);
                        box.BorderWidth =  2;

                        /* Now on to the image stuff */
                        Gtk.Image image = new Gtk.Image(xpm_filename);

                        /* Create a label for the button */
                        Label label = new Label (label_text);

                        /* Pack the image and label into the box */
                        box.PackStart (image, false, false, 3);
                        box.PackStart(label, false, false, 3);

                        image.Show();
                        label.Show();

                        return box;
        }
Beispiel #50
0
        void InitWindow()
        {
            int height;
            int width;

            this.Icon = Utilities.GetIcon ("tasque-48", 48);
            // Update the window title
            Title = string.Format ("Tasque");

            width = GtkApplication.Instance.Preferences.GetInt("MainWindowWidth");
            height = GtkApplication.Instance.Preferences.GetInt("MainWindowHeight");

            if(width == -1)
                width = 600;
            if(height == -1)
                height = 600;

            this.DefaultSize = new Gdk.Size( width, height);

            accelGroup = new AccelGroup ();
            AddAccelGroup (accelGroup);
            globalKeys = new GlobalKeybinder (accelGroup);

            VBox mainVBox = new VBox();
            mainVBox.BorderWidth = 0;
            mainVBox.Show ();
            this.Add (mainVBox);

            HBox topHBox = new HBox (false, 0);
            topHBox.BorderWidth = 4;

            categoryComboBox = new ComboBox ();
            categoryComboBox.Accessible.Description = "Category Selection";
            categoryComboBox.WidthRequest = 150;
            categoryComboBox.WrapWidth = 1;
            categoryComboBox.Sensitive = false;
            CellRendererText comboBoxRenderer = new Gtk.CellRendererText ();
            comboBoxRenderer.WidthChars = 20;
            comboBoxRenderer.Ellipsize = Pango.EllipsizeMode.End;
            categoryComboBox.PackStart (comboBoxRenderer, true);
            categoryComboBox.SetCellDataFunc (comboBoxRenderer,
                new Gtk.CellLayoutDataFunc (CategoryComboBoxDataFunc));

            categoryComboBox.Show ();
            topHBox.PackStart (categoryComboBox, false, false, 0);

            // Space the addTaskButton and the categoryComboBox
            // far apart by using a blank label that expands
            Label spacer = new Label (string.Empty);
            spacer.Show ();
            topHBox.PackStart (spacer, true, true, 0);

            // The new task entry widget
            addTaskEntry = new Entry (Catalog.GetString ("New task..."));
            addTaskEntry.Sensitive = false;
            addTaskEntry.Focused += OnAddTaskEntryFocused;
            addTaskEntry.Changed += OnAddTaskEntryChanged;
            addTaskEntry.Activated += OnAddTaskEntryActivated;
            addTaskEntry.FocusInEvent += OnAddTaskEntryFocused;
            addTaskEntry.FocusOutEvent += OnAddTaskEntryUnfocused;
            addTaskEntry.DragDataReceived += OnAddTaskEntryDragDataReceived;
            addTaskEntry.Show ();
            topHBox.PackStart (addTaskEntry, true, true, 0);

            // Use a small add icon so the button isn't mammoth-sized
            HBox buttonHBox = new HBox (false, 6);
            Gtk.Image addImage = new Gtk.Image (Gtk.Stock.Add, IconSize.Menu);
            addImage.Show ();
            buttonHBox.PackStart (addImage, false, false, 0);
            Label l = new Label (Catalog.GetString ("_Add"));
            l.Show ();
            buttonHBox.PackStart (l, true, true, 0);
            buttonHBox.Show ();
            addTaskButton =
                new MenuToolButton (buttonHBox, Catalog.GetString ("_Add Task"));
            addTaskButton.UseUnderline = true;
            // Disactivate the button until the backend is initialized
            addTaskButton.Sensitive = false;
            Gtk.Menu addTaskMenu = new Gtk.Menu ();
            addTaskButton.Menu = addTaskMenu;
            addTaskButton.Clicked += OnAddTask;
            addTaskButton.Show ();
            topHBox.PackStart (addTaskButton, false, false, 0);

            globalKeys.AddAccelerator (OnGrabEntryFocus,
                        (uint) Gdk.Key.n,
                        Gdk.ModifierType.ControlMask,
                        Gtk.AccelFlags.Visible);

            globalKeys.AddAccelerator (delegate (object sender, EventArgs e) {
                GtkApplication.Instance.Quit (); },
                        (uint) Gdk.Key.q,
                        Gdk.ModifierType.ControlMask,
                        Gtk.AccelFlags.Visible);

            this.KeyPressEvent += KeyPressed;

            topHBox.Show ();
            mainVBox.PackStart (topHBox, false, false, 0);

            scrolledWindow = new ScrolledWindow ();
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.HscrollbarPolicy = PolicyType.Never;

            scrolledWindow.BorderWidth = 0;
            scrolledWindow.CanFocus = true;
            scrolledWindow.Show ();
            mainVBox.PackStart (scrolledWindow, true, true, 0);

            innerEb = new EventBox();
            innerEb.BorderWidth = 0;
            Gdk.Color backgroundColor = GetBackgroundColor ();
            innerEb.ModifyBg (StateType.Normal, backgroundColor);
            innerEb.ModifyBase (StateType.Normal, backgroundColor);

            targetVBox = new VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show ();
            innerEb.Add(targetVBox);

            scrolledWindow.AddWithViewport(innerEb);

            statusbar = new Gtk.Statusbar ();
            statusbar.HasResizeGrip = true;
            statusbar.Show ();

            mainVBox.PackEnd (statusbar, false, false, 0);

            //
            // Delay adding in the TaskGroups until the backend is initialized
            //

            Shown += OnWindowShown;
            DeleteEvent += WindowDeleted;

            backend.BackendInitialized += OnBackendInitialized;
            backend.BackendSyncStarted += OnBackendSyncStarted;
            backend.BackendSyncFinished += OnBackendSyncFinished;
            // if the backend is already initialized, go ahead... initialize
            if(backend.Initialized) {
                OnBackendInitialized(null, null);
            }

            GtkApplication.Instance.Preferences.SettingChanged += OnSettingChanged;
        }
Beispiel #51
0
 public DockToolButton(string stockId)
 {
     Image = new Gtk.Image(stockId, IconSize.Menu);
     Image.Show();
 }
        public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences)
            : base()
        {
            if (backend == null)
                throw new ArgumentNullException ("backend");
            if (preferences == null)
                throw new ArgumentNullException ("preferences");
            this.backend = backend;
            this.preferences = preferences;

            LoadPreferences ();

            BorderWidth = 0;

            // We're using an event box so we can paint the background white
            EventBox imageEb = new EventBox ();
            imageEb.BorderWidth = 0;
            imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.Show ();

            VBox mainVBox = new VBox(false, 0);
            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            // Add the rtm logo
            image = new Gtk.Image (normalPixbuf);
            image.Show();
            //make the dialog box look pretty without hard coding total size and
            //therefore clipping displays with large fonts.
            Alignment spacer = new Alignment((float)0.5, 0, 0, 0);
            spacer.SetPadding(0, 0, 125, 125);
            spacer.Add(image);
            spacer.Show();
            imageEb.Add (spacer);
            mainVBox.PackStart(imageEb, true, true, 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;

            authButton = new LinkButton (
            #if GETTEXT
            Catalog.GetString ("Click Here to Connect"));
            #elif ANDROID

            #endif
            authButton.Clicked += OnAuthButtonClicked;

            if ( isAuthorized ) {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are currently connected");
            #elif ANDROID

            #endif
                string userName = preferences.Get (PreferencesKeys.UserNameKey);
                if (userName != null && userName.Trim () != string.Empty)
                    statusLabel.Text = "\n\n" +
            #if GETTEXT
                        Catalog.GetString ("You are currently connected as") +
            #elif ANDROID

            #endif
                        "\n" + userName.Trim();
            } else {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are not connected");
            #elif ANDROID

            #endif
                authButton.Show();
            }
            mainVBox.PackStart(statusLabel, false, false, 0);
            mainVBox.PackStart(authButton, false, false, 0);

            Label blankLabel = new Label("\n");
            blankLabel.Show();
            mainVBox.PackStart(blankLabel, false, false, 0);
        }
Beispiel #53
0
        /// <summary>
        /// Placeholder method to draw the existing filename inside the window.
        /// 
        /// Currently, we are using a method where we create a new HBox and stuff
        /// the image widget there and remove the old widget, which is technically overkill
        /// but since this behaves somewhat like a double buffer, it should make the overall
        /// experience smoother.
        /// </summary>
        /// <param name="filename">
        /// A <see cref="System.String"/>
        /// </param>
        void DrawImageInWindow(string filename)
        {
            // Create the new image widget and draw it being hidden
            try {
                Log.Debug("Drawing image now");
                Gtk.Image drawTarget = new Gtk.Image(filename);
                drawTarget.Hide();

                foreach(Widget child in hbox3.Children)
                {
                    // remove all existing children
                    hbox3.Remove(child);
                    child.Dispose();
                }
                drawTarget.Show();
                hbox3.PackStart(drawTarget, true, true, 0);

            } catch (Exception ex) {
                Log.Error("Something broke in DrawImageInWindow - " + ex.Message);
            }
        }
 private static void SetImage(Image targetImage, Image sourceImage)
 {
     targetImage.SetFromImage(sourceImage.ImageProp, sourceImage.Pixmap);
     targetImage.Show();
 }
Beispiel #55
0
        public QueryWidget(PhotoQuery query, Db db) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

            this.query     = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label(Catalog.GetString("Find: "));
            label.Show();
            label.Ypad = 9;
            box.PackStart(label, false, false, 0);

            untagged         = new Gtk.Label(Catalog.GetString("Untagged photos"));
            untagged.Visible = false;
            box.PackStart(untagged, false, false, 0);

            comma1_label         = new Gtk.Label(", ");
            comma1_label.Visible = false;
            box.PackStart(comma1_label, false, false, 0);

            rated         = new Gtk.Label(Catalog.GetString("Rated photos"));
            rated.Visible = false;
            box.PackStart(rated, false, false, 0);

            comma2_label         = new Gtk.Label(", ");
            comma2_label.Visible = false;
            box.PackStart(comma2_label, false, false, 0);

            // Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
            rollfilter         = new Gtk.Label(Catalog.GetString("Import roll"));
            rollfilter.Visible = false;
            box.PackStart(rollfilter, false, false, 0);

            folder_query_widget         = new FolderQueryWidget(query);
            folder_query_widget.Visible = false;
            box.PackStart(folder_query_widget, false, false, 0);

            logic_widget = new LogicWidget(query, db.Tags);
            logic_widget.Show();
            box.PackStart(logic_widget, true, true, 0);

            warning_box = new Gtk.HBox();
            warning_box.PackStart(new Gtk.Label(System.String.Empty));

            Gtk.Image warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);
            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

            clear_button = new Gtk.Button();
            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked    += HandleClearButtonClicked;
            clear_button.Relief      = Gtk.ReliefStyle.None;
            clear_button.TooltipText = Catalog.GetString("Clear search");
            box.PackEnd(clear_button, false, false, 0);

            refresh_button = new Gtk.Button();
            refresh_button.Add(new Gtk.Image("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked    += HandleRefreshButtonClicked;
            refresh_button.Relief      = Gtk.ReliefStyle.None;
            refresh_button.TooltipText = Catalog.GetString("Refresh search");
            box.PackEnd(refresh_button, false, false, 0);

            Gtk.Label warning = new Gtk.Label(Catalog.GetString("No matching photos found"));
            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd(warning_box, false, false, 0);

            warning_box.Visible = false;
        }
Beispiel #56
0
        public CsBoardApp(string engine,
				   string filename)
            : base(engine, filename)
        {
            title = String.Format (Catalog.
                           GetString
                           ("Welcome to CS Board ({0})"),
                           control.Name);
            csboardWindow.Title = title;
            instance = this;
            subapps = new ArrayList ();
            subAppsMap = new Hashtable ();
            accel = new AccelGroup ();
            csboardWindow.AddAccelGroup (accel);
            Gtk.Image img =
                new Gtk.Image (Gdk.Pixbuf.
                           LoadFromResource
                           ("computer.png"));
            img.Show ();
            playerToolButton.IconWidget = img;

            subapps.Add (this);
            playerToolButton.Sensitive = false;
            TitleChangedEvent += OnAppTitleChanged;

            AddApp (CsBoard.ICS.ICSDetailsWidget.Instance);
            CsBoard.Viewer.GameViewer.CreateInstance ();
            playerToolButton.Clicked += OnToolButtonClicked;

            if (filename == null)
              {
                  control.OpenGame (App.Session.Filename);
                  ShowAppFromLastSession ();
              }
            else
              {
                  ShowApp (CsBoard.Viewer.GameViewer.
                       Instance);
                  GLib.Idle.Add (delegate
                         {
                         CsBoard.Viewer.GameViewer.
                         Instance.Load (filename);
                         return false;}
                  );
              }

            chessGameWidget.Show ();
            boardWidget.Show ();
            csboardWindow.Show ();
        }
Beispiel #57
0
        public PodcastPlaylistView(PodcastPlaylistModel model)
        {
            if (model == null)
            {
                throw new NullReferenceException("model");
            }

            columns = new ArrayList(3);
            schemas = new ArrayList(3);

            RulesHint      = true;
            Selection.Mode = SelectionMode.Multiple;

            filter             = new TreeModelFilter(model, null);
            filter.VisibleFunc = PodcastFilterFunc;

            sort = new TreeModelSort(filter);
            sort.DefaultSortFunc = PodcastFeedTitleTreeIterCompareFunc;

            Model = sort;

            podcast_title_column = NewColumn(
                Catalog.GetString("Title"),
                (int)Column.PodcastTitle,
                GConfSchemas.PodcastTitleColumnSchema
                );

            feed_title_column = NewColumn(
                Catalog.GetString("Feed"),
                (int)Column.FeedTitle,
                GConfSchemas.PodcastFeedColumnSchema
                );

            pubdate_column = NewColumn(
                Catalog.GetString("Date"),
                (int)Column.PubDate,
                GConfSchemas.PodcastDateColumnSchema
                );

            /********************************************/

            download_column = new TreeViewColumn();

            Gtk.Image download_image = new Gtk.Image(
                PodcastPixbufs.DownloadColumnIcon
                );

            download_image.Show();

            download_column.Expand      = false;
            download_column.Resizable   = false;
            download_column.Clickable   = false;
            download_column.Reorderable = false;
            download_column.Visible     = true;
            download_column.Widget      = download_image;

            CellRendererToggle download_renderer = new CellRendererToggle();

            download_renderer.Activatable = true;
            download_renderer.Toggled    += OnDownloadToggled;
            download_column.PackStart(download_renderer, true);

            download_column.SetCellDataFunc(
                download_renderer, new TreeCellDataFunc(DownloadCellToggle));

            /********************************************/
            activity_column = new TreeViewColumn();

            Gtk.Image activity_image = new Gtk.Image(
                PodcastPixbufs.ActivityColumnIcon
                );

            activity_image.Show();

            activity_column.Expand      = false;
            activity_column.Resizable   = false;
            activity_column.Clickable   = false;
            activity_column.Reorderable = false;
            activity_column.Visible     = true;
            activity_column.Widget      = activity_image;

            CellRendererPixbuf activity_renderer = new CellRendererPixbuf();

            activity_column.PackStart(activity_renderer, true);

            activity_column.SetCellDataFunc(activity_renderer,
                                            new TreeCellDataFunc(TrackCellActivity));

            /********************************************/

            CellRendererText podcast_title_renderer = new CellRendererText();
            CellRendererText feed_title_renderer    = new CellRendererText();
            CellRendererText pubdate_renderer       = new CellRendererText();

            podcast_title_column.PackStart(podcast_title_renderer, false);
            podcast_title_column.SetCellDataFunc(podcast_title_renderer,
                                                 new TreeCellDataFunc(TrackCellPodcastTitle));

            feed_title_column.PackStart(feed_title_renderer, true);
            feed_title_column.SetCellDataFunc(feed_title_renderer,
                                              new TreeCellDataFunc(TrackCellPodcastFeedTitle));

            pubdate_column.PackStart(pubdate_renderer, true);
            pubdate_column.SetCellDataFunc(pubdate_renderer,
                                           new TreeCellDataFunc(TrackCellPubDate));

            sort.SetSortFunc((int)Column.PodcastTitle,
                             new TreeIterCompareFunc(PodcastTitleTreeIterCompareFunc));
            sort.SetSortFunc((int)Column.FeedTitle,
                             new TreeIterCompareFunc(PodcastFeedTitleTreeIterCompareFunc));
            sort.SetSortFunc((int)Column.PubDate,
                             new TreeIterCompareFunc(PodcastPubDateTreeIterCompareFunc));

            InsertColumn(activity_column, (int)Column.Activity);
            InsertColumn(download_column, (int)Column.Download);
            InsertColumn(podcast_title_column, (int)Column.PodcastTitle);
            InsertColumn(feed_title_column, (int)Column.FeedTitle);
            InsertColumn(pubdate_column, (int)Column.PubDate);
        }
        public PodcastPlaylistView(PodcastPlaylistModel model)
        {
            if (model == null)
            {
                throw new NullReferenceException ("model");
            }

            columns = new ArrayList (3);
            schemas = new ArrayList (3);

            RulesHint = true;
            Selection.Mode = SelectionMode.Multiple;

            filter = new TreeModelFilter (model, null);
            filter.VisibleFunc = PodcastFilterFunc;

            sort = new TreeModelSort (filter);
            sort.DefaultSortFunc = PodcastFeedTitleTreeIterCompareFunc;

            Model = sort;

            podcast_title_column = NewColumn (
                Catalog.GetString ("Title"),
                (int) Column.PodcastTitle,
                GConfSchemas.PodcastTitleColumnSchema
            );

            feed_title_column = NewColumn (
                Catalog.GetString ("Feed"),
                (int) Column.FeedTitle,
                GConfSchemas.PodcastFeedColumnSchema
            );

            pubdate_column = NewColumn (
                Catalog.GetString ("Date"),
                (int) Column.PubDate,
                GConfSchemas.PodcastDateColumnSchema
            );

            /********************************************/

            download_column = new TreeViewColumn();

            Gtk.Image download_image = new Gtk.Image(
                PodcastPixbufs.DownloadColumnIcon
            );

            download_image.Show();

            download_column.Expand = false;
            download_column.Resizable = false;
            download_column.Clickable = false;
            download_column.Reorderable = false;
            download_column.Visible = true;
            download_column.Widget = download_image;

            CellRendererToggle download_renderer = new CellRendererToggle();

            download_renderer.Activatable = true;
            download_renderer.Toggled += OnDownloadToggled;
            download_column.PackStart(download_renderer, true);

            download_column.SetCellDataFunc (
                download_renderer, new TreeCellDataFunc(DownloadCellToggle));

            /********************************************/
            activity_column = new TreeViewColumn();

            Gtk.Image activity_image = new Gtk.Image(
                PodcastPixbufs.ActivityColumnIcon
            );

            activity_image.Show();

            activity_column.Expand = false;
            activity_column.Resizable = false;
            activity_column.Clickable = false;
            activity_column.Reorderable = false;
            activity_column.Visible = true;
            activity_column.Widget = activity_image;

            CellRendererPixbuf activity_renderer = new CellRendererPixbuf();
            activity_column.PackStart(activity_renderer, true);

            activity_column.SetCellDataFunc (activity_renderer,
                                             new TreeCellDataFunc (TrackCellActivity));

            /********************************************/

            CellRendererText podcast_title_renderer = new CellRendererText();
            CellRendererText feed_title_renderer = new CellRendererText();
            CellRendererText pubdate_renderer = new CellRendererText();

            podcast_title_column.PackStart (podcast_title_renderer, false);
            podcast_title_column.SetCellDataFunc (podcast_title_renderer,
                                                  new TreeCellDataFunc (TrackCellPodcastTitle));

            feed_title_column.PackStart (feed_title_renderer, true);
            feed_title_column.SetCellDataFunc (feed_title_renderer,
                                               new TreeCellDataFunc (TrackCellPodcastFeedTitle));

            pubdate_column.PackStart (pubdate_renderer, true);
            pubdate_column.SetCellDataFunc (pubdate_renderer,
                                            new TreeCellDataFunc (TrackCellPubDate));

            sort.SetSortFunc((int)Column.PodcastTitle,
                             new TreeIterCompareFunc(PodcastTitleTreeIterCompareFunc));
            sort.SetSortFunc((int)Column.FeedTitle,
                             new TreeIterCompareFunc(PodcastFeedTitleTreeIterCompareFunc));
            sort.SetSortFunc((int)Column.PubDate,
                             new TreeIterCompareFunc(PodcastPubDateTreeIterCompareFunc));

            InsertColumn (activity_column, (int)Column.Activity);
            InsertColumn (download_column, (int)Column.Download);
            InsertColumn (podcast_title_column, (int)Column.PodcastTitle);
            InsertColumn (feed_title_column, (int)Column.FeedTitle);
            InsertColumn (pubdate_column, (int)Column.PubDate);
        }