Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

WndHelp.cpp

Go to the documentation of this file.
00001 //
00002 // WndHelp.cpp
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "WndHelp.h"
00025 #include "Skin.h"
00026 
00027 #ifdef _DEBUG
00028 #define new DEBUG_NEW
00029 #undef THIS_FILE
00030 static char THIS_FILE[] = __FILE__;
00031 #endif
00032 
00033 IMPLEMENT_SERIAL(CHelpWnd, CPanelWnd, 1)
00034 
00035 BEGIN_MESSAGE_MAP(CHelpWnd, CPanelWnd)
00036         //{{AFX_MSG_MAP(CHelpWnd)
00037         ON_WM_CREATE()
00038         ON_WM_DESTROY()
00039         ON_WM_SIZE()
00040         //}}AFX_MSG_MAP
00041 END_MESSAGE_MAP()
00042 
00043 #define PANEL_WIDTH             200
00044 #define TOOLBAR_HEIGHT  28
00045 
00046 
00048 // CHelpWnd     construction
00049 
00050 CHelpWnd::CHelpWnd() : CPanelWnd( TRUE, FALSE )
00051 {
00052         Create( IDR_HELPFRAME );
00053 }
00054 
00055 CHelpWnd::~CHelpWnd()
00056 {
00057 }
00058 
00060 // CHelpWnd message handlers
00061 
00062 int CHelpWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
00063 {
00064         if ( CPanelWnd::OnCreate( lpCreateStruct ) == -1 ) return -1;
00065 
00066         CRect rect( 0, 0, 0, 0 );
00067 
00068         if ( ! m_wndToolBar.Create( this, WS_CHILD|WS_VISIBLE|CBRS_NOALIGN, AFX_IDW_TOOLBAR ) ) return -1;
00069         m_wndToolBar.SetBarStyle( m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_BORDER_TOP );
00070         m_wndPanel.Create( WS_CHILD|WS_VISIBLE, rect, this, 100 );
00071         m_wndView.Create( WS_CHILD|WS_VISIBLE, rect, this, 100 );
00072 
00073         LoadState();
00074 
00075         return 0;
00076 }
00077 
00078 void CHelpWnd::OnDestroy()
00079 {
00080         SaveState();
00081         CPanelWnd::OnDestroy();
00082 }
00083 
00084 void CHelpWnd::OnSkinChange()
00085 {
00086         CPanelWnd::OnSkinChange();
00087         Skin.CreateToolBar( _T("CHelpWnd"), &m_wndToolBar );
00088         // m_wndPanel.OnSkinChange();
00089 }
00090 
00091 void CHelpWnd::OnSize(UINT nType, int cx, int cy)
00092 {
00093         if ( nType != 1982 ) CPanelWnd::OnSize( nType, cx, cy );
00094 
00095         CRect rc;
00096         GetClientRect( &rc );
00097 
00098         HDWP hDWP = BeginDeferWindowPos( 3 );
00099 
00100         DeferWindowPos( hDWP, m_wndToolBar, HWND_TOP, PANEL_WIDTH, rc.bottom - TOOLBAR_HEIGHT, rc.right - PANEL_WIDTH, TOOLBAR_HEIGHT, 0 );
00101         DeferWindowPos( hDWP, m_wndPanel, NULL, 0, 0, PANEL_WIDTH, rc.bottom, SWP_NOZORDER );
00102         DeferWindowPos( hDWP, m_wndView, NULL, PANEL_WIDTH, 0, rc.right - PANEL_WIDTH, rc.bottom - TOOLBAR_HEIGHT, SWP_NOZORDER );
00103 
00104         EndDeferWindowPos( hDWP );
00105 }
00106 
00107 BOOL CHelpWnd::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
00108 {
00109         if ( m_wndToolBar.m_hWnd != NULL )
00110         {
00111                 if ( m_wndToolBar.OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ) ) return TRUE;
00112         }
00113 
00114         return CPanelWnd::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo );
00115 }

Generated on Thu Dec 15 10:39:52 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2