コード例 #1
0
 public iFolderViewItem(iFolderHolder holder, iFolderViewGroup group, TreeIter iter, int maxWidth)
 {
     this.holder = holder;
        this.group = group;
        this.iter = iter;
        this.maxWidth = maxWidth;
        this.CanFocus = true;
        this.bSelected = false;
        this.bMouseIsHovering = false;
        this.ModifyBg(StateType.Normal, this.Style.Base(StateType.Normal));
        this.ModifyBase(StateType.Normal, this.Style.Base(StateType.Normal));
        currentName = "";
        currentLocation = "";
        currentStatus = "";
        LoadImages();
        SetPixbufs();
        this.Add(CreateWidgets());
        this.WidthRequest = this.maxWidth;
        this.Realized +=
     new EventHandler(OnWidgetRealized);
        TargetEntry[] targets =
     new TargetEntry[]
     {
      new TargetEntry ("text/ifolder-id", 0, (uint)iFolderWindow.DragTargetType.iFolderID)
     };
        this.DragDataGet += new DragDataGetHandler(HandleDragDataGet);
        Drag.SourceSet(this, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Move);
 }
コード例 #2
0
		public override void ExposePaths(ClipboardData paths) {
			TargetEntry target0 = new TargetEntry("x-special/gnome-copied-files", 0, 0);
        	TargetEntry target1 = new TargetEntry("text/uri-list", 0, 0);
			
			outData = paths;

        	clip.SetWithData(new TargetEntry[] {target0, target1}, ClearGet, ClearFunc);
		}
コード例 #3
0
 public CubeListItem()
 {
     this.Build();
     Gtk.TargetEntry[] source_table = new Gtk.TargetEntry[] {
         new Gtk.TargetEntry ("application/cube", Gtk.TargetFlags.App, 0)
     };
     Gtk.Drag.SourceSet(drawCube, Gdk.ModifierType.Button1Mask, source_table, Gdk.DragAction.Move);
 }
コード例 #4
0
ファイル: Clipboard.cs プロジェクト: Gravecorp/gtk-sharp
 public bool SetWithOwner(TargetEntry[] targets, ClipboardGetFunc get_func, ClipboardClearFunc clear_func, GLib.Object owner)
 {
     ClipboardClearFunc clear_proxy = new ClipboardClearFunc (ClearProxy);
     GtkSharp.ClipboardGetFuncWrapper get_func_wrapper = new GtkSharp.ClipboardGetFuncWrapper (get_func);
     GtkSharp.ClipboardClearFuncWrapper clear_proxy_wrapper = new GtkSharp.ClipboardClearFuncWrapper (clear_proxy);
     bool ret = gtk_clipboard_set_with_owner (Handle, targets, targets.Length, get_func_wrapper.NativeDelegate, clear_proxy_wrapper.NativeDelegate, owner == null ? IntPtr.Zero : owner.Handle);
     SetPersistentData (get_func_wrapper, clear_func, clear_proxy_wrapper);
     return ret;
 }
コード例 #5
0
        private void EnableDrop()
        {
            //init drag supported targets.
            TargetEntry[] targets = new TargetEntry[1] {
                new TargetEntry("text/uri-list", 0, 0)
            };

            // set up label as a drop target
            Gtk.Drag.DestSet (this.treeView, DestDefaults.All, targets, Gdk.DragAction.Copy);
            this.treeView.DragDataReceived += HandleDragDataReceived;
        }
コード例 #6
0
ファイル: Preview.cs プロジェクト: unhammer/gimp-sharp
        public Preview(Dialog dialog, VariableSet variables)
        {
            _dialog = dialog;

              Realized += OnRealized;
              ExposeEvent += OnExposed;

              var targets = new TargetEntry[]{
            new TargetEntry("image/jpeg", 0, 0),
            new TargetEntry("image/png", 0, 0),
            new TargetEntry("text/plain", 0, 1),
            new TargetEntry("STRING", 0, 2)};

              Gtk.Drag.DestSet(this, DestDefaults.All, targets,
               DragAction.Copy | DragAction.Move);

              Events = EventMask.ButtonPressMask;
        }
コード例 #7
0
ファイル: MainWindow.cs プロジェクト: physalis/MeeGen
        public MainWindow(string databaseFile, string preferencesFile)
            : base(Gtk.WindowType.Toplevel)
        {
            Build();

            this.drawingarea.DoubleBuffered = true;
            this.iconview.PixbufColumn = 0;

            this.moreMenu = new MoreMenu(FillIconView);
            this.moreMenu.ShowAll();

            //this.GtkScrolledWindow.VScrollbar.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(255, 255, 255));
            //this.GtkScrolledWindow.VScrollbar.ModifyFg(Gtk.StateType.Normal, new Gdk.Color(255, 255, 255));
            //this.GtkScrolledWindow.VScrollbar.ModifyBase(Gtk.StateType.Normal, new Gdk.Color(255, 255, 255));

            this.iconDict = new Dictionary<string, ListStore>();
            this.imageDict = new Dictionary<string, string[]>();

            this.shapeManager = new ShapeManager();

            try
            {
                LoadImages(databaseFile);
                FillIconView("heads");

            }catch(Exception e)
            {
                MessageBox.ShowError(e.Message);
                //Application.Quit() fails for some reason
                System.Diagnostics.Process.GetCurrentProcess().Kill();
            }

            // the drag and drop table that contains destination and source targets
            Gtk.TargetEntry[] dd_table = new Gtk.TargetEntry[]{new Gtk.TargetEntry("text/plain", 0, 0)};

            // Set up the drawingarea as a drop destination
            Gtk.Drag.DestSet(drawingarea, DestDefaults.All, dd_table, Gdk.DragAction.Copy);

            // Set up the iconview as the drag source
            Gtk.Drag.SourceSet(iconview, Gdk.ModifierType.Button1Mask, dd_table, Gdk.DragAction.Copy);

            this.preferencesFile = preferencesFile;
            this.LoadPreferences();
        }
コード例 #8
0
ファイル: EditModsDialog.cs プロジェクト: Altreus/MultiMC
        public EditModsDialog(Window parent, Instance inst)
            : base("Edit Mods", parent)
        {
            this.inst = inst;

            XML gxml = new XML(null, "MultiMC.GTKGUI.EditModsDialog.glade",
                "vboxEditMods", null);
            gxml.Autoconnect(this);

            this.VBox.PackStart(vboxEditMods);

            this.AddButton("_Cancel", ResponseType.Cancel);
            this.AddButton("_OK", ResponseType.Ok);

            WidthRequest = 600;
            HeightRequest = 500;

            modStore = new ListStore(typeof(string), typeof(Mod));
            jarModList.Model = modStore;
            jarModList.AppendColumn("Mod Name", new CellRendererText(), "text", 0);

            mlModStore = new ListStore(typeof(string), typeof(Mod));
            mlModList.Model = mlModStore;
            mlModList.AppendColumn("Mod Name", new CellRendererText(), "text", 0);

            //mlModList.Selection.Mode = SelectionMode.Multiple;

            inst.InstMods.ModFileChanged += (o, args) => LoadModList();

            // Listen for key presses
            jarModList.KeyPressEvent += new KeyPressEventHandler(jarModList_KeyPressEvent);
            mlModList.KeyPressEvent += new KeyPressEventHandler(mlModList_KeyPressEvent);
            TargetEntry te = new TargetEntry ();
            te.Flags = TargetFlags.Widget;
            te.Target = "STRING";
            TargetEntry[] tes = new TargetEntry[1];
            tes[0]=te;
            Gtk.TargetList tel = new Gtk.TargetList(tes);
            Gtk.Drag.SourceSet (jarModList, Gdk.ModifierType.Button1Mask, tes, Gdk.DragAction.Move);
            Gtk.Drag.DestSetTargetList (jarModList, tel);
            jarModList.DragDataGet += new DragDataGetHandler (ddgh);
            jarModList.DragDataReceived += new DragDataReceivedHandler (ddrh);
        }
コード例 #9
0
    // edit menu things

    public void DoEditCopy()
    {
        Console.WriteLine("DoEditCopy: ");
        Gtk.Clipboard cb = Gtk.Clipboard.Get(Gdk.Atom.Intern("PRIMARY", false));

        Gtk.TargetEntry[] entries = new Gtk.TargetEntry[5];
        entries[0].Target = "STRING";
        entries[0].Flags  = 0;
        entries[0].Info   = 0;
        entries[1].Target = "TEXT";
        entries[1].Flags  = 0;
        entries[1].Info   = 0;
        entries[2].Target = "COMPOUND_TEXT";
        entries[2].Flags  = 0;
        entries[2].Info   = 0;
        entries[3].Target = "UTF8_TEXT";
        entries[3].Flags  = 0;
        entries[3].Info   = 0;
        entries[4].Target = "MPHOTO_IMAGEID_LIST";
        entries[4].Flags  = 0;
        entries[4].Info   = 1;


        cb_currently_selected.Clear();

        for (int i = 0; i < icon_list.Selection.Count; i++)
        {
            if (icon_list.Selection[i])
            {
                cb_currently_selected.Add(icon_list.Adapter.GetImageID(i));
                Console.WriteLine("   adding: " + icon_list.Adapter.GetImageID(i));
            }
        }

        // cb.Set (entries, new Gtk.ClipboardGetFunc (CbGetFunc), new Gtk.ClipboardClearFunc (CbClearFunc), null);
    }
