Switcher

From TrillWiki

Jump to: navigation, search


Switchers are controls that "switch" images based on certain conditions. For instance, a "medium switcher" changes what image is displayed depending on the medium of the current window. An extension of this concept is animated GIF files. The animation loads a series of images into the switcher, which "switches" the images based on time. (This is all done internally, so you don't have to define each fram individually.

Contents

[edit] Code

<control name="<name>" type="switcher">
<background name="[name]" type="[type]">
<source name="[ bitmap name ]" left="0" right="0" top="0" bottom="0"/>
<rect>
<left num="0" width="0"/>
<right num="0" width="1"/>
<top num="0" height="0"/>
<bottom num="0" height="1"/>
</rect>
</background>
<cursor type="[type]"/>
</control>

[edit] ON/OFF Switcher

For an on/off switcher, the background name will be "on" or "off".

[edit] Buddy Icon

For a buddy icon, do not include anything between the <control> tags at all, it is an empty control.

[edit] Status Button Switcher

For a status button switcher, the background name will be "connected", "disconnected", "partially connected" or "away" - you will have to copy all the <background> code 4 times, 1 for each state.

Used for a little icon on the status button icontrol. This control is referenced within the button control of the status button, as an IControl, with a name of "icon"

[edit] Transfer Status Switcher (3.0)

Trillian 3.0 introduced a new switcher to the file transfer windows.

  • name="status_image"
  • types include: pending, complete, error, transferring

(Note: status_image was found in the talk.dll and Kevin gave us the above information. As far as we know, noone's tried it yet.)

[edit] Medium Switcher

The medium switcher is used in the message, channel, Console, and file transfer windows. It is used so that you only have to design one window, for each purpose, instead of 5 (one for each medium). It works by defining an area (the IControl ), and then selecting the appropriate image from the medium switcher control.

The <background> bit will have to be repeated at least 5 or 10 times because of continuing improvement of the skinning language. In previous versions of Trillian, the name="" properties were 0,1,2,3,4 but now they are IRC, AIM etc. The numbers are used for all windows except xfers(which use the names). The numbers will be phased out in the future, but in .7x are required for most windows. With 1.0, the numbers are no longer necessary, and in fact are not recommended in 2.0 with medium plugins.

As of Trillian 2.0 the code got a lot more complex. The medium switcher now supports medium statuses as well in the "type" attribute of the <background> code. See the contact list for a reference on the states used.

Window Type Version <background name="">
IRC AIM ICQ MSN YAHOO! 2.0+ Medium Plugin
Messages, Channels, Consoles (connections) 0.7x 0 1 2 3 4
Messages, Channels, Consoles (connections) 2.0+ IRC AIM ICQ MSN YAHOO MediumName
Transfers all versions IRC AIM ICQ MSN YAHOO MediumName

[edit] Taskbar Icon Switcher

For a taskbar icon switcher, the background names are as follows:

  • aim-flat
  • aim-over
  • aim-push
  • aim-disabled
  • icq-flat
  • icq-over
  • icq-push
  • icq-disabled
  • irc-flat
  • irc-over
  • irc-push
  • irc-disabled
  • msn-flat
  • msn-over
  • msn-push
  • msn-disabled
  • yahoo-flat
  • yahoo-over
  • yahoo-push
  • yahoo-disabled


Cursor type will be one of the ones listed at the the bottom of the button page. (as stated there, it does not do anything, so leave it out).

MainRegion code can be used.

[edit] Animations

2.0+ allows animations to be used in switchers. Just add the GIF file (currently only animated GIF support exists) as you would normally, and use it in the <source> tags as normal. In fact, the only change is in the graphics, the code does not change at all.

Personal tools