Full simple sample of using own toolbars


Author
Message
NorthGates
NorthGates
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
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.
Reply
Dieter Schulten
Dieter Schulten
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
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 (224 views, 144.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search