50 " |
50 " |
51 ! |
51 ! |
52 |
52 |
53 examples |
53 examples |
54 " |
54 " |
55 Example1: |
55 very simple: |
56 |
56 |name| |
57 FileSelectionBox open |
57 |
58 |
58 name := FileSelectionBox requestFilename. |
59 Example2: |
59 Transcript showCr:name |
60 |
60 |
61 FileSelectionBox new open |
61 |
62 |
62 simple: |
63 Example3: |
63 |name| |
|
64 |
|
65 name := FileSelectionBox requestFilename:'which file ?'. |
|
66 Transcript showCr:name |
|
67 |
|
68 |
|
69 with initial selection: |
|
70 |name| |
|
71 |
|
72 name := FileSelectionBox requestFilename:'which file ?' default:'Make.proto'. |
|
73 Transcript showCr:name |
|
74 |
|
75 |
|
76 more detailed setup: |
|
77 |
|
78 FileSelectionBox new openModal |
|
79 |
|
80 setting title: |
64 |
81 |
65 |box| |
82 |box| |
66 box := FileSelectionBox new. |
83 box := FileSelectionBox new. |
67 box title:'Which file ?'. |
84 box title:'Which file ?'. |
68 box open |
85 box open |
69 |
86 |
70 Example4: |
87 setting a matchpattern: |
71 |
88 |
72 |box| |
89 |box| |
73 box := FileSelectionBox new. |
90 box := FileSelectionBox new. |
74 box title:'Which file ?'. |
91 box title:'Which file ?'. |
75 box pattern:'*.doc'. |
92 box pattern:'*.rc'. |
76 box open |
93 box open |
77 |
94 |
78 Example5: |
95 setting a matchblock: |
79 |
96 |
80 |box| |
97 |box| |
81 box := FileSelectionBox new. |
98 box := FileSelectionBox new. |
82 box title:'Which file ?'. |
99 box title:'Which file ?'. |
83 box pattern:'*'. |
100 box pattern:'*'. |
84 box matchBlock:[:name | name first isLowercase]. |
101 box matchBlock:[:name | name first isLowercase]. |
85 box open |
102 box open |
86 |
103 |
87 Example6: |
104 both pattern and matchBlock: |
88 |
105 |
89 |box| |
106 |box| |
90 box := FileSelectionBox new. |
107 box := FileSelectionBox new. |
91 box title:'Which directory ?'. |
108 box title:'Which directory ?'. |
92 box pattern:'l*'. |
109 box pattern:'l*'. |
93 box matchBlock:[:name | OperatingSystem isDirectory:name]. |
110 box matchBlock:[:name | OperatingSystem isDirectory:name]. |
94 box open |
111 box open |
|
112 |
|
113 finally, an action: |
|
114 |
|
115 |box| |
|
116 box := FileSelectionBox new. |
|
117 box title:'Which directory ?'. |
|
118 box pattern:'l*'. |
|
119 box matchBlock:[:name | OperatingSystem isDirectory:name]. |
|
120 box action:[:name | Transcript showCr:name]. |
|
121 box open |
95 " |
122 " |
96 ! |
123 ! |
97 |
124 |
98 version |
125 version |
99 ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelBox.st,v 1.24 1995-12-05 12:23:53 chrisy Exp $' |
126 ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSelBox.st,v 1.25 1995-12-05 19:12:25 cg Exp $' |
100 ! ! |
127 ! ! |
101 |
128 |
102 !FileSelectionBox class methodsFor:'defaults'! |
129 !FileSelectionBox class methodsFor:'defaults'! |
103 |
130 |
104 requestFilename |
131 requestFilename |