Beispiel #1
0
        void SetLabel()
        {
            Gtk.MessageDialog md = new Gtk.MessageDialog(null,
                                                         0,
                                                         Gtk.MessageType.Question,
                                                         Gtk.ButtonsType.None,
                                                         "<b>" + Catalog.GetString("Set the timer's label to:") + "</b>");
            md.Title = "Docky Timer";
            md.Icon  = DockServices.Drawing.LoadIcon("docky", 22);
            md.Modal = false;

            md.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
            md.AddButton(Catalog.GetString("_Set Label"), Gtk.ResponseType.Ok);
            md.DefaultResponse = Gtk.ResponseType.Ok;

            Gtk.Entry labelEntry = new Gtk.Entry("" + label);
            labelEntry.Activated += delegate {
                Label = labelEntry.Text;
                md.Destroy();
            };
            labelEntry.Show();
            md.VBox.PackEnd(labelEntry);

            md.Response += (o, args) => {
                if (args.ResponseId != Gtk.ResponseType.Cancel)
                {
                    Label = labelEntry.Text;
                }
                md.Destroy();
            };

            md.Show();
        }
 public void SetDirectMode()
 {
     Gtk.Table.TableChild props;
     widgetTable.Remove(latLabel);
     widgetTable.Remove(lonLabel);
     widgetTable.Remove(latWidget);
     widgetTable.Remove(lonWidget);
     widgetTable.Add(m_DirectEntry);
     widgetTable.Add(m_DirectLabel);
     props              = ((Gtk.Table.TableChild)(this.widgetTable[m_DirectLabel]));
     props.TopAttach    = 0;
     props.LeftAttach   = 0;
     props.RightAttach  = 1;
     props.BottomAttach = 1;
     props.XOptions     = AttachOptions.Shrink;
     m_DirectLabel.Show();
     props                     = ((Gtk.Table.TableChild)(this.widgetTable[m_DirectEntry]));
     props.TopAttach           = 0;
     props.LeftAttach          = 1;
     props.RightAttach         = 2;
     props.BottomAttach        = 1;
     props.XOptions            = AttachOptions.Shrink;
     m_DirectEntry.Text        = Utilities.getCoordStringCN(latWidget.getCoordinate(), lonWidget.getCoordinate());
     m_DirectEntry.TooltipText = Catalog.GetString("Coordinates must be typed in using English formatting");
     m_DirectEntry.Show();
     m_IsDirect = true;
 }
Beispiel #3
0
        public override void Init()
        {
            Gtk.Label             label           = new Gtk.Label();
            Pango.FontDescription fontDescription = Pango.FontDescription.FromString(UIUtils.BUTTON_FONT);
            label.ModifyFont(fontDescription);
            label.ShowAll();

            _button               = new Gtk.Button(label);
            _button.CanFocus      = true;
            _button.UseUnderline  = true;
            _button.TooltipText   = GetCommandDescriptor()._command;
            _button.WidthRequest  = _buttonSize.X;
            _button.HeightRequest = _buttonSize.Y;
            _button.Show();
            _button.ButtonPressEvent   += OnButtonPressEvent;
            _button.ButtonReleaseEvent += OnButtonReleaseEvent;

            GetParent().Add(_button);

            _inputArguments               = new Gtk.Entry();
            _inputArguments.CanFocus      = true;
            _inputArguments.Text          = GetCommandDescriptor()._arguments;
            _inputArguments.Name          = "_inputArguments";
            _inputArguments.IsEditable    = true;
            _inputArguments.InvisibleChar = '●';
            _inputArguments.Show();
            _inputArguments.WidthRequest  = _inputSize.X;
            _inputArguments.HeightRequest = _inputSize.Y;
            _inputArguments.TextInserted += OnArgumentsTextInserted;
            GetParent().Add(_inputArguments);

            Refresh();
        }
        public OpenRemoteServer () : base (Catalog.GetString ("Open remote DAAP server"), null)
        {
            VBox.Spacing = 6;
            VBox.PackStart (new Label () {
                Xalign = 0.0f,
                Text = Catalog.GetString ("Enter server IP address and port:")
            }, true, true, 0);

            HBox box = new HBox ();
            box.Spacing = 12;
            VBox.PackStart (box, false, false, 0);

            address_entry = new Entry ();
            address_entry.Activated += OnEntryActivated;
            address_entry.WidthChars = 30;
            address_entry.Show ();

            port_entry = new SpinButton (1d, 65535d, 1d);
            port_entry.Value = 3689;
            port_entry.Show ();

            box.PackStart (address_entry, true, true, 0);
            box.PackEnd (port_entry, false, false, 0);

            address_entry.HasFocus = true;

            VBox.ShowAll ();

            AddStockButton (Stock.Cancel, ResponseType.Cancel);
            AddStockButton (Stock.Ok, ResponseType.Ok, true);
        }
 public ToolbarEntry(ICommand cmd)
     : base(cmd)
 {
     entry = new Entry ();
     entry.Activated += new EventHandler (OnActivated);
     entry.Text = cmd.Properties.Text;
     this.Add (entry);
     entry.Show ();
     this.ShowAll ();
 }
