Advertisement
wheeler

my_textctrl.cpp

Aug 24th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. #include "my_textctrl.hpp"
  2.  
  3. void my_textctrl::add_message(wxString author, wxString msg)
  4. {
  5.     wxTextAttr author_attr(wxColour(0, 0, 0xff));
  6.     author_attr.SetFontWeight(wxFONTWEIGHT_BOLD);
  7.     wxString input(author + wxT(": ") + msg, wxMBConvUTF8());
  8.     write_lock_.lock();
  9.     long int start = GetInsertionPoint(), end;
  10.     AppendText(input);
  11.     end = GetInsertionPoint();
  12.     write_lock_.unlock();
  13.  
  14.     //SetStyle(start, end, author_attr);
  15. }
  16.  
  17. void my_textctrl::add_info(wxString info)
  18. {
  19.     wxTextAttr attr(wxColour(0xff, 0x66, 0));
  20.     info += wxString("\n", wxMBConvUTF8());
  21.  
  22.     write_lock_.lock();
  23.     long int start = GetInsertionPoint(), end;
  24.     AppendText(info);
  25.     end = GetInsertionPoint();
  26.     write_lock_.unlock();
  27.  
  28.     SetStyle(start, end, attr);
  29. }
  30.  
  31. void my_textctrl::add_error(wxString error)
  32. {
  33.     wxTextAttr attr(wxColour(0xcc, 0, 0));
  34.     attr.SetFontWeight(wxFONTWEIGHT_BOLD);
  35.     error += wxString("\n", wxMBConvUTF8());
  36.  
  37.     write_lock_.lock();
  38.     long int start = GetInsertionPoint(), end;
  39.     AppendText(error);
  40.     end = GetInsertionPoint();
  41.     write_lock_.unlock();
  42.  
  43.     SetStyle(start, end, attr);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement