NSOutlineView highlight style - nsoutlineview

I want to implement an NSTableView programmatically (Swift 4), not using Storyboards. If I were using a Storyboard (which I am not -- I want my outline in plain code), I would use the 'Source List' setting in the Attributes Inspector. See the screenshot below.
How can/should I code my NSOutlineView in Swift to use the 'Source List Highlight Style'?

Related

Infragistics UltraToolbarsManager - adding ApplicationDefaults to QuickAccessToolbar

Currently my QuckAccessToobar (QAT) shows only Show Below the Ribbon and Minimize the Ribbon options. I would like to add more options there, like in WordPad sample:
I found non infragistics related explanation here. It says about using QuickAccessToolbar.ApplicationDefaults property.
I found how to add tools to QAT itself (not dropdown) here. But there is no ApplicationDefaults property on ultraToolbarsManager1.Ribbon.QuickAccessToolbar
How can I add items to QAT dropdown so that users can check/uncheck them during runtime to display/hide buttons from QAT?
Turned out that ContextMenuTools property on UltraToolbarsManager.Ribbon.QuickAccessToolbar is exactly what I need.

WPF Toolkit Propertybox does not display nullable Enums

I'm currently using the Extended WPF Toolkit and from that i'm using the Propertybox. This box displays all properties of a bound element. While this works great, there is one problem. I'm using Nullable... so it does not display this enum correctly (it just gives a textbox). If i changed the enum to a normal enum (not nullable), then it displays the items correctly in a combobox.
To solve this, i tried the IItemsSource interface as described in the documentation, but this won't allow me to add a "null" value either.
I know i could solve this by adding a fake "null" value to my enumlist, but i would like to avoid this. Does anyone here know how i could make my nullable display correctly?
Kind regards
Tom
Control documentation:
https://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid
UPDATE SOLUTION:
I "solved" it by using a different control. http://www.codeproject.com/Articles/87715/Native-WPF-4-PropertyGrid. This grid supports it out of the box.
SOLUTION: I "solved" it by using a different control. https://github.com/xceedsoftware/wpftoolkit. This grid supports Nullable out of the box, and has some filtering functions for the properties you want to display that are not included in the Community Edition of the WPF Toolkit.
Update 2020: Added link to current webpage.

How to do Selection Alignment using the RichTextBox in Silverlight 4?

I cannot seem to figure out how to do a Selection Alignment in the new RichTextBox, I have an idea that I need to convert the selection into the Paragraph type which supports alignment, but cannot seem to figure this out. None of the Silverlight examples have this, but I'm sure it is possible.
I have this code, that does not work - as I think I need the selection to be a Paragraph as it always returns and Exception "Value does not fall within the expected range".
Editor.Selection.SetPropertyValue(Paragraph.TextAlignmentProperty, TextAlignment.Left)
I make sure I check for a Valid Selection first, code like the following works for "Bold":
If Editor.Selection.Text.Length > 0 Then ' Text Selected
If TypeOf Editor.Selection.GetPropertyValue(Run.FontWeightProperty) Is FontWeight _
AndAlso DirectCast(Editor.Selection.GetPropertyValue(Run.FontWeightProperty), FontWeight) = FontWeights.Normal Then
Editor.Selection.SetPropertyValue(Run.FontWeightProperty, FontWeights.Bold)
Else
Editor.Selection.SetPropertyValue(Run.FontWeightProperty, FontWeights.Normal)
End If
End If
Editor.Focus()
Example in XAML:
<Paragraph TextAlignment="Right">Example</Paragraph>
The above works in the contents of a RichTextBox however I need to do this programatically based on a selection - like in WordPad.
Using silverlight 4 released version, this is how I did it.
Editor.Selection.ApplyPropertyValue(Paragraph.TextAlignmentProperty, TextAlignment.Left)
That assumes that your text that you will be justifying is currently selected.
Looks like the RichTextArea does not support this as yet in the Silverlight 4 beta, although it is possible to populate a RichTextArea with Paragraph elements with a particular TextAlignment in code and XAML you cannot do it on a Selection as this does not expose the "Block" or "Paragraph" element selected just the "Run".

Emulating hyperlink functionality in datawindow text fields

The idea is rather simple. Some datawindow (not web datawindow) varchar fields contain detailed descriptions. I was wondering if it is possible to provide the following (wikipedia-like) functionality to users: The ability to click (or dbl-click or whatever) on specific words of the text, while reading (which somehow should be indicated as clickable - it would be perfect if they could be colored blue but I don't think this is possible) and open a relevant window (or response). Do you think something like this could be implemented?
To achieve the colour, you could use a rich text edit style if you're using PB 11.5.
For the hyperlink functionality, I'd try to leverage the Clicked event, trying to identify with SelectedStart() what word has been clicked and then whether or not it is a hyperlink. The column would need to have TabOrder so that a click would place the cursor in the text.
Good luck,
Terry.
if you use a RTF datawindow you can insert hyperlinks (in whatever colour or style you wish)

WPF Handle links inside FlowDocument

I'm building simple dictionary application using WPF.
I'm using MVVM pattern, databinding and FlowDocument to display words to user.
UI consists of 2 controls: ListBox and FlowDocumentScrollViewer.
Dictionary data comes from XML file, format of this string may look like this
<b>Word</b> - Some description. Another <i>description</i>. Reference <ref id="123">related word</ref>
The order of HTML and reference elements is not defined.
I parse HTML string, make it into XAML, then from XAML I create FlowDocument object and bind it to Document property of FlowDocumentScrollViewer control.
The problem arises when I need to link ref. elements. (my requirement is when user clicks on reference link, referenced word is selected in ListBox control and shown in FlowDocumentScrollViewer)
My question is there a way to dynamically create "hyperlink"-style controls (with event or commands attached) that would take user to referenced word in dictionary.
Is it possible to solve this problem at all?
There is the Hyperlink text element that has a Command property and a Click event. It behaves pretty much like a button, but it is used inside the FlowDocuments. You can use either method to achieve what you are after, but I tend to prefer Commands. Especially if you are implementing this using the MVVM pattern as you have tagged...

Resources