home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / Joypad.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  4.6 KB  |  169 lines

  1. // -*- C++ -*-
  2. // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
  3. // Copyright (C) 1999-2003 Forgotten
  4. // Copyright (C) 2004 Forgotten and the VBA development team
  5.  
  6. // This program is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation; either version 2, or(at your option)
  9. // any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software Foundation,
  18. // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  
  20. #if !defined(AFX_JOYPAD_H__FFFB2470_9EEC_4D2D_A5F0_3BF31579999A__INCLUDED_)
  21. #define AFX_JOYPAD_H__FFFB2470_9EEC_4D2D_A5F0_3BF31579999A__INCLUDED_
  22.  
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. // Joypad.h : header file
  27. //
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // JoypadEditControl window
  31.  
  32. class JoypadEditControl : public CEdit
  33. {
  34.   // Construction
  35.  public:
  36.   JoypadEditControl();
  37.  
  38.   // Attributes
  39.  public:
  40.  
  41.   // Operations
  42.  public:
  43.  
  44.   // Overrides
  45.   // ClassWizard generated virtual function overrides
  46.   //{{AFX_VIRTUAL(JoypadEditControl)
  47.   //}}AFX_VIRTUAL
  48.  
  49.   // Implementation
  50.  public:
  51.   virtual BOOL PreTranslateMessage(MSG *pMsg);
  52.   afx_msg LRESULT OnJoyConfig(WPARAM wParam, LPARAM lParam);
  53.   virtual ~JoypadEditControl();
  54.  
  55.   // Generated message map functions
  56.  protected:
  57.   //{{AFX_MSG(JoypadEditControl)
  58.   afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  59.   //}}AFX_MSG
  60.  
  61.   DECLARE_MESSAGE_MAP()
  62.     };
  63.  
  64.     /////////////////////////////////////////////////////////////////////////////
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // JoypadConfig dialog
  68.  
  69. class JoypadConfig : public CDialog
  70. {
  71.   // Construction
  72.  public:
  73.   void assignKeys();
  74.   void assignKey(int id, int key);
  75.   JoypadConfig(int w, CWnd* pParent = NULL);   // standard constructor
  76.  
  77.   // Dialog Data
  78.   //{{AFX_DATA(JoypadConfig)
  79.   enum { IDD = IDD_CONFIG };
  80.   JoypadEditControl  up;
  81.   JoypadEditControl  speed;
  82.   JoypadEditControl  right;
  83.   JoypadEditControl  left;
  84.   JoypadEditControl  down;
  85.   JoypadEditControl  capture;
  86.   JoypadEditControl  buttonStart;
  87.   JoypadEditControl  buttonSelect;
  88.   JoypadEditControl  buttonR;
  89.   JoypadEditControl  buttonL;
  90.   JoypadEditControl  buttonGS;
  91.   JoypadEditControl  buttonB;
  92.   JoypadEditControl  buttonA;
  93.   //}}AFX_DATA
  94.  
  95.  
  96.   // Overrides
  97.   // ClassWizard generated virtual function overrides
  98.   //{{AFX_VIRTUAL(JoypadConfig)
  99.  protected:
  100.   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  101.   //}}AFX_VIRTUAL
  102.  
  103.   // Implementation
  104.  protected:
  105.   UINT timerId;
  106.   int which;
  107.  
  108.   // Generated message map functions
  109.   //{{AFX_MSG(JoypadConfig)
  110.   afx_msg void OnCancel();
  111.   afx_msg void OnOk();
  112.   afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  113.   afx_msg void OnDestroy();
  114.   afx_msg void OnTimer(UINT nIDEvent);
  115.   afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  116.   virtual BOOL OnInitDialog();
  117.   //}}AFX_MSG
  118.   DECLARE_MESSAGE_MAP()
  119.     };
  120.     /////////////////////////////////////////////////////////////////////////////
  121. // MotionConfig dialog
  122.  
  123. class MotionConfig : public CDialog
  124. {
  125.   // Construction
  126.  public:
  127.   void assignKeys();
  128.   void assignKey(int id, int key);
  129.   MotionConfig(CWnd* pParent = NULL);   // standard constructor
  130.  
  131.   // Dialog Data
  132.   //{{AFX_DATA(MotionConfig)
  133.   enum { IDD = IDD_MOTION_CONFIG };
  134.   JoypadEditControl  up;
  135.   JoypadEditControl  right;
  136.   JoypadEditControl  left;
  137.   JoypadEditControl  down;
  138.   //}}AFX_DATA
  139.  
  140.  
  141.   // Overrides
  142.   // ClassWizard generated virtual function overrides
  143.   //{{AFX_VIRTUAL(MotionConfig)
  144.  protected:
  145.   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  146.   //}}AFX_VIRTUAL
  147.  
  148.   // Implementation
  149.  protected:
  150.  
  151.   // Generated message map functions
  152.   //{{AFX_MSG(MotionConfig)
  153.   afx_msg void OnCancel();
  154.   afx_msg void OnOk();
  155.   afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  156.   afx_msg void OnDestroy();
  157.   virtual BOOL OnInitDialog();
  158.   afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  159.   afx_msg void OnTimer(UINT nIDEvent);
  160.   //}}AFX_MSG
  161.   DECLARE_MESSAGE_MAP()
  162.     private:
  163.   UINT timerId;
  164. };
  165. //{{AFX_INSERT_LOCATION}}
  166. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  167.  
  168. #endif // !defined(AFX_JOYPAD_H__FFFB2470_9EEC_4D2D_A5F0_3BF31579999A__INCLUDED_)
  169.