ASPiK SDK
uitemplatesettingscontroller.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 __uitemplatesettingscontroller__
6 #define __uitemplatesettingscontroller__
7 
8 #include "../uidescription.h"
9 
10 #if VSTGUI_LIVE_EDITING
11 
12 #include "../icontroller.h"
13 #include "../../lib/controls/ctextedit.h"
14 #include <string>
15 
16 namespace VSTGUI {
17 
18 //----------------------------------------------------------------------------------------------------
19 class UITemplateSettingsController : public CBaseObject, public IController
20 {
21 public:
22  UITemplateSettingsController (const std::string& templateName, UIDescription* description);
23  ~UITemplateSettingsController () override = default;
24 
25  CMessageResult notify (CBaseObject* sender, IdStringPtr message) override;
26  CView* verifyView (CView* view, const UIAttributes& attributes, const IUIDescription* description) override;
27  void valueChanged (CControl* control) override;
28 protected:
29  static bool valueToString (float value, char utf8String[256], CParamDisplay::ValueToStringUserData* userData);
30  static bool stringToValue (UTF8StringPtr txt, float& result, CTextEdit::StringToValueUserData* userData);
31 
32  SharedPointer<UIDescription> description;
33  std::string templateName;
34  std::string newTemplateName;
35  CPoint minSize;
36  CPoint maxSize;
37 
38  enum {
39  kNameTag = 0,
40  kMinWidthTag,
41  kMinHeightTag,
42  kMaxWidthTag,
43  kMaxHeightTag,
44  kMinUseCurrentTag,
45  kMaxUseCurrentTag,
46  kNumTags
47  };
48  CControl* controls[kNumTags];
49 };
50 
51 } // namespace
52 
53 #endif // VSTGUI_LIVE_EDITING
54 
55 #endif // __uitemplatesettingscontroller__
Definition: customcontrols.cpp:8