objview.h

来自「Yet another mp3 player, but this time us」· C头文件 代码 · 共 51 行

H
51
字号
/*   objview.h  Abstract base class for deriving displayed objects.  This program is free software; you can redistribute it and/or modify it  under the terms of the GNU General Public License as published by the  Free Software Foundation; either version 2 of the License, or (at your  option) any later version.  This program is distributed in the hope that it will be useful, but  WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  General Public License for more details, www.gnu.org.  Copyright (C) 2000  Simon Harrison (email smh@N_O_S_P_A_M@dr.com)*/#ifndef WINDOWVIEW_DOT_H#define WINDOWVIEW_DOT_H#include "svgawrap.h"class CObjectView {   protected:   int PAGE_TOP;    // Y position   int PAGE_LEFT;   // X Position   bool hasfocus;   // Whether or not the object processes K/B input.   vgaw* vga;       // Reference to the display   CObjectView() {}   public:   int Update() {   // returns key input not handled by this view.      int r=0;      if (hasfocus) r = ProcessMessages();      Paint();      return r;   }                   // update any tasks the view must support.   SetFocus(bool b) { hasfocus = b; }   bool GetFocus() { return hasfocus; }   virtual ~CObjectView() {}   protected:   writexy( int x, int y, char* p ) {       vga->spaced_gl_write( x+PAGE_LEFT, y+PAGE_TOP, p );    }    virtual int ProcessMessages() { return 0; }  // Check for keyboard input    virtual Paint() {}          // Update the display for this view.};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?