From: Guy H <da...@us...> - 2005-01-31 22:56:03
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22351/AnyEditv2 Modified Files: AnyEdit.rc OutputBar.cpp OutputBar.h OutputEdit.cpp OutputEdit.h Log Message: 1. Fixed context menu so it will use regular menu items (copy and clear) 2. Enabled read-only output edits (and set them all thus expect for the 'edit' tab) Index: OutputEdit.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OutputEdit.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OutputEdit.cpp 29 Jan 2005 17:55:12 -0000 1.7 --- OutputEdit.cpp 31 Jan 2005 22:55:51 -0000 1.8 *************** *** 17,22 **** COutputEdit::COutputEdit() { ! m_bCanPaint=TRUE; m_CurSelLine = -1; } --- 17,23 ---- COutputEdit::COutputEdit() { ! m_bCanPaint = TRUE; m_CurSelLine = -1; + m_bReadOnly = FALSE; } *************** *** 143,149 **** ON_WM_CONTEXTMENU() ON_COMMAND(ID_VIEW_OUTPUT, OnViewOutput) ! ON_WM_TIMER() ! ON_COMMAND(ID_OUTPUT_CLEAR, OnOutputClear) ! ON_COMMAND(ID_OUTPUT_COPY, OnOutputCopy) ON_COMMAND(ID_OUTPUT_COPYLINE, OnOutputCopyline) ON_COMMAND(ID_OUTPUT_ERROR, OnOutputError) --- 144,148 ---- ON_WM_CONTEXTMENU() ON_COMMAND(ID_VIEW_OUTPUT, OnViewOutput) ! ON_COMMAND(ID_EDIT_CLEAR_ALL, OnOutputClear) ON_COMMAND(ID_OUTPUT_COPYLINE, OnOutputCopyline) ON_COMMAND(ID_OUTPUT_ERROR, OnOutputError) *************** *** 151,154 **** --- 150,155 ---- ON_CONTROL_REFLECT(EN_CHANGE, OnChange) ON_COMMAND(ID_EDIT_COPY, OnEditCopy) + ON_WM_TIMER() + ON_WM_CHAR() //}}AFX_MSG_MAP END_MESSAGE_MAP() *************** *** 204,211 **** void COutputEdit::OnLButtonDown(UINT nFlags, CPoint point) { - //CEdit::OnLButtonDown(nFlags, point); - // TODO: Add your message handler code here and/or call default Default(); - //UpdateWindow(); DrawLine(FALSE); } --- 205,209 ---- *************** *** 213,229 **** void COutputEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { ! // TODO: Add your message handler code here and/or call default Default(); - //UpdateWindow(); DrawLine(FALSE); - //CEdit::OnKeyDown(nChar, nRepCnt, nFlags); - } void COutputEdit::OnLButtonUp(UINT nFlags, CPoint point) { - // TODO: Add your message handler code here and/or call default Default(); - //UpdateWindow(); DrawLine(FALSE); } --- 211,224 ---- void COutputEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { ! if (m_bReadOnly) ! return; ! Default(); DrawLine(FALSE); } void COutputEdit::OnLButtonUp(UINT nFlags, CPoint point) { Default(); DrawLine(FALSE); } *************** *** 234,243 **** } ! void COutputEdit::SetDirectoryPath( CString szPath ) { ! szDirectoryPath = szPath; } ! BOOL COutputEdit::AddRegexToParser( CString parserLine, int fileGroup, int lineGroup, int msgGroup ) { //I know that it might look better to have an array of 3 integers passed as parameter --- 229,238 ---- } ! void COutputEdit::SetDirectoryPath(const CString& szPath ) { ! m_szDirectoryPath = szPath; } ! BOOL COutputEdit::AddRegexToParser(const CString& parserLine, int fileGroup, int lineGroup, int msgGroup ) { //I know that it might look better to have an array of 3 integers passed as parameter *************** *** 288,296 **** } - void COutputEdit::OnOutputCopy() - { - Copy(); - } - void COutputEdit::OnOutputCopyline() { --- 283,286 ---- *************** *** 333,346 **** // Check if the filename got is a full path. ! if( -1 == szFileName.ReverseFind('\\') && !szDirectoryPath.IsEmpty() ) { ! if( szDirectoryPath[ szDirectoryPath.GetLength() - 1 ] != '\\' ) { // Add an extra \ to the end of the directorypath ! szFileName = szDirectoryPath + "\\" + szFileName; } else { ! szFileName = szDirectoryPath + szFileName; } } --- 323,336 ---- // Check if the filename got is a full path. ! if( -1 == szFileName.ReverseFind('\\') && !m_szDirectoryPath.IsEmpty() ) { ! if( m_szDirectoryPath[ m_szDirectoryPath.GetLength() - 1 ] != '\\' ) { // Add an extra \ to the end of the directorypath ! szFileName = m_szDirectoryPath + "\\" + szFileName; } else { ! szFileName = m_szDirectoryPath + szFileName; } } *************** *** 443,445 **** { Copy(); ! } \ No newline at end of file --- 433,442 ---- { Copy(); ! } ! ! void COutputEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) ! { ! if (m_bReadOnly) ! return; ! CEdit::OnChar(nChar, nRepCnt, nFlags); ! } Index: OutputEdit.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OutputEdit.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OutputEdit.h 29 Jan 2005 17:55:12 -0000 1.5 --- OutputEdit.h 31 Jan 2005 22:55:51 -0000 1.6 *************** *** 45,49 **** afx_msg void OnViewOutput(); afx_msg void OnOutputClear(); - afx_msg void OnOutputCopy(); afx_msg void OnOutputCopyline(); afx_msg void OnOutputError(); --- 45,48 ---- *************** *** 51,78 **** afx_msg void OnChange(); afx_msg void OnEditCopy(); //}}AFX_MSG protected: ! int m_CurSelLine; ! int m_nCaretLine; BOOL m_bCanPaint; CSize m_sizeChar; ! CString szDirectoryPath; CRegexOutputParser m_OutputParser; protected: CString GetOutputLine(void); ! void DrawLine(BOOL bInPaint); ! void GetLineRect(int nLine, LPRECT lpRect); ! int GetCurLine(); ! BOOL CanParseLine(); ! void SetAutoScrollBars(); public: ! void ClearAll(); ! void AddString(LPCSTR lpszNewStr); ! void ClearOutputParser(); ! BOOL AddRegexToParser( CString parserLine, int fileGroup, int lineGroup, int msgGroup ); ! void SetDirectoryPath( CString szPath ); ! int GetCount(); DECLARE_MESSAGE_MAP() --- 50,80 ---- afx_msg void OnChange(); afx_msg void OnEditCopy(); + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); //}}AFX_MSG protected: ! int m_CurSelLine; ! int m_nCaretLine; BOOL m_bCanPaint; CSize m_sizeChar; ! CString m_szDirectoryPath; CRegexOutputParser m_OutputParser; + BOOL m_bReadOnly; protected: CString GetOutputLine(void); ! void DrawLine(BOOL bInPaint); ! void GetLineRect(int nLine, LPRECT lpRect); ! int GetCurLine(); ! BOOL CanParseLine(); ! void SetAutoScrollBars(); public: ! void ClearAll(); ! void AddString(LPCSTR lpszNewStr); ! void ClearOutputParser(); ! BOOL AddRegexToParser(const CString& parserLine, int fileGroup, int lineGroup, int msgGroup); ! void SetDirectoryPath(const CString& szPath ); ! int GetCount(); ! void SetReadOnly(BOOL bReadOnly = TRUE) {m_bReadOnly = bReadOnly;}; DECLARE_MESSAGE_MAP() Index: OutputBar.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OutputBar.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** OutputBar.cpp 29 Jan 2005 17:55:12 -0000 1.25 --- OutputBar.cpp 31 Jan 2005 22:55:43 -0000 1.26 *************** *** 58,62 **** ON_WM_CREATE() ON_WM_SIZE() ! //}}AFX_MSG_MAP ON_REGISTERED_MESSAGE(UPM_LINE, OnLine) ON_REGISTERED_MESSAGE(UPM_FINISHED, OnFinished) --- 58,62 ---- ON_WM_CREATE() ON_WM_SIZE() ! //}}AFX_MSG_MAP ON_REGISTERED_MESSAGE(UPM_LINE, OnLine) ON_REGISTERED_MESSAGE(UPM_FINISHED, OnFinished) *************** *** 115,141 **** // Create output panes: ! // const DWORD dwStyle = WS_HSCROLL|LBS_USETABSTOPS|LBS_HASSTRINGS|LBS_NOINTEGRALHEIGHT|WS_CHILD|WS_VISIBLE|WS_VSCROLL; ! m_wndOutputBuild.Create (WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|WS_VSCROLL|WS_HSCROLL|ES_WANTRETURN, rectClient, &m_wndTabs, 1); m_wndOutputBuild.SetFont (&m_Font); m_wndOutputBuild.SetTabStops(4); m_wndOutputBuild.SetOwner (this); ! m_wndOutputOutput.Create (WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|WS_VSCROLL|WS_HSCROLL|ES_WANTRETURN, rectClient, &m_wndTabs, 2); m_wndOutputOutput.SetFont (&m_Font); m_wndOutputOutput.SetTabStops(4); m_wndOutputOutput.SetOwner (this); ! m_wndOutputFind1.Create (WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|WS_VSCROLL|WS_HSCROLL|ES_WANTRETURN, rectClient, &m_wndTabs, 3); m_wndOutputFind1.SetFont (&m_Font); m_wndOutputFind1.SetTabStops(4); m_wndOutputFind1.SetOwner (this); ! m_wndOutputFind2.Create (WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|WS_VSCROLL|WS_HSCROLL|ES_WANTRETURN, rectClient, &m_wndTabs, 4); m_wndOutputFind2.SetFont (&m_Font); m_wndOutputFind2.SetTabStops(4); m_wndOutputFind2.SetOwner (this); ! m_wndEdit.Create (WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|WS_VSCROLL|WS_HSCROLL|ES_WANTRETURN, rectClient, &m_wndTabs, 5); m_wndEdit.SetFont (&m_Font); m_wndEdit.SetTabStops(4); --- 115,145 ---- // Create output panes: ! const DWORD dwStyle = WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|WS_VSCROLL|WS_HSCROLL|ES_WANTRETURN; ! m_wndOutputBuild.Create (dwStyle, rectClient, &m_wndTabs, 1); m_wndOutputBuild.SetFont (&m_Font); m_wndOutputBuild.SetTabStops(4); m_wndOutputBuild.SetOwner (this); + m_wndOutputBuild.SetReadOnly(); ! m_wndOutputOutput.Create (dwStyle, rectClient, &m_wndTabs, 2); m_wndOutputOutput.SetFont (&m_Font); m_wndOutputOutput.SetTabStops(4); m_wndOutputOutput.SetOwner (this); + m_wndOutputOutput.SetReadOnly(); ! m_wndOutputFind1.Create (dwStyle, rectClient, &m_wndTabs, 3); m_wndOutputFind1.SetFont (&m_Font); m_wndOutputFind1.SetTabStops(4); m_wndOutputFind1.SetOwner (this); + m_wndOutputFind1.SetReadOnly(); ! m_wndOutputFind2.Create (dwStyle, rectClient, &m_wndTabs, 4); m_wndOutputFind2.SetFont (&m_Font); m_wndOutputFind2.SetTabStops(4); m_wndOutputFind2.SetOwner (this); + m_wndOutputFind2.SetReadOnly(); ! m_wndEdit.Create (dwStyle, rectClient, &m_wndTabs, 5); m_wndEdit.SetFont (&m_Font); m_wndEdit.SetTabStops(4); *************** *** 143,147 **** // Fill view context, but only if Splash Screen is on. ! if( theApp.GetConfigFile()->GetSplashScreen() ) FillBuildWindow(); // Attach views to tab: --- 147,152 ---- // Fill view context, but only if Splash Screen is on. ! if (theApp.GetConfigFile()->GetSplashScreen()) ! FillBuildWindow(); // Attach views to tab: Index: AnyEdit.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.rc,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** AnyEdit.rc 27 Jan 2005 13:34:55 -0000 1.111 --- AnyEdit.rc 31 Jan 2005 22:55:39 -0000 1.112 *************** *** 615,620 **** POPUP "Popup" BEGIN ! MENUITEM "&Copy", ID_OUTPUT_COPY ! MENUITEM "C&lear", ID_OUTPUT_CLEAR MENUITEM SEPARATOR MENUITEM "&Go To Line", ID_OUTPUT_ERROR --- 615,620 ---- POPUP "Popup" BEGIN ! MENUITEM "&Copy", ID_EDIT_COPY ! MENUITEM "C&lear", ID_EDIT_CLEAR_ALL MENUITEM SEPARATOR MENUITEM "&Go To Line", ID_OUTPUT_ERROR *************** *** 1921,1925 **** IDD_PREF_EXTEN DIALOGEX 0, 0, 295, 192 STYLE WS_CHILD ! FONT 8, "MS Sans Serif" BEGIN LTEXT "File Filters",IDC_STATIC,7,7,131,10 --- 1921,1925 ---- IDD_PREF_EXTEN DIALOGEX 0, 0, 295, 192 STYLE WS_CHILD ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "File Filters",IDC_STATIC,7,7,131,10 Index: OutputBar.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/OutputBar.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** OutputBar.h 29 Jan 2005 17:55:12 -0000 1.11 --- OutputBar.h 31 Jan 2005 22:55:51 -0000 1.12 *************** *** 67,71 **** afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSize(UINT nType, int cx, int cy); ! //}}AFX_MSG afx_msg LRESULT OnLine(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnFinished(WPARAM wParam, LPARAM lParam); --- 67,71 ---- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSize(UINT nType, int cx, int cy); ! //}}AFX_MSG afx_msg LRESULT OnLine(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnFinished(WPARAM wParam, LPARAM lParam); |