AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ARulerArea.h
1/*
2 * AUI Framework - Declarative UI toolkit for modern C++20
3 * Copyright (C) 2020-2024 Alex2772 and Contributors
4 *
5 * SPDX-License-Identifier: MPL-2.0
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 */
11
12#pragma once
13
14#include <AUI/View/AViewContainer.h>
15#include "ARulerView.h"
16
23class API_AUI_VIEWS ARulerArea: public AViewContainerBase, public IFontView {
24private:
25 _<AView> mWrappedView;
26 _<ARulerView> mHorizontalRuler;
27 _<ARulerView> mVerticalRuler;
28 glm::ivec2 mMousePos;
29
30 void setWrappedViewPosition(const glm::ivec2& pos);
31
32 glm::ivec2 getTargetPosition() const;
33
34protected:
35 void updatePosition();
36
37public:
38 ARulerArea(const _<AView>& wrappedView);
39 void setSize(glm::ivec2 size) override;
40 void onPointerMove(glm::vec2 pos, const APointerMoveEvent& event) override;
41
42 void invalidateFont() override;
43
44 void render(ARenderContext ctx) override;
45};
46
Photoshop-like ruler area for measuring display units.
Definition: ARulerArea.h:23
A view that represents a set of views.
Definition: AViewContainerBase.h:68
void onPointerMove(glm::vec2 pos, const APointerMoveEvent &event) override
Handles pointer hover events.
Definition: AViewContainerBase.cpp:242
void render(ARenderContext context) override
Draws this AView. Noone should call this function except rendering routine.
Definition: AViewContainerBase.cpp:233
Interface of a AView that works with fonts (i.e., ALabel, ATextField, AText, etc.....
Definition: IFontView.h:19
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Pointing method move event.
Definition: APointerMoveEvent.h:21
Render context passed to AView::render.
Definition: ARenderContext.h:43