Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 15, 2018 8:16 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Creating Aqua-Style UI-Elements
PostPosted: Sun Oct 16, 2005 3:04 pm 
Offline

Joined: Mon Oct 03, 2005 12:50 pm
Posts: 27
Location: Germany
Hi,

I'm started creating a collection of new controls for RB, but have hit a huge problem: How to create the style of Aqua-controls with Graphics-class-methods?

_________________
PowerMac Dual G5 1.8 (2.25GB) with RB2005r4


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 19, 2005 1:30 am 
Offline

Joined: Mon Oct 03, 2005 11:53 pm
Posts: 670
Location: Loves Park, IL
Why do you need\want to create Aqua-style controls? Is it for porting projects over to Windows/Linux/OS9, or is it because a particular control you need does not exist?

Wayne C. Winquist

_________________
Wayne C. Winquist

Not Wayne's World Wordpress
Not Wayne's World MySpace!
Not Wayne's World Yahoo! 360


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 19, 2005 4:44 am 
Offline

Joined: Mon Oct 03, 2005 12:50 pm
Posts: 27
Location: Germany
w2ed wrote:
Why do you need\want to create Aqua-style controls? Is it for porting projects over to Windows/Linux/OS9, or is it because a particular control you need does not exist?


The second. I dearly miss controls like a spreadsheet-grid, calendars, etc. But how to make them look like the rest of the controls?

_________________
PowerMac Dual G5 1.8 (2.25GB) with RB2005r4


Top
 Profile  
Reply with quote  
 Post subject: Not Internally
PostPosted: Wed Oct 19, 2005 6:42 am 
Offline

Joined: Fri Sep 30, 2005 11:34 pm
Posts: 11
Location: Canberra, Australia
In a number of Mac OS X applications - including those from Apple - custom UI elements are created externally at design time using a bitmap editor, saved as either TIFFs or PNGs, and then included in the application at build time as the face of a custom control class.

Based on this, your best bet is probably to do the same: create the 'face' of your controls using a bitmap editor, save them in a format that REALbasic recognises, and then incorporate the images into your custom control code.

_________________
com.realsoftware.forums.digitaleon
I don't work for REAL Software, I just use their products...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 19, 2005 7:23 am 
Offline

Joined: Fri Sep 30, 2005 8:33 am
Posts: 103
Location: Houston, TX
digitaleon,

While I agree with most of what you are saying, I do thin there are areas where the Apple controls are being generated on-the-fly without relying on bitmaps.

For example I recently created an almost dead on replica of the search bar that Spotlight (and iTunes too) that allows you to select what you are searching for.

I used a canvas and a gradient drawing class that I wrote a very long time ago.

Anyway my point is, it is possible to create controls that look like they are using bitmaps but without relying on them. My preference is to go this route whenever possible, I feel it make the component more "flexable".

Cheers!

Kev

_________________
Beware Geeks bearing GIFs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 19, 2005 7:46 am 
Offline

Joined: Fri Sep 30, 2005 4:28 pm
Posts: 21
Location: Parma, Italy
SerKevin wrote:
Anyway my point is, it is possible to create controls that look like they are using bitmaps but without relying on them. My preference is to go this route whenever possible, I feel it make the component more "flexable".


Do you mean a sort of user skinnable GUI?

_________________
[sniper] - Darkworks Software CEO
mail : sniper@darkworks.it
Skype : lord.sniper

Darkworks Software
http://www.darkworks.it/
mail : contacts@darkworks.it


Top
 Profile  
Reply with quote  
 Post subject: Agreed 100%
PostPosted: Wed Oct 19, 2005 7:56 am 
Offline

Joined: Fri Sep 30, 2005 11:34 pm
Posts: 11
Location: Canberra, Australia
SerKevin wrote:
Anyway my point is, it is possible to create controls that look like they are using bitmaps but without relying on them. My preference is to go this route whenever possible, I feel it make the component more "flexable".

Agreed 100%. I'm hoping that in the future vector-based and/or shape-based controls will be the standard (this is the direction that Windows is moving in, as are KDE, GNOME and other platform-neutral desktop environments).

Duplicating the Aqua look-n'-feel should be entirely possible using the Graphics class, although it would not be a small task to accomplish to clone something like a PushButton. I was thinking of the kinds of custom controls like DVD Player has when I replied before which are very aesthetic and very functional, but alas, are also very bitmap. Interestingly, they're also PICT format, rather than TIFF or PNG like in most bundles.

_________________
com.realsoftware.forums.digitaleon
I don't work for REAL Software, I just use their products...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 19, 2005 8:31 am 
Offline

Joined: Fri Sep 30, 2005 8:33 am
Posts: 103
Location: Houston, TX
@digitaleon - Hmmm, I didn't know those controls were picts... learn something new every day.

@Azzolini - Well I guess that is one ability if everything is draw on-the-fly. For example the user colud be allowed to set the starting and ending color for the gradient, for example. However in almost all cases this in bad UI design.

I meant more from a reusablility and maintenance standpoint. If I want to add another control with say different text or the colors change slightly then I don't have to go to the trouble of creating more bitmaps (in Photoshop for example) and swaping them out in the project. I simply change properties on my controls and them are redrawn with the new look-feel which is a lot less trouble for me.

If you are worried about speed you can always have your controls "spin-up" the graphics when it opens and cache them for use later.

Cheers!

Kev

_________________
Beware Geeks bearing GIFs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 12:09 am 
Offline

