Winstep

Software Technologies


 Winstep Forums


Print view
Board index : Winstep Forums : General Discussion  [ 4 posts ]
Author Message
 Post subject: Battery and Calendar
PostPosted: Sun Dec 04, 2016 8:59 pm 
Offline

Joined: Thu Oct 26, 2006 10:06 pm
Posts: 89
Location: Greeneville, Tn. USA
Can the calendar and battery meter be skinned? If so, it eludes me.

_________________
Jim Dillard


Back to top
 Profile YIM 
 
 Post subject: Re: Battery and Calendar
PostPosted: Sun Dec 04, 2016 9:20 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
Yes, both can be skinned.

However, as I wrote several times here already, I've been changing a lot of stuff 'under the hood' to unify the module related code and make it a lot easier for me to add new modules.

This actually makes skinning them easier too (since any skinning option available for one module is now available for all the others as well), but only from a perspective of using something like the Winstep Theme Builder. From the perspective of someone editing the config files directly, it got worse.

This is because some of the skinning options (mainly those related to text) are now given index numbers instead of explicit names such as 'ClockDigitalFont', for instance.

My advice is to wait for the Winstep Theme Builder. I know it's been on the backburner for some time now, but the fact is that I also need it to make themes and many of the changes I made to the code actually made it easier for me to finally finish it.

Anyway, Mindy already asked me how to skin the new Calendar module, so I'm going to post here my reply to her:

###

This latest modules are actually not meant to be skinned by editing the configuration files directly, since the setting names are now more 'programming' friendly than skinner friendly. But lets try:

Bitmaps (this is the easy part):

WsCal.png - Calendar background bitmap

WsCalOverlay.png (optional) - Pasted on top of the calendar after everything has been drawn.

WsCalToday.png - Image used to highlight the 'today' day, automatically centered to the day. The actual day number is printed on top.

WsCalEvent.png - Same as above but for days with Clock Alarm events.

WsCalLeftArrow.png
WsCalRightArrow.png - Arrows for going forward and backwards in the date.

Configuration file has a .WSI extension, so, for instance, <ThemeName>.WSI. The basic settings that should be in it are:

[WORKSHELF]
CalLeftArrowXPos = 0
CalLeftArrowYPos = 0
CalRightArrowXpos = 0
CalRightArrowYpos = 0
CalShowOverlay = false
CalOverlayXpos=0
CalOverlayYpos=0

Now, see how the Weather module text settings are? Calendar text settings are all like that, they no longer have specific names, but indexes (this makes it easier for me to add new text settings and manipulate them in code):

So, for the meaning of each index in the calendar module:

01 - Date (Today)
02 - Day (Today)
03 - Weekday (Today)
04 - Month (Today)
05 - Year (Today)
06 - Month (currently selected in calendar)
07 - Year (currently selected in calendar)
08 - Month + Year (currently selected in calendar)
09 - Weekday Header
10 - Days of the Month

Now, each index has the following properties with the following default values (you do not have to specify them all, properties you do not explicitly specify in the calendar configuration file will use the default value):

CalEnabled = False
CalFont = Arial
CalFontSize = 9
CalFontBold = False
CalFontItalic = False
CalFontColor = 0
CalEffect = 0
CalEffectColor = 0
CalXpos = 0
CalYpos = 0
CalMaxWidth = 0
CalPos = 0
CalPrefix =
CalSuffix =
CalTicker = False
CalUpperCase = False
CalFieldFormat = 0
CalRows = 0
CalCols = 0
CalVSpacing = 0
CalHSpacing = 0
CalPosV = 0
CalTickerEnabled = False

So, for settings related to 'Date (Today)' which has an index of one, if you want to use that field you should add to the INI

CalEnabled01=true
CalFont01=Tahoma

and so on.

There are some new important configuration fields above for date related text settings. The value in CalFieldFormat, for instance, has the following meaning for Dates, Weekdays and Months text field types:

0: Short - 31/10/2016, F, 07
1: Medium - 31-Out-2016, Fri, Jun
2: Long - Monday, 31 October 2016, Friday, June

Also only for these field types, CalUpperCase is used to specify if the text should be forced to uppercase, e.g.; FRIDAY instead of Friday, or JAN instead of Jan.

Weekday Header (index 9) and Days of the Month (index 10) are also special, because they define text grids.

