Tutorial
This tutorial is for BeBuilder V0.5
- Run BeBuilder
First thing to do after copying everything into a convenient place, is to double click on the icon!
The main window opens, with three menus : Menu, Tools and AddOns.
The Tools Menu should be considered experimental.
- Create a Project
In the menu "File" choose the New Project item.
You are asked for a directory to place the generated code.
Choose a convenient place, create the directory if you need to (use the menu File), open it and click on the Button labelled "Select 'MyDir'"
If you check the directory (via the Tracker) you just choosed, you will find three files (AProject.cpp, AProject.h, makefile) those files are automatically generated by BeBuilder.
- Test this new feature called Automatic Code Generation
As said before, the code is automatically generated for you when you add a component or modify a property.
Click on AProject in the main window, then choose the Edit CPP File in the Tools menu.
The File AProject.cpp is edited in the BeIDE notice the "application/x-vnd.BeBuilderApp" Now close the window.
Click on AProject in the main window.
Click on the AppSignature property in the Properties window, the Standard Property Editor appears,
enter whatever you want and press Validate.
The AppSignature property in the Properties window has been updated.
Now click on AProject in the main window, then choose the Edit CPP File in the Tools menu.
Whatever you entered is now written in the file... That's dynamic code generation!
- Add A Window
Select the AProject item.
In the toolbar choose the Window Item. A window opens and AWindowComponent1 is added to the list
in the BeBuilder main window.
- Add A View
In the main window click on AWindowComponent1 then choose View in the toolbar.
The Window turns grey, it's the view.
If you click inside the new window you have just created, you may notice that AViewComponent2 is now selected in the main Window.
The properties associated with the View are visible in the Properties window.
- Add A Button
Select the AViewComponent2 Item and click on Button in the toolbar. A Button has been added to the BView: you can move it and resize it with the mouse...
- Add A TextControl
Select the AViewComponent2 Item and click on TextControl in the toolbar. A TextControl has been added to the BView: you can move it and resize it with the mouse...
- Add A RadioButton
Select the AViewComponent2 Item and click on RadioButton in the toolbar. A RadioButton has been added to the BView: you can move it and resize it with the mouse...
- Add A CheckBox
Select the AViewComponent2 Item and click on CheckBox in the toolbar. A CheckBox has been added to the BView: you can move it and resize it with the mouse...
- Add A Menu
As you can see to add a menu is a little more tricky than adding a button, but it's really simple too.
- Select the AViewComponent2 item and click on MenuBar in the toolbar.
- Select the AMenuBarX item and click on Menu in the toolbar.
- Select the AMenuX item and click on the MenuItem in the toolba.
- Keep AMenuX selected, you can add others MenuItem, Separator and even add a sub-menu (you have to click on Menu again.)
- Actions
If you are curious, you certainly noticed that a "Message" property was available for some components, it lets you specify a BMessage identifier like 'B_MY_MENU_SAVE' or anything you want.
BeBuilder will add your message to the handler in the BView or BMenuBar unit. All you will have to do is find in the generated code, the comment saying something like "Add you handler here" and you are done.
Your button, checkbox, menuitem... will have a function when selected.
Be careful: the last 4 digits of your BMessage property must be unique in the application.
As soon as you modified the Message Property the code is generated in the file associated.
- AddOns
AddOns are the new features added to BeBuilder V0.3. It lets developers create their own components and make them available in BeBuilder V0.3. All you have to do is copy addons into the AddOn directory in the BeBuilder directory!
AddOns are like any others built-in components, you can use them the same way you use a Button or a Textcontrol, select the AViewX component in the BBuilder main window and choose the menu with your addon, that's it!
- Generation
Since BeBuilder V0.5 the generation path is determined when you choose the directory when creating a new project.
Be Sure the directory where you want to generate is empty.
- Save / Load A Project
Since BeBuilder V0.5 you can save the project you are working on.
How ? It's simple : just go in the File Menu and Choose Save.
To open a project just open BeBuilder and drag or double-click on the project you want to reload and BeBuilder will be loaded automatically.
This feature is supposed to work but i won't be held responsible for any damages it could cause.
- Make!
Open a terminal window and go to the last directory then enter "make".
Your project is done! you can run it!
With the Tools menu that is still experimental you can make and or run the project from BeBuilder V0.5.
Index