Changeset 15 in flair-src for trunk/lib/FlairCore/src/TextEdit.cpp
- Timestamp:
- 04/08/16 15:40:57 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/TextEdit.cpp
r2 r15 22 22 using std::string; 23 23 24 namespace flair 25 { 26 namespace gui 27 { 24 namespace flair { 25 namespace gui { 28 26 29 TextEdit::TextEdit(const LayoutPosition * position,string name,size_t buf_size): Widget(position->getLayout(),name,"TextEdit")30 {31 SetVolatileXmlProp("row",position->Row());32 SetVolatileXmlProp("col",position->Col());33 27 TextEdit::TextEdit(const LayoutPosition *position, string name, size_t buf_size) 28 : Widget(position->getLayout(), name, "TextEdit") { 29 SetVolatileXmlProp("row", position->Row()); 30 SetVolatileXmlProp("col", position->Col()); 31 SendXml(); 34 32 35 33 delete position; 36 34 37 // text_node=AddXmlChild("Text");35 // text_node=AddXmlChild("Text"); 38 36 39 printf_buffer=(char*)malloc(buf_size); 40 if(printf_buffer==NULL) Err("erreur malloc\n"); 37 printf_buffer = (char *)malloc(buf_size); 38 if (printf_buffer == NULL) 39 Err("erreur malloc\n"); 41 40 } 42 41 43 TextEdit::~TextEdit() 44 { 45 free(printf_buffer); 46 } 42 TextEdit::~TextEdit() { free(printf_buffer); } 47 43 44 void TextEdit::Append(const char *format, ...) { 45 int n; 48 46 49 void TextEdit::Append(const char * format, ...) 50 { 51 int n; 47 va_list args; 48 va_start(args, format); 49 n = vsprintf(printf_buffer, format, args); 50 va_end(args); 51 if (n <= 0) 52 return; 52 53 53 va_list args; 54 va_start(args, format); 55 n = vsprintf(printf_buffer,format, args); 56 va_end (args); 57 if (n<=0) return; 58 59 SetVolatileXmlProp("value",printf_buffer,text_node); 60 SendXml(); 61 54 SetVolatileXmlProp("value", printf_buffer, text_node); 55 SendXml(); 62 56 } 63 57
Note:
See TracChangeset
for help on using the changeset viewer.