DialogBox.st
changeset 1736 51a7c4c90388
parent 1708 dc23c5ca439e
child 1740 0160c5afae9c
equal deleted inserted replaced
1735:3f596be86a0d 1736:51a7c4c90388
  1584     "
  1584     "
  1585 
  1585 
  1586     "Modified: 19.4.1996 / 14:27:31 / cg"
  1586     "Modified: 19.4.1996 / 14:27:31 / cg"
  1587 !
  1587 !
  1588 
  1588 
       
  1589 requestFileName:titleString default:defaultName ifFail:failReturn pattern:pattern fromDirectory:dir
       
  1590     "launch a Dialog, which allows user to enter a filename.
       
  1591      The files presented initially are those from dir.
       
  1592      The box will show ok/cancel in its buttons.
       
  1593      The matchPattern is set to pattern initially.
       
  1594      Return the string or failReturn if cancel was pressed."
       
  1595 
       
  1596     ^ self 
       
  1597         requestFileName:titleString 
       
  1598         default:defaultName
       
  1599         version:nil
       
  1600         ifFail:failReturn
       
  1601         pattern:pattern
       
  1602         fromDirectory:dir
       
  1603 
       
  1604 !
       
  1605 
  1589 requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern
  1606 requestFileName:titleString default:defaultName ok:okText abort:abortText pattern:pattern
  1590     "launch a Dialog, which allows user to enter a filename.
  1607     "launch a Dialog, which allows user to enter a filename.
  1591      The files presented initially are those from the current directory.
  1608      The files presented initially are those from the current directory.
  1592      The box will show okText in its okButton, abortText in the abortButton.
  1609      The box will show okText in its okButton, abortText in the abortButton.
  1593      The matchPattern is set to pattern initially.
  1610      The matchPattern is set to pattern initially.
  1786 requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock fromDirectory:aDirectoryPath
  1803 requestFileName:titleString default:defaultName version:versionSymbol ifFail:failBlock fromDirectory:aDirectoryPath
  1787     "launch a Dialog, which allows user to enter a filename.
  1804     "launch a Dialog, which allows user to enter a filename.
  1788      Return the string or the value of failBlock if cancel was pressed.
  1805      Return the string or the value of failBlock if cancel was pressed.
  1789      The version argument allows validation of the files existance;
  1806      The version argument allows validation of the files existance;
  1790      it may be any of:
  1807      it may be any of:
  1791 	#mustBeNew      - fail (return empty string) if the file exists
  1808         #mustBeNew      - fail (return empty string) if the file exists
  1792 	#new            - confirm if the file exists
  1809         #new            - confirm if the file exists
  1793 	#mustBeOld      - fail if the file does not exist
  1810         #mustBeOld      - fail if the file does not exist
  1794 	#old            - confirm if the file does not exist
  1811         #old            - confirm if the file does not exist
  1795 	#any (other)    - no validation
  1812         #any (other)    - no validation
  1796     "
  1813     "
  1797 
  1814 
  1798     ^ self requestFileName:titleString default:defaultName version:versionSymbol 
  1815     ^ self 
  1799 	   ifFail:failBlock pattern:nil fromDirectory:aDirectoryPath
  1816         requestFileName:titleString 
       
  1817         default:defaultName 
       
  1818         version:versionSymbol 
       
  1819         ifFail:failBlock 
       
  1820         pattern:nil 
       
  1821         fromDirectory:aDirectoryPath
  1800         
  1822         
  1801     "
  1823     "
  1802      Dialog 
  1824      Dialog 
  1803 	requestFileName:'enter a fileName:'
  1825         requestFileName:'enter a fileName:'
  1804 	default:''
  1826         default:''
  1805 	version:nil
  1827         version:nil
  1806 	ifFail:['none']
  1828         ifFail:['none']
  1807 	fromDirectory:'/etc'
  1829         fromDirectory:'/etc'
  1808     "
  1830     "
  1809     "
  1831     "
  1810      Dialog 
  1832      Dialog 
  1811 	requestFileName:'enter a fileName:'
  1833         requestFileName:'enter a fileName:'
  1812 	default:''
  1834         default:''
  1813 	version:#old 
  1835         version:#old 
  1814 	ifFail:['none']   
  1836         ifFail:['none']   
  1815 	fromDirectory:'/etc'
  1837         fromDirectory:'/etc'
  1816     "
  1838     "
  1817     "
  1839     "
  1818      Dialog 
  1840      Dialog 
  1819 	requestFileName:'enter a fileName:'
  1841         requestFileName:'enter a fileName:'
  1820 	default:''
  1842         default:''
  1821 	version:#mustBeNew 
  1843         version:#mustBeNew 
  1822 	ifFail:['none']   
  1844         ifFail:['none']   
  1823 	fromDirectory:'/etc'
  1845         fromDirectory:'/etc'
  1824     "
  1846     "
  1825 
  1847 
  1826     "Modified: 20.2.1997 / 18:12:28 / cg"
  1848     "Modified: 20.2.1997 / 18:12:28 / cg"
  1827     "Modified: 21.2.1997 / 14:27:27 / stefan"
  1849     "Modified: 21.2.1997 / 14:27:27 / stefan"
  1828 !
  1850 !
  1949      and confirm if it already exists.
  1971      and confirm if it already exists.
  1950      The box will not allow pressing 'ok' without an entered string.
  1972      The box will not allow pressing 'ok' without an entered string.
  1951      Return the pathname string consisting of the full pathname of the filename,
  1973      Return the pathname string consisting of the full pathname of the filename,
  1952      or an empty string (if cancel was pressed)."
  1974      or an empty string (if cancel was pressed)."
  1953 
  1975 
  1954     ^ self requestFileName:titleString 
  1976     ^ self 
  1955 		   default:defaultName 
  1977         requestFileName:titleString 
  1956 		   version:#new 
  1978         default:defaultName 
  1957 		    ifFail:''
  1979         version:#new 
       
  1980         ifFail:''
  1958 
  1981 
  1959     "
  1982     "
  1960      Dialog requestNewFileName:'enter a fileName:' default:''  
  1983      Dialog requestNewFileName:'enter a fileName:' default:''  
  1961     "
  1984     "
  1962 
  1985 
  5818 ! !
  5841 ! !
  5819 
  5842 
  5820 !DialogBox class methodsFor:'documentation'!
  5843 !DialogBox class methodsFor:'documentation'!
  5821 
  5844 
  5822 version
  5845 version
  5823     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.123 1998-10-21 15:20:17 cg Exp $'
  5846     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.124 1999-02-11 23:45:44 cg Exp $'
  5824 ! !
  5847 ! !
  5825 DialogBox initialize!
  5848 DialogBox initialize!