Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
ImageView.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 pongasoft
3 *
4 * Licensed under the Apache License, Version 2.0 or the MIT license,
5 * at your option. You may not use this file except in compliance with
6 * one of these licenses. You may obtain copies of the licenses at:
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 * https://opensource.org/licenses/MIT
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 *
17 * @author Yan Pujante
18 */
19#pragma once
20
21#include "CustomView.h"
22
24
39class ImageView : public CustomView
40{
41public:
42 explicit ImageView(const CRect &iSize) : CustomView(iSize) { CView::setMouseEnabled(false); }
43
46 BitmapPtr getImage() const { return fImage; }
47
49 void setImage(BitmapPtr iImage) { fImage = iImage; }
50
51 // draw => does the actual drawing job
52 void draw(CDrawContext *iContext) override;
53
54protected:
56
57public:
58 class Creator : public CustomViewCreator<ImageView, CustomView>
59 {
60 public:
61 explicit Creator(char const *iViewName = nullptr, char const *iDisplayName = nullptr) :
62 CustomViewCreator(iViewName, iDisplayName)
63 {
65 }
66 };
67
68};
69
70}
CustomViewCreator(char const *iViewName=nullptr, char const *iDisplayName=nullptr, char const *iBaseViewName=VSTGUI::UIViewCreator::kCView)
Definition CustomViewCreator.h:1318
CustomView(const CRect &iSize)
Definition CustomView.cpp:30
Creator(char const *iViewName=nullptr, char const *iDisplayName=nullptr)
Definition ImageView.h:61
void draw(CDrawContext *iContext) override
Definition ImageView.cpp:27
void setImage(BitmapPtr iImage)
attribute image
Definition ImageView.h:49
BitmapPtr getImage() const
The image to use.
Definition ImageView.h:46
BitmapSPtr fImage
Definition ImageView.h:55
ImageView(const CRect &iSize)
Definition ImageView.h:42
void registerBitmapAttribute(std::string const &iName, typename BitmapAttribute::Getter iGetter, typename BitmapAttribute::Setter iSetter)
Definition CustomViewCreator.h:972
Definition CustomController.h:25
CBitmap * BitmapPtr
Definition Types.h:50
SharedPointer< CBitmap > BitmapSPtr
Definition Types.h:51