|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.7 root 7: //
8: // モニターウィンドウ
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "wxsubwindow.h"
1.1.1.8 root 14: #include "wxtextscreen.h"
15: #include "wxscrollbar.h"
1.1 root 16:
1.1.1.8 root 17: // モニタパネル
18: class WXMonitorPanel : public WXTextScreen
19: {
20: using inherited = WXTextScreen;
21: public:
1.1.1.10 root 22: WXMonitorPanel(wxWindow *parent, Monitor *monitor_);
1.1.1.9 root 23: ~WXMonitorPanel() override;
1.1.1.8 root 24:
25: // 画面を更新して再描画する。
1.1.1.12! root 26: virtual void DoRefresh();
1.1.1.8 root 27:
28: // 更新頻度設定
29: void SetRate(int hz);
30:
1.1.1.10 root 31: Monitor *GetMonitor() const { return monitor; }
1.1.1.8 root 32:
33: private:
34: void OnTimer(wxTimerEvent&);
35:
1.1.1.10 root 36: Monitor *monitor {};
1.1.1.8 root 37: wxTimer timer {};
38:
39: wxDECLARE_EVENT_TABLE();
40: };
41:
42: // モニタウィンドウ (サイズ固定)
1.1 root 43: class WXMonitorWindow : public WXSubWindow
44: {
1.1.1.2 root 45: using inherited = WXSubWindow;
1.1 root 46: public:
1.1.1.6 root 47: WXMonitorWindow(wxWindow *parent, const wxString& name,
1.1.1.10 root 48: Monitor *monitor_);
1.1.1.9 root 49: ~WXMonitorWindow() override;
1.1 root 50:
1.1.1.6 root 51: protected:
1.1.1.8 root 52: // モニタパネル
53: WXMonitorPanel *monpanel {};
54: };
55:
56: // 縦スクロールバー付きモニタウィンドウ
57: class WXScrollMonitorWindow : public WXSubWindow
58: {
59: using inherited = WXSubWindow;
60: public:
61: WXScrollMonitorWindow(wxWindow *parent, const wxString& name,
1.1.1.10 root 62: Monitor *monitor_);
1.1.1.9 root 63: ~WXScrollMonitorWindow() override;
1.1.1.8 root 64:
1.1.1.11 root 65: void FontChanged() override;
1.1.1.8 root 66: bool Layout() override;
67:
68: private:
1.1.1.12! root 69: bool GetMySizeHints(wxSize *, wxSize *, wxSize *, wxSize *) override;
1.1.1.8 root 70:
71: // マウスホイールイベント
72: void OnMouseWheel(wxMouseEvent&);
73:
74: // スクロールイベント
75: void OnScroll(wxScrollEvent& event);
76:
77: // スクロール処理
78: void DoScroll(int pos);
79:
80: // モニタパネル
81: WXMonitorPanel *monpanel {};
82:
83: // スクロールバー
84: WXScrollBar *vscroll {};
1.1 root 85: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.