Annotation of nono/wx/wxtextscreen.h, revision 1.1.1.5

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: 
                      7: #pragma once
                      8: 
                      9: #include "wxtextpanel.h"
1.1.1.5 ! root       10: #include "wxbmp.h"
1.1       root       11: 
                     12: //
1.1.1.3   root       13: // テキストスクリーンを表示するパネル
1.1       root       14: //
                     15: // wxPanel
                     16: //  ↓
                     17: // WXTextPanel  テキストフォントを管理するクラス
                     18: //  ↓
1.1.1.3   root       19: // WXTextScreen テキストスクリーンを表示するパネル
1.1       root       20: //
                     21: class WXTextScreen : public WXTextPanel
                     22: {
1.1.1.2   root       23:        using inherited = WXTextPanel;
1.1       root       24: 
                     25:  public:
1.1.1.3   root       26:        WXTextScreen(wxWindow *parent, IMonitor& monitor);
                     27:        virtual ~WXTextScreen() override;
1.1       root       28: 
1.1.1.3   root       29:        // 必要なら画面を更新して再描画する。
                     30:        // TextScreen が前回描画時から更新されていたら、このパネルを再描画する。
                     31:        void RefreshIfUpdated();
1.1       root       32: 
                     33:        // フォントサイズ変更
1.1.1.3   root       34:        void SetFontSize(FontId fontid) override;
                     35: 
                     36:        // 更新頻度設定
                     37:        void SetRate(int hz);
                     38: 
                     39:        // サイズ (桁数×行数) を取得する
                     40:        const wxSize GetSize() const { return wxSize(ts.GetCol(), ts.GetRow()); }
                     41: 
                     42:        // TextScreen のユーザデータ取得、設定
                     43:        uint64 GetUserData() const { return ts.userdata; }
                     44:        void SetUserData(uint64 value) { ts.userdata = value; }
1.1       root       45: 
                     46:  private:
1.1.1.3   root       47:        void OnPaint(wxPaintEvent&);
                     48:        void OnSize(wxSizeEvent&);
                     49:        void OnTimer(wxTimerEvent&);
                     50: 
1.1.1.5 ! root       51:        void Init(int col, int row);
1.1       root       52:        void Draw(wxDC& dc);
                     53: 
1.1.1.5 ! root       54:        // コントロール全域のビットマップ
        !            55:        WXBitmap bitmap {};
        !            56: 
        !            57:        std::vector<uint16> prevbuf {};
1.1       root       58: 
1.1.1.3   root       59:        IMonitor& monitor;
1.1.1.4   root       60:        TextScreen ts {};
1.1       root       61: 
1.1.1.3   root       62:        wxTimer timer {};
                     63: 
1.1       root       64:        wxDECLARE_EVENT_TABLE();
                     65: };

unix.superglobalmegacorp.com

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