Hey Felipe,
2012/2/13 Felipe Zanchet Grazziotin <fel...@starbyte.net>
> Dmitriy,
>
> thanks for your answer!
>
> On Sun, Feb 12, 2012 at 5:39 PM, Dmitriy Igrishin <dmit...@gmail.com>wrote:
>
>> Hey Felipe,
>>
>>
>>
>> You may easily achieve this functionality by overriding either
>> WMenuItem::createItemWidget() and WMenuItem::updateItemWidget().
>>
>
> Great, got some real progress with it! Also understood how
> WMenuItem::updateItemWidget works to build the WLink and related labels.
>
> Somehow there's something wrong. I want my images to be clickable and have
> a caption into. With this code (shared at https://gist.github.com/1812531so
> don't mess with mailing list) I successfully got the anchor, the image
> with caption... plus this strange extra text with the caption.
>
> <a id="or0kfao" class=" " onclick="var
> e=event||window.event,o=this;if(e.ctrlKey||e.metaKey||(Wt3_2_0.button(e) >
> 1))return true;else{Wt3_2_0.cancelEvent(e,0x2);}" href="
> http://localhost:8080/#">
> <img id="or0kfb8" src="image.jpg" alt="my caption">
> <span id="or0kfam">my caption</span>
> </a>
>
>
> I'm failing to see how that extra text is being placed there. Looks like
> WMenuItem::updateItemWidget is inserting it via enabledLabel, but am not
> sure.
>
> What am I missing here? I'm a C programmer, maybe it's just my C++
> noobness taking part :(
>
Hmm, you don't need to call WMenuItem::createItemWidget() in
YourMenuItem::createItemWidget(). Just create WAnchor, call
WAnchor::setImage() and return it.
It seems, that you don't even need to override
WMenuItem::updateItemWidget() in you case becase
IMO the default impl. will serve fine for you.
--
// Dmitriy.
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest