Day 010 - Getting started with RAD generation
The Configuring the analysis for RAD section is on page 90 in the tutorial. To be honest, when I first started looking at WinDev it wasn't immediately obvious to me that the product did full-on code generation based on a database definition (the analysis). This is the part of the tutorial that explains how that's done.
Step one (after creating the analysis itself, that is) is to make sure that the analysis contains optimum information for code generation. This is very much like tuning the dictionary in Clarion.
But first, a step back to the IDE. If you don't have your analysis open, how do you get there? I'm aware of two ways. One is to go to the dashboard, click on Analysis, and then on Graph. The other is to double-click on the Analysis in the project explorer. The latter option is a little less obvious (to me at least) because if the node is contracted there's really nothing to indicate that it's the analysis, unless you're really good at interpreting icons. But little by little I'm beginning to find a path through the IDE.
Â
When you open an analysis, three new menus appear on the main menu: Analysis, Structure of files and Shape.
The Analysis menu:
The Structure of files menu:
The Shape menu:
There's a tab on the data file description window for RAD properties. Among other things it lets you choose the sort order and the key, which may not be exactly the same thing (from what I can tell).Â
You can specify the key to use or you can "let the RAD choose". But you can also specify the "item" used to view the specified (or non-specified key). I'll be interested to see how that turns out.Â
I needed to prevent the automatically-created identifiers (primary keys) from being displayed, via the file properties:
And that was it for the analysis modifications.Â
Generating an app
Lesson 2.3 (page 92) is where the rubber hits the road. Generation is done via the Workshop menu:
I chose Full application RAD and then Simple RAD:
And all files:
I didn't, however, need menu items for all files:
I accepted the defaults for the next two screens and set the ? menu options as instructed by the tutorial. When I finished the wizard WinDev generated the app in a little over ten seconds, creating the following windows:
I pressed the Go button to run the application:
The tip of the day is part of the AAF (Automatic Application Features). I'm not a big fan of TOOD windows - they mostly feel intrusive. I'm trying to get some work done and this dang window keeps popping up in front of my app. So I usually turn them off, and no doubt there are lots of useful tips I miss.Â
There is however an AAF PDF which you can easily include in your apps (it's part of the ? menu options you set for generation), and this document explains some of the built-in features all WinDev desktop apps have. This is a 54 page document and it's well worth your time as it presents a number of features some of which you can choose to enable or disable in your applications, including:
- dimming of disabled windows
- keyboard shortcuts
- searching/filtering tables (browses)
- changing table columns and sort orders
- exporting tables to Word, Excel etc.,Â
- printing tables
- changing table row height
- resizing combo boxes
- user macros
- user-defined reports
- window animations
- automatic form cancellation on timeout
- scrollbar tooltips
- jumping to a specific line on a multi-line control
- displaying a calendar
- displaying a calculator
- copying, opening, and viewing images in high quality
- modifying charts
- print preview
- export to Word, Excel, HTML, PDF, XML, and email
- annotating reports
- security
- customizing window appearance with splitters
- clickable links
- currency conversion tooltip
- bug reporting
The PDF also advises the user that their desktop application can be easily converted to a web or mobile application. In fact, it says this is child's play. I'm not sure how many developers will want an advertisement of how easy and inexpensive it is (or should be) to create a mobile version of what may be a desktop-specific application with a complicated UI!
Minor quibbles aside, the AAF PDF really should be required reading for all WinDev developers. If you don't read it and your users do, I expect they'll be educating you in short order! That's an impressive list of built-in features.Â
With my detour into the AAF PDF (I love detours) I didn't get far in my code generation; I'll resume tomorrow on page 96.Â
Â
Â
Â