コード例 #10
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();
        Gnome.Vfs.Vfs.Initialize();
        treeviewDocuments.Model = DocumentStore;

        DocumentStore.RowInserted += OnRowInserted;
        DocumentStore.RowDeleted += OnRowDeleted;
        DocumentStore.RowChanged += OnRowChanged;

        //treeviewDocuments.AppendColumn (Mono.Unix.Catalog.GetString("Preview"), new Gtk.CellRendererPixbuf(), "pixbuf", 0);
        treeviewDocuments.AppendColumn (Mono.Unix.Catalog.GetString("Document"), new Gtk.CellRendererText(), "markup", 1);

        TargetEntry[] Targets = new TargetEntry[]{
            new TargetEntry("text/uri-list", TargetFlags.OtherApp, 0),
            new TargetEntry("application/couturier-row", TargetFlags.Widget, 1),
        };

        TargetEntry[] Sources = new TargetEntry[]{
            new TargetEntry("application/couturier-row", TargetFlags.Widget, 0),
        };

        this.labelPages.Text = Catalog.GetString("No Pages");
        this.imageAddDocument.TooltipMarkup = Catalog.GetString ("Add new document");
        this.imageRemoveDocument.TooltipMarkup = Catalog.GetString("Remove selected document");
        this.imageClearList.TooltipMarkup = Catalog.GetString ("Clear list");

        treeviewDocuments.EnableModelDragSource (Gdk.ModifierType.Button1Mask, Sources, (Gdk.DragAction.Default|Gdk.DragAction.Move));
        treeviewDocuments.EnableModelDragDest (Targets, Gdk.DragAction.Default);
        treeviewDocuments.Show();

        LoadDefaults();

        ShowAll();
    }
コード例 #11
0
ファイル: BaseDialog.cs プロジェクト: albfernandez/dalle
        private void InitComponents()
        {
            CloseButton = new Gtk.Button (Gtk.Stock.Close);
            FileEntry = new Gtk.Entry ();
            BrowseButton = new Gtk.Button (Catalog.GetString ("Browse..."));
            ActionButton = CreateActionButton ();
            Progress = new CustomProgressBar ();
            CheckOutputDir = new Gtk.CheckButton ();
            LabelOutputDir = new Gtk.EventBox();
            LabelOutputDir.Add(new Gtk.Label(Catalog.GetString ("Output directory")));
            LabelOutputDir.ButtonPressEvent += HandleLabelOutputDirClicked;

            FileOutputDirEntry = new Gtk.Entry ();
            CloseButton.Clicked += new EventHandler (this.CloseButtonClicked);
            ActionButton.Clicked += new EventHandler (this.ActionButtonClicked);
            BrowseButton.Clicked += new EventHandler (this.BrowseButtonClicked);
            // Targets
            TargetEntry [] te = new TargetEntry [] {
                new TargetEntry ("STRING", 0, 1),
            };
            Gtk.Drag.DestSet (this, DestDefaults.All, te, Gdk.DragAction.Copy | Gdk.DragAction.Move );

            FileEntry.DragDataReceived += new DragDataReceivedHandler(DropHandler);
            FileOutputDirEntry.DragDataReceived += new DragDataReceivedHandler(DropHandler2);
            FileOutputDirEntry.Sensitive = false;
            this.DragDataReceived += new DragDataReceivedHandler (DropHandler);
            CheckOutputDir.Toggled += HandleCheckOutputDirToggled;
        }
コード例 #12
0
ファイル: Clipboard.cs プロジェクト: Gravecorp/gtk-sharp
 static extern bool gtk_clipboard_set_with_owner(IntPtr raw, TargetEntry[] targets, int n_targets, GtkSharp.ClipboardGetFuncNative get_func, GtkSharp.ClipboardClearFuncNative clear_func, IntPtr owner);
コード例 #13
0
ファイル: MainWindow.cs プロジェクト: RodH257/Pinta
        public MainWindow()
            : base(WindowType.Toplevel)
        {
            CreateWindow ();

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

            progress_dialog = new ProgressDialog ();

            PintaCore.Initialize (tool_toolbar, canvas, this, progress_dialog);
            color.Initialize ();

            Compose ();

            LoadPaintBrushes ();
            LoadToolBox ();
            LoadEffects ();
            //CreateStatusBar ();

            canvas.IsFocus = true;

            UpdateRulerRange ();

            PintaCore.Chrome.DrawingArea.SizeAllocated += delegate {
                UpdateRulerRange ();
            };

            dialog_handler = new DialogHandlers (this);
            PintaCore.Actions.View.ZoomToWindow.Activated += new EventHandler (ZoomToWindow_Activated);
            PintaCore.Actions.View.ZoomToSelection.Activated += new EventHandler (ZoomToSelection_Activated);

            DeleteEvent += new DeleteEventHandler (MainWindow_DeleteEvent);

            PintaCore.Actions.File.BeforeQuit += delegate {
                dock.SaveLayouts (System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory (), "layouts.xml"));

                // Don't store the maximized height if the window is maximized
                if ((this.GdkWindow.State & Gdk.WindowState.Maximized) == 0) {
                    PintaCore.Settings.PutSetting ("window-size-width", this.GdkWindow.GetSize ().Width);
                    PintaCore.Settings.PutSetting ("window-size-height", this.GdkWindow.GetSize ().Height);
                }

                PintaCore.Settings.PutSetting ("window-maximized", (this.GdkWindow.State & Gdk.WindowState.Maximized) != 0);
                PintaCore.Settings.PutSetting ("ruler-metric", (int) hruler.Metric);
                PintaCore.Settings.PutSetting ("ruler-show", PintaCore.Actions.View.Rulers.Active);
                PintaCore.Settings.PutSetting ("toolbar-shown", PintaCore.Actions.View.ToolBar.Active);
                PintaCore.Settings.SaveSettings ();
            };

            ChangeRulersUnit ((MetricType) PintaCore.Settings.GetSetting ("ruler-metric", (int) MetricType.Pixels));
            PintaCore.Actions.View.Rulers.Active = PintaCore.Settings.GetSetting ("ruler-show", false);
            dialog_handler.UpdateRulerVisibility ();

            if (PintaCore.Settings.GetSetting <bool> ("window-maximized", false))
                this.GdkWindow.Maximize ();

            PintaCore.Actions.View.ToolBar.Active = PintaCore.Settings.GetSetting ("toolbar-shown", true);
            ToggleToolbar (PintaCore.Actions.View.ToolBar.Active);

            PintaCore.Actions.Help.About.Activated += new EventHandler (About_Activated);
            PintaCore.Workspace.ActiveDocumentChanged += ActiveDocumentChanged;
            PintaCore.Workspace.DocumentCreated += new EventHandler<DocumentEventArgs> (Workspace_DocumentCreated);
            PintaCore.Workspace.DocumentClosed += new EventHandler<DocumentEventArgs> (Workspace_DocumentClosed);

            // We support drag and drop for URIs
            Gtk.TargetEntry[] targetEntryTypes = new Gtk.TargetEntry[] { new Gtk.TargetEntry ("text/uri-list", 0, 100) };
            Gtk.Drag.DestSet (this, Gtk.DestDefaults.Motion | Gtk.DestDefaults.Highlight | Gtk.DestDefaults.Drop, targetEntryTypes, Gdk.DragAction.Copy);

            this.DragDataReceived += MainWindow_DragDataReceived;

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

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

                    main_menu.Hide ();
                } catch {
                    // If things don't work out, just use a normal menu.
                }
            }
        }
コード例 #14
0
ファイル: MainWindow.cs プロジェクト: yaoshuyin/TreeNote
    void CreateTreeView()
    {
         //CreateColumns
        TreeViewColumn col = new TreeViewColumn ();
        CellRendererText cell = new CellRendererText ();
        cell.Editable = true;
        col.Title = "Nodes";
        col.PackStart (cell, true);
        col.AddAttribute (cell, "text", 0);
        treeview1.AppendColumn (col);

        TreeViewColumn col2 = new TreeViewColumn ();
        CellRendererText cell2 = new CellRendererText ();
        cell2.Editable = true;
        col2.Title = "Url";
        col2.PackStart (cell2, true);
        col2.AddAttribute (cell2, "text", 1);
        col2.Visible = false;
        treeview1.AppendColumn (col2);
        treeview1.HeadersVisible = false;

        //Add Store
        treestore = new TreeStore (typeof(string), typeof(string));
        treeview1.Model = treestore;        

        cell.Edited +=  (o, args) => {
            Gtk.TreeIter iter;
            treestore.GetIter (out iter, new Gtk.TreePath (args.Path));

            String newvalue = (String)treestore.GetValue (iter, 0);
            Console.WriteLine (newvalue); 

            treestore.SetValue (iter, 0, args.NewText);
            };

            cell2.Edited += (o, args) => {
                Gtk.TreeIter iter;
                treestore.GetIter (out iter, new Gtk.TreePath (args.Path));

                String newvalue = (String)treestore.GetValue (iter, 1);
                Console.WriteLine (newvalue); 

                treestore.SetValue (iter, 1, args.NewText);
            };

            TargetEntry[] ten = new TargetEntry[]{ new TargetEntry ("tree", TargetFlags.App, 1) };

        treeview1.EnableModelDragDest (ten, Gdk.DragAction.Move);
        treeview1.EnableModelDragSource (Gdk.ModifierType.Button1Mask, ten, Gdk.DragAction.Move);
        ShowAll ();

        treeview1.DragDataGet += (o, args) => {
            TreeModel model;
            ((TreeSelection)treeview1.Selection).GetSelected (out model, out SourceIter);
                args.SelectionData.Set (args.SelectionData.Target, 8,   Encoding.UTF8.GetBytes (model.GetValue (SourceIter, 0).ToString ()));
            };

        treeview1.DragDataReceived += Tree_DragDataReceived;

        treeview1.ButtonPressEvent += Tree_ButtonPressEvent;
    }
