|
From: <cre...@us...> - 2007-10-27 22:58:30
|
Revision: 1758
http://frontierkernel.svn.sourceforge.net/frontierkernel/?rev=1758&view=rev
Author: creecode
Date: 2007-10-27 15:58:34 -0700 (Sat, 27 Oct 2007)
Log Message:
-----------
updated alertdialog function to use CreateStandardAlert and RunStandardAlert
Modified Paths:
--------------
Frontier/branches/IUDA_Desktop/Common/source/dialogs.c
Modified: Frontier/branches/IUDA_Desktop/Common/source/dialogs.c
===================================================================
--- Frontier/branches/IUDA_Desktop/Common/source/dialogs.c 2007-10-27 17:42:44 UTC (rev 1757)
+++ Frontier/branches/IUDA_Desktop/Common/source/dialogs.c 2007-10-27 22:58:34 UTC (rev 1758)
@@ -964,7 +964,7 @@
pascal boolean modaldialogcallback (DialogPtr pdialog, EventRecord *ev, short *item) {
-
+
/*
standard dialog & alert event filtering.
@@ -1819,39 +1819,32 @@
} /*customalert*/
-boolean alertdialog (bigstring bsprompt) {
+boolean alertdialog ( bigstring bsprompt ) {
+
+ //
+ // 2007-10-27 creedon: updated to use CreateStandardAlert and
+ // RunStandardAlert
+ //
+ // put up the standard "alert" dialog, with the provided prompt and return
+ // true if the user clicked on ok. false if cancel was clicked.
+ //
- /*
- put up the standard "alert" dialog, with the provided prompt and return
- true if the user clicked on ok. false if cancel was clicked.
- */
+ CFStringRef csr = CFStringCreateWithPascalString ( kCFAllocatorDefault,
+ bsprompt, kCFStringEncodingMacRoman );
+ DialogItemIndex itemIndex;
+ DialogRef theAlert;
- register DialogPtr pdialog;
- register short itemnumber;
+ CreateStandardAlert ( kAlertCautionAlert, csr, NULL, NULL, &theAlert );
- sysbeep ();
+ RunStandardAlert ( theAlert, NULL, &itemIndex );
- if ((pdialog = newmodaldialog (alertdialogid, alertokitem)) == nil)
- return (false);
+ CFRelease ( csr );
- setdialogtext (pdialog, alertmsgitem, bsprompt);
-
- #if TARGET_API_MAC_CARBON == 1
- {
- WindowRef pWind = GetDialogWindow(pdialog);
- ShowWindow(pWind);
- }
- #else
- ShowWindow (pdialog);
- #endif
- itemnumber = runmodaldialog ();
-
- disposemodaldialog (pdialog);
-
- return (itemnumber == alertokitem);
- } /*alertdialog*/
+ return ( itemIndex == alertokitem );
+ } // alertdialog
+
boolean alertstring (short iderror) {
bigstring bs;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|