Weekday Header uses CalHSpacing09 to define the horizontal size of each weekday column, e.g.; Mon Tue Wed Thu Fri Sat Sun

Also, if you specify CalFieldFormat09 = 0 (short) in this field, what you get is M T W T F S S

Days of Month is a multi-row, multi-column field. Here you use both CalHSpacing10 for horizontal size of each column and CalVSpacing10 for vertical size of each row.

CalPosV10 is used here to specify vertical text justification: 0 - Top justified, 1 - Centered vertically, 2 - Bottom Justified.

Finally, there are three more 'auxiliary' text fields, which are used to specify different colors, font, font sizes, etc, for special days in the Days of Month grid. Since they are auxiliary, only the following settings are used:

Enabled = True
Font = Arial
FontSize = 9
FontBold = False
FontItalic = False
FontColor = 0
Effect = 0
EffectColor = 0

These have the following indexes:

11 - Today Day in the Days of the Month grid
12 - Event Days in the Days of the Month grid
13 - Days that belong to the previous and following months (i.e.; the days that normally appeared grayed out in the calendar)

So, say you want the 'Today Day' to appear in Bold instead of using the attributes specified in the Days of the Month index. You would add:

CalEnabled11 = True
CalFont11 = Arial
CalFontSize11 = 9
CalFontBold11 = True

Hope that makes sense? If you don't enable the Aux field types, those 'special' days will use whatever color, font, and font size are specified for the 'Days of the Month' grid (index 10).

One more thing. for the calendar the

CalRows = 0
CalCols = 0

attributes of each text filed are NEVER used since the calendar module will automatically specify 7 cols for the Weekday Header field and 6 rows + 7 cols for the Days of the Month field. Don't bother with them. These attributes are now used in other modules (such as the CPU meter) that allow multi-row information (such as the <x> programs using the most CPU time, etc...).

I have been changing a lot of stuff under the hood. Even the clock module now uses the above format (although it still supports ClockDigitalEnabled, etc, for backwards compatibility). This allows me to add new text fields for modules almost with a click of a button, but you won't see the true benefit until the Winstep Theme Builder is done. Then it will all come together. :)

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
 Post subject: Re: Battery and Calendar
PostPosted: Mon Dec 05, 2016 5:01 am 
Offline

Joined: Thu Oct 26, 2006 10:06 pm
Posts: 89
Location: Greeneville, Tn. USA
Thanks for the quick response. I will be patient. Until the skinning engine is done, I will try my hand at your instructions.

I assume the battery module is similarly skinned?

_________________
Jim Dillard


Back to top
 Profile YIM 
 
 Post subject: Re: Battery and Calendar
PostPosted: Mon Dec 05, 2016 8:30 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Thu Feb 26, 2004 8:30 pm
Posts: 11930
PuterDudeJim wrote:
I assume the battery module is similarly skinned?


Lol. Battery module works like a meter module (i.e.; like the CPU, Net and RAM meters) so you can use bar graphs, histograms and/or gauges with it.

Main bitmaps are

WsUPS.png
WsUPSOverlay.png (optional)

and the meter bitmap names (which are also optional) are

WsUPSGauge.png - Needle of gauge
WsUPSGaugeShadow.png ' Shadow of the needle
WsUPSb.png ' Bar bitmap
WsUPSh.png ' Histogram bitmap
WsUPSMulti.png ' Multi-state images

These work the same and have the same settings (prefixed by UPS instead, of course, e.g.; UPSShowMulti, UPSGraphEnabled, etc...) as, say, the CPU meter module.

Indexes for the text information have the following meaning:

01: Status
02: Charge
03: Runtime
04: Name
05: Serial
06: Manufacturer
07: Manufacturing Date
08: Type
09: Chemistry
10: Charge Cycles
11: Health
12: Temperature
13: Voltage

_________________
Jorge Coelho
Winstep Xtreme - Xtreme Power!
http://www.winstep.net - Winstep Software Technologies


Back to top
 Profile WWW 
 
Post new topic Reply to topic Board index : Winstep Forums : General Discussion  [ 4 posts ]
Display posts from previous:  Sort by  

Who is online

Users browsing this forum: Google [Bot] and 46 guests


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
You cannot post attachments in this forum

Search for:
Jump to:  
cron