Ejemplo n.º 1
0
    protected void OnButtonClicked(object sender, EventArgs e)
    {
        if (sender == button1)
        {

            Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog ("Choose item...", this, FileChooserAction.Open, "Cancel",  ResponseType.Cancel, "Insert Spacer",  ResponseType.None, "Add", ResponseType.Accept);

            Gtk.Alignment align = new Alignment (1, 0, 0, 1);
            Gtk.Frame frame = new Frame ("Position");
            Gtk.HBox hbox = new HBox (false, 4);

            RadioButton rbRight;
            rbRight = new RadioButton ("Right");
            hbox.PackEnd(rbRight, false, false, 1);
            hbox.PackEnd(new RadioButton (rbRight, "Left"), false, false, 1);

            frame.Add (hbox);
            align.Add (frame);
            align.ShowAll ();
            dialog.ExtraWidget = align;

            ResponseType response = (ResponseType)dialog.Run ();
            if (response == ResponseType.Accept) {
                RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" + dialog.Filename + "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' && /bin/sleep 1 &&/usr/bin/killall Dock");
            } else if (response == ResponseType.None) {
                RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '{tile-data={}; tile-type=\"spacer-tile\";}' && /bin/sleep 1 &&/usr/bin/killall Dock");
            }
            dialog.Destroy ();

        }
    }
		public DefaultPolicyOptionsDialog (Gtk.Window parentWindow)
			: base (parentWindow, new PolicySet (),
			        "/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels")
		{
			this.Title = GettextCatalog.GetString ("Custom Policies");
			editingSet = (PolicySet) DataObject;
			
			HBox topBar = new HBox ();
			topBar.Spacing = 3;
			topBar.PackStart (new Label (GettextCatalog.GetString ("Editing Policy:")), false, false, 0);
			
			policiesCombo = ComboBox.NewText ();
			topBar.PackStart (policiesCombo, false, false, 0);
			
			newButton = new Button (GettextCatalog.GetString ("Add Policy"));
			topBar.PackEnd (newButton, false, false, 0);
			
			deleteButton = new Button (GettextCatalog.GetString ("Delete Policy"));
			topBar.PackEnd (deleteButton, false, false, 0);
			
			Alignment align = new Alignment (0f, 0f, 1f, 1f);
			align.LeftPadding = 9;
			align.TopPadding = 9;
			align.RightPadding = 9;
			align.BottomPadding = 9;
			align.Add (topBar);
			
			HeaderBox ebox = new HeaderBox ();
			ebox.GradientBackround = true;
			ebox.SetMargins (0, 1, 0, 0);
			ebox.Add (align);
			
			ebox.ShowAll ();
			
			VBox.PackStart (ebox, false, false, 0);
			VBox.BorderWidth = 0;
			Box.BoxChild c = (Box.BoxChild) VBox [ebox];
			c.Position = 0;
			
			foreach (PolicySet ps in PolicyService.GetUserPolicySets ()) {
				PolicySet copy = ps.Clone ();
				originalSets [copy] = ps;
				sets.Add (copy);
			}
			FillPolicySets ();
			
			policiesCombo.Changed += HandlePoliciesComboChanged;
			newButton.Clicked += HandleNewButtonClicked;
			deleteButton.Clicked += HandleDeleteButtonClicked;
		}
Ejemplo n.º 3
0
        public DropDownButton()
        {
            Gtk.HBox hbox = new Gtk.HBox();

            label              = new Gtk.Label();
            label.Xalign       = 0;
            label.WidthRequest = 125;
            label.Ellipsize    = Pango.EllipsizeMode.End;

            hbox.PackStart(label, true, true, 3);

            hbox.PackEnd(new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.None), false, false, 1);
            hbox.PackEnd(new Gtk.VSeparator(), false, false, 1);
            Child = hbox;
        }
Ejemplo n.º 4
0
        public StatusView(string filepath, VersionControlSystem vc)
            : base(Path.GetFileName(filepath) + " Status")
        {
            this.vc = vc;
            this.filepath = filepath;

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

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

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

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

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

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

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

            main.ShowAll();

            StartUpdate();
        }
Ejemplo n.º 5
0
        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 = ComboBoxEntry.NewText ();
            address_entry.Entry.Activated += OnEntryActivated;
            address_entry.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.Add, ResponseType.Ok, true);

            LoadHistory();
        }
Ejemplo n.º 6
0
		public static Gtk.Window Create ()
		{
			HBox options = new HBox (false, 0);
			CheckButton check_button = null;

			window = new ColorSelectionDialog ("Color selection dialog");
			window.ColorSelection.HasOpacityControl = true;
			window.ColorSelection.HasPalette = true;

			window.SetDefaultSize (250, 200);
			window.VBox.PackStart (options, false, false, 0);
			window.VBox.BorderWidth = 10;

			check_button = new CheckButton("Show Opacity");
			check_button.Active = true;
			options.PackStart (check_button, false, false, 0);
			check_button.Toggled += new EventHandler (Opacity_Callback);

			check_button = new CheckButton("Show Palette");
			check_button.Active = true;
			options.PackEnd (check_button, false, false, 0);
			check_button.Toggled += new EventHandler (Palette_Callback);

			window.ColorSelection.ColorChanged += new EventHandler (Color_Changed);
			window.OkButton.Clicked += new EventHandler (Color_Selection_OK);
			window.CancelButton.Clicked += new EventHandler (Color_Selection_Cancel); 

			options.ShowAll ();

			return window;
		}
Ejemplo n.º 7
0
 // constructor that show the graphic interface to users
 public Graphics(Game g)
     : base(Gtk.WindowType.Toplevel)
 {
     Build ();
       int scale = 10;
       if (Screen.Height < 1000)
     scale = 5;
       this.game = g;
       VBox gridWrapper = new VBox ();
       HBox box = new HBox ();
       this.status = new Label ("");
       this.chooser = new Popup (this, this.game.getChooseableFigures(), handleChooser, scale);
       this.mainGrid = new GridWidget (this.game, clickHandler, scale);
       gridWrapper.PackStart (status, false, false, 0);
       gridWrapper.PackStart (this.mainGrid, false, false, 0);
       this.sidebarLeft = new SidebarWidget (g.getRemovedFigures (), "black", scale);
       box.PackStart (new HBox ());
       box.PackStart (this.sidebarLeft);
       box.PackStart (gridWrapper, false, false, 0);
       this.sidebarRight = new SidebarWidget (g.getRemovedFigures (), "white", scale);
       box.PackEnd (this.sidebarRight);
       box.PackStart (new HBox ());
       box.ShowAll ();
       this.Add (box);
       updateGui (this.game.initialState ());
       this.Show ();
 }
Ejemplo n.º 8
0
        public SdStatusBar(IStatusBarService manager)
        {
            Spacing = 3;
            BorderWidth = 1;

            progress = new ProgressBar ();
            this.PackStart (progress, false, false, 0);

            this.PackStart (txtStatusBarPanel, true, true, 0);
            statusBox = new HBox ();
            statusLabel = new Label ();
            statusLabel.SetAlignment (0, 0.5f);
            statusLabel.Wrap = false;
            statusBox.PackEnd (statusLabel, true, true, 0);
            txtStatusBarPanel.Add (statusBox);

            this.PackStart (cursorStatusBarPanel, false, false, 0);
            cursorLabel = new Label ("  ");
            cursorStatusBarPanel.Add (cursorLabel);

            this.PackStart (modeStatusBarPanel, false, false, 0);
            modeLabel = new Label ("  ");
            modeStatusBarPanel.Add (modeLabel);

            this.PackStart (iconsStatusBarPanel, false, false, 0);
            txtStatusBarPanel.ShowAll ();

            Progress.Hide ();
            Progress.PulseStep = 0.3;
        }
Ejemplo n.º 9
0
        public static void AddNewWordToDic(object sender, EventArgs e)
        {
            var win = new Gtk.Window("Přidej slovo");
            win.SetPosition( WindowPosition.Mouse );
            Label l = new Label();
            l.Text = "Vloží slovo do aktuálně načteného slovníku, avšak nezmění zdroj (např. soubor dic.txt )";

            Entry entry = new Entry();
            Button b = new Button("Přidej");
            VBox vbox = new VBox();
            HBox hbox = new HBox();
            vbox.BorderWidth = 10;

            vbox.PackStart( l );
            vbox.PackEnd( hbox );

            hbox.PackStart( entry );
            hbox.PackEnd( b );

            b.Clicked += delegate {
                game.dictionary.Add( entry.Text );
                win.HideAll();
                win.Destroy();
                win.Dispose();
            };

            win.Add(vbox);
            win.ShowAll();
        }
Ejemplo n.º 10
0
        public SourceFrame(Variable<ProviderFactory> loader)
            : base(3, 2, "Source")
        {
            _loader = loader;

              Table.ColumnSpacing = 12;

              var imageButton = CreateImageButton();
              Attach(imageButton, 0, 1, 0, 1);

              var hbox = new HBox();
              Attach(hbox, 1, 2, 0, 1);

              _imageBox = CreateImageComboBox();
              hbox.Add(_imageBox);
              _refresh = CreateRefreshButton();
              hbox.PackEnd(_refresh, false, false, 0);

              var fileButton = CreateFileButton(imageButton);
              Attach(fileButton, 0, 1, 1, 2);

              var folderButton = CreateFolderButton(fileButton);
              Attach(folderButton, 0, 1, 2, 3);

              _include = CreateIncludeToggleButton();
              Attach(_include, 1, 2, 2, 3);

              SetFileEntry(false);
              _choose.Sensitive = false;
        }
Ejemplo n.º 11
0
        private void AppendChat(IChat chat)
        {
            Gtk.HBox  container = new Gtk.HBox();
            Gtk.Label label     = new Gtk.Label(chat.Name);
            container.PackStart(label);
            Gtk.Button button = new Gtk.Button(new Gtk.Image(Gtk.IconTheme.Default.LookupIcon("gtk-close", 16, Gtk.IconLookupFlags.NoSvg).LoadIcon()));
            button.Clicked += OnClicked;
            button.Relief   = Gtk.ReliefStyle.None;
            button.SetSizeRequest(20, 20);
            container.PackEnd(button);

            Gtk.TextView   view      = new Logopathy.Gui.ChatView(chat);
            ScrolledWindow view_swin = new Gtk.ScrolledWindow(new Gtk.Adjustment(0, 0, 0, 0, 0, 0), new Gtk.Adjustment(0, 0, 0, 0, 0, 0));

            view_swin.Add(view);
            view_swin.SetPolicy(Gtk.PolicyType.Automatic, Gtk.PolicyType.Automatic);

            hash.Add(container, view);

            int pos = AppendPage(view_swin, container);

            container.ShowAll();

            ShowAll();

            AddedChats.Add(chat);
            ChatToPage.Add(chat, pos);
        }
Ejemplo n.º 12
0
    public CatalogPropertiesDialog(Catalog catalog)
    {
        this.catalog = catalog;
        this.Title = String.Format (Mono.Posix.Catalog.GetString ("{0} properties"), catalog.Name);
        this.HasSeparator = false;

        cancelButton = (Button)this.AddButton (Stock.Cancel, 0);
        okButton     = (Button)this.AddButton (Stock.Ok, 1);
        cancelButton.Clicked += OnCancelButtonClicked;
        okButton.Clicked     += OnOkButtonClicked;
        VBox vBox = this.VBox;

        HBox titleBox = new HBox ();
        Gtk.Frame frame = new Frame ("<b>"+Mono.Posix.Catalog.GetString ("Columns to show")+"</b>");
        ((Label)(frame.LabelWidget)).UseMarkup = true;
        titleBox.PackEnd (frame);
        vBox.PackStart (titleBox);

        VBox columnsBox = new VBox ();

        columns = catalog.Columns;
        Hashtable columnsToShow = catalog.ColumnsToShow;
        checks = new Hashtable ();
        foreach (string colName in columns.Keys) {
            if (colName.Equals ("id")) continue;
            CheckButton check = new CheckButton ((string)columns[colName]);
            check.Active = (bool)columnsToShow[colName];
            checks.Add (columns[colName], check);
            columnsBox.PackStart (check);
        }

        frame.Add (columnsBox);

        this.ShowAll();
    }
Ejemplo n.º 13
0
 internal void Init(Gtk.Window parent,
 Widget waitingWidget,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       this.buttonSet = buttonSet;
       VBox contentVBox = new VBox();
       this.VBox.Add(contentVBox);
       HBox h = new HBox();
       contentVBox.PackStart(h, true, true, 0);
       h.BorderWidth = 10;
       h.Spacing = 10;
       if (waitingWidget != null)
       {
        h.PackStart(waitingWidget, false, false, 0);
       }
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       h.PackEnd(v);
       progressBar = new ProgressBar();
       contentVBox.PackStart(progressBar, true, false, 8);
       progressBar.ActivityBlocks = 20;
       progressBar.Orientation = ProgressBarOrientation.LeftToRight;
       progressBar.PulseStep = 0.05;
       contentVBox.ShowAll();
       this.Realized += new EventHandler(OnRealizeWidget);
       switch(buttonSet)
       {
        case ButtonSet.Cancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     break;
        case ButtonSet.None:
        default:
     break;
       }
       bHideCalled = false;
 }
Ejemplo n.º 14
0
        protected virtual void Build()
        {
            var vbox = new Gtk.VBox();
            var hbox = new Gtk.HBox();

#if GTK2
            hbox.PackStart(CreateEntry(), true, true, 2);
            hbox.PackEnd(CreatePopupButton(), true, false, 2);
            vbox.PackStart(hbox, true, true, 4);
#else
            hbox.PackStart(CreateEntry(), true, true, 1);
            hbox.PackEnd(CreatePopupButton(), true, false, 0);
            vbox.PackStart(hbox, true, true, 1);
#endif

            this.Add(vbox);
        }
Ejemplo n.º 15
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            Spacing           = 6;
            this.selectDialog = selectDialog;

            store    = new ListStore(typeof(string), typeof(string), typeof(AssemblyInfo), typeof(bool), typeof(string), typeof(IconId), typeof(int));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += AddReference;
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Path"), new CellRendererText(), "text", ColPath);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            var but = new Gtk.Button(GettextCatalog.GetString("Browse..."));

            but.Clicked += HandleClicked;
            var hbox = new Gtk.HBox();

            hbox.PackEnd(but, false, false, 0);
            PackStart(hbox, false, false, 0);

            ShowAll();
            BorderWidth = 6;
        }
Ejemplo n.º 16
0
		public DemoStockBrowser () : base ("Stock Icons and Items")
		{
			SetDefaultSize (-1, 500);
			BorderWidth = 8;

			HBox hbox = new HBox (false, 8);
			Add (hbox);

			ScrolledWindow sw = new ScrolledWindow ();
			sw.SetPolicy (PolicyType.Never, PolicyType.Automatic);
			hbox.PackStart (sw, false, false, 0);

			ListStore model = CreateModel ();

			TreeView treeview = new TreeView (model);
			sw.Add (treeview);

			TreeViewColumn column = new TreeViewColumn ();
			column.Title = "Name";
			CellRenderer renderer = new CellRendererPixbuf ();
			column.PackStart (renderer, false);
			column.SetAttributes (renderer, "stock_id", Column.Id);
			renderer = new CellRendererText ();
			column.PackStart (renderer, true);
			column.SetAttributes (renderer, "text", Column.Name);

			treeview.AppendColumn (column);
			treeview.AppendColumn ("Label", new CellRendererText (), "text", Column.Label);
			treeview.AppendColumn ("Accel", new CellRendererText (), "text", Column.Accel);
			treeview.AppendColumn ("ID", new CellRendererText (), "text", Column.Id);

			Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f);
			hbox.PackEnd (align, false, false, 0);

			Frame frame = new Frame ("Selected Item");
			align.Add (frame);

			VBox vbox = new VBox (false, 8);
			vbox.BorderWidth = 8;
			frame.Add (vbox);

			typeLabel = new Label ();
			vbox.PackStart (typeLabel, false, false, 0);
			iconImage = new Gtk.Image ();
			vbox.PackStart (iconImage, false, false, 0);
			accelLabel = new Label ();
			vbox.PackStart (accelLabel, false, false, 0);
			nameLabel = new Label ();
			vbox.PackStart (nameLabel, false, false, 0);
			idLabel = new Label ();
			vbox.PackStart (idLabel, false, false, 0);

			treeview.Selection.Mode = Gtk.SelectionMode.Single;
			treeview.Selection.Changed += new EventHandler (SelectionChanged);

			ShowAll ();
		}
Ejemplo n.º 17
0
        protected virtual void Build()
        {
            var hbox3 = new Gtk.HBox();

            hbox3.PackStart(CreateEntry(), true, true, 5);

            hbox3.PackEnd(CreatePopupButton(), false, false, 0);

            this.Add(hbox3);
        }
Ejemplo n.º 18
0
		protected virtual void Build ()
		{
			var hbox3 = new Gtk.HBox ();

			hbox3.PackStart (CreateEntry (), true, true, 5);

			hbox3.PackEnd (CreatePopupButton (), false, false, 0);
			
			this.Add (hbox3);
		}
Ejemplo n.º 19
0
        public MessageDialog(ArrayList list)
            : base(WindowType.Toplevel)
        {
            Title = "Error";
            IconName = "dialog-error";

            DeleteEvent += OnClose;

            Resizable = false;
            BorderWidth = 6;

            vbox = new VBox(false, 6);
            Add(vbox);
            hbox = new HBox(false, 6);

            vbox.PackStart(hbox);

            image = new Image(Stock.DialogError, IconSize.Dialog);
            hbox.PackStart(image);

            table = new Table(2, 3, false);
            table.RowSpacing = 6;
            hbox.PackEnd(table);

            label = new Label();
            label.Markup = "<big><b>Some feeds failed to import</b></big>";
            table.Attach(label, 1, 2, 0, 1);

            buffer = new TextBuffer(new TextTagTable());
            foreach ( string feed in list ) {
                buffer.Text = buffer.Text + feed+"\n";;
            }

            textview = new TextView(buffer);
            textview.Editable = false;
            textview.WrapMode = WrapMode.Word;
            textview.SetSizeRequest(400, 150);

            textviewsw = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
            textviewsw.ShadowType = ShadowType.In;
            textviewsw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            textviewsw.Add(textview);
            table.Attach(textviewsw, 1, 2, 1, 2);

            bbox = new HButtonBox();
            bbox.Layout = ButtonBoxStyle.End;
            bbox.Spacing = 6;
            vbox.PackEnd(bbox);

            close_button = new Button(Stock.Close);
            close_button.Clicked += new EventHandler(OnClose);
            bbox.PackStart(close_button);

            TransientFor = (Browser)Summa.Core.Application.Browsers[0];
        }
Ejemplo n.º 20
0
    private Gtk.Widget CreateObjectList()
    {
        Gtk.HBox hbox = new Gtk.HBox(false, 0);

        Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10);
        Gtk.VScrollbar scrollbar   = new Gtk.VScrollbar(vadjustment);

        hbox.PackStart(new ObjectListWidget(this, vadjustment), true, true, 0);
        hbox.PackEnd(scrollbar, false, true, 0);
        return(hbox);
    }
Ejemplo n.º 21
0
        internal void SetToolbar(DocumentToolbar toolbar)
        {
            toolbar.Add(revertButton);
            toolbar.Add(revertToButton);

            Gtk.HBox a = new Gtk.HBox();
            a.PackEnd(searchEntry, false, false, 0);
            toolbar.Add(a, true);

            toolbar.ShowAll();
        }
Ejemplo n.º 22
0
 private Container createActionButtonsContainer()
 {
     var box = new HBox(false, 0);
     var deleteContactButton = new Button("Delete Contact");
     deleteContactButton.Clicked += delegate(object sender, EventArgs e) {
         ShowDeleteContactDialog();
     };
     box.PackEnd(deleteContactButton, false, false, 0);
     var editContactButton = new Button("Edit Contact");
     editContactButton.Clicked += delegate(object sender, EventArgs e) {
         ShowEditContactDialog ();
     };
     box.PackEnd(editContactButton, false, false, 0);
     var newContactButton = new Button("Add Contact");
     newContactButton.Clicked += delegate(object sender, EventArgs e) {
         ShowNewContactDialog ();
     };
     box.PackEnd(newContactButton, false, false, 0);
     return box;
 }
        public MyTreeViewColumn(string title, Gtk.CellRenderer cell,string prop,int col,bool defaultsort)
            : base(title,cell,prop,col)
        {
            up_arrow = MainClass.GetResource("up_arrow.png");
            down_arrow = MainClass.GetResource("down_arrow.png");
            blank_arrow = MainClass.GetResource("blank_arrow.png");
            model_col = col;
            if(defaultsort)
                col_icon = new Gtk.Image(up_arrow);
            else
                col_icon = new Gtk.Image(blank_arrow);

            Gtk.HBox hb = new Gtk.HBox();
            Gtk.Label lb = new Label(title);
            hb.PackEnd(col_icon);
            hb.PackEnd(lb);
            this.Widget = hb;
            hb.ShowAll();

            base.Clicked += new EventHandler(col_clicked);
        }
        public DeleteConfirmationDialog(ISource delfeed)
            : base(WindowType.Toplevel)
        {
            feed = delfeed;

            Title = "Delete feed?";
            IconName = "edit-delete";

            DeleteEvent += OnCancel;

            Resizable = false;
            BorderWidth = 6;

            vbox = new VBox(false, 6);
            Add(vbox);
            hbox = new HBox(false, 6);

            vbox.PackStart(hbox);

            image = new Image(Stock.Delete, IconSize.Dialog);
            hbox.PackStart(image);

            table = new Table(2, 3, false);
            table.RowSpacing = 6;
            hbox.PackEnd(table);

            label = new Label();
            label.Wrap = true;
            label.Markup = "<b><big>Delete feed "+feed.Name+"?</big></b>";
            table.Attach(label, 1, 2, 0, 1);

            warn_label = new Label();
            warn_label.Wrap = true;
            warn_label.Markup = "This cannot be undone.";
            warn_label.SetAlignment(0.0F, 0.5F);
            table.Attach(warn_label, 1, 2, 1, 2);

            bbox = new HButtonBox();
            bbox.Layout = ButtonBoxStyle.End;
            bbox.Spacing = 6;
            vbox.PackEnd(bbox);

            cancel_button = new Button(Stock.Cancel);
            cancel_button.Clicked += new EventHandler(OnCancel);
            bbox.PackStart(cancel_button);

            delete_button = new Button(Stock.Delete);
            delete_button.Clicked += new EventHandler(OnDelete);
            bbox.PackEnd(delete_button);
        }
Ejemplo n.º 25
0
        public MainWindow()
            : base("Overlaytest")
        {
            VBox vBox = new VBox ();

            _da = new DrawingArea ();
            _da.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));
            _da.SetSizeRequest (400, 300);
            _da.DoubleBuffered = false;
            vBox.PackStart (_da, false, false, 0);

            _scale = new HScale (0, 1, 0.01);
            _scale.DrawValue = false;
            _scale.ValueChanged += ScaleValueChanged;
            vBox.PackStart (_scale, false, false, 0);

            HBox hBox = new HBox ();

            Button btnOpen = new Button ();
            btnOpen.Label = "Open";
            btnOpen.Clicked += ButtonOpenClicked;

            hBox.PackStart (btnOpen, false, false, 0);

            Button btnPlay = new Button ();
            btnPlay.Label = "Play";
            btnPlay.Clicked += ButtonPlayClicked;

            hBox.PackStart (btnPlay, false, false, 0);

            Button btnPause = new Button ();
            btnPause.Label = "Pause";
            btnPause.Clicked += ButtonPauseClicked;

            hBox.PackStart (btnPause, false, false, 0);

            _lbl = new Label ();
            _lbl.Text = "00:00 / 00:00";

            hBox.PackEnd (_lbl, false, false, 0);

            vBox.PackStart (hBox, false, false, 3);

            Add (vBox);

            WindowPosition = Gtk.WindowPosition.Center;
            DeleteEvent += OnDeleteEvent;

            GLib.Timeout.Add (1000, new GLib.TimeoutHandler (UpdatePos));
        }
Ejemplo n.º 26
0
 internal void Init(Gtk.Window parent,
 Widget waitingWidget,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       this.buttonSet = buttonSet;
       HBox h = new HBox();
       h.BorderWidth = 10;
       h.Spacing = 10;
       if (waitingWidget != null)
       {
        h.PackStart(waitingWidget, false, false, 0);
       }
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + statement + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       h.PackEnd(v);
       h.ShowAll();
       this.VBox.Add(h);
       switch(buttonSet)
       {
        case ButtonSet.Cancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     break;
        case ButtonSet.None:
        default:
     break;
       }
 }
Ejemplo n.º 27
0
 public MainWindow() : base("Gtk Embedding Demo")
 {
     var root = new HBox();
     var left  = new VBox();
     left.Add(new Button("I'm GTK button"));
     left.Add(new Calendar());
     root.PackEnd(left, false, false, 0);
     var host = new GtkAvaloniaControlHost() {Content = new MainView()};
     host.SetSizeRequest(600, 600);
     root.PackStart(host, true, true, 0);
     Add(root);
     
     ShowAll();
 }
Ejemplo n.º 28
0
        internal void SetToolbar(DocumentToolbar toolbar)
        {
            if (info.Repository.SupportsRevertRevision)
            {
                toolbar.Add(revertButton);
            }

            toolbar.Add(revertToButton);
            toolbar.Add(refreshButton);

            Gtk.HBox a = new Gtk.HBox();
            a.PackEnd(searchEntry, false, false, 0);
            toolbar.Add(a, true);

            toolbar.ShowAll();
        }
Ejemplo n.º 29
0
        void createCombos()
        {
            // class
            actionComboBox = ComboBox.NewText();
            actionComboBox.AppendText("Add");
            actionComboBox.AppendText("Delete");
            actionComboBox.AppendText("Replace");

            actionComboBox.Active = 0;
            actionComboBox.Show();

            actionHBox.PackStart(actionComboBox, true, true, 5);

            connComboBox = Util.CreateServerCombo();
            hbox452.PackEnd(connComboBox, true, true, 5);
        }
        public DefaultMonitorPad(string title, string icon)
        {
            buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            textEditorControl = new Gtk.TextView (buffer);
            textEditorControl.Editable = false;
            scroller = new Gtk.ScrolledWindow ();
            scroller.ShadowType = ShadowType.In;
            scroller.Add (textEditorControl);

            Toolbar toolbar = new Toolbar ();
            toolbar.IconSize = IconSize.SmallToolbar;
            toolbar.Orientation = Orientation.Vertical;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;

            buttonStop = new ToolButton ("gtk-stop");
            buttonStop.Clicked += new EventHandler (OnButtonStopClick);
            buttonStop.SetTooltip (tips, "Stop", "Stop");
            toolbar.Insert (buttonStop, -1);

            ToolButton buttonClear = new ToolButton ("gtk-clear");
            buttonClear.Clicked += new EventHandler (OnButtonClearClick);
            buttonClear.SetTooltip (tips, "Clear console", "Clear console");
            toolbar.Insert (buttonClear, -1);

            hbox = new HBox (false, 5);
            hbox.PackStart (scroller, true, true, 0);
            hbox.PackEnd (toolbar, false, false, 0);

            bold = new TextTag ("bold");
            bold.Weight = Pango.Weight.Bold;
            buffer.TagTable.Add (bold);

            tag = new TextTag ("0");
            tag.Indent = 10;
            buffer.TagTable.Add (tag);
            tags.Add (tag);

            Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
            Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));

            this.title = title;
            this.icon = icon;
            this.markupTitle = title;

            Control.ShowAll ();
        }
Ejemplo n.º 31
0
        public AddFeedDialog()
            : base(WindowType.Toplevel)
        {
            Title = StringCatalog.AddFeedTitle;
            IconName = "add";

            DeleteEvent += OnCancel;

            Resizable = false;
            BorderWidth = 6;

            vbox = new VBox(false, 6);
            Add(vbox);
            hbox = new HBox(false, 6);

            vbox.PackStart(hbox);

            image = new Image(Stock.Add, IconSize.Dialog);
            hbox.PackStart(image);

            table = new Table(2, 3, false);
            table.RowSpacing = 6;
            hbox.PackEnd(table);

            label = new Label();
            label.Markup = StringCatalog.AddFeedMessage;
            table.Attach(label, 1, 2, 0, 1);

            entry = new Entry();
            entry.Activated += OnActivated;
            table.Attach(entry, 1, 2, 1, 2);

            bbox = new HButtonBox();
            bbox.Layout = ButtonBoxStyle.End;
            bbox.Spacing = 6;
            vbox.PackEnd(bbox);

            cancel_button = new Button(Stock.Cancel);
            cancel_button.Clicked += new EventHandler(OnCancel);
            bbox.PackStart(cancel_button);

            add_button = new Button(Stock.Add);
            add_button.Clicked += new EventHandler(OnAdd);
            add_button.GrabFocus();
            bbox.PackEnd(add_button);
        }
Ejemplo n.º 32
0
 public iFolderCreationDialog(iFolderWeb ifolder)
     : base()
 {
     this.Title = "";
        this.HasSeparator = false;
        this.Resizable = false;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
        Gdk.Pixbuf bigiFolder =
     new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"));
        Image folderImage = new Image(bigiFolder);
        VBox vbox = new VBox();
        vbox.BorderWidth = 10;
        vbox.Spacing = 10;
        HBox h = new HBox();
        h.Spacing = 12;
        folderImage.SetAlignment(0.5F, 0);
        h.PackStart(folderImage, false, false, 0);
        VBox vbox2 = new VBox();
        vbox2.Spacing = 10;
        Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
     Util.GS("iFolder Created") +
     "</span>");
        l.LineWrap = false;
        l.UseMarkup = true;
        l.Selectable = false;
        l.Xalign = 0;
        l.Yalign = 0;
        vbox2.PackStart(l, false, false, 0);
        l = new Label(Util.GS("The folder you selected is now an iFolder.  To learn more about using iFolder and sharing iFolders with other users, see \"Managing iFolders\" in iFolder Help."));
        l.LineWrap = true;
        l.Xalign = 0;
        vbox2.PackStart(l, true, true, 0);
        h.PackEnd(vbox2, true, true, 0);
        vbox.PackStart(h);
        Alignment cbAlignment = new Alignment(1, 1, 1, 0);
        vbox.PackStart(cbAlignment, true, true, 0);
        cbutton =
     new CheckButton(Util.GS("Do not show this message again."));
        cbAlignment.Add(cbutton);
        vbox.ShowAll();
        this.VBox.Add(vbox);
        this.AddButton(Stock.Close, ResponseType.Ok);
        this.AddButton(Stock.Help, ResponseType.Help);
 }
Ejemplo n.º 33
0
 public iFolderExceptionDialog( Gtk.Window parent,
   System.Exception exception)
     : base()
 {
     this.Title = Util.GS("iFolder Error");
        this.HasSeparator = true;
        this.Resizable = false;
        this.Modal = true;
        this.ex = exception;
        if(parent != null)
     this.TransientFor = parent;
        HBox h = new HBox();
        h.BorderWidth = 10;
        h.Spacing = 10;
        Image i = new Image();
        i.SetFromStock(Gtk.Stock.DialogError, IconSize.Dialog);
        i.SetAlignment(0.5F, 0);
        h.PackStart(i, false, false, 0);
        VBox v = new VBox();
        v.BorderWidth = 10;
        v.Spacing = 10;
        Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
     GLib.Markup.EscapeText(exception.Message) + "</span>");
        l.LineWrap = true;
        l.UseMarkup = true;
        l.UseUnderline = false;
        l.Selectable = true;
        l.Xalign = 0; l.Yalign = 0;
        v.PackStart(l);
        dButton = new Button(Util.GS("Show Details"));
        dButton.Clicked += new EventHandler(ButtonPressed);
        HBox bhbox = new HBox();
        bhbox.PackStart(dButton, false, false, 0);
        v.PackEnd(bhbox, false, false, 0);
        details = new Label(Util.GS("Click \"Show Details\" below to get the full message returned with this error"));
        details.LineWrap = true;
        details.Selectable = true;
        details.Xalign = 0; details.Yalign = 0;
        v.PackEnd(details);
        h.PackEnd(v);
        h.ShowAll();
        this.VBox.Add(h);
        this.AddButton(Stock.Close, ResponseType.Ok);
 }
Ejemplo n.º 34
0
 public iFolderNetworkDialog()
     : base()
 {
     this.Title = "";
                 this.HasSeparator = false;
                 this.Resizable = false;
                 this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
     Gdk.Pixbuf bigiFolder =
                         new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"));
                 Image folderImage = new Image(bigiFolder);
                 VBox vbox = new VBox();
                 vbox.BorderWidth = 10;
                 vbox.Spacing = 10;
                 HBox h = new HBox();
                 h.Spacing = 12;
                 folderImage.SetAlignment(0.5F, 0);
                 h.PackStart(folderImage, false, false, 0);
                 VBox vbox2 = new VBox();
                 vbox2.Spacing = 10;
                 Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
                                                         Util.GS("Network Events") +
                                                         "</span>");
                 l.LineWrap = false;
                 l.UseMarkup = true;
                 l.Selectable = false;
                 l.Xalign = 0;
                 l.Yalign = 0;
                 vbox2.PackStart(l, false, false, 0);
                 l = new Label(Util.GS("Novell iFolder does not currently support this machine's Network card to detect Network events. DBus failed to initialize for the Network card."));
                 l.LineWrap = true;
                 l.Xalign = 0;
                 vbox2.PackStart(l, true, true, 0);
                 h.PackEnd(vbox2, true, true, 0);
                 vbox.PackStart(h);
                 Alignment cbAlignment = new Alignment(1, 1, 1, 0);
                 vbox.PackStart(cbAlignment, true, true, 0);
                 cbutton =
                         new CheckButton(Util.GS("Do not show this message again."));
                 cbAlignment.Add(cbutton);
                 vbox.ShowAll();
                 this.VBox.Add(vbox);
                 this.AddButton(Stock.Close, ResponseType.Ok);
 }
