Giter VIP home page Giter VIP logo

on-board's Introduction

onBoard

onBoard is a class that lets you incorporate sub-forms as dialogs in a form, even in a multi-page form.

Thanks to this class, the unglamorous work is taken care of:

  • load the sub-form on the fly, creating one instance per page.
  • control it from a worker
  • reposition it if the main form is resized.

You can concentrate on your dialogues without worrying about the mechanics.

 

preview

A few tips for getting started

You can see how this works in the HDI form included in the project.

I would just like to draw your attention to a few important points:

  • The sub-form area is located on page 0 of the main form, its expression type is object and it is configured to grow both horizontally and vertically. Its name is important, as we'll be using it to declare the intances of the built-in subforms.

  • You need to modify the method of this object if you want to manage specific actions. An example is given. This is where you can retrieve the contents of the sub-form's Form object

  • Embedded dialogs are declared in the On load event of the main form by creating an instance of the onBoard class. For example:

    Form.alert:=cs.onBoard.new("on-board"; "MESSAGE")
    Form.alert.me:=Form.alert
    • The first parameter of the constructor is the name of the sub-form object container you created earlier, the second is the name of the form to be used.
    • After that, set the me attribute to itself to enable the class functions to be used in the sub-form.

The instance can manage its positioning when the main form is resized. To do this, one of the objects in your sub-form must be called main and configured to move horizontally and vertically (usually a background). The onResize() function tracks the coordinates of the main object and moves all other objects in the sub-form accordingly. To take advantage of this, simply call the function in the On resize event of the sub-form as follows:

If (FORM Event.code=On Resize)
	
	Form.me.onResize()
	
End if

In the same way, you can call function onLoad() to initialize the content of static texts named title and additional and the title of buttons named cancel & ok.

If (FORM Event.code=On Load)
	
	Form.me.onLoad()
	
End if

Other functions can be used in the sub-form:

Form.me.close()
Form.me.accept()
Form.me.cancel()

or from a worker:

CALL FORM($caller; Formula(Form.progress.setProgress($progress; $message)))

on-board's People

Contributors

vdelachaux avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.