VLF-One Visual Notification on Main Panel

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
mwilliams
Posts: 23
Joined: Sat May 28, 2016 1:45 am

VLF-One Visual Notification on Main Panel

Post by mwilliams » Wed May 06, 2020 6:32 am

I was wondering if it is possible to change the properties (mainly background color) of the tab for a slider panel? We have a notification rp in a slider that checks for new messages/events directed at a user and want a way to visually notify them with out interrupting them. Right now we show a message in the message bar at the bottom but we have it disappearing automatically so many times the user doesn't see it. I was thinking maybe we could change the color of the slider tab to indicate new messages. Another idea if possible would be to extend the slider out just a bit, kind of a peek option. Then maybe we could put a component to indicate new messages. I think a badge would be a great option but everything I've read says they are only on applications, business objects, and command handlers and we are looking for something that shows in the main panel. Is it possible to insert a badge say in the header area?

Does any of this sound possible?

MarkD
Posts: 657
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-One Visual Notification on Main Panel

Post by MarkD » Wed May 06, 2020 10:51 am

Just to check we are talking about the same thing ...... your slider is a RP with ancestor VF_AC028O?

If that's the case then you should be able to apply a style to it background panel to change the background color.

The style should be defined in code and then applied to the background panel as it is being displayed.

Let me kow if you want an example.

mwilliams
Posts: 23
Joined: Sat May 28, 2016 1:45 am

Re: VLF-One Visual Notification on Main Panel

Post by mwilliams » Thu May 07, 2020 1:58 am

Hey Mark, yes our slider is a RP with ancestor VF_AC028O. And yes, it would be nice to have an example.

Thanks.

MarkD
Posts: 657
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-One Visual Notification on Main Panel

Post by MarkD » Fri May 08, 2020 3:27 pm

Here you go ....

Code: Select all

Begin_Com Role(*EXTENDS #VF_AC028O) Height(457) Width(201)

Define_Com Class(#PRIM_MD.RaisedButton) Name(#RedButton) Caption('Use Red Background') Displayposition(1) Left(0) Parent(#CustomPanelBody) Tabposition(1) Themedrawstyle('MediumTitle') Top(0) Width(201)
Define_Com Class(#PRIM_MD.RaisedButton) Name(#GreenButton) Caption('Use Green Background') Displayposition(2) Left(0) Parent(#CustomPanelBody) Tabposition(2) Themedrawstyle('MediumTitle') Top(42) Width(201)
Define_Com Class(#PRIM_MD.RaisedButton) Name(#BlueButton) Caption('Use Blue Background') Displayposition(3) Left(0) Parent(#CustomPanelBody) Tabposition(3) Themedrawstyle('MediumTitle') Top(88) Width(201)

* -------------------------------------------------------------------------
Define_Com Class(#Prim_vs.Style) Name(#RedBackGround) Normbackcolor(Red)
Define_Com Class(#Prim_vs.Style) Name(#GreenBackGround) Normbackcolor(Green)
Define_Com Class(#Prim_vs.Style) Name(#BlueBackGround) Normbackcolor(Blue)

Define_Com Class(*ANCESTOR) Name(#HeaderPanel) Width(201)
Define_Com Class(*ANCESTOR) Name(#CustomPanelBody) Height(439) Width(201)
Define_Com Class(*ANCESTOR) Name(#DockImage) Left(185)
Define_Com Class(*ANCESTOR) Name(#CloseImage) Left(169)

* -------------------------------------------------------------------------
Mthroutine Name(uInitialize) Options(*REDEFINE)
* Start with blue
Set Com(#COM_OWNER) Style(#BlueBackGround)
Endroutine

* -------------------------------------------------------------------------
Evtroutine Handling(#RedButton.Click #GreenButton.Click #BlueButton.Click) Com_Sender(#ClickedButton)
If (#ClickedButton *IsEqualTo #RedButton)
Set Com(#COM_OWNER) Style(#RedBackGround)
Return
Endif
If (#ClickedButton *IsEqualTo #GreenButton)
Set Com(#COM_OWNER) Style(#GreenBackGround)
Return
Endif
If (#ClickedButton *IsEqualTo #BlueButton)
Set Com(#COM_OWNER) Style(#BlueBackGround)
Return
Endif
Endroutine

End_Com
Should look like this when snapped in as right edge slider ..........
Capture2.PNG
Capture2.PNG (24.86 KiB) Viewed 1256 times

MarkD
Posts: 657
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-One Visual Notification on Main Panel

Post by MarkD » Fri May 08, 2020 3:30 pm

Regarding the other questions .....
I think you can make a slider display itself when it detects some event.
This means you could alter its width to become temporarily skinnier, and to also open and slide in and then close again on a timer.
You can certainly put a badge onto the slider's main panel.

mwilliams
Posts: 23
Joined: Sat May 28, 2016 1:45 am

Re: VLF-One Visual Notification on Main Panel

Post by mwilliams » Sat May 09, 2020 3:07 am

Hey Mark, Thanks for the reply. I think I tried doing something like you did in your code sample. I was able to change the background color but it doesn't seem to effect the slider tab when the slider is closed but I'll try again. Just to give a visual, here is what I'm trying to accomplish.
slider tab.png
slider tab.png (12.36 KiB) Viewed 1245 times
I used the developer tools to temporarily change the tab color. Of course as soon as my mouse hovers over it, the background color changes.

I'm also going to play with trying to change the slider height temporarily. Just thought the tab option may be an easier option.

MarkD
Posts: 657
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-One Visual Notification on Main Panel

Post by MarkD » Thu May 14, 2020 11:10 am

I think that might be the way to go - change the height and then cause the slider itself to slide into view, instead of trying to change the slider's tab color. You could start a timer so that the slider contracts back to a tab again after 2 seconds (say) unless the user clicks on it to view their messages.

MarkD
Posts: 657
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-One Visual Notification on Main Panel

Post by MarkD » Thu May 14, 2020 11:14 am

See https://docs.lansa.com/14/en/lansa048/i ... n_0040.htm for how to programtically display (float) and close a slider pane.

Post Reply