| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/editor/KeypadDialog.h $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:38 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Generic keypad dialog base class |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 8 5/02/99 9:23p Matt |
| 30 | * Notify the level keypad when the level has changed, and then re-init |
| 31 | * the combo boxes. |
| 32 | * |
| 33 | * 7 4/03/99 7:54p Matt |
| 34 | * Finished implementing spiffy keypad update system. |
| 35 | * |
| 36 | * 6 3/10/99 7:17p Samir |
| 37 | * added function that updates keypads. |
| 38 | * |
| 39 | * 5 10/01/98 10:48a Samir |
| 40 | * hopefully fixced scrolling problem. |
| 41 | * |
| 42 | * 4 4/16/98 6:39p Kevin |
| 43 | * made CKeypadDialog::Activate static. |
| 44 | * |
| 45 | * 3 10/02/97 6:47p Samir |
| 46 | * Made m_Active static, so deactivating one keypad deactivates all. |
| 47 | * |
| 48 | * 2 8/25/97 12:04p Samir |
| 49 | * Fixed some scrolling problems. |
| 50 | * |
| 51 | * 7 2/21/97 5:04p Samir |
| 52 | * Set active flag to false when destroying to prevent corruption of |
| 53 | * memory for some reason. |
| 54 | * |
| 55 | * 6 2/20/97 6:05p Samir |
| 56 | * Allow for clean activation and deactivation of surfaces in editor when |
| 57 | * going into fullscreen mode. |
| 58 | * |
| 59 | * 5 2/20/97 5:39p Samir |
| 60 | * Added Deactivate virtual function. |
| 61 | * |
| 62 | * 4 2/19/97 2:15p Samir |
| 63 | * Added a RunKeypadFunction where children can inherits this function to |
| 64 | * add keypad control. |
| 65 | * |
| 66 | * 3 1/27/97 11:38a Samir |
| 67 | * Added horizontal scrolling of keypad modeless dialog. |
| 68 | * |
| 69 | * $NoKeywords: $ |
| 70 | */ |
| 71 | |
| 72 | #ifndef M_KEYPAD_DIALOG_H |
| 73 | #define M_KEYPAD_DIALOG_H |
| 74 | |
| 75 | ///////////////////////////////////////////////////////////////////////////// |
| 76 | // CKeypadDialog dialog |
| 77 | |
| 78 | class CKeypadDialog : public CDialog { |
| 79 | // Construction |
| 80 | public: |
| 81 | CKeypadDialog(UINT id, CWnd *pParent = NULL); // standard constructor |
| 82 | |
| 83 | BOOL Create(); |
| 84 | |
| 85 | // Dialog Data |
| 86 | //{{AFX_DATA(CKeypadDialog) |
| 87 | enum { IDD = IDD_KEYPAD_DLGBAR }; |
| 88 | // NOTE: the ClassWizard will add data members here |
| 89 | //}}AFX_DATA |
| 90 | |
| 91 | // Overrides |
| 92 | // ClassWizard generated virtual function overrides |
| 93 | //{{AFX_VIRTUAL(CKeypadDialog) |
| 94 | protected: |
| 95 | virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support |
| 96 | virtual void PostNcDestroy(); |
| 97 | //}}AFX_VIRTUAL |
| 98 | |
| 99 | protected: |
| 100 | static BOOL m_Active; // is keypad active? |
| 101 | |
| 102 | public: |
| 103 | virtual void RunKeypadFunction(int code){}; |
| 104 | virtual void UpdateKeypad(int mask){}; |
| 105 | |
| 106 | static void Deactivate() { CKeypadDialog::m_Active = FALSE; }; // called when shutting down keypad. |
| 107 | static void Activate() { CKeypadDialog::m_Active = TRUE; }; |
| 108 | |
| 109 | // Implementation |
| 110 | protected: |
| 111 | CWnd *m_wndParent; // Parent window to dialog |
| 112 | |
| 113 | virtual void OnCancel(); |
| 114 | |
| 115 | // Generated message map functions |
| 116 | //{{AFX_MSG(CKeypadDialog) |
| 117 | afx_msg void OnSize(UINT nType, int cx, int cy); |
| 118 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar); |
| 119 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar); |
| 120 | afx_msg void OnDestroy(); |
| 121 | virtual BOOL OnInitDialog(); |
| 122 | //}}AFX_MSG |
| 123 | DECLARE_MESSAGE_MAP() |
| 124 | |
| 125 | private: |
| 126 | UINT m_IDD; |
| 127 | bool m_sized; |
| 128 | int m_fullwidth, m_fullheight, m_hpos, m_vpos; |
| 129 | void InitScrollBars(int vis_w, int vis_h); |
| 130 | }; |
| 131 | |
| 132 | // Keypad update flags |
| 133 | #define KUF_CURROOM_CHANGED (1 << 0) |
| 134 | #define KUF_CURFACE_CHANGED (1 << 1) |
| 135 | #define KUF_CURPORTAL_CHANGED (1 << 2) |
| 136 | #define KUF_CUROBJ_CHANGED (1 << 3) |
| 137 | #define KUF_CUROBJ_NAME_CHANGED (1 << 4) |
| 138 | #define KUF_LEVEL_LOADED (1 << 5) |
| 139 | |
| 140 | #endif |