[Rel] Unit Converter 0.2.0

I am not sure it is good to initiate another thread for a little updage like this. --;

First of all, thanks for thanks !

Changes:

- size of the widget is now 360x270 (I guess it's better than wiered 351...)

- some units, including UK pints, are added.

- units are configurable. (CAUTIONS: don't mess it up. No default botton! )

- it works in any size ( 4x3 is recommended though.)

- it accepts comma (comma is represented with dot, though)

Ave: I really want to work on SDK for Avedesk 1.3 !

Here are some scrreen shots

screenshot2.png

config.png

Download

#328596

I keep getting the 404 error :(

But looks great and it's one of the best new desklets ever released for AveDesk! :D

#328600

sorry for the missing link. It is now fixed.

#328601

Wonderfull Widget... Damn, you are a pro mate...

wanna give a shot at creating these widgets ???

Check these out :

http://www.apple.com/downloads/dashboard/c...ert/dfocus.html

http://www.apple.com/downloads/dashboard/c...calculator.html

#328605

well, they look great and must be useful for photographers.

However, I have no chance to try them to figure out how they work and act. (I couldn't afford a real mac. :( )

I need exact behavior of widgets and image files to duplicate them. :)

#328607

An amazing update. I do translate some texts from english to portuguese and Unit Converter is so useful to me as a cup of coffee. You not only bring it as good as it was on Konfab, but made it even better!! You're the man!!

#328634

@jooney8: hmm.... I'm trying to get the screenies and hopefully resources of those widgets. I've an iBook but no Tiger.. :(. Just wanted to know if someone's ready to create these if we can get hands on resources.

#328648

musashisama: dose it work fine for other languages? I try to develop it using Unicode, but not sure. Any problem, please let me know.

igo: That would not be a great deal of work to develop widgets with no complicate behavior. (for example, a weather widget is too complicate to build in a few hours, but isn't the unit converter.) Once you've got the resources, please let me know.

#328654

@joony: great update! I'll get the 1.3 SDK finished today, just came home :)

#328676

Hey Joony8, I still haven't got my hands on Screenies yet... but here are resources for the widgets I mentioned, please check the attachement. Will post screenies as soon as I get them.

:)

#328868

I've got a couple of thing to say: first one is this wodget is great, thanks for taking the time to program it.

second one is could you make and option to normalize the numbers? instead of 1 Joule = to 64415096465... (it even doesn't fit) electron Volts to 6.24150974e18 or to the number of decimal ciphers you want, and dont maube you should do a workaround so when the scale is elevated to -19 doesn't show as 0.

EDIT: maybe putting to boxes instead of one, one for the normalised number and othe for the exponent (sorry if I explain myself wrong, but I don't use English normally)

#329156

Wow! Cool stuff!

#329160

@AndreasV: Greate! Now I am reworking everything for 1.3 and I like your new hacking style. Btw, I am trying to get Dropdown list control working. It seems not to call my callback function.

@igo: I simply download the widget from the website you told, and runing the script in IE gives me working screenies for a widget. Once I finish UC, I will try to reproduce one of them, soon. :)

@UnduTheGun: That's the good idea. The normalization (or significant digits+exponent) is one of the new features I am implementing in the new release. As soon as I get the dropdown list work for me, you can have it.

Thank everyone for greate ideas!

#329335

@AndreasV: Greate! Now I am reworking everything for 1.3 and I like your new hacking style. Btw, I am trying to get Dropdown list control working. It seems not to call my callback function.

Can you show me the code on how you set up the control and install the callback? :)

#329338

@AndreasV: Thank you for looking my code in person!

Here is the segment of code which is actually copy of your code. The symptom is: when i select an item, the selected item is checked and the menu pan disappears normally, but the item on the dropbox is left unchanged. Of course the callback is not called.

[font=Lucida Grande]	comboDigit = AveCreateControl(container, "back_combodigit", AVE_DROPDOWNLIST_CONTROL, 0L, NULL);

AveLockControl(comboDigit);

AveSendMessage(comboDigit, AV_DROPLIST_SET_ONSELCHANGECALLBACK, (WPARAM)this, (LPARAM)OnDigitSelChange);

AveSendMessage(comboDigit, AV_SET_FONT2, 0L, (LPARAM)&f2);

AveSendMessage(comboDigit, AV_SET_TEXTCOLOR, 0L, (LPARAM)Color(255,255,255,255).GetValue());

AveSendMessage(comboDigit, AV_SET_RECT, (WPARAM)&digitRect, (LPARAM)&backSize);

for(std::vector<std::wstring>::iterator iter2 = digits.begin(); iter2 != digits.end(); ++iter2)

AveSendMessage(comboDigit, AV_DROPLIST_ADDITEM, 0L, (LPARAM)(*iter2).c_str());

AveSendMessage(comboDigit, AV_DROPLIST_SET_SEL, AveSendMessage(comboDigit, AV_DROPLIST_FINDITEM, 0L, (LPARAM)sigDigits.c_str()), 0L);

AveSendMessage(comboDigit, AV_UPDATE, 0L, 0L);

AveUnlockControl(comboDigit);

AveAddControlToContainer(container, comboDigit);

DeskletLayerSetVisibility(hwndDesklet, AveSendMessage(comboDigit, AV_GET_LAYERID, 0L, 0L), FALSE, FALSE);





[/font]The code for callback look like this.



static BOOL __stdcall OnDigitSelChange(UnitConverter* w, AVEHANDLE control, INT* newSel)

{

// reacts to changes in the digit combo

UINT selVal = (UINT)(*newSel);

// for testing

char temp[1024]; wcstombs( temp, w->digits[selVal].c_str(), 1024 );

MessageBox( w->hwndDesklet, temp, "Output", MB_OK );

//end

if(selVal >= 0 && selVal < w->digits.size())

{

w->sigDigits = w->digits[selVal];

w->UpdateValue(1);

}

return TRUE;

}

#329425

It looks like you are not forwarding Window Messages to the container :)

void __stdcall OnProcessMessage(UnitConverter* w, HWND hwnd, UINT msg, WPARAM w, LPARAM l)

{

if(NULL == w)

return;



if(w->container != NULL)

{

if(AveForwardMessage(w->container, msg, w, l))

return;

}



// your handling of certain WM_*s

}

#329444

@AndreasV: Thanks. I've rechecked every event handling functions and I found I still have OnLeftButtonClick which cause problem. BTW, I like your new programming style.

Unit Converter 0.3.0 will be out in a few minutes.

#329465