## Introduction

### 4 classes

This document describes the 4 classes of dFrameAPI and their methods.

The normal way for building dFrameAPI applications is the following one:

Only one object is created with a constructor, the DFrame object:

var dFrame = new DFrame(parameters)

Bars can then be added to the DFrame object:

var bar = dFrame.addBar(parameters)

The method returns a Bar object.

Buttons and Menus are then added to Bars:

var button = bar.addButton(parameters): Returns a Button object

var menu = bar.addMenu(parameters): Returns a Menu object

However it is possible to use 'shortcuts' and directly add Buttons and Menus to a DFrame:

var button = dFrame.addButton(parameters)

var menu = dFrame.addMenu(parameters)

In this case dFrameAPI creates a default Bar and adds Buttons and Menus to this Bar:

At least there are a few other methods to create objects:

var bar = dFrame.addTaskBar(parameters): Add a special Bar, the Task Bar

var menu = dFrame.addTaskMenu(parameters): Add a special Menu, the Task Menu.

var button = object.addText(parameters) (object can be a DFrame or a Bar)

var menu = dFrame.addContextMenu(parameters): Add a context Menu

var barLayer = bar.addBarLayer(parameters): Add a layer

### Additional "Style methods"

The common way to set Styles properties to an object is the following one:

Create a Style: var dFrameStyle = new DFrameStyle()

Define the Style: dFrameStyle.setBackgroundColor('red')

Use the Style: var dFrame = new DFrame(dFrameStyle)

However all Style method can apply to objects. The following code will product the same result as the previous one:

Create a Style: var dFrameStyle = new DFrameStyle()

Use the Style: var dFrame = new DFrame(dFrameStyle)

Use Style method on an object: dFrame.setBackgroundColor('red')

So all Styles methods can also be considered as objects methods. See Use shortcuts in the Style section

### 2 single object classes

In addition 2 classes define 2 object automatically instantiated when dFrameAPI loads:

The dFrameAPI object manages some technical features as incude libraries, load images, check Styles, check images …

The DFrameCollector is a kind of gabage collector whose role is to store closed DFrames.