April 18, 2014

Borland's Kylix: turbocharging Linux development - page 2

Not Your Father's TurboPascal

  • April 9, 2001
  • By Scott Courtney

Kylix is a screen space pig, as are all the other integrated development environments I've ever seen. It starts up with a main menu/tool bar that contains all the usual features: file and project operations, clipboard control, tool and environment settings, compile and debug functions, and so forth. There is also an object properties dialog, a graphical form editor (for GUI layouts) and a source code browser that is linked to the object class tree. There is a lot of information presented, and it is very well organized, so I'm not really criticizing Borland for taking up a lot of real estate on the monitor -- but you should be aware that this is not a tool you'll want to use on a display smaller than 1024x768.

The menus and toolbars are extremely customizable, and many of the window sub- panes can be docked together or floated independently. I intentionally avoided changing many of the default settings so that the screenshots with this review would be more typical, but rest assured there are a lot of virtual knobs to twiddle and levers to pull in the Kylix user interface. The widgets, both in Kylix itself and in the runtime application environment, are mature and solid, working as expected without the anomolies and annoyances that I have sometimes seen under older X11 environments. Kylix is a very polished tool, and except for the errrors mentioned previously the GUI development environment worked quite well for me.

Kylix is geared toward a "project" mentality, as are most IDEs, but the project management dialogs stay mostly out of the way during the coding process. I was pleased to see that my coding efforts were integrated smoothly into Kylix's own project repositories; for example, one UI form that I created became available for re-use without any action on my part. To make objects globally reusable requires a few clicks on a menu, but is not at all difficult. The only negative comment I have for the project management functions was that it was unclear, at least to me, how the visible IDE popups related to the underlying source code and resource files. When I clicked on "File...Save" from the IDE menu, I was not always sure which file I was saving, and where. There is a "File...SaveAll" function which is sometimes enabled and sometimes not, and again I could not fathom what determined this option's status. Likewise, the "File...Reopen" list includes both individual files and entire projects, and it was not clear to me the implication of re-opening a previous code file from within a different project. Probably this is all documented somewhere, but it was not intuitively obvious.

A new project is started with one empty form onto which you can drop various visible and non-visible GUI components. These automatically become declared objects within the form itself, and the main form is in turn an instance of the TForm object class. With a modern IDE, it is generally possible to create a displayable but non-functional (stubbed) prototype of the application's user interface without writing any code, and Kylix is no exception. The GUI control widget set is quite extensive, and Kylix goes beyond simple widgets to include entire pre-defined dialogs. These components are numerous and include things like password entry as well as dual-lists, in which items can be moved by the user from a pool of options (on the left) to and from a list of selected items (on the right). You can add your own commonly-needed dialogs and forms to the Kylix repository as well.

Learning to Fly (And To Fall Down)

Borland provides a tutorial guidebook that guides new users through the entire process of creating a working text editor application in Kylix. Naturally enough, and like any true geek, I totally ignored the tutorial and dove into writing some code in a project I called MyApplication. With the amazing speed that comes only from a sophisticated rapid development environment, I was soon flying along at Mach 3. Unfortunately, I was also in a tailspin headed directly for the nearest mountain range. The good news was that I got to see what Kylix does when your application generates a segfault (something that is supposed to be impossible in Pascal). Kylix handled it gracefully, showing a detailed hex dump which I didn't bother to analyze, and I instead fixed the bad object reference in my code. In about an hour I realized that this ad-hoc coding approach was getting me nothing but frustration. With a sigh of resignation, I opened the tutorial.

The tutorial spends about a dozen pages explaining the various aspects of Kylix's own user interface. It's painful to wade through all this when you really want to be crunching out Pascal code, but they are right to force the issue. Kylix is a very deep and mature IDE, with a lot of subtle features that are not obvious at first glance. For example, just about anything in your code is really a hyperlink to the online manuals. You simply hold down the Control key while clicking with the left mouse button to bring up the relevant section of the reference manuals for the class libraries or Pascal language. The links are only visible when the Control key is pressed, though, so without the tutorial I never would have known about this useful feature. The online help also contains code examples, though these seem mostly to be trivial code fragments.

Users of other IDEs, such as IBM's VisualAge for Java, will have no trouble using the GUI designer. Widgets such as pushbuttons, text fields (Borland calls them "Memo" fields), scrollbars, dropdown lists, and so forth are provided on the main Kylix menu, under a series of tabbed sections. Most of these are intuitively clear, but it was not obvious to me the difference between "Standard", "Additional", and "Common Controls." After a little time in Kylix, though, I had memorized a few of these and I think the rest would fall into place with a little more practice.

The process of placing and editing widgets is very intuitive, especially if you have used another IDE before. The Object Properties dialog is continuously visible (to the left of the screen) and allows one to set the static properties of the widgets. These include things like the caption (label), alignment, height and width (which can also be done graphically), cursor override, and so forth. Wherever a static property of one object needed to contain a reference to another (previously defined) object, the properties dialog offers a helpful drop-down selection list of all objects that are suitable in type. For those that are text or integer constants, the change can be made directly in the properties table.

Sitemap | Contact Us