| |||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||
Print This Article REALbasic University: Column 068
Review: REALbasic 4.5 (Part 2)Last time I started reviewing REALbasic 4.5, and quickly discovered there's just too much stuff to cover in one column. After exploring some of the smaller innovations of 4.5, today we're going to look at some of the major new features added.
Major New FeaturesI've been using RB 4.5 for a few weeks now and the most amazing thing is that there are so many new features I haven't even gotten to try them all yet!
Vector GraphicsAfter a couple of weeks with the new version I was exploring the online help one day and saw something about vector graphics. I'd forgotten all about this incredible feature. If you're not familiar with graphics terminology, there are two primary types of computer graphics: bitmap and vector. Bitmap graphics are the type most of us are used to and consist of pictures where every dot in the draw is specified pixel-by-pixel. A program like Adobe Photoshop, for instance, is designed to let you edit the individual pixels of a photo. The problem with bitmap graphics is that enlarging the graphic reduces the quality. If you've got a drawing that's exactly 205 pixels by 117 pixels, where do the extra pixels come from when you stretch it to 300 pixels wide? The answer is that the computer, via an algorithm (a formula), fabricates those extra pixels. That's what causes those infamous "jaggies" you see in some digital photos. Sometimes it doesn't look too bad. Sometimes it's horrible. It all depends on the amount of enlargement, the amount of detail in the picture, and the quality of the enlargement algorithm. Vector graphics, however, don't suffer from enlargement problems. Vector graphics are mathematical formulas for how a graphic should look. For instance, a rectangle starts here and is this wide and this tall. If the computer knows how to draw the shape of a rectangle, it can draw it at any size we want and it will always look sharp and clear. Of course vector graphics aren't just limited to rectangle or even basic shapes like circles. By using curved lines -- and recording the angles of those curves precisely -- we can regenerate complex drawings at any size with no loss of quality. Take a look at the results of this simple vector demo program I wrote: ![]() ![]() ![]() Note that the shape of the curve remains constant at every zoom level. REALbasic's implementation of vector graphics is quite powerful. There's a built-in scaling command (that's what I used in the above demo), as well as a rotation feature (also part of the demo). If you'd like to try out this demo, you can grab the project file here (keep in mind this requires REALbasic 4.5 to function). Of course I'm just barely touching the surface here on the capabilities of vector graphics. There are several different kinds (classes) of vector objects we can draw, including stringShape (text) and pixmapShape (bitmap). That means, yes, you can draw text and photos and REALbasic will zoom/rotate them for you! You can also group several drawn objects together and operate on them as one command (zoom or rotate). That's just like the "group" command in many drawing programs. For more on vector graphics, read RB's online help on the subject: ![]() REALbasic's new vector graphics give you the power to write your own Adobe Illustrator clone, if you wish. There are even a couple new methods added to the folderItem object that let you read/write a vector graphic picture!
New ListBox FeaturesOne item that's been improving with each REALbasic release is the powerful ListBox control, and in 4.5 it gains two very handy new features. Those are drag-to-reorder rows and resizable columns. Both of these were achievable via custom class workarounds, but it's much better to have the features part of the standard control. You enable both of these features via checkboxes on the listBox Properties palette: ![]() That's all you have to do! Now your listBox will automatically let the user resize the columns: ![]() and drag the rows around: ![]() Totally sweet. You can see that REAL Software added a couple new events to the listBox control (the background window is an RB 4.0 screenshot): ![]() Of particular importance is the DragReorderRows event, which gets fired whenever the user changes the order of the rows. If you return true in that event, REALbasic won't automatically rearrange the rows (you have to do it yourself). If you have a hierarchal listBox (with folders, like a Finder list) that's your only choice: RB won't do it for you (I have no idea why). Well, that's it for this column. Next we'll continue by looking at some more big improvements in RB 4.5. If you would like the complete REALbasic project file for this week's tutorial (including resources), you may download it here.
Next WeekWe continue covering more of RB 4.5's major new features.
NewsREAL Software has replaced their "REALbugs" application with a new online bug database. This system is searchable, so if you experience a problem with REALbasic you think might be a bug, search for it online first to make sure no one else has already reported the problem. If it's a new bug, you can complete a form to add the bug to the database. This is a much requested feature and REAL Software has been working hard to implement this for a long time. It will make fixing problems with REALbasic faster, so be sure to take advantage of this.
LettersThis week we've got an interesting letter from Robby, who's just starting out with REALbasic. He's got an excellent question: where to start?
Thanks for the great letter, Robby! I would say you are the ideal kind of person to use REALbasic. You're not a programmer, but you need a custom program because the existing software doesn't do what you want. Countless people -- myself included -- fell into programming in this same manner. Next, let me give you some encouragement and discouragement. First the encouragement. I urge you to purchase a license to REALbasic -- $100 for the Standard version is all you need for now (actually less than the cost of Now Up-to-Date & Contact!) -- and begin working on this project. You'll find the payoff will be enormous: you'll learn volumes, not just about programming, but about creating. If you eventually share your creation with the world, you'll make friends all over the globe and possibly bring in some decent spending money (you probably won't get rich, though anything's possible). Most likely this first project will lead to others, perhaps new kinds of software unique to your experience as a salesperson. Now for the discouragement. Programming of any kind, even scripting in AppleScript or for the web, is complicated work. An environment like REALbasic makes it far easier than in days past, but RB isn't going to magically do what you want. Writing a contact management program won't be easy: it will take dedication and many hours of your time. Especially if you have no background in programming, you'll have to learn a lot about basic techniques in addition to the specifics of REALbasic. Just how badly do you want to do this? I don't want to deceive you. Such a project could take anywhere from a few weeks to a few years of effort. However, if you're game, and willing to invest your time, REALbasic is the perfect environment for such a project. That said, let's assume you want to do this. How do you go about it? First, go ahead and purchase a license. A thirty-day trial is good just to see what RB can do, but it's not enough time to write your first project from scratch. For now, just get the Standard license. You can always upgrade later to the Pro version if you need database capabilities (which, considering your project, I'd recommend). The Standard version lets you test the database capabilities but limits you to 50 records. That should be enough to test your program and make sure it's working. Second, read through the entire REALbasic University archives: today's lesson is our 68th so there's a huge amount of material there for you to explore. Just like the books out there, some of the older material is geared toward older versions of RB, but most of the basics are valid. (In fact, the most common thing you'll find is that limitations and problems with older versions of RB are no longer applicable.) Buy one of the books -- I recommend you look through them first, to make sure you get one that both has the basic info you need and has an approach you can appreciate. Finally, in blatant (but genuine) self-promotion, I'd recommend a subscription to my own REALbasic Developer magazine. Third, programming is 80% planning and design. If you've got a good vision for what you want the software to do and how it should work (especially what makes it unique), you're halfway there. Don't worry too much (especially early on) about the minor technical details -- those can always be solved. When I first got started with REALbasic I would spend a whole Saturday trying to get one feature working. I didn't know what I was doing so I'd just dive in a try something. It wouldn't work, so I'd try something else. Eventually I managed to get something functioning, but years later the way I'd programmed that feature (badly) caused me headaches. Eventually it all had to be ripped out and rewritten properly. Later, I realized I had been focusing on the wrong thing, worrying about the coding of one minor feature when I should have done my research first. If I had checked around on the 'net for sample code or read a book on algorithms I might have discovered someone else had already solved my problem or learned how to write the first right from the start. Finally, let me offer a suggestion for you. Your contact management program might be too much of a project for you to attempt as your first REALbasic application. You could try writing a simpler version first, just to get you started and test out your ideas. Another approach is this: why not find a more experienced REALbasic programmer and offer to collaborate? You'd have the concept and the vision, the other the RB expertise. This would most likely mean you'd have to go the shareware route and sell your program so you could split the profits with your partner, though I have heard of arrangements where you simply pay a partner to help you. With a partner you're not on your own, you can share ideas and brainstorm, the work goes faster with the two of you doing it, and if either of you get stuck on something, the other is there to bail the other one out. Plus you get the benefit of learning REALbasic without the stress of walking a tightrope by yourself! If you go with a partner, go carefully: make sure it's someone you can get along with, that they are willing to put in the same time commitment as yourself, and though it hopefully wouldn't be an issue, if you're really serious, it might be worth having a lawyer draw up an agreement of some kind. You wouldn't want the other guy stealing your ideas and marketing them on his own. How do you find a partner? Well, you could ask around on the REALbasic mailing list. You could also put in a Classified Ad in REALbasic Developer magazine. About the Column REALbasic University is a weekly instructional column on programming with REALbasic and is brought to you by REALbasic Developer, the magazine for REALbasic programmers. Each week we answer select reader questions, and we're always open to ideas for future columns. Send your questions to . (Keep your questions simple and specific. General queries like "How do I write my own web browser?" will be neglected.) Your question won't be answered immediately, but will be answered in a future column. (If you don't want your correspondence published, just be sure to indicate that when you write. Otherwise it's fair game.) About the Author See the REALbasic University Archives
REALbasic University contents ©2001-2004 by Marc Zeedar and REALbasic Developer. All Rights Reserved.
|
. |
| |||||||||||||||||||||||||