Hi Marcel!
Fair point, I will revert that.
Would you agree with the rest of the patch when I reupload it?
This commit was a first step towards the implementation of a CommandLineUIManager as discussed here: http://forum.world.st/CommandLineUIManager-td5106538.html By the way, my image already contains an early prototype version of it.
If there is anyone else interested in this extension, my questions from the post belowhttp://forum.world.st/The-Inbox-ToolBuilder-Kernel-ct-135-mcz-tp5110615p5110623.html are still up to date! :-)
Best,
Christoph
http://www.hpi.de/ ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Donnerstag, 1. Oktober 2020 16:28:53 An: squeak-dev@lists.squeakfoundation.org Betreff: Re: [squeak-dev] The Inbox: ToolBuilder-Kernel-ct.135.mcz
Hi Christoph.
-1 because "false" is typically different than "cancellation" in the context where that UI request is posed.
Imagine that a user says "No, do not overwrite but duplicate that item." but your logic could trigger something like "Close this dialog" just because the current UI manager omitted to implement that case. It would be more discoverable to raise that #subclassResponsibility exception.
Best, Marcel
commits-2 wrote
Christoph Thiede uploaded a new version of ToolBuilder-Kernel to project The Inbox: http://source.squeak.org/inbox/ToolBuilder-Kernel-ct.135.mcz
==================== Summary ====================
Name: ToolBuilder-Kernel-ct.135 Author: ct Time: 24 January 2020, 6:34:43.604574 pm UUID: 3ec2613e-56d3-2d41-b5c3-799a66a986e9 Ancestors: ToolBuilder-Kernel-mt.134
Provides fallback implementations for some UIManager messages
=============== Diff against ToolBuilder-Kernel-mt.134 ===============
Item was changed: ----- Method: UIManager>>chooseFrom:values:lines:title: (in category 'ui requests') ----- chooseFrom: labelList values: valueList lines: linesArray title: aString
"Choose an item from the given list. Answer the corresponding value."
| result |
result := self chooseFrom: labelList lines: linesArray title: aString.
(result isNil or: [result isZero]) ifTrue: [^ nil].
^ valueList at: result!
"Choose an item from the given list. Answer the selected item."
^self subclassResponsibility!
Item was changed:
----- Method: UIManager>>confirm:orCancel: (in category 'ui requests')
confirm: aString orCancel: cancelBlock
"Put up a yes/no/cancel menu with caption aString. 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."
^ (self confirm: aString)
ifFalse: [cancelBlock value];
yourself!
"Put up a yes/no/cancel menu with caption aString. 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."
^self subclassResponsibility!
Item was changed: ----- Method: UIManager>>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."
^ (self confirm: aString title: titleString)
ifFalse: [cancelBlock value];
yourself!
"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."
^self subclassResponsibility!
Item was changed: ----- Method: UIManager>>request:initialAnswer:centerAt: (in category 'ui requests - text') ----- request: queryString initialAnswer: defaultAnswer centerAt: aPoint
"Create an instance of me whose question is queryString with the given
initial answer. Invoke it centered at the given point, and answer the string the user accepts. Answer the empty string if the user cancels."
"Create an instance of me whose question is queryString with the given
initial answer. Invoke it centered at the given point, and answer the
string the user accepts. Answer the empty string if the user cancels."
^ self request: queryString initialAnswer: defaultAnswer!
^self subclassResponsibility!
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html