[squeak-dev] Review Request: mvcLineLengthDialogs.1.cs

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Tue Apr 5 17:30:57 UTC 2022


=============== Summary ===============

Change Set:        mvcLineLengthDialogs
Date:            5 April 2022
Author:            Christoph Thiede

Adds a line-length limit to MVC dialogs. Complements Morphic-mt.1935. Due to the recent elimination of #withCRs in many places, this change has been overdue for an even longer time.

Example (to be run in an MVC project):
    self inform: Object comment


=============== Diff ===============

MVCUIManager>>informUser:during: {ui requests} · ct 4/5/2022 19:14 (changed)
- informUser: aString during: aBlock
+ informUser: aStringOrText during: aBlock
    "Display a message above (or below if insufficient room) the cursor 
    during execution of the given block.
-         UIManager default informUser: 'Just a sec!' during: [(Delay forSeconds: 1) wait].
+         Project uiManager informUser: 'Just a sec!' during: [1 second wait].
    "
    (SelectionMenu labels: '')
        displayAt: Sensor cursorPoint
-         withCaption: aString
+         withCaption: (aStringOrText ifNotNil: [aStringOrText withNoLineLongerThan: 100])
        during: aBlock

PopUpMenu>>mvcStartUpWithCaption:icon:at:allowKeyboard: {*ST80-Menus} · ct 4/5/2022 19:10 (changed)
mvcStartUpWithCaption: captionOrNil icon: aForm at: location allowKeyboard: aBoolean
    "Display the menu, with caption if supplied. Wait for the mouse button to go down, then track the selection as long as the button is pressed. When the button is released,
    Answer the index of the current selection, or zero if the mouse is not released over  any menu item. Location specifies the desired topLeft of the menu body rectangle. The final argument indicates whether the menu should seize the keyboard focus in order to allow the user to navigate it via the keyboard."

    frame ifNil: [self computeForm].
    Cursor normal showWhile:
        [self
            displayAt: location
-             withCaption: captionOrNil
+             withCaption: (captionOrNil ifNotNil: [captionOrNil withNoLineLongerThan: 100])
            during: [self controlActivity]].
    ^ selection

---
Sent from Squeak Inbox Talk
["mvcLineLengthDialogs.1.cs"]
["mvcLineLengthDialogs.png"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220405/e31d0495/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mvcLineLengthDialogs.1.cs
Type: application/octet-stream
Size: 1747 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220405/e31d0495/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mvcLineLengthDialogs.png
Type: application/octet-stream
Size: 79270 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220405/e31d0495/attachment-0003.obj>


More information about the Squeak-dev mailing list