Projects

Downloads

Resume

Photos

Pictures

Illustrations

3D

Videos
The Traits User's Guide

Table of Contents

Introduction. 3

Defining Traits. 4

Defining Simple Traits. 5

Defining More Complex Traits. 7

Mapped Traits. 12

Trait Functions. 14

Digging Deeper 16

Trait Handlers. 16

TheTraitHandler Class. 17

The TraitType Class. 17

The TraitInstance Class. 19

The TraitFunction Class. 19

The TraitRange Class. 21

The TraitEnum Class. 21

The TraitPrefixList Class. 22

The TraitMap Class. 23

The TraitPrefixMap Class. 24

The TraitComplex Class. 25

Defining Your Own Trait Handlers. 25

Trait Delegation. 28

The TraitDelegate Class. 28

Delegating Via a Method. 29

Delegating Via Other Traits or Attributes. 29

The Different Types of Delegation. 29

Reusing Trait Definitions. 31

Special Predefined Traits and Values. 32

Creating Categories of Similar Traits for Objects. 33

Per Object Traits. 34

Useful Methods on Objects with Traits. 35

Performance Considerations of Traits. 36

Creating Graphical User Interface Trait Editors. 37

The Standard Trait Editors. 38

Using and Overriding a Default Trait Editor 43

Editing Traits. 45

Controlling Trait Editor Layout 47

Creating a TraitEditor Subclass. 53

Creating a TraitSheetHandler Subclass. 55

Trait Editor Constructors. 56

Using Trait Editors in Non-GUI Applications. 57

Where to Get the Code. 60

 



© Copyright 2001-2008 by David C. Morrill. All rights reserved.