Joined: Mon Oct 03, 2005 11:53 pm
Posts: 670
Location: Loves Park, IL
I have to agree with SerKevin on having them generated on-the-fly without relying on bitmaps. It makes it more portable should you need to use that class again: just copy and paste the class as opposed to the class and all of its connecting files. (That's how I am doing the paletteTab controls I am working on, since I can think of a few other uses for them.)

A few thoughts to keep in mind, however. First, how complex is your graphic going to be? It would be optimal to do it without any external graphics, but the programming to keep it right and consistent could come back to bite you, thus making it faster to do it with externals instead.

Second, do you even need to create a class for it? Could it be possible to do it with a few declare statements, or has there been a plug-in/class already developed for this? Sometimes someone elkse has thought what you thought. (I'll assume this is a no, or that you can't , as I can't either.)

Finally, once you get past the drawing part, there's the functionality stuff - is it going to work like a field or button? Will people be able to type or draw on it? How it's going to work is just as important.

To help you get started, Resexcellence has a couple of good articles on custom control creation worth checking out.

Hope this helps. :)

Wayne C. Winquist

_________________
Wayne C. Winquist

Not Wayne's World Wordpress
Not Wayne's World MySpace!
Not Wayne's World Yahoo! 360


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 6:59 am 
Offline

Joined: Fri Sep 30, 2005 4:28 pm
Posts: 21
Location: Parma, Italy
A very cool feature of a future RB version will be the ability to export project folders as one file "packages" (maybe VirtualVolume based).

I think it will simplify developers life a lot, so our custom controls, classes, and code may be distributed with all needed resources (Text, Pictures, Sounds, etc.) as a single file that users can install with the semplicity of a drag'n'drop.

Think, no more "Where is this external item?" dialogs.

Thoughts?

_________________
[sniper] - Darkworks Software CEO
mail : sniper@darkworks.it
Skype : lord.sniper

Darkworks Software
http://www.darkworks.it/
mail : contacts@darkworks.it


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 9:54 am 
Offline
User avatar

Joined: Mon Oct 03, 2005 5:33 pm
Posts: 464
Quote:
Agreed 100%. I'm hoping that in the future vector-based and/or shape-based controls will be the standard (this is the direction that Windows is moving in, as are KDE, GNOME and other platform-neutral desktop environments).


I always thought it was goofy that Apple didn't do this when they moved to OS X in the first place, considering they had:

1) PDF (a great vector format) support built right into the OS, and
2) had to redraw all the icons anyway.

Because of their short-sightedness, you can't open a window with picture previews larger than 128x128, and you can't make the (teeny-weeny) mouse cursor larger without turning it into a pixellated mess. Shame, Apple. Especially since I could do both of those things in Windows XP. (Filmstrip view in Explorer is the best thing ever... sometimes I mount my Mac documents folder over the network just so I can use filmstrip view to organize images.)

Image
Megamouse is half as big, but twice as ugly, as Godzilla.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 10:11 am 
Offline

Joined: Fri Sep 30, 2005 4:28 pm
Posts: 21
Location: Parma, Italy
Apple is already working on Scalable UI, read this :

http://www.interact-sw.co.uk/iangblog/2 ... resolution

_________________
[sniper] - Darkworks Software CEO
mail : sniper@darkworks.it
Skype : lord.sniper

Darkworks Software
http://www.darkworks.it/
mail : contacts@darkworks.it


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 10:56 am 
Offline
User avatar

Joined: Mon Oct 03, 2005 5:33 pm
Posts: 464
Azzolini Stefano wrote:
Apple is already working on Scalable UI, read this :

http://www.interact-sw.co.uk/iangblog/2 ... resolution


I know. Windows Vista will have it, also (or at least support for it), and I'm sure Linux will be following right along 3-4 years from now like they always are.

But my point is this: Why didn't Apple do it right in the first place when they made OS X? It would have saved tons of effort if they didn't *have* to do anything now because it'd already been done.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2005 10:53 pm 
Offline

Joined: Mon Oct 03, 2005 11:53 pm
Posts: 670
Location: Loves Park, IL
Hindsight is always 20/20, Blakey. Look at the type of computers out when OS X was first introduced - if I recall correctly, they had either just started the G4 desktops, or were still on the G3's. They probably felt that it was too much too soon.

(Either that, or I shudder the possibilities of what they were thinking... :P

Wayne C. Winquist

_________________
Wayne C. Winquist

Not Wayne's World Wordpress
Not Wayne's World MySpace!
Not Wayne's World Yahoo! 360


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 21, 2005 10:09 am 
Offline
User avatar

Joined: Mon Oct 03, 2005 5:33 pm
Posts: 464
w2ed wrote:
Hindsight is always 20/20, Blakey. Look at the type of computers out when OS X was first introduced - if I recall correctly, they had either just started the G4 desktops, or were still on the G3's. They probably felt that it was too much too soon.

(Either that, or I shudder the possibilities of what they were thinking... :P

Wayne C. Winquist


This should have been tops on Apple's list the day they moved off the 72 dpi monitors they'd been using before. I'm sorry, but there's no way that something that's obvious to me wasn't obvious to the entire group of people who develop for OS X. They used bitmaps for one reason, and one reason alone: they wanted to get it done quicker.

That said, though, you're right that the problem wasn't *as* apparent back when OS X was new as it is now, with the 12" laptops with the ridiculous 220dpi 1450x800 displays, or whatever they are.

Oh well, in 2 years, OS X.5 will be out, Vista will be out, and hopefully I'll be able to *read text on my computer* again. Now we just need to get those "artsy" websites to stop using font size 5 and we'll be set.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group