Jamba  3.0.2
TextEditView.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 pongasoft
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  *
16  * @author Yan Pujante
17  */
18 #pragma once
19 
20 #include <vstgui4/vstgui/lib/controls/ctextedit.h>
22 
23 namespace pongasoft {
24 namespace VST {
25 namespace GUI {
26 namespace Views {
27 
28 using namespace VSTGUI;
29 using namespace Params;
30 
33 class TextEdit : public CTextEdit
34 {
35 public:
36  explicit TextEdit(const CRect &iSize) : CTextEdit(iSize, nullptr, -1) {};
37 };
38 
43 class TextEditView : public CustomViewAdapter<TextEdit>
44 {
45 public:
46  // Constructor
47  explicit TextEditView(const CRect &iSize) : CustomViewAdapter(iSize)
48  {}
49 
50  // setTag => overridden to be able to change the param (in the editor)
51  void setTag(int32_t val) override;
52 
53  // registerParameters
54  void registerParameters() override;
55 
56  // valueChanged
57  void valueChanged() override;
58 
59  // onParameterChange
60  void onParameterChange(ParamID iParamID) override;
61 
62  CLASS_METHODS_NOCOPY(TextEditView, CustomViewAdapter<TextEdit>)
63 
64 protected:
65  // the underlying jmb parameter of type UTF8String
67 
68 public:
69  class Creator : public CustomViewCreator<TextEditView, CustomViewAdapter<TextEdit>>
70  {
71  public:
72  explicit Creator(char const *iViewName = nullptr, char const *iDisplayName = nullptr) :
73  CustomViewCreator(iViewName, iDisplayName, VSTGUI::UIViewCreator::kCTextEdit)
74  {
75  }
76  };
77 };
78 
79 }
80 }
81 }
82 }
83 
Definition: CustomViewCreator.h:981
Creator(char const *iViewName=nullptr, char const *iDisplayName=nullptr)
Definition: TextEditView.h:72
Definition: Clock.h:22
TextEdit(const CRect &iSize)
Definition: TextEditView.h:36
TextEditView(const CRect &iSize)
Definition: TextEditView.h:47
Definition: TextEditView.h:33
Definition: TextEditView.h:43