From: Leon W. <moo...@us...> - 2005-02-03 14:42:24
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10900 Modified Files: AnyEditChildFrame.cpp Log Message: Bugfix: If the MiniToolbar setting was off in the Preferences, the control did not get created. The menu command update function expect it to be available to know if it is visible. So it caused a crash. The fix now always creates the control, but the visible style depends on the MiniToolbar setting in the Preferences. Index: AnyEditChildFrame.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEditChildFrame.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AnyEditChildFrame.cpp 30 Sep 2004 09:42:58 -0000 1.8 --- AnyEditChildFrame.cpp 3 Feb 2005 14:42:11 -0000 1.9 *************** *** 1,2 **** --- 1,26 ---- + /**************************************************************************** + Copyright (C) AnyEdit Team + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. + + http://www.anyedit.org + *****************************************************************************/ + // AnyEditChildFrame.cpp : implementation file // *************** *** 58,77 **** return -1; EnableDocking(CBRS_ALIGN_ANY); - CRegProfile reg; ! if( theApp.GetConfigFile()->GetMiniToolbar() ) ! { ! if (!m_wndTool.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM ! | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), AFX_IDW_TOOLBAR + 7) || ! !m_wndTool.LoadToolBar(IDR_VIEW)) ! { ! TRACE0("Failed to create toolbar 1\n"); ! return -1; // fail to create ! } ! m_wndTool.EnableDocking(CBRS_ALIGN_ANY); ! DockControlBar(&m_wndTool); } return 0; --- 82,101 ---- return -1; + DWORD dwStyle; + EnableDocking(CBRS_ALIGN_ANY); ! dwStyle = WS_CHILD | CBRS_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC; ! if( theApp.GetConfigFile()->GetMiniToolbar() ) dwStyle |= WS_VISIBLE; ! if (!m_wndTool.CreateEx(this, TBSTYLE_FLAT, dwStyle, CRect(0,0,0,0), AFX_IDW_TOOLBAR + 7) || ! !m_wndTool.LoadToolBar(IDR_VIEW)) ! { ! TRACE0("Failed to create Mini Toolbar\n"); ! return -1; // fail to create } + + m_wndTool.EnableDocking(CBRS_ALIGN_ANY); + DockControlBar(&m_wndTool); return 0; |