1
0

editwndstring.h 474 B

123456789101112131415161718192021222324
  1. #ifndef _EDITWNDSTRING_H
  2. #define _EDITWNDSTRING_H
  3. #include <api/wnd/wndclass/editwnd.h>
  4. #include <bfc/memblock.h>
  5. class EditWndString : public EditWnd
  6. {
  7. public:
  8. void setBuffer(wchar_t *buffer, int len=0)
  9. {
  10. b.setSize(len+1);
  11. wchar_t *bufmem=b.getMemory();
  12. if(len)
  13. wcsncpy(bufmem,buffer,len);
  14. bufmem[len]=0;
  15. EditWnd::setBuffer(bufmem,len);
  16. }
  17. const wchar_t *getBuffer() { return b.getMemory(); }
  18. private:
  19. MemBlock<wchar_t> b;
  20. };
  21. #endif//_EDITWNDSTRING_H