Ejemplo n.º 35
0
 public CounterDisplay(MainWindow win, string cat, string counter, string instance)
     : base(string.Format ("{0}/{1}", cat, counter))
 {
     w = win;
     HBox hbox = new HBox (false, 6);
     VBox vbox = new VBox (false, 6);
     hbox.PackStart (vbox, false, false, 4);
     Label l = new Label (string.Format ("Instance: {0}", instance));
     l.Xalign = 0;
     vbox.PackStart (l, false, false, 0);
     rawval = new Label ("");
     rawval.Xalign = 0;
     vbox.PackStart (rawval, false, false, 0);
     error = new Label ("");
     error.Xalign = 0;
     vbox.PackStart (error, false, false, 0);
     type = new Label ("");
     type.Xalign = 0;
     vbox.PackStart (type, false, false, 0);
     draw = new CounterDrawing ();
     hbox.PackEnd (draw, true, true, 4);
     Add (hbox);
     Button rem = new Button ("Remove");
     vbox.PackStart (rem, false, false, 0);
     rem.Clicked += delegate {
         w.RemoveCounter (this);
     };
     ShowAll ();
     try {
         if (instance == null)
             countero = new PerformanceCounter (cat, counter);
         else
             countero = new PerformanceCounter (cat, counter, instance);
         type.Text = countero.CounterType.ToString ();
         Update ();
         //Console.WriteLine ("{0}", countero.RawValue);
         //Console.WriteLine ("'{0}' '{1}' '{3}': {2}", cat, counter, countero.RawValue, instance);
     } catch (Exception e) {
         error.Text = e.Message;
         Console.WriteLine (e.StackTrace);
     }
 }
Ejemplo n.º 36
0
		public virtual void Initialize (string name, Gdk.Pixbuf icon)
		{
			DND.SourceSet (this);
			AboveChild = true;

			Gtk.HBox hbox = new HBox (false, 6);
			hbox.BorderWidth = 3;

			if (icon != null) {
				icon = icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear);
				hbox.PackStart (new Gtk.Image (icon), false, false, 0);
			}

			Gtk.Label label = new Gtk.Label ("<small>" + name + "</small>");
			label.UseMarkup = true;
			label.Justify = Justification.Left;
			label.Xalign = 0;
			hbox.PackEnd (label, true, true, 0);

			Add (hbox);
		}
Ejemplo n.º 37
0
		public AssemblyReferencePanel (SelectReferenceDialog selectDialog)
		{
			this.selectDialog = selectDialog;
			
			chooser = new FileChooserWidget (FileChooserAction.Open, "");
			chooser.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
			chooser.SelectMultiple = true;

			// this should only allow dll's and exe's
			FileFilter filter = new FileFilter ();
			filter.Name = GettextCatalog.GetString ("Assemblies");
			filter.AddPattern ("*.[Dd][Ll][Ll]");
			filter.AddPattern ("*.[Ee][Xx][Ee]");
			chooser.AddFilter (filter);
			chooser.FileActivated += new EventHandler (SelectReferenceDialog);
			chooser.SelectionChanged += HandleChooserSelectionChanged;
			chooser.BorderWidth = 6;

			PackStart (chooser, true, true, 0);
			
			HeaderBox hbox = new HeaderBox (1, 0, 0, 0);
			hbox.GradientBackround = true;
			hbox.SetPadding (6,6,6,6);
			
			HBox box = new HBox ();
			detailsLabel = new Label ();
			detailsLabel.Xalign = 0;
			detailsLabel.Ellipsize = Pango.EllipsizeMode.End;
			box.PackStart (detailsLabel, true, true, 0);
			addButton = new Gtk.Button (Gtk.Stock.Add);
			box.PackEnd (addButton, false, false, 0);
			hbox.Add (box);
			PackStart (hbox, false, false, 0);
			
			addButton.Clicked += SelectReferenceDialog;
			
			Spacing = 6;
			ShowAll();
		}
Ejemplo n.º 38
0
 public iFolderCrashDialog(System.Exception e)
     : base()
 {
     this.SetDefaultSize (600, 400);
        this.Title = "";
        this.HasSeparator = false;
        this.Resizable = true;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder-crash.png"));
        Image crashImage =
     new Image(new Gdk.PixbufAnimation(Util.ImagesPath("ifolder-crash.gif")));
        VBox vbox = new VBox();
        vbox.BorderWidth = 10;
        vbox.Spacing = 10;
        Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
     Util.GS("iFolder crashed because of an unhandled exception") +
     "</span>");
        l.LineWrap = false;
        l.UseMarkup = true;
        l.Selectable = false;
        l.Xalign = 0; l.Yalign = 0;
        vbox.PackStart(l, false, false, 0);
        HBox h = new HBox();
        h.BorderWidth = 10;
        h.Spacing = 12;
        crashImage.SetAlignment(0.5F, 0);
        h.PackStart(crashImage, false, false, 0);
        TextView tv = new TextView();
        tv.WrapMode = Gtk.WrapMode.Word;
        tv.Editable = false;
        tv.Buffer.Text = e.ToString();
        ScrolledWindow sw = new ScrolledWindow();
        sw.ShadowType = Gtk.ShadowType.EtchedIn;
        sw.Add(tv);
        h.PackEnd(sw, true, true, 0);
        vbox.PackEnd(h);
        vbox.ShowAll();
        this.VBox.Add(vbox);
        this.AddButton(Stock.Close, ResponseType.Ok);
 }
Ejemplo n.º 39
0
    private Gtk.Widget CreateTileList()
    {
        Gtk.VBox box = new Gtk.VBox();
        box.Homogeneous = false;

        Gtk.Adjustment vadjustment = new Gtk.Adjustment(0, 0, 100, 1, 10, 10);

        tileList = new TileListWidget(this, selection, vadjustment);
        TilegroupSelector selector = new TilegroupSelector(this, tileList);

        Gtk.HBox hbox = new Gtk.HBox(false, 0);

        Gtk.VScrollbar scrollbar = new Gtk.VScrollbar(vadjustment);

        hbox.PackStart(tileList, true, true, 0);
        hbox.PackEnd(scrollbar, false, true, 0);

        box.PackStart(selector, false, true, 0);
        box.PackStart(hbox, true, true, 0);

        return(box);
    }
Ejemplo n.º 40
0
        public SambaPopulateDialog()
        {
            ui = new Glade.XML(null, "lat.glade", "sambaPopulateDialog", null);
            ui.Autoconnect(this);

            serverComboBox          = Util.CreateServerCombo();
            serverComboBox.Changed += OnServerChanged;
            hbox451.PackEnd(serverComboBox, true, true, 5);

            Connection conn = GetCurrentConnection();

            userOUEntry.Text     = "ou=Users," + conn.DirectoryRoot;
            groupOUEntry.Text    = "ou=Groups," + conn.DirectoryRoot;
            computerOUEntry.Text = "ou=Computers," + conn.DirectoryRoot;
            idmapOUEntry.Text    = "ou=Idmap," + conn.DirectoryRoot;

            adminEntry.Text = "root";
            guestEntry.Text = "nobody";

            sambaPopulateDialog.Icon = Global.latIcon;
            sambaPopulateDialog.Run();
            sambaPopulateDialog.Destroy();
        }
Ejemplo n.º 41
0
        public void OnAddPls()
        {
            Hyena.Log.Information("add playlist");
            Gtk.Dialog dlg = new Gtk.Dialog();
            dlg.Title = "Add Playlist";
            Gtk.Entry pls = new Gtk.Entry();
            pls.WidthChars = 40;
            Gtk.Label lbl = new Gtk.Label("Playlist name:");
            Gtk.HBox  hb  = new Gtk.HBox();
            hb.PackStart(lbl, false, false, 1);
            hb.PackEnd(pls);
            dlg.VBox.PackStart(hb);
            dlg.AddButton(Gtk.Stock.Cancel, 0);
            dlg.AddButton(Gtk.Stock.Ok, 1);
            dlg.VBox.ShowAll();
            string plsname = "";

            while (plsname == "")
            {
                int response = dlg.Run();
                if (response == 0)
                {
                    dlg.Hide();
                    dlg.Destroy();
                    return;
                }
                else
                {
                    plsname = pls.Text.Trim();
                }
            }
            dlg.Hide();
            dlg.Destroy();
            _pls = _col.NewPlayList(plsname);
            _model.Reload();
            _pls_model.SetPlayList(_pls);
        }
Ejemplo n.º 42
0
        public DataDatabaseView(string fileName)
        {
            hbox = new HBox();
            sqlLiteDal = new SqlLiteDal(fileName);

            lblTable = new Label(MainClass.Languages.Translate("tables"));
            hbox.PackStart(lblTable,false,false,10);

            cbTable = new ComboBox();
            cbTable.Changed += new EventHandler(OnComboProjectChanged);
            CellRendererText textRenderer = new CellRendererText();
            cbTable.PackStart(textRenderer, true);
            cbTable.AddAttribute(textRenderer, "text", 0);
            cbTable.Model = tablesComboModel;
            cbTable.WidthRequest = 200;

            hbox.PackStart(cbTable,false,false,2);
            hbox.PackEnd(new Label(""),true,true,2);

            this.PackStart(hbox,false,false,5);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);

            treeView = new TreeView (tableModel);
            treeView.RulesHint = true;
            //treeView.SearchColumn = (int) Column.Description;
            sw.Add (treeView);

            this.PackStart(sw,true,true,5);

            this.ShowAll();

            GetTables();
        }
