DialogBox.st
changeset 4164 11aa3c5f93e5
parent 4155 1edd671b6485
child 4181 da91606eb79c
equal deleted inserted replaced
4163:59799aef0498 4164:11aa3c5f93e5
  2310      The matchPattern is set to pattern initially.
  2310      The matchPattern is set to pattern initially.
  2311      Return the string, or nil if cancel was pressed."
  2311      Return the string, or nil if cancel was pressed."
  2312 
  2312 
  2313     |box defaultDir defaultNm dir enteredName|
  2313     |box defaultDir defaultNm dir enteredName|
  2314 
  2314 
  2315     UserPreferences current useNativeFileDialog ifTrue:[
  2315     Screen current nativeFileDialogs ifTrue:[
  2316         OperatingSystem isMSWINDOWSlike ifTrue:[
  2316         OperatingSystem isMSWINDOWSlike ifTrue:[
  2317             ^ Win32FileDialog    
  2317             ^ Win32FileDialog    
  2318                 fileDialogFor:nil 
  2318                 fileDialogFor:nil 
  2319                 save:false 
  2319                 save:false 
  2320                 title:titleString 
  2320                 title:titleString 
  2383         abort:'oh, no' 
  2383         abort:'oh, no' 
  2384         pattern:'rc*'
  2384         pattern:'rc*'
  2385         fromDirectory:'/etc'  
  2385         fromDirectory:'/etc'  
  2386     "
  2386     "
  2387 
  2387 
  2388     "Modified: 23.10.1997 / 19:59:01 / cg"
  2388     "Modified: / 23-10-1997 / 19:59:01 / cg"
       
  2389     "Modified: / 24-08-2010 / 17:28:57 / sr"
  2389 !
  2390 !
  2390 
  2391 
  2391 requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean
  2392 requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean
  2392     "launch a Dialog, which allows user to enter a filename.
  2393     "launch a Dialog, which allows user to enter a filename.
  2393      The files presented initially are those in aDirectoryPathOrNil, or the
  2394      The files presented initially are those in aDirectoryPathOrNil, or the
  2644         #any (other)    - no validation
  2645         #any (other)    - no validation
  2645     "
  2646     "
  2646 
  2647 
  2647     |box defaultDir defaultNm|
  2648     |box defaultDir defaultNm|
  2648 
  2649 
  2649     UserPreferences current useNativeFileDialog ifTrue:[
  2650     Screen current nativeFileDialogs ifTrue:[
  2650         OperatingSystem isMSWINDOWSlike ifTrue:[
  2651         OperatingSystem isMSWINDOWSlike ifTrue:[
  2651             ^ Win32FileDialog    
  2652             ^ Win32FileDialog    
  2652                 fileDialogFor:nil 
  2653                 fileDialogFor:nil 
  2653                 save:false 
  2654                 save:false 
  2654                 title:titleString 
  2655                 title:titleString 
  2744         ifFail:['none']   
  2745         ifFail:['none']   
  2745         pattern:'*.conf'
  2746         pattern:'*.conf'
  2746         fromDirectory:'/etc'
  2747         fromDirectory:'/etc'
  2747     "
  2748     "
  2748 
  2749 
  2749     "Created: / 21.2.1997 / 14:23:44 / stefan"
  2750     "Created: / 21-02-1997 / 14:23:44 / stefan"
  2750     "Modified: / 21.2.1997 / 14:38:04 / stefan"
  2751     "Modified: / 16-06-1998 / 13:34:23 / cg"
  2751     "Modified: / 16.6.1998 / 13:34:23 / cg"
  2752     "Modified: / 24-08-2010 / 17:29:04 / sr"
  2752 !
  2753 !
  2753 
  2754 
  2754 requestFileName:titleString fromDirectory:aDirectory
  2755 requestFileName:titleString fromDirectory:aDirectory
  2755     "launch a Dialog, which allows user to enter a filename.
  2756     "launch a Dialog, which allows user to enter a filename.
  2756      The files presented initially are those from the current directory.
  2757      The files presented initially are those from the current directory.
  2889     default := defaultOrNil.
  2890     default := defaultOrNil.
  2890     default notNil ifTrue:[ default := default asString].
  2891     default notNil ifTrue:[ default := default asString].
  2891 
  2892 
  2892     resources := self classResources.
  2893     resources := self classResources.
  2893 
  2894 
  2894     UserPreferences current useNativeFileDialog ifTrue:[
  2895     Screen current nativeFileDialogs ifTrue:[
  2895         OperatingSystem isMSWINDOWSlike ifTrue:[
  2896         OperatingSystem isMSWINDOWSlike ifTrue:[
  2896             appendActionOrNil isNil ifTrue:[
  2897             appendActionOrNil isNil ifTrue:[
  2897                 ^ Win32FileDialog    
  2898                 ^ Win32FileDialog    
  2898                     fileDialogFor:nil 
  2899                     fileDialogFor:nil 
  2899                     save:true 
  2900                     save:true 
  2953         action:[:fn | Transcript showCR:'save ',fn] 
  2954         action:[:fn | Transcript showCR:'save ',fn] 
  2954         appendAction:nil
  2955         appendAction:nil
  2955     "
  2956     "
  2956 
  2957 
  2957     "Modified: / 27-10-2006 / 09:47:01 / cg"
  2958     "Modified: / 27-10-2006 / 09:47:01 / cg"
       
  2959     "Modified: / 24-08-2010 / 17:29:12 / sr"
  2958 ! !
  2960 ! !
  2959 
  2961 
  2960 !DialogBox class methodsFor:'fill in the blank dialogs'!
  2962 !DialogBox class methodsFor:'fill in the blank dialogs'!
  2961 
  2963 
  2962 forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel
  2964 forRequestText:title editViewClass:editViewClass lines:numLines columns:numCols initialAnswer:initialText model:textModel
  9118 ! !
  9120 ! !
  9119 
  9121 
  9120 !DialogBox class methodsFor:'documentation'!
  9122 !DialogBox class methodsFor:'documentation'!
  9121 
  9123 
  9122 version
  9124 version
  9123     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.299 2010-07-07 14:44:38 cg Exp $'
  9125     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.300 2010-08-24 15:39:39 sr Exp $'
  9124 !
  9126 !
  9125 
  9127 
  9126 version_CVS
  9128 version_CVS
  9127     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.299 2010-07-07 14:44:38 cg Exp $'
  9129     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.300 2010-08-24 15:39:39 sr Exp $'
  9128 ! !
  9130 ! !
  9129 
  9131 
  9130 DialogBox initialize!
  9132 DialogBox initialize!