doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConsoleView.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 #pragma once
29 
30 #include "MaterialEditor.h"
31 
37 class ConsoleView : public CFormView
38 {
39 
40 public:
41  enum{ IDD = IDD_CONSOLE_FORM };
42 
43  CEdit editConsole;
44  CEdit editInput;
45 
51 
52 public:
53  virtual ~ConsoleView();
54 
55  //Public Operations
56  void AddText(const char *msg);
57  void SetConsoleText ( const idStr& text );
58  void ExecuteCommand ( const idStr& cmd = "" );
59 
60 
61 protected:
62  ConsoleView();
63  DECLARE_DYNCREATE(ConsoleView)
64 
65  //CFormView Overrides
66  virtual BOOL PreTranslateMessage(MSG* pMsg);
67  virtual void DoDataExchange(CDataExchange* pDX);
68  virtual void OnInitialUpdate();
69 
70  //Message Handlers
71  afx_msg void OnSize(UINT nType, int cx, int cy);
72  DECLARE_MESSAGE_MAP()
73 
74  //Protected Operations
75  const char* TranslateString(const char *buf);
76 
77 
78 };
virtual void OnInitialUpdate()
Transfers data to and from the controls in the console.
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
#define const
Definition: getdate.c:251
#define BOOL
Definition: mprintf.c:71
virtual BOOL PreTranslateMessage(MSG *pMsg)
Handles keyboard input to process the "Enter" key to execute commands and command history...
virtual void DoDataExchange(CDataExchange *pDX)
Transfers data to and from the controls in the console.
bool saveCurrentCommand
Definition: ConsoleView.h:50
afx_msg void OnSize(UINT nType, int cx, int cy)
Windows message called when the window is resized.
ConsoleView()
Constructor for ConsoleView.
Definition: ConsoleView.cpp:49
idStrList consoleHistory
Definition: ConsoleView.h:47
idStr currentCommand
Definition: ConsoleView.h:48
virtual ~ConsoleView()
Destructor for ConsoleView.
Definition: ConsoleView.cpp:56
idStr consoleStr
Definition: ConsoleView.h:46
void ExecuteCommand(const idStr &cmd="")
Executes the specified console command.
const char * TranslateString(const char *buf)
Replaces \n with \r\n for carriage returns in an edit control.
View in the Material Editor that functions as a Doom III console.
Definition: ConsoleView.h:37
#define IDD_CONSOLE_FORM
void SetConsoleText(const idStr &text)
Replaces the text in the console window with the specified text.
Definition: ConsoleView.cpp:95
CEdit editConsole
Definition: ConsoleView.h:43
Definition: Str.h:116
int currentHistoryPosition
Definition: ConsoleView.h:49
CEdit editInput
Definition: ConsoleView.h:44
void AddText(const char *msg)
Adds text to the end of the console output window.
Definition: ConsoleView.cpp:65