Annotation of nono/wx/wxmonitor.h, revision 1.1.1.11

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:        // 画面を更新して再描画する。
                     26:        void DoRefresh();
                     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;
        !            66:        void Fit() override;
1.1.1.8   root       67:        bool Layout() override;
                     68: 
                     69:  private:
1.1.1.11! root       70:        // 最大/最小サイズ設定
        !            71:        wxSize DoSizeHints();
1.1.1.8   root       72: 
                     73:        // マウスホイールイベント
                     74:        void OnMouseWheel(wxMouseEvent&);
                     75: 
                     76:        // スクロールイベント
                     77:        void OnScroll(wxScrollEvent& event);
                     78: 
                     79:        // スクロール処理
                     80:        void DoScroll(int pos);
                     81: 
                     82:        // モニタパネル
                     83:        WXMonitorPanel *monpanel {};
                     84: 
                     85:        // スクロールバー
                     86:        WXScrollBar *vscroll {};
                     87: 
1.1.1.11! root       88:        // 前回のウィンドウマージン (クライアント領域の外側)
        !            89:        wxSize oldmargin {};
        !            90: 
        !            91:        // 謎のリサイズ対策
        !            92:        bool layout_pass2 {};
1.1       root       93: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.