stlab.adobe.com Adobe Systems Incorporated

platform_edit_text.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /****************************************************************************************************/
00008 
00009 #ifndef ADOBE_EDIT_TEXT_HPP
00010 #define ADOBE_EDIT_TEXT_HPP
00011 
00012 /****************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <adobe/layout_attributes.hpp>
00017 #include <adobe/any_regular.hpp>
00018 #include <adobe/future/widgets/headers/widget_utils.hpp>
00019 
00020 #include <adobe/future/widgets/headers/platform_label.hpp>
00021 #include <adobe/future/widgets/headers/edit_text_common.hpp>
00022 
00023 #include <boost/function.hpp>
00024 
00025 #include <string>
00026 
00027 /****************************************************************************************************/
00028 
00029 namespace adobe {
00030 
00031 /****************************************************************************************************/
00032 
00033     struct edit_text_t : boost::noncopyable
00034 {
00035     typedef std::string                                         model_type;
00036     typedef boost::function<void (const std::string&, bool&)>   edit_text_pre_edit_proc_t;
00037     typedef boost::function<void (const model_type&)>           setter_type;
00038     typedef boost::function<void (modifiers_t)>          edit_text_label_hit_proc_t;
00039 
00040                       edit_text_t(const edit_text_ctor_block_t& block);
00041     
00042     void              initialize(HWND parent);
00043     label_t&          get_label();
00044 
00045 // placeable
00046 
00047     void              measure(extents_t& result);
00048     void              place(const place_data_t& place_data);
00049 
00050 //controller
00051     void              monitor(setter_type proc);
00052     void              enable(bool active);
00053 
00054 //view
00055     void              display(const model_type&);
00056 
00057     void              set_theme(theme_t theme);
00058     void              set_field_text(const std::string& text);
00059     void              set_static_disabled(bool is_static_disabled);
00060     void              set_selection(long start_char, long end_char);
00061     void              signal_pre_edit(edit_text_pre_edit_proc_t proc);
00062     void              signal_label_hit(edit_text_label_hit_proc_t proc);
00063     //
00068     //
00069     long              get_window_style() const;
00070 
00071     HWND                       control_m;
00072     theme_t             theme_m;
00073     label_t                    name_m;
00074     std::string                alt_text_m;
00075     std::wstring               field_text_m;
00076     bool                       using_label_m;
00077     long                       characters_m;
00078     long                       rows_m;
00079     long                       cols_m;
00080     long                       max_cols_m;
00081     bool                       scrollable_m;
00082     bool                       password_m;
00083     long                       edit_baseline_m;
00084     long                       edit_height_m;
00085     long                       static_baseline_m;
00086     long                       static_height_m;
00087     edit_text_pre_edit_proc_t  pre_edit_proc_m;
00088     setter_type                post_edit_proc_m;
00089     edit_text_label_hit_proc_t label_hit_proc_m;
00090     bool                       type_2_debounce_m;
00091     std::string                value_m; // Used to debounce
00092 
00093 private: 
00094     void                       edit_text_label_hit(modifiers_t);
00095 
00096 };
00097 
00098 inline std::string get_control_string(const edit_text_t& widget)
00099 {
00100     return implementation::get_control_string(widget.control_m);
00101 }
00102 
00103 inline HWND get_display(const edit_text_t& widget)
00104     { return widget.control_m; }
00105 
00106 /****************************************************************************************************/
00107 
00108 } // namespace adobe
00109 
00110 /****************************************************************************************************/
00111 
00112 #endif
00113 
00114 /****************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google