コード例 #1
0
        /// <summary>
        /// <c>LearnSymbolDatabaseChooserDialog</c>'s constructor.
        /// </summary>
        /// <param name="parent">
        /// The dialog's parent dialog, to which it's modal.
        /// </param>
        /// <param name="databases">
        /// The databases the user can choose from.
        /// </param>
        public LearnSymbolDatabaseChooserDialog(Window parent,
                                                List <DatabaseFileInfo> databases)
        {
            XML gxml = new XML(null,
                               "mathtextrecognizer.glade",
                               "learnSymbolDatabaseChooserDialog",
                               null);

            gxml.Autoconnect(this);

            learnSymbolDatabaseChooserDialog.Modal        = true;
            learnSymbolDatabaseChooserDialog.Resizable    = false;
            learnSymbolDatabaseChooserDialog.TransientFor = parent;

            databaseHash = new Dictionary <string, DatabaseFileInfo>();

            optionsTooltips = new Tooltips();

            RadioButton groupRB = new RadioButton("group");

            foreach (DatabaseFileInfo databaseInfo in databases)
            {
                // We add a new option per database
                string      label    = System.IO.Path.GetFileName(databaseInfo.Path);
                RadioButton optionRB = new RadioButton(groupRB, label);

                optionRB.Clicked += new EventHandler(OnOptionRBClicked);
                optionsVB.Add(optionRB);

                MathTextDatabase database = databaseInfo.Database;


                optionsTooltips.SetTip(optionRB,
                                       String.Format("{0}\n{1}",
                                                     database.ShortDescription,
                                                     database.Description),
                                       "database description");

                databaseHash.Add(label, databaseInfo);
            }

            // We add the option of creating a new database.
            newRB          = new RadioButton(groupRB, "Crear nueva base de datos");
            newRB.Clicked += new EventHandler(OnOptionRBClicked);
            optionsVB.Add(newRB);
            optionsTooltips.SetTip(newRB,
                                   "Te permite crear una base de datos nueva",
                                   "new databse description");

            optionsTooltips.Enable();

            learnSymbolDatabaseChooserDialog.ShowAll();
        }
コード例 #2
0
        // Handlers :: OnStateChangedEvent
        private void OnStateChangedEvent(bool playing)
        {
            if (playing)
            {
                tooltips.Enable();
            }
            else
            {
                tooltips.Disable();
            }

            this.playing = playing;

            UpdateImage();
        }
コード例 #3
0
        public void ShowControlBox(Gtk.VBox labels, Gtk.VBox widgets)
        {
            Tooltips tooltips = new Tooltips();

            coresize               = new HScale(0, 100, 5);
            coresize.Value         = coresizevalue;
            coresize.ValueChanged += new EventHandler(coresize_ValueChanged);
            tooltips.SetTip(coresize, "Radius of core.  Core has no fall-off", "Radius of core.  Inside core, brush has full effect; outside of core, brush effect falls off towards the edge.");
            tooltips.Enable();

            labels.PackEnd(new Label("Brush core radius:"));
            widgets.PackEnd(coresize);
            labels.ShowAll();
            widgets.ShowAll();
        }
コード例 #4
0
        public LogicWidget(PhotoQuery query, TagStore tag_store, TagSelectionWidget selector) : base()
        {
            //SetFlag (WidgetFlags.NoWindow);
            this.query = query;
            this.tag_selection_widget = selector;

            CanFocus  = true;
            Sensitive = true;

            Literal.Tips = tips;

            tips.Enable();

            Init();

            tag_store.ItemsChanged += HandleTagChanged;
            tag_store.ItemsRemoved += HandleTagDeleted;

            Show();

            logic_widget = this;
        }
