AddToolAlert method
AddToolAlert(text$, sigtext$, id, filename$, sigfilename$)
AddToolAlert
The AddToolAlert(Title, SignalledTitle, ID, PictureName, SignalledPictureName) method adds an item to a persistent tool menu created by the AddToolMenu method. It is similar to the AddToolFile method except AddToolAlert provides a means for the item to show a 'signalled' state triggered asynchronously by another KCML process.
The toolbar item will show its normal title and picture until the KCML process is signalled via $ALERT FORM. When that happens the title and picture will change to their signalled equivalents. The toolbar item will remain signalled until clicked.
DIM IDMail=0 REM Get client and forms interfaces. Use the DEFEVENT form of CREATE as we REM will process events OBJECT Client = CREATE "ClientCOM", "KClient", DEFEVENT ClientEvents OBJECT Forms = Client.GetForms() REM Copy mail images to KClient cache COPY OBJECT "/myimages/mail.png" TO "mail.png" COPY OBJECT "/myimages/new_mail.png" TO "new_mail.png" REM Create a tool menu REM The tool menu will appear before the Help menu if one exists otherwise REM it will be the last item on the menu bar. Forms.AddToolMenu("&Tools", FALSE, "&Help", FALSE) REM Add a mail item to the toolbar. This item will show when the user has new mail Forms.AddToolAlert("Mail", "You have mail", IDMail, "mail.png", new_mail.png) REM The signalled state is to be set via $ALERT FORM from another KCML process handling mail REM Handle the click event. Note this event handler is independent of any form DEFEVENT ClientEvents.LeftToolClick(Click) SELECT CASE Click CASE IDMail REM The alerted state is automatically reset by the user's click MailForm.Open() END SELECT END EVENT