Skip to content

1. Getting started

Gary Criblez edited this page Jun 26, 2020 · 4 revisions

Installation

AJUI_BreadCrumb must be placed in the component folder of your application.

Principles of use

In this section, we describe the sequence of operations to be performed in order to generate a simple Breadcrumb in the context of the main form.

Prerequisites

AJUI_Breadcrumb needs an image object that will serve as a model. This object is provided with the AJUI_Library library that you can open from your application (/File/Open/Object Library...) and you just have to drag & drop the "BreadCrumb_object" object on your form.

You can duplicate this object to create as many Breadcrumb as necessary. Each Breadcrumb should have a specific name that you can define according to your imagination.

If you create the Breadcrumb by yourself in the form editor, do not forget to activate the events required to operate the Breadcrumb (see the chapter on events).

Basis for creating a breadcrumb

The first thing to do when creating a Breadcrumb is to open the method of your image form object and create an instance with the method "New AJUI_BreadCrumb". Then, associate the name of your form object to the instance with the "Name" member function. Then, add sections with the "AddSection" member function. Now, the Breadcrumb is created and will use the default values, all you have to do is adapt the parameters of it to your needs in terms of interface and operation.

Case of
  : (Form event code =On Load)

  Form.bc:=New AJUI_BreadCrumb ()
  Form.bc.Name("myBC")
  Form.bc.addSection("sect_home";New object("label";"Home"))
  Form.bc.addSection("sect_products";New object("label";"Products"))
  Form.bc.addSection("sect_enterprise";New object("label";"Enterprise"))
  Form.bc.addSection("sect_support";New object("label";"Support"))
  Form.bc.addSection("sect_store";New object("label";"Store"))
  Form.bc.addSection("sect_contact";New object("label";"Contact"))

End case

Form.bc.Draw ()

To do this, simply call the member functions of the properties described in the corresponding chapters. Test, the different compositions and types. Also change the property values for different states using the desired constants. Finally, encapsulate everything in an "on load" event and launch the "Draw" function.

For information, the default values make it possible to create an "arrow" model.

We have reviewed the construction bases and for the next step, we strongly recommend that you use the "AJUI_BreadcrumbLab" application, which is provided to you with the source code and can be used as a demonstrator for the component (Lab and HDI)

AJUI_BreadcrumbLab provides you with an environment that allows you to better understand the graphical results of the different properties and to quickly create templates to simplify the definition of your Breadcrumb. It also shows clearly which properties can be used by each model. It is delivered with a number of predefined templates.

AJUI_BreadCrumb class

Since V18R3, you can replace the returned instance by New AJUI_BreadCrumb with the call of the Breadcrumb class. The functions of the Breadcrumb class use the same names and parameters as for the formulas obtainable by New AJUI_BreadCrumb. The default values are also the same.

The only difference in terms of code is when the instance is created:

  //with formulas
    $myBC:=new AJUI_BreadCrumb ()

  //with class
    $myBC:= AJUI_Breadcrumb.new ()