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

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

unix.superglobalmegacorp.com

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