コード例 #5
0
		/// <summary>
		/// <c>LearnSymbolDatabaseChooserDialog</c>'s constructor.
		/// </summary>
		/// <param name="parent">
		/// The dialog's parent dialog, to which it's modal.
		/// </param>
		/// <param name="databases">
		/// The databases the user can choose from.
		/// </param>
		public LearnSymbolDatabaseChooserDialog(Window parent,
		                                        List<DatabaseFileInfo> databases)
		{
			XML gxml = new XML(null, 
			                   "mathtextrecognizer.glade", 
			                   "learnSymbolDatabaseChooserDialog",
			                   null);
			
			gxml.Autoconnect(this);
			
			learnSymbolDatabaseChooserDialog.Modal=true;
			learnSymbolDatabaseChooserDialog.Resizable = false;
			learnSymbolDatabaseChooserDialog.TransientFor = parent;
			
			databaseHash = new Dictionary<string,DatabaseFileInfo>();
			
			optionsTooltips = new Tooltips();
			
			RadioButton groupRB = new RadioButton("group");
			foreach(DatabaseFileInfo databaseInfo in databases)
			{
				// We add a new option per database
				string label = System.IO.Path.GetFileName(databaseInfo.Path);
				RadioButton optionRB = new RadioButton(groupRB, label);
				
				optionRB.Clicked += new EventHandler(OnOptionRBClicked);
				optionsVB.Add(optionRB);
				
				MathTextDatabase database = databaseInfo.Database;
			
				
				optionsTooltips.SetTip(optionRB, 
				                       String.Format("{0}\n{1}",
				                                     database.ShortDescription,
				                                     database.Description),
				                       "database description");
				
				databaseHash.Add(label, databaseInfo);
			}
			
			// We add the option of creating a new database.
			newRB = new RadioButton(groupRB, "Crear nueva base de datos");
			newRB.Clicked += new EventHandler(OnOptionRBClicked);
			optionsVB.Add(newRB);
			optionsTooltips.SetTip(newRB, 
			                       "Te permite crear una base de datos nueva",
			                       "new databse description");
			
			optionsTooltips.Enable();
			
			learnSymbolDatabaseChooserDialog.ShowAll();
		}
コード例 #6
0
    private PhotoEditorUI(ArrayList selectedphotos, DeskFlickrUI.ModeSelected mode)
    {
        Glade.XML gxml = new Glade.XML(null, "organizer.glade", "window2", null);
        gxml.Autoconnect(this);
        _isconflictmode = (mode == DeskFlickrUI.ModeSelected.ConflictMode);
        _isuploadmode   = (mode == DeskFlickrUI.ModeSelected.UploadMode);
        _isblogmode     = (mode == DeskFlickrUI.ModeSelected.BlogMode);
        if (mode == DeskFlickrUI.ModeSelected.BlogAndConflictMode)
        {
            _isconflictmode = true;
            _isblogmode     = true;
        }
        _tags         = new ArrayList();
        _comments     = new ArrayList();
        window2.Title = "Edit information for " + selectedphotos.Count + " photos";
        window2.SetIconFromFile(DeskFlickrUI.ICON_PATH);
        notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Information");
        notebook1.NextPage();
        notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Tags");
        notebook1.NextPage();
        notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Comments");

        tips = new Tooltips();
        SetCommentsToolBar();
        tips.Enable();
        SetCommentsTree();

        if (_isconflictmode)
        {
            notebook1.NextPage();
            notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Information at Server");
        }
        else
        {
            notebook1.RemovePage(3);
        }

        if (_isblogmode)
        {
            notebook1.NextPage();
            notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Blog Entry");
            notebook1.Page = 3;         // Default page is blog entry if editor is in Blog mode.
        }
        else
        {
            if (_isconflictmode)
            {
                notebook1.RemovePage(4);
            }
            else
            {
                notebook1.RemovePage(3);
            }
            notebook1.Page = 0;         // Default page is photo editing.
        }


        table1.SetColSpacing(0, 50);
        // Set Labels
        label6.Text = "Edit";
        label5.Text = "Title:";
        label4.Text = "Description:";
        label3.Text = "Visibility:";
        label2.Text = "License:";
        if (_isuploadmode)
        {
            label2.Sensitive = false;
        }
        // Labels for blog tab.
        label17.Text = "Title: ";
        label18.Text = "Description: ";

        // Search box
        label15.Markup  = "<span weight='bold'>Search: </span>";
        entry2.Changed += new EventHandler(OnFilterEntryChanged);

        // Revert button
        button9.Label    = "Revert Photo(s)";
        button9.Clicked += new EventHandler(OnRevertButtonClicked);

        // entry1.ModifyFont(Pango.FontDescription.FromString("FreeSerif 10"));
        SetPrivacyComboBox();
        SetLicenseComboBox();
        SetTagTreeView();

        // Make previous and next buttons insensitive. They'll become sensitive
        // only when the user ticks the 'Per Photo' checkbutton.
        button3.Sensitive     = false;
        button4.Sensitive     = false;
        checkbutton1.Toggled += new EventHandler(OnPerPageCheckToggled);
        button3.Clicked      += new EventHandler(OnPrevButtonClick);
        button4.Clicked      += new EventHandler(OnNextButtonClick);
        button5.Clicked      += new EventHandler(OnSaveButtonClick);
        button6.Clicked      += new EventHandler(OnCancelButtonClick);

        entry1.Changed           += new EventHandler(OnTitleChanged);
        textview5.Buffer.Changed += new EventHandler(OnDescChanged);

        combobox1.Changed += new EventHandler(OnPrivacyChanged);
        combobox2.Changed += new EventHandler(OnLicenseChanged);

        entry4.Changed           += new EventHandler(OnBlogTitleChanged);
        textview7.Buffer.Changed += new EventHandler(OnBlogDescChanged);

        textview3.Buffer.Changed += new EventHandler(OnTagsChanged);

        TextTag texttag = new TextTag("conflict");

        texttag.Font          = "Times Italic 10";
        texttag.WrapMode      = WrapMode.Word;
        texttag.ForegroundGdk = new Gdk.Color(0x99, 0, 0);
        textview4.Buffer.TagTable.Add(texttag);

        // Showing photos should be the last step.
        this._selectedphotos = selectedphotos;
        if (selectedphotos.Count == 1)
        {
            checkbutton1.Sensitive = false;
            ShowInformationForCurrentPhoto();
        }
        else
        {
            EmbedCommonInformation();
        }
        // Save a copy of the original photos, so that only those photos
        // which  have been edited, would have their dirty bit set. Advantage:
        // this would reduce the number of dirty photos, and hence there'll
        // be lesser photos to update when sycing with server.
        _originalphotos = new System.Collections.Generic.Dictionary <string, Photo>();
        foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos)
        {
            Photo p = sel.photo;
            _originalphotos.Add(p.Id, new Photo(p));
        }

        eventbox5.ButtonPressEvent += OnLinkPressed;
        eventbox5.EnterNotifyEvent += MouseOnLink;
        eventbox5.LeaveNotifyEvent += MouseLeftLink;

        window2.ShowAll();
    }
