Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease add your comments to this article.
Please note that you must provide both a name and a valid email address in order
for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!
Back to article list Search Articles Add Comment Printer friendly Direct link ABC: Making the No button default on deletes 1998-07-07 -- Rick Martin Newsgroups: topspeed.products.c4
> Could anyone tell me how to force the default button
> of the Confirm Delete dialog to No.
You need to override the ErrorClass and change your application to use your
new class.
Here is the Class definition I use to accomplish the same thing.
Put this into an include file in your LibSrc directory (I use SHError.INC
and SHError.CLW):
!ABCIncludeFile
OMIT('_EndOfInclude_',_SharpeErrorPresent_)
_SharpeErrorPresent_ EQUATE(1)
INCLUDE('aberror.inc')
SharpeError CLASS(ErrorClass),TYPE,MODULE('SHERROR.CLW'), |
LINK('SHERROR.CLW',_ABCLinkMode_),DLL(_ABCDllMode_)
TakeUser PROCEDURE,BYTE,VIRTUAL,PROC,PROTECTED
END
_EndOfInclude_
Put this code in a source file in your LibSrc
MEMBER
MAP
.
INCLUDE('SHERROR.INC')
! We want to override Take user and make No the default for confirm delete
SharpeError.TakeUser PROCEDURE
CODE
If Self.Errors.ID = 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 Parent.TakeUser()
End
HTH,
Rick
Today is November 21, 2024, 7:24 am This article has been viewed 35383 times. Google search has resulted in 14 hits on this article since January 25, 2004.
|
|