Display a nsoutlineview programmatically - c#

I want to display a simple nsoutlineview that will display a hierarchy.
When I did it via InterfaceBuilder, everything was fine, but now that I'm trying to it programmatically, I have some trouble.
Here the code I use to display the outline view, inside a nsscrollview :
this.OutlineView = new NSOutlineView();
this.OutlineView.IndentationPerLevel = 16.0f;
this.OutlineView.IndentationMarkerFollowsCell = true;
this.OutlineView.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.Regular;
this.OutlineView.HeaderView = null;
this.OutlineView.BackgroundColor = NSColor.FromDeviceRgba(225f/255f,228f/255f,232f/255f,1f);
this.OutlineView.DataSource = dataSource;
this.OutlineView.Delegate = aDelegate;
NSTableColumn tableColumn = new NSTableColumn("Name");
tableColumn.Editable = false;
tableColumn.MinWidth = 100f;
this.OutlineView.AddColumn(tableColumn);
this.DocumentView = this.OutlineView;
And this is what I get when I want to display the hierarchy of a root directory and a file inside this directory :
No arrow before root, no indentation of the file in the directory...

Ok found it after looking in the debugger how xCode construct the scroll view :S
In addition to adding the table column, you have to set the OutlineTableColumn, by adding this line :
this.OutlineView.OutlineTableColumn = tableColumn;

Related

Gtk# application is not rendering TreeView Properly

I am trying to develop a gtk application on mac using gtk#. I created a tree view just like in the tutorial but the arrows are not rendering properly as seem below, there are no arrows. I can click to open and close but the actual arrows aren't working.
I copy pasted the code from the tutorial and It did the same thing, but here is my code anywhere. I have also verified view.ShowExpanders is set to true
Application.Init();
Window window = new Window("Editor Window");
window.SetPosition(WindowPosition.Center);
window.HeightRequest = 800;
window.WidthRequest = 1200;
TreeView view = new TreeView();
view.WidthRequest = 500;
TreeViewColumn column = new TreeViewColumn();
column.Title = "Heirarchy";
CellRendererText cell = new CellRendererText();
column.PackStart(cell, true);
view.AppendColumn(column);
column.AddAttribute(cell, "text", 0);
TreeStore store = new TreeStore(typeof(string));
TreeIter i = store.AppendValues("Project");
i = store.AppendValues(i,"Room1");
i = store.AppendValues(i, "Item");
store.AppendValues(i, "Attribute");
store.AppendValues(i, "Attribute");
store.AppendValues(i, "Attribute");
view.ShowExpanders = true;
view.Model = store;
view.ShowExpanders = true;
window.Add(view);
window.DeleteEvent += ExitWindow;
window.ShowAll();
Application.Run();
Is there some sort of image asset that doesn't exist on my computer? How would I install that on mac? Thank you for any help you can provide.
As a comment suggested, using brew install adwaita-icon-theme fixed the problem

How to set page layout break on worksheet using EPPlus

Is there a way to set specify where to break the page using EEPlus? I have the following code that sets the printer properties but haven't found a way to set a break point on a certain column.
// Set printer settings
ws.PrinterSettings.PaperSize = ePaperSize.Tabloid;
ws.PrinterSettings.Orientation = eOrientation.Landscape;
ws.PrinterSettings.FitToPage = true;
ws.PrinterSettings.FitToHeight = 1;
ws.PrinterSettings.FooterMargin = .05M;
ws.PrinterSettings.TopMargin = .05M;
ws.PrinterSettings.LeftMargin = .05M;
ws.PrinterSettings.RightMargin = .05M;
Edit (this helped solve my problem)
ws.Column(30).PageBreak = true;
ws.PrinterSettings.PaperSize = ePaperSize.A3;
ws.PrinterSettings.Orientation = eOrientation.Landscape;
ws.PrinterSettings.Scale = 75;
Just need to get reference to the Row and/or Column objects:
ws.Row(20).PageBreak = true;
ws.Column(2).PageBreak = true;
But keep in mind that FitToPage might suppress these.

