// XTOutBarCtrl.cpp : implementation of the CXTOutBarCtrl class.
//
// This file is a part of the XTREME TOOLKIT PRO MFC class library.
// �1998-2005 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF CODEJOCK SOFTWARE.
//
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// support@codejock.com
// http://www.codejock.com
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "XTPResourceManager.h"
#include "XTPColorManager.h"
#include "XTPDrawHelpers.h"
#include "XTResource.h"
#include "XTDefines.h"
#include "XTUtil.h"
#include "XTGlobal.h"
#include "XTVC50Helpers.h"
#include "XTWndHook.h"
#include "XTFlatComboBox.h"
#include "XTOutBarCtrl.h"
#include "XTMemDC.h"
#include "XTOutBarTheme.h"
#include "XTFunctions.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CXTOutBarEditItem
CXTOutBarEditItem::CXTOutBarEditItem()
{
m_iIndex = -1;
m_pParentWnd = NULL;
m_bSmallIcons = false;
m_bEscapeKey = false;
m_bIsFolder = false;
}
CXTOutBarEditItem::~CXTOutBarEditItem()
{
}
IMPLEMENT_DYNAMIC(CXTOutBarEditItem, CXTEdit)
BEGIN_MESSAGE_MAP(CXTOutBarEditItem, CXTEdit)
//{{AFX_MSG_MAP(CXTOutBarEditItem)
ON_WM_KILLFOCUS()
ON_WM_CHAR()
ON_WM_SETCURSOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CXTOutBarEditItem::OnKillFocus(CWnd* /*pNewWnd*/)
{
PostMessage( WM_CLOSE );
if ( !m_bEscapeKey )
{
GetWindowText( m_strText );
if ( !m_strText.IsEmpty( ) )
{
m_pParentWnd->EndLabelEdit( this, m_bIsFolder );
}
}
}
BOOL CXTOutBarEditItem::PreTranslateMessage(MSG* pMsg)
{
switch ( pMsg->wParam )
{
case VK_ESCAPE:
{
m_bEscapeKey = TRUE; // fall thru
}
case VK_RETURN:
{
PostMessage( WM_CLOSE );
return TRUE;
}
}
return CXTEdit::PreTranslateMessage(pMsg);
}
void CXTOutBarEditItem::PostNcDestroy()
{
delete this;
}
BOOL CXTOutBarEditItem::Create(LPCTSTR lpszText, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, UINT nIndex, bool bIsFolder, bool bSmallIcons)
{
ASSERT_VALID( pParentWnd ); // must be valid.
m_pParentWnd = ( CXTOutBarCtrl* )pParentWnd;
ASSERT_KINDOF( CXTOutBarCtrl, m_pParentWnd ); // must be an outlook bar control.
// get the inside size of the outlook bar.
CRect rcInside;
m_pParentWnd->GetInsideRect( rcInside );
rcInside.DeflateRect(5,5);
// adjust the size if necessary.
m_rcOriginal = rect;
m_bSmallIcons = bSmallIcons;
m_bIsFolder = bIsFolder;
m_iIndex = nIndex;
m_strText = lpszText;
if ( m_rcOriginal.Width( ) > rcInside.Width( ) )
{
if ( m_bSmallIcons != TRUE )
{
m_rcOriginal.left = rcInside.left;
}
m_rcOriginal.right = rcInside.right;
}
if (!CXTEdit::Create(dwStyle, m_rcOriginal, pParentWnd, nID))
return FALSE;
if (!CXTEdit::Initialize(m_pParentWnd))
return FALSE;
SetFont( m_pParentWnd->GetFontX( ) );
SetWindowText( m_strText );
return TRUE;
}
void CXTOutBarEditItem::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// if this is a folder, do default processing.
if ( m_bIsFolder )
{
CXTEdit::OnChar(nChar, nRepCnt, nFlags);
return;
}
// if the escape or return key has been pressed, abort edit.
else if ( nChar == VK_ESCAPE || nChar == VK_RETURN )
{
if ( nChar == VK_ESCAPE )
{
m_bEscapeKey = TRUE;
}
m_pParentWnd->SetFocus( );
return;
}
CXTEdit::OnChar(nChar, nRepCnt, nFlags);
// get the inside size of the outlook bar.
CRect rcInside;
m_pParentWnd->GetInsideRect( rcInside );
rcInside.DeflateRect(5,5);
// get the edit box text
CString strText;
GetWindowText( strText );
// get the font used by the outlook bar.
CFont* pFont = m_pParentWnd->GetFontX( );
ASSERT( pFont && pFont->GetSafeHandle( ) );
// select the font used by the outlook bar.
CWindowDC dc( NULL );
// get the size of the text string.
CFont* f = dc.SelectObject( pFont );
CSize sz = dc.GetTextExtent( strText );
dc.SelectObject( f );
// construct the edit box size.
CRect rcItem = m_rcOriginal;
// calculate the width of the edit box.
if ( m_bSmallIcons == TRUE )
{
rcItem.right = rcItem.left + sz.cx + 9;
if ( rcItem.right < m_rcOriginal.right )
{
rcItem.right = m_rcOriginal.right;
}
else if ( rcItem.right > rcInside.right )
{
rcItem.right = rcInside.right;
}
}
else
{
int x = ( rcInside.Width( )-sz.cx )/2;
rcItem.left = rcInside.left + x;
rcItem.right = rcItem.left + sz.cx;
rcItem.InflateRect( 6,0 );
if ( rcItem.Width( ) < m_rcOriginal.Width( ) )
{
rcItem = m_rcOriginal;
}
else if ( rcItem.Width( ) > rcInside.Width( ) )
{
rcItem.left = rcInside.left;
rcItem.right = rcInside.right;
}
}
// resize the edit box.
MoveWindow( &rcItem );
}
BOOL CXTOutBarEditItem::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
HCURSOR hCursor = ::LoadCursor( NULL, IDC_IBEAM );
if ( hCursor != NULL )
{
::SetCursor( hCursor );
return TRUE;
}
return CXTEdit::OnSetCursor(pWnd, nHitTest, message);
}
/////////////////////////////////////////////////////////////////////////////
// CXTOutBarCtrl
IMPLEMENT_THEME_HOST(CXTOutBarCtrl, CXTOutBarTheme)
CXTOutBarCtrl::CXTOutBarCtrl()
: CXTThemeManagerStyleHost(GetThemeFactoryClass())
, m_penBlack(PS_SOLID, 1, RGB(0,0,0))
{
m_rcUpArrow.SetRectEmpty();
m_rcDownArrow.SetRectEmpty();
m_dwFlags = OBS_XT_DEFAULT;
m_pLargeImageList = NULL;
m_pSmallImageList = NULL;
m_sizeOffset.cx = 4;
m_sizeOffset.cy = 3;
m_sizeMargin.cx = 5;
m_sizeMargin.cy = 5;
m_nFolderHeight = 22;
m_nSelFolder = 0;
m_nLastFolderSelected = -1;
m_nFolderHilighted = -1;
m_nLastItemSelected = -1;
m_nItemHilighted = -1;
m_nLastDragItemDraw = -1;
m_nLastDragItemDrawType = -1;
m_nFirstItem = 0;
m_nIconSpacingSmall = 10;
m_nIconSpacingLarge = 8;
m_nAnimationTickCount = 10;
m_nSelAnimCount = 0;
m_nSelAnimTiming = 0;
m_nHitInternal1 = 0;
m_nHitInternal2 = 0;
m_bUpArrow = FALSE;
m_bDownArrow = FALSE;
m_bUpPressed = FALSE;
m_bDownPressed = FALSE;
m_bLooping = FALSE;
m_bPressedHighlight = FALSE;
m_bIconPressed = FALSE;
SetFontX(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
}
CXTOutBarCtrl::~CXTOutBarCtrl()
{
int iFolder;
for (iFolder = 0; iFolder < m_arFolder.GetSize(); iFolder++)
{
m_nSelFolder = iFolder;
CXTOutBarFolder* pBarFolder = (CXTOutBarFolder*)m_arFolder.GetAt(iFolder);
SAFE_DELETE( pBarFolder );
}
m_arFolder.RemoveAll();
m_penBlack.DeleteObject();
m_font.DeleteObject();
}
IMPLEMENT_DYNCREATE(CXTOutBarCtrl, CWnd)
BEGIN_MESSAGE_MAP(CXTOutBarCtrl, CWnd)
//{{AFX_MSG_MAP(CXTOutBarCtrl)
ON_WM_TIMER()
ON_WM_PAINT()
ON_WM_ERASEBKGND()
ON_WM_MOUSEMOVE()
ON_MESSAGE_VOID(WM_MOUSELEAVE, OnMouseLeave)
ON_WM_LBUTTONDOWN()
ON_WM_SETCURSOR()
ON_WM_SIZE()
ON_COMMAND(XT_IDC_LARGEICON, OnLargeIcon)
ON_UPDATE_COMMAND_UI(XT_IDC_LARGEICON, OnUpdateLargeIcon)
ON_COMMAND(XT_IDC_SMALLICON, OnSmallIcon)
ON_UPDATE_COMMAND_UI(XT_IDC_SMALLICON, OnUpdateSmallIcon)
ON_COMMAND(XT_IDC_REMOVEITEM, OnRemoveItem)
ON_UPDATE_COMMAND_UI(
没有合适的资源?快使用搜索试试~ 我知道了~
PCSHARE最终版本源代码
共2000个文件
h:1163个
cpp:1054个
bmp:502个
5星 · 超过95%的资源 需积分: 17 102 下载量 195 浏览量
2014-07-30
11:53:26
上传
评论 6
收藏 45.95MB ZIP 举报
温馨提示
PcShare是一款功能强大的远程管理软件,可以在内网、外网任意位置随意管理需要的远程主机,有超强的隐藏和自我修复等功能。该软件是由国内安全爱好者无可非议开发,并授权freebuf独家发布,
资源推荐
资源详情
资源评论
收起资源包目录
PCSHARE最终版本源代码 (2000个子文件)
XTOutBarCtrl.cpp 86KB
XTPTaskPanelPaintManager.cpp 68KB
XTPImageManager.cpp 54KB
XTPDockingPanePaintManager.cpp 52KB
XTPTabClientWnd.cpp 46KB
XTPDockState.cpp 45KB
XTPTaskPanel.cpp 45KB
XTTreeBase.cpp 45KB
XTPPropExchange.cpp 44KB
XTPReportControl.cpp 44KB
XTTabCtrl.cpp 42KB
XTColorPageStandard.cpp 42KB
XTPCommandBar.cpp 41KB
XTHexEdit.cpp 40KB
propset.cpp 40KB
ReportSampleView.cpp 39KB
MyFileWnd.cpp 38KB
MyFileWnd.cpp 38KB
XTPTabPaintManagerAppearance.cpp 38KB
MyClientManaView.cpp 38KB
MyClientManaView.cpp 38KB
MyFunc.cpp 36KB
XTPImageEditor.cpp 34KB
XTPPaintManager.cpp 33KB
drawvw.cpp 32KB
wordpvw.cpp 32KB
XTPOffice2003Theme.cpp 32KB
XTEditListBox.cpp 32KB
MyMainTrans.cpp 32KB
XTPToolBar.cpp 31KB
XTSplitterWnd.cpp 31KB
XTShellTreeBase.cpp 31KB
XTPPopupBar.cpp 31KB
XTPCommandBars.cpp 30KB
XTDateTimeCtrl.cpp 30KB
XTFlatTabCtrl.cpp 30KB
MyMainTrans.cpp 30KB
XTPPropertyGridPaintManager.cpp 30KB
MainFrm.cpp 29KB
MyClientMain.cpp 29KB
PaneProperties.cpp 29KB
XTPDockingPaneAutoHidePanel.cpp 29KB
XTPReportHeader.cpp 29KB
XTPCustomizeSheet.cpp 29KB
XTPDockingPaneContext.cpp 28KB
XTPOfficeTheme.cpp 27KB
wordpad.cpp 27KB
MyCreateClientDlg.cpp 27KB
XTCheckListBox.cpp 27KB
XTPControls.cpp 27KB
MyCreateClientDlg.cpp 27KB
XTPReportPaintManager.cpp 26KB
XTColorSelectorCtrl.cpp 26KB
MainFrm.cpp 26KB
XTPDefaultTheme.cpp 26KB
MainFrm.cpp 26KB
XTPDockingPaneManager.cpp 25KB
XTPPropertyGrid.cpp 25KB
XTPTabPaintManagerColors.cpp 25KB
MyMultView.cpp 25KB
MyMultView.cpp 25KB
MyServerTran.cpp 25KB
XTPTabPaintManager.cpp 24KB
PopupControlDemoDlg.cpp 24KB
MainFrm.cpp 24KB
MainFrm.cpp 24KB
MyServerTran.cpp 24KB
XTColorPageCustom.cpp 23KB
XTRegistryManager.cpp 22KB
XTShellListBase.cpp 22KB
XTPDockingPaneSplitterContainer.cpp 22KB
XTPDockingPaneTabbedContainer.cpp 22KB
Themes.cpp 22KB
XTFunctions.cpp 22KB
XTHtmlView.cpp 22KB
MainFrm.cpp 22KB
drawobj.cpp 22KB
XTTrayIcon.cpp 22KB
MyClientMain.cpp 22KB
ruler.cpp 22KB
XTPPropertyGridView.cpp 22KB
PaneIcons.cpp 21KB
XTMDIWndTab.cpp 21KB
XTPShortcutBar.cpp 21KB
XTPTabManager.cpp 21KB
XTPDrawHelpers.cpp 21KB
MainFrm.cpp 21KB
ListCtrlDlg.cpp 21KB
PcStart.cpp 20KB
MainFrm.cpp 20KB
XTPDockingPaneLayout.cpp 20KB
MainFrm.cpp 19KB
XTListBase.cpp 19KB
XTGlobal.cpp 19KB
XTHeaderTheme.cpp 19KB
MyMainFunc.cpp 19KB
XTPControlComboBox.cpp 19KB
XTPPopupControl.cpp 19KB
frame.cpp 19KB
frame.cpp 19KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
wz381882733
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页