コード例 #15
0
 private Widget CreateIconViewPane()
 {
     iFoldersScrolledWindow = new ScrolledWindow();
        iFoldersIconView = new iFolderIconView(iFoldersScrolledWindow);
        myiFoldersFilter = new TreeModelFilter(ifdata.iFolders, null);
        myiFoldersFilter.VisibleFunc = SynchronizedFoldersFilterFunc;
        localGroup = new iFolderViewGroup(Util.GS("iFolders on This Computer"), myiFoldersFilter);
        iFoldersIconView.AddGroup(localGroup);
        DomainInformation[] domains = domainController.GetDomains();
        foreach (DomainInformation domain in domains)
        {
     AddServerGroup(domain.ID);
        }
        iFoldersIconView.SelectionChanged +=
     new EventHandler(OniFolderIconViewSelectionChanged);
        iFoldersIconView.BackgroundClicked +=
     new iFolderClickedHandler(OniFolderIconViewBackgroundClicked);
        iFoldersIconView.iFolderClicked +=
     new iFolderClickedHandler(OniFolderClicked);
        iFoldersIconView.iFolderActivated +=
     new iFolderActivatedHandler(OniFolderActivated);
        iFoldersIconView.KeyPressEvent +=
     new KeyPressEventHandler(OniFolderIconViewKeyPress);
        TargetEntry[] targets =
     new TargetEntry[]
     {
          new TargetEntry ("text/uri-list", 0, (uint) TargetType.UriList),
          new TargetEntry ("application/x-root-window-drop", 0, (uint) TargetType.RootWindow)
     };
        Drag.DestSet(iFoldersIconView,
        DestDefaults.All,
        targets,
        Gdk.DragAction.Copy | Gdk.DragAction.Move);
        iFoldersIconView.DragMotion +=
     new DragMotionHandler(OnIconViewDragMotion);
        iFoldersIconView.DragDrop +=
     new DragDropHandler(OnIconViewDragDrop);
        iFoldersIconView.DragDataReceived +=
     new DragDataReceivedHandler(OnIconViewDragDataReceived);
        iFoldersScrolledWindow.AddWithViewport(iFoldersIconView);
        return iFoldersScrolledWindow;
 }
コード例 #16
0
ファイル: BugsViewWidget.cs プロジェクト: slluis/bugziller
        public BugsViewWidget(BugzillaServer server)
        {
            this.Build ();
            this.server = server;

            bugsStore = new TreeStore (
                                       typeof (BugInfo),
                                       typeof(string), // Group
                                       typeof(int), // Id
                                       typeof(int), // Local priority
                                       typeof(string), // Status
                                       typeof(string), // Severity
                                       typeof(string), // Target Milestone
                                       typeof(int), // Age
                                       typeof(string), // Assignee
                                       typeof(string), // ColOS
                                       typeof(string), // Component
                                       typeof(string), // Summary
                                       typeof(int), // Weight
                                       typeof(Gdk.Color), // Back color
                                       typeof(Gdk.Color), // Font color
                                       typeof(string) // Summary
                                       );
            bugsList.Model = bugsStore;

            /*			CellRendererSpin spin = new CellRendererSpin ();
            spin.Digits = 1;
                         */
            CellRendererText spin = new CellRendererText ();

            spin.Editable = true;
            spin.Edited += HandleSpinEdited;

            groupColumns = new TreeViewColumn [Enum.GetValues (typeof(GroupCommand)).Length - 1];

            groupColumn = bugsList.AppendColumn ("Category", new CellRendererText (), "text", ColGroup);
            bugsList.AppendColumn ("Id", new CellRendererText (), "text", ColId);
            bugsList.AppendColumn ("Prio", spin, "text", ColPriority);
            groupColumns [(int)GroupCommand.GroupByStatus] = bugsList.AppendColumn ("Status", new CellRendererText (), "text", ColStatus);
            groupColumns [(int)GroupCommand.GroupBySeverity] = bugsList.AppendColumn ("Severity", new CellRendererText (), "text", ColSeverity);
            groupColumns [(int)GroupCommand.GroupByMilestone] = bugsList.AppendColumn ("Milestone", new CellRendererText (), "text", ColTargetMilestone);
            bugsList.AppendColumn ("Age", new CellRendererText (), "text", ColAge);
            groupColumns [(int)GroupCommand.GroupByOwner] = bugsList.AppendColumn ("Assigned", new CellRendererText (), "text", ColAssignee);
            bugsList.AppendColumn ("OS", new CellRendererText (), "text", ColOS);
            groupColumns [(int)GroupCommand.GroupByComponent] = bugsList.AppendColumn ("Component", new CellRendererText (), "text", ColComponent);
            groupColumns [(int)GroupCommand.GroupByTag] = bugsList.AppendColumn ("Tags", new CellRendererText (), "text", ColTags);
            CellRendererText ct = new CellRendererText ();
            bugsList.AppendColumn ("Summary", ct, "text", ColSummary);

            int n = 1;
            foreach (TreeViewColumn col in bugsList.Columns) {
                col.SortColumnId = n++;
                col.Clickable = true;
                col.Resizable = true;
                col.Reorderable = true;
                CellRendererText crt = (CellRendererText) col.CellRenderers[0];
                col.AddAttribute (crt, "weight", ColWeight);
                col.AddAttribute (crt, "background-gdk", ColBackColor);
                col.AddAttribute (crt, "foreground-gdk", ColFontColor);
            }

            bugsList.DragBegin += HandleBugsListDragBegin;
            bugsList.DragDataReceived += HandleBugsListDragDataReceived;
            bugsList.DragEnd += HandleBugsListDragEnd;
            bugsList.DragMotion += HandleBugsListDragMotion;

            bugsList.Selection.Mode = SelectionMode.Multiple;
            bugsList.Selection.Changed += HandleBugsListSelectionChanged;

            Gtk.TargetEntry[] targets = new Gtk.TargetEntry [] { new TargetEntry ("bug", TargetFlags.Widget, 0) };
            //			bugsList.EnableModelDragSource (Gdk.ModifierType.None, targets, Gdk.DragAction.Move);
            Gtk.Drag.SourceSet (bugsList, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Move);
            bugsList.EnableModelDragDest (targets, Gdk.DragAction.Move);

            ActionCommand setPrioHigh = new ActionCommand (LocalCommands.SetPriorityHigh, GettextCatalog.GetString ("Set High Priority (Bottom)"));
            ActionCommand setPrioMed = new ActionCommand (LocalCommands.SetPriorityMed, GettextCatalog.GetString ("Set Medium Priority (Bottom)"));
            ActionCommand setPrioLow = new ActionCommand (LocalCommands.SetPriorityLow, GettextCatalog.GetString ("Set Low Priority (Bottom)"));
            ActionCommand setPrioHighTop = new ActionCommand (LocalCommands.SetPriorityHighTop, GettextCatalog.GetString ("Set High Priority (Top)"));
            ActionCommand setPrioMedTop = new ActionCommand (LocalCommands.SetPriorityMedTop, GettextCatalog.GetString ("Set Medium Priority (Top)"));
            ActionCommand setPrioLowTop = new ActionCommand (LocalCommands.SetPriorityLowTop, GettextCatalog.GetString ("Set Low Priority (Top)"));
            ActionCommand toggleRead = new ActionCommand (LocalCommands.ToggleNewMarker, GettextCatalog.GetString ("Mark as Changed"));
            ActionCommand openInBrowser = new ActionCommand (LocalCommands.OpenInBrowser, GettextCatalog.GetString ("Open in Browser"));
            ActionCommand refreshBugInfo = new ActionCommand (LocalCommands.RefreshFromSever, GettextCatalog.GetString ("Refresh From Server"));
            ActionCommand setTagCommand = new ActionCommand (LocalCommands.TagsList, GettextCatalog.GetString ("Set tag"));
            ActionCommand clearTagsCommand = new ActionCommand (LocalCommands.ClearTags, GettextCatalog.GetString ("Clear Tags"));
            ActionCommand editTagsCommand = new ActionCommand (LocalCommands.EditTags, GettextCatalog.GetString ("Edit Tags"));
            setTagCommand.CommandArray = true;
            setTagCommand.ActionType = ActionType.Check;

            menuSet = new CommandEntrySet ();
            menuSet.Add (openInBrowser);
            menuSet.AddSeparator ();
            menuSet.Add (setPrioHighTop);
            menuSet.Add (setPrioHigh);
            menuSet.Add (setPrioMedTop);
            menuSet.Add (setPrioMed);
            menuSet.Add (setPrioLowTop);
            menuSet.Add (setPrioLow);
            menuSet.AddSeparator ();

            CommandEntrySet tagsSet = menuSet.AddItemSet (GettextCatalog.GetString ("Tags"));
            tagsSet.Add (setTagCommand);
            tagsSet.AddSeparator ();
            tagsSet.Add (clearTagsCommand);
            tagsSet.Add (editTagsCommand);

            menuSet.Add (toggleRead);
            menuSet.AddSeparator ();
            menuSet.Add (refreshBugInfo);

            // Manage menu

            ActionCommand newServer = new ActionCommand (LocalCommands.NewServer, GettextCatalog.GetString ("Add Server..."));
            ActionCommand deleteServer = new ActionCommand (LocalCommands.DeleteServer, GettextCatalog.GetString ("Remove Server"));
            ActionCommand editServer = new ActionCommand (LocalCommands.EditServer, GettextCatalog.GetString ("Edit Server"));
            CommandEntrySet adminMenuSet = new CommandEntrySet ();
            adminMenuSet.Add (newServer);
            adminMenuSet.Add (deleteServer);
            adminMenuSet.Add (editServer);

            // Edit button

            MenuButton editButton = new MenuButton ();
            editButton.Relief = ReliefStyle.None;
            editButton.Label = GettextCatalog.GetString ("Manage");
            editButton.MenuCreator = delegate {
                return IdeApp.CommandService.CreateMenu (adminMenuSet);
            };
            hboxHeader.PackStart (editButton, false, false, 0);
            Box.BoxChild ch = (Box.BoxChild) hboxHeader [editButton];
            ch.Position = 1;
            editButton.ShowAll ();

            // Group by button

            CommandEntrySet groupByMenuSet = new CommandEntrySet ();
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByNothing, GettextCatalog.GetString ("Don't group")));
            groupByMenuSet.AddSeparator ();
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByComponent, GettextCatalog.GetString ("Component")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByMilestone, GettextCatalog.GetString ("Target Milestone")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByOwner, GettextCatalog.GetString ("Assigned To")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupBySeverity, GettextCatalog.GetString ("Severity")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByStatus, GettextCatalog.GetString ("Status")));
            groupByMenuSet.Add (new ActionCommand (GroupCommand.GroupByTag, GettextCatalog.GetString ("Tag")));

            MenuButton groupButton = new MenuButton ();
            groupButton.Relief = ReliefStyle.None;
            groupButton.Label = GettextCatalog.GetString ("Group By");
            groupButton.MenuCreator = delegate {
                return IdeApp.CommandService.CreateMenu (groupByMenuSet);
            };
            hboxHeader.PackStart (groupButton, false, false, 0);
            ch = (Box.BoxChild) hboxHeader [groupButton];
            ch.Position = 4;
            groupButton.ShowAll ();

            // Load data

            FillServers ();
            FillServer (null);
        }