Ejemplo n.º 43
0
        private void build()
        {
            this.Title = "New Battlelords Character";
            {
                // page 1 - intro
                Gtk.TextView   tv = new Gtk.TextView();
                Gtk.TextBuffer tb;
                tb = tv.Buffer;
                //tb.Text = MediaManager.GetHtml("intro.html");
                tb.Text = "Welcome to the Battlelords Character Asistant.\n" +
                          "\nThis will guide you thru the initial player character generation. " +
                          "You will be presented with some initial options that can not change " +
                          "once the character is created. " +
                          "\nStep 1" +
                          "\nStep 2" +
                          "\nStep 3" +
                          "\nStep 4" +
                          "\nConculsion";
                tv.WrapMode = WrapMode.Word;
                tv.Editable = false;

                this.AppendPage(tv);
                this.SetPageTitle(tv, "Introduction");
                this.SetPageType(tv, AssistantPageType.Intro);
                this.SetPageComplete(tv, true);
            }
            {
                // page 2 - rolling method
                string method1 = "Percentile dice are rolled and marked down in order of the given visual statistics. " +
                                 "Eight rolls are initially made. The player then makes three additional dice rolls. " +
                                 "He has the option of replacing any three previously rolled statistics with one of these number. " +
                                 "Players may not move rolls around! First roll is Strength, second roll is Manual Dexterity, etc.";
                Gtk.VBox     vb      = new Gtk.VBox();
                Gtk.HBox     hb1     = new Gtk.HBox();
                Gtk.Label    lb1     = new Gtk.Label("Rolling Method");
                string[]     entries = { "Method 1", "Method 2", "Method 3", "Fill In" };
                Gtk.ComboBox cb1     = new Gtk.ComboBox(entries);
                hb1.PackStart(lb1, true, false, 0);
                hb1.PackEnd(cb1, true, false, 0);
                cb1.Active = 0;
                Gtk.HBox        hb2 = new Gtk.HBox();
                Gtk.CheckButton b1  = new Gtk.CheckButton("Max Body Points");
                Gtk.CheckButton b2  = new Gtk.CheckButton("Max Starting Money");
                b1.Active = true;
                b2.Active = true;
                hb2.PackStart(b1, true, false, 1);
                hb2.PackEnd(b2, true, false, 1);
                Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
                Gtk.TextView       tv = new Gtk.TextView();
                tv.WrapMode = WrapMode.Word;
                tv.Editable = false;
                Gtk.TextBuffer tb = tv.Buffer;
                tb.Text = method1;
                sw.Add(tv);
                //vb.PackStart(hb1, false, false, 0);
                vb.PackStart(hb2, false, false, 0);
                //vb.PackEnd(sw, true, true, 0);

                this.AppendPage(vb);
                this.SetPageTitle(vb, "Rolling Options");
                this.SetPageType(vb, AssistantPageType.Content);
                this.SetPageComplete(vb, true);
            }
            {
                // page 3 - race
                TreeStore ts = new TreeStore(typeof(string), typeof(string));
                foreach (BattlelordsRace r in this.session.Races)
                {
                    ts.AppendValues(r.Name, r.Name);
                }
                TreeView tv = new TreeView(ts);
                tv.HeadersVisible = true;
                tv.AppendColumn("Battlelords Race", new CellRendererText(), "text", 0);

                this.AppendPage(tv);
                this.SetPageTitle(tv, "Select Race");
                this.SetPageType(tv, AssistantPageType.Content);
                this.SetPageComplete(tv, true);
            }
            {
                // page 4 - Basics page

                /*
                 * 1 char name
                 * 2 player name
                 * 3 height
                 * 4 weight
                 * 5 body pts
                 * 6 start money
                 */
                Gtk.VBox vb2 = new Gtk.VBox();

                Gtk.HBox  hb1 = new Gtk.HBox();
                Gtk.Label lb1 = new Gtk.Label("Player's Name:");
                Gtk.Entry en1 = new Gtk.Entry();
                hb1.PackStart(lb1, false, false, 0);
                hb1.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb1.PackEnd(en1, true, true, 0);

                Gtk.HBox  hb2 = new Gtk.HBox();
                Gtk.Label lb2 = new Gtk.Label("Character's Name:");
                Gtk.Entry en2 = new Gtk.Entry();
                hb2.PackStart(lb2, false, false, 0);
                hb2.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb2.PackEnd(en2, true, true, 0);

                Gtk.HBox  hb3 = new Gtk.HBox();
                Gtk.Label lb3 = new Gtk.Label("Height (ft):");
                Gtk.Entry en3 = new Gtk.Entry();
                en3.Sensitive = false;
                Gtk.Button b3 = new Gtk.Button();
                //b3.Label = "roll";
                b3.TooltipText = "Click here to roll height.";
                b3.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb3.PackStart(lb3, false, false, 0);
                hb3.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb3.PackStart(en3, true, true, 0);
                hb3.PackEnd(b3, false, false, 0);

                Gtk.HBox  hb4 = new Gtk.HBox();
                Gtk.Label lb4 = new Gtk.Label("Weight (lbs):");
                Gtk.Entry en4 = new Gtk.Entry();
                en4.Sensitive = false;
                Gtk.Button b4 = new Gtk.Button();
                //b4.Label = "roll";
                b4.TooltipText = "Click here to roll for weight.";
                b4.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb4.PackStart(lb4, false, false, 0);
                hb4.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb4.PackStart(en4, true, true, 0);
                hb4.PackEnd(b4, false, false, 0);

                Gtk.HBox  hb5 = new Gtk.HBox();
                Gtk.Label lb5 = new Gtk.Label("Body Points:");
                Gtk.Entry en5 = new Gtk.Entry();
                en5.Sensitive = false;
                Gtk.Button b5 = new Gtk.Button();
                b5.TooltipText = "Click here to roll for body points.";
                b5.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb5.PackStart(lb5, false, false, 0);
                hb5.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb5.PackStart(en5, true, true, 0);
                hb5.PackEnd(b5, false, false, 0);

                Gtk.HBox  hb6 = new Gtk.HBox();
                Gtk.Label lb6 = new Gtk.Label("Starting Money:");
                Gtk.Entry en6 = new Gtk.Entry();
                en6.Sensitive = false;
                Gtk.Button b6 = new Gtk.Button();
                b6.TooltipText = "Click here to roll for starting money.";
                b6.Image       = MediaManager.GetImageFromBaseFile("dice.png");
                hb6.PackStart(lb6, false, false, 0);
                hb6.PackStart(new Gtk.HSeparator(), true, false, 0);
                hb6.PackStart(en6, true, true, 0);
                hb6.PackEnd(b6, false, false, 0);

                vb2.PackStart(hb1, false, false, 0);
                vb2.PackStart(hb2, false, false, 0);
                vb2.PackStart(hb3, false, false, 0);
                vb2.PackStart(hb4, false, false, 0);
                vb2.PackStart(hb5, false, false, 0);
                vb2.PackStart(hb6, false, false, 0);

                this.AppendPage(vb2);
                this.SetPageTitle(vb2, "Enter Basic Information");
                this.SetPageType(vb2, AssistantPageType.Content);
                this.SetPageComplete(vb2, true);
            }
            {
                // page 5 - vitals
                VBox         vb5 = new VBox();
                Gtk.Notebook nb  = new Gtk.Notebook();
                //Battle.Gui.VitalsControl stvc = new Battle.Gui.VitalsControl(this.session);
                //stvc.Sensitive = false;
                VitalsControl m1vitals   = new VitalsControl(this.session);
                VitalsControl m2vitals   = new VitalsControl(this.session);
                VitalsControl m3vitals   = new VitalsControl(this.session);
                VitalsControl fillvitals = new VitalsControl(this.session);

                m1vitals.Enabled = false;
                m2vitals.Enabled = false;
                m3vitals.Enabled = false;

                nb.AppendPage(m1vitals, new Gtk.Label("Method 1"));
                nb.AppendPage(m2vitals, new Gtk.Label("Method 2"));
                nb.AppendPage(m3vitals, new Gtk.Label("Method 3"));
                nb.AppendPage(fillvitals, new Gtk.Label("Fill In"));

                HButtonBox bb5     = new HButtonBox();
                Button     rollBtn = new Button(Stock.Execute);
                rollBtn.Clicked += delegate(object sender, EventArgs e) {
                    Console.WriteLine("{0}", sender.GetType().ToString());
                };
                rollBtn.Label = "Roll";
                Button saveBtn = new Button(Stock.Save);
                saveBtn.Label = "Save";
                bb5.PackStart(rollBtn);
                bb5.PackEnd(saveBtn);
                nb.SwitchPage += delegate(object o, SwitchPageArgs args) {
                    if (args.PageNum == 3)
                    {
                        rollBtn.Sensitive = false;
                    }
                    else
                    {
                        rollBtn.Sensitive = true;
                    }
                };

                vb5.Add(nb);
                vb5.Add(bb5);

                this.AppendPage(vb5);
                this.SetPageTitle(vb5, "Enter Vitals");
                this.SetPageType(vb5, AssistantPageType.Content);
                this.SetPageComplete(vb5, true);
            }
            {
                // page 6 - secondaries
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Enter Secondary Attributes");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 7 - fate
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Determine Fate");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 8 - social
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Social Status");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 9 - skills
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Choose Initial Skills");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 10 - matrixes
                Gtk.Label             not_completed_label = new Gtk.Label("not completed");
                Pango.FontDescription d = new Pango.FontDescription();
                d.Style = Pango.Style.Italic;
                not_completed_label.ModifyFont(d);

                this.AppendPage(not_completed_label);
                this.SetPageTitle(not_completed_label, "Choose Initial Matrixes");
                this.SetPageType(not_completed_label, AssistantPageType.Content);
                this.SetPageComplete(not_completed_label, true);
            }
            {
                // page 11 - confirm
                TextView   tv11 = new TextView();
                TextBuffer b11  = tv11.Buffer;
                b11.Text      = "Confirm this new character.";
                tv11.Editable = false;
                this.AppendPage(tv11);
                this.SetPageTitle(tv11, "Confirm New Character");
                this.SetPageType(tv11, AssistantPageType.Confirm);
                this.SetPageComplete(tv11, true);
            }
            this.Close  += HandleHandleClose;
            this.Cancel += HandleHandleCancel;
            this.ShowAll();
        }
