Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "my_textctrl.hpp"
- void my_textctrl::add_message(wxString author, wxString msg)
- {
- wxTextAttr author_attr(wxColour(0, 0, 0xff));
- author_attr.SetFontWeight(wxFONTWEIGHT_BOLD);
- wxString input(author + wxT(": ") + msg, wxMBConvUTF8());
- write_lock_.lock();
- long int start = GetInsertionPoint(), end;
- AppendText(input);
- end = GetInsertionPoint();
- write_lock_.unlock();
- //SetStyle(start, end, author_attr);
- }
- void my_textctrl::add_info(wxString info)
- {
- wxTextAttr attr(wxColour(0xff, 0x66, 0));
- info += wxString("\n", wxMBConvUTF8());
- write_lock_.lock();
- long int start = GetInsertionPoint(), end;
- AppendText(info);
- end = GetInsertionPoint();
- write_lock_.unlock();
- SetStyle(start, end, attr);
- }
- void my_textctrl::add_error(wxString error)
- {
- wxTextAttr attr(wxColour(0xcc, 0, 0));
- attr.SetFontWeight(wxFONTWEIGHT_BOLD);
- error += wxString("\n", wxMBConvUTF8());
- write_lock_.lock();
- long int start = GetInsertionPoint(), end;
- AppendText(error);
- end = GetInsertionPoint();
- write_lock_.unlock();
- SetStyle(start, end, attr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement