AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ACustomWindow.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#include <AUI/Platform/AWindow.h>
14
21class API_AUI_VIEWS ACustomWindow: public AWindow
22{
23 friend class AWindowManager;
24public:
25 ACustomWindow(const AString& name, int width, int height);
26 ACustomWindow() = default;
27 ~ACustomWindow() override = default;
28
29 void setTitleHeight(uint32_t height) {
30 mTitleHeight = height;
31 }
32
33 void onPointerPressed(const APointerPressedEvent& event) override;
34 void onPointerReleased(const APointerReleasedEvent& event) override;
35
36 virtual bool isCaptionAt(const glm::ivec2& pos);
37
38 void setSize(glm::ivec2 size) override;
39
40signals:
41 emits<glm::ivec2> dragBegin;
42 emits<> dragEnd;
43
44private:
45 bool mDragging = false;
46 glm::ivec2 mDragPos{};
47 uint32_t mTitleHeight = 30;
48
49 void handleXConfigureNotify();
50
51#if AUI_PLATFORM_WIN
52protected:
53 LRESULT winProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) noexcept override;
54 void doDrawWindow() override;
55
56#endif
57};
Represents a window without native caption but still draggable by top side.
Definition: ACustomWindow.h:22
Represents a Unicode character string.
Definition: AString.h:37
void onPointerPressed(const APointerPressedEvent &event) override
Called on pointer (mouse) released event.
Definition: AWindowBase.cpp:211
void onPointerReleased(const APointerReleasedEvent &event) override
Called on pointer (mouse) released event.
Definition: AWindowBase.cpp:284
Definition: AWindowManager.h:23
Represents a window in the underlying windowing system.
Definition: AWindow.h:45
Pointing method press event.
Definition: APointerPressedEvent.h:21
Pointing method press event.
Definition: APointerReleasedEvent.h:19
Definition: Size.h:22