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.30 date: 2023/07/06 14:35:53
user: cg
file: Separator.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

Description:


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

See examples.

copyright

COPYRIGHT (c) 1995 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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
(comment from inherited method)
redraw part of myself immediately, given logical coordinates
(if transformation is nonNil)
The default here is to redraw everything
- subclasses usually redefine this, adding more intelligence

o  sizeChanged: how from: oldExtentOrNil
my view has changed the size (not the contents)

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
returns my spec class (for UI editor)

Usage example(s):

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:49:41 GMT