|
- Forum
- iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1054 |
Background colour for labels and buttons? |
le 13/01/2005 @ 06:21 par Leonard Zajaczkowski

|
Hello.
Is there a way to change the background colour of the labels and buttons directly in izibasic. Or, indirectly, by using the Rsrc editor?
I've tried the colour commands but they only affect the graphic commands like boxfilled, etc... |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 13/01/2005 @ 10:49 par aldweb

visiteur |
Leonard,
I never tried to do it, so I don't even know if there is an option in Palm OS to do it for each single object. Do you want to do it for a few objects (like changing from red to green according to some values)? Or for all objects? => Why not use a theme manager then?
Cheers
@+ aldweb |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 13/01/2005 @ 22:11 par Leonard Zajaczkowski

visiteur |
Actually, I just wanted to change some of the background colours for the labels. The reason being, when you put a label over top of a filled object, or a full screen image, a white box surrounds the label starting from the initial position all the way to the right edge of the screen. Looks ugly, mabye there is a way of turning on transparency? |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 13/01/2005 @ 22:19 par aldweb

visiteur |
Leonard,
Even though I did not test it myself in this case, so I give no garantee to my answer, maybe give a try to GPRINT instead of LABEL.
Cheers
@+ aldweb |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 13/01/2005 @ 23:49 par Leonard Zajaczkowski

visiteur |
Gprint is a new command, I'm still looking at the 3.1 document; I'll have to print the 4.0 document now.
Unfortunately, gprint also has a white box around it, but it does not go all the way to the right edge. |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 5 -------- le 14/01/2005 @ 13:15 par aldweb

visiteur |
Then, Leonard, sorry but I think there is no solution at this stage but to use a "PP applet".
The difficulty with iziBasic is to provide a language syntax which is KISS (Keep It Small and Simple). This means that I am trying to make it easy and quick to use, not too much filled with parameter options for all statements, answering most common needs. And at the same time, I cannot put in iziBasic all the flexibility of an access to the whole Palm APIs. This is why the "PP applets" were made.
I take good note of your request and add it to my wish list, to study it and eventually put it in my to do list.
Cheers
@+ aldweb |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 6 -------- le 14/01/2005 @ 15:50 par aldweb

visiteur |
Hello again Leonard,
As I can imagine that writing PP applets is not easy when doing it for the first time, I designed this one for you 
Here is the result:

Here is the iziBasic source code:

And here is the PP applet source code:

Be careful that there is no check for valid conditions in this source code. For instance, it only runs if Palm OS >=3.5 and you should send valid values for colors...
Isn't it much easier to develop in iziBasic? 
Cheers
@+ aldweb |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 7 -------- le 14/01/2005 @ 17:03 par Leonard Zajaczkowski

visiteur |
Thank you for the code and you're right, it would take me a while to learn enough pascal to produce this kind of code. For now, I'm going to stick with izibasic and learn what I can do with its code.
There are ways to get around bumps, I just used gprint and put a frame around the white box to make it look nice. |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 8 -------- le 15/01/2005 @ 03:52 par Montalvo

visiteur |
This is how I do it:
* In your favorite paint program, create an image of 160 x 14 pixels, fill it with your choice of background color. * Select a non-antialiased font, of the color of your choice, and type the label. I use TREBUCHET and it looks very nice. * Remember to set de BPP to 8 bits * Create the resource and include it in the sourcecode of your application. * Simply use the IMAGE command to set the custom-color "label" on the correct position.
In this way, you will not depend on create the PP applet, and you can use the FONT of your choice (any font of our PC).
|
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 9 -------- le 15/01/2005 @ 05:24 par Leonard Zajaczkowski

visiteur |
Hello Montalvo.
That is a good idea for a static label, but I need to update the label during the program run. So, unless I make a completely new font it will not work. However, I will remember this trick, it may come in handy. |
|
 |
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 10 -------- le 18/01/2005 @ 20:51 par aldweb

visiteur |
Leonard,
I am very sure that you will be happy to see the following iziBasic source code:
' ColorText.ibas {CREATORID "LDTE"} {VERSION "1.0"}
BEGIN C=COLORRGB(0,0,204) D=COLORRGB(255,153,51) GPRINT "Hello in Color",55,70,C,D W=WAITEVENT END
I have extended the GPRINT command to work both with a front color and a back color. This will be made available in version 4.2 of iziBasic to be released in a few days 
Cheers
@+ aldweb |
|
 |
 sujet actif
 sujet clos
 Important!
 Nouveau message -
 Rectifier message
 Clôturer sujet
 Remonter
|
|