/ Forums / Advansys Formativ / Creating Solutions with Formativ / events on press toolbarbutton / Reply To: events on press toolbarbutton
You can add toolbar button to GroupWise Main Window or each message type (mail, task, note, etc) window. Open the Formativ IDE then go to the Integrations tab and check toolbar option. You may need to restart GroupWise to see the appropriate toolbar buttons appearing.
You can not change the toolbar button appearance as you described above. May be you can have two distinct applets to perform the task or you can change the applet operation based on a key pressed.
The sample code below add some text to the message subject when the toolbar button pressed. If the CTRL key was pressed when the applet execute then the applet will remove the text from the message subject. See the Formativ Language Guide for more information about the KeyIsDown method.
dim OldSubject
dim AddSubject
call GroupWise.FocusSet(9, "")
' Is the CTRL key down?
iRemoveText = utilities.KeyIsDown(VK_CONTROL)
OldSubject = GroupWise.ItemGetText("X00", 9)
AddSubject = "[somestring] "
' Remove text from the subject if the CTRL key down otherwise insert the text.
if iRemoveText then
If (InStr(1, OldSubject, AddSubject, vbTextCompare) > 0) then
OldSubject = replace(OldSubject, AddSubject, " ", 1, -1, vbTextCompare)
call GroupWise.ItemSetText("X00", 9,OldSubject, false)
end if
else
If (InStr(1, OldSubject, AddSubject, vbTextCompare) > 0) then
call GroupWise.ItemSetText("X00", 9,OldSubject, false)
else
call GroupWise.ItemSetText("X00", 9,AddSubject + OldSubject, false)
end if
end if
Hope this helps.
Regards,
Advansys Support