` Message when cancelling parent but child changed (George Lehman ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Message when cancelling parent but child changed
2001-06-27 -- George Lehman
 
Ok, I have a solution. I searched several directories for code related to cancel, and found the question is asked in thiswindow.takecloseevent in the parent call. So I worked up this little template: #!-------------------------------------------------------------------------- --- #EXTENSION(ChildUpdateCancelWarning,'Force Cancel-Warning if Child record modified'),PROCEDURE #LOCALDATA LOC:ChildRecordModified Byte #ENDLOCALDATA #AT (%WindowManagerMethodCodeSection,'Init','(),BYTE'),LAST LOC:ChildRecordModified = 0 #Endat #AT(%WindowManagerMethodCodeSection,'Run','(USHORT Number,BYTE Request),BYTE'),Priority(8000) IF (GlobalResponse = RequestCompleted) THEN LOC:ChildRecordModified = 1 END #Endat #AT (%WindowManagerMethodCodeSection,'TakeCloseEvent','(),BYTE'),Priority(2500) IF (LOC:ChildRecordModified) AND (Self.CancelAction <> Cancel:Cancel) THEN IF (Self.Errors.Throw(MSG:ConfirmCancel) = Level:Cancel) THEN SELECT(Self.FirstField) Return Level:Notify ELSE Self.CancelAction = Cancel:Cancel ! Don't ask again END END #Endat #!-------------------------------------------------------------------------- --- I decided against trying to apply it on a global scale, and just made it something I have to add to each form that suffers from the problem. Also, I did not take into account the Cancel:Save branch because I never use that option. The middle section is based on code from abwindow.tpl. If anyone else can use this, please feel free to do with it as you please. > If you already have the flag set, I'd start in the Cancel button's embeds. > I'd also > look at closewindow.


Today is April 23, 2024, 4:23 am
This article has been viewed 35105 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: