Day 001 - Learning about windows
Day 1! Now, what the heck do I do?
Well, there is a tutorial. A dead tree tutorial. As nice as that is for bathroom reading, it's pretty inconvenient trying to keep a perfect-bound book open on my desk.Â
Happily, a PDF of the tutorial is included with the install. On page 19 I read the following:
This course was designed so you can approach it in two different ways:
- Â either you follow all the detailed exercises in each lesson (recommended method)
- or, if you are in a hurry and already experienced, you can read through it without doing the exercises, as all the exercises have screen shots. However, in order to quickly assimilate the main concepts, we recommend that you follow the course step by step.Â
I'll give the tutorial a go, although by nature I'm a bit impatient with these kinds of things.
Tutorial: Discovering WinDev
Some very basic stuff here. Definition of an application, a project (what in C7 and later Clarion devs call a solution). Which raises the question of how you organize really large apps in WinDev.Â
Analysis, skins and style sheets
Really key word in WinDev. The analysis is the data dictionary, and (although not mentioned in this part of the tutorial) can be shared among projects.Â
Skins are also mentioned as a key concept - the skin controls the appearance of the application. And style sheets. I'm familiar with CSS and I can see how this would be key to web apps, but this is a WinDev tutorial so it will be interesting to see how style sheets come into play.Â
My_First_Windows
My_First_Windows is the first tutorial sample project. The tutorial tells me I'm going to create a few windows and some basic controls.Â
First up, a counter window which displays a spin box. From the tutorial:
You may think this is too basic, too simple, but we recommend you build this window nevertheless.Â
Darn right. Oh well. Here we go.Â
Step 1: click the New icon in the toolbar.
Okay, here's the first thing you need to know about the IDE: it's busy. Here's a partial screen shot of the toolbar:
And here's the New icon:
Â
The second thing you need to know about the IDE
Our ten year old daughter just came in to the office to say goodbye before she left for school. The monitor with the WinDev IDE caught her attention.
"That is soooo cool! What is that?"
"It's WinDev."
"I love it!"
Â
If you click right on the icon instead of choosing an item from the drop list you get what for lack of a better term I'll call the  "New" wheel:
Â
(Daughter again: "WinDev - it's even cooler now!)
Hovering over the Window button brings up a sub-wheel:
(Daughter is off to school, sorry.)
I choose Window, and from the following screen I accept the defaults.
That results in this window being created:
Actually I've resized it a little.Â
Right-clicking on the window brings up the WinDev equivalent of a properties pad:
The tutorial makes note of the WIN_ prefix on the default window name. This is due to the use of a programming charter, which prepends standard prefixes to generated labels. You can use a standard charter, you can use your own charter, or you can avoid using charters entirely. Peter Holemans is one who found problems with charters in certain situations.
Following instructions I modified the name adn description and then saved the window, which gets stored as a .wdw file. Out of curiosity I opened the file in Notepad and found it contained binary data. So no mucking about with the wdw directly.Â
Interestingly, placing a control isn't a drag/drop affair from a toolbox as with most IDEs; instead you choose a control from the menu then click where you want it to go (C6 style).Â
Here's the control on the window:
You can bring up the control properties either by right-clicking and choosing Description or by double-clicking.Â
Using the properties I changed the control name and set the initial value as specified.Â
All of this resulted in two warnings and two errors (the errors were predicted by the tutorial). Note that at no time did I do an explicit compile - these errors were automatically reported by the IDE, which I assume did a compile when I saved the window.Â
The solution to the errors is easy, as explained in the tutorial. They are caused by my renaming the control. Simply right-click on either of the errors and choose Rename all the references. Easy peasy.Â
That's as far as I got in my first hour, in no small part due to the time it takes to write up my observations. But as is always the case, trying to explain what I'm learning helps me learn as well.Â
Just for fun I pressed the Go button and in fact did get a working program that displayed the window and let me change the field values using the spin bar. More on this window tomorrow...Â
Â