aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/wnd/wndclass/editwndstring.h
blob: 843524bf4ac5f5e1f755e025fcd5d87fff4028f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _EDITWNDSTRING_H
#define _EDITWNDSTRING_H

#include <api/wnd/wndclass/editwnd.h>
#include <bfc/memblock.h>

class EditWndString : public EditWnd 
{
public:
	void setBuffer(wchar_t *buffer, int len=0) 
	{
		b.setSize(len+1);
		wchar_t *bufmem=b.getMemory();
		if(len) 
			wcsncpy(bufmem,buffer,len);
		bufmem[len]=0;
		EditWnd::setBuffer(bufmem,len);
	}
	const wchar_t *getBuffer() { return b.getMemory(); }
private:
	MemBlock<wchar_t> b;
};

#endif//_EDITWNDSTRING_H