コード例 #17
0
		// Set Event Handlers
		private void UpdateReactors()
		{
			
			// Enable Drop on MainWindow
            TargetEntry[] VtvD = new TargetEntry[]{
                    new TargetEntry("text/uri-list", 0, 0),
                    new TargetEntry("text/plain", 0, 1),
                    new TargetEntry("STRING", 0, 1)
            };
			
			Gtk.Drag.DestSet(MainWindow, 
                             DestDefaults.All, VtvD, 
                             Gdk.DragAction.Copy | 
                             Gdk.DragAction.Move |
                             Gdk.DragAction.Link |
                             Gdk.DragAction.Ask);
            
			MainWindow.DragDataReceived += MainWindow_Selection_Received;
			MainWindow.DeleteEvent += MainWindow_Delete;
			
			menuExit.Activated += MainWindow_Delete;
			btnExit.Clicked += MainWindow_Delete;
			
			menuScanFile.Activated += ActionOpen;
			btnScanFile.Clicked += ActionOpen;
			
			menuScanFolder.Activated += ActionOpen;
			btnScanFolder.Clicked += ActionOpen;
			
			menuScanFolderSubfolders.Activated += ActionOpen;
			btnScanFolderSubfolders.Clicked += ActionOpen;
			
			menuSaveReport.Activated += ActionReport;
			btnSaveReport.Clicked += ActionReport;
			
			menuAutoReport.Activated += ActionAutoReport;
			menuAboutWindow.Activated += ActionInfo;
			
			tabContainer.SwitchPage += TabChanged;
			
		}
コード例 #18
0
ファイル: ItemEditBox.cs プロジェクト: konne88/MyInventory
        public ItemEditBox (Items items, UIManager uiManager)
		: this(new Builder("item_edit_box.ui"))
        {
			Items = items;
			
			// create image the actions
			Gtk.Action addImageAction = new Gtk.Action("addImage","Add Image...","",Stock.Open);
			addImageAction.Activated += OnAddItemImage;
			Gtk.Action removeImageAction = new Gtk.Action("removeImage","Remove Image","",Stock.Remove);
			removeImageAction.Activated += OnRemoveItemImage;
			Gtk.Action imageAction = new Gtk.Action("itemImage","Image");
			
			ActionGroup imageActionGroup = new ActionGroup("itemImage");
			imageActionGroup.Add(addImageAction);
			imageActionGroup.Add(removeImageAction);
			imageActionGroup.Add(imageAction);
			uiManager.InsertActionGroup(imageActionGroup,0);
			
			// create the tag actions
			Gtk.Action addTagAction = new Gtk.Action("addTag","Add Tag","",Stock.Add);
			addTagAction.Activated += OnAddItemTag;
			Gtk.Action removeTagAction = new Gtk.Action("removeTag","Remove Tag","",Stock.Remove);
			removeTagAction.Activated += OnRemoveItemTag;
			Gtk.Action tagAction = new Gtk.Action("itemTag","Tag");
			
			ActionGroup tagActionGroup = new ActionGroup("itemTag");
			tagActionGroup.Add(addTagAction);
			tagActionGroup.Add(removeTagAction);
			tagActionGroup.Add(tagAction);
			uiManager.InsertActionGroup(tagActionGroup,0);
			
			// add columns to the item type combobox
			CellRenderer render = new CellRendererText ();
			itemEditType.PackStart(render, true);
			itemEditType.AddAttribute(render, "text", 0);
			
			// add columns and model to the depreciation combobox
			render = new CellRendererPixbuf ();
			itemEditDepreciationMethod.PackStart(render, false);
			itemEditDepreciationMethod.AddAttribute(render, "pixbuf", 0);
			render = new CellRendererText ();
			itemEditDepreciationMethod.PackStart(render, true);
			itemEditDepreciationMethod.AddAttribute(render, "text", 1);
			
			ListStore list = new ListStore(typeof(Gdk.Pixbuf),typeof(string),typeof(DepreciationMethod));
			list.AppendValues(new Gdk.Pixbuf(null,"degressive.png"),"Degressive",DepreciationMethod.Degressive);
			list.AppendValues(new Gdk.Pixbuf(null,"linear.png"),"Linear",DepreciationMethod.Linear);
			list.AppendValues(new Gdk.Pixbuf(null,"progressive.png"),"Progressive",DepreciationMethod.Progressive);
			itemEditDepreciationMethod.Model = list;
			
			// add columns and model to the label combobox
			render = new CellRendererPixbuf ();
			itemEditLabelMethod.PackStart(render, false);
			itemEditLabelMethod.AddAttribute(render, "pixbuf", 0);
			render = new CellRendererText ();
			itemEditLabelMethod.PackStart(render, true);
			itemEditLabelMethod.AddAttribute(render, "text", 1);
			
			list = new ListStore(typeof(Gdk.Pixbuf),typeof(string),typeof(DepreciationMethod));
			list.AppendValues(null,"Not Labelable",LabelMethod.None);
			list.AppendValues(null,"Printed Labels",LabelMethod.Print);
			list.AppendValues(null,"Painted Labels",LabelMethod.Paint);
			itemEditLabelMethod.Model = list;
			
			purchaseDatePicker = new PurchaseDatePicker();
			purchaseDatePicker.DateChanged += OnPickerDateChanged;
			itemEditShowCalendarIcon.Pixbuf = new Gdk.Pixbuf(null,"calendar.png");
			
			// create the images columns
			TreeViewColumn col = new TreeViewColumn ();
			col.Title = "images";
			render = new CellRendererToggle ();
			(render as CellRendererToggle).Toggled += OnMainImageToggle;
			(render as CellRendererToggle).Radio = true;
			col.PackStart(render, false);
			col.AddAttribute(render, "active", 1);			
			render = new CellRendererPixbuf ();
			col.PackStart       (render, false);
			col.AddAttribute(render, "pixbuf", 2);			
			render = new CellRendererText ();
			(render as CellRendererText).Editable = true;
			(render as CellRendererText).Edited += OnItemImageMemoEdited;
			render.EditingStarted += OnItemImageMemoEditingStarted;
			col.PackStart       (render, true);
			col.AddAttribute(render, "text", 3);
			col.AddAttribute(render, "foreground-gdk",4);
			itemEditImages.AppendColumn(col);
			
			itemEditImages.HeadersVisible = false;			
			TargetEntry target = new TargetEntry("text/plain",TargetFlags.OtherApp,0);
			TargetEntry[] targetArray = new TargetEntry[1];
			targetArray[0] = target;
			itemEditImages.EnableModelDragDest(targetArray, Gdk.DragAction.Copy);
			itemEditImages.DragDataReceived += OnItemImageDragDataReceived;
						
			// create the tags cells
			render = new CellRendererText ();
			itemEditTagCell = render;
			(render as CellRendererText).Editable = true;
			(render as CellRendererText).Edited += OnItemTagNameEdited;
			render.EditingStarted += OnStartItemTagEdit;
			itemEditTags.PackStart (render, false);
			itemEditTags.AddAttribute(render, "text", 1);
			
			// create the tag completion
			itemTagCompletion = new ItemTagChooser();
			itemTagCompletion.MatchFunc = ItemTabCompletionMatch;
			itemTagCompletion.MinimumKeyLength = 0;
			itemTagCompletion.PopupSetWidth = false;
			render = new CellRendererText ();
			itemTagCompletion.PackStart (render, true);
			itemTagCompletion.AddAttribute(render, "text", 1);
			
			// create the popup menues
			uiManager.AddUiFromResource("item_edit_box_menues.xml");
			itemImagePopup = (Menu) uiManager.GetWidget("/itemImagePopup");
        	itemTagPopup = (Menu) uiManager.GetWidget("/itemTagPopup");
		}
