Konfabulator widget released - version 0.91
-
- New Member
- Posts: 9
- Joined: Mon Aug 08, 2005 6:03 pm
Sizing widget
Hi Neil,
I have been able to change the height of the widget, depending on how many projects are attached, by adding the following code after the buildStats() function calls.
Unfortunately to keep the footer position at the bottom of the widget, it then needs a calculation for the footer position, and another call to buildStats() as follows:
or maybe more createText calls would be better to display the footer line.
Hope this is of help to those who want to change the height of the widget.
Alan
I have been able to change the height of the widget, depending on how many projects are attached, by adding the following code after the buildStats() function calls.
Code: Select all
main_window.height=vGap*(projects+1)+34+14
background.height=vGap*(projects+1) +34 +14
Code: Select all
footerVPos=background.height-2
buildStats();
Hope this is of help to those who want to change the height of the widget.

Alan
-
- New Member
- Posts: 9
- Joined: Mon Aug 08, 2005 6:03 pm
I just used the background image you supplied with the widget, and it seems to stretch or compress itself as required. I've tried it with an account with 7 projects attached (changed max projects attached to 8 ) and one with just two and the background changes height accordingly, still with the curved corners! Not sure why, but it seems to work!
Alan

Alan
-
- New Member
- Posts: 9
- Joined: Mon Aug 08, 2005 6:03 pm
Hi Neil,
For changing the length of the widget to take into account the number of projects attached to, I think the following coding might be a bit more efficient than what I suggested earlier:
It just needs adding after each buildStats() call.
Regards, Alan
For changing the length of the widget to take into account the number of projects attached to, I think the following coding might be a bit more efficient than what I suggested earlier:
Code: Select all
buildStats();
//Code added to change height of widget depending on no of projects attached to.
main_window.height=vGap*(projects+1)+34+14
background.height=vGap*(projects+1) +34 +14
footerVPos=background.height-2
updatedTxt = createText(4, footerVPos, 10, fontName, "bold", "left", txtColour, statsUpdated);
updatedTxtShadow = createShadowText(updatedTxt);
footerTxt = createText(-1, footerVPos, 10, fontName, "bold", "center", txtColour, "boinc.mundayweb.com");
footerTxtShadow = createShadowText(footerTxt);
versionTxt = createText(-1, footerVPos, 10, fontName, "bold", "right", txtColour, VERSION_NO);
versionTxtShadow = createShadowText(versionTxt);
//End of modification
Regards, Alan
Hi all,
Tonight I have released version 0.4 of the Konfabulator widget. This version will now automatically resize itself based on the number of projects that a user has.
Thanks to Red Squirrel for the help - I only needed these three lines in the end:
These were added to the buildStats routine.
I found in testing that at least version 2.1.1 of Konfabulator is needed as versions 2.0 up to but not including 2.1.1 do not process the "delete" object statements!!!
If you have any problems, please let me know.
Cheers,
Neil.
Tonight I have released version 0.4 of the Konfabulator widget. This version will now automatically resize itself based on the number of projects that a user has.
Thanks to Red Squirrel for the help - I only needed these three lines in the end:
Code: Select all
main_window.height=vGap*(projects+1)+34+14
background.height=vGap*(projects+1) +34 +14
footerVPos=background.height-2
I found in testing that at least version 2.1.1 of Konfabulator is needed as versions 2.0 up to but not including 2.1.1 do not process the "delete" object statements!!!
If you have any problems, please let me know.
Cheers,
Neil.
-
- New Member
- Posts: 9
- Joined: Mon Aug 08, 2005 6:03 pm
Hi Neil,
I just noticed a couple of bugs in v0.4 of BOINC widget.
If you change text colour in the preferences, the footer line stays the original colour and the date disappears from the line. Same if you change the User ID - the date disappears. I think this is because the footer line is not rewritten when the widget is already loaded.
Also there is no blank line between the totals and the footer line. Thats why I had
not just
Hope I don't sound too "picky"!
Regards,
Alan
I just noticed a couple of bugs in v0.4 of BOINC widget.
If you change text colour in the preferences, the footer line stays the original colour and the date disappears from the line. Same if you change the User ID - the date disappears. I think this is because the footer line is not rewritten when the widget is already loaded.
Also there is no blank line between the totals and the footer line. Thats why I had
Code: Select all
main_window.height = vGap * (projectTotal +1) + startHOffset + 14;
background.height = vGap * (projectTotal +1)+ startHOffset + 14;
Code: Select all
main_window.height = vGap * projectTotal + startHOffset + 14;
background.height = vGap * projectTotal + startHOffset + 14;
Regards,
Alan
Hi Alan,
Thanks for pointing out the colour bugs - I forgot to add the colour code in the buildStats routine. I also made a semantic error regarding the vOffset property of the date text fields which wouldn't haven been caught at runtime.
These have now been fixed in version 0.41.
I personally prefer not having a gap between the total line and the stats. However, I can introduce an option to put the gap in if users want?
Cheers,
Neil.
Thanks for pointing out the colour bugs - I forgot to add the colour code in the buildStats routine. I also made a semantic error regarding the vOffset property of the date text fields which wouldn't haven been caught at runtime.
These have now been fixed in version 0.41.
I personally prefer not having a gap between the total line and the stats. However, I can introduce an option to put the gap in if users want?
Cheers,
Neil.
-
- New Member
- Posts: 9
- Joined: Mon Aug 08, 2005 6:03 pm
Hi all,
I have released version 0.5 which adds two new preferences.
The first was supplied by ClarkF1 and allows you to turn the background image on or off.
The second is the "gap" preference which allows you to add a gap between the total line and the stats lines if you wish.
Any problems, let me know.
Cheers,
Neil.
I have released version 0.5 which adds two new preferences.
The first was supplied by ClarkF1 and allows you to turn the background image on or off.
The second is the "gap" preference which allows you to add a gap between the total line and the stats lines if you wish.
Any problems, let me know.
Cheers,
Neil.
Hi again.
I have just released version 0.51 after ClarkF1 correctly pointed out that shadow text was lacking on any text that is centered or right aligned.
Basically, when you set the alignment of text to anything other than "left", the hOffset value is set to "-1". Therefore, when aligning the shadow text you can't!
To get round this, I had a hunt around the Konfabulator forums. In the end I created a function called "alignObj" which when given a text object and either "left, "center" or "right", it will align the object correctly. It basically uses the width of the main window and the text object to work out the correct alignment. One pre-condition is that the data property of the text field must be set in order for the correct alignment to be calculated.
Sorry for the constant updates!
Neil.
I have just released version 0.51 after ClarkF1 correctly pointed out that shadow text was lacking on any text that is centered or right aligned.
Basically, when you set the alignment of text to anything other than "left", the hOffset value is set to "-1". Therefore, when aligning the shadow text you can't!
To get round this, I had a hunt around the Konfabulator forums. In the end I created a function called "alignObj" which when given a text object and either "left, "center" or "right", it will align the object correctly. It basically uses the width of the main window and the text object to work out the correct alignment. One pre-condition is that the data property of the text field must be set in order for the correct alignment to be calculated.
Sorry for the constant updates!
Neil.