By NorthGates - Wednesday, April 10, 2013
Would it be possible to have a full example with at least one button on how to hook, including enable, disable and process the command.
Currently I am using the nevron context menu from the commandbarmanager and I am at a loss on how to correctly implement my ribbon bar buttons.
|
By Dieter Schulten - Tuesday, May 7, 2013
Hello Northgates,
i am just using the drawing pane of nevron. All Buttons and other gui elements are created by my self.
// I JUST CREATED A "NDiagramCommander " private NDiagramCommander commander = new NDiagramCommander(); private NDrawingView drawingView = new NDrawingView();
...
// I ASSIGNED THE COMMANDER TO THE VIEW commander.View = this.drawingView;
// IF THE USER PRESSES MY ALLIGN LEFT BUTTON, I DO THIS NAlignLeftsCommand command = new NAlignLeftsCommand(); commander.Commands.Add(command); command.Execute();
// TO CHANGE THE FOREGROUND COLOR OF ALL SHAPES, I DO THIS
public void SetFontForegroundColor(Color color) { if (drawingView == null) return; NSelection selection = drawingView.Selection; if (selection.NodesCount == 0) return;
NTextStyle textStyle = new NTextStyle(); textStyle.FillStyle = new NColorFillStyle(color);
foreach (INNode node in selection.Nodes) { NShape shape = (NShape)node; if (shape.Style.TextStyle == null) { shape.Style.TextStyle = textStyle; } else { shape.Style.TextStyle.FillStyle = new NColorFillStyle(color); } }
drawingView.SmartRefresh(); }
Hope this helps.
Regards, Dieter
|
|