public iFolderViewGroupSelection(iFolderViewGroup group) : base() { this.group = group; // Set up the defaults this.Mode = SelectionMode.Single; }
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); }
/// <summary> /// Event Handler for Selection Changed event /// </summary> private void SelectionChangedHandler(object o, EventArgs args) { //Debug.PrintLine("iFolderIconView.SelectionChangedHandler()"); iFolderViewGroupSelection gSelect = (iFolderViewGroupSelection)o; iFolderViewGroup group = gSelect.ViewGroup; // Deselect all other items from other groups foreach (iFolderViewGroup tempGroup in viewGroups) { if (group != tempGroup) { tempGroup.Selection.SelectionChanged -= new EventHandler(SelectionChangedHandler); tempGroup.Selection.UnselectAll(); tempGroup.Selection.SelectionChanged += new EventHandler(SelectionChangedHandler); } } if (SelectionChanged != null) { iFolderViewItem selectedItem = null; if (group.Selection.GetSelected(out selectedItem)) { currentSelection = selectedItem.Holder; SelectionChanged(selectedItem.Holder, EventArgs.Empty); } else { currentSelection = null; SelectionChanged(null, EventArgs.Empty); } } }
/// <summary> /// Remove Group /// </summary> /// <param name="group">iFolder View Group</param> public void RemoveGroup(iFolderViewGroup group) { if (viewGroups.Contains(group)) { viewGroups.Remove(group); group.Selection.SelectionChanged -= new EventHandler(SelectionChangedHandler); vbox.Remove(group); } }
/// <summary> /// Constructor /// </summary> /// <param name="holder">iFolder Holder</param> /// <param name="group">iFolderViewGroup</param> 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 = ""; // domainController = DomainController.GetDomainController(); LoadImages(); SetPixbufs(); this.Add(CreateWidgets()); this.WidthRequest = this.maxWidth; this.Realized += new EventHandler(OnWidgetRealized); // FIXME: Fix things up so that if the user changes the theme, our icons will refresh too // if (!registeredForThemeChangeEvent) // { // IconTheme.Changed += new EventHandler(OnGtkIconThemeChanged); // } /// /// Set up drag and drop /// 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); }
/// <summary> /// Add Group /// </summary> /// <param name="group">iFolderViewGroup</param> public void AddGroup(iFolderViewGroup group) { if (viewGroups.Contains(group)) { return; // Don't add something that's already there } viewGroups.Add(group); vbox.PackStart(group, false, false, 0); group.RebuildTable(); group.Selection.SelectionChanged += new EventHandler(SelectionChangedHandler); vbox.ShowAll(); }
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 = ""; domainController = DomainController.GetDomainController(); LoadImages(); SetPixbufs(); this.Add(CreateWidgets()); this.WidthRequest = this.maxWidth; this.Realized += new EventHandler(OnWidgetRealized); }
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; }
private void AddServerGroup(string domainID) { Console.WriteLine("iFolderWindow.AddServerGroup(DomainID: {0})", domainID); if (serverGroups.ContainsKey(domainID)) return; DomainInformation domain = domainController.GetDomain(domainID); if (domain == null) return; iFolderServerFilter serverFilter = new iFolderServerFilter(domainID, SearchEntry); TreeModelFilter treeModelFilter = new TreeModelFilter(ifdata.iFolders, null); treeModelFilter.VisibleFunc = serverFilter.FilterFunc; iFolderViewGroup group = new iFolderViewGroup( string.Format( Util.GS("iFolders on {0}"), domain.Name), treeModelFilter, SearchEntry); serverGroups[domainID] = group; serverGroupFilters[domainID] = serverFilter; group.VisibleWhenEmpty = false; if (bAvailableFoldersShowing) iFoldersIconView.AddGroup(group); }
public void RemoveGroup(iFolderViewGroup group) { if (viewGroups.Contains(group)) { viewGroups.Remove(group); group.Selection.SelectionChanged -= new EventHandler(SelectionChangedHandler); vbox.Remove(group); } }
public void AddGroup(iFolderViewGroup group) { if (viewGroups.Contains(group)) return; viewGroups.Add(group); vbox.PackStart(group, false, false, 0); group.RebuildTable(); group.Selection.SelectionChanged += new EventHandler(SelectionChangedHandler); vbox.ShowAll(); }
public void RemoveGroup(iFolderViewGroup group) { iFolderIconView.CheckThread(); if (viewGroups.Contains(group)) { viewGroups.Remove(group); group.Selection.SelectionChanged -= SelectionChangedHandler; vbox.Remove(group); } }
public void AddGroup(iFolderViewGroup group) { iFolderIconView.CheckThread(); viewGroups.Add(group); group.Selection.SelectionChanged += SelectionChangedHandler; vbox.PackStart(group, false, false, 0); group.RebuildTable(); vbox.ShowAll(); }
public iFolderViewGroupSelection(iFolderViewGroup group) : base() { Console.WriteLine("iFolderViewGroupSelection.iFolderViewGroupSelection"); this.group = group; this.Mode = SelectionMode.Single; }
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; }
public iFolderViewGroupSelection(iFolderViewGroup group) : base() { this.group = group; this.Mode = SelectionMode.Single; }