Profile Picture

NPopupNotify OptionsButton usage exception

Posted By Craig Swearingen 11 Years Ago
Author
Message
Craig Swearingen
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
I've been evaluating the 13.7.16.12 version further today and found an exception in code that works fine in my licensed copy. When the user clicks on the OptionsButton on a popup notify an exception happens indicating:

{"Unable to cast object of type 'Nevron.UI.NCaptionContent' to type 'Nevron.Dom.INElement'."}

at Nevron.UI.NUIElementContainer.GetChildFromId(Int32 id)
at Nevron.UI.WinForm.Controls.l11IIIl1.DisplayOptions()
at Nevron.UI.WinForm.Controls.l11IIIl1.OnCaptionButtonItemClick(Object sender, NUIItemEventArgs e)
at Nevron.UI.NCaptionElement.OnButtonItemClick(NCaptionButtonItem item)
at Nevron.UI.NCaptionButtonItem.OnClick(EventArgs e)
at Nevron.UI.NMouseInputElement.Nevron.UI.INMouseInputElement.OnMouseUp(NMouseEventArgs e)
at Nevron.UI.NUIElementContainer.ProcessMouseUp(NMouseEventArgs e)
at Nevron.UI.NMouseInputElement.Nevron.UI.INMouseInputElement.OnMouseUp(NMouseEventArgs e)
at Nevron.UI.WinForm.NUIElementHostImpl.OnMouseUp(MouseEventArgs e)
at Nevron.UI.WinForm.NUIElementHost.OnMouseUp(MouseEventArgs e)

With the code below the options button shows up but when the user clicks on it the exception happens as indicated above:

NPopupNotify p = new NPopupNotify();
p.PredefinedStyle = PredefinedPopupStyle.Skinned;
p.Caption.Content.Text = "my title";
NImageAndTextItem content = p.Content;
content.TextMargins = new NPadding(0, 4, 0, 0);
content.Text = "my message";
PopupAnimation animation = PopupAnimation.Fade | PopupAnimation.Slide;
p.AutoHide = true;
p.VisibleSpan = 5000;
p.Opacity = 255;
p.Animation = animation;
p.AnimationDirection = PopupAnimationDirection.Automatic;
p.VisibleOnMouseOver = true;
p.FullOpacityOnMouseOver = true;
p.AnimationInterval = 20;
p.AnimationSteps = 20;
p.OptionsButton = true;
NCommand cmd = new NCommand();
cmd.Properties.Text = "my menu item";
cmd.Properties.Style = CommandStyle.Text;
cmd.Click += new CommandEventHandler(cmd_Click);
cmd.Properties.Tag = p;
p.OptionsCommands.Add(cmd);
p.Show();


Also, I can reproduce this exception when using the Nevron UI Examples for C# "Popup Notify" example.




Similar Topics


Reading This Topic