BIF3
[ class tree: BIF3 ] [ index: BIF3 ] [ all elements ]
Prev Next
Changing the look

So, form time to time, we cut our hair, we change clothes, we get uglier, etc. We change our look, just like a BIF application.! All BIF applications implement skins.

For the anxious, let's go straight to the point. In your application directory, change skins.txt
#  file 'skins.txt': User configuration file
#  ----------------------------------------------
#  
#  This file has skins configuration.
#  They are listed in order to be included.
#  must exist either
#      "$sys_dir/Skins/$skin.php" 
#  or
#      "$app_dir/Skins/$skin.php" 
SkinDefault
SkinAeolus

Now, our aplication should look diferent.

It's a very common mistake to delete 'SkinDefault' line, and will give an error like "Can't file template file", it's necesary to have both lines.

We could use several skins at once, even this is not so common in most skinable applications, is very common in humans with their clothes.

Humans when they wear clothes have a special order to put them on, the final look will be based in that order. Why your underwear isn't visible? because you put your pants AFTER your underwear. Your coat won't let your shirt visible.

For this example, our skins.txt will be:
#  file 'skins.txt': User configuration file
#  ----------------------------------------------
#  
#  This file has skins configuration.
#  They are listed in order to be included.
#  must exist either
#      "$sys_dir/Skins/$skin.php" 
#  or
#      "$app_dir/Skins/$skin.php" 
SkinUnderwear
SkinPants
SkinTShirt
SkinCoat

Your SkinPants won't cover ALL the application, just the lower part, for example. Suppose you have a LowerPart Widget. If you wan't to change the look of that widget: create a file named lowerpart.tpl and place it in the right directory.

The natural next question is: Which is the 'right directory'? the skin directory!: for SkinPants will be Skins/Pants/ either in your application or system directory (make sure Skins/SkinPants.php exists!)

if Skins/Pants/lowerpart.tpl and Skins/Underwear/lowerpart.tpl exist, will be used for drawing LowerPart widget. Remember we talk about the order.

But UpperPart widget isn't covered by neither SkinUnderwear or SkinPants. That's why we need SkinTShirt also.

Back to a more realistic scenario, all BIF3 widgets representation are in SkinDefault skin. That's if we were using TitleBox widget, we need that skin. Usally, we have also a SkinMyApplication skin for application-specific widgets. And also if a costumer asks for special esthetic changes, we could have a SkinSpecialCostumer with VERY few widget's template. Without changing the SkinMyApplication for all other costumers.

Just to get things a little more clear, skins.txt will look like -order is important-:
#  file 'skins.txt': User configuration file
#  ----------------------------------------------
#  
#  This file has skins configuration.
#  They are listed in order to be included.
#  must exist either
#      "$sys_dir/Skins/$skin.php" 
#  or
#      "$app_dir/Skins/$skin.php" 
SkinDefault
SkinMyApplication
SkinSpecialCostumer

Conclusion:

Stack-able skins let us have multiple looks from the same application without changing the hole skin: just the widgets we're interested. This minimize maintenance, making programmers happier because is less work! Besides, in a large project, we could start using a simple skin for prototyping and, after, the graphical designer completes all widgets.

Prev   Next
Documentator's help Creating More Widgets

Documentation generated on Wed, 10 Nov 2004 19:41:18 -0300 by phpDocumentor 1.2.3