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

Marcel Taeumel marcel.taeumel at hpi.de
Fri Apr 8 07:45:48 UTC 2022


Hi Christoph --

> withNoLineLongerThan: 100

Make that 45 or 65, please. Especially if it is a Text, not a String.

Best,
Marcel
Am 08.04.2022 09:44:03 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Christoph --

+1

There also is a constant in TextConstants that defines this centered style in MVC pop-ups. Maybe we should change it to leftFlush? Would also affect menus, I think.

Best,
Marcel
Am 05.04.2022 19:31:13 schrieb christoph.thiede at student.hpi.uni-potsdam.de <christoph.thiede at student.hpi.uni-potsdam.de>:
=============== 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 [https://github.com/hpi-swa-lab/squeak-inbox-talk]
["mvcLineLengthDialogs.1.cs"]
["mvcLineLengthDialogs.png"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220408/b7b2d3c2/attachment.html>


More information about the Squeak-dev mailing list