28 #include "../../idlib/precompiled.h"
37 #define EDIT_HEIGHT 25
49 ConsoleView::ConsoleView()
50 : CFormView(ConsoleView::IDD) {
78 int len = work2.GetLength();
80 work2 = work2.Right(
editConsole.GetLimitText() * .75f );
81 len = work2.GetLength();
137 bool propogateCommand =
true;
140 if ( str.CompareNoCase (
"clear" ) == 0) {
144 else if ( str.CompareNoCase (
"edit" ) == 0) {
145 propogateCommand =
false;
147 if ( propogateCommand ) {
159 if (pMsg->hwnd ==
editInput.GetSafeHwnd()) {
161 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) {
166 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_UP ) {
179 editInput.SetSel ( selLocation , selLocation + 1);
189 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_DOWN ) {
203 editInput.SetSel ( selLocation , selLocation + 1);
207 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB ) {
208 common->
Printf (
"Command History\n----------------\n" );
215 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_NEXT) {
219 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_PRIOR ) {
223 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_HOME ) {
227 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_END ) {
232 return CFormView::PreTranslateMessage(pMsg);
239 CFormView::DoDataExchange(pDX);
250 CFormView::OnInitialUpdate();
266 CFormView::OnSize(nType, cx, cy);
280 static char buf2[32768];
286 for (i = 0; i <
l; i++) {
287 if (buf[i] ==
'\n') {
virtual void OnInitialUpdate()
Transfers data to and from the controls in the console.
CONST PIXELFORMATDESCRIPTOR UINT
virtual BOOL PreTranslateMessage(MSG *pMsg)
Handles keyboard input to process the "Enter" key to execute commands and command history...
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
virtual void DoDataExchange(CDataExchange *pDX)
Transfers data to and from the controls in the console.
afx_msg void OnSize(UINT nType, int cx, int cy)
Windows message called when the window is resized.
idStr & RemoveColors(void)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual ~ConsoleView()
Destructor for ConsoleView.
int Append(const type &obj)
IMPLEMENT_DYNCREATE(CCamWnd, CWnd)
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.
bool RemoveIndex(int index)
void SetConsoleText(const idStr &text)
Replaces the text in the console window with the specified text.
const char * c_str(void) const
int currentHistoryPosition
#define IDC_CONSOLE_OUTPUT
void AddText(const char *msg)
Adds text to the end of the console output window.