Login
`
Templates, Tools and Utilities
|
||
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
ABC: Default to yes button on confirm delete 1998-12-27 -- Jim Kane Newsgroups: topspeed.products.c4
> How do you make the "No" button pre-highlighted when the Confirm Delete
> window pops up?
Good question but not a terribly easy task. I use the error class
takeother() functionality for 'special' cases. Search ABERROR.TRN for
the message you want to change. In this case find:
USHORT(Msg:ConfirmDelete)
BYTE(Level:User)
Change the Level:User to any number greater than 5 (highest currently
defined level) I use 99.
Then go to aberror.clw and find this part:
! This is purely here to enable people to add their own fatality levels
! By default an unknown fatality is a program error
ErrorClass.TakeOther PROCEDURE
CODE
RETURN SELF.TakeProgram()
! This is really to allow the user to confirm an action
! The simple case is just a yes or no with a yes default
ErrorClass.TakeUser PROCEDURE
CODE
IF MESSAGE(Self.SubsString(),Self.Errors.Title,ICON:Question, |
Button:Yes+Button:No,BUTTON:Yes,0) = Button:Yes
RETURN Level:Benign
ELSE
RETURN Level:Cancel
END
Now write your own TakeOther based on takeUser that normally processes
Msg:confirmDelete:
ErrorClass.TakeOther PROCEDURE
CODE
Case SELF.Errors.Id
Of Msg:ConfirmDelete
IF MESSAGE(Self.SubsString(),Self.Errors.Title,ICON:Question, |
Button:Yes+Button:No,BUTTON:NO,0) = Button:Yes
RETURN Level:Benign
ELSE
RETURN Level:Cancel
END
ELSE
RETURN SELF.TakeProgram()
END
Using this basic method you can greatly customize error handling to any
degree you want. The only drawback is you need to modify takeOther in
every new copy of aberror you get. Likewise with aberror.trn. But its
pretty fast.
---
Jim Kane
Today is November 21, 2024, 3:47 am This article has been viewed 35409 times. Google search has resulted in 69 hits on this article since January 25, 2004.
|
|