Beispiel #6
0
 static void one_act(Gtk.Entry entry, Gtk.ToggleButton butn)
 {
     if (butn.Active == true)
     {
         entry.Sensitive = false;
         entry.Hide();
     }
     else
     {
         entry.Sensitive = true;
         entry.Show();
     }
 }
            // FIXME clicking the spinbutton too fast seems to switch the view to browse

            public FaceBox(Gtk.Box tb, PhotoImageView vw) : base()
            {
                m_list     = new ArrayList();
                face_store = Core.Database.Faces;
                View       = vw;
                tag_store  = FSpot.Core.Database.Tags;

                Gtk.Label lab = new Gtk.Label("Face det:");
                lab.Show();
                tb.PackStart(lab, false, true, 0);

                face_button = new ToolbarButton();
                face_button.Add(new Gtk.Image("f-spot-sepia", IconSize.Button));
                tb.PackStart(face_button, false, true, 0);

                face_button.Clicked += HandleFaceButtonClicked;

                tag_entry = new Gtk.Entry("test");
                tag_entry.Show();
                tag_entry.Sensitive = false;
                tb.PackStart(tag_entry, false, true, 0);

                m_newtag_button = new  ToolbarButton();
                m_newtag_button.Add(new Gtk.Image("f-spot-new-tag", IconSize.Button));
                m_newtag_button.Show();
                m_newtag_button.Sensitive = false;
                tb.PackStart(m_newtag_button, false, true, 0);

                m_newtag_button.Clicked += HandleNewTagButtonClicked;

                m_spin = new SpinButton(1, 1, 1);
                m_spin.Show();
                m_spin.Sensitive = false;
                tb.PackStart(m_spin, false, true, 0);

                m_spin.Changed += HandleSpinChanged;

                //m.spin.ValueChanged += jesli w bazie, to pokaz jego tag
                //this.Add(tag_widget);
            }
        public AccountLoginForm(Account account)
            : base(1, 2, false)
        {
            this.account = account;

            BorderWidth = 5;
            RowSpacing = 5;
            ColumnSpacing = 5;

            Label username_label = new Label (Catalog.GetString ("Username:"));
            username_label.Xalign = 1.0f;
            username_label.Show ();

            username_entry = new Entry ();
            username_entry.Show ();

            Attach (username_label, 0, 1, 0, 1, AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            Attach (username_entry, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            username_entry.Text = account.UserName ?? String.Empty;
        }
Beispiel #9
0
		public TaskOptionsDialog(Gtk.Window parent,
		                         Gtk.DialogFlags flags,
		                         Task task)
: base (Catalog.GetString ("Task Options"), parent, flags)
		{
			HasSeparator = false;
			//BorderWidth = 0;
			Resizable = false;
			//Decorated = false;
			this.SetDefaultSize (400, 300);
			this.task = task;

//   Frame frame = new Frame();
//   frame.Shadow = ShadowType.Out;
//   frame.Show();
//   VBox.PackStart (frame, true, true, 0);

			VBox vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			vbox.Show ();
			VBox.PackStart (vbox, true, true, 0);
//   frame.Add (vbox);

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

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

//   Gtk.Label l = new Gtk.Label (
//     string.Format (
//      "<span weight=\"bold\">{0}</span>",
//      Catalog.GetString ("Task Options")));
//   l.UseMarkup = true;
//   l.Show ();
//   vbox.PackStart (l, false, false, 0);

			///
			/// Summary
			///
			Gtk.Label l = new Label (Catalog.GetString ("_Summary:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			summary_entry = new Gtk.Entry ();
			l.MnemonicWidget = summary_entry;
			summary_entry.Text = task.Summary;
			summary_entry.Show ();
			vbox.PackStart (summary_entry, false, false, 0);

			///
			/// Details
			///
			l = new Label (Catalog.GetString ("_Details:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			details_text_view = new TextView ();
			l.MnemonicWidget = details_text_view;
			details_text_view.WrapMode = WrapMode.Word;
			details_text_view.Show ();

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.EtchedIn;
			sw.Add (details_text_view);
			sw.Show ();

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

			///
			/// Completion Checkbox
			///
			HBox hbox = new Gtk.HBox (false, 4);

			completed_check_button = new Gtk.CheckButton (
			        task.IsComplete ?
			        Catalog.GetString ("_Completed:") :
			        Catalog.GetString ("_Complete"));
			if (task.IsComplete)
				completed_check_button.Active = true;
			completed_check_button.UseUnderline = true;
			completed_check_button.Toggled += OnCompletedCheckButtonToggled;
			completed_check_button.Show ();
			hbox.PackStart (completed_check_button, false, false, 0);

			completed_label = new Gtk.Label (
			        task.IsComplete ?
			        GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) :
			        string.Empty);
			completed_label.Xalign = 0;
			completed_label.Show ();
			hbox.PackStart (completed_label, true, true, 0);

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

			///
			/// Due Date
			///
			hbox = new HBox (false, 4);
			due_date_check_button = new CheckButton (Catalog.GetString ("Due Date:"));
			if (task.DueDate != DateTime.MinValue)
				due_date_check_button.Active = true;
			due_date_check_button.Toggled += OnDueDateCheckButtonToggled;
			due_date_check_button.Show ();
			hbox.PackStart (due_date_check_button, false, false, 0);

			due_date_button =
			        new Gtk.Extras.DateButton (task.DueDate, false);
			if (task.DueDate == DateTime.MinValue)
				due_date_button.Sensitive = false;
			due_date_button.Show ();
			hbox.PackStart (due_date_button, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);

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

			///
			/// Priority
			///
			hbox = new HBox (false, 4);
			priority_check_button = new CheckButton (Catalog.GetString ("Priority:"));
			if (task.Priority != TaskPriority.Undefined)
				priority_check_button.Active = true;
			priority_check_button.Toggled += OnPriorityCheckButtonToggled;
			priority_check_button.Show ();
			hbox.PackStart (priority_check_button, false, false, 0);

			priority_combo_box = ComboBox.NewText ();
			priority_combo_box.AppendText (Catalog.GetString ("None"));
			priority_combo_box.AppendText (Catalog.GetString ("Low"));
			priority_combo_box.AppendText (Catalog.GetString ("Normal"));
			priority_combo_box.AppendText (Catalog.GetString ("High"));
			if (task.Priority == TaskPriority.Undefined)
				priority_combo_box.Sensitive = false;
			priority_combo_box.Active = (int) task.Priority;
			priority_combo_box.Changed += OnPriorityComboBoxChanged;
			priority_combo_box.Show ();
			hbox.PackStart (priority_combo_box, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);
			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
			AddButton (Gtk.Stock.Save, Gtk.ResponseType.Ok, true);

//   if (parent != null)
//    TransientFor = parent;

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

//   if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
//    DestroyWithParent = true;
		}
Beispiel #10
0
        private Gtk.Widget MakeAppearancePage()
        {
            VBox vbox = new VBox (false, 6);
            vbox.BorderWidth = 10;

            VBox sectionVBox = new VBox (false, 4);
            Label l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Color Management"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            HBox hbox = new HBox (false, 6);
            Label lblTodaysTaskColor = new Label ();
            lblTodaysTaskColor.Text = Catalog.GetString ("Today:");
            lblTodaysTaskColor.Xalign = 0;
            lblTodaysTaskColor.WidthRequest = 75;
            lblTodaysTaskColor.Show ();

            IPreferences prefs = application.Preferences;
            txtTodaysTaskColor = new Entry();
            txtTodaysTaskColor.Text = prefs.Get (PreferencesKeys.TodayTaskTextColor);
            txtTodaysTaskColor.Changed += OnTxtTodaysTaskColorChanged;
            txtTodaysTaskColor.Show ();

            btnChangeTodaysTaskColor = new ColorButton();
            string todayTasksColor = prefs.Get (PreferencesKeys.TodayTaskTextColor);
            Gdk.Color currentColor = new Gdk.Color();
            Gdk.Color.Parse (todayTasksColor, ref currentColor);
            btnChangeTodaysTaskColor.Color = currentColor;

            btnChangeTodaysTaskColor.ColorSet += OnBtnChangeTodaysTaskColorColorSet;
            btnChangeTodaysTaskColor.Show ();

            hbox.PackStart (lblTodaysTaskColor, false, false, 0);
            hbox.PackStart (txtTodaysTaskColor, false, false, 0);
            hbox.PackStart (btnChangeTodaysTaskColor, false, false, 0);
            hbox.Show ();

            HBox hbox2 = new HBox (false, 6);

            Label lblOverdueTaskColor = new Label ();
            lblOverdueTaskColor.Text = Catalog.GetString ("Overdue:");
            lblOverdueTaskColor.WidthRequest = 75;
            lblOverdueTaskColor.Xalign = 0;
            lblOverdueTaskColor.Show ();

            txtOverdueTaskColor = new Entry();
            txtOverdueTaskColor.Text = prefs.Get (PreferencesKeys.OverdueTaskTextColor);
            txtOverdueTaskColor.Changed += OnTxtOverdueTaskColorChanged;
            txtOverdueTaskColor.Show ();

            btnChangeOverdueTaskColor = new ColorButton();
            string overdueTasksColor = prefs.Get (PreferencesKeys.OverdueTaskTextColor);
            Gdk.Color overdueColor = new Gdk.Color();
            Gdk.Color.Parse (overdueTasksColor, ref overdueColor);
            btnChangeOverdueTaskColor.Color = overdueColor;

            btnChangeOverdueTaskColor.ColorSet += OnBtnChangeOverdueTaskColorColorSet;
            btnChangeOverdueTaskColor.Show();

            hbox2.PackStart (lblOverdueTaskColor, false, false, 0);
            hbox2.PackStart (txtOverdueTaskColor, false, false, 0);
            hbox2.PackStart (btnChangeOverdueTaskColor, false, false, 0);
            hbox2.Show ();

            sectionVBox.PackStart (hbox, false, false, 0);
            sectionVBox.PackStart (hbox2, false, false, 0);
            sectionVBox.Show();

            vbox.PackStart (sectionVBox, false, false, 0);

            return vbox;
        }
        void CreateWidget()
        {
            Homogeneous = false;
            Spacing = 1;

            Add (date_entry = new Entry () {WidthChars = 10, IsEditable = true});
            date_entry.Changed += HandleDateEntryChanged;
            date_entry.Show ();
            var bbox = new HBox ();
            Widget w;
            bbox.Add (w = calendar_label = new Label (Catalog.GetString ("Calendar")));
            w.Show ();
            bbox.Add (w = new Arrow (ArrowType.Down, ShadowType.Out));
            w.Show ();
            bbox.Show ();
            Add (date_button = new Button (bbox));
            date_button.Clicked += HandleCalendarButtonClicked;
            date_button.Show ();
            Add (time_entry = new Entry () {WidthChars = 12, IsEditable = true});
            time_entry.Changed += HandleTimeEntryChanged;
            time_entry.Show ();
            Add (offset_entry = new Entry () {WidthChars = 6, IsEditable = true});
            offset_entry.Changed += HandleOffsetEntryChanged;
            offset_entry.Show ();

            calendar = new Calendar ();
            calendar.DaySelected += HandleCalendarDaySelected;
            calendar.DaySelectedDoubleClick += HandleCalendarDaySelectedDoubleClick;
            var frame = new Frame ();
            frame.Add (calendar);
            calendar.Show ();
            calendar_popup = new Window (WindowType.Popup) {DestroyWithParent = true, Resizable = false};
            calendar_popup.Add (frame);
            calendar_popup.DeleteEvent += HandlePopupDeleted;
            calendar_popup.KeyPressEvent += HandlePopupKeyPressed;
            calendar_popup.ButtonPressEvent += HandlePopupButtonPressed;
            frame.Show ();

            UpdateWidget ();
        }
Beispiel #12
0
        private void Init()
        {
            Logger.Debug("Called Init");
            this.Icon = Utilities.GetIcon("giver-48", 48);
            // Update the window title
            this.Title = string.Format("Giver Preferences");

            //this.DefaultSize = new Gdk.Size (300, 500);
            this.VBox.Spacing     = 0;
            this.VBox.BorderWidth = 0;
            this.SetDefaultSize(450, 100);


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


            // Start with an event box to paint the background white
            EventBox eb = new EventBox();

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

            VBox mainVBox = new VBox();

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

            Label label = new Label();

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

            // Name Box at the top of the Widget
            HBox nameBox = new HBox();

            nameBox.Show();
            nameEntry = new Entry();
            nameEntry.Show();
            nameBox.PackStart(nameEntry, true, true, 0);
            nameBox.Spacing = 10;
            mainVBox.PackStart(nameBox, false, false, 0);

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

            Gtk.Table table = new Table(4, 3, false);
            table.Show();
            // None Entry
            noneButton = new RadioButton((Gtk.RadioButton)null);
            noneButton.Show();
            table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            VBox vbox = new VBox();

            vbox.Show();
            Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
            image.Show();
            vbox.PackStart(image, false, false, 0);
            label = new Label("None");
            label.Show();
            vbox.PackStart(label, false, false, 0);
            table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            vbox = new VBox();
            vbox.Show();
            table.Attach(vbox, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

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

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

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

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


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

            fileLocationButton = new FileChooserButton("Select storage location",
                                                       FileChooserAction.SelectFolder);
            fileLocationButton.Show();

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

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

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

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

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

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

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

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

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

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

            DeleteEvent += WindowDeleted;
        }
Beispiel #13
0
        void createCritRow(string attr, string op, string val)
        {
            _numCriteria++;

            HBox hbox = new HBox(false, 0);

            critVbox.PackStart(hbox, true, true, 0);

            Gtk.Entry attrEntry = new Gtk.Entry();
            attrEntry.Text = attr;
            attrEntry.Show();
            hbox.PackStart(attrEntry, true, true, 5);

            VBox vbox75 = new VBox(false, 0);

            vbox75.Show();
            hbox.PackStart(vbox75, true, true, 5);

            ComboBox critCombo = createCombo(ops);

            comboSetActive(critCombo, ops, op);
            vbox75.PackStart(critCombo, false, true, 16);

            Gtk.Entry valEntry = new Gtk.Entry();
            valEntry.Text = val;
            valEntry.Show();
            hbox.PackStart(valEntry, true, true, 5);

            VBox vbox76 = new VBox(false, 0);

            vbox76.Show();
            hbox.PackStart(vbox76, true, true, 5);

            ComboBox boolCombo = createCombo(boolOps);

            boolCombo.Sensitive = false;
            vbox76.PackStart(boolCombo, false, true, 16);

            if (_numCriteria == 1)
            {
                firstCritCombo          = boolCombo;
                firstCritCombo.Changed += new EventHandler(OnBoolChanged);
            }
            else if (_numCriteria > 1)
            {
                _allCombos.Add(boolCombo);
            }

            SearchCriteria sc = new SearchCriteria(
                hbox, attrEntry, critCombo, valEntry, boolCombo);

            string key = "row" + _numCriteria.ToString();

            _critTable.Add(key, sc);

            if (_numCriteria > 1)
            {
                toggleBoolCombo(_numCriteria);
            }

            critVbox.ShowAll();
        }
Beispiel #14
0
        protected void StringValueToTable(Table container, string name, string valueText, ref int row)
        {
            Label targetLabel = new Label();
            Entry target = new Entry();

            target.Text = valueText;
            target.Sensitive = false;
            target.Show();

            targetLabel.Text = name;
            targetLabel.Xalign = 0;
            targetLabel.Xpad = 13;
            targetLabel.Show();

            container.Attach(targetLabel, (uint)0, (uint)1, (uint)row, (uint)(row + 1), AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            container.Attach(target, (uint)1, (uint)2, (uint)row, (uint)(row + 1), AttachOptions.Expand|AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            row += 1;
            //Console.WriteLine ("Finished writing to row {0}", row);
        }
Beispiel #15
0
        private Gtk.Widget MakeAppearancePage()
        {
            VBox vbox = new VBox(false, 6);

            vbox.BorderWidth = 10;

            VBox  sectionVBox = new VBox(false, 4);
            Label l           = new Label();

            l.Markup = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                     Catalog.GetString("Color Management"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            HBox  hbox = new HBox(false, 6);
            Label lblTodaysTaskColor = new Label();

            lblTodaysTaskColor.Text         = Catalog.GetString("Today:");
            lblTodaysTaskColor.Xalign       = 0;
            lblTodaysTaskColor.WidthRequest = 75;
            lblTodaysTaskColor.Show();

            IPreferences prefs = application.Preferences;

            txtTodaysTaskColor          = new Entry();
            txtTodaysTaskColor.Text     = prefs.Get(PreferencesKeys.TodayTaskTextColor);
            txtTodaysTaskColor.Changed += OnTxtTodaysTaskColorChanged;
            txtTodaysTaskColor.Show();

            btnChangeTodaysTaskColor = new ColorButton();
            string todayTasksColor = prefs.Get(PreferencesKeys.TodayTaskTextColor);

            Gdk.Color currentColor = new Gdk.Color();
            Gdk.Color.Parse(todayTasksColor, ref currentColor);
            btnChangeTodaysTaskColor.Color = currentColor;

            btnChangeTodaysTaskColor.ColorSet += OnBtnChangeTodaysTaskColorColorSet;
            btnChangeTodaysTaskColor.Show();

            hbox.PackStart(lblTodaysTaskColor, false, false, 0);
            hbox.PackStart(txtTodaysTaskColor, false, false, 0);
            hbox.PackStart(btnChangeTodaysTaskColor, false, false, 0);
            hbox.Show();

            HBox hbox2 = new HBox(false, 6);

            Label lblOverdueTaskColor = new Label();

            lblOverdueTaskColor.Text         = Catalog.GetString("Overdue:");
            lblOverdueTaskColor.WidthRequest = 75;
            lblOverdueTaskColor.Xalign       = 0;
            lblOverdueTaskColor.Show();

            txtOverdueTaskColor          = new Entry();
            txtOverdueTaskColor.Text     = prefs.Get(PreferencesKeys.OverdueTaskTextColor);
            txtOverdueTaskColor.Changed += OnTxtOverdueTaskColorChanged;
            txtOverdueTaskColor.Show();

            btnChangeOverdueTaskColor = new ColorButton();
            string overdueTasksColor = prefs.Get(PreferencesKeys.OverdueTaskTextColor);

            Gdk.Color overdueColor = new Gdk.Color();
            Gdk.Color.Parse(overdueTasksColor, ref overdueColor);
            btnChangeOverdueTaskColor.Color = overdueColor;

            btnChangeOverdueTaskColor.ColorSet += OnBtnChangeOverdueTaskColorColorSet;
            btnChangeOverdueTaskColor.Show();

            hbox2.PackStart(lblOverdueTaskColor, false, false, 0);
            hbox2.PackStart(txtOverdueTaskColor, false, false, 0);
            hbox2.PackStart(btnChangeOverdueTaskColor, false, false, 0);
            hbox2.Show();

            sectionVBox.PackStart(hbox, false, false, 0);
            sectionVBox.PackStart(hbox2, false, false, 0);
            sectionVBox.Show();

            vbox.PackStart(sectionVBox, false, false, 0);

            return(vbox);
        }
    protected void OnPressEditTopicEvent(object o, EventArgs e)
    {
        int zaznaczony = -1, indeks1 = 0, indeks2 = 0, offset = 0;
        Gtk.Widget[] dzieci = TopicTable.Children;
        Gtk.Entry nazwaTmp = null, katTmp = null;

        if (maszDwaNoweKomponentyDoPoliczenia)
            offset = 12;
        else
            offset = 10;

        for(int i = 0; i < maxTopics; i++)
            if(checkbuttony[i].Active)
                zaznaczony = i;

        //nic nie jest zaznaczone
        if (zaznaczony == -1)
            return;

        zaznaczony %= 5;
        switch (zaznaczony){
            case 0:	indeks1 = dzieci.Length - offset;
                    break;
            case 1:	indeks1 = dzieci.Length - offset - 6;
                    break;
            case 2:	indeks1 = dzieci.Length - offset - 12;
                    break;
            case 3:	indeks1 = dzieci.Length - offset - 18;
                    break;
            case 4:	indeks1 = dzieci.Length - offset - 24;
                    break;
        }

        indeks2 = indeks1 + 4;

        if (EditTopic.Label == "OK"){

            maszDwaNoweKomponentyDoPoliczenia = false;

            if (Proxy.getInstance().canDoQuery("UPDATE", UserList.getInstance().current().status)){
                string lista = " Subjects SET Topic=\'";
                lista += ((Gtk.Entry)dzieci[1]).Text + "\', Cathegory=\'";
                lista += ((Gtk.Entry)dzieci[0]).Text + "\' WHERE id=";
                lista += ((Gtk.Label)dzieci[indeks2 + 2]).Text + ";";
                IDataReader reader = DBQuery.createQuery("UPDATE", lista);
                DBQuery.CloseReader(reader);
            }else{
                Proxy.getInstance().blad("UPDATE");
                return;
            }

            Gtk.MessageDialog msgDialog = new Gtk.MessageDialog(null,
                                                                DialogFlags.DestroyWithParent,
                                      							MessageType.Info,
                                      							ButtonsType.Ok,
                                                                "Dane tematu zostały zmienione");
            msgDialog.Run();
            msgDialog.Destroy();
            EditTopic.Label = "Edytuj temat";
            loadTopics();

            prevPage.Visible  = true;
            nextPage.Visible  = true;
            DeleteTopic.Visible = true;
            AddTopic.Visible = true;

            return;
        }

        if (EditTopic.Label == "Edytuj temat"){

            nazwaTmp = new Gtk.Entry(((Gtk.Label)dzieci[indeks2 - 1]).Text);
            katTmp = new Gtk.Entry(((Gtk.Label)dzieci[indeks1]).Text);

            prevPage.Visible  = false;
            nextPage.Visible  = false;
            DeleteTopic.Visible = false;
            AddTopic.Visible = false;

            //po dodaniu dwóch Gtk.Entry się sypie, to jest zabezpieczenie
            maszDwaNoweKomponentyDoPoliczenia = true;

            EditTopic.Label = "OK";

            nazwaTmp.WidthChars = 10;
            katTmp.WidthChars = 10;

            //schowanie etykiet
            dzieci[indeks2 - 1].Hide();
            dzieci[indeks1].Hide();

            //pokazanie pól tekstowych
            TopicTable.Attach(nazwaTmp, 1, 2, (uint)(zaznaczony + 1), (uint)(zaznaczony + 2));
            TopicTable.Attach(katTmp, 4, 5, (uint)(zaznaczony + 1), (uint)(zaznaczony + 2));
            nazwaTmp.Show();
            katTmp.Show();
        }
    }
    void showWidgetsPowerful(ArrayList widgetArray)
    {
        Constants.GenericWindowShow stuff = (Constants.GenericWindowShow)widgetArray[0];
        bool   editable = (bool)widgetArray[1];
        string text     = (string)widgetArray[2];

        if (stuff == Constants.GenericWindowShow.ENTRY)
        {
            entry.Show();
            entry.IsEditable = editable;
            entry.Sensitive  = editable;
            entry.Text       = text;
        }
        else if (stuff == Constants.GenericWindowShow.ENTRY2)
        {
            hbox_entry2.Show();
            entry2.IsEditable = editable;
            entry2.Sensitive  = editable;
            entry2.Text       = text;
        }
        else if (stuff == Constants.GenericWindowShow.ENTRY3)
        {
            hbox_entry3.Show();
            entry3.IsEditable = editable;
            entry3.Sensitive  = editable;
            entry3.Text       = text;
        }
        else if (stuff == Constants.GenericWindowShow.SPININT)
        {
            hbox_spin_int.Show();
            spin_int.IsEditable = editable;
            spin_int.Sensitive  = editable;
        }
        else if (stuff == Constants.GenericWindowShow.SPINDOUBLE)
        {
            spin_double.Show();
            spin_double.IsEditable = editable;
        }
        else if (stuff == Constants.GenericWindowShow.HBOXSPINDOUBLE2)
        {
            hbox_spin_double2.Show();
            spin_double2.IsEditable = editable;
            spin_double2.Sensitive  = editable;
        }
        else if (stuff == Constants.GenericWindowShow.SPININT2)
        {
            hbox_spin_int2.Show();
            spin_int2.IsEditable = editable;
        }
        else if (stuff == Constants.GenericWindowShow.SPININT3)
        {
            hbox_spin_int3.Show();
            spin_int3.IsEditable = editable;
        }
        else if (stuff == Constants.GenericWindowShow.HEIGHTMETRIC)
        {
            hbox_height_metric.Show();
        }
        else if (stuff == Constants.GenericWindowShow.COMBO)
        {
            /*
             * hbox_combo.Show();
             * combo.Show();
             */
        }
        else if (stuff == Constants.GenericWindowShow.COMBOALLNONESELECTED)
        {
            //createComboCheckBoxes();
            //combo_all_none_selected.Active =
            //	UtilGtk.ComboMakeActive(comboCheckBoxesOptions, Catalog.GetString("Selected"));
            hbox_combo_all_none_selected.Show();
            hbox_all_none_selected.Show();
        }
        else if (stuff == Constants.GenericWindowShow.BUTTONMIDDLE)
        {
            hbuttonbox_middle.Show();
        }
        else if (stuff == Constants.GenericWindowShow.TEXTVIEW)
        {
            scrolled_window_textview.Show();
        }
        else           //if(stuff == Constants.GenericWindowShow.TREEVIEW)
        {
            scrolled_window_treeview.Show();
        }
    }
 public ToolbarEntry()
     : base()
 {
     entry = new Entry ();
     entry.Activated += new EventHandler (OnActivated);
     this.Add (entry);
     entry.Show ();
     this.ShowAll ();
 }
        private HBox BuildLimitFooter()
        {
            HBox limitFooter = new HBox();
            limitFooter.Show();
            limitFooter.Spacing = 5;

            limitCheckBox = new CheckButton("Limit to");
            limitCheckBox.Show();
            limitCheckBox.Toggled += OnLimitCheckBoxToggled;
            limitFooter.PackStart(limitCheckBox, false, false, 0);

            limitEntry = new Entry("25");
            limitEntry.Show();
            limitEntry.SetSizeRequest(50, -1);
            limitFooter.PackStart(limitEntry, false, false, 0);

            limitComboBox = ComboBox.NewText();
            limitComboBox.Show();
            foreach(string criteria in model.LimitCriteria)
                limitComboBox.AppendText(criteria);
            limitComboBox.Active = 0;
            limitFooter.PackStart(limitComboBox, false, false, 0);

            Label orderLabel = new Label("selected by");
            orderLabel.Show();
            limitFooter.PackStart(orderLabel, false, false, 0);

            orderComboBox = ComboBox.NewText();
            orderComboBox.Show();
            foreach(string order in model.OrderCriteria)
                orderComboBox.AppendText(order);
            orderComboBox.Active = 0;
            limitFooter.PackStart(orderComboBox, false, false, 0);

            limitCheckBox.Active = false;
            OnLimitCheckBoxToggled(limitCheckBox, null);

            return limitFooter;
        }
Beispiel #20
0
        /*		private void OnStatusComboKeyPress (object sender, KeyPressEventArgs args)
        {
            if (args.Event.Key == Gdk.Key.Return) {
                if (PersonManager.Me != null) {
                    Logger.Debug ("FIXME: Set \"my\" status to: {0}",
                            statusComboBoxEntry.ActiveText);
                    PersonManager.Me.Presence.Message =
                            statusComboBoxEntry.ActiveText;
                }
            }
        }
        */
        /*		private void OnStatusComboChanged (object sender, EventArgs args)
        {
            Logger.Debug ("OnStatusComboChanged");
        }
        */
        private Widget CreateSidebarSearchEntry()
        {
            VBox vbox = new VBox (false, 0);

            Label l = new Label (
                    string.Format ("<span size=\"large\">{0}</span>",
                        Catalog.GetString ("Filter")));
            l.UseMarkup = true;
            l.ModifyFg (StateType.Normal, this.Style.Base (StateType.Selected));
            l.Xalign = 0;
            l.Show ();
            vbox.PackStart (l, false, false, 0);

            searchEntry = new Entry ();
            searchEntry.SelectRegion (0, -1);
            searchEntry.CanFocus = true;
            searchEntry.Changed += OnSearchEntryChanged;
            searchEntry.Show ();

            Image stopImage = new Image (Stock.Stop, Gtk.IconSize.Menu);
            stopImage.SetAlignment (0.5F, 0.0F);

            cancelSearchButton = new Button (stopImage);
            cancelSearchButton.Relief = ReliefStyle.None;
            cancelSearchButton.Sensitive = false;
            cancelSearchButton.Clicked += OnCancelSearchButton;
            cancelSearchButton.Show ();

            HBox searchHBox = new HBox (false, 4);
            searchHBox.PackStart (searchEntry, true, true, 0);
            searchHBox.PackStart (cancelSearchButton, false, false, 0);

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

            return vbox;
        }
		// FIXME clicking the spinbutton too fast seems to switch the view to browse
			
		public FaceBox (Gtk.Box tb, PhotoImageView vw) : base() {
			
			m_list = new ArrayList();
			face_store = Core.Database.Faces;
			View = vw;
			tag_store = FSpot.Core.Database.Tags;
			
			Gtk.Label lab = new Gtk.Label("Face det:");
			lab.Show();
			tb.PackStart(lab, false, true, 0);
				
			face_button = new ToolbarButton ();
			face_button.Add (new Gtk.Image ("f-spot-sepia", IconSize.Button));
			tb.PackStart (face_button, false, true, 0);
				
			face_button.Clicked += HandleFaceButtonClicked;
			
			tag_entry = new Gtk.Entry ("test");
			tag_entry.Show();
				tag_entry.Sensitive = false;
			tb.PackStart(tag_entry, false, true, 0);
				
			m_newtag_button = new  ToolbarButton ();
			m_newtag_button.Add (new Gtk.Image ("f-spot-new-tag", IconSize.Button));
			m_newtag_button.Show();
			m_newtag_button.Sensitive = false;
			tb.PackStart(m_newtag_button,false,true,0);	
			
			m_newtag_button.Clicked += HandleNewTagButtonClicked;				
						
			m_spin = new SpinButton(1,1,1);
			m_spin.Show();
			m_spin.Sensitive = false;
			tb.PackStart(m_spin, false, true, 0);
				
			m_spin.Changed += HandleSpinChanged;
				
			//m.spin.ValueChanged += jesli w bazie, to pokaz jego tag
			//this.Add(tag_widget);
			
		}
Beispiel #22
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 #23
0
        public void PasswordProvider (PdfPasswordProviderArgs args)
        {
            // This method is called from some random thread, but we need
            // to do the dialog on the GUI thread; use the reset_event
            // to block this thread until the user is done with the dialog.
            ThreadAssist.BlockingProxyToMain (delegate {
                Log.Debug ("Password requested to open document");
                var dialog = new Hyena.Widgets.HigMessageDialog (
                    Window, DialogFlags.Modal, MessageType.Question, ButtonsType.None,
                    Catalog.GetString ("Document is Encrypted"),
                    Catalog.GetString ("Enter the document's password to open it:")
                );
                dialog.Image = Gtk.IconTheme.Default.LoadIcon ("dialog-password", 48, 0);

                var password_entry = new Entry () { Visibility = false };
                password_entry.Show ();
                dialog.LabelVBox.PackStart (password_entry, false, false, 12);

                dialog.AddButton (Stock.Cancel, ResponseType.Cancel, false);
                dialog.AddButton (Stock.Ok, ResponseType.Ok, true);

                var response = (ResponseType)dialog.Run ();
                string password = password_entry.Text;
                dialog.Destroy ();

                if (response == ResponseType.Ok) {
                    args.Password = Document.Password = password;
                } else {
                    Log.Information ("Password dialog cancelled");
                    args.Abort = true;
                }
            });
        }
Beispiel #24
0
        void createCritRow(string attr, string op, string val)
        {
            _numCriteria++;

            HBox hbox = new HBox (false, 0);
            critVbox.PackStart (hbox, true, true, 0);

            Gtk.Entry attrEntry = new Gtk.Entry ();
            attrEntry.Text = attr;
            attrEntry.Show ();
            hbox.PackStart (attrEntry, true, true, 5);

            VBox vbox75 = new VBox (false, 0);
            vbox75.Show ();
            hbox.PackStart (vbox75, true, true, 5);

            ComboBox critCombo = createCombo (ops);
            comboSetActive (critCombo, ops, op);
            vbox75.PackStart (critCombo, false, true, 16);

            Gtk.Entry valEntry = new Gtk.Entry ();
            valEntry.Text = val;
            valEntry.Show ();
            hbox.PackStart (valEntry, true, true, 5);

            VBox vbox76 = new VBox (false, 0);
            vbox76.Show ();
            hbox.PackStart (vbox76, true, true, 5);

            ComboBox boolCombo = createCombo (boolOps);
            boolCombo.Sensitive = false;
            vbox76.PackStart (boolCombo, false, true, 16);

            if (_numCriteria == 1) {
                firstCritCombo = boolCombo;
                firstCritCombo.Changed += new EventHandler (OnBoolChanged);
            } else if (_numCriteria > 1) {
                _allCombos.Add (boolCombo);
            }

            SearchCriteria sc = new SearchCriteria (
                hbox, attrEntry, critCombo, valEntry, boolCombo);

            string key = "row" + _numCriteria.ToString ();

            _critTable.Add (key, sc);

            if (_numCriteria > 1)
                toggleBoolCombo (_numCriteria);

            critVbox.ShowAll ();
        }
Beispiel #25
0
        private Widget MakeGoogleTalkPreferences()
        {
            PropertyEditor peditor;

            VBox vbox = new VBox (false, 4);

            Label label = MakeLabel (
                    string.Format (
                        "<span size=\"larger\" weight=\"bold\">{0}</span>",
                        Catalog.GetString ("GoogleTalk Account Settings")));
            label.Xalign = 0;
            vbox.PackStart (label, false, false, 0);
            label = MakeLabel (
                    string.Format (
                        "<span size=\"smaller\">{0}</span>",
                        Catalog.GetString (
                            "In this alpha-phase of the project, this is the " +
                            "only IM account type we support (so stop your worryin'!).")));
            label.Xalign = 0;
            label.Wrap = true;
            vbox.PackStart (label, false, true, 0);

            Table table = new Table (4, 2, false);
            table.BorderWidth = 8;
            table.RowSpacing = 4;
            table.ColumnSpacing = 8;
            vbox.PackStart (table, true, true, 0);

            // Server address
            label = MakeLabel (Catalog.GetString ("Server Address:"));
            label.Xalign = 1;
            label.Yalign = 0;
            table.Attach (label, 0, 1, 0, 1, AttachOptions.Fill, 0, 0, 0);

            serverAddressEntry = new Entry ();
            label.MnemonicWidget = serverAddressEntry;
            serverAddressEntry.Show ();
            peditor = new PropertyEditorEntry (
                    Preferences.GoogleTalkServer, serverAddressEntry);
            SetupPropertyEditor (peditor);
            table.Attach (serverAddressEntry, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);

            // Server port
            label = MakeLabel (Catalog.GetString ("Server Port:"));
            label.Xalign = 1;
            label.Yalign = 0;
            table.Attach (label, 0, 1, 1, 2, AttachOptions.Fill, 0, 0, 0);

            serverPortEntry = new Entry ();
            label.MnemonicWidget = serverPortEntry;
            serverPortEntry.Show ();
            peditor = new PropertyEditorEntry (
                    Preferences.GoogleTalkPort, serverPortEntry);
            SetupPropertyEditor (peditor);
            table.Attach (serverPortEntry, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);

            // Username
            label = MakeLabel (Catalog.GetString ("Username:"******"Password:"));
            label.Xalign = 1;
            label.Yalign = 0;
            table.Attach (label, 0, 1, 3, 4, AttachOptions.Fill, 0, 0, 0);

            passwordEntry = new Entry ();
            label.MnemonicWidget = passwordEntry;
            passwordEntry.Visibility = false; // password field
            passwordEntry.Show ();
            table.Attach (passwordEntry, 1, 2, 3, 4, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);

            vbox.Show ();

            return vbox;
        }
Beispiel #26
0
    void create()
    {
        entries = new ArrayList();
        radiosM = new ArrayList();
        radiosF = new ArrayList();
        spins = new ArrayList();

        Gtk.Label nameLabel = new Gtk.Label("<b>" + Catalog.GetString("Full name") + "</b>");
        Gtk.Label sexLabel = new Gtk.Label("<b>" + Catalog.GetString("Sex") + "</b>");
        Gtk.Label weightLabel = new Gtk.Label("<b>" + Catalog.GetString("Weight") +
            "</b>(" + Catalog.GetString("Kg") + ")" );

        nameLabel.UseMarkup = true;
        sexLabel.UseMarkup = true;
        weightLabel.UseMarkup = true;

        nameLabel.Xalign = 0;
        sexLabel.Xalign = 0;
        weightLabel.Xalign = 0;

        weightLabel.Show();
        nameLabel.Show();
        sexLabel.Show();

        table_main.Attach (nameLabel, (uint) 1, (uint) 2, 0, 1);
        table_main.Attach (sexLabel, (uint) 2, (uint) 3, 0, 1);
        table_main.Attach (weightLabel, (uint) 3, (uint) 4, 0, 1);

        for (int count=1; count <= rows; count ++) {
            Gtk.Label myLabel = new Gtk.Label((count).ToString());
            table_main.Attach (myLabel, (uint) 0, (uint) 1, (uint) count, (uint) count +1);
            myLabel.Show();
            //labels.Add(myLabel);

            Gtk.Entry myEntry = new Gtk.Entry();
            table_main.Attach (myEntry, (uint) 1, (uint) 2, (uint) count, (uint) count +1);
            myEntry.Show();
            entries.Add(myEntry);

            Gtk.RadioButton myRadioM = new Gtk.RadioButton(Catalog.GetString(Constants.M));
            myRadioM.Show();
            radiosM.Add(myRadioM);

            Gtk.RadioButton myRadioF = new Gtk.RadioButton(myRadioM, Catalog.GetString(Constants.F));
            myRadioF.Show();
            radiosF.Add(myRadioF);

            Gtk.HBox sexBox = new HBox();
            sexBox.PackStart(myRadioM, false, false, 4);
            sexBox.PackStart(myRadioF, false, false, 4);
            sexBox.Show();
            table_main.Attach (sexBox, (uint) 2, (uint) 3, (uint) count, (uint) count +1);

            Gtk.SpinButton mySpin = new Gtk.SpinButton(0, 300, .1);
            table_main.Attach (mySpin, (uint) 3, (uint) 4, (uint) count, (uint) count +1);
            mySpin.Show();
            spins.Add(mySpin);
        }

        string sportStuffString = "";
        if(currentSession.PersonsSportID != Constants.SportUndefinedID)
            sportStuffString += Catalog.GetString("Sport") + ":<i>" + Catalog.GetString(SqliteSport.Select(currentSession.PersonsSportID).Name) + "</i>.";
        if(currentSession.PersonsSpeciallityID != Constants.SpeciallityUndefinedID)
            sportStuffString += " " + Catalog.GetString("Speciallity") + ":<i>" + SqliteSpeciallity.Select(currentSession.PersonsSpeciallityID) + "</i>.";
        if(currentSession.PersonsPractice != Constants.LevelUndefinedID)
            sportStuffString += " " + Catalog.GetString("Level") + ":<i>" + Util.FindLevelName(currentSession.PersonsPractice) + "</i>.";

        if(sportStuffString.Length > 0)
            sportStuffString = Catalog.GetString("Persons will be created with default session values") +
                ":\n" + sportStuffString;
        label_sport_stuff.Text = sportStuffString;
        label_sport_stuff.UseMarkup = true;

        table_main.Show();
    }
		void SetLabel ()
		{
			Gtk.MessageDialog md = new Gtk.MessageDialog (null, 
					  0,
					  Gtk.MessageType.Question, 
					  Gtk.ButtonsType.None,
					  "<b>" + Catalog.GetString ("Set the timer's label to:") + "</b>");
			md.Title = "Docky Timer";
			md.Icon = DockServices.Drawing.LoadIcon ("docky", 22);
			md.Modal = false;
			
			md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
			md.AddButton (Catalog.GetString ("_Set Label"), Gtk.ResponseType.Ok);
			md.DefaultResponse = Gtk.ResponseType.Ok;
			
			Gtk.Entry labelEntry = new Gtk.Entry ("" + label);
			labelEntry.Activated += delegate {
				Label = labelEntry.Text;
				md.Destroy ();
			};
			labelEntry.Show ();
			md.VBox.PackEnd (labelEntry);

			md.Response += (o, args) => {
				if (args.ResponseId != Gtk.ResponseType.Cancel)
					Label = labelEntry.Text;
				md.Destroy ();
			};
			
			md.Show ();
		}
Beispiel #28
0
        private Widget CreateEditWidget()
        {
            statusEntry = new Entry ();
            statusEntry.ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            statusEntry.Activated += OnStatusEntryActivated;
            statusEntry.KeyPressEvent += OnStatusEntryKeyPressEvent;
            statusEntry.Show ();

            return statusEntry;
        }
Beispiel #29
0
    void createEmptyTable()
    {
        entries = new ArrayList();
        radiosM = new ArrayList();
        radiosF = new ArrayList();
        spins = new ArrayList();

        Gtk.Label nameLabel = new Gtk.Label("<b>" + Catalog.GetString("Full name") + "</b>");
        Gtk.Label sexLabel = new Gtk.Label("<b>" + Catalog.GetString("Sex") + "</b>");
        Gtk.Label weightLabel = new Gtk.Label("<b>" + Catalog.GetString("Weight") +
            "</b>(" + Catalog.GetString("Kg") + ")" );

        nameLabel.UseMarkup = true;
        sexLabel.UseMarkup = true;
        weightLabel.UseMarkup = true;

        nameLabel.Xalign = 0;
        sexLabel.Xalign = 0;
        weightLabel.Xalign = 0;

        weightLabel.Show();
        nameLabel.Show();
        sexLabel.Show();

        uint padding = 4;

        table_main.Attach (nameLabel, (uint) 1, (uint) 2, 0, 1,
                Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand , Gtk.AttachOptions.Shrink, padding, padding);
        table_main.Attach (sexLabel, (uint) 2, (uint) 3, 0, 1,
                Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
        table_main.Attach (weightLabel, (uint) 3, (uint) 4, 0, 1,
                Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);

        for (int count=1; count <= rows; count ++) {
            Gtk.Label myLabel = new Gtk.Label((count).ToString());
            table_main.Attach (myLabel, (uint) 0, (uint) 1, (uint) count, (uint) count +1,
                    Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
            myLabel.Show();
            //labels.Add(myLabel);

            Gtk.Entry myEntry = new Gtk.Entry();
            table_main.Attach (myEntry, (uint) 1, (uint) 2, (uint) count, (uint) count +1,
                    Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand , Gtk.AttachOptions.Shrink, padding, padding);
            myEntry.Show();
            entries.Add(myEntry);

            Gtk.RadioButton myRadioM = new Gtk.RadioButton(Catalog.GetString(Constants.M));
            myRadioM.Show();
            radiosM.Add(myRadioM);

            Gtk.RadioButton myRadioF = new Gtk.RadioButton(myRadioM, Catalog.GetString(Constants.F));
            myRadioF.Show();
            radiosF.Add(myRadioF);

            Gtk.HBox sexBox = new HBox();
            sexBox.PackStart(myRadioM, false, false, 4);
            sexBox.PackStart(myRadioF, false, false, 4);
            sexBox.Show();
            table_main.Attach (sexBox, (uint) 2, (uint) 3, (uint) count, (uint) count +1,
                    Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);

            Gtk.SpinButton mySpin = new Gtk.SpinButton(0, 300, .1);
            table_main.Attach (mySpin, (uint) 3, (uint) 4, (uint) count, (uint) count +1,
                    Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, padding, padding);
            mySpin.Show();
            spins.Add(mySpin);
        }

        string sportStuffString = "";
        if(currentSession.PersonsSportID != Constants.SportUndefinedID)
            sportStuffString += Catalog.GetString("Sport") + ":<i>" + Catalog.GetString(SqliteSport.Select(false, currentSession.PersonsSportID).Name) + "</i>.";
        if(currentSession.PersonsSpeciallityID != Constants.SpeciallityUndefinedID)
            sportStuffString += " " + Catalog.GetString("Specialty") + ":<i>" + SqliteSpeciallity.Select(false, currentSession.PersonsSpeciallityID) + "</i>.";
        if(currentSession.PersonsPractice != Constants.LevelUndefinedID)
            sportStuffString += " " + Catalog.GetString("Level") + ":<i>" + Util.FindLevelName(currentSession.PersonsPractice) + "</i>.";

        if(sportStuffString.Length > 0)
            sportStuffString = Catalog.GetString("Persons will be created with default session values") +
                ":\n" + sportStuffString;
        label_message.Text = sportStuffString;
        label_message.UseMarkup = true;
        label_message.Visible = true;

        table_main.Show();
        scrolledwindow.Visible = true;
        notebook.CurrentPage = 0;

        //once loaded table cannot be created again
        //don't do this: it crashes
        //button_manually_created.Sensitive = false;
        //do this:
        created_table = true;

        button_accept.Sensitive = true;
    }
        Func<object> BuildArgumentEntry(Argument a)
        {
            Label lbl = new Label ();
            Entry ety = new Entry ();

            DType t = Mapper.DTypeFromString(a.Type);

            lbl.Text = string.Format ("{0} ({1}) : ", a.Name, Mapper.DTypeToStr (t));
            lbl.Xalign = 0;

            argumentTable.Attach (lbl, 0, 1, rowIndex, rowIndex + 1);
            argumentTable.Attach (ety, 1, 2, rowIndex, rowIndex + 1);
            rowIndex++;

            lbl.Show ();
            ety.Show ();
            argumentTable.ShowAll ();

            return (Func<object>)delegate {
                object result = Mapper.Convert(t, ety.Text);

                return result;
            };
        }
Beispiel #31
0
    protected void OnPressEditTopicEvent(object o, EventArgs e)
    {
        int zaznaczony = -1, indeks1 = 0, indeks2 = 0, offset = 0;

        Gtk.Widget[] dzieci = TopicTable.Children;
        Gtk.Entry    nazwaTmp = null, katTmp = null;

        if (maszDwaNoweKomponentyDoPoliczenia)
        {
            offset = 12;
        }
        else
        {
            offset = 10;
        }

        for (int i = 0; i < maxTopics; i++)
        {
            if (checkbuttony[i].Active)
            {
                zaznaczony = i;
            }
        }

        //nic nie jest zaznaczone
        if (zaznaczony == -1)
        {
            return;
        }

        zaznaczony %= 5;
        switch (zaznaczony)
        {
        case 0: indeks1 = dzieci.Length - offset;
            break;

        case 1: indeks1 = dzieci.Length - offset - 6;
            break;

        case 2: indeks1 = dzieci.Length - offset - 12;
            break;

        case 3: indeks1 = dzieci.Length - offset - 18;
            break;

        case 4: indeks1 = dzieci.Length - offset - 24;
            break;
        }

        indeks2 = indeks1 + 4;

        if (EditTopic.Label == "OK")
        {
            maszDwaNoweKomponentyDoPoliczenia = false;

            if (Proxy.getInstance().canDoQuery("UPDATE", UserList.getInstance().current().status))
            {
                string lista = " Subjects SET Topic=\'";
                lista += ((Gtk.Entry)dzieci[1]).Text + "\', Cathegory=\'";
                lista += ((Gtk.Entry)dzieci[0]).Text + "\' WHERE id=";
                lista += ((Gtk.Label)dzieci[indeks2 + 2]).Text + ";";
                IDataReader reader = DBQuery.createQuery("UPDATE", lista);
                DBQuery.CloseReader(reader);
            }
            else
            {
                Proxy.getInstance().blad("UPDATE");
                return;
            }

            Gtk.MessageDialog msgDialog = new Gtk.MessageDialog(null,
                                                                DialogFlags.DestroyWithParent,
                                                                MessageType.Info,
                                                                ButtonsType.Ok,
                                                                "Dane tematu zostały zmienione");
            msgDialog.Run();
            msgDialog.Destroy();
            EditTopic.Label = "Edytuj temat";
            loadTopics();

            prevPage.Visible    = true;
            nextPage.Visible    = true;
            DeleteTopic.Visible = true;
            AddTopic.Visible    = true;

            return;
        }

        if (EditTopic.Label == "Edytuj temat")
        {
            nazwaTmp = new Gtk.Entry(((Gtk.Label)dzieci[indeks2 - 1]).Text);
            katTmp   = new Gtk.Entry(((Gtk.Label)dzieci[indeks1]).Text);

            prevPage.Visible    = false;
            nextPage.Visible    = false;
            DeleteTopic.Visible = false;
            AddTopic.Visible    = false;

            //po dodaniu dwóch Gtk.Entry się sypie, to jest zabezpieczenie
            maszDwaNoweKomponentyDoPoliczenia = true;

            EditTopic.Label = "OK";

            nazwaTmp.WidthChars = 10;
            katTmp.WidthChars   = 10;

            //schowanie etykiet
            dzieci[indeks2 - 1].Hide();
            dzieci[indeks1].Hide();

            //pokazanie pól tekstowych
            TopicTable.Attach(nazwaTmp, 1, 2, (uint)(zaznaczony + 1), (uint)(zaznaczony + 2));
            TopicTable.Attach(katTmp, 4, 5, (uint)(zaznaczony + 1), (uint)(zaznaczony + 2));
            nazwaTmp.Show();
            katTmp.Show();
        }
    }
Beispiel #32
0
		public NoteFindBar (Note note)
			: base (false, 0)
		{
			this.note = note;

			BorderWidth = 2;

			Gtk.Button button = new Gtk.Button ();
			button.Image = new Gtk.Image (Gtk.Stock.Close, Gtk.IconSize.Menu);
			button.Relief = Gtk.ReliefStyle.None;
			button.Clicked += HideFindBar;
			button.Show ();
			PackStart (button, false, false, 4);

			Gtk.Label label = new Gtk.Label (Catalog.GetString ("_Find:"));
			label.Show ();
			PackStart (label, false, false, 0);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Changed += OnFindEntryChanged;
			entry.Activated += OnFindEntryActivated;
			entry.Show ();
			PackStart (entry, true, true, 0);

			prev_button = new Gtk.Button (Catalog.GetString ("_Previous"));
			prev_button.Image = new Gtk.Arrow (Gtk.ArrowType.Left, Gtk.ShadowType.None);
			prev_button.Relief = Gtk.ReliefStyle.None;
			prev_button.Sensitive = false;
			prev_button.FocusOnClick = false;
			prev_button.Clicked += OnPrevClicked;
			prev_button.Show ();
			PackStart (prev_button, false, false, 0);

			next_button = new Gtk.Button (Catalog.GetString ("_Next"));
			next_button.Image = new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None);
			next_button.Relief = Gtk.ReliefStyle.None;
			next_button.Sensitive = false;
			next_button.FocusOnClick = false;
			next_button.Clicked += OnNextClicked;
			next_button.Show ();
			PackStart (next_button, false, false, 0);

			// Bind ESC to close the FindBar if it's open and has
			// focus or the window otherwise.  Also bind Return and
			// Shift+Return to advance the search if the search
			// entry has focus.
			shift_key_pressed = false;
			entry.KeyPressEvent += KeyPressed;
			entry.KeyReleaseEvent += KeyReleased;
		}
Beispiel #33
0
		private void Init()
		{
			Logger.Debug("Called Init");
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			this.Title = string.Format ("Giver Preferences");	
			
			//this.DefaultSize = new Gdk.Size (300, 500); 	
			this.VBox.Spacing = 0;
			this.VBox.BorderWidth = 0;
			this.SetDefaultSize (450, 100);


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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

			DeleteEvent += WindowDeleted;
		}
Beispiel #34
0
		// Page 2
		// List of Hotkey options
		public Gtk.Widget MakeHotkeysPane ()
		{
			Gtk.Label label;
			Gtk.CheckButton check;
			Gtk.Alignment align;
			Gtk.Entry entry;
			IPropertyEditorBool keybind_peditor;
			IPropertyEditor peditor;

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


			// Hotkeys...

			check = MakeCheckButton (Catalog.GetString ("Listen for _Hotkeys"));
			hotkeys_list.PackStart (check, false, false, 0);

			keybind_peditor =
			        Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_KEYBINDINGS,
			                                        check);
			SetupPropertyEditor (keybind_peditor);

			label = MakeTipLabel (
			                Catalog.GetString ("Hotkeys allow you to quickly access " +
			                                   "your notes from anywhere with a keypress. " +
			                                   "Example Hotkeys: " +
			                                   "<b>&lt;ALT&gt;F11</b>, " +
			                                   "<b>&lt;ALT&gt;N</b>"));
			hotkeys_list.PackStart (label, false, false, 0);

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

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


			// Show notes menu keybinding...

			label = MakeLabel (Catalog.GetString ("Show notes _menu"));
			table.Attach (label, 0, 1, 0, 1);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 0, 1);

			peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_SHOW_NOTE_MENU,
			                                   entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			// Open Start Here keybinding...

			label = MakeLabel (Catalog.GetString ("Open \"_Start Here\""));
			table.Attach (label, 0, 1, 1, 2);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 1, 2);

			peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_OPEN_START_HERE,
			                                   entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			// Create new note keybinding...

			label = MakeLabel (Catalog.GetString ("Create _new note"));
			table.Attach (label, 0, 1, 2, 3);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 2, 3);

			peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_CREATE_NEW_NOTE,
			                                   entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			// Open Search All Notes window keybinding...

			label = MakeLabel (Catalog.GetString ("Open \"Search _All Notes\""));
			table.Attach (label, 0, 1, 3, 4);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 3, 4);

			peditor = Services.Factory.CreatePropertyEditorEntry (
			        Preferences.KEYBINDING_OPEN_RECENT_CHANGES,
			        entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			return hotkeys_list;
		}