wiki:widgets

Version 4 (modified by marcel.taeumel, 13 years ago) ( diff )

--

Introduction

Adds nice looking Morphic controls, e.g., lists, dropdown lists, push buttons, check boxes. It uses the signals mechanism for callbacks.

How to Install

Environment
4.1, 4.2 Trunk
4.0.2 (win)
not tested with cog
Sources
ConfigurationOfWidgets
SwaUtilities
Widgets
Icons (optional)
Signals
Animations
SwaUtil
Misc
SwaUtilities@SqueakSource

Configuration groups

default ... just the widgets
full ... widgets and several CC icon sets (~10000 icons)

System categories

Widgets-Core ... various widgets (e.g., buttons, lists, line inputs)
Widgets-Support ... internally used helper classes
Widgets-Views ... model-based item views (list, table, tree with columns)
Widgets-Views-Models ... example models also used in default dialogs
Widgets-Views-Support ... internally used helper classes for item views
Widgets-Dialogs ... default dialogs, ui files created with Morphic Designer

Version 1.1 (in development)

Version 1.0

  • first release to be used in Morphic Designer 1.0
  • still dependent from swautil due to text formatting functions
    • will be removed soon as lots of other stuff comes with that package
  • some example dialogs need the Icons package

How to Use

Button Widgets

Containers & Spacers

Input Widgets

Display Widgets

Item Widgets (Item-Based)

Item Widgets (Model-Based)

How to Extend

Most of the widgets are written from scratch. If you want to extend or add new ones, here are some hints:

  • layouting of morphs in combination with embedded text morphs can be problematic in the first place as the dimensions are not correct
    • see optimizations and fixes in UiComboBox
  • put all signals of a widget class into the signals protocol
  • for each signal, explain with a comment when it will generally be sent, e.g., "This signal is emitted whenever the user clicks with the left mouse button."
  • try to write as compact classes as possible, i.e., avoid having several classes for buttons, buttons with icons, buttons with icons and text, but write exactly one class and make these features configurable
  • consider the Morphic Designer and implement on the class-side of your widget class:
    • #isWidgetClass ... used by the designer as a widget
    • #widgetCategory ... as grouped in the designer's widget tree
    • #widgetProperties ... appended to the end of the designer's property table
    • #widgetPropertiesToIgnore ... hidden in the designer's property table
    • #widgetClassIcon ... icon in the designer's widget tree
    • #widgetClassName ... text in the designer's widget tree

Attachments (12)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.