@ -18,8 +18,9 @@
# include "nel/misc/win_displayer.h"
# ifdef NL_OS_WINDOWS
# define NOMINMAX
# ifndef NL_COMP_MINGW
# define NOMINMAX
# endif
# include <windows.h>
# include <windowsx.h>
# include <winuser.h>
@ -263,7 +264,7 @@ void CWinDisplayer::updateLabels ()
{
access . value ( ) [ i ] . Hwnd = CreateWindowW ( L " STATIC " , L " " , WS_CHILD | WS_VISIBLE | SS_SIMPLE , 0 , 0 , 0 , 0 , _HWnd , ( HMENU ) NULL , ( HINSTANCE ) GetWindowLongPtr ( _HWnd , GWLP_HINSTANCE ) , NULL ) ;
}
SendMessage ( ( HWND ) access . value ( ) [ i ] . Hwnd , WM_SETFONT , ( LONG) _HFont , TRUE ) ;
SendMessage ( ( HWND ) access . value ( ) [ i ] . Hwnd , WM_SETFONT , ( WPARAM) _HFont , TRUE ) ;
needResize = true ;
}
@ -285,7 +286,7 @@ void CWinDisplayer::updateLabels ()
}
}
SendMessage ( ( HWND ) access . value ( ) [ i ] . Hwnd , WM_SETTEXT , 0 , ( L ONG ) n . c_str ( ) ) ;
SendMessage ( ( HWND ) access . value ( ) [ i ] . Hwnd , WM_SETTEXT , 0 , ( L PARAM ) n . c_str ( ) ) ;
access . value ( ) [ i ] . NeedUpdate = false ;
}
}
@ -422,7 +423,7 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint
dwStyle | = WS_HSCROLL ;
_HEdit = CreateWindowExW ( WS_EX_OVERLAPPEDWINDOW , RICHEDIT_CLASSW , L " " , dwStyle , 0 , _ToolBarHeight , w , h - _ToolBarHeight - _InputEditHeight , _HWnd , ( HMENU ) NULL , ( HINSTANCE ) GetWindowLongPtr ( _HWnd , GWLP_HINSTANCE ) , NULL ) ;
SendMessage ( _HEdit , WM_SETFONT , ( LONG) _HFont , TRUE ) ;
SendMessage ( _HEdit , WM_SETFONT , ( WPARAM) _HFont , TRUE ) ;
// set the edit text limit to lot of :)
SendMessage ( _HEdit , EM_LIMITTEXT , - 1 , 0 ) ;
@ -436,7 +437,7 @@ void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint
_HInputEdit = CreateWindowExW ( WS_EX_OVERLAPPEDWINDOW , RICHEDIT_CLASSW , L " " , WS_CHILD | WS_VISIBLE
/*| ES_MULTILINE*/ | ES_WANTRETURN | ES_NOHIDESEL | ES_AUTOHSCROLL , 0 , h - _InputEditHeight , w , _InputEditHeight ,
_HWnd , NULL , ( HINSTANCE ) GetWindowLongPtr ( _HWnd , GWLP_HINSTANCE ) , NULL ) ;
SendMessageW ( _HInputEdit , WM_SETFONT , ( LONG) _HFont , TRUE ) ;
SendMessageW ( _HInputEdit , WM_SETFONT , ( WPARAM) _HFont , TRUE ) ;
LRESULT dwEvent = SendMessageW ( _HInputEdit , EM_GETEVENTMASK , ( WPARAM ) 0 , ( LPARAM ) 0 ) ;
dwEvent | = ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_CHANGE ;
@ -486,7 +487,7 @@ void CWinDisplayer::clear ()
SendMessageW ( _HEdit , EM_SETSEL , 0 , nIndex ) ;
// clear all the text
SendMessageW ( _HEdit , EM_REPLACESEL , FALSE , ( L ONG ) " " ) ;
SendMessageW ( _HEdit , EM_REPLACESEL , FALSE , ( L PARAM ) " " ) ;
SendMessageW ( _HEdit , EM_SETMODIFY , ( WPARAM ) TRUE , ( LPARAM ) 0 ) ;
@ -535,7 +536,7 @@ void CWinDisplayer::display_main ()
// store old selection
DWORD startSel , endSel ;
SendMessage ( _HEdit , EM_GETSEL , ( LONG) & startSel , ( LONG ) & endSel ) ;
SendMessage ( _HEdit , EM_GETSEL , ( WPARAM) & startSel , ( LPARAM ) & endSel ) ;
// find how many lines we have to remove in the current output to add new lines
@ -549,7 +550,7 @@ void CWinDisplayer::display_main ()
if ( nblineremove = = _HistorySize )
{
SendMessage ( _HEdit , WM_SETTEXT , 0 , ( L ONG ) " " ) ;
SendMessage ( _HEdit , WM_SETTEXT , 0 , ( L PARAM ) " " ) ;
startSel = endSel = - 1 ;
}
else
@ -559,7 +560,7 @@ void CWinDisplayer::display_main ()
LRESULT oldIndex2 = SendMessageW ( _HEdit , EM_LINEINDEX , nblineremove , 0 ) ;
//nlassert (oldIndex2 != -1);
SendMessageW ( _HEdit , EM_SETSEL , oldIndex1 , oldIndex2 ) ;
SendMessageW ( _HEdit , EM_REPLACESEL , FALSE , ( L ONG ) " " ) ;
SendMessageW ( _HEdit , EM_REPLACESEL , FALSE , ( L PARAM ) " " ) ;
// update the selection due to the erasing
sint dt = ( sint ) ( oldIndex2 - oldIndex1 ) ;
@ -599,7 +600,7 @@ void CWinDisplayer::display_main ()
}
// add the string to the edit control
SendMessageW ( _HEdit , EM_REPLACESEL , FALSE , ( L ONG ) str . c_str ( ) ) ;
SendMessageW ( _HEdit , EM_REPLACESEL , FALSE , ( L PARAM ) str . c_str ( ) ) ;
}
// restore old selection