Skip to content
Permalink
Browse files

Merge pull request #750 from jecisc/Migrate-more-layouts

Migrate-more-layouts
  • Loading branch information...
jecisc committed Sep 4, 2019
2 parents cb26690 + 3578950 commit cee71ae1742b8237c6f27102bdc6ec39800db181
@@ -209,6 +209,13 @@ SpAbstractMorphicAdapter >> extent [
^ self widget extent
]

{ #category : #'api-focus' }
SpAbstractMorphicAdapter >> gtInspectorPreviewIn: composite [
<gtInspectorPresentationOrder: 30>

self widgetDo: [ :w | w gtInspectorMorphIn: composite ]
]

{ #category : #protocol }
SpAbstractMorphicAdapter >> hRigid [

@@ -30,25 +30,29 @@ Class {

{ #category : #spec }
SpEditableList class >> defaultSpec [
^ SpLayout composed
newColumn:
[ :column |
column
newRow: [ :menuRow |
menuRow
add: #addButton;
add: #removeButton ]
height: 25;
newRow: [ :listRow |
listRow
newColumn: [ :c1 | c1 add: #list ];
newColumn: [ :c2 |
c2
add: #topButton;
add: #upButton;
add: #downButton;
add: #bottomButton ]
width: 24 ] ]
^ SpBoxLayout newVertical
add:
(SpBoxLayout newHorizontal
add: #addButton;
add: #removeButton;
yourself)
expand: false
fill: false
padding: 0;
add:
(SpBoxLayout newHorizontal
add: #list;
add:
(SpBoxLayout newVertical
add: #topButton;
add: #upButton;
add: #downButton;
add: #bottomButton;
yourself)
expand: false
fill: false
padding: 0;
yourself);
yourself
]

@@ -27,44 +27,48 @@ SpLabelledContainer class >> defaultSpec [
{ #category : #specs }
SpLabelledContainer class >> labelBottom [
<spec>
^ SpLayout composed
newColumn: [ :column |
column
add: #subwidget origin: 0 @ 0 corner: 1 @ 0.9;
add: #label origin: 0 @ 0.9 corner: 1 @ 1 ];
^ SpBoxLayout newVertical
add: #subwidget;
add: #label
expand: false
fill: false
padding: 0;
yourself
]

{ #category : #specs }
SpLabelledContainer class >> labelLeft [
<spec>
^ SpLayout composed
newRow: [ :row |
row
add: #label origin: 0 @ 0 corner: 0.2 @ 1;
add: #subwidget origin: 0.2 @ 0 corner: 1 @ 1 ];
^ SpBoxLayout newHorizontal
add: #label
expand: false
fill: false
padding: 0;
add: #subwidget;
yourself
]

{ #category : #specs }
SpLabelledContainer class >> labelRight [
<spec>
^ SpLayout composed
newRow: [ :row |
row
add: #subwidget origin: 0 @ 0 corner: 0.8 @ 1;
add: #label origin: 0.8 @ 0 corner: 1 @ 1 ];
^ SpBoxLayout newHorizontal
add: #subwidget;
add: #label
expand: false
fill: false
padding: 0;
yourself
]

{ #category : #specs }
SpLabelledContainer class >> labelTop [
<spec>
^ SpLayout composed
newColumn: [ :column |
column
add: #label origin: 0 @ 0 corner: 1 @ 0.1;
add: #subwidget origin: 0 @ 0.1 corner: 1 @ 1 ];
^ SpBoxLayout newVertical
add: #label
expand: false
fill: false
padding: 0;
add: #subwidget;
yourself
]

@@ -481,6 +481,23 @@ SpPresenter >> giveFocusToPreviousFrom: aModel [
true ]
]

{ #category : #'api-focus' }
SpPresenter >> gtInspectorPreviewIn: composite [
<gtInspectorPresentationOrder: 30>
self widget ifNotNil: [ :w | w gtInspectorPreviewIn: composite ]
]

{ #category : #'api-focus' }
SpPresenter >> gtInspectorSubPresentersIn: composite [
<gtInspectorPresentationOrder: 20>
composite tree
title: 'Sub presenters';
rootsExpanded;
display: [ :each | {each} ];
children: [ :each | each presenters ];
when: [ :each | each presenters isNotEmpty ]
]

{ #category : #'private-focus' }
SpPresenter >> handlesKeyboard: evt [

@@ -12,7 +12,7 @@ Class {
'dropList',
'input'
],
#category : #'Spec2-Core-Widgets'
#category : #'Spec2-Deprecated'
}

{ #category : #specs }
@@ -26,6 +26,13 @@ SpInputTextDropList class >> defaultSpec [
yourself
]

{ #category : #testing }
SpInputTextDropList class >> isDeprecated [
"This presenter does not add enough value to Spec to be kept in it. If you are using it, please copy the code in your own application."

^ true
]

{ #category : #'api-shortcuts' }
SpInputTextDropList >> acceptOnCR: aBoolean [
self input acceptOnCR: aBoolean
@@ -73,6 +80,12 @@ SpInputTextDropList >> entryCompletion: anEntryCompletion [
self input entryCompletion: anEntryCompletion
]

{ #category : #'as yet unclassified' }
SpInputTextDropList >> ghostText: aText [
self deprecated: 'This API is too tight to Morph. Use #placeholder: instead.' transformWith: '`@receiver ghostText: `@statement' -> '`@receiver placeholder: `@statement'.
self placeholder: aText
]

{ #category : #initialization }
SpInputTextDropList >> initializeWidgets [
input := self instantiate: SpTextInputFieldPresenter.

This file was deleted.

@@ -1,7 +1,7 @@
Class {
#name : #SpInputTextDropListTest,
#superclass : #SpSmokeTest,
#category : #'Spec2-Tests-Core-Widgets'
#category : #'Spec2-Deprecated'
}

{ #category : #running }
@@ -6,7 +6,7 @@ Be aware that when you use this, you broke Spec plateform independency and force
Class {
#name : #SpMorphicGenericAdapter,
#superclass : #SpAbstractMorphicAdapter,
#category : #'Spec2-Deprecated'
#category : #'Spec2-Deprecated-Adapters'
}

{ #category : #deprecation }
@@ -36,9 +36,41 @@ Class {

{ #category : #specs }
SpDemoStandaloneFormPresenter class >> defaultSpec [

<spec: #default>

"SpBoxLayout newVertical
add:
(SpGridLayout new
add: 'Name:' at: 1 @ 1;
add: #nameTextInput at: 2 @ 1;
add: 'Surname:' at: 1 @ 2;
add: #surnameTextInput at: 2 @ 2;
add: 'Number 1:' at: 1 @ 3;
add: #number1Input at: 2 @ 3;
add: 'Number 2:' at: 1 @ 4;
add: #number2Input at: 2 @ 4;
add: 'Scale:' at: 1 @ 5;
add: #scaleInput at: 2 @ 5;
add: 'Password:' at: 1 @ 6;
add: #passwordInput at: 2 @ 6;
add: 'Remember me:' at: 1 @ 7;
add: #checkboxInput at: 2 @ 7;
add: 'Date:' at: 1 @ 8;
add: #dateInput at: 2 @ 8;
add: 'Gender:' at: 1 @ 9;
add:
(SpBoxLayout newHorizontal
add: #maleButton;
add: #femaleButton;
yourself)
at: 2 @ 9;
add: 'Items:' at: 1 @ 10;
add: #itemsInput at: 2 @ 10;
yourself);
add:
(SpBoxLayout newHorizontal
add: #submitButton;
add: #restoreButton;
yourself);
yourself"
| fontWidth labelsWidth rowHeight checkboxWidth |
fontWidth := (StandardFonts defaultFont widthOfString: 'M').
labelsWidth := fontWidth * 8.
@@ -3,9 +3,13 @@ Extension { #name : #SpEditableList }
{ #category : #'*Spec2-Examples' }
SpEditableList class >> example [
<sampleInstance>
^self new

title: 'Selectors list';
| presenter |
presenter := self new
list: self selectors;
openWithSpec
openWithSpec;
yourself.

presenter withWindowDo: [ :w | w title: 'Selectors list' ].

^ presenter
]

0 comments on commit cee71ae

Please sign in to comment.
You can’t perform that action at this time.