ASPiK SDK
uigridcontroller.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 __uigridcontroller__
6 #define __uigridcontroller__
7 
8 #include "../uidescription.h"
9 
10 #if VSTGUI_LIVE_EDITING
11 
12 #include "uigrid.h"
13 #include "../delegationcontroller.h"
14 #include "../../lib/controls/ctextedit.h"
15 
16 namespace VSTGUI {
17 
18 //----------------------------------------------------------------------------------------------------
19 class UIGridController : public UIGrid, public DelegationController
20 {
21 public:
22  UIGridController (IController* baseController, UIDescription* description);
23  ~UIGridController () override;
24 
25 protected:
26  void valueChanged (CControl* pControl) override;
27  CView* verifyView (CView* view, const UIAttributes& attributes, const IUIDescription* description) override;
28  IControlListener* getControlListener (UTF8StringPtr name) override;
29 
30  SharedPointer<UIDescription> editDescription;
31  SharedPointer<CTextEdit> gridControls[2];
32 
33  static bool valueToString (float value, char utf8String[256], CParamDisplay::ValueToStringUserData* userData);
34  static bool stringToValue (UTF8StringPtr txt, float& result, CTextEdit::StringToValueUserData* userData);
35 
36  enum {
37  kGridXTag,
38  kGridYTag
39  };
40 };
41 
42 } // namespace
43 
44 #endif // VSTGUI_LIVE_EDITING
45 
46 #endif // __uigridcontroller__
Definition: customcontrols.cpp:8