Path: news.cs.au.dk!not-for-mail From: "Sascha Kimmel" Newsgroups: comp.lang.beta Subject: RE: MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL ... Date: 1 Mar 1999 22:54:51 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 173 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990301225451.8623.qmail@noatun.mjolner.dk> Reply-To: "Sascha Kimmel" NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 920328906 23887 255.255.255.255 (1 Mar 1999 22:55:06 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 1 Mar 1999 22:55:06 GMT Xref: news.cs.au.dk comp.lang.beta:11853 > -----Ursprüngliche Nachricht----- > Von: Morten Grouleff [mailto:mg@mjolner.dk] > Gesendet am: Montag, 1. März 1999 14:13 > An: usergroup@mjolner.dk > Betreff: Re: MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL ... > > "Sascha Kimmel" writes: > > > When I want to implement the WINAPI fucntions/Windows MB_YESNOCANCEL, > > MB_YESNO, MB_RETRYCANCEL, MB_OKCANCEL, MB_ABORTRETRYIGNORE I > have a problem. > > I don't know where to implement the functions instead of > inserting some code > > into stddialogs_ntibody and stddialogs. > > I want to use the "real" WINAPI functions/windows because then > there are no > > translations necessary and I don't have to do double work - if > Microsoft has > > already implemented these windows, why not call them? > > > > As you might already have guessed I also want to know which button was > > clicked by the user. > > You don't have to insert the code in those files, as the fragment system > allows you to insert the code in the right slots anyway. > > There is one small problem, though: The call of windows to show the > messagebox does not save the returnvalue anywhere. I'll fix that, so > that the following hack should not be necessary in upcoming releases. Thank you for your great and quick help. To use all types of windows implemented within the WINAPI I now use this file saved as "moredialogs.bet": ORIGIN '~beta/guienv/v1.6/guienv'; INCLUDE '~beta/guienv/v1.6/stddialogs'; INCLUDE '~beta/guienv/v1.6/private/winnt/stddialogs_ntibody'; (* Start of hack due to missing save of returnvalue *) -- myGUIENVmessageDialogPrivate: descriptor -- (# type: @integer; mtitle: @text; msgCstr: @cString; result: @Integer; #) -- guienvLib: attributes -- MyMessageDialog: dialog (# message: ^text; messageDialogPrivate: @<>; onClose:< object; enter (message[], title[]) do inner; (if title[] = None then messageDialogPrivate.mtitle[] -> title[]; if); (if message[]=NONE then &text[] -> message[]; if); message[] -> messageDialogPrivate.msgCstr.set; (if messageDialogPrivate.msgCstr<>0 then (if owner[]=none then GetActiveWindow -> this(guienv).private.windows.findById -> owner[]; if); (if owner[]=none then (0,messageDialogPrivate.msgCstr,title,messageDialogPrivate.type) -> PrivMessageBox -> messageDialogPrivate.result; else (owner.interfaceObjectID,messageDialogPrivate.msgCstr,title, messageDialogPrivate.type) -> PrivMessageBox -> messageDialogPrivate.result; if); messageDialogPrivate.msgCstr.free; onClose; else (0,'Could not allocate msg. string.', 'Alert',messageDialogPrivate.type) -> MessageBox; if); #); (* End of hack due to missing save of returnvalue *) yesnoDialog: MyMessageDialog (# onClose:: (# do (if messageDialogPrivate.result=IDNO then onNo if); (if messageDialogPrivate.result=IDYES then onYes if); #); onNo:< object; onYes:< object; do inner; MB_ICONINFORMATION+MB_YESNO+MB_TASKMODAL+MB_SETFOREGROUND -> messageDialogPrivate.type; 'YES or NO' -> messageDialogPrivate.mtitle; #); OkayCancelDialog: MyMessageDialog (# onClose:: (# do (if messageDialogPrivate.result=IDOK then onOk if); (if messageDialogPrivate.result=IDCANCEL then onCancel if); #); onOk:< object; onCancel:< object; do inner; MB_ICONQUESTION+MB_OKCANCEL+MB_TASKMODAL+MB_SETFOREGROUND -> messageDialogPrivate.type; 'OK?' -> messageDialogPrivate.mtitle; #); AbortRetryIgnoreDialog: MyMessageDialog (# onClose:: (# do (if messageDialogPrivate.result=IDABORT then onAbort if); (if messageDialogPrivate.result=IDRETRY then onRetry if); (if messageDialogPrivate.result=IDIGNORE then onIgnore if); #); onAbort:< object; onRetry:< object; onIgnore:< object; do inner; MB_ICONEXCLAMATION+MB_ABORTRETRYIGNORE+MB_TASKMODAL+MB_SETFOREGROUND -> messageDialogPrivate.type; 'Abort, retry or ignore?' -> messageDialogPrivate.mtitle; #); YesNoCancelDialog: MyMessageDialog (# onClose:: (# do (if messageDialogPrivate.result=IDYES then onYes if); (if messageDialogPrivate.result=IDNO then onNo if); (if messageDialogPrivate.result=IDCANCEL then onCancel if); #); onYes:< object; onNo:< object; onCancel:< object; do inner; MB_ICONQUESTION+MB_YESNOCANCEL+MB_TASKMODAL+MB_SETFOREGROUND -> messageDialogPrivate.type; 'Yes, no or cancel?' -> messageDialogPrivate.mtitle; #); RetryCancelDialog: MyMessageDialog (# onClose:: (# do (if messageDialogPrivate.result=IDRETRY then onRetry if); (if messageDialogPrivate.result=IDCANCEL then onCancel if); #); onRetry:< object; onCancel:< object; do inner; MB_ICONEXCLAMATION+MB_RETRYCANCEL+MB_TASKMODAL+MB_SETFOREGROUND -> messageDialogPrivate.type; 'Yes, no or cancel?' -> messageDialogPrivate.mtitle; #); Regards, S. Kimmel