Demonstrate how to modify the view layout of a compound component using the BDE.
Open the latest version of BDE at: https://www.cubbles.world/bde/bde@2.0.0-SNAPSHOT/bde/index.html. When opening the BDE by default a new empty compound is created, which is called new-compound
. We can use this compound for the purpose of our tutorial.
We recommend you to use Chrome due to compatibility issues. |
Since the component that we are going to use for our compound are in the bde-test store, we need to change the current store. To aim that, you should use the Change store
option on the Header Toolbar (shown below):
Click on the option to open the Change Store dialog. This time the Base Url is the same, so you don't need to change it. You should only change the name of the store, which in this case is bde-test. If everything is okay, the Change Store dialog will close and a notification will be displayed on the bottom of the browser.
To load the component you should use the Load from base option of the Header toolbar:
A dialog should be displayed, here you should type the name of the desired component, which in this case is audio-player
. When the component appears in the result list, click on it to add it. The data flow of the the component should look as follows:
If you switch to the application-view you will see that the components of the audio-player
are not correctly arranged:
To modify the layout of the component you should switch to the design-view:
This view allows you to arrange all the cubbles of the loaded compound containers. By default there are only 2 containers:
You can add as many flexbox containers as you want and set them up individually.
To achieve a better view perform the following steps:
input
, output
, fft
and the eq
cubbles to the hidden container, since they have no view.utton, pauseButton
and stopButton
cubbles to the second flexbox container.volumeSlider
, middleSlider
, bassSlider
and trebbleSlider
cubbles to the third flexbox containerIf you switch to the application-view the instantiated component should now looks as shown below:
Now you can perform the following steps to modify the alignment and distribution of the two first flexbox containers:
After those settings an instance of the component should finally look as follows: