How to place a Button in the alarm viewer toolbar?

I’m trying to add a button in the bottom toolbar of the alarmViewer, and I’ve been looking at the sample and tried to replicate the structure but I’ve had no luck with it, Could you lend me a hand on how I should structure it? Is there a way to feed the currently selected Alarm as the AlarmPreviewPlugin does?

You don’t mention it but maybe you have seen the Smart Client Alarm Preview plugin sample. https://doc.developer.milestonesys.com/html/index.html?base=samples/alarmpreviewsample.html&tree=tree_1.html

The sample shows how to do an AlarmPreviewWpfUserControl, and you can put your controls in the user control.

One idea that you might be missing in that sample. If you in the AlarmPreviewWpfUserControl adds a field public Alarm _alarm = null; and in the GetContents() method add _alarm = alarm; you can read that alarm from the button. There might be better coding practices but I hope this is sufficient to illustrate how the information can be present after the button is clicked..

Hey! Yes, in fact as of now we are currently trying to avoid using the AlarmPreview plugin as it takes some precious space from the viewer. So let me clarify, what I’m trying to achieve here is avoid using the alarmPreview plugin and setting its functionality inside the toolbar button. As of now, I’ve managed to place the button everywhere, but that should not happen. I’d like too only see the button when the toolbar belongs to the alarm viewer. So that the placement just changes slightly. This however, brings up another problem that comes with not having the selected alarm info in the new button as it will not be fed directly. What MessageFilter is used for the single click on the alarm line, and does it contain the alarm within it? Can I intercept or avoid the original milestone alarm detail from popping up when double clicking?

You can intercept when a line is getting focus on the Alarm List.. The Dynamic View plugin sample does this.

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/dynamicview/readme.html&tree=tree_1.html

Maybe this is actually what you seek..

Yes! I actually managed to solve the button problem. It was not very clear for me what it was really requiered for the button to appear, I just collect the alarm when the line is selected through the information message. And with that I have access to it.