Exemplo n.º 1
0
		private void OnRefresh (HitRenderer signaller)
		{
			string str;
			
			str = "<b>" + name + "</b>";
			if (renderer.TotalCount > 0) {
				str += " -- " + renderer.TotalCount + " match";
				if (renderer.TotalCount > 1)
					str += "es";
			}
			nameLabel.Markup = str;


			str = "";
			if (renderer.DisplayedCount > 1) {
				str = String.Format ("{0} - {1} displayed",
						     renderer.FirstDisplayed + 1,
						     renderer.LastDisplayed + 1);
				if (renderer.LastDisplayed + 1 < renderer.TotalCount) {
					prevButton.Show ();
					nextButton.Show ();
				}
			}
			displayedLabel.Text = str;

			prevButton.Sensitive = (renderer.FirstDisplayed > 0);
			nextButton.Sensitive = (renderer.LastDisplayed + 1 < renderer.TotalCount
						&& renderer.TotalCount > 0);
		}
Exemplo n.º 2
0
        private void OnRefresh(HitRenderer signaller)
        {
            string str;

            str = "<b>" + name + "</b>";
            if (renderer.TotalCount > 0)
            {
                str += " -- " + renderer.TotalCount + " match";
                if (renderer.TotalCount > 1)
                {
                    str += "es";
                }
            }
            nameLabel.Markup = str;


            str = "";
            if (renderer.DisplayedCount > 1)
            {
                str = String.Format("{0} - {1} displayed",
                                    renderer.FirstDisplayed + 1,
                                    renderer.LastDisplayed + 1);
                if (renderer.LastDisplayed + 1 < renderer.TotalCount)
                {
                    prevButton.Show();
                    nextButton.Show();
                }
            }
            displayedLabel.Text = str;

            prevButton.Sensitive = (renderer.FirstDisplayed > 0);
            nextButton.Sensitive = (renderer.LastDisplayed + 1 < renderer.TotalCount &&
                                    renderer.TotalCount > 0);
        }
Exemplo n.º 3
0
        public HitRendererControl(string _name, string icon, HitRenderer r)
            : base(false, 3)
        {
            name     = _name;
            renderer = r;

            renderer.RefreshEvent += new HitRenderer.RefreshHandler(OnRefresh);

            if (icon != null)
            {
                Gtk.Widget iconW = DataBarn.GetImageWidget(icon);
                if (iconW != null)
                {
                    this.PackStart(iconW, false, false, 3);
                    iconW.Show();
                }
            }

            nameLabel = new Gtk.Label("");
            this.PackStart(nameLabel, false, false, 3);
            nameLabel.Show();


            nextButton          = new Gtk.Button("Next");
            nextButton.Clicked += new EventHandler(OnNextClicked);
            this.PackEnd(nextButton, false, false, 3);

            displayedLabel = new Gtk.Label("");
            this.PackEnd(displayedLabel, false, false, 3);
            displayedLabel.Show();

            prevButton          = new Gtk.Button("Prev");
            prevButton.Clicked += new EventHandler(OnPrevClicked);
            this.PackEnd(prevButton, false, false, 3);

            // Initialize things
            OnRefresh(null);
        }
Exemplo n.º 4
0
		public HitRendererControl (string _name, string icon, HitRenderer r) 
			: base (false, 3)
		{
			name = _name;
			renderer = r;

			renderer.RefreshEvent += new HitRenderer.RefreshHandler (OnRefresh);
			
			if (icon != null) {
				Gtk.Widget iconW = DataBarn.GetImageWidget (icon);
				if (iconW != null) {
					this.PackStart (iconW, false, false, 3);
					iconW.Show ();
				}
			}

			nameLabel = new Gtk.Label ("");
			this.PackStart (nameLabel, false, false, 3);
			nameLabel.Show ();


			nextButton = new Gtk.Button ("Next");
			nextButton.Clicked += new EventHandler (OnNextClicked);
			this.PackEnd (nextButton, false, false, 3);

			displayedLabel = new Gtk.Label ("");
			this.PackEnd (displayedLabel, false, false, 3);
			displayedLabel.Show ();

			prevButton = new Gtk.Button ("Prev");
			prevButton.Clicked += new EventHandler (OnPrevClicked);
			this.PackEnd (prevButton, false, false, 3);

			// Initialize things
			OnRefresh (null);
		}