WinWorkstation.st
changeset 8591 159a30c96939
parent 8590 5639b500fee6
child 8592 20d28aee8271
equal deleted inserted replaced
8590:5639b500fee6 8591:159a30c96939
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4 COPYRIGHT (c) 1996 by Claus Gittinger
     2 COPYRIGHT (c) 1996 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
  2141 		    } else {
  2139 		    } else {
  2142 			sleep(0);
  2140 			sleep(0);
  2143 		    }
  2141 		    }
  2144 		    goto again;
  2142 		    goto again;
  2145 		}
  2143 		}
  2146 		/* fail evtl. später ändern und in st verzögert aufrufen
  2144 		/* fail evtl. später ändern und in st verzögert aufrufen
  2147 		*/
  2145 		*/
  2148 		console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
  2146 		console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
  2149 	    }
  2147 	    }
  2150 	    free((char*)ev->ev_arg1);
  2148 	    free((char*)ev->ev_arg1);
  2151 	    ev->ev_arg1 = 0;
  2149 	    ev->ev_arg1 = 0;
 16664 
 16662 
 16665     |trueForSave dialogTitle defaultBaseName defaultDirectory owningViewId windowGroup filterString filterArrayOrPairs
 16663     |trueForSave dialogTitle defaultBaseName defaultDirectory owningViewId windowGroup filterString filterArrayOrPairs
 16666      null filterStringParts
 16664      null filterStringParts
 16667      nativeFileDialogCreationData returnValue
 16665      nativeFileDialogCreationData returnValue
 16668      nativeFileDialogReturnData targetFileOrDirectory multiSelectBaseNames selectedSuffixInfo selectedSuffix
 16666      nativeFileDialogReturnData targetFileOrDirectory multiSelectBaseNames selectedSuffixInfo selectedSuffix
 16669      needsSlash checkForNativeFileDialogInitializeErrorBlock|
 16667      needsSlash dataAddress didPerformCroppedBaseNameHack delay|
 16670 
 16668 
 16671     trueForSave := trueForSaveArg ? false.
 16669     trueForSave := trueForSaveArg ? false.
 16672 
 16670 
 16673     dialogTitleArg notEmptyOrNil ifTrue:[
 16671     dialogTitleArg notEmptyOrNil ifTrue:[
 16674         dialogTitle := dialogTitleArg asUnicode16String.
 16672         dialogTitle := dialogTitleArg asUnicode16String.
 16736             filterIndex:filterIndexArg ? 1
 16734             filterIndex:filterIndexArg ? 1
 16737             trueForSave:trueForSave
 16735             trueForSave:trueForSave
 16738             trueForMultiSelect:trueForMultiSelect ? false
 16736             trueForMultiSelect:trueForMultiSelect ? false
 16739             trueForPromptOverwrite:trueForPromptOverwrite ? true.
 16737             trueForPromptOverwrite:trueForPromptOverwrite ? true.
 16740 
 16738 
 16741         checkForNativeFileDialogInitializeErrorBlock := 
 16739         dataAddress := nativeFileDialogCreationData dataAddress.
 16742             [
 16740         didPerformCroppedBaseNameHack := false.
 16743                 NativeFileDialogInitializeError handle:[:ex |
 16741 
 16744                     "set #returnValue to suppress the #ensure block,
 16742         [
 16745                      no need for close if this error occures,
 16743             delay := 100 milliseconds.
 16746                      cleanups are done within #primCheckForErrorInFileDialogInitializeByCreationData"
 16744 
 16747                     returnValue := ''.
 16745             (trueForSave not
 16748                     ex reject.
 16746             and:[didPerformCroppedBaseNameHack not]) ifTrue:[
 16749                 ] do:[          
 16747                 "hack for display bug (cropped default basename)
 16750                     self primCheckForErrorInFileDialogInitializeByCreationData:nativeFileDialogCreationData.
 16748                  https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/644328"
       
 16749                 didPerformCroppedBaseNameHack := self primTryCroppedBaseNameHackByDataAddress:dataAddress.
       
 16750                 didPerformCroppedBaseNameHack ifFalse:[
       
 16751                     delay := 10 milliseconds.
 16751                 ].
 16752                 ].
 16752             ].
 16753             ].
 16753 
 16754 
 16754         trueForSave ifFalse:[
       
 16755             "hack for display bug (cropped default basename)
       
 16756              https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/644328"
       
 16757             [
       
 16758                 checkForNativeFileDialogInitializeErrorBlock value. "/ check to avoid freeze in this while loop       
       
 16759                 self primTryCroppedBaseNameHackByDataAddress:nativeFileDialogCreationData dataAddress
       
 16760             ] whileFalse:[
       
 16761                 "/ loop until the dialog has opened
       
 16762                 Delay waitForMilliseconds:10.
       
 16763             ].
       
 16764         ].
       
 16765 
       
 16766         [
       
 16767             windowGroup notNil ifTrue:[
 16755             windowGroup notNil ifTrue:[
 16768                 windowGroup sensor eventSemaphore waitWithTimeout:100 milliseconds.
 16756                 windowGroup sensor eventSemaphore waitWithTimeout:delay.
 16769                 "sr: we can process all events (also redraws),
 16757                 "sr: we can process all events (also redraws),
 16770                  because the operating system handles the modal,
 16758                  because the operating system handles the modal,
 16771                  user events are blocked by operating system"
 16759                  user events are blocked by operating system"
 16772                 windowGroup processEvents.
 16760                 windowGroup processEvents.
 16773             ] ifFalse:[
 16761             ] ifFalse:[
 16774                 Delay waitForMilliseconds:100.
 16762                 Delay waitFor:delay.
 16775             ].
 16763             ].
 16776 
 16764 
 16777             checkForNativeFileDialogInitializeErrorBlock value. "/ check to avoid freeze in this while loop
 16765             NativeFileDialogInitializeError handle:[:ex |
       
 16766                 "set #returnValue to suppress the #ensure block,
       
 16767                  no need for close if this error occures,
       
 16768                  cleanups are done within #primCheckForErrorInFileDialogInitializeByCreationData"
       
 16769                 returnValue := ''.
       
 16770                 ex reject.
       
 16771             ] do:[          
       
 16772                 self primCheckForErrorInFileDialogInitializeByCreationData:nativeFileDialogCreationData.
       
 16773             ].
       
 16774 
 16778             returnValue := self primGetNativeFileDialogResultByCreationData:nativeFileDialogCreationData.
 16775             returnValue := self primGetNativeFileDialogResultByCreationData:nativeFileDialogCreationData.
 16779         ] doWhile:[
 16776         ] doWhile:[
 16780             returnValue isNil
 16777             returnValue isNil
 16781         ].
 16778         ].
 16782     ] ensure:[
 16779     ] ensure:[
 16926 
 16923 
 16927         p terminate.
 16924         p terminate.
 16928     "
 16925     "
 16929 
 16926 
 16930     "Created: / 25-10-2018 / 10:54:52 / sr"
 16927     "Created: / 25-10-2018 / 10:54:52 / sr"
 16931     "Modified (comment): / 19-11-2018 / 16:06:45 / sr"
 16928     "Modified: / 20-11-2018 / 09:41:34 / sr"
 16932 !
 16929 !
 16933 
 16930 
 16934 primCheckForErrorInFileDialogInitializeByCreationData:nativeFileDialogCreationData
 16931 primCheckForErrorInFileDialogInitializeByCreationData:nativeFileDialogCreationData
 16935     "checks if the file dialog has been created succesfully,
 16932     "checks if the file dialog has been created succesfully,
 16936      otherwise raises NativeFileDialogInitializeError"
 16933      otherwise raises NativeFileDialogInitializeError"
 19900 	    RETURN (self);
 19897 	    RETURN (self);
 19901 	}
 19898 	}
 19902     }
 19899     }
 19903 %}
 19900 %}
 19904     "
 19901     "
 19905      (StandardSystemView new label:'äöü') open
 19902      (StandardSystemView new label:'äöü') open
 19906     "
 19903     "
 19907 !
 19904 !
 19908 
 19905 
 19909 setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
 19906 setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
 19910     "set the windows shape to an elliptical region"
 19907     "set the windows shape to an elliptical region"