Ejemplo n.º 44
0
    public BlessMain(string[] args)
    {
        Application.Init();

        //
        Catalog.Init(ConfigureDefines.GETTEXT_PACKAGE, ConfigureDefines.LOCALE_DIR);

        // load main window from glade XML
        Glade.XML gxml = new Glade.XML(FileResourcePath.GetDataPath("bless.glade"), "MainWindow", "bless");
        gxml.Autoconnect(this);

        // set the application icon
        MainWindow.Icon = new Gdk.Pixbuf(FileResourcePath.GetDataPath("bless-48x48.png"));

        string blessConfDir = FileResourcePath.GetUserPath();

        // make sure local configuration directory exists
        try {
            if (!Directory.Exists(blessConfDir))
            {
                Directory.CreateDirectory(blessConfDir);
            }
        }
        catch (Exception ex) {
            ErrorAlert ea = new ErrorAlert(Catalog.GetString("Cannot create user configuration directory"), ex.Message + Catalog.GetString("\n\nSome features of Bless may not work properly."), MainWindow);
            ea.Run();
            ea.Destroy();
        }

        Preferences.Proxy.Enable = false;
        // load default preferences
        Preferences.Default.Load(FileResourcePath.GetDataPath("default-preferences.xml"));
        Preferences.Default["Default.Layout.File"] = FileResourcePath.GetDataPath("bless-default.layout");

        // load user preferences
        LoadPreferences(Path.Combine(blessConfDir, "preferences.xml"));
        Preferences.Instance.AutoSavePath = Path.Combine(blessConfDir, "preferences.xml");

        // add the (empty) Menubar and toolbar
        uiManager = new UIManager();
        MainWindow.AddAccelGroup(uiManager.AccelGroup);
        uiManager.AddUiFromString(uiXml);

        actionEntries = new ActionEntry[] {
            new ActionEntry("File", null, Catalog.GetString("_File"), null, null, null),
            new ActionEntry("Edit", null, Catalog.GetString("_Edit"), null, null, null),
            new ActionEntry("View", null, Catalog.GetString("_View"), null, null, null),
            new ActionEntry("Search", null, Catalog.GetString("_Search"), null, null, null),
            new ActionEntry("Tools", null, Catalog.GetString("_Tools"), null, null, null),
            new ActionEntry("Help", null, Catalog.GetString("_Help"), null, null, null)
        };

        ActionGroup group = new ActionGroup("MainMenuActions");

        group.Add(actionEntries);
        group.Add(new ToggleActionEntry[] {
            new ToggleActionEntry("ToolbarAction", null, Catalog.GetString("Toolbar"), null, null,
                                  new EventHandler(OnViewToolbarToggled), false)
        });

        uiManager.InsertActionGroup(group, 0);

        Widget mb = uiManager.GetWidget("/menubar");

        MainVBox.PackStart(mb, false, false, 0);
        MainVBox.ReorderChild(mb, 0);
        Widget tb = uiManager.GetWidget("/toolbar");

        tb.Visible = false;
        MainVBox.PackStart(tb, false, false, 0);
        MainVBox.ReorderChild(tb, 1);

        // create the DataBook
        dataBook             = new DataBook();
        dataBook.PageAdded  += new DataView.DataViewEventHandler(OnDataViewAdded);
        dataBook.Removed    += new RemovedHandler(OnDataViewRemoved);
        dataBook.SwitchPage += new SwitchPageHandler(OnSwitchPage);

        DataViewBox.PackStart(dataBook);


        // create the widget groups that hold utility widgets
        WidgetGroup widgetGroup0     = new WidgetGroup();
        WidgetGroup widgetGroup1     = new WidgetGroup();
        WidgetGroup sideWidgetGroup0 = new WidgetGroup();
        WidgetGroup sideWidgetGroup1 = new WidgetGroup();

        widgetGroup0.Show();
        widgetGroup1.Show();
        sideWidgetGroup0.Show();
        sideWidgetGroup1.Show();

        MainVBox.PackStart(widgetGroup0, false, false, 0);
        MainVBox.ReorderChild(widgetGroup0, 3);
        MainVBox.PackStart(widgetGroup1, false, false, 0);
        MainVBox.ReorderChild(widgetGroup1, 4);

        DataViewBox.PackStart(sideWidgetGroup0, false, false, 0);
        DataViewBox.ReorderChild(sideWidgetGroup0, 0);
        DataViewBox.PackEnd(sideWidgetGroup1, false, false, 0);
        //MainVBox.ReorderChild(widgetGroup1, 4);


        Services.File    = new FileService(dataBook, MainWindow);
        Services.Session = new SessionService(dataBook, MainWindow);
        Services.UI      = new UIService(uiManager);
        //Services.Info=new InfoService(infobar);

        // Add area plugins
        PluginManager.AddForType(typeof(AreaPlugin), new object[0]);
        PluginManager areaPlugins = PluginManager.GetForType(typeof(AreaPlugin));

        Area.InitiatePluginTable();
        foreach (AreaPlugin p in areaPlugins.Plugins)
        {
            Area.AddFactoryItem(p.Name, p.CreateArea);
        }

        // Load GUI plugins
        PluginManager.AddForType(typeof(GuiPlugin), new object[] { MainWindow, uiManager });
        PluginManager guiPlugins = PluginManager.GetForType(typeof(GuiPlugin));

        foreach (Plugin p in guiPlugins.Plugins)
        {
            guiPlugins.LoadPlugin(p);
        }

        // load recent file history
        try {
            History.Instance.Load(Path.Combine(blessConfDir, "history.xml"));
        }
        catch (Exception e) {
            System.Console.WriteLine(e.Message);
        }

        // if user specified files on the command line
        // try to load them
        if (args.Length > 0)
        {
            Services.File.LoadFiles(args);
        }
        else if (Preferences.Instance["Session.LoadPrevious"] == "True")
        {
            bool   loadIt          = true;
            string prevSessionFile = Path.Combine(blessConfDir, "last.session");

            if (Preferences.Instance["Session.AskBeforeLoading"] == "True" &&
                File.Exists(prevSessionFile))
            {
                MessageDialog md = new MessageDialog(MainWindow,
                                                     DialogFlags.DestroyWithParent,
                                                     MessageType.Question,
                                                     ButtonsType.YesNo, Catalog.GetString("Do you want to load your previous session?"));

                ResponseType result = (ResponseType)md.Run();
                md.Destroy();

                if (result == ResponseType.Yes)
                {
                    loadIt = true;
                }
                else
                {
                    loadIt = false;
                }
            }
            // try to load previous session
            if (loadIt)
            {
                Services.Session.Load(prevSessionFile);
            }
        }

        // if nothing has been loaded, create a new file
        if (dataBook.NPages == 0)
        {
            ByteBuffer bb = Services.File.NewFile();

            // create and setup a  DataView
            DataView dv = Services.File.CreateDataView(bb);

            // append the DataView to the DataBook
            dataBook.AppendView(dv, new CloseViewDelegate(Services.File.CloseFile), Path.GetFileName(bb.Filename));
        }

        PreferencesChangedHandler handler = new PreferencesChangedHandler(OnPreferencesChanged);

        Preferences.Proxy.Subscribe("View.Toolbar.Show", "mainwin", handler);


        // register drag and drop of files
        MainWindow.DragDataReceived += OnDragDataReceived;
        Gtk.Drag.DestSet(MainWindow, DestDefaults.Motion | DestDefaults.Drop, dropTargets, Gdk.DragAction.Copy | Gdk.DragAction.Move);

        DataViewBox.ShowAll();

        Preferences.Proxy.Enable = true;
        // fire the preferences changed event
        // so things are setup according to the preferences
        Preferences.Proxy.NotifyAll();

        Application.Run();
    }
Ejemplo n.º 45
0
        public LogWidget(VersionControlDocumentInfo info)
        {
            this.Build();
            this.info = info;
            if (info.Document != null)
            {
                this.preselectFile = info.Item.Path;
            }

            revertButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert changes from this revision"));
            revertButton.IsImportant = true;
//			revertButton.Sensitive = false;
            revertButton.Clicked += new EventHandler(RevertRevisionClicked);
            CommandBar.Insert(revertButton, -1);

            revertToButton             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert to this revision"));
            revertToButton.IsImportant = true;
//			revertToButton.Sensitive = false;
            revertToButton.Clicked += new EventHandler(RevertToRevisionClicked);
            CommandBar.Insert(revertToButton, -1);

            Gtk.ToolItem item = new Gtk.ToolItem();
            Gtk.HBox     a    = new Gtk.HBox();
            item.Add(a);
            searchEntry = new SearchEntry();
            searchEntry.WidthRequest             = 200;
            searchEntry.ForceFilterButtonVisible = true;
            searchEntry.EmptyMessage             = GettextCatalog.GetString("Search");
            searchEntry.Changed += HandleSearchEntryFilterChanged;
            searchEntry.Ready    = true;
            searchEntry.Show();
            a.PackEnd(searchEntry, false, false, 0);
            CommandBar.Insert(item, -1);
            ((Gtk.Toolbar.ToolbarChild)CommandBar[item]).Expand = true;

            CommandBar.ShowAll();

            messageRenderer.Ellipsize = Pango.EllipsizeMode.End;
            TreeViewColumn colRevMessage = new TreeViewColumn();

            colRevMessage.Title = GettextCatalog.GetString("Message");
            var graphRenderer = new RevisionGraphCellRenderer();

            colRevMessage.PackStart(graphRenderer, false);
            colRevMessage.SetCellDataFunc(graphRenderer, GraphFunc);

            colRevMessage.PackStart(messageRenderer, true);
            colRevMessage.SetCellDataFunc(messageRenderer, MessageFunc);
            colRevMessage.Sizing = TreeViewColumnSizing.Autosize;

            treeviewLog.AppendColumn(colRevMessage);
            colRevMessage.MinWidth  = 350;
            colRevMessage.Resizable = true;


            TreeViewColumn colRevDate = new TreeViewColumn(GettextCatalog.GetString("Date"), textRenderer);

            colRevDate.SetCellDataFunc(textRenderer, DateFunc);
            colRevDate.Resizable = true;
            treeviewLog.AppendColumn(colRevDate);

            TreeViewColumn colRevAuthor = new TreeViewColumn();

            colRevAuthor.Title = GettextCatalog.GetString("Author");
            colRevAuthor.PackStart(pixRenderer, false);
            colRevAuthor.PackStart(textRenderer, true);
            colRevAuthor.SetCellDataFunc(textRenderer, AuthorFunc);
            colRevAuthor.SetCellDataFunc(pixRenderer, AuthorIconFunc);
            colRevAuthor.Resizable = true;
            treeviewLog.AppendColumn(colRevAuthor);

            TreeViewColumn colRevNum = new TreeViewColumn(GettextCatalog.GetString("Revision"), textRenderer);

            colRevNum.SetCellDataFunc(textRenderer, RevisionFunc);
            colRevNum.Resizable = true;
            treeviewLog.AppendColumn(colRevNum);

            treeviewLog.Model              = logstore;
            treeviewLog.Selection.Changed += TreeSelectionChanged;

            treeviewFiles = new FileTreeView();
            treeviewFiles.DiffLineActivated += HandleTreeviewFilesDiffLineActivated;
            scrolledwindowFiles.Child        = treeviewFiles;
            scrolledwindowFiles.ShowAll();

            changedpathstore = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), // icon/file name
                                             typeof(Gdk.Pixbuf), typeof(string), // icon/operation
                                             typeof(string),                     // path
                                             typeof(string),                     // revision path (invisible)
                                             typeof(string[])                    // diff
                                             );

            TreeViewColumn colChangedFile = new TreeViewColumn();
            var            crp            = new CellRendererPixbuf();
            var            crt            = new CellRendererText();

            colChangedFile.Title = GettextCatalog.GetString("File");
            colChangedFile.PackStart(crp, false);
            colChangedFile.PackStart(crt, true);
            colChangedFile.AddAttribute(crp, "pixbuf", 2);
            colChangedFile.AddAttribute(crt, "text", 3);
            treeviewFiles.AppendColumn(colChangedFile);

            TreeViewColumn colOperation = new TreeViewColumn();

            colOperation.Title = GettextCatalog.GetString("Operation");
            colOperation.PackStart(crp, false);
            colOperation.PackStart(crt, true);
            colOperation.AddAttribute(crp, "pixbuf", 0);
            colOperation.AddAttribute(crt, "text", 1);
            treeviewFiles.AppendColumn(colOperation);

            TreeViewColumn colChangedPath = new TreeViewColumn();

            colChangedPath.Title = GettextCatalog.GetString("Path");

            diffRenderer.DrawLeft = true;
            colChangedPath.PackStart(diffRenderer, true);
            colChangedPath.SetCellDataFunc(diffRenderer, SetDiffCellData);
            treeviewFiles.AppendColumn(colChangedPath);
            treeviewFiles.Model          = changedpathstore;
            treeviewFiles.TestExpandRow += HandleTreeviewFilesTestExpandRow;
            treeviewFiles.Events        |= Gdk.EventMask.PointerMotionMask;

            textviewDetails.WrapMode = Gtk.WrapMode.Word;

            labelAuthor.Text   = "";
            labelDate.Text     = "";
            labelRevision.Text = "";
        }
Ejemplo n.º 46
0
        private void PushButton(object sender, EventArgs e)
        {
            Gtk.CheckButton check  = new Gtk.CheckButton("Down");
            Gtk.Entry       input  = new Gtk.Entry(15);
            Gtk.HBox        divide = new Gtk.HBox(false, 0);
            Gtk.Button      but    = new Gtk.Button("OK");

            input.Activated += delegate {
                but.Click();
            };

            divide.PackStart(input);
            divide.Add(check);
            divide.PackEnd(but);

            Gtk.Window w = new Gtk.Window(Gtk.WindowType.Popup);
            w.SetPosition(WindowPosition.Mouse);

            w.Add(divide);

            w.BorderWidth = 0;
            w.Modal       = true;
            w.CanFocus    = true;
            w.ShowAll();

            but.Clicked += delegate {
                if (input.Text == "")
                {
                    return;
                }
                int      i, j;
                string[] name = ((Gtk.Button)sender).Name.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                i = int.Parse(name [1]);
                j = int.Parse(name [2]);

                w.HideAll();


                if (this.game.GetActualPlayer().DoMove(
                        new Lexicon.Move(new System.Drawing.Point(i - 1, j - 1), input.Text.ToUpperInvariant(), check.Active))
                    )
                {
                    w.Destroy();
                    if (!Scrabble.Game.InitialConfig.client)
                    {
                        this.game.changePlayer();
                    }
                }
            };

            w.KeyPressEvent += delegate(object o, KeyPressEventArgs args) {
                switch (args.Event.Key)
                {
                case Gdk.Key.Escape:
                    w.HideAll();
                    w.Dispose();
                    w.Destroy();
                    break;
                }
            };
        }
