LIBURANIA
GUI library (a wrapper of Win32 API) in C++
読み取り中…
検索中…
一致する文字列を見つけられません
clkpanel.h
[詳解]
1/*
2 * Copyright 2000-2024 oZ/acy (名賀月晃嗣)
3 * Redistribution and use in source and binary forms,
4 * with or without modification,
5 * are permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
36#ifndef INCLUDE_GUARD_URANIA_CLKPANEL_H
37#define INCLUDE_GUARD_URANIA_CLKPANEL_H
38
39#include <any>
40#include "bwin.h"
41
42
43namespace urania {
44
47{
48public:
49 using PH_ = void (*)(urania::BasicWindow*, urania::PaintDevice*, std::any&);
50
51private:
52 HWND pw_;
53 int id_;
54 PH_ ph_;
55 std::any app_;
56
57 ClickPanel(PH_ p, const std::any& a) : ph_(p), app_(a) {}
58
59 LRESULT wproc_(UINT msg, WPARAM wp, LPARAM lp) override;
60
61 void init_(HWND hw) override
62 {
63 bindHWND_(hw);
64 }
65
66 void uninit_() override
67 {
69 }
70
71
72public:
74
84 static
85 std::unique_ptr<ClickPanel>
86 create(
87 int x, int y, int w, int h, PH_ ph, const std::any& ap,
88 WndBase* par, int id);
89
92 {
93 if (ph_)
94 ph_(w, pdev, app_);
95 }
96};
97
98
99}// end of namespace urania
100
101
102#endif // INCLUDE_GUARD_URANIA_CLKPANEL_H
Window用基底クラス
Window管理・操作用基底クラス
Definition bwin.h:54
void unbindHWND_()
HWNDからBasicWindowオブジェクトへの結合を切斷
Definition bwin.h:149
void bindHWND_(HWND hw)
BasicWindowオブジェクトとHWNDの二重結合を形成
Definition bwin.h:142
クリックパネルコントロール
Definition clkpanel.h:47
void(*)(urania::BasicWindow *, urania::PaintDevice *, std::any &) PH_
Definition clkpanel.h:49
void paint(BasicWindow *w, PaintDevice *pdev)
描畫ハンドラを呼び出す。
Definition clkpanel.h:91
static std::unique_ptr< ClickPanel > create(int x, int y, int w, int h, PH_ ph, const std::any &ap, WndBase *par, int id)
クリックパネルの生成
Definition clkpanel.cpp:36
~ClickPanel()
Definition clkpanel.h:73
Definition paintdev.h:212
HWND管理用基底クラス
Definition wbase.h:55
Definition clkpanel.h:43