|
Class: Separator
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--Separator
- Package:
- stx:libwidg2
- Category:
- Views-Layout
- Version:
- rev:
1.26
date: 2018/11/09 23:18:08
- user: cg
- file: Separator.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- Claus Gittinger
a simple widget for a separating line.
To be placed between groups of other widgets.
See examples.
FramedBox
VariableVerticalPanel
VariableHorizontalPanel
accessing
-
orientation
-
return the orientation (one of #horizontal or #vertical)
-
orientation: aSymbol
-
set the orientation to one of #horizontal or #vertical
drawing
-
redrawX: x y: y width: w height: h
-
-
sizeChanged: how
-
(comment from inherited method)
tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)
focus handling
-
wantsFocusWithButtonPress
-
no, do not catch the keyboard focus on button click
initialization
-
initialize
-
(comment from inherited method)
initialize all state of the view - usually redefined in subclasses,
but always doing a 'super initialize'. Each class should setup its
locals - and not forget the others.
View setup is separated into two parts, the general setup done here
and the style specific setup in initStyle. Each view should be prepared
for a stylechange by being sent another initStyle with a new style value.
(in this case, it should set all of its style-dependent things, but
leave the state and contents as-is)
queries
-
computePreferredExtent
-
(comment from inherited method)
return my computed preferred extent - this is the minimum size I would like to have.
If there are any components, a rectangle enclosing them
is returned. Otherwise, the actual extent is returned.
-
specClass
-
redefined, since the name of my specClass is nonStandard (i.e. not SeparatorSpec)
a separator between two button-panels:
|top p1 p2 sep|
top := StandardSystemView new.
top extent:300@300.
p1 := VerticalPanelView origin:0.0@0.0 corner:1.0@0.5 in:top.
p1 bottomInset:5; borderWidth:0.
p2 := VerticalPanelView origin:0.0@0.5 corner:1.0@1.0 in:top.
p2 topInset:5; borderWidth:0.
(Button label:'one' in:p1) width:0.2.
(Button label:'two' in:p1) width:0.2.
(Button label:'three' in:p1) width:0.2.
sep := Separator in:top.
sep orientation:#horizontal.
sep origin:0.0@0.5 extent:1.0@10.
sep topInset:-5; bottomInset:-5.
(Button label:'four' in:p2) width:0.2.
(Button label:'five' in:p2) width:0.2.
(Button label:'six' in:p2) width:0.2.
top open
|
vertical:
|top p1 p2 sep|
top := StandardSystemView new.
top extent:300@300.
p1 := VerticalPanelView origin:0.0@0.0 corner:0.5@1.0 in:top.
p1 rightInset:5; borderWidth:0.
p2 := VerticalPanelView origin:0.5@0.0 corner:1.0@1.0 in:top.
p2 leftInset:5; borderWidth:0.
(Button label:'one' in:p1) width:0.4.
(Button label:'two' in:p1) width:0.4.
(Button label:'three' in:p1) width:0.4.
sep := Separator in:top.
sep orientation:#vertical.
sep origin:0.5@0.0 extent:10@1.0.
sep leftInset:-5; rightInset:-5.
(Button label:'four' in:p2) width:0.4.
(Button label:'five' in:p2) width:0.4.
(Button label:'six' in:p2) width:0.4.
top open
|
with multiple horizontal seps in a panel:
|top p sep|
top := StandardSystemView new.
top extent:300@300.
p := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
p verticalLayout:#spreadSpace.
p horizontalLayout:#center.
(Button label:'one' in:p).
(Button label:'two' in:p).
(Button label:'three' in:p).
sep := Separator in:p.
sep orientation:#horizontal.
sep extent:0.9@10.
(Button label:'four' in:p).
(Button label:'five' in:p).
sep := Separator in:p.
sep orientation:#horizontal.
sep extent:0.9@10.
(Button label:'six' in:p).
top open
|
|