Project

General

Profile

WLineEdit with clickable image inside

Added by Jockel Meierthiele over 1 year ago

Hello,

I try to create a WLineEdit with an clickable image inside.
It is similar to the WDateEdit, but I really do not understand how it is working.

So I added the image via css just like in WDateEdit, but how can I generate a "click"-event for the image and send it to the server?

Can anybody help me on the topic?
Thank you.

(I need a WLineEdit/derived from WLineEdit; using a WContainerWidget is not an option for me here)


Replies (2)

RE: WLineEdit with clickable image inside - Added by Roel Standaert over 1 year ago

WDateEdit and WTimeEdit just have some JavaScript code attached to them. They just check if the position of the click matches the position of the image to show the calendar or time picker.

How come WContainerWidget is not an option?

RE: WLineEdit with clickable image inside - Added by Jockel Meierthiele over 1 year ago

Hi,

They just check if the position...

ah, yes, I tried it much too complicated! Now I just connect to 'mouseWentDown' event and check the position.
This seems to work for me! Thank you for the hint!

How come WContainerWidget is not an option?

This would be a huge refactoring (a frequently used

 unique_ptr<Wt::WFormWidge> factory(...)

-function).

Thank you!

    (1-2/2)