[Cppcms-users] forms - select_base::msg patch
Brought to you by:
artyom-beilis
From: kpeo <sla...@ya...> - 2012-07-18 10:59:18
|
Hello all! Sometimes we need to return a message, attached to selectable widget. For example, we have a content structure and form inside it with selectable widget, that has a displayed text (message) for every options. As i understand, original API can't return a message - just id (int or string). Shure, we can use id = message, but what if message is not unique or we need less alphabets for option's storing? We also may want to display this option as message in content structure and store this option as id. Well, we can use own component (map or kind of enum) to store id-to-text mapping, but we already have one in original library. So, i decide to write this little patch for src/form.cpp and cppcms/form.h. Shure, you can use it freely at your own risk, as me ;) And i'll be glad to see any criticism about it. Suggest, may be after reviewing by maintainers and if this patch looks useful - it will be included in new revisions of framework. Regards, kpeo |