DevExpress: How to set programmatically diagram to chart control

I create ChartControl dynamiclly and I have to set Diagram property as dynamiclly.
Here is my code:
XYDiagram xyDiagram1 = new XYDiagram();
xyDiagram1.AxisX.Title.Text = "";
xyDiagram1.AxisX.VisibleInPanesSerializable = "-1";
xyDiagram1.AxisX.WholeRange.Auto = false;
xyDiagram1.AxisX.WholeRange.AutoSideMargins = false;
xyDiagram1.AxisX.WholeRange.MaxValueSerializable = "10";
xyDiagram1.AxisX.WholeRange.MinValueSerializable = "5";
xyDiagram1.AxisX.WholeRange.SideMarginsValue = 2.5D;
xyDiagram1.AxisY.Title.Text = "";
xyDiagram1.AxisY.VisibleInPanesSerializable = "-1";
barChart.Diagram = xyDiagram1;
But it throws This property can't be customized at runtime. exception. Do you have any suggestion?
An instance of ChartControl.Diagram is automatically created by a chart. The ViewType enumerable controls what diagram is created. So, cast the ChartControl.Diagram property to your diagram type to get it. You don't need to create a diagram manually.

Programmatically Aligning Elements in Monotouch View

I've created a view that will need to be added to several different screens. I'm struggling to figure out how to align the elements correctly in the view.
The output needs to look like the following:
I've tried the following with no success:
var uiiv = new UIImageView(image);
var firstLine = new UITextField { Text = description};
var secondLine = new UITextField { Text = summary};
this.Add(uiiv);
this.Add(firstLine );
this.Add(secondLine );
Every UI element should have a Frame property that allows you to specify the position of the element relative to it's parent view. Using this property will allow you to position the element.

How to hand code people picker in sharepoint 2010 for Coded UI

I am trying to automate sharepoint 2010 people picker, but it is very difficult even to highlight any control inside the window.
I have used hand coding to find the window but the controls inside the window are not highlighting.
WinWindow pp = new WinWindow(browserWindow);
pp.TechnologyName = "MSAA";
pp.SearchProperties[WinWindow.PropertyNames.ClassName] = "Internet Explorer_TridentDlgFrame";
pp.SearchProperties[WinWindow.PropertyNames.ControlType] = "Window";
pp.SearchProperties[WinWindow.PropertyNames.Name] = "Select People -- Webpage Dialog";
pp.Find();
pp.DrawHighlight();
Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument doc = new Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument(pp);
doc.TechnologyName = "Web";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.TagName] = "BODY";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.FrameDocument] = "False";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.RedirectingPage] = "False";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.ControlType] = "Document";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Title] = "Select People";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.PageUrl] = PAGE_URL_Here;
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.AbsolutePath] = AbsolutePath_Here;
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.ClassName] = "HtmlBody";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.FriendlyName] = "Select People";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.HasFocus] = "False";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Exists] = "True";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.Enabled] = "True";
doc.SearchProperties[Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlDocument.PropertyNames.IsTopParent] = "False";
doc.Find();
doc.DrawHighlight();
Above code easily highlights people picker window and used this object to find the control inside it is not finding any.
It is showing this error...
The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'Web'
TagName: 'BODY'
FrameDocument: 'False'
RedirectingPage: 'False'
ControlType: 'Document'
Am i doing it right.
I found the answer for this,..
Well using crosshair or recording show the control on peoplepicker as separeate control but while finding through code all the control in it are shown as Edit box.
so need to store all control in a UITestControlCollection and use loop to find the control needed using its name property.
Then do the mouse or keyboard action.
//write ur code here to find the parent control
UITestControlCollection controlFound = matching.FindMatchingControls();
//use loop to find the control

Categories