コード例 #19
0
 private Widget CreateIconViewPane()
 {
     iFoldersScrolledWindow = new ScrolledWindow();
        iFoldersIconView = new iFolderIconView(iFoldersScrolledWindow);
        myiFoldersFilter = new TreeModelFilter(ifdata.iFolders, null);
        myiFoldersFilter.VisibleFunc = SynchronizedFoldersFilterFunc;
        localGroup = new iFolderViewGroup(Util.GS("iFolders on This Computer"), myiFoldersFilter, SearchEntry);
        iFoldersIconView.AddGroup(localGroup);
        VBox emptyVBox = new VBox(false, 0);
        emptyVBox.BorderWidth = 12;
        Table table = new Table(3, 2, false);
        emptyVBox.PackStart(table, true, true, 0);
        table.RowSpacing = 12;
        table.ColumnSpacing = 12;
        Label l = new Label(
     string.Format("<span size=\"large\">{0}</span>",
       Util.GS("There are no iFolders on this computer.  To set up an iFolder, do one of the following:")));
        table.Attach(l,
        0, 2,
        0, 1,
        AttachOptions.Expand | AttachOptions.Fill,
        0, 0, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        l.Xalign = 0;
        Image uploadImg = new Image(Util.ImagesPath("upload48.png"));
        table.Attach(uploadImg,
        0, 1,
        1, 2,
        AttachOptions.Shrink | AttachOptions.Fill,
        0, 0, 0);
        l = new Label(
     string.Format("<span>{0}</span>",
       Util.GS("Select an existing folder on this computer to upload to an iFolder Server")));
        table.Attach(l,
        1, 2,
        1, 2,
        AttachOptions.Expand | AttachOptions.Fill,
        0, 0, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        l.Xalign = 0;
        Image downloadImg = new Image(Util.ImagesPath("download48.png"));
        table.Attach(downloadImg,
        0, 1,
        2, 3,
        AttachOptions.Shrink | AttachOptions.Fill,
        0, 0, 0);
        l = new Label(
     string.Format("<span>{0}</span>",
       Util.GS("Select an iFolder on the server to download to this computer")));
        table.Attach(l,
        1, 2,
        2, 3,
        AttachOptions.Expand | AttachOptions.Fill,
        0, 0, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        l.Xalign = 0;
        localGroup.EmptyWidget = emptyVBox;
        VBox emptySearchVBox = new VBox(false, 0);
        emptySearchVBox.BorderWidth = 12;
        l = new Label(
     string.Format("<span size=\"large\">{0}</span>",
       Util.GS("No matches found")));
        emptySearchVBox.PackStart(l, true, true, 0);
        l.UseMarkup = true;
        l.LineWrap = true;
        localGroup.EmptySearchWidget = emptySearchVBox;
        TargetEntry[] targets =
     new TargetEntry[]
     {
          new TargetEntry ("text/uri-list", 0, (uint) DragTargetType.UriList),
          new TargetEntry ("application/x-root-window-drop", 0, (uint) DragTargetType.RootWindow),
          new TargetEntry ("text/ifolder-id", 0, (uint) DragTargetType.iFolderID)
     };
        Drag.DestSet(iFoldersIconView,
        DestDefaults.All,
        targets,
        Gdk.DragAction.Copy | Gdk.DragAction.Move);
        iFoldersIconView.DragMotion +=
     new DragMotionHandler(OnIconViewDragMotion);
        iFoldersIconView.DragDrop +=
     new DragDropHandler(OnIconViewDragDrop);
        iFoldersIconView.DragDataReceived +=
     new DragDataReceivedHandler(OnIconViewDragDataReceived);
        DomainInformation[] domains = domainController.GetDomains();
        foreach (DomainInformation domain in domains)
        {
     AddServerGroup(domain.ID);
        }
        iFoldersIconView.SelectionChanged +=
     new EventHandler(OniFolderIconViewSelectionChanged);
        iFoldersIconView.BackgroundClicked +=
     new iFolderClickedHandler(OniFolderIconViewBackgroundClicked);
        iFoldersIconView.iFolderClicked +=
     new iFolderClickedHandler(OniFolderClicked);
        iFoldersIconView.iFolderActivated +=
     new iFolderActivatedHandler(OniFolderActivated);
        iFoldersIconView.KeyPressEvent +=
     new KeyPressEventHandler(OniFolderIconViewKeyPress);
        iFoldersScrolledWindow.AddWithViewport(iFoldersIconView);
        return iFoldersScrolledWindow;
 }
コード例 #20
0
ファイル: TargetService.cs プロジェクト: tcausby/giver
		private void Init()
		{
			this.BorderWidth = 0;
			this.Relief = Gtk.ReliefStyle.None;
			this.CanFocus = false;
			progressFraction = 0;
			updateProgress = false;
			
			VBox outerVBox = new VBox (false, 4);
	        HBox hbox = new HBox(false, 10);
			if(isManual) {
				image = new Gtk.Image(Utilities.GetIcon("computer", 48));
			} else {
				if(serviceInfo.Photo != null)
					image = new Gtk.Image(serviceInfo.Photo);
				else
				 	image = new Gtk.Image(Utilities.GetIcon("giver-48", 48));
			}

			hbox.PackStart(image, false, false, 0);
			VBox vbox = new VBox();
			hbox.PackStart(vbox, false, false, 0);
			Label label = new Label();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			if(isManual)
				label.Markup = "<span weight=\"bold\" size=\"large\">User Specified</span>";
			else
				label.Markup = string.Format ("<span weight=\"bold\" size=\"large\">{0}</span>",
                    						serviceInfo.UserName);
			vbox.PackStart(label, true, true, 0);

			label = new Label();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.UseMarkup = true;
			label.UseUnderline = false;

			if(isManual) {
				label.LineWrap = true;
				label.Markup = "<span style=\"italic\" size=\"small\">Use this recipient to enter\ninformation manually.</span>";
			} else {
				label.LineWrap = false;
				label.Markup = string.Format ("<span size=\"small\">{0}</span>",
	                    						serviceInfo.MachineName);
			}

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

			if(!isManual) {
				label = new Label();
				label.Justify = Gtk.Justification.Left;
	            label.SetAlignment (0.0f, 0.5f);
				label.LineWrap = false;
				label.UseMarkup = true;
				label.UseUnderline = false;
				label.Markup = string.Format ("<span style=\"italic\" size=\"small\">{0}:{1}</span>",
	                    						serviceInfo.Address, serviceInfo.Port);

				vbox.PackStart(label, true, true, 0);
			}

	        hbox.ShowAll();
	        outerVBox.PackStart (hbox, true, true, 0);
	        
	        progressBar = new ProgressBar ();
	        progressBar.Orientation = ProgressBarOrientation.LeftToRight;
	        progressBar.BarStyle = ProgressBarStyle.Continuous;
	        
	        progressBar.NoShowAll = true;
	        outerVBox.PackStart (progressBar, true, false, 0);
	        
			progressLabel = new Label ();
			progressLabel.UseMarkup = true;
			progressLabel.Xalign = 0;
			progressLabel.UseUnderline = false;
			progressLabel.LineWrap = true;
			progressLabel.Wrap = true;
			progressLabel.NoShowAll = true;
			progressLabel.Ellipsize = Pango.EllipsizeMode.End;
			outerVBox.PackStart (progressLabel, false, false, 0);
	        
	        outerVBox.ShowAll ();
	        Add(outerVBox);

			TargetEntry[] targets = new TargetEntry[] {
	                		new TargetEntry ("text/uri-list", 0, (uint) DragTargetType.UriList) };

			this.DragDataReceived += DragDataReceivedHandler;

			Gtk.Drag.DestSet(this,
						 DestDefaults.All | DestDefaults.Highlight,
						 targets,
						 Gdk.DragAction.Copy | Gdk.DragAction.Move );
		}
コード例 #21
0
ファイル: PlanningView.cs プロジェクト: chergert/adroit
        void BuildTaskColumns()
        {
            var completed_column = new TreeViewColumn ();
            completed_column.Widget = new Gtk.Image (Stock.Apply, IconSize.Menu);
            completed_column.Widget.Show ();
            var ctoggle = new Gtk.CellRendererToggle ();
            ctoggle.Xalign = 0.5f;
            ctoggle.Activatable = true;
            ctoggle.Toggled += HandleTaskCompletedToggled;
            completed_column.PackStart (ctoggle, false);
            completed_column.SetCellDataFunc (ctoggle, (TreeCellDataFunc)TaskCompletedCellDataFunc);

            var flag_column = new TreeViewColumn ();
            flag_column.Widget = new Gtk.Image (System.Reflection.Assembly.GetExecutingAssembly (), "Resources.flag-green.png");
            flag_column.Widget.Show ();
            var cflag = new CellRendererFlag ();
            cflag.Mode = CellRendererMode.Editable;
            cflag.Changed += delegate (object o, FlagArgs e) {
                var path = new Gtk.TreePath (e.Path);
                FlagSelectedTask (path);
            };
            flag_column.PackStart (cflag, true);
            flag_column.SetCellDataFunc (cflag, (TreeCellDataFunc)TaskFlagCellDataFunc);

            var attach_column = new TreeViewColumn ();
            var attach_pixbuf = GetResourcePixbuf ("Resources.attachment-16.png");
            attach_column.Widget = new Gtk.Image (attach_pixbuf);
            attach_column.Widget.Show ();
            var attach_cpix = new CellRendererPixbuf ();
            attach_column.PackStart (attach_cpix, true);
            attach_column.Alignment = 0.5f;
            attach_column.SetCellDataFunc (attach_cpix, (TreeCellDataFunc)TaskAttachCellDataFunc);

            task_title_column = new TreeViewColumn ();
            task_title_column.Title = Catalog.GetString ("Title");
            task_title_column.Expand = true;

            var ctext = new CellRendererText ();
            ctext.Ellipsize = Pango.EllipsizeMode.End;
            ctext.Editable = true;
            ctext.Edited += OnTaskTitleEdited;
            ctext.EditingStarted += delegate {
                this.OnEditingStarted (ctext);
            };
            ctext.EditingCanceled += delegate {
                this.OnEditingStopped ();
            };
            task_title_column.PackStart (ctext, true);
            task_title_column.SetCellDataFunc (ctext, (TreeCellDataFunc)TaskTitleCellDataFunc);

            var next_action_column = new TreeViewColumn ();
            next_action_column.Title = Catalog.GetString ("Next Action");

            ctext = new CellRendererText ();
            ctext.Ellipsize = Pango.EllipsizeMode.End;
            ctext.Editable = true;
            ctext.Edited += OnTaskNextActionEdited;
            ctext.EditingStarted += delegate {
                this.OnEditingStarted (ctext);
            };
            ctext.EditingCanceled += delegate {
                this.OnEditingStopped ();
            };
            next_action_column.PackStart (ctext, true);
            next_action_column.SetCellDataFunc (ctext, (TreeCellDataFunc)TaskNextActionCellDataFunc);

            m_tasksTreeView.AppendColumn (completed_column);
            m_tasksTreeView.AppendColumn (flag_column);
            m_tasksTreeView.AppendColumn (attach_column);
            m_tasksTreeView.AppendColumn (task_title_column);
            m_tasksTreeView.AppendColumn (next_action_column);

            var targetEntries = new TargetEntry[] {
                new TargetEntry ("application/adroit-task", TargetFlags.App, 0),
            };

            this.m_tasksTreeView.EnableModelDragSource (Gdk.ModifierType.Button1Mask, targetEntries, Gdk.DragAction.Default | Gdk.DragAction.Move);
            this.m_tasksTreeView.DragDataGet += delegate(object o, DragDataGetArgs args) {
                TreeIter iter;
                TreeModel model;
                m_tasksTreeView.Selection.GetSelected (out model, out iter);
                var task = (Task)model.GetValue (iter, 0);
                args.SelectionData.Set (null, 0, BitConverter.GetBytes (task.Id));
            };
        }
コード例 #22
0
ファイル: PlanningView.cs プロジェクト: chergert/adroit
        void BuildProjectColumns()
        {
            m_projectsTreeView.RowSeparatorFunc = delegate (TreeModel model, TreeIter iter) {
                var project = (Project)model.GetValue (iter, 0);
                return (project == null);
            };

            var column = new TreeViewColumn ();
            column.Title = Catalog.GetString ("Projects");
            column.Alignment = 0.5f;

            var cpix = new CellRendererPixbuf ();
            column.PackStart (cpix, false);
            column.SetCellDataFunc (cpix, (TreeCellDataFunc) ProjectIconCellDataFunc);

            var ctext = new CellRendererText ();
            ctext.Ellipsize = Pango.EllipsizeMode.End;
            ctext.Editable = true;
            ctext.Edited += OnProjectTitleEdited;
            ctext.EditingStarted += delegate {
                this.OnEditingStarted (ctext);
            };
            ctext.EditingCanceled += delegate {
                this.OnEditingStopped ();
            };
            column.PackStart (ctext, true);
            column.SetCellDataFunc (ctext, (TreeCellDataFunc) ProjectTitleCellDataFunc);

            m_projectsTreeView.RowSeparatorFunc = ProjectRowSeparatorFunc;
            m_projectsTreeView.AppendColumn (column);

            var targetEntries = new TargetEntry[] {
                new TargetEntry ("application/adroit-task", TargetFlags.App, 0),
            };

            this.m_projectsTreeView.EnableModelDragDest (targetEntries, Gdk.DragAction.Default | Gdk.DragAction.Move);
            this.m_projectsTreeView.DragDataReceived += delegate(object o, DragDataReceivedArgs args) {
                var tree = o as Gtk.TreeView;

                TreeViewDropPosition pos;
                TreePath path;

                if (tree.GetDestRowAtPos (args.X, args.Y, out path, out pos)) {
                    TreeIter iter;
                    tree.Model.GetIter (out iter, path);
                    var project = tree.Model.GetValue (iter, 0) as Project;
                    if (project == null)
                        return;

                    var model = m_tasksTreeView.Model;
                    var taskId = BitConverter.ToInt32 (args.SelectionData.Data, 0);

                    model.Foreach (delegate (TreeModel m, TreePath p, TreeIter i) {
                        var task = m.GetValue (i, 0) as Task;

                        if (task != null && task.Id == taskId) {
                            var command = new EditTaskCommand () {
                                Task = task,
                                Property = "ProjectId",
                                Value = project.Id,
                                Storage = m_storage
                            };
                            var commands = ServiceManager.Get<CommandService> ().Commands;
                            commands.Do (command);
                            return true;
                        }
                        return false;
                    });
                }
            };
        }
コード例 #23
0
ファイル: ExplorerView.cs プロジェクト: hol353/ApsimX
        /// <summary>Default constructor for ExplorerView</summary>
        public ExplorerView(ViewBase owner)
            : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.ExplorerView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            treeview1.Model = treemodel;
            TreeViewColumn column = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();
            column.PackStart(iconRender, false);
            textRender = new Gtk.CellRendererText();
            textRender.Editable = true;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            //            column.SetCellDataFunc(textRender, treecelldatafunc);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;

            TargetEntry[] target_table = new TargetEntry[] {
               new TargetEntry ("application/x-model-component", TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            //treeview1.EnableModelDragDest(target_table, actions);
            //treeview1.EnableModelDragSource(Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion += OnDragOver;
            treeview1.DragDrop += OnDragDrop;
            treeview1.DragBegin += OnDragBegin;
            treeview1.DragDataGet += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd += OnDragEnd;
            treeview1.DragDataDelete += OnDragDataDelete;
            treeview1.FocusInEvent += Treeview1_FocusInEvent;
            treeview1.FocusOutEvent += Treeview1_FocusOutEvent;
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
コード例 #24
0
		private void BuildLabelTreeView()
		{
			/* Move some stuff to LabelTreeView */
			labelTreeView = new LabelTreeView (this, true);
			labelListStore = new ListStore (typeof (TorrentLabel));
			
			labelTreeView.Model = labelListStore;
			labelTreeView.Selection.Changed += OnLabelSelectionChanged;
			labelViewScrolledWindow.AddWithViewport (labelTreeView);
			labelTreeView.Show ();
				
			//torrentFilter = new Gtk.TreeModelFilter (torrentListStore, null);
			//torrentFilter = new TorrentFilterModel(torrentListStore, null);
			//torrentFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTorrentTree);
			
			torrentTreeView.Model = torrentListStore;
			//torrentTreeView.Model = torrentFilter;
			
			//ArrayList allList = new ArrayList ();
			//foreach(TorrentManager manager in torrents.Keys){
			//	allList.Add (manager);
			//}
			
			allLabel = new TorrentLabel (new ArrayList(), "All", "gtk-home");
			downloadingLabel = new TorrentLabel (new ArrayList(), "Downloading", "gtk-go-down");
			uploadLabel = new TorrentLabel (new ArrayList(), "Seeding", "gtk-go-up");
		
			//labelListStore.AppendValues(Gtk.IconTheme.Default.LoadIcon("gtk-home", 16, 0), "All", "(0)");
			//labelListStore.AppendValues(Gtk.IconTheme.Default.LoadIcon("gtk-go-down", 16, 0), "Downloading", "(0)");
			//labelListStore.AppendValues(Gtk.IconTheme.Default.LoadIcon("gtk-go-up", 16, 0), "Seeding", "(0)");
		
			labelListStore.AppendValues (allLabel);
			labelListStore.AppendValues (downloadingLabel);
			labelListStore.AppendValues (uploadLabel);
			
			TargetEntry [] targetEntries = new TargetEntry[]{
				new TargetEntry("application/x-monotorrent-torrentmanager-objects", 0, 0)
			};
			
			labelTreeView.EnableModelDragDest(targetEntries, Gdk.DragAction.Copy);
			labelTreeView.DragDataReceived += OnTorrentDragDataReceived;
			
		}
コード例 #25
0
ファイル: MainWindow.cs プロジェクト: ArsenShnurkov/monsoon
        private void BuildLabelTreeView()
        {
            /* Move some stuff to LabelTreeView */
            LabelController = ServiceManager.Get <LabelController> ();
            labelTreeView = new LabelTreeView (LabelController, true);

            labelViewScrolledWindow.Add (labelTreeView);

            TargetEntry [] targetEntries = new TargetEntry[]{
                new TargetEntry(TorrentTreeView.RowAtom.Name, 0, 0)
            };

            torrentTreeView.DragBegin += Event.Wrap ((DragBeginHandler) delegate {
                TreeIter it;
                if (!labelTreeView.Selection.GetSelected (out it))
                    return;

                TorrentLabel label = (TorrentLabel) labelTreeView.Model.GetValue (it, 0);
                if (!label.Immutable)
                    LabelController.Add (LabelController.Delete);
            });

            torrentTreeView.DragEnd += Event.Wrap ((DragEndHandler) delegate {
                TreeIter iter;
                if (!labelTreeView.Model.GetIterFirst (out iter))
                    return;

                TreeIter prev = iter;
                while (labelTreeView.Model.IterNext(ref iter))
                    prev = iter;

                TorrentLabel label = (TorrentLabel) labelTreeView.Model.GetValue (prev, 0);
                if (label == LabelController.Delete)
                    LabelController.Remove (LabelController.Delete);
            });

            labelTreeView.EnableModelDragDest(targetEntries, Gdk.DragAction.Copy);
            labelTreeView.DragDataReceived += OnTorrentDragDataReceived;
        }
コード例 #26
0
 public static void AddTargetEntry(this TargetList targetList, TargetEntry entry)
 {
     targetList.Add(entry.Target, (uint)entry.Flags, (uint)entry.Info);
 }
コード例 #27
0
        public BugsViewWidget(BugzillaServer server)
        {
            this.Build();
            this.server = server;

            bugsStore = new TreeStore(
                typeof(BugInfo),
                typeof(string),                                 // Group
                typeof(int),                                    // Id
                typeof(int),                                    // Local priority
                typeof(string),                                 // Status
                typeof(string),                                 // Severity
                typeof(string),                                 // Target Milestone
                typeof(int),                                    // Age
                typeof(string),                                 // Assignee
                typeof(string),                                 // ColOS
                typeof(string),                                 // Component
                typeof(string),                                 // Summary
                typeof(int),                                    // Weight
                typeof(Gdk.Color),                              // Back color
                typeof(Gdk.Color),                              // Font color
                typeof(string)                                  // Summary
                );
            bugsList.Model = bugsStore;

/*			CellRendererSpin spin = new CellRendererSpin ();
 *                      spin.Digits = 1;
 */
            CellRendererText spin = new CellRendererText();

            spin.Editable = true;
            spin.Edited  += HandleSpinEdited;

            groupColumns = new TreeViewColumn [Enum.GetValues(typeof(GroupCommand)).Length - 1];

            groupColumn = bugsList.AppendColumn("Category", new CellRendererText(), "text", ColGroup);
            bugsList.AppendColumn("Id", new CellRendererText(), "text", ColId);
            bugsList.AppendColumn("Prio", spin, "text", ColPriority);
            groupColumns [(int)GroupCommand.GroupByStatus]    = bugsList.AppendColumn("Status", new CellRendererText(), "text", ColStatus);
            groupColumns [(int)GroupCommand.GroupBySeverity]  = bugsList.AppendColumn("Severity", new CellRendererText(), "text", ColSeverity);
            groupColumns [(int)GroupCommand.GroupByMilestone] = bugsList.AppendColumn("Milestone", new CellRendererText(), "text", ColTargetMilestone);
            bugsList.AppendColumn("Age", new CellRendererText(), "text", ColAge);
            groupColumns [(int)GroupCommand.GroupByOwner] = bugsList.AppendColumn("Assigned", new CellRendererText(), "text", ColAssignee);
            bugsList.AppendColumn("OS", new CellRendererText(), "text", ColOS);
            groupColumns [(int)GroupCommand.GroupByComponent] = bugsList.AppendColumn("Component", new CellRendererText(), "text", ColComponent);
            groupColumns [(int)GroupCommand.GroupByTag]       = bugsList.AppendColumn("Tags", new CellRendererText(), "text", ColTags);
            CellRendererText ct = new CellRendererText();

            bugsList.AppendColumn("Summary", ct, "text", ColSummary);

            int n = 1;

            foreach (TreeViewColumn col in bugsList.Columns)
            {
                col.SortColumnId = n++;
                col.Clickable    = true;
                col.Resizable    = true;
                col.Reorderable  = true;
                CellRendererText crt = (CellRendererText)col.CellRenderers[0];
                col.AddAttribute(crt, "weight", ColWeight);
                col.AddAttribute(crt, "background-gdk", ColBackColor);
                col.AddAttribute(crt, "foreground-gdk", ColFontColor);
            }

            bugsList.DragBegin        += HandleBugsListDragBegin;
            bugsList.DragDataReceived += HandleBugsListDragDataReceived;
            bugsList.DragEnd          += HandleBugsListDragEnd;
            bugsList.DragMotion       += HandleBugsListDragMotion;

            bugsList.Selection.Mode     = SelectionMode.Multiple;
            bugsList.Selection.Changed += HandleBugsListSelectionChanged;

            Gtk.TargetEntry[] targets = new Gtk.TargetEntry [] { new TargetEntry("bug", TargetFlags.Widget, 0) };
//			bugsList.EnableModelDragSource (Gdk.ModifierType.None, targets, Gdk.DragAction.Move);
            Gtk.Drag.SourceSet(bugsList, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Move);
            bugsList.EnableModelDragDest(targets, Gdk.DragAction.Move);

            ActionCommand setPrioHigh      = new ActionCommand(LocalCommands.SetPriorityHigh, GettextCatalog.GetString("Set High Priority (Bottom)"));
            ActionCommand setPrioMed       = new ActionCommand(LocalCommands.SetPriorityMed, GettextCatalog.GetString("Set Medium Priority (Bottom)"));
            ActionCommand setPrioLow       = new ActionCommand(LocalCommands.SetPriorityLow, GettextCatalog.GetString("Set Low Priority (Bottom)"));
            ActionCommand setPrioHighTop   = new ActionCommand(LocalCommands.SetPriorityHighTop, GettextCatalog.GetString("Set High Priority (Top)"));
            ActionCommand setPrioMedTop    = new ActionCommand(LocalCommands.SetPriorityMedTop, GettextCatalog.GetString("Set Medium Priority (Top)"));
            ActionCommand setPrioLowTop    = new ActionCommand(LocalCommands.SetPriorityLowTop, GettextCatalog.GetString("Set Low Priority (Top)"));
            ActionCommand toggleRead       = new ActionCommand(LocalCommands.ToggleNewMarker, GettextCatalog.GetString("Mark as Changed"));
            ActionCommand openInBrowser    = new ActionCommand(LocalCommands.OpenInBrowser, GettextCatalog.GetString("Open in Browser"));
            ActionCommand refreshBugInfo   = new ActionCommand(LocalCommands.RefreshFromSever, GettextCatalog.GetString("Refresh From Server"));
            ActionCommand setTagCommand    = new ActionCommand(LocalCommands.TagsList, GettextCatalog.GetString("Set tag"));
            ActionCommand clearTagsCommand = new ActionCommand(LocalCommands.ClearTags, GettextCatalog.GetString("Clear Tags"));
            ActionCommand editTagsCommand  = new ActionCommand(LocalCommands.EditTags, GettextCatalog.GetString("Edit Tags"));

            setTagCommand.CommandArray = true;
            setTagCommand.ActionType   = ActionType.Check;

            menuSet = new CommandEntrySet();
            menuSet.Add(openInBrowser);
            menuSet.AddSeparator();
            menuSet.Add(setPrioHighTop);
            menuSet.Add(setPrioHigh);
            menuSet.Add(setPrioMedTop);
            menuSet.Add(setPrioMed);
            menuSet.Add(setPrioLowTop);
            menuSet.Add(setPrioLow);
            menuSet.AddSeparator();

            CommandEntrySet tagsSet = menuSet.AddItemSet(GettextCatalog.GetString("Tags"));

            tagsSet.Add(setTagCommand);
            tagsSet.AddSeparator();
            tagsSet.Add(clearTagsCommand);
            tagsSet.Add(editTagsCommand);

            menuSet.Add(toggleRead);
            menuSet.AddSeparator();
            menuSet.Add(refreshBugInfo);

            // Manage menu

            ActionCommand   newServer    = new ActionCommand(LocalCommands.NewServer, GettextCatalog.GetString("Add Server..."));
            ActionCommand   deleteServer = new ActionCommand(LocalCommands.DeleteServer, GettextCatalog.GetString("Remove Server"));
            ActionCommand   editServer   = new ActionCommand(LocalCommands.EditServer, GettextCatalog.GetString("Edit Server"));
            CommandEntrySet adminMenuSet = new CommandEntrySet();

            adminMenuSet.Add(newServer);
            adminMenuSet.Add(deleteServer);
            adminMenuSet.Add(editServer);

            // Edit button

            MenuButton editButton = new MenuButton();

            editButton.Relief      = ReliefStyle.None;
            editButton.Label       = GettextCatalog.GetString("Manage");
            editButton.MenuCreator = delegate {
                return(IdeApp.CommandService.CreateMenu(adminMenuSet));
            };
            hboxHeader.PackStart(editButton, false, false, 0);
            Box.BoxChild ch = (Box.BoxChild)hboxHeader [editButton];
            ch.Position = 1;
            editButton.ShowAll();

            // Group by button

            CommandEntrySet groupByMenuSet = new CommandEntrySet();

            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupByNothing, GettextCatalog.GetString("Don't group")));
            groupByMenuSet.AddSeparator();
            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupByComponent, GettextCatalog.GetString("Component")));
            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupByMilestone, GettextCatalog.GetString("Target Milestone")));
            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupByOwner, GettextCatalog.GetString("Assigned To")));
            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupBySeverity, GettextCatalog.GetString("Severity")));
            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupByStatus, GettextCatalog.GetString("Status")));
            groupByMenuSet.Add(new ActionCommand(GroupCommand.GroupByTag, GettextCatalog.GetString("Tag")));

            MenuButton groupButton = new MenuButton();

            groupButton.Relief      = ReliefStyle.None;
            groupButton.Label       = GettextCatalog.GetString("Group By");
            groupButton.MenuCreator = delegate {
                return(IdeApp.CommandService.CreateMenu(groupByMenuSet));
            };
            hboxHeader.PackStart(groupButton, false, false, 0);
            ch          = (Box.BoxChild)hboxHeader [groupButton];
            ch.Position = 4;
            groupButton.ShowAll();

            // Load data

            FillServers();
            FillServer(null);
        }
