DialogBox.st
changeset 3384 22a6f1b80bb1
parent 3382 deb5b2cfea1a
child 3393 280482ccaab8
equal deleted inserted replaced
3383:41470ff2567d 3384:22a6f1b80bb1
  4871     "
  4871     "
  4872      Dialog requestNameSpace:'Select a NameSpace' initialAnswer:nil
  4872      Dialog requestNameSpace:'Select a NameSpace' initialAnswer:nil
  4873     "
  4873     "
  4874 !
  4874 !
  4875 
  4875 
       
  4876 requestProject:title initialAnswer:initialTextOrNil suggestions:suggestions
       
  4877     "Ask for a project (package-id)"
       
  4878 
       
  4879     |allProjects newProject box|
       
  4880 
       
  4881     allProjects := Smalltalk allProjectIDs.
       
  4882 
       
  4883     box := ListSelectionBox new.
       
  4884     box useComboBoxWithList:suggestions.
       
  4885     box title:title.
       
  4886     box list:allProjects.
       
  4887     box okAction:[:sel | newProject := sel].
       
  4888     box initialText:initialTextOrNil.
       
  4889     box entryCompletionBlock:(DoWhatIMeanSupport packageNameEntryCompletionBlock).
       
  4890     box label:'Enter Project'.
       
  4891     box showAtPointer.
       
  4892 
       
  4893     newProject notNil ifTrue:[
       
  4894         newProject := newProject withoutSeparators asSymbol.
       
  4895     ].
       
  4896     ^ newProject
       
  4897 
       
  4898     "
       
  4899      Dialog 
       
  4900         requestProject:'enter a project'
       
  4901         initialAnswer:'stx:libbasic' 
       
  4902         suggestions:#('foo' 'bar' 'baz')
       
  4903     "
       
  4904 
       
  4905     "Created: / 07-09-2006 / 11:40:17 / cg"
       
  4906 !
       
  4907 
  4876 requestSelector:aString initialAnswer:initial
  4908 requestSelector:aString initialAnswer:initial
  4877     "launch a Dialog, which allows user to enter a method selector.
  4909     "launch a Dialog, which allows user to enter a method selector.
  4878      Return the entered string (may be empty string) or nil (if cancel was pressed).
  4910      Return the entered string (may be empty string) or nil (if cancel was pressed).
  4879      The entryField does selectorCompletion on TAB."
  4911      The entryField does selectorCompletion on TAB."
  4880 
  4912 
  8242 ! !
  8274 ! !
  8243 
  8275 
  8244 !DialogBox class methodsFor:'documentation'!
  8276 !DialogBox class methodsFor:'documentation'!
  8245 
  8277 
  8246 version
  8278 version
  8247     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.252 2006-09-04 09:20:34 cg Exp $'
  8279     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.253 2006-09-07 09:44:24 cg Exp $'
  8248 ! !
  8280 ! !
  8249 
  8281 
  8250 DialogBox initialize!
  8282 DialogBox initialize!