Profile Picture

Full simple sample of using own toolbars

Posted By NorthGates 11 Years Ago
Author
Message
Dieter Schulten
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 10, Visits: 2
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

Attachments
designer.png (208 views, 144.00 KB)
NorthGates
questionmark Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
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.



Similar Topics


Reading This Topic