Changeset 15 in flair-src for trunk/lib/FlairCore/src/TextEdit.cpp


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (6 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/TextEdit.cpp

    r2 r15  
    2222using std::string;
    2323
    24 namespace flair
    25 {
    26 namespace gui
    27 {
     24namespace flair {
     25namespace gui {
    2826
    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     SendXml();
     27TextEdit::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();
    3432
    35     delete position;
     33  delete position;
    3634
    37 //    text_node=AddXmlChild("Text");
     35  //    text_node=AddXmlChild("Text");
    3836
    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");
    4140}
    4241
    43 TextEdit::~TextEdit()
    44 {
    45     free(printf_buffer);
    46 }
     42TextEdit::~TextEdit() { free(printf_buffer); }
    4743
     44void TextEdit::Append(const char *format, ...) {
     45  int n;
    4846
    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;
    5253
    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();
    6256}
    6357
Note: See TracChangeset for help on using the changeset viewer.