I have the following in the cancel/close event but when I click the window close button just the window closes and I am wanting the app to quit as there is only ever 1 window. Is there another event I should be working in or am I in the right place but not got the following right?
if gsaved = false then
dim oDlg as new MessageDialog
oDlg.Message = “Do you want to save changes to this document before closing?”
oDlg.Explanation = “If you don’t save, your changes will be lost.”
oDlg.ActionButton.Caption = “&Save”
oDlg.CancelButton.Caption = “Cancel”
oDlg.CancelButton.Visible = true
oDlg.AlternateActionButton.Caption = “&Don’t Save”
oDlg.AlternateActionButton.Visible = true
dim oBtn as MessageDialogButton = oDlg.ShowModalWithin(self)
select case oBtn
case oDlg.ActionButton
// Save
if gsaved = false then
if uppercase(right(currentfile,8)) = “.CWPTEXT” then
SavePCW
else
SavePCW1
end if
else
end if
return false
case oDlg.CancelButton
// Cancel close
return true
case oDlg.AlternateActionButton
// Don’t Save
end select
else
return false
end if