add a native wstring version textbox::append
added a textbox::append which accepts texts in std::wstring
This commit is contained in:
		
							parent
							
								
									b25949c9b3
								
							
						
					
					
						commit
						dcb472cb06
					
				@ -185,7 +185,7 @@ namespace nana
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        /// Appends an string. If `at_caret` is `true`, the string is inserted at the position of caret, otherwise, it is appended at end of the textbox.
 | 
					        /// Appends an string. If `at_caret` is `true`, the string is inserted at the position of caret, otherwise, it is appended at end of the textbox.
 | 
				
			||||||
		textbox& append(const std::string& text, bool at_caret);
 | 
							textbox& append(const std::string& text, bool at_caret);
 | 
				
			||||||
 | 
					        textbox& append(const std::wstring& text, bool at_caret);
 | 
				
			||||||
		/// Determines whether the text is line wrapped.
 | 
							/// Determines whether the text is line wrapped.
 | 
				
			||||||
		bool line_wrapped() const;
 | 
							bool line_wrapped() const;
 | 
				
			||||||
		textbox& line_wrapped(bool);
 | 
							textbox& line_wrapped(bool);
 | 
				
			||||||
 | 
				
			|||||||
@ -435,7 +435,23 @@ namespace drawerbase {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
			return *this;
 | 
								return *this;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					        //a native wstring version textbox::append
 | 
				
			||||||
 | 
					        textbox& textbox::append(const std::wstring& text, bool at_caret)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            internal_scope_guard lock;
 | 
				
			||||||
 | 
					            auto editor = get_drawer_trigger().editor();
 | 
				
			||||||
 | 
					            if(editor)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if(at_caret == false)
 | 
				
			||||||
 | 
					                    editor->move_caret_end(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                editor->put(text);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                editor->try_refresh();
 | 
				
			||||||
 | 
					                API::update_window(this->handle());
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return *this;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
		/// Determine wheter the text is auto-line changed.
 | 
							/// Determine wheter the text is auto-line changed.
 | 
				
			||||||
		bool textbox::line_wrapped() const
 | 
							bool textbox::line_wrapped() const
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user