David T. Lewis uploaded a new version of ToolBuilder-MVC to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-MVC-dtl.38.mcz ==================== Summary ==================== Name: ToolBuilder-MVC-dtl.38 Author: dtl Time: 29 March 2015, 5:10:54.703 pm UUID: b9fbc8b7-4f34-4575-a651-3400866d6880 Ancestors: ToolBuilder-MVC-dtl.37 Allow the UIManager to specify titles for confirm dialogs. In Morphic, this is the text of the title bar. In MVC, it is a line of text added to the top of the dialog prompt. #confirm:title replaces #confirm:label: which was defined previously in UIManager, but not implemented for Morphic or MVC. #title is consistent with other UIManager method naming and matches the implementation in UserDialogBoxMorph. =============== Diff against ToolBuilder-MVC-dtl.37 =============== Item was added: + ----- Method: MVCUIManager>>confirm:orCancel:title: (in category 'ui requests') ----- + confirm: aString orCancel: cancelBlock title: titleString + "Put up a yes/no/cancel menu with caption aString, and titleString to label the dialog. + Answer true if the response is yes, false if no. If cancel is chosen, evaluate cancelBlock. + This is a modal question--the user must respond yes or no." + ^ PopUpMenu + confirm: (self dialogStringFromQuery: aString withTitle: titleString) + orCancel: cancelBlock! Item was added: + ----- Method: MVCUIManager>>confirm:title: (in category 'ui requests') ----- + confirm: queryString title: titleString + "Put up a yes/no menu with caption queryString, and titleString to label the dialog. + Answer true if the response is yes, false if no. This is a modal question--the user + must respond yes or no." + ^PopUpMenu confirm: (self dialogStringFromQuery: queryString withTitle: titleString) + ! Item was added: + ----- Method: MVCUIManager>>confirm:title:trueChoice:falseChoice: (in category 'ui requests') ----- + confirm: queryString title: titleString trueChoice: trueChoice falseChoice: falseChoice + "Put up a yes/no menu with caption queryString, and titleString to label the dialog. + The actual wording for the two choices will be as provided in the trueChoice and + falseChoice parameters. Answer true if the response is the true-choice, false if it + is the false-choice. This is a modal question -- the user must respond one way or + the other." + ^ PopUpMenu + confirm: (self dialogStringFromQuery: queryString withTitle: titleString) + trueChoice: trueChoice + falseChoice: falseChoice! Item was added: + ----- Method: MVCUIManager>>dialogStringFromQuery:withTitle: (in category 'private') ----- + dialogStringFromQuery: queryString withTitle: titleString + "In Morphic, it is common to display a simple dialog that has a title bar. In MVC, simple + dialogs are simple. If the UIManager requests a dialog with title, add the title as a simply + decorated line at the top of the dialog text." + ^String streamContents: [ :strm | + strm nextPutAll: '- '; + nextPutAll: titleString; + nextPutAll: ' -'; + nextPut: Character cr; + nextPutAll: queryString ] + ! |
Free forum by Nabble | Edit this page |