diff --git a/src/Toplo-Examples/ToElementWithEditor.class.st b/src/Toplo-Examples/ToElementWithEditor.class.st index cd3169a66..f64f6f6aa 100644 --- a/src/Toplo-Examples/ToElementWithEditor.class.st +++ b/src/Toplo-Examples/ToElementWithEditor.class.st @@ -23,7 +23,7 @@ ToElementWithEditor >> beforeEditorOpened: anEditor fromManager: aManager [ do: [ :event | aManager closeWindow ]. anEditor text: (contents ifNil: [self background paint color asString]). - anEditor infinite requestFocus. + anEditor requestFocus. anEditor selecter all; apply. diff --git a/src/Toplo-Examples/ToSandBox.class.st b/src/Toplo-Examples/ToSandBox.class.st index b1d7a819a..7976c466b 100644 --- a/src/Toplo-Examples/ToSandBox.class.st +++ b/src/Toplo-Examples/ToSandBox.class.st @@ -932,6 +932,7 @@ ToSandBox class >> example_CodeEditor [ disabox := ToCheckMenuItem new label: (ToLabel text: 'Disable'). menuBar := ToMenuBar new. + menuBar hMatchParent. menuBar addItem: fileMenu. menuBar addItem: inspectBtn. menuBar addItem: showStatisticsBtn. @@ -983,6 +984,46 @@ ToSandBox class >> example_EditableList2WithAllClassesNames [ space show ] +{ #category : #album } +ToSandBox class >> example_EditorWithMinHeight [ + + | pane menuBar text album disabox inspectBtn showStatisticsBtn | + pane := ToPane vertical matchParent. + + text := ''. + album := ToAlbum new. + album hMatchParent. + album vFitContent. + album next constraintsDo: [ :c | + c vertical fitContent. + c horizontal matchParent ]. + album infinite constraintsDo: [ :c | + c vertical fitContent. + c horizontal matchParent ]. + album text: text copy. + album minHeight: 100. + + inspectBtn := ToMenuItem new labelText: 'Inspect'. + showStatisticsBtn := ToMenuItem new labelText: 'Statistics'. + disabox := ToCheckMenuItem new label: (ToLabel text: 'Disable'). + + menuBar := ToMenuBar new. + menuBar hMatchParent. + menuBar addItem: inspectBtn. + menuBar addItem: showStatisticsBtn. + menuBar addItem: disabox. + + pane addChild: menuBar. + pane addChild: album. + + inspectBtn whenClickedDo: [ :evt | album space root inspect ]. + disabox whenClickedDo: [ :evt | album disabled: disabox isChecked ]. + showStatisticsBtn whenClickedDo: [ :evt | + album space showStatisticsWindow ]. + + pane openInSpace +] + { #category : #album } ToSandBox class >> example_EditorWithPlaceholder [ @@ -1002,8 +1043,8 @@ ToSandBox class >> example_EditorWithPlaceholder [ withRowNumbers; withSaveCapability; whenSaveRequestedDo: [ :saveRequested | - saveRequested client saveResult: true ]; - withEditsFeedback. + saveRequested accepted: true ]; + yourself. view openInInnerWindow ] @@ -1027,7 +1068,7 @@ ToSandBox class >> example_EditorWithPlaceholderWithAlbum [ withRowNumbers; withSaveCapability; whenSaveRequestedDo: [ :saveRequested | - saveRequested client saveResult: true ]; + saveRequested accepted: true ]; withEditsFeedback. view openInInnerWindow ] @@ -1041,10 +1082,10 @@ ToSandBox class >> example_EditorWithoutSoftLine [ withRowNumbers; withSaveCapability; whenSaveRequestedDo: [ :saveRequested | - saveRequested client saveResult: true ]; + saveRequested accepted: true ]; withEditsFeedback. view withoutSoftLine. - view text: ((String loremIpsum: 100000) asRopedText fontName: 'Source Code Pro'). + view text: ((String loremIpsum: 10000) asRopedText fontName: 'Source Code Pro'). view openInSpace ] diff --git a/src/Toplo-Examples/ToWorkspaceExample.class.st b/src/Toplo-Examples/ToWorkspaceExample.class.st index c41179af3..3b33f38ea 100644 --- a/src/Toplo-Examples/ToWorkspaceExample.class.st +++ b/src/Toplo-Examples/ToWorkspaceExample.class.st @@ -5,8 +5,8 @@ Class { #name : #ToWorkspaceExample, #superclass : #Object, #instVars : [ - 'textModel', - 'bindings' + 'bindings', + 'album' ], #category : #'Toplo-Examples-TopLevel' } @@ -72,8 +72,8 @@ ToWorkspaceExample >> correctFrom: start to: stop with: aString [ ToWorkspaceExample >> doIt [ | toDo | - toDo := textModel selectedText asString. - toDo ifEmpty: [ toDo := textModel text asString ]. + toDo := album selectedText asString. + toDo ifEmpty: [ toDo := album text asString ]. [ OpalCompiler new source: toDo readStream; @@ -93,14 +93,14 @@ ToWorkspaceExample >> hasBindingOf: aString [ ToWorkspaceExample >> initialize [ super initialize. bindings := Dictionary new. - textModel := ToAlbum new. + album := ToAlbum new. ] { #category : #'user interface' } ToWorkspaceExample >> initializeCodeEditor [ - textModel + album withRowNumbers; placeholderBuilder: [ :thePlaceholder :e | | text lab | text := (('Workspace example' , String cr , '- doit: Cmd-d') asRopedText @@ -145,15 +145,15 @@ ToWorkspaceExample >> openInSpace: aSpace [ | frame | self initializeCodeEditor. - textModel infinite requestFocus. - textModel showPlaceholder. + album requestFocus. + album showPlaceholder. frame := ToInnerWindow new title: 'Workspace'. - frame pane addChild: textModel. + frame pane addChild: album. aSpace root addChild: frame ] { #category : #accessing } ToWorkspaceExample >> text [ - ^ textModel text + ^ album text ] diff --git a/src/Toplo-Widget-Accordion/ToAccordionElement.class.st b/src/Toplo-Widget-Accordion/ToAccordionElement.class.st deleted file mode 100644 index ec2a23f8d..000000000 --- a/src/Toplo-Widget-Accordion/ToAccordionElement.class.st +++ /dev/null @@ -1,146 +0,0 @@ -Class { - #name : #ToAccordionElement, - #superclass : #ToElement, - #instVars : [ - 'header', - 'body', - 'headerBuilder', - 'bodyBuilder' - ], - #category : #'Toplo-Widget-Accordion-Core' -} - -{ #category : #examples } -ToAccordionElement class >> exampleWithLabel [ - -