Re: [Cppcms-users] [PATCH] Add support for readonly HTML attribute
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-09-27 09:29:31
|
Hi, Can you send the patch as an attachment and not "in-line" also please open a feature request or patch in tracking system so I'll not forget it. Also I need your agreement to this: http://cppcms.com/wikipp/en/page/cppcms_1x_coding_standards#Copyrights (i.e. copyright transfer) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Christian Gmeiner <chr...@gm...> >To: cpp...@li... >Sent: Thursday, September 27, 2012 8:16 AM >Subject: [Cppcms-users] [PATCH] Add support for readonly HTML attribute > >This patch adds support for readonly HTML attribute [0]. > >[0] http://www.w3schools.com/tags/att_input_readonly.asp > >Signed-off-by: Christian Gmeiner <chr...@gm...> >--- > >diff -Nur build_org/dependencies/src/cppcms-1.0.2/cppcms/form.h >build/dependencies/src/cppcms-1.0.2/cppcms/form.h >--- build_org/dependencies/src/cppcms-1.0.2/cppcms/form.h 2012-08-14 >09:42:24.000000000 +0200 >+++ build/dependencies/src/cppcms-1.0.2/cppcms/form.h 2012-09-26 >18:32:21.869608847 +0200 >@@ -533,6 +533,17 @@ > /// > void disabled(bool); > >+ >+ /// >+ /// Get the HTML \c readonly attribute. >+ /// >+ bool readonly(); >+ >+ /// >+ /// Set/Unset the HTML \c readonly attribute. >+ /// >+ void readonly(bool); >+ > /// > /// Get the general user defined attribute string that can be >added to the widget. > /// >@@ -685,11 +696,12 @@ > uint32_t is_valid_ : 1; > uint32_t is_set_ : 1; > uint32_t is_disabled_ : 1; >+ uint32_t is_readonly_ : 1; > uint32_t is_generation_done_ : 1; > uint32_t has_message_ : 1; > uint32_t has_error_ : 1; > uint32_t has_help_ : 1; >- uint32_t reserverd_ : 25; >+ uint32_t reserverd_ : 24; > > struct _data; > booster::hold_ptr<_data> d; >diff -Nur build_org/dependencies/src/cppcms-1.0.2/src/form.cpp >build/dependencies/src/cppcms-1.0.2/src/form.cpp >--- build_org/dependencies/src/cppcms-1.0.2/src/form.cpp 2012-08-14 >09:42:24.000000000 +0200 >+++ build/dependencies/src/cppcms-1.0.2/src/form.cpp 2012-09-26 >18:23:51.181619376 +0200 >@@ -280,6 +280,7 @@ > is_valid_(1), > is_set_(0), > is_disabled_(0), >+ is_readonly_(0), > is_generation_done_(0), > has_message_(0), > has_error_(0), >@@ -411,6 +412,16 @@ > is_disabled_=v; >} > >+bool base_widget::readonly() >+{ >+ return is_readonly_; >+} >+ >+void base_widget::readonly(bool v) >+{ >+ is_readonly_=v; >+} >+ >std::string base_widget::attributes_string() >{ > return attr_; >@@ -676,6 +687,9 @@ > if(lm.second >= 0 && validate_charset()) { > output << boost::format("maxlength=\"%1%\" >",std::locale::classic()) % lm.second; > } >+ if(readonly()) { >+ output << "readonly=\"readonly\""; >+ } >} > >------------------------------------------------------------------------------ >Everyone hates slow websites. So do we. >Make your web apps faster with AppDynamics >Download AppDynamics Lite for free today: >http://ad.doubleclick.net/clk;258768047;13503038;j? >http://info.appdynamics.com/FreeJavaPerformanceDownload.html >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |