eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Separator':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Separator


Inheritance:

   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

Description:


a simple widget for a separating line. 
To be placed between groups of other widgets.

See examples.


Related information:

    FramedBox
    VariableVerticalPanel
    VariableHorizontalPanel

Instance protocol:

accessing
o  orientation
return the orientation (one of #horizontal or #vertical)

o  orientation: aSymbol
set the orientation to one of #horizontal or #vertical

drawing
o  redrawX: x y: y width: w height: h

o  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
o  wantsFocusWithButtonPress
no, do not catch the keyboard focus on button click

initialization
o  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
o  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.

o  specClass
redefined, since the name of my specClass is nonStandard (i.e. not SeparatorSpec)


Examples:


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


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 16 Apr 2024 22:32:25 GMT