コード例 #28
0
		void EnableDragFrom ()
		{
			// we dont really want to offer the drag to anything, merely pretend to, so we set a mimetype nothing takes
			TargetEntry te = new TargetEntry ("text/docky-uri-list", TargetFlags.App, 0);
			Gtk.Drag.SourceSet (Owner, Gdk.ModifierType.Button1Mask, new[] { te }, DragAction.Private);
		}
コード例 #29
0
ファイル: ExplorerView.cs プロジェクト: hut104/ApsimX
        /// <summary>Default constructor for ExplorerView</summary>
        public ExplorerView(ViewBase owner)
            : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.ExplorerView.glade", "vpaned1");
            gxml.Autoconnect(this);
            _mainWidget = vpaned1;

            progressbar1.Visible = false;
            statusWindow.HeightRequest = 20;
            treeview1.Model = treemodel;
            TreeViewColumn column = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();
            column.PackStart(iconRender, false);
            textRender = new Gtk.CellRendererText();
            textRender.Editable = true;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            //            column.SetCellDataFunc(textRender, treecelldatafunc);
            treeview1.AppendColumn(column);

            treeview1.CursorChanged += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;

            TargetEntry[] target_table = new TargetEntry[] {
               new TargetEntry ("application/x-model-component", TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            //treeview1.EnableModelDragDest(target_table, actions);
            //treeview1.EnableModelDragSource(Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion += OnDragOver;
            treeview1.DragDrop += OnDragDrop;
            treeview1.DragBegin += OnDragBegin;
            treeview1.DragDataGet += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd += OnDragEnd;
            treeview1.DragDataDelete += OnDragDataDelete;

            TextTag tag = new TextTag("error");
            tag.Foreground = "red";
            statusWindow.Buffer.TagTable.Add(tag);
            tag = new TextTag("warning");
            tag.Foreground = "brown";
            statusWindow.Buffer.TagTable.Add(tag);
            tag = new TextTag("normal");
            tag.Foreground = "blue";
            statusWindow.ModifyBase(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xf0));
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
コード例 #30
0
ファイル: DragDrop.cs プロジェクト: GNOME/gnome-subtitles
	/* Private members */

	private void SetDropTargets () {
		TargetEntry[] targetEntries = new TargetEntry[] { targetUriList };
		Gtk.Drag.DestSet(Base.GetWidget(WidgetNames.SubtitleAreaVBox), DestDefaults.All, targetEntries, DragAction.Copy);
		Gtk.Drag.DestSet(Base.GetWidget(WidgetNames.VideoAreaHBox), DestDefaults.All, targetEntries, DragAction.Copy);
	}
コード例 #31
0
        public ModelerCanvas()
        {
            this.ContentName = GettextCatalog.GetString ("DB Modeler");
            this.IsViewOnly = true;
            //Create model view-controller environment
            View = new StandardDrawingView (this);
            _controller = new modelController (View,this);

            //Create database designer canvas environment
            widget = new ModelerCanvasWidget (this, _controller);
            widget.getScroller ().SetSizeRequest (200, 200);
            widget.getScroller ().BorderWidth = 1;
            widget.getScroller ().Add ((Widget)View);
            Tool = new SelectionTool (this);
            widget.getScroller ().ShowAll ();

            //Add drag and drop support
            TargetEntry[] te2 = new TargetEntry[] { new Gtk.TargetEntry ("table/relationship", 0, 7777) };
            ScrolledWindow xscroller = widget.getScroller ();
            Gtk.Drag.DestSet (xscroller, DestDefaults.All, te2, Gdk.DragAction.Copy);
            xscroller.DragDataReceived += OnDragDataReceived;

            //todo: fix this undo manager
            _undoManager = new UndoManager ();
            UndoManager.StackChanged += delegate { UpdateUndoRedoSensitiveness (); };
        }
コード例 #32
0
ファイル: MphotoToplevel.cs プロジェクト: emtees/old-code
    // edit menu things

    public void DoEditCopy ()
    {
        Console.WriteLine ("DoEditCopy: ");
        Gtk.Clipboard cb = Gtk.Clipboard.Get (Gdk.Atom.Intern ("PRIMARY", false));

        Gtk.TargetEntry[] entries = new Gtk.TargetEntry[5];
        entries[0].Target = "STRING";
        entries[0].Flags = 0;
        entries[0].Info = 0;
        entries[1].Target = "TEXT";
        entries[1].Flags = 0;
        entries[1].Info = 0;
        entries[2].Target = "COMPOUND_TEXT";
        entries[2].Flags = 0;
        entries[2].Info = 0;
        entries[3].Target = "UTF8_TEXT";
        entries[3].Flags = 0;
        entries[3].Info = 0;
        entries[4].Target = "MPHOTO_IMAGEID_LIST";
        entries[4].Flags = 0;
        entries[4].Info = 1;


        cb_currently_selected.Clear ();

        for (int i = 0; i < icon_list.Selection.Count; i++) {
            if (icon_list.Selection[i]) {
                cb_currently_selected.Add (icon_list.Adapter.GetImageID (i));
                Console.WriteLine ("   adding: " + icon_list.Adapter.GetImageID (i));
            }
        }

        // cb.Set (entries, new Gtk.ClipboardGetFunc (CbGetFunc), new Gtk.ClipboardClearFunc (CbClearFunc), null);
    }