Jamba C++ API  5.1.1
TextEditView.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019 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 
24 
25 using namespace VSTGUI;
26 using namespace Params;
27 
30 class TextEdit : public CTextEdit
31 {
32 public:
33  explicit TextEdit(const CRect &iSize) : CTextEdit(iSize, nullptr, UNDEFINED_PARAM_ID) {};
34 };
35 
45 class TextEditView : public CustomViewAdapter<TextEdit>
46 {
47 public:
48  // Constructor
49  explicit TextEditView(const CRect &iSize) : CustomViewAdapter(iSize)
50  {}
51 
52  // registerParameters
53  void registerParameters() override;
54 
55  // valueChanged
56  void valueChanged() override;
57 
58  // setListener
59  void setListener(IControlListener *l) override;
60 
61 protected:
62  // the underlying jmb parameter of type UTF8String
64 
65 public:
66  class Creator : public CustomViewCreator<TextEditView, CustomViewAdapter<TextEdit>>
67  {
68  public:
69  explicit Creator(char const *iViewName = nullptr, char const *iDisplayName = nullptr) :
70  CustomViewCreator(iViewName, iDisplayName, VSTGUI::UIViewCreator::kCTextEdit)
71  {
72  }
73  };
74 };
75 
76 }
77 
Inherit from this class to provide the factory for a custom view.
Definition: CustomViewCreator.h:1314
Creator(char const *iViewName=nullptr, char const *iDisplayName=nullptr)
Definition: TextEditView.h:69
This class can be used to extend VSTGUI classes directly while still benefiting from the extensions a...
Definition: CustomView.h:335
Definition: Types.h:29
Definition: CustomController.h:24
TextEdit(const CRect &iSize)
Definition: TextEditView.h:33
The purpose of this class is to adapt the constructor signature to a single element,...
Definition: TextEditView.h:30
TextEditView(const CRect &iSize)
Definition: TextEditView.h:49
constexpr ParamID UNDEFINED_PARAM_ID
Constant used throughout the code to test whether the ParamID represents a valid id or an undefined o...
Definition: Types.h:47
Extends the CTextEdit view to tie it to a GUIJmbParam<UTF8String>.
Definition: TextEditView.h:45