コード例 #7
0
ファイル: DeskFlickrUI.cs プロジェクト: joshuacox/dfo
    public void CreateGUI()
    {
        Application.Init();
          Glade.XML gxml = new Glade.XML (null, "organizer.glade", "window1", null);
          gxml.Autoconnect (this);

          // Wao! Loading an image from file, didn't work when it was located
          // in object constructor i.e. DeskFlickrUI(). Shifting it to this
          // place, magically works!
          _nophotothumbnail = new Gdk.Pixbuf(SQTHUMBNAIL_PATH);

          tips = new Tooltips();

          // Popup upload window, and label box.
          eventbox6.ModifyBg(StateType.Normal, tabcolor);

          // The value of stream button in this toolbar is being used by
          // other initializations. So, this should be positioned _before_ them.
          SetHorizontalToolBar();
          SetTopLeftToolBar();

          // Set Text for the label
          label1.Text = "Desktop Flickr Organizer";
          label12.Markup = "<span weight='bold'>Search: </span>";
          label19.Text = "";
          Gdk.Color greycolor = new Gdk.Color(0x7F, 0x7C, 0x7C);
          eventbox11.ModifyBg(StateType.Normal, greycolor);

          // Set Flames window label size.
          label11.Wrap = true;
          int height;
          int width;
          eventbox3.GetSizeRequest(out width, out height);
          label11.SetSizeRequest(width, height);

          tips.SetTip(eventbox3, "Flames Window", "Flames Window");
          tips.Enable();
          // Set upload window label.
          popuplabel = new Label();

          entry5.Changed += new EventHandler(OnFilterEntryChanged);
          checkbutton2.Toggled += new EventHandler(OnFilterEntryChanged);
          checkbutton3.Toggled += new EventHandler(OnFilterEntryChanged);
          checkbutton4.Toggled += new EventHandler(OnFilterEntryChanged);

          SetLeftTextView();
          SetLeftTreeView();
          SetRightTreeView();

          // Set the menu bar
          SetMenuBar();
          SetVerticalBar();
          SetFlamesWindow();

          SetIsConnected(0);
          progressbar2.Text = "Upload Status";
          // Set window properties
          window1.SetIconFromFile(ICON_PATH);
          window1.DeleteEvent += OnWindowDeleteEvent;
          RestoreWindow();
          window1.ShowAll();
          Application.Run();
    }