Ejemplo n.º 47
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.StartWindow"/> class.
        /// </summary>
        public StartWindow() : base(Gtk.WindowType.Toplevel)
        {
            #region Basic window properties
            // Basic window properties
            this.Title        = "Scrabble - Základní nastavení";
            this.Name         = "ConfigWindow";
            this.DeleteEvent += OnDeleteEvent;
            this.SetPosition(WindowPosition.Center);
            this.DefaultWidth  = 410;
            this.DefaultHeight = 280;
            this.Icon          = Scrabble.Game.InitialConfig.icon;
            #endregion

            this.numberOfPlayers = 2;

            // Own thread for loading dictionary
            this.statusb = new Gtk.Statusbar();
            this.statusb.Push(statusb.GetContextId("Slovník"), "Načítám slovník");
            this.tdic = new Thread(LoadDictionary);
            this.tdic.Start();

            // infoText (top)
            this.infoText = new Gtk.Label("Základní nastavení hry.\n" +
                                          "Nastavte prosím počet hráčů, jejich jména a určete zda za ně bude hrát umělá inteligence. " +
                                          "Také můžete nastavit, kteří hráči se připojují vzdáleně.");
            this.infoText.Wrap = true;

            // First config line (number of players, client)
            this.upperHbox = new HBox(false, 5);
            this.l1        = new Label("Počet hráčů");
            this.upperHbox.PackStart(l1);
            this.l2                = new Label(", nebo:");
            this.entryNum          = new SpinButton(2, 5, 1);
            this.entryNum.Changed += OnNumberOfPlayerChange;
            client             = new CheckButton();
            client.Clicked    += IamClient;
            client.Label       = "připojit se ke vzdálené hře";
            client.TooltipText = "Pokud zaškrnete, tak se program bude chovat pouze jako client a připojí se k hře vedené na jiném PC.";
            upperHbox.Add(entryNum);
            upperHbox.Add(l2);
            upperHbox.PackEnd(client);
            upperHbox.BorderWidth  = 10;
            upperHbox.WidthRequest = 20;

            // Table with config for each player (dynamic size)
            table = new Gtk.Table(5, 7, false);
            table.Attach(new Gtk.Label("Jméno hráče:"), 1, 2, 0, 1);
            table.Attach(new Gtk.Label("CPU"), 2, 3, 0, 1);
            table.Attach(new Gtk.Label("Network"), 3, 4, 0, 1);
            ipLabel = new Gtk.Label("IP");
            table.Attach(ipLabel, 4, 5, 0, 1);

            labels    = new Gtk.Label[5];
            entryes   = new Gtk.Entry[5];
            CPUchecks = new Gtk.CheckButton[5];
            MPchecks  = new Gtk.CheckButton[5];
            IPs       = new Gtk.Entry[5];
            for (int i = 0; i < 5; i++)
            {
                labels [i]      = new Gtk.Label((i + 1).ToString());
                labels [i].Name = string.Format("l {0}", i);
                table.Attach(labels [i], 0, 1, (uint)i + 1, (uint)i + 2);
                entryes [i]             = new Gtk.Entry(12);
                entryes [i].Text        = "Hráč " + (i + 1).ToString();
                entryes [i].TooltipText = "Vložte jméno hráče.";
                table.Attach(entryes [i], 1, 2, (uint)i + 1, (uint)i + 2);
                CPUchecks [i]             = new Gtk.CheckButton();
                CPUchecks [i].Name        = string.Format("c {0}", i);
                CPUchecks [i].TooltipText = "Pokud je zaškrtnuto, tak za hráče bude hrát počítač.";
                ((Gtk.CheckButton)CPUchecks [i]).Clicked += OnCpuChange;
                table.Attach(CPUchecks [i], 2, 3, (uint)i + 1, (uint)i + 2);
                MPchecks [i]             = new Gtk.CheckButton();
                MPchecks [i].Name        = string.Format("n {0}", i);
                MPchecks [i].TooltipText = "Pokud je zaškrtnuto, tak se počítá s tím, že se tento hráč připojí vzdáleně. ";
                ((Gtk.CheckButton)MPchecks [i]).Clicked += OnNetChange;
                table.Attach(MPchecks [i], 3, 4, (uint)i + 1, (uint)i + 2);
                IPs [i]            = new Gtk.Entry(15);
                IPs [i].Text       = "192.168.0.X";
                IPs [i].WidthChars = 15;
                IPs [i].Sensitive  = false;
                table.Attach(IPs [i], 4, 5, (uint)i + 1, (uint)i + 2);
            }
            this.CPUchecks[0].Hide();

            ok             = new Button("Hotovo");
            ok.Clicked    += Done;
            ok.BorderWidth = 5;
            ok.TooltipText = "Potvrzením začne hra. Může se stát, že program bude ještě chvíli načítat slovník.";
            table.Attach(ok, 0, 5, 6, 7);

            // Main vbox (where all is)
            this.mainVbox = new Gtk.VBox(false, 5);

            this.mainVbox.PackStart(infoText);
            this.mainVbox.Add(upperHbox);
            this.mainVbox.Spacing = 5;
            this.mainVbox.Add(table);
            this.mainVbox.PackEnd(statusb);

            this.mainVbox.BorderWidth = 9;
            this.Add(mainVbox);
            this.mainVbox.ShowAll();

            for (int i = 2; i < numberOfPlayers + 3; i++)
            {
                labels [i].Hide();
                entryes [i].Hide();
                CPUchecks [i].Hide();
                MPchecks [i].Hide();
                IPs [i].Hide();
            }
            ipLabel.Hide();

            foreach (Gtk.Entry e in IPs)
            {
                e.Hide();
            }

            this.CPUchecks[0].Hide();
            this.MPchecks[0].Hide();
        }
Ejemplo n.º 48
0
        public QueryWidget(PhotoQuery query, Db db) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

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

            label = new Gtk.Label(Strings.FindColonSpace);
            label.Show();
            label.Ypad = 9;
            box.PackStart(label, false, false, 0);

            untagged = new Gtk.Label(Strings.UntaggedPhotos)
            {
                Visible = false
            };
            box.PackStart(untagged, false, false, 0);

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

            rated = new Gtk.Label(Strings.RatedPhotos)
            {
                Visible = false
            };
            box.PackStart(rated, false, false, 0);

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

            rollfilter = new Gtk.Label(Strings.ImportRoll)
            {
                Visible = false
            };
            box.PackStart(rollfilter, false, false, 0);

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

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

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

            var warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);

            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

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

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

            var warning = new Gtk.Label(Strings.NoMatchingPhotosFound);

            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

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

            warning_box.Visible = false;
        }
Ejemplo n.º 49
0
        private void Build()
        {
            this.titulo = "";

            vBox         = new Gtk.VBox(false, 3);
            vBox.Visible = true;

            HBOpcionesGraficos = new Gtk.HBox(false, 2);
            setVisible(HBOpcionesGraficos);
            HBGraph = new Gtk.HBox(false, 3);
            setVisible(HBGraph);
            HVGraphControls         = new Gtk.VBox(false, 3);
            HVGraphControls.Visible = true;
            HBMeses = new Gtk.HBox(false, 3);
            setVisible(HBMeses);
            HBAnhos = new Gtk.HBox(false, 3);
            setVisible(HBAnhos);

            this.WidthGraph  = this.DefaultWidth;
            this.HeightGraph = this.DefaultHeight;

            Gtk.Action actViewDrawing = new Gtk.Action("ViewNotebook", "Drawing demo", "View drawing demo", null);
            actViewDrawing.Activated += (obj, evt) => this.OnViewDrawing();

            this.btAumentar      = InitButton(this.btAumentar, strBtAumentar);
            this.btReducir       = InitButton(this.btReducir, strBtReducir);
            this.btMeses         = InitButton(this.btMeses, strBtMeses);
            this.btAnhos         = InitButton(this.btAnhos, strBtAnhos);
            this.btAnhoSiguiente = InitButton(this.btAnhoSiguiente, strBtAnhoSiguiente);
            this.btAnhoAnterior  = InitButton(this.btAnhoAnterior, strBtAnhoAnterior);
            this.btOcGen         = InitButton(this.btOcGen, strBtOcGen);
            this.btOcPCl         = InitButton(this.btOcPCl, strBtOcPCl);
            this.btOcPHb         = InitButton(this.btOcPHb, strBtOcPHb);
            this.btComHb         = InitButton(this.btComHb, strBtComHb);

            this.cbClientes = new Gtk.ComboBox {
                Visible = false
            };
            this.cbHabitaciones = new Gtk.ComboBox {
                Visible = false
            };
            this.cbComodidades = new Gtk.ComboBox {
                Visible = false
            };

            this.graph = new Graph((int)(this.DefaultWidth * 0.9), (int)(this.DefaultHeight * 0.75));

            this.DeleteEvent += (o, args) => Gtk.Application.Quit();

            btAumentar.Clicked      += (object sender, EventArgs e) => this.Ajustar();
            btReducir.Clicked       += (object sender, EventArgs e) => this.Reducir();
            btMeses.Clicked         += (object sender, EventArgs e) => this.setPorMeses(true);
            btAnhos.Clicked         += (object sender, EventArgs e) => this.setPorMeses(false);
            btAnhoSiguiente.Clicked += (object sender, EventArgs e) => setAnho(1);
            btAnhoAnterior.Clicked  += (object sender, EventArgs e) => setAnho(-1);
            cbClientes.Changed      += (object sender, EventArgs e) => changeCB();
            cbHabitaciones.Changed  += (object sender, EventArgs e) => changeCB();
            cbComodidades.Changed   += (object sender, EventArgs e) => changeCB();

            btOcGen.Clicked += (object sender, EventArgs e) => this.MostrarOcupacionGeneral();
            btOcPCl.Clicked += (object sender, EventArgs e) => this.MostrarOcupacionPorCliente("");
            btOcPHb.Clicked += (object sender, EventArgs e) => this.MostrarOcupacionPorHabitacion(0);
            btComHb.Clicked += (object sender, EventArgs e) => this.MostrarComodidadesHabitaciones("");

            HBOpcionesGraficos.PackStart(this.btOcGen);
            HBOpcionesGraficos.PackStart(this.btOcPCl);
            HBOpcionesGraficos.PackStart(this.cbClientes);
            HBOpcionesGraficos.PackStart(this.btOcPHb);
            HBOpcionesGraficos.PackStart(this.cbHabitaciones);
            HBOpcionesGraficos.PackStart(this.btComHb);
            HBOpcionesGraficos.PackStart(this.cbComodidades);

            HBMeses.PackStart(this.btAnhoAnterior);
            HBMeses.PackStart(this.btMeses);
            HBMeses.PackStart(this.btAnhoSiguiente);

            HBAnhos.PackStart(this.btAnhos);

            HVGraphControls.PackStart(this.HBMeses);
            HVGraphControls.PackStart(this.HBAnhos);
            HVGraphControls.PackStart(this.btAumentar);
            HVGraphControls.PackStart(this.btReducir);

            HBGraph.PackStart(graph);
            HBGraph.PackEnd(HVGraphControls);

            vBox.PackStart(HBOpcionesGraficos);
            vBox.PackStart(HBGraph);

            this.Add(vBox);
            this.setPorMeses(false);
            this.OnViewDrawing();
        }
Ejemplo n.º 50
0
Archivo: Window.cs Proyecto: MrJoe/lat
 void CreateServerCombo()
 {
     serverComboBox = Util.CreateServerCombo();
     hbox448.PackEnd(serverComboBox, true, true, 5);
 }
