ASPiK SDK
win32textedit.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __win32textedit__
6 #define __win32textedit__
7 
8 #include "../iplatformtextedit.h"
9 
10 #if WINDOWS
11 
12 #include <windows.h>
13 
14 #ifdef STRICT
15 #define WINDOWSPROC WNDPROC
16 #else
17 #define WINDOWSPROC FARPROC
18 #endif
19 
20 namespace VSTGUI {
21 
22 //-----------------------------------------------------------------------------
23 class Win32TextEdit : public IPlatformTextEdit
24 {
25 public:
26  Win32TextEdit (HWND parent, IPlatformTextEditCallback* textEdit);
27  ~Win32TextEdit () noexcept;
28 
29  UTF8String getText () override;
30  bool setText (const UTF8String& text) override;
31  bool updateSize () override;
32 
33  HWND getPlatformControl () const { return platformControl; }
34  HBRUSH getPlatformBackColor () const { return platformBackColor; }
35  IPlatformTextEditCallback* getTextEdit () const { return textEdit; }
36 
37 //-----------------------------------------------------------------------------
38 protected:
39  void textChanged ();
40 
41  HWND platformControl;
42  HANDLE platformFont;
43  HBRUSH platformBackColor;
44  WINDOWSPROC oldWndProcEdit;
45  std::string text;
46 
47  static LONG_PTR WINAPI procEdit (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
48 };
49 
50 } // namespace
51 
52 #endif // WINDOWS
53 
54 #endif // __win32textedit__
Definition: customcontrols.cpp:8