資源簡介
可以作為畢設東西,也可以自己參照它做東西。這個界面很好,用odbc與sql連接。
代碼片段和文件信息
//?baseButton.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“qpglxt.h“
#include?“baseButton.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CbaseButton
CbaseButton::CbaseButton(UINT?NomalPicUINT?DownPicUINT?EnablePic)
{
?m_DownPic=DownPic;
?m_NomalPic=NomalPic;
?m_EnablePic=EnablePic;
}
CbaseButton::~CbaseButton()
{
}
BEGIN_MESSAGE_MAP(CbaseButton?CButton)
//{{AFX_MSG_MAP(CbaseButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CbaseButton?message?handlers
bool?CbaseButton::Drawit(CDC?*pDC?UINT?ResID)
{
CDC?memDC;
CBitmap?bit;
CBitmap*?pbit;
COLORREF?ColOldCol;
BITMAP?bitstruct;
bit.LoadBitmap(ResID);
bit.GetBitmap(&bitstruct);
memDC.CreateCompatibleDC(pDC);
pbit=memDC.Selectobject(&bit);
OldCol=memDC.GetPixel(00);
for(int?x=0;x {
for(int?y=0;y {
Col=memDC.GetPixel(xy);
if(Col!=OldCol)
pDC->SetPixel(xyCol);
}
}
memDC.DeleteDC();
bit.Deleteobject();
pbit->Deleteobject();
return?true;
}
void?CbaseButton::DrawItem(LPDRAWITEMSTRUCT?lpDrawItemStruct)?
{
CDC*?pDC;
pDC=CDC::FromHandle(lpDrawItemStruct->hDC);
UINT?state=lpDrawItemStruct->itemState;
CRect?focRectrect=lpDrawItemStruct->rcItem;
focRect.left=rect.left+3;
focRect.right=rect.right-3;
focRect.top=rect.top+3;
focRect.bottom=rect.bottom-3;
//寫按鈕文本
pDC->SetBkMode(TRANSPARENT);
CString?sCaption;
this->GetWindowText(sCaption);
if(state&ODS_SELECTED)
{
Drawit(pDCm_DownPic);
pDC->SetTextColor(RGB(255100100));
}
else
{
Drawit(pDCm_NomalPic);
pDC->SetTextColor(RGB(255255155));
}
if(state&ODS_FOCUS)
{
pDC->DrawFocusRect(&focRect);
lpDrawItemStruct->itemAction=ODA_FOCUS?;
}
if(state&ODS_DISABLED)
{
Drawit(pDCm_EnablePic);
pDC->SetTextColor(RGB(969696));
}
pDC->DrawText(sCaptionrectDT_CENTER|DT_VCENTER|DT_SINGLELINE);
}
BOOL?CbaseButton::PreTranslateMessage(MSG*?pMsg)?
{
if(pMsg->hwnd==this->GetSafeHwnd()&&pMsg->message==WM_KEYDOWN?&&?pMsg->wParam==13)
{
pMsg->lParam=589857;
pMsg->message=WM_LBUTTONDOWN;
}
if(pMsg->hwnd==this->GetSafeHwnd()&&pMsg->message==WM_KEYUP?&&?pMsg->wParam==13)
{
pMsg->lParam=589857;
pMsg->message=WM_LBUTTONUP;
}
return?CButton::PreTranslateMessage(pMsg);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????2228224??2006-02-28?13:54??物資管理系統\databa
?????文件????1048576??2006-02-28?13:54??物資管理系統\databa
?????文件????5170188??2006-02-28?13:54??物資管理系統\源程序\11qpglxt.aps
?????文件???????2578??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1356??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1608??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1423??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件????????939??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1285??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件????????835??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1197??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1385??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1332??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1424??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件???????1292??2006-02-28?13:54??物資管理系統\源程序\ba
?????文件?????232614??2006-02-28?13:54??物資管理系統\源程序\BMP\BMPBackF.bmp
?????文件?????232614??2006-02-28?13:54??物資管理系統\源程序\BMP\BMPINPUT.bmp
?????文件?????232614??2006-02-28?13:54??物資管理系統\源程序\BMP\BMPKCPD.bmp
?????文件?????232614??2006-02-28?13:54??物資管理系統\源程序\BMP\BMPSELL.bmp
?????文件?????232614??2006-02-28?13:54??物資管理系統\源程序\BMP\BMPSELLBACK.bmp
?????文件?????232614??2006-02-28?13:54??物資管理系統\源程序\BMP\BMPTH.bmp
?????文件???????6086??2006-02-28?13:54??物資管理系統\源程序\BMP\BUTDOWN.bmp
?????文件???????6086??2006-02-28?13:54??物資管理系統\源程序\BMP\BUTENABLED.bmp
?????文件???????6086??2006-02-28?13:54??物資管理系統\源程序\BMP\BUTUP.bmp
?????文件?????160974??2006-02-28?13:54??物資管理系統\源程序\BMP\login.bmp
?????文件??????44544??2006-02-28?13:54??物資管理系統\源程序\BMP\Thumbs.db
?????文件?????135334??2006-02-28?13:54??物資管理系統\源程序\BMP\查詢.bmp
?????文件????2089014??2006-02-28?13:54??物資管理系統\源程序\BMP\背景1024_768.bmp
?????文件????1296054??2006-02-28?13:54??物資管理系統\源程序\BMP\背景800_600.bmp
?????文件???????6750??2006-02-28?13:54??物資管理系統\源程序\DBackFactry.cpp
............此處省略195個文件信息
- 上一篇:SGM C++代碼 VS2013
- 下一篇:C++參考大全 第四版 高清掃描版
評論
共有 條評論