Ejemplo n.º 51
0
        public void SetLabel(Gtk.Widget page, Xwt.Drawing.Image icon, string label)
        {
            string labelNoSpaces = label != null?label.Replace(' ', '-') : null;

            this.label = label;
            this.page  = page;

            if (icon == null)
            {
                icon = ImageService.GetIcon("md-empty");
            }

            if (box == null)
            {
                box = new HBox();
                box.Accessible.SetShouldIgnore(true);
                box.Spacing = -2;

                tabIcon = new ImageView();
                tabIcon.Accessible.SetShouldIgnore(true);
                tabIcon.Show();
                box.PackStart(tabIcon, false, false, 3);

                labelWidget = new ExtendedLabel(label);
                // Ignore the label because the title tab already contains its name
                labelWidget.Accessible.SetShouldIgnore(true);
                labelWidget.UseMarkup = true;
                var alignLabel = new Alignment(0.0f, 0.5f, 1, 1);
                alignLabel.Accessible.SetShouldIgnore(true);
                alignLabel.BottomPadding = 0;
                alignLabel.RightPadding  = 15;
                alignLabel.Add(labelWidget);
                box.PackStart(alignLabel, false, false, 0);

                btnDock             = new ImageButton();
                btnDock.Image       = pixAutoHide;
                btnDock.TooltipText = GettextCatalog.GetString("Auto Hide");
                btnDock.CanFocus    = true;
                //			btnDock.WidthRequest = btnDock.HeightRequest = 17;
                btnDock.Clicked          += OnClickDock;
                btnDock.ButtonPressEvent += (o, args) => args.RetVal = true;
                btnDock.WidthRequest      = btnDock.SizeRequest().Width;
                UpdateDockButtonAccessibilityLabels();

                btnClose             = new ImageButton();
                btnClose.Image       = pixClose;
                btnClose.TooltipText = GettextCatalog.GetString("Close");
                btnClose.CanFocus    = true;
                //			btnClose.WidthRequest = btnClose.HeightRequest = 17;
                btnClose.WidthRequest = btnDock.SizeRequest().Width;
                btnClose.Clicked     += delegate {
                    item.Visible = false;
                };
                btnClose.ButtonPressEvent += (o, args) => args.RetVal = true;

                al = new Alignment(0, 0.5f, 1, 1);
                al.Accessible.SetShouldIgnore(true);
                HBox btnBox = new HBox(false, 0);
                btnBox.Accessible.SetShouldIgnore(true);
                btnBox.PackStart(btnDock, false, false, 3);
                btnBox.PackStart(btnClose, false, false, 1);
                al.Add(btnBox);
                box.PackEnd(al, false, false, 3);

                Add(box);
            }

            tabIcon.Image = icon;

            string realLabel, realHelp;

            if (!string.IsNullOrEmpty(label))
            {
                labelWidget.Parent.Show();
                labelWidget.Name = label;
                btnDock.Name     = string.Format("btnDock_{0}", labelNoSpaces ?? string.Empty);
                btnClose.Name    = string.Format("btnClose_{0}", labelNoSpaces ?? string.Empty);
                realLabel        = GettextCatalog.GetString("Close {0}", label);
                realHelp         = GettextCatalog.GetString("Close the {0} pad", label);
            }
            else
            {
                labelWidget.Parent.Hide();
                realLabel = GettextCatalog.GetString("Close pad");
                realHelp  = GettextCatalog.GetString("Close the pad");
            }

            btnClose.Accessible.SetLabel(realLabel);
            btnClose.Accessible.Description = realHelp;

            if (label != null)
            {
                Accessible.Name        = $"DockTab.{labelNoSpaces}";
                Accessible.Description = GettextCatalog.GetString("Switch to the {0} tab", label);
                Accessible.SetTitle(label);
                Accessible.SetLabel(label);
            }

            // Get the required size before setting the ellipsize property, since ellipsized labels
            // have a width request of 0
            box.ShowAll();
            Show();

            minWidth = tabIcon.SizeRequest().Width + al.SizeRequest().Width + 10;

            UpdateBehavior();
            UpdateVisualStyle();
        }
Ejemplo n.º 52
0
    public DialogPersonPopup(int personID, string name, string rfid,
                             List <Task> tasks, List <StationCount> stationsCount, bool serverConnected, bool Autologout)
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_person_popup.glade", "dialog_person_popup", null);
        gladeXML.Autoconnect(this);

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

        Visible         = true;
        this.Autologout = Autologout;

        //1) Show top of the window widgets
        label_name.Text      = "<b>" + name + "</b>";
        label_name.UseMarkup = true;
        label_rfid.Text      = rfid;

        Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_close.png");

        image_close.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_person_logout.png");
        image_person_logout.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "gtk-apply.png");
        image_server_connected_yes.Pixbuf = pixbuf;
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "gtk-cancel.png");
        image_server_connected_no.Pixbuf = pixbuf;

        if (serverConnected)
        {
            label_server_connected.Text        = "Server is connected";
            image_server_connected_yes.Visible = true;
            image_server_connected_no.Visible  = false;
        }
        else
        {
            label_server_connected.Text        = Constants.ServerDisconnectedMessage;
            image_server_connected_yes.Visible = false;
            image_server_connected_no.Visible  = true;
        }

        //string photoFile = Util.GetPhotoFileName(false, personID);
        string photoFile = Util.UserPhotoURL(false, personID);

        if (File.Exists(photoFile))
        {
            try {
                pixbuf = new Pixbuf(photoFile);                  //from a file
                image_person.Pixbuf = pixbuf;
            } catch {
                string extension = Util.GetMultimediaExtension(photoFile);
                //on windows there are problem using the fileNames that are not on temp
                string tempFileName = Path.Combine(Path.GetTempPath(),
                                                   Constants.PhotoSmallTemp + extension);
                File.Copy(photoFile, tempFileName, true);
                pixbuf = new Pixbuf(tempFileName);
                image_person.Pixbuf = pixbuf;
            }
        }

        //2) Show tasks stuff
        list_tasks_fixed                      = new List <Task>();
        list_hboxs_row                        = new List <Gtk.HBox>();
        list_buttons_start                    = new List <Gtk.Button>();
        list_buttons_done                     = new List <Gtk.Button>();
        list_buttons_done_id                  = new List <int>();
        taskActive                            = new Task();
        Fake_button_start_task                = new Gtk.Button();
        Fake_button_person_logout             = new Gtk.Button();
        Fake_button_person_autologout_changed = new Gtk.Button();

        checkbutton_autologout.Active = Autologout;

        bool task_parametrized_exist = false;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_capture_big.png");

        Gtk.HBox hboxRow;
        foreach (Task t in tasks)
        {
            hboxRow = new Gtk.HBox(false, 10);

            if (t.Laterality == "R,L")
            {
                Gtk.VBox vboxRL = new Gtk.VBox(false, 4);

                Task taskCopy = new Task(t.Id, t.PersonId, t.StationId, t.ExerciseId, t.ExerciseName,
                                         t.Sets, t.Nreps, t.Load, t.Speed, t.PercentMaxSpeed,
                                         "R", t.Comment);
                Gtk.HBox hboxStartAndLabel = createHBoxStartAndLabel(taskCopy, pixbuf);
                vboxRL.PackStart(hboxStartAndLabel, false, false, 0);

                taskCopy = new Task(t.Id, t.PersonId, t.StationId, t.ExerciseId, t.ExerciseName,
                                    t.Sets, t.Nreps, t.Load, t.Speed, t.PercentMaxSpeed,
                                    "L", t.Comment);
                hboxStartAndLabel = createHBoxStartAndLabel(taskCopy, pixbuf);
                vboxRL.PackStart(hboxStartAndLabel, false, false, 0);

                Gtk.VSeparator vsep = new Gtk.VSeparator();
                hboxRow.PackStart(vsep, false, false, 0);
                hboxRow.PackStart(vboxRL, false, false, 0);
            }
            else
            {
                Gtk.HBox hboxStartAndLabel = createHBoxStartAndLabel(t, pixbuf);
                hboxRow.PackStart(hboxStartAndLabel, false, false, 0);
            }

            task_parametrized_exist = true;

            //create button_done (shared on R,L)
            Gtk.Button button_done = new Gtk.Button("Fet!");
            button_done.Clicked += new EventHandler(button_done_clicked);
            hboxRow.PackEnd(button_done, false, false, 0);
            list_buttons_done.Add(button_done);
            list_buttons_done_id.Add(t.Id);
            list_hboxs_row.Add(hboxRow);

            vbox_tasks_parametrized.PackStart(hboxRow, false, false, 0);
        }

        if (!task_parametrized_exist)
        {
            Gtk.Label label = new Gtk.Label("There are no pending tasks on this station.");
            vbox_tasks_parametrized.PackStart(label, false, false, 0);
        }

        vbox_tasks_parametrized.ShowAll();

        //3) Show other stations tasks
        string sep            = "";
        string stationsString = "";

        foreach (StationCount sc in stationsCount)
        {
            stationsString += sep + sc.ToString();
            sep             = ", ";
        }

        if (stationsString == "")
        {
            label_other_stations.Text = "There are no tasks at other stations";
        }
        else
        {
            //label_other_stations.Text = "There are task at this stations:" + "\n\n" + stationsString;
            label_other_stations.Text = stationsString;
        }
    }
Ejemplo n.º 53
0
        public QueryWidget(PhotoQuery query, Db db) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            warning_box.Visible = false;
        }
Ejemplo n.º 54
0
        public static void CheckWordDialog(object sender, EventArgs e)
        {
            var lab = new Gtk.Label("Zadejte slovo: ");
            var ent = new Gtk.Entry();
            var but = new Gtk.Button("OK");
            var div = new Gtk.HBox(false, 1);

            div.PackStart(lab);
            div.Add(ent);
            div.PackEnd(but);
            var checkWin = new Gtk.Window(Gtk.WindowType.Popup);

            checkWin.Add(div);
            checkWin.BorderWidth = 0;
            checkWin.Modal       = true;
            checkWin.CanFocus    = true;
            checkWin.SetPosition(WindowPosition.Mouse);
            checkWin.ShowAll();
            ent.Activated += delegate {
                but.Click();
            };
            but.Clicked += delegate {
                checkWin.HideAll();

                if (game.dictionary.Content(ent.Text))
                {
                    Gtk.MessageDialog ans = new Gtk.MessageDialog(
                        game.Window,
                        DialogFlags.DestroyWithParent,
                        MessageType.Info,
                        ButtonsType.Close,
                        "Slovo \"" + ent.Text + "\" <b>je</b> ve slovníku"
                        );
                    ans.Run();
                    ans.Destroy();
                }
                else
                {
                    Gtk.MessageDialog ans = new Gtk.MessageDialog(
                        game.Window,
                        DialogFlags.DestroyWithParent,
                        MessageType.Info,
                        ButtonsType.Close,
                        "Slovo \"" + ent.Text + "\" <b>není</b> ve slovníku"
                        );
                    ans.Run();
                    ans.Destroy();
                }
                checkWin.Dispose();
                checkWin.Destroy();
            };

            checkWin.KeyPressEvent += delegate(object o, KeyPressEventArgs args) {
                switch (args.Event.Key)
                {
                case Gdk.Key.Escape:
                    checkWin.HideAll();
                    checkWin.Dispose();
                    checkWin.Destroy();
                    break;

                case Gdk.Key.ISO_Enter:
                    but.Click();
                    break;
                }
            };
        }