public override void DidSelect(NSTabView tabView, NSTabViewItem item) { if (SetRootPersonMenuItem != null) { SetRootPersonMenuItem.Enabled = false; } if (App.Document == null) { return; // don't bother if we've not loaded a document yet } switch (Title) { case "MainListsController": MainLists(item.Label); break; case "ErrorsFixesController": ErrorsFixes(item.Label); break; case "LocationsController": Locations(item.Label); break; } }
protected override IView OnConvertToView(FigmaNode currentNode, ProcessedNode parentNode, FigmaRendererService rendererService) { var frame = (FigmaFrame)currentNode; var tabView = new NSTabView(); List <NSTabViewItem> items = new List <NSTabViewItem>(); var tabNodes = frame.FirstChild(s => s.name == ComponentString.ITEMS); if (tabNodes == null) { return(new View(tabView)); } foreach (FigmaNode tabNode in tabNodes.GetChildren(t => t.visible, reverseChildren: true)) { var firstChild = tabNode.FirstChild(s => s.name.In(ComponentString.STATE_REGULAR, ComponentString.STATE_SELECTED) && s.visible); if (firstChild != null) { FigmaText text = firstChild.FirstChild(s => s.name == ComponentString.TITLE) as FigmaText; if (text != null) { items.Add(new NSTabViewItem() { Label = text.characters }); } } } tabView.SetItems(items.ToArray()); return(new View(tabView)); }
public override void DidFinishLaunching(NSNotification notification) { mainWindowController = new MainWindowController (); // This is where we setup our visual tree. These could be setup in MainWindow.xib, but // this example is showing programmatic creation. // We create a tab control to insert both examples into, and set it to take the entire window and resize CGRect frame = mainWindowController.Window.ContentView.Frame; NSTabView tabView = new NSTabView (frame) { AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable }; NSTabViewItem firstTab = new NSTabViewItem () { View = OutlineSetup.SetupOutlineView (frame), Label = "NSOutlineView" }; tabView.Add (firstTab); NSTabViewItem secondTab = new NSTabViewItem () { View = TableSetup.SetupTableView (frame), Label = "NSTableView" }; tabView.Add (secondTab); mainWindowController.Window.ContentView.AddSubview (tabView); mainWindowController.Window.MakeKeyAndOrderFront (this); }
public override void DidFinishLaunching(NSNotification notification) { mainWindowController = new MainWindowController(); // This is where we setup our visual tree. These could be setup in MainWindow.xib, but // this example is showing programmatic creation. // We create a tab control to insert both examples into, and set it to take the entire window and resize CGRect frame = mainWindowController.Window.ContentView.Frame; NSTabView tabView = new NSTabView(frame) { AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable }; NSTabViewItem firstTab = new NSTabViewItem() { View = OutlineSetup.SetupOutlineView(frame), Label = "NSOutlineView" }; tabView.Add(firstTab); NSTabViewItem secondTab = new NSTabViewItem() { View = TableSetup.SetupTableView(frame), Label = "NSTableView" }; tabView.Add(secondTab); mainWindowController.Window.ContentView.AddSubview(tabView); mainWindowController.Window.MakeKeyAndOrderFront(this); }
public RadioStationView() { tabView = new NSTabView(); tabView.Add(new NSTabViewItem((NSString)"Recent") { Label = "Recent", ToolTip = "Recent radio stations", View = (recent = new RadioStationListView { IsIncluded = false, }), }); tabView.Add(new NSTabViewItem((NSString)"My Stations") { Label = "My Stations", ToolTip = "My Radio Stations", View = (stations = new RadioStationListView { IsIncluded = true, }), }); tabView.DidSelect += async(object sender, NSTabViewItemEventArgs e) => { await Task.Delay(1); recent.CollectionView.ReloadData(); stations.CollectionView.ReloadData(); }; AddSubview(tabView); }
public TableTabsDelegate(NSTableView tableView, NSTabView tabView) { m_tableView = tableView; m_tabView = tabView; SelectionChange(); }
public override void WillSelect(NSTabView tabView, NSTabViewItem item) { if (item is TabViewItem tabViewItem) { owner.viewModel.OnTabChanging(tabViewItem.id); } }
public override void DidSelect(NSTabView tabView, NSTabViewItem item) { base.DidSelect(tabView, item); var controller = item.ViewController as ColorComponentViewController; EditorType = controller.EditorType; }
public override void DidFinishLaunching (NSNotification notification) { mainWindowController = new MainWindowController (); // We create a tab control to insert both examples into, and set it to take the entire window and resize CGRect frame = mainWindowController.Window.ContentView.Frame; NSTabView tabView = new NSTabView (frame) { AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable }; NSTabViewItem firstTab = new NSTabViewItem () { View = new CustomDrawRectView (tabView.ContentRect), Label = "CustomDrawRectView" }; tabView.Add (firstTab); NSTabViewItem secondTab = new NSTabViewItem () { View = new CustomLayerBasedView (tabView.ContentRect), Label = "CustomLayerBasedView" }; tabView.Add (secondTab); mainWindowController.Window.ContentView.AddSubview (tabView); mainWindowController.Window.MakeKeyAndOrderFront (this); }
public override void DidSelect(NSTabView tabView, NSTabViewItem item) { if (this.inhibitSelection) { return; } ViewModel.SelectedBrushType = ViewModel.BrushTypes[item.Label]; this.filterResource.Hidden = ViewModel.SelectedBrushType != CommonBrushType.Resource; if (!this.filterResource.Hidden) { if (Selected is TabButton tb) { tb.NextKeyView = this.filterResource; item.View.Window?.MakeFirstResponder(this.filterResource); if (item.View.Subviews.Length > 1 && item.View.Subviews[1].Subviews.Length > 0 && item.View.Subviews[1].Subviews[0] is NSOutlineView rov) { rov.NextKeyView = this.filterResource.NextKeyView; this.filterResource.NextKeyView = rov; } } } base.DidSelect(tabView, item); }
public TableTabsDelegate(NSTableView tableView, NSTabView tabView) { m_tableView = tableView; m_tabView = tabView; SelectionChange (); }
public MacTabView() { tabView = new NSTabView() { TranslatesAutoresizingMaskIntoConstraints = false }; }
public override void DidFinishLaunching(NSNotification notification) { mainWindowController = new MainWindowController(); // We create a tab control to insert both examples into, and set it to take the entire window and resize CGRect frame = mainWindowController.Window.ContentView.Frame; NSTabView tabView = new NSTabView(frame) { AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable }; NSTabViewItem firstTab = new NSTabViewItem() { View = new CustomDrawRectView(tabView.ContentRect), Label = "CustomDrawRectView" }; tabView.Add(firstTab); NSTabViewItem secondTab = new NSTabViewItem() { View = new CustomLayerBasedView(tabView.ContentRect), Label = "CustomLayerBasedView" }; tabView.Add(secondTab); mainWindowController.Window.ContentView.AddSubview(tabView); mainWindowController.Window.MakeKeyAndOrderFront(this); }
void ReleaseDesignerOutlets() { if (PropertyPages != null) { PropertyPages.Dispose(); PropertyPages = null; } }
public TableTabsController(NSTableView tableView, NSTabView tabView) { this.tableView = tableView; this.tabView = tabView; tableView.Delegate = new TableTabsDelegate(tableView, tabView); this.tableView.DataSource = this; }
public override void DidSelect(NSTabView tabView, NSTabViewItem item) { base.DidSelect(tabView, item); if (View?.Window?.WindowController is PreferencesWindowController windowController) { windowController.DidSelectTabViewItem(item); } }
public TableTabsController(NSTableView tableView, NSTabView tabView) { this.tableView = tableView; this.tabView = tabView; tableView.Delegate = new TableTabsDelegate (tableView, tabView); this.tableView.DataSource = this; }
public override void WillSelect(NSTabView tabView, NSTabViewItem item) { var myItem = item as TabViewItem; if (myItem != null) { owner.viewEvents.OnTabChanging(myItem.id, myItem.tag); } }
public override void WillSelect(NSTabView tabView, NSTabViewItem item) { var controller = item.ViewController as ColorComponentViewController; base.WillSelect(tabView, item); controller.ViewModel = ViewModel; EditorType = controller.EditorType; }
private void InitializeCommandLineModeRadioButtons(NSTabView tab) { var state = (int)ViewModel.CommandLineMode; var advancedTab = tab.Items.First(t => SelectedTab.Advanced.ToString().Equals((NSString)t.Identifier)); foreach (var radioButton in advancedTab.View.Subviews.OfType <NSButton>().Where(b => b.Identifier.StartsWith("CommandLine"))) { radioButton.State = radioButton.Tag == state ? NSCellStateValue.On : NSCellStateValue.Off; } }
public void TableViewDraggedImageEnded(NSTabView aTableView, NSImage aImage, NSPoint aPoint, NSDragOperation aOperation) { if (aOperation == NSDragOperation.NSDragOperationDelete) { foreach (Bookmark b in iDraggedBookmarks) { UserLog.WriteLine("Deleting bookmark: " + b.Title); iBookmarkManager.Remove(b); } } }
public override void DidSelect(NSTabView tabView, NSTabViewItem item) { if (this.inhibitSelection) { return; } ViewModel.SelectedBrushType = ViewModel.BrushTypes[item.Label]; this.filterResource.Hidden = ViewModel.SelectedBrushType != CommonBrushType.Resource; base.DidSelect(tabView, item); }
public override void WillSelect(NSTabView tabView, NSTabViewItem item) { if (item.ViewController is NotifyingViewController <BrushPropertyViewModel> brushController) { brushController.ViewModel = ViewModel; } if (this.inhibitSelection) { return; } base.WillSelect(tabView, item); }
void ReleaseDesignerOutlets() { if (FeaturePagesTabView != null) { FeaturePagesTabView.Dispose(); FeaturePagesTabView = null; } if (FeaturePagesArrayController != null) { FeaturePagesArrayController.Dispose(); FeaturePagesArrayController = null; } }
public SpatialDockManager() { IsVertical = true; DividerStyle = NSSplitViewDividerStyle.Thin; AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable; //Add tabview for legend TabControl1 = new NSTabView(); AddSubview (TabControl1); //Add tabview for map TabControl2= new NSTabView(); AddSubview (TabControl2); }
public void DidSelect(NSTabView tabView, NSTabViewItem item) { if (tabView != null && item != null) { switch (item.Label) { case "Logs": { tvPiiLogs.Value = string.Empty; tvPiiLogs.Value = _errorLog; } break; case "Raw Token": { tvRawToken.Value = string.Empty; //tvRawToken.Value = (_currentToken != null) ? _currentToken.Token : string.Empty; } break; case "Token": { } break; case "Cache": { } break; case "Keychain": { if (_currentEndpoint != null) { //_keychainTvDataSource.KeychainValues = KeychainService.Instance.GetRecordsFromKeychain($"{_currentEndpoint.TeamId}.{_currentEndpoint.KeychainSecurityGroup}"); //tvKeychain.ReloadData(); } } break; default: { //auth window - do nothing } break; } } }
private void InitializeAlwaysUpdateDelegates(NSTabView tab) { var alwaysUpdateDelegate = new AlwaysUpdateTextChanges(); var tabsToVisit = new[] { SelectedTab.Input.ToString(), SelectedTab.Advanced.ToString() }; foreach (var tabItem in tab.Items) { var identifer = tabItem.Identifier as NSString; if ((identifer != null) && tabsToVisit.Contains(identifer)) { foreach (var textField in tabItem.View.Subviews.OfType <NSTextField>().Where(t => t.Identifier.StartsWith("UseCommitDelegate"))) { textField.Delegate = alwaysUpdateDelegate; } } } }
public RadioStationView() { iflButton = new SimpleButton { Clicked = async(obj) => { await PlaybackManager.Shared.Play(new RadioStation("I'm Feeling Lucky") { Id = "IFL", }); }, Title = "I'm Feeling Luck", }; AddSubview(iflButton); tabView = new NSTabView(); tabView.Add(new NSTabViewItem((NSString)"Recent") { Label = "Recent", ToolTip = "Recent radio stations", View = (recent = new RadioStationListView { IsIncluded = false, }), }); tabView.Add(new NSTabViewItem((NSString)"My Stations") { Label = "My Stations", ToolTip = "My Radio Stations", View = (stations = new RadioStationListView { IsIncluded = true, }), }); tabView.DidSelect += async(object sender, NSTabViewItemEventArgs e) => { await Task.Delay(1); recent.CollectionView.ReloadData(); stations.CollectionView.ReloadData(); }; AddSubview(tabView); }
public MacTabWrapper(NSTabView content) { this.content = content; }
public override void DidSelect(NSTabView tabView, NSTabViewItem item) { if (App.Document == null) { return; // don't bother if we've not loaded a document yet } NSViewController viewController = null; switch (item.Label) { case "Gedcom Stats": if (ChildViewControllers.Length > 0) { viewController = ChildViewControllers[0]; } break; case "Main Lists": LoadMainLists(ProgressController); if (ChildViewControllers.Length > 1) { viewController = ChildViewControllers[1]; } Analytics.TrackAction(Analytics.MainFormAction, Analytics.MainListsEvent); break; case "Errors/Fixes": LoadErrorsAndFixes(ProgressController); if (ChildViewControllers.Length > 2) { viewController = ChildViewControllers[2]; } Analytics.TrackAction(Analytics.MainFormAction, Analytics.ErrorsFixesEvent); break; case "Locations": LoadLocations(ProgressController); if (ChildViewControllers.Length > 3) { viewController = ChildViewControllers[3]; } Analytics.TrackAction(Analytics.MainFormAction, Analytics.LocationTabViewed); break; case "Lost Cousins": UpdateLostCousinsReport(ProgressController); if (ChildViewControllers.Length > 5) { viewController = ChildViewControllers[5]; } Analytics.TrackAction(Analytics.MainFormAction, Analytics.LostCousinsTabEvent); break; default: viewController = null; break; } if (viewController != null) { if (viewController is GedcomDocumentViewController) { App.CurrentViewController = viewController; } else { var index = (viewController as NSTabViewController).SelectedTabViewItemIndex; if (ChildViewControllers.Length > index) { App.CurrentViewController = viewController.ChildViewControllers[index]; } } } else { App.CurrentViewController = null; } }
public override void DidSelect(NSTabView tabView, NSTabViewItem item) { base.DidSelect(tabView, item); ToolbarSegmentedControl.SelectedSegment = SelectedTabViewItemIndex; ItemSelected?.Invoke(this, new NSTabViewItemEventArgs(item)); }
public override void WillSelect(NSTabView tabView, NSTabViewItem item) { base.WillSelect(tabView, item); WillSelectCalled?.Raise(this); }
public void DidSelect(NSTabView tabView, NSTabViewItem item) { // Invalidate touch bar so we get a new one this.SetTouchBar(null); }
public InspectorWindow(IInspectDelegate inspectorDelegate, CGRect frame) : base(frame, NSWindowStyle.Titled | NSWindowStyle.Resizable, NSBackingStore.Buffered, false) { this.inspectorDelegate = inspectorDelegate; ShowsToolbarButton = false; MovableByWindowBackground = false; propertyEditorPanel = new PropertyEditorPanel(); editorProvider = new PropertyEditorProvider(); propertyEditorPanel.TargetPlatform = new TargetPlatform(editorProvider) { SupportsCustomExpressions = true, SupportsMaterialDesign = true, }; var currentThemeStyle = NSUserDefaults.StandardUserDefaults.StringForKey("AppleInterfaceStyle") ?? "Light"; PropertyEditorPanel.ThemeManager.Theme = currentThemeStyle == "Dark" ? PropertyEditorTheme.Dark : PropertyEditorTheme.Light; contentView = ContentView; var stackView = NativeViewHelper.CreateVerticalStackView(margin); contentView.AddSubview(stackView); stackView.LeftAnchor.ConstraintEqualToAnchor(contentView.LeftAnchor, margin).Active = true; stackView.RightAnchor.ConstraintEqualToAnchor(contentView.RightAnchor, -margin).Active = true; stackView.TopAnchor.ConstraintEqualToAnchor(contentView.TopAnchor, margin).Active = true; constraint = stackView.HeightAnchor.ConstraintEqualToConstant(contentView.Frame.Height - margin * 2); constraint.Active = true; outlineView = new OutlineView(); var outlineViewScrollView = new ScrollContainerView(outlineView); outlineView.SelectionNodeChanged += (s, e) => { if (outlineView.SelectedNode is NodeView nodeView) { RaiseFirstResponder?.Invoke(this, nodeView.Wrapper); } }; outlineView.KeyPress += (sender, e) => { if (e == DeleteKey) { if (outlineView.SelectedNode is NodeView nodeView) { RaiseDeleteItem?.Invoke(this, nodeView.Wrapper); } } }; //TOOLBAR var toolbarTab = new NSTabView() { TranslatesAutoresizingMaskIntoConstraints = false }; var toolbarTabViewWrapper = new MacTabWrapper(toolbarTab); toolbarTab.WantsLayer = true; toolbarTab.Layer.BackgroundColor = NSColor.Red.CGColor; stackView.AddArrangedSubview(toolbarTab); toolbarTab.LeftAnchor.ConstraintEqualToAnchor(contentView.LeftAnchor, margin).Active = true; toolbarTab.RightAnchor.ConstraintEqualToAnchor(contentView.RightAnchor, -margin).Active = true; toolbarTab.TopAnchor.ConstraintEqualToAnchor(contentView.TopAnchor, margin).Active = true; toolbarTab.HeightAnchor.ConstraintEqualToConstant(ScrollViewSize).Active = true; ///////////////// var toolbarTabItem = new NSTabViewItem(); toolbarTabItem.Label = "Toolbar"; var toolbarStackView = NativeViewHelper.CreateVerticalStackView(); toolbarStackView.TranslatesAutoresizingMaskIntoConstraints = true; var toolbarHorizontalStackView = NativeViewHelper.CreateHorizontalStackView(); toolbarHorizontalStackView.TranslatesAutoresizingMaskIntoConstraints = true; toolbarSearchTextField = new NSSearchField(); toolbarSearchTextField.Changed += (object sender, EventArgs e) => { Search(); }; toolbarHorizontalStackView.AddArrangedSubview(toolbarSearchTextField); var compactModeToggleButton = new ToggleButton(); compactModeToggleButton.TranslatesAutoresizingMaskIntoConstraints = true; compactModeToggleButton.Image = inspectorDelegate.GetImageResource("compact-display-16.png").NativeObject as NSImage; compactModeToggleButton.ToolTip = "Use compact display"; toolbarHorizontalStackView.AddArrangedSubview(compactModeToggleButton); toolbarStackView.AddArrangedSubview(toolbarHorizontalStackView); toolbarView = new MacInspectorToolbarView(); var toolbarViewScrollView = new ScrollContainerView(toolbarView); toolbarStackView.AddArrangedSubview(toolbarViewScrollView); toolbarTabItem.View = toolbarStackView; toolbarView.ActivateSelectedItem += (sender, e) => { RaiseInsertItem?.Invoke(this, toolbarView.SelectedItem.TypeOfView); }; var outlineTabItem = new NSTabViewItem(); outlineTabItem.Label = "View Hierarchy"; outlineTabItem.View = outlineViewScrollView; toolbarTab.Add(outlineTabItem); toolbarTab.Add(toolbarTabItem); foreach (var module in InspectorContext.Current.Modules) { if (!module.IsEnabled) { continue; } module.Load(this, toolbarTabViewWrapper); } //=================== //Method list view methodListView = new MethodListView(); methodListView.AddColumn(new NSTableColumn("col") { Title = "Methods" }); methodListView.DoubleClick += MethodListView_DoubleClick; scrollView = new ScrollContainerView(methodListView); var titleContainter = NativeViewHelper.CreateHorizontalStackView(); //titleContainter.WantsLayer = true; //titleContainter.Layer.BackgroundColor = NSColor.Gray.CGColor; methodSearchView = new NSSearchField() { TranslatesAutoresizingMaskIntoConstraints = false }; titleContainter.AddArrangedSubview(methodSearchView); methodSearchView.WidthAnchor.ConstraintEqualToConstant(180).Active = true; IImageWrapper invokeImage = inspectorDelegate.GetImageResource("execute-16.png"); IButtonWrapper invokeButton = inspectorDelegate.GetImageButton(invokeImage); invokeButton.SetTooltip("Invoke Method!"); invokeButton.SetWidth(ButtonWidth); titleContainter.AddArrangedSubview((NSView)invokeButton.NativeObject); invokeButton.Pressed += (s, e) => InvokeSelectedView(); titleContainter.AddArrangedSubview(NativeViewHelper.CreateLabel("Result: ")); resultMessage = NativeViewHelper.CreateLabel(""); resultMessage.LineBreakMode = NSLineBreakMode.ByWordWrapping; titleContainter.AddArrangedSubview(resultMessage); var methodStackPanel = NativeViewHelper.CreateVerticalStackView(); methodStackPanel.AddArrangedSubview(titleContainter); titleContainter.LeftAnchor.ConstraintEqualToAnchor(methodStackPanel.LeftAnchor, 0).Active = true; titleContainter.RightAnchor.ConstraintEqualToAnchor(methodStackPanel.RightAnchor, 0).Active = true; methodStackPanel.AddArrangedSubview(scrollView); ///// var tabPropertyPanel = new NSTabViewItem(); tabPropertyPanel.View = propertyEditorPanel; tabPropertyPanel.Label = "Properties"; var tabMethod = new NSTabViewItem(); tabMethod.View.AddSubview(methodStackPanel); methodStackPanel.LeftAnchor.ConstraintEqualToAnchor(tabMethod.View.LeftAnchor, 0).Active = true; methodStackPanel.RightAnchor.ConstraintEqualToAnchor(tabMethod.View.RightAnchor, 0).Active = true; methodStackPanel.TopAnchor.ConstraintEqualToAnchor(tabMethod.View.TopAnchor, 0).Active = true; methodStackPanel.BottomAnchor.ConstraintEqualToAnchor(tabMethod.View.BottomAnchor, 0).Active = true; tabMethod.Label = "Methods"; tabView = new NSTabView() { TranslatesAutoresizingMaskIntoConstraints = false }; tabView.Add(tabPropertyPanel); tabView.Add(tabMethod); stackView.AddArrangedSubview(tabView as NSView); tabView.LeftAnchor.ConstraintEqualToAnchor(stackView.LeftAnchor, 0).Active = true; tabView.RightAnchor.ConstraintEqualToAnchor(stackView.RightAnchor, 0).Active = true; methodSearchView.Activated += (sender, e) => { if (viewSelected != null) { methodListView.SetObject(viewSelected.NativeObject, methodSearchView.StringValue); } }; compactModeToggleButton.Activated += (sender, e) => { toolbarView.ShowOnlyImages(!toolbarView.IsImageMode); }; }