コード例 #8
0
ファイル: PhotoEditorUI.cs プロジェクト: joshuacox/dfo
    private PhotoEditorUI(ArrayList selectedphotos, DeskFlickrUI.ModeSelected mode)
    {
        Glade.XML gxml = new Glade.XML (null, "organizer.glade", "window2", null);
          gxml.Autoconnect (this);
          _isconflictmode = (mode == DeskFlickrUI.ModeSelected.ConflictMode);
          _isuploadmode = (mode == DeskFlickrUI.ModeSelected.UploadMode);
          _isblogmode = (mode == DeskFlickrUI.ModeSelected.BlogMode);
          if (mode == DeskFlickrUI.ModeSelected.BlogAndConflictMode) {
        _isconflictmode = true;
        _isblogmode = true;
          }
          _tags = new ArrayList();
          _comments = new ArrayList();
          window2.Title = "Edit information for " + selectedphotos.Count + " photos";
          window2.SetIconFromFile(DeskFlickrUI.ICON_PATH);
          notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Information");
          notebook1.NextPage();
          notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Tags");
          notebook1.NextPage();
          notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Comments");

          tips = new Tooltips();
          SetCommentsToolBar();
          tips.Enable();
          SetCommentsTree();

          if (_isconflictmode) {
            notebook1.NextPage();
            notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Information at Server");
          } else {
            notebook1.RemovePage(3);
          }

          if (_isblogmode) {
            notebook1.NextPage();
            notebook1.SetTabLabelText(notebook1.CurrentPageWidget, "Blog Entry");
            notebook1.Page = 3; // Default page is blog entry if editor is in Blog mode.
          } else {
            if (_isconflictmode) notebook1.RemovePage(4);
            else notebook1.RemovePage(3);
            notebook1.Page = 0; // Default page is photo editing.
          }

          table1.SetColSpacing(0, 50);
          // Set Labels
          label6.Text = "Edit";
          label5.Text = "Title:";
          label4.Text = "Description:";
          label3.Text = "Visibility:";
          label2.Text = "License:";
          if (_isuploadmode) label2.Sensitive = false;
          // Labels for blog tab.
          label17.Text = "Title: ";
          label18.Text = "Description: ";

          // Search box
          label15.Markup = "<span weight='bold'>Search: </span>";
          entry2.Changed += new EventHandler(OnFilterEntryChanged);

          // Revert button
          button9.Label = "Revert Photo(s)";
          button9.Clicked += new EventHandler(OnRevertButtonClicked);

          // entry1.ModifyFont(Pango.FontDescription.FromString("FreeSerif 10"));
          SetPrivacyComboBox();
          SetLicenseComboBox();
          SetTagTreeView();

          // Make previous and next buttons insensitive. They'll become sensitive
          // only when the user ticks the 'Per Photo' checkbutton.
          button3.Sensitive = false;
          button4.Sensitive = false;
          checkbutton1.Toggled += new EventHandler(OnPerPageCheckToggled);
          button3.Clicked += new EventHandler(OnPrevButtonClick);
          button4.Clicked += new EventHandler(OnNextButtonClick);
          button5.Clicked += new EventHandler(OnSaveButtonClick);
          button6.Clicked += new EventHandler(OnCancelButtonClick);

          entry1.Changed += new EventHandler(OnTitleChanged);
          textview5.Buffer.Changed += new EventHandler(OnDescChanged);

          combobox1.Changed += new EventHandler(OnPrivacyChanged);
          combobox2.Changed += new EventHandler(OnLicenseChanged);

          entry4.Changed += new EventHandler(OnBlogTitleChanged);
          textview7.Buffer.Changed += new EventHandler(OnBlogDescChanged);

          textview3.Buffer.Changed += new EventHandler(OnTagsChanged);

          TextTag texttag = new TextTag("conflict");
          texttag.Font = "Times Italic 10";
          texttag.WrapMode = WrapMode.Word;
          texttag.ForegroundGdk = new Gdk.Color(0x99, 0, 0);
          textview4.Buffer.TagTable.Add(texttag);

          // Showing photos should be the last step.
          this._selectedphotos = selectedphotos;
          if (selectedphotos.Count == 1) {
        checkbutton1.Sensitive = false;
        ShowInformationForCurrentPhoto();
          } else {
        EmbedCommonInformation();
          }
          // Save a copy of the original photos, so that only those photos
          // which  have been edited, would have their dirty bit set. Advantage:
          // this would reduce the number of dirty photos, and hence there'll
          // be lesser photos to update when sycing with server.
          _originalphotos = new System.Collections.Generic.Dictionary<string, Photo>();
          foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos) {
        Photo p = sel.photo;
        _originalphotos.Add(p.Id, new Photo(p));
          }

          eventbox5.ButtonPressEvent += OnLinkPressed;
          eventbox5.EnterNotifyEvent += MouseOnLink;
          eventbox5.LeaveNotifyEvent += MouseLeftLink;

          window2.ShowAll();
    }
コード例 #9
0
ファイル: RoundBrush.cs プロジェクト: hughperkins/osmp-cs
        public void ShowControlBox( Gtk.VBox labels, Gtk.VBox widgets )
        {
            Tooltips tooltips = new Tooltips();

            coresize = new HScale( 0, 100, 5 );
            coresize.Value = coresizevalue;
            coresize.ValueChanged += new EventHandler( coresize_ValueChanged );
            tooltips.SetTip( coresize, "Radius of core.  Core has no fall-off", "Radius of core.  Inside core, brush has full effect; outside of core, brush effect falls off towards the edge." );
            tooltips.Enable();

            labels.PackEnd( new Label( "Brush core radius:" ) );
            widgets.PackEnd( coresize );
            labels.ShowAll();
            widgets.ShowAll();
        }