您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetStyle函数代码示例

51自学网 2021-06-01 21:15:40
  C++
这篇教程C++ GetStyle函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetStyle函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStyle函数的具体用法?C++ GetStyle怎么用?C++ GetStyle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetStyle函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DrawItem

void CUploadListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){	if (!theApp.emuledlg->IsRunning())		return;	if (!lpDrawItemStruct->itemData)		return;	CDC* odc = CDC::FromHandle(lpDrawItemStruct->hDC);	BOOL bCtrlFocused = ((GetFocus() == this) || (GetStyle() & LVS_SHOWSELALWAYS));	if (lpDrawItemStruct->itemState & ODS_SELECTED) {		if (bCtrlFocused)			odc->SetBkColor(m_crHighlight);		else			odc->SetBkColor(m_crNoHighlight);	}	else		odc->SetBkColor(GetBkColor());	const CUpDownClient* client = (CUpDownClient*)lpDrawItemStruct->itemData;	CMemDC dc(odc, &lpDrawItemStruct->rcItem);	CFont* pOldFont = dc.SelectObject(GetFont());	CRect cur_rec(lpDrawItemStruct->rcItem);	COLORREF crOldTextColor = dc.SetTextColor((lpDrawItemStruct->itemState & ODS_SELECTED) ? m_crHighlightText : m_crWindowText);    if (client->GetSlotNumber() > theApp.uploadqueue->GetActiveUploadsCount()) {        dc.SetTextColor(::GetSysColor(COLOR_GRAYTEXT));    }	int iOldBkMode;	if (m_crWindowTextBk == CLR_NONE){		DefWindowProc(WM_ERASEBKGND, (WPARAM)(HDC)dc, 0);		iOldBkMode = dc.SetBkMode(TRANSPARENT);	}	else		iOldBkMode = OPAQUE;	CKnownFile* file = theApp.sharedfiles->GetFileByID(client->GetUploadFileID());	CHeaderCtrl *pHeaderCtrl = GetHeaderCtrl();	int iCount = pHeaderCtrl->GetItemCount();	cur_rec.right = cur_rec.left - 8;	cur_rec.left += 4;	CString Sbuffer;	for (int iCurrent = 0; iCurrent < iCount; iCurrent++)	{		int iColumn = pHeaderCtrl->OrderToIndex(iCurrent);		if (!IsColumnHidden(iColumn))		{			cur_rec.right += GetColumnWidth(iColumn);			switch (iColumn)			{				case 0:{					uint8 image;					if (client->IsFriend())						image = 4;					else if (client->GetClientSoft() == SO_EDONKEYHYBRID){						if (client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 8;						else							image = 7;					}					else if (client->GetClientSoft() == SO_MLDONKEY){						if (client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 6;						else							image = 5;					}					else if (client->GetClientSoft() == SO_SHAREAZA){						if(client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 10;						else							image = 9;					}					else if (client->GetClientSoft() == SO_AMULE){						if(client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 12;						else							image = 11;					}					else if (client->GetClientSoft() == SO_LPHANT){						if(client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 14;						else							image = 13;					}					else if (client->ExtProtocolAvailable()){						if(client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 3;						else							image = 1;					}					else{						if (client->credits->GetScoreRatio(client->GetIP()) > 1)							image = 2;						else							image = 0;					}					uint32 nOverlayImage = 0;					if ((client->Credits() && client->Credits()->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED))						nOverlayImage |= 1;					if (client->IsObfuscatedConnectionEstablished())						nOverlayImage |= 2;					int iIconPosY = (cur_rec.Height() > 16) ? ((cur_rec.Height() - 16) / 2) : 1;//.........这里部分代码省略.........
开发者ID:acat,项目名称:emule,代码行数:101,


示例2: do_open_image

/** Load image from disk, update imgr and imgf * @return true on success */static bool do_open_image(char const* filename) {  // MessageBox(NULL, filename, "opening image", 0);  if (imgf!=NULL) {    if (imgr!=NULL) { delete imgr; imgr=NULL; }    delete imgf; imgf=NULL;    if (filename2!=NULL) filename2[0]='-'; /* mark file closed */  }  // !! free  // !! check for errors  // !! generalize  SimBuffer::B loadHints;  #if 0  Image::Loader::reader_t reader=in_bmp_loader.checker(    "BM/0/0/0/0" "/0/0/0/0"    "/0/0/0/0" "/0/0/0/0", "", opt);  FILE *f=fopen(filename, "rb");  if (f==NULL) return false;  Image::Sampled *img=reader((Image::filep_t)f, loadHints);  fclose(f);  #endif  init_loader();  SamImageLoad args;  args.filename=filename;  args.loadHints=&loadHints;  Image::Sampled *img=(Image::Sampled*)do_samfun((SamArgs::samfun_t)do_image_load, &args);  if (img==NULL) return false;  // Image::load(filename, loadHints);  imgr=new WinImageRGB(CopyableAdapter(*img));  // Image::Sampled *imgrgb=img->toRGB(8);  // imgr=new WinImageRGB(img->getWd(), img->getHt());  // imgr->fill(0,0,(char)255);  // imgr->fromPPM8(imgrgb->getRowbeg());  assert(imgr!=NULL); /* `operator new' never returns NULL */  // HDC hdc_main=GetDC(hwnd_main);  imgf=new WinFastImage(hwnd_main, imgr->getHbitmap());  wd_last=imgf->getWd(); ht_last=imgf->getHt();  // ReleaseDC(hwnd_main, hdc_main);  slen_t len=strlen(filename);  if (filename2!=NULL) delete [] filename2;  strcpy(filename2=new char[len+3], ": ");  strcpy(filename2+2, filename);  SetWindowText(hwnd_main, filename2);  SetWindowLong(hwnd_main, GWL_STYLE, GetWindowLong(hwnd_main, GWL_STYLE)&~WS_THICKFRAME);  /* ^^^ The Win32 API way to say hwnd_main.setResizable(false); :-) */  InvalidateRect(hwnd_main, NULL, TRUE);#if 0    LONG fr_wd, fr_ht;  getFrameSize(hwnd_main, fr_wd, fr_ht);  // !! handle minimum window size  SetWindowPos(hwnd_main, NULL, 0, 0, fr_wd+imgf->getWd(), fr_ht+imgf->getHt(), SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER);  GdiFlush();  { /* Dat: strange, two iterations of getFrameSize + SetWindowPos is needed !! still bad */    getFrameSize(hwnd_main, fr_wd, fr_ht);    SetWindowPos(hwnd_main, NULL, 0, 0, fr_wd+imgf->getWd(), fr_ht+imgf->getHt(), SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER);  }BOOL CYourWndOrDialog::ResizeClient (int nWidth,  int nHeight, BOOL bRedraw) {                       RECT rcWnd;                       GetClientRect (&rcWnd);                       if(nWidth != -1)                        rcWnd.right = nWidth;                       if(nHeight != -1)                        rcWnd.bottom = nHeight;                       if(!::AdjustWindowRectEx(&rcWnd,                                                 GetStyle(),                                                 (!(GetStyle() & WS_CHILD)                        && GetMenu() != NULL)), GetExStyle()))                        return FALSE;                       UINT uFlags = SWP_NOZORDER | SWP_NOMOVE;                       if(!bRedraw)                        uFlags |= SWP_NOREDRAW;                       return SetWindowPos(NULL,                                            0, 0,                                            rcWnd.right - rcWnd.left,                                            rcWnd.bottom - rcWnd.top,                                            uFlags);                      } // CYourWndOrDialog::ResizeClient
开发者ID:endriff,项目名称:sam2p,代码行数:84,


示例3: OnPaint

void CKofBCGPFontComboBox::OnPaint(){	if ((GetStyle () & 0x0003L) == CBS_SIMPLE)	{		Default ();		return;	}	if (!m_bVisualManagerStyle && !m_bOnGlass)	{		Default ();		return;	}	CPaintDC dc(this); // device context for painting	BYTE alpha = 0;	if (m_bOnGlass)	{		alpha = 255;	}	CBCGPMemDC memDC (dc, this, alpha);	CDC* pDC = &memDC.GetDC ();	CRect rectClient;	GetClientRect (rectClient);	CBCGPDrawManager dm (*pDC);	dm.DrawRect (rectClient, globalData.clrWindow, (COLORREF)-1);//  得注释掉这句话// 	SendMessage (WM_PRINTCLIENT, (WPARAM) pDC->GetSafeHdc (), (LPARAM) PRF_CLIENT);	const int cxDropDown = ::GetSystemMetrics (SM_CXVSCROLL) + 4;	int nCurSel = GetCurSel();	if (CB_ERR != nCurSel)	{		if (m_Images.GetSafeHandle () == NULL)		{			CBCGPLocalResource locaRes;			m_Images.Create (IDB_BCGBARRES_FONT, nImageWidth, 0, RGB (255, 255, 255));		}		CFont fontSelected;		CFont* pOldFont = NULL;		CRect rc(rectClient);				rc.right -= cxDropDown;		CBCGPFontDesc* pDesc = (CBCGPFontDesc*)GetItemDataPtr(nCurSel);		if (pDesc != NULL)		{						if (pDesc->m_nType & (DEVICE_FONTTYPE | TRUETYPE_FONTTYPE))			{				CPoint ptImage (rc.left + 3, rc.top + (rc.Height () - nImageHeight) / 2);				m_Images.Draw (pDC, pDesc->GetImageIndex (), ptImage, ILD_NORMAL);			}			rc.left += nImageWidth + 9;			if (m_bDrawUsingFont && pDesc->m_nCharSet != SYMBOL_CHARSET)			{				LOGFONT lf;				globalData.fontRegular.GetLogFont (&lf);				lstrcpy (lf.lfFaceName, pDesc->m_strName);				if (pDesc->m_nCharSet != DEFAULT_CHARSET)				{					lf.lfCharSet = pDesc->m_nCharSet;				}				if (lf.lfHeight < 0)				{					lf.lfHeight -= 4;				}				else				{					lf.lfHeight += 4;				}				fontSelected.CreateFontIndirect (&lf);				pOldFont = pDC->SelectObject (&fontSelected);			}		}		CString strText;		GetLBText (nCurSel, strText);		pDC->DrawText (strText, rc, DT_SINGLELINE | DT_VCENTER);		if (pOldFont != NULL)		{			pDC->SelectObject (pOldFont);		}	}	m_rectBtn = rectClient;	m_rectBtn.left = m_rectBtn.right - cxDropDown;	m_rectBtn.DeflateRect (2, 2);	CBCGPDrawOnGlass dog (m_bOnGlass);//.........这里部分代码省略.........
开发者ID:kaffeel,项目名称:coolformat3.2,代码行数:101,


示例4: GetParamNode

wxObject *wxChoicebookXmlHandler::DoCreateResource(){    if (m_class == wxT("choicebookpage"))    {        wxXmlNode *n = GetParamNode(wxT("object"));        if ( !n )            n = GetParamNode(wxT("object_ref"));        if (n)        {            bool old_ins = m_isInside;            m_isInside = false;            wxObject *item = CreateResFromNode(n, m_choicebook, NULL);            m_isInside = old_ins;            wxWindow *wnd = wxDynamicCast(item, wxWindow);            if (wnd)            {                m_choicebook->AddPage(wnd, GetText(wxT("label")),                                           GetBool(wxT("selected")));                if ( HasParam(wxT("bitmap")) )                {                    wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);                    wxImageList *imgList = m_choicebook->GetImageList();                    if ( imgList == NULL )                    {                        imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() );                        m_choicebook->AssignImageList( imgList );                    }                    int imgIndex = imgList->Add(bmp);                    m_choicebook->SetPageImage(m_choicebook->GetPageCount()-1, imgIndex );                }            }            else                wxLogError(wxT("Error in resource."));            return wnd;        }        else        {            wxLogError(wxT("Error in resource: no control within choicebook's <page> tag."));            return NULL;        }    }    else    {        XRC_MAKE_INSTANCE(nb, wxChoicebook)        nb->Create(m_parentAsWindow,                   GetID(),                   GetPosition(), GetSize(),                   GetStyle(wxT("style")),                   GetName());        wxChoicebook *old_par = m_choicebook;        m_choicebook = nb;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_choicebook, true/*only this handler*/);        m_isInside = old_ins;        m_choicebook = old_par;        return nb;    }}
开发者ID:gitrider,项目名称:wxsj2,代码行数:66,


示例5: GetInPlaceActiveItem

//*************************************************************************************void CBCGPFrameWnd::RecalcLayout (BOOL bNotify){    if (m_bInRecalcLayout)        return;    m_bInRecalcLayout = TRUE;    BOOL bWasOleInPlaceActive = m_Impl.m_bIsOleInPlaceActive;    m_Impl.m_bIsOleInPlaceActive = FALSE;    COleClientItem*	pActiveItem = GetInPlaceActiveItem ();    if (pActiveItem != NULL && pActiveItem->m_pInPlaceFrame != NULL &&            pActiveItem->GetItemState () == COleClientItem::activeUIState)    {        m_Impl.m_bIsOleInPlaceActive = TRUE;        m_Impl.m_bHadCaption = (GetStyle () & WS_CAPTION) != 0;    }    if (!m_bIsMinimized)    {        CView* pView = GetActiveView ();        if (m_dockManager.IsPrintPreviewValid () ||                m_pNotifyHook != NULL)        {            if (pView != NULL && pView->IsKindOf (RUNTIME_CLASS (CBCGPPrintPreviewView)))            {                m_dockManager.RecalcLayout (bNotify);                CRect rectClient = m_dockManager.GetClientAreaBounds ();                pView->SetWindowPos (NULL, rectClient.left, rectClient.top,                                     rectClient.Width (), rectClient.Height (),                                     SWP_NOZORDER  | SWP_NOACTIVATE);            }            else            {                if (bNotify && m_pNotifyHook != NULL)                {                    ActiveItemRecalcLayout ();                }                else                {                    m_bInRecalcLayout = FALSE;                    CFrameWnd::RecalcLayout (bNotify);                    AdjustClientArea ();                }            }        }        else        {            m_dockManager.RecalcLayout (bNotify);            AdjustClientArea ();        }    }    m_bInRecalcLayout = FALSE;    if (bWasOleInPlaceActive != m_Impl.m_bIsOleInPlaceActive)    {        if (!m_Impl.m_bHadCaption)        {            if (m_Impl.m_bIsOleInPlaceActive)            {                ModifyStyle (0, WS_CAPTION);            }            else            {                ModifyStyle (WS_CAPTION, 0);            }        }        m_Impl.OnChangeVisualManager ();        SetWindowPos (NULL, -1, -1, -1, -1,                      SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED);    }}
开发者ID:cugxiangzhenwei,项目名称:WorkPlatForm,代码行数:79,


示例6: CalcPositionFromClientRect

	bool CWidget::CalcPositionFromClientRect(RECT *pRect) const	{		if (m_hwnd==nullptr)			return false;		return ::AdjustWindowRectEx(pRect,GetStyle(),FALSE,GetExStyle())!=FALSE;	}
开发者ID:nexus7ici,项目名称:TSTask,代码行数:6,


示例7: _

wxString wxNativeFontInfo::ToUserString() const{    wxString desc;    // first put the adjectives, if any - this is English-centric, of course,    // but what else can we do?    if ( GetUnderlined() )    {        desc << _("underlined");    }    if ( GetStrikethrough() )    {        desc << _(" strikethrough");    }    switch ( GetWeight() )    {        default:            wxFAIL_MSG( wxT("unknown font weight") );            wxFALLTHROUGH;        case wxFONTWEIGHT_NORMAL:            break;        case wxFONTWEIGHT_THIN:            desc << _(" thin");            break;        case wxFONTWEIGHT_EXTRALIGHT:            desc << _(" extra light");            break;        case wxFONTWEIGHT_LIGHT:            desc << _(" light");            break;        case wxFONTWEIGHT_MEDIUM:            desc << _(" medium");            break;        case wxFONTWEIGHT_SEMIBOLD:            desc << _(" semi bold");            break;        case wxFONTWEIGHT_BOLD:            desc << _(" bold");            break;        case wxFONTWEIGHT_EXTRABOLD:            desc << _(" extra bold");            break;        case wxFONTWEIGHT_HEAVY:            desc << _(" heavy");            break;        case wxFONTWEIGHT_EXTRAHEAVY:            desc << _(" extra heavy");            break;    }    switch ( GetStyle() )    {        default:            wxFAIL_MSG( wxT("unknown font style") );            wxFALLTHROUGH;        case wxFONTSTYLE_NORMAL:            break;            // we don't distinguish between the two for now anyhow...        case wxFONTSTYLE_ITALIC:        case wxFONTSTYLE_SLANT:            desc << _(" italic");            break;    }    wxString face = GetFaceName();    if ( !face.empty() )    {        if (face.Contains(' ') || face.Contains(';') || face.Contains(','))        {            face.Replace("'", "");                // eventually remove quote characters: most systems do not                // allow them in a facename anyway so this usually does nothing            // make it possible for FromUserString() function to understand            // that the different words which compose this facename are            // not different adjectives or other data but rather all parts            // of the facename            desc << wxT(" '") << face << wxT("'");        }        else            desc << wxT(' ') << face;    }    else // no face name specified    {        // use the family        wxString familyStr;//.........这里部分代码省略.........
开发者ID:catalinr,项目名称:wxWidgets,代码行数:101,


示例8: return

UINT CIconButtonCtrl::OnGetDlgCode(){	return ( GetStyle() & BS_DEFPUSHBUTTON ) ? DLGC_DEFPUSHBUTTON : DLGC_UNDEFPUSHBUTTON;}
开发者ID:GetEnvy,项目名称:Envy,代码行数:4,


示例9: sizeof

void CXTPSkinObjectTab::DrawTabText(CDC* pDC, CRect& rcItem, int iItem, int iCount,  BOOL bSelected){	CTabCtrl* pTabCtrl = (CTabCtrl*)this;	CString strCaption;	LPTSTR pszText = strCaption.GetBuffer(256);	pszText[0] = 0;	TC_ITEM tci;	tci.mask = TCIF_TEXT;	tci.pszText = pszText;	tci.cchTextMax = 255;	BOOL bResult = pTabCtrl->GetItem(iItem, &tci);	strCaption.ReleaseBuffer();#ifdef _UNICODE	if (!bResult)	{		char tText[256];		tText[0] = 0;		TC_ITEMA tcia;		::ZeroMemory(&tcia, sizeof(TC_ITEMA));		tcia.mask = TCIF_TEXT;		// Get the header item text and format		tcia.pszText = tText;		tcia.cchTextMax = 255;		::SendMessage(pTabCtrl->m_hWnd, TCM_GETITEMA, iItem, (LPARAM)&tcia);		strCaption = tText;	}#else	if (!bResult)		return;#endif	if (strCaption.GetLength() == 0)		return;	pDC->SetTextColor(GetColor(COLOR_BTNTEXT));	// Set the font for the tab label.	DWORD dwStyle = GetStyle();	CXTPSkinManagerClass* pClass = GetSkinClass();	int nStateId = bSelected ? TIS_SELECTED: m_nHotItem == iItem ? TIS_HOT : TIS_NORMAL;	int nPartId = iItem == 0 ? TABP_TOPTABITEMLEFTEDGE :		iItem == iCount - 1 && !bSelected ? TABP_TOPTABITEMRIGHTEDGE : TABP_TOPTABITEM;	// Draw the tab label.	if (IsHorz(dwStyle))	{		UINT dsFlags = DT_SINGLELINE | DT_VCENTER | DT_CENTER | DT_END_ELLIPSIS;		if (SendMessage(WM_QUERYUISTATE) & UISF_HIDEACCEL)		{			dsFlags |= DT_HIDEPREFIX;		}		if (!(GetStyle() & TCS_BUTTONS))		{			rcItem.top += bSelected ? -2 : 1;			rcItem.right -= iItem == 0 ? 3 : 0;		}		else		{			rcItem.top += bSelected ? 0 : -1;		}		pClass->DrawThemeText(pDC, nPartId, nStateId, strCaption, dsFlags, &rcItem);	}	else	{		CSize sz = pDC->GetTextExtent(strCaption);		rcItem.left = rcItem.right-(rcItem.Width()-sz.cy + 1)/ 2;		rcItem.top = rcItem.top+(rcItem.Height()-sz.cx + 1)/ 2;		pClass->DrawThemeText(pDC, nPartId, nStateId, strCaption, DT_SINGLELINE | DT_NOCLIP, &rcItem);	}}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:85,


示例10: rcItem

voidMFCSimpleTypeView::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){	int			m_bClientWidthSel = TRUE;	int			m_cxClient = 0;	int			m_cxStateImageOffset = 0;	COLORREF	m_clrText = ::GetSysColor(COLOR_WINDOWTEXT);	COLORREF	m_clrTextBk = ::GetSysColor(COLOR_WINDOW);	COLORREF	m_clrBkgnd = ::GetSysColor(COLOR_WINDOW);	CListCtrl& listCtrl=GetListCtrl();	CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);	CRect rcItem(lpDrawItemStruct->rcItem);	UINT uiFlags = ILD_TRANSPARENT;	CImageList* pImageList;	int nItem = lpDrawItemStruct->itemID;	BOOL bFocus = (GetFocus() == this);	COLORREF clrTextSave, clrBkSave;	COLORREF clrImage = m_clrBkgnd;	static _TCHAR szBuff[MAX_PATH];	LPCTSTR pszText;	StabEnt			*itemSym = SymForItem(nItem);// get item data	LV_ITEM lvi;	lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;	lvi.iItem = nItem;	lvi.iSubItem = 0;	lvi.pszText = szBuff;	lvi.cchTextMax = sizeof(szBuff);	lvi.stateMask = 0xFFFF;     // get all state flags	listCtrl.GetItem(&lvi);	BOOL bSelected = (bFocus || (GetStyle() & LVS_SHOWSELALWAYS)) && lvi.state & LVIS_SELECTED;	bSelected = bSelected || (lvi.state & LVIS_DROPHILITED);// set colors if item is selected	CRect rcAllLabels;	listCtrl.GetItemRect(nItem, rcAllLabels, LVIR_BOUNDS);	CRect rcLabel;	listCtrl.GetItemRect(nItem, rcLabel, LVIR_BOUNDS);//	listCtrl.GetItemRect(nItem, rcLabel, LVIR_LABEL);	rcAllLabels.left = rcLabel.left;	if (m_bClientWidthSel && rcAllLabels.right<m_cxClient)		rcAllLabels.right = m_cxClient;	if (bSelected)	{		clrTextSave = pDC->SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));		clrBkSave = pDC->SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));		pDC->FillRect(rcAllLabels, &CBrush(::GetSysColor(COLOR_HIGHLIGHT)));	}	else		pDC->FillRect(rcAllLabels, &CBrush(m_clrTextBk));// set color and mask for the icon	if (lvi.state & LVIS_CUT)	{		clrImage = m_clrBkgnd;		uiFlags |= ILD_BLEND50;	}	else if (bSelected) {		clrImage = ::GetSysColor(COLOR_HIGHLIGHT);		uiFlags |= ILD_BLEND50;	}// draw state icon	UINT nStateImageMask = lvi.state & LVIS_STATEIMAGEMASK;	if (nStateImageMask)	{		int nImage = (nStateImageMask>>12) - 1;		pImageList = listCtrl.GetImageList(LVSIL_STATE);		if (pImageList)		{			pImageList->Draw(pDC, nImage,				CPoint(rcItem.left, rcItem.top), ILD_TRANSPARENT);		}	}// draw normal and overlay icon/*	CRect rcIcon;	ListCtrl.GetItemRect(nItem, rcIcon, LVIR_ICON);	pImageList = listCtrl.GetImageList(LVSIL_SMALL);	if (pImageList)	{		UINT nOvlImageMask=lvi.state & LVIS_OVERLAYMASK;		if (rcItem.left<rcItem.right-1)		{			ImageList_DrawEx(pImageList->m_hImageList, lvi.iImage,					pDC->m_hDC,rcIcon.left,rcIcon.top, 16, 16,					m_clrBkgnd, clrImage, uiFlags | nOvlImageMask);		}	}*/// draw item label//.........这里部分代码省略.........
开发者ID:dakyri,项目名称:qua,代码行数:101,


示例11: GetPos

void CSliderCtrlEx::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) {	int loopMax = colorList.GetSize();	// number of color ranges to process	LPNMCUSTOMDRAW lpCustDraw = (LPNMCUSTOMDRAW)pNMHDR;	////////////////////////////////////////////////////////////////////////////////	// OnCustomDraw() is called at many different stages during the painting process	// of the control. We only care about the PREPAINT state or the ITEMPREPAINT	// state and not always then.	//	// If we want to be notified about subcontrol painting, we have to say so when	// we get the initial PREPAINT message.	////////////////////////////////////////////////////////////////////////////////	if(lpCustDraw->dwDrawStage == CDDS_PREPAINT)	{		// should we report slider's position?		int curVal = GetPos();		if((m_Callback != NULL)	&& (curVal != m_oldPosition))		{			m_oldPosition = curVal;			m_Callback(m_p2Object, m_data1, curVal, m_IsDragging);		}		// If we don't have any special coloring to do, skip all the silliness...		if(loopMax <= 0)		{			*pResult = CDRF_DODEFAULT;		}		else		{			// We want to be informed when each part of the control is being			// processed so we can intercept the channel drawing.			*pResult = CDRF_NOTIFYITEMDRAW;	// send messages for each piece-part		}		return;	}	///////////////////////////////////////////////////////////////////////////////	// A slider (track control) is drawn in several steps:	//	1. Erase	//	2. Tics	//	3. Channel	//	4. Thumb	//	// It would be nice to capture when the background has been painted and	// before the other sub-pieces have been painted. Then we could just	// substitute our own painting routine. But this doesn't seem to be	// available.	//	// So this routine captures the tics by inserting operations before	// painting the thumb.	//	// Look at the help on NMCUSTOMDRAW for complete details, but the pNMHDR	// pointer looks at a structure like:	//	// typedef struct tagNMCUSTOMDRAWINFO {    //	 NMHDR  hdr;    //	 DWORD  dwDrawStage;	// This indicates what stage of the drawing process is involved    //	 HDC    hdc;			// graphics context of the control (or sub-component)    //	 RECT   rc;    //	 DWORD  dwItemSpec;	// This is the particular piece-part of the slider involved    //	 UINT   uItemState;    //	 LPARAM lItemlParam;	// } NMCUSTOMDRAW	//	// The stages include CDDS_PREPAINT, which is just before painting of the entire	// control. However, unless the *pResult parameter is set to CDRF_NOTIFYITEMDRAW,	// we will get notification for the control as a whole, not for each piece-part.	// So the first thing to do is set *pResult. Thereafter, we must intercept	// the sub-parts.	//	// We don't care about painting the background (we will re-paint later on). We	// don't care about PREPAINT on the CHANNEL or the TICS since we will overwrite	// everything when we get to the THUMB.	/////////////////////////////////////////////////////////////////////////////////	if((lpCustDraw->dwDrawStage == CDDS_ITEMPREPAINT) && (lpCustDraw->dwItemSpec != TBCD_THUMB))	{		*pResult = CDRF_DODEFAULT;		return;	}	// get channel orientation	BOOL IsVertical = (TBS_VERT & GetStyle()) ? TRUE : FALSE;	// Get the coordinates of the control's window	CRect crect;	GetClientRect(crect);	// client coordinates (top = left = 0, bottom = height, right = width)	// Much of this is "paraphrased" from Nic Wilson's work -- see the header file	//////////////////////////////////////////////////////////////////////////////////	// This bit does the tics marks transparently.	// Create a memory dc to hold a copy of the oldbitmap data that includes the tics,	// because when we add the background in we will lose the tic marks.	///////////////////////////////////////////////////////////////////////////////////	CDC *pDC = CDC::FromHandle(lpCustDraw->hdc);	CDC SaveCDC;	CBitmap SaveCBmp;//.........这里部分代码省略.........
开发者ID:zekoman,项目名称:tibiaauto,代码行数:101,


示例12: rcItem

void CListCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){	CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);	CRect rcItem(lpDrawItemStruct->rcItem);	UINT uiFlags = ILD_TRANSPARENT;	CImageList* pImageList;	int nItem = lpDrawItemStruct->itemID;	BOOL bFocus = (GetFocus() == this);	COLORREF clrTextSave, clrBkSave;	COLORREF clrImage = m_clrBkgnd;	static _TCHAR szBuff[MAX_PATH];	LPCTSTR pszText;// get item data	LV_ITEM lvi;	lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;	lvi.iItem = nItem;	lvi.iSubItem = 0;	lvi.pszText = szBuff;	lvi.cchTextMax = sizeof(szBuff);	lvi.stateMask = 0xFFFF;     // get all state flags	GetItem(&lvi);	BOOL bSelected = (bFocus || (GetStyle() & LVS_SHOWSELALWAYS)) && lvi.state & LVIS_SELECTED;	bSelected = bSelected || (lvi.state & LVIS_DROPHILITED);// set colors if item is selected	CRect rcAllLabels;	GetItemRect(nItem, rcAllLabels, LVIR_BOUNDS);	CRect rcLabel;	GetItemRect(nItem, rcLabel, LVIR_LABEL);	rcAllLabels.left = rcLabel.left;	if (m_bClientWidthSel && rcAllLabels.right<m_cxClient)		rcAllLabels.right = m_cxClient;	// @@	clrTextSave = pDC->SetTextColor(colTextColor[0]);			if (bSelected)	{		//@@		//clrTextSave = pDC->SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));		clrBkSave = pDC->SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));		pDC->FillRect(rcAllLabels, &CBrush(::GetSysColor(COLOR_HIGHLIGHT)));	}	else		pDC->FillRect(rcAllLabels, &CBrush(m_clrTextBk));// set color and mask for the icon	if (lvi.state & LVIS_CUT)	{		clrImage = m_clrBkgnd;		uiFlags |= ILD_BLEND50;	}	else if (bSelected)	{		clrImage = ::GetSysColor(COLOR_HIGHLIGHT);		uiFlags |= ILD_BLEND50;	}// draw state icon	UINT nStateImageMask = lvi.state & LVIS_STATEIMAGEMASK;	if (nStateImageMask)	{		int nImage = (nStateImageMask>>12) - 1;		pImageList = GetImageList(LVSIL_STATE);		if (pImageList)		{			pImageList->Draw(pDC, nImage,				CPoint(rcItem.left, rcItem.top), ILD_TRANSPARENT);		}	}// draw normal and overlay icon	CRect rcIcon;	GetItemRect(nItem, rcIcon, LVIR_ICON);	pImageList = GetImageList(LVSIL_SMALL);	if (pImageList)	{		UINT nOvlImageMask=lvi.state & LVIS_OVERLAYMASK;		if (rcItem.left<rcItem.right-1)		{			ImageList_DrawEx(pImageList->m_hImageList, lvi.iImage,					pDC->m_hDC,rcIcon.left,rcIcon.top, 16, 16,					m_clrBkgnd, clrImage, uiFlags | nOvlImageMask);		}	}// draw item label	GetItemRect(nItem, rcItem, LVIR_LABEL);//.........这里部分代码省略.........
开发者ID:bugou,项目名称:test,代码行数:101,


示例13: return

BOOL CXTPSkinObjectFrame::HasCaption() const{    return (GetStyle() & WS_CAPTION) == WS_CAPTION;}
开发者ID:ylyking,项目名称:ThisIsASoftRenderer,代码行数:4,


示例14: GetLong

wxObject *wxRadioBoxXmlHandler::DoCreateResource(){    if ( m_class == wxT("wxRadioBox"))    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));        XRC_MAKE_INSTANCE(control, wxRadioBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("label")),                        GetPosition(), GetSize(),                        m_labels,                        GetLong(wxT("dimension"), 1),                        GetStyle(),                        wxDefaultValidator,                        GetName());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        const unsigned count = m_labels.size();        for( unsigned i = 0; i < count; i++ )        {#if wxUSE_TOOLTIPS            if ( !m_tooltips[i].empty() )                control->SetItemToolTip(i, m_tooltips[i]);#endif // wxUSE_TOOLTIPS#if wxUSE_HELP            if ( m_helptextSpecified[i] )                control->SetItemHelpText(i, m_helptexts[i]);#endif // wxUSE_HELP            if ( !m_isShown[i] )                control->Show(i, false);            if ( !m_isEnabled[i] )                control->Enable(i, false);        }        // forget information about the items of this radiobox, we should start        // afresh for the next one        m_labels.clear();#if wxUSE_TOOLTIPS        m_tooltips.clear();#endif // wxUSE_TOOLTIPS#if wxUSE_HELP        m_helptexts.clear();        m_helptextSpecified.clear();#endif // wxUSE_HELP        m_isShown.clear();        m_isEnabled.clear();        return control;    }    else // inside the radiobox element    {        // we handle handle <item>Label</item> constructs here, and the item        // tag can have tooltip, helptext, enabled and hidden attributes        wxString label = GetNodeContent(m_node);        wxString tooltip;        m_node->GetAttribute(wxT("tooltip"), &tooltip);        wxString helptext;        bool hasHelptext = m_node->GetAttribute(wxT("helptext"), &helptext);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)        {            label = wxGetTranslation(label, m_resource->GetDomain());            if ( !tooltip.empty() )                tooltip = wxGetTranslation(tooltip, m_resource->GetDomain());            if ( hasHelptext )                helptext = wxGetTranslation(helptext, m_resource->GetDomain());        }        m_labels.push_back(label);#if wxUSE_TOOLTIPS        m_tooltips.push_back(tooltip);#endif // wxUSE_TOOLTIPS#if wxUSE_HELP        m_helptexts.push_back(helptext);        m_helptextSpecified.push_back(hasHelptext);#endif // wxUSE_HELP        m_isEnabled.push_back(GetBoolAttr("enabled", 1));        m_isShown.push_back(!GetBoolAttr("hidden", 0));        return NULL;    }//.........这里部分代码省略.........
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:101,


示例15: dc

void CPartialGroupBox::OnPaint(HDC /*hDC*/){	CPaintDC dc(m_hWnd);	//paint groupbox manually	CRect controlrect;	GetClientRect(controlrect);	//::MapWindowPoints(HWND_DESKTOP, GetParent(), (LPPOINT)(LPRECT)controlrect, (sizeof(RECT)/sizeof(POINT)));	CFontHandle font = GetFont();	dc.SelectFont(font);	dc.SetMapMode(MM_TEXT);	dc.SelectBrush(GetSysColorBrush(COLOR_BTNFACE));	TCHAR grptext[MAX_PATH];	GetWindowText(grptext,MAX_PATH);	CRect fontsizerect(0,0,0,0);	dc.DrawText(grptext,-1,fontsizerect,DT_SINGLELINE|DT_LEFT|DT_CALCRECT);	CRect framerect(controlrect);	framerect.top += (fontsizerect.Height())/2;	long Style =  GetStyle();	if((Style & 0xF000) == BS_FLAT)	{		dc.Draw3dRect(framerect,RGB(0,0,0),RGB(0,0,0));		framerect.DeflateRect(1,1);		dc.Draw3dRect(framerect,RGB(255,255,255),RGB(255,255,255));	}	else	{		Draw3dLine(dc,framerect,GetSysColor(COLOR_3DSHADOW),GetSysColor(COLOR_3DHILIGHT));		framerect.DeflateRect(1,1);		Draw3dLine(dc,framerect,GetSysColor(COLOR_3DHILIGHT),GetSysColor(COLOR_3DSHADOW));	}	if(_tcslen(grptext))	{		CRect fontrect(controlrect);		fontrect.bottom = controlrect.top+fontsizerect.Height();		if((Style & 0xF00) == BS_RIGHT)		{			fontrect.right -= 6;			fontrect.left = fontrect.right - fontsizerect.Width();		}		else if((Style & 0xF00) == BS_CENTER)		{			fontrect.left += (controlrect.Width()-fontsizerect.Width())/2;			fontrect.right = fontrect.left + fontsizerect.Width();		}		else //BS_LEFT or default		{			fontrect.left += 6;			fontrect.right = fontrect.left + fontsizerect.Width();		}		fontrect.InflateRect(2,0);		dc.FillRect(fontrect,GetSysColor(COLOR_BTNFACE));		fontrect.DeflateRect(2,0);		//Draw Caption		dc.SetBkMode(OPAQUE);		dc.SetBkColor(GetSysColor(COLOR_BTNFACE));		dc.DrawText(grptext,-1,fontrect,DT_SINGLELINE|DT_LEFT);	}}
开发者ID:NexusTools,项目名称:P64-J,代码行数:71,


示例16: GetMDIFrame

void CMDIChildWnd::ActivateFrame(int nCmdShow){	BOOL bVisibleThen = (GetStyle() & WS_VISIBLE) != 0;	CMDIFrameWnd* pFrameWnd = GetMDIFrame();	ASSERT_VALID(pFrameWnd);	// determine default show command	if (nCmdShow == -1)	{		// get maximized state of frame window (previously active child)		BOOL bMaximized;		pFrameWnd->MDIGetActive(&bMaximized);		// convert show command based on current style		DWORD dwStyle = GetStyle();		if (bMaximized || (dwStyle & WS_MAXIMIZE))			nCmdShow = SW_SHOWMAXIMIZED;		else if (dwStyle & WS_MINIMIZE)			nCmdShow = SW_SHOWMINIMIZED;	}	// finally, show the window	CFrameWnd::ActivateFrame(nCmdShow);	// update the Window menu to reflect new child window	CMDIFrameWnd* pFrame = GetMDIFrame();	::SendMessage(pFrame->m_hWndMDIClient, WM_MDIREFRESHMENU, 0, 0);	// Note: Update the m_bPseudoInactive flag.  This is used to handle the	//  last MDI child getting hidden.  Windows provides no way to deactivate	//  an MDI child window.	BOOL bVisibleNow = (GetStyle() & WS_VISIBLE) != 0;	if (bVisibleNow == bVisibleThen)		return;	if (!bVisibleNow)	{		// get current active window according to Windows MDI		HWND hWnd = (HWND)::SendMessage(pFrameWnd->m_hWndMDIClient,			WM_MDIGETACTIVE, 0, 0);		if (hWnd != m_hWnd)		{			// not active any more -- window must have been deactivated			ASSERT(!m_bPseudoInactive);			return;		}		// check next window		ASSERT(hWnd != NULL);		pFrameWnd->MDINext();		// see if it has been deactivated now...		hWnd = (HWND)::SendMessage(pFrameWnd->m_hWndMDIClient,			WM_MDIGETACTIVE, 0, 0);		if (hWnd == m_hWnd)		{			// still active -- fake deactivate it			ASSERT(hWnd != NULL);			OnMDIActivate(FALSE, NULL, this);			m_bPseudoInactive = TRUE;   // so MDIGetActive returns NULL		}	}	else if (m_bPseudoInactive)	{		// if state transitioned from not visible to visible, but		//  was pseudo deactivated -- send activate notify now		OnMDIActivate(TRUE, this, NULL);		ASSERT(!m_bPseudoInactive); // should get set in OnMDIActivate!	}}
开发者ID:VectorDM,项目名称:VC98,代码行数:71,


示例17: GetClientRect

void CTextProgressCtrl::OnPaint() {    if (m_nMin >= m_nMax)         return;    COLORREF crBarColour, crBgColour;    crBarColour = (m_crBarClr == CLR_DEFAULT)? ::GetSysColor(COLOR_HIGHLIGHT) : m_crBarClr;    crBgColour = (m_crBgClr == CLR_DEFAULT)? ::GetSysColor(COLOR_WINDOW) : m_crBgClr;    CRect LeftRect, RightRect, ClientRect;    GetClientRect(ClientRect);    double Fraction = (double)(m_nPos - m_nMin) / ((double)(m_nMax - m_nMin));    CPaintDC PaintDC(this); // device context for painting    CMemDC dc(&PaintDC);    //CPaintDC dc(this);    // device context for painting (if not double buffering)    dc.SelectObject(GetParent()->GetFont()); // pja July 1, 2001    // Draw Bar    LeftRect = RightRect = ClientRect;#ifdef PBS_VERTICAL    DWORD dwStyle = GetStyle();    if (dwStyle & PBS_VERTICAL)    {        LeftRect.top = LeftRect.bottom - (int)((LeftRect.bottom - LeftRect.top)*Fraction);        RightRect.bottom = LeftRect.top;    }    else#endif    {        LeftRect.right = LeftRect.left + (int)((LeftRect.right - LeftRect.left)*Fraction);        RightRect.left = LeftRect.right;    }    dc.FillSolidRect(LeftRect, crBarColour);    dc.FillSolidRect(RightRect, crBgColour);    // Draw Text if not vertical    if (m_bShowText#ifdef PBS_VERTICAL        && (dwStyle & PBS_VERTICAL) == 0#endif        )    {        CString str;        if (m_strText.GetLength())            str = m_strText;        else            str.Format("%d%%", (int)(Fraction*100.0));        dc.SetBkMode(TRANSPARENT);        DWORD dwTextStyle = DT_CENTER | DT_VCENTER | DT_SINGLELINE;        // If we are drawing vertical, then create a new verticla font        // based on the current font (only works with TrueType fonts)        CFont font, *pOldFont = NULL;#ifdef PBS_VERTICAL        if (dwStyle & PBS_VERTICAL)        {            LOGFONT lf;            GetFont()->GetLogFont(&lf);            lf.lfEscapement = lf.lfOrientation = 900;            font.CreateFontIndirect(&lf);            pOldFont = (CFont*) dc.SelectObject(&font);            dwTextStyle = DT_VCENTER|DT_CENTER|DT_SINGLELINE;        }#endif        CRgn rgn;        rgn.CreateRectRgn(LeftRect.left, LeftRect.top, LeftRect.right, LeftRect.bottom);        dc.SelectClipRgn(&rgn);        dc.SetTextColor(m_crTextClr == CLR_DEFAULT ? crBgColour : m_crTextClr);        dc.DrawText(str, ClientRect, dwTextStyle);        rgn.DeleteObject();        rgn.CreateRectRgn(RightRect.left, RightRect.top, RightRect.right, RightRect.bottom);        dc.SelectClipRgn(&rgn);        dc.SetTextColor(m_crTextClr == CLR_DEFAULT ? crBarColour : m_crTextClr);        dc.DrawText(str, ClientRect, dwTextStyle);        if (pOldFont)        {            dc.SelectObject(pOldFont);            font.DeleteObject();        }    }}
开发者ID:vicentdsmin,项目名称:myie,代码行数:92,


示例18: ReportError

wxObject *wxBitmapComboBoxXmlHandler::DoCreateResource(){    if (m_class == wxT("ownerdrawnitem"))    {        if ( !m_combobox )        {            ReportError("ownerdrawnitem only allowed within a wxBitmapComboBox");            return NULL;        }        m_combobox->Append(GetText(wxT("text")),                           GetBitmap(wxT("bitmap")));        return m_combobox;    }    else /*if( m_class == wxT("wxBitmapComboBox"))*/    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        XRC_MAKE_INSTANCE(control, wxBitmapComboBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("value")),                        GetPosition(), GetSize(),                        0,                        NULL,                        GetStyle(),                        wxDefaultValidator,                        GetName());        m_isInside = true;        m_combobox = control;        wxXmlNode *children_node = GetParamNode(wxT("object"));        wxXmlNode *n = children_node;#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */#   pragma ivdep#   pragma swp#   pragma unroll#   pragma prefetch#   if 0#       pragma simd noassert#   endif#endif /* VDM auto patch */        while (n)        {            if ((n->GetType() == wxXML_ELEMENT_NODE) &&                (n->GetName() == wxT("object")))            {                CreateResFromNode(n, control, NULL);            }            n = n->GetNext();        }        m_isInside = false;        m_combobox = NULL;        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        return control;    }}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:69,


示例19: ctlCheckTreeView

wxObject *ctlCheckTreeViewXmlHandler::DoCreateResource(){     ctlCheckTreeView *ctl=new ctlCheckTreeView(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle());        SetupWindow(ctl);       return ctl;}
开发者ID:lhcezar,项目名称:pgadmin3,代码行数:8,


示例20: GetColor2

CXTPChartColor CXTPChartAreaSeriesView::GetActualColor2() const{	CXTPChartColor clr = GetColor2();	return CXTPChartColor((BYTE)((CXTPChartAreaSeriesStyle*)GetStyle())->GetTransparency(), clr.GetR(), clr.GetG(), clr.GetB());}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:5,


示例21: GetClientRect

void CSkinDialog::OnNcPaint(){    // TODO: Add your message handler code here    if(!CImgSkin::IsLoaded())    {        CXTPDialog::OnNcPaint();        return;    }    if(HasStyle(WS_CHILD))    {        return;    }    /*    RECT ClientRect;    GetClientRect(&ClientRect);    OffsetRect(&ClientRect, 100, 100);    ExcludeClipRect(GetWindowDC()->GetSafeHdc(), ClientRect.left, ClientRect.top,    	ClientRect.right, ClientRect.bottom);    */    CRect rcWindow;    GetWindowRect(&rcWindow);    Bitmap bmpBuf(rcWindow.Width(), rcWindow.Height());    Graphics graphics(&bmpBuf);    Graphics g(GetWindowDC()->GetSafeHdc());    Rect rc, rc1;    // Title Left    rc = m_bActive?m_mapRect["TitleLeftActive"]:m_mapRect["TitleLeft"];    rc1.X = 0;    rc1.Y = 0;    rc1.Width = rc.Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Title Center    rc = m_bActive?m_mapRect["TitleCenterActive"]:m_mapRect["TitleCenter"];    rc1.X = m_mapRect["TitleLeftActive"].Width;    rc1.Y = 0;    rc1.Width = rcWindow.Width()-m_mapRect["TitleLeftActive"].Width-m_mapRect["TitleRightActive"].Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Title Right    rc = m_bActive?m_mapRect["TitleRightActive"]:m_mapRect["TitleRight"];    rc1.X = rc1.GetRight();    rc1.Y = 0;    rc1.Width = rc.Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Border Left    rc = m_bActive?m_mapRect["BorderLeftActive"]:m_mapRect["BorderLeft"];    rc1.X = 0;    rc1.Y = m_mapRect["TitleLeftActive"].Height;    rc1.Width = rc.Width;    rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Border Bottom    rc = m_bActive?m_mapRect["BorderBotActive"]:m_mapRect["BorderBot"];    rc1.X = 0;    rc1.Y = rcWindow.Height()-rc.Height-1;    rc1.Width = rcWindow.Width();    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Border Right    rc = m_bActive?m_mapRect["BorderRightActive"]:m_mapRect["BorderRight"];    rc1.X = rcWindow.Width()-rc.Width-1;    rc1.Y = m_mapRect["TitleLeftActive"].Height;    rc1.Width = rc.Width;    rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Close Button    rc = m_nButtonDown==HT_CLOSE?m_mapRect["NcBtnCloseDown"]:m_mapRect["NcBtnClose"];    rc1.X = rcWindow.Width()-m_mapRect["NcBtnClosePos"].X;    rc1.Y = m_mapRect["NcBtnClosePos"].Y;    rc1.Width = rc.Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Max Button    if(GetStyle()&WS_MAXIMIZEBOX)    {        rc = IsZoomed()?(m_nButtonDown==HT_MAX?m_mapRect["NcBtnResDown"]:m_mapRect["NcBtnRes"]):(m_nButtonDown==HT_MAX?m_mapRect["NcBtnMaxDown"]:m_mapRect["NcBtnMax"]);        rc1.X = rcWindow.Width()-m_mapRect["NcBtnMaxPos"].X;        rc1.Y = m_mapRect["NcBtnMaxPos"].Y;        rc1.Width = rc.Width;        rc1.Height = rc.Height;        graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    }    // Min Button//.........这里部分代码省略.........
开发者ID:jin1818,项目名称:projectcodesync,代码行数:101,


示例22: XRC_MAKE_INSTANCE

wxObject *wxTreebookXmlHandler::DoCreateResource(){    if (m_class == wxT("wxTreebook"))    {        XRC_MAKE_INSTANCE(tbk, wxTreebook)        tbk->Create(m_parentAsWindow,                    GetID(),                    GetPosition(), GetSize(),                    GetStyle(wxT("style")),                    GetName());        wxImageList *imagelist = GetImageList();        if ( imagelist )            tbk->AssignImageList(imagelist);        wxTreebook * old_par = m_tbk;        m_tbk = tbk;        bool old_ins = m_isInside;        m_isInside = true;        wxArrayTbkPageIndexes old_treeContext = m_treeContext;        m_treeContext.Clear();        CreateChildren(m_tbk, true/*only this handler*/);        m_treeContext = old_treeContext;        m_isInside = old_ins;        m_tbk = old_par;        return tbk;    }//    else ( m_class == wxT("treebookpage") )    wxXmlNode *n = GetParamNode(wxT("object"));    wxWindow *wnd = NULL;    if ( !n )        n = GetParamNode(wxT("object_ref"));    if (n)    {        bool old_ins = m_isInside;        m_isInside = false;        wxObject *item = CreateResFromNode(n, m_tbk, NULL);        m_isInside = old_ins;        wnd = wxDynamicCast(item, wxWindow);        if (wnd == NULL && item != NULL)        {            ReportError(n, "treebookpage child must be a window");        }    }    size_t depth = GetLong( wxT("depth") );    if( depth <= m_treeContext.GetCount() )    {        // first prepare the icon        int imgIndex = wxNOT_FOUND;        if ( HasParam(wxT("bitmap")) )        {            wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);            wxImageList *imgList = m_tbk->GetImageList();            if ( imgList == NULL )            {                imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() );                m_tbk->AssignImageList( imgList );            }            imgIndex = imgList->Add(bmp);        }        else if ( HasParam(wxT("image")) )        {            if ( m_tbk->GetImageList() )            {                imgIndex = GetLong(wxT("image"));            }            else // image without image list?            {                ReportError(n, "image can only be used in conjunction "                               "with imagelist");            }        }        // then add the page to the corresponding parent        if( depth < m_treeContext.GetCount() )            m_treeContext.RemoveAt(depth, m_treeContext.GetCount() - depth );        if( depth == 0)        {            m_tbk->AddPage(wnd,                GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);        }        else        {            m_tbk->InsertSubPage(m_treeContext.Item(depth - 1), wnd,                GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);        }        m_treeContext.Add( m_tbk->GetPageCount() - 1);//.........这里部分代码省略.........
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:101,


示例23: GetStyle

bool CSkinDialog::LoadSkin(const char * szSkinPath /* = NULL */, const char * szControlName){    if(szSkinPath==NULL)    {        CImgSkin::Unload();        return true;    }    if(!CImgSkin::Load(szSkinPath, szControlName))        return false;    m_dwStyle = GetStyle();    // 去掉标题栏,边框,只留客户区    // ModifyStyle(WS_CAPTION|WS_THICKFRAME, 0);    ModifyStyle(WS_CAPTION, 0);    CRect rcWindow;    CRect rcClient;    CRect rc;    GetWindowRect(&rcWindow);    GetClientRect(&m_rcClient);    // 圆角    SetWindowRgn(CreateRoundRectRgn(0, 0, rcWindow.Width(), rcWindow.Height(), m_mapRect["RoundCorner"].Width, m_mapRect["RoundCorner"].Height), TRUE);    if(!HasStyle(WS_CHILD))    {        // 调整窗口自己        rcWindow.left -= m_mapRect["BorderLeft"].Width;        rcWindow.right += m_mapRect["BorderRight"].Width;        rcWindow.top -= m_mapRect["TitleLeft"].Height;        rcWindow.bottom += m_mapRect["BorderBot"].Height;        CWnd * pParent = GetParent();        if(pParent==NULL) pParent = GetDesktopWindow();        //pParent->ScreenToClient(&rcWindow);        //MoveWindow(rcWindow, FALSE);        GetClientRect(&rcClient);        POINT ptOffset = {0};        CRect rcChild;        CWnd* pWndChild;        // 菜单        CMenu * pMenu = GetMenu();        if(pMenu)        {            m_wndMenuBar.CreateToolBar(WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS, this, ID_MENU_BAR);            m_wndMenuBar.LoadMenu(pMenu);            m_wndMenuBar.SetFlags(xtpFlagStretched);            SetMenu(NULL);            CXTPPaintManager::SetTheme(xtpThemeOffice2003);            m_wndMenuBar.LoadSkin(szSkinPath);            RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, reposDefault, NULL, &rcClient);            AddAnchor(m_wndMenuBar, ANCHOR_TOPLEFT|ANCHOR_TOPRIGHT);            m_wndMenuBar.GetWindowRect(&rc);            ptOffset.y += rc.Height();            pWndChild = GetWindow(GW_CHILD);            while (pWndChild)            {                if(pWndChild!=&m_wndMenuBar)                {                    pWndChild->GetWindowRect(rcChild);                    rcChild.OffsetRect(ptOffset);                    ScreenToClient(&rcChild);                    pWndChild->MoveWindow(rcChild, FALSE);                }                pWndChild = pWndChild->GetNextWindow();            }        }        // 调整子窗口        /*        ptOffset.x = m_mapRect["BorderLeft"].Width;        ptOffset.y = m_mapRect["TitleLeft"].Height;        pWndChild = GetWindow(GW_CHILD);        while (pWndChild)        {        	pWndChild->GetWindowRect(rcChild);        	rcChild.OffsetRect(ptOffset);        	ScreenToClient(&rcChild);        	pWndChild->MoveWindow(rcChild, FALSE);        	pWndChild = pWndChild->GetNextWindow();        }        m_rcClient.left = ptOffset.x;        m_rcClient.right = m_rcClient.left+rcClient.Width();        m_rcClient.top += ptOffset.y;        m_rcClient.bottom = m_rcClient.top+rcClient.Height();        */    }//.........这里部分代码省略.........
开发者ID:jin1818,项目名称:projectcodesync,代码行数:101,


示例24: GLOW_DEBUGSCOPE

GlowWidget::AutoPackError GlowQuickPanelWidget::OnAutoPack(	int hSize,	int vSize,	AutoPackOptions hOption,	AutoPackOptions vOption,	int& leftMargin,	int& rightMargin,	int& topMargin,	int& bottomMargin){	GLOW_DEBUGSCOPE("GlowQuickPanelWidget::OnAutoPack");		int position = (arrangement_ == vertical) ? vmargin_ : hmargin_;	int size = 0;	int minWidth = position;		// Arrange widgets with default alignment	for (GlowComponent* child = FirstChild(); child != 0; child = child->Next())	{		// Get next widget		GlowWidget* widget = dynamic_cast<GlowWidget*>(child);		if (widget == 0 || !widget->IsVisible() || widget->IsClosing())		{			continue;		}				// Handle the label of the panel (if any) differently.		if (widget == label_)		{			if (GetStyle() == GlowPanelWidget::etchedStyle)			{				// Etched style: label is half in and half out of the panel				widget->AutoPack(hmargin_, unspecifiedPos, 0, unspecifiedPos,					leftPos | preferredSize, centerPos | preferredSize);				topMargin = widget->Height()/2;				if (arrangement_ == vertical)				{					position += widget->Height()/2;				}			}			else			{				// Other style: label is completely out of the panel				widget->AutoPack(hmargin_, unspecifiedPos, unspecifiedPos, 0,					leftPos | preferredSize, bottomPos | preferredSize);				topMargin = widget->Height();			}			minWidth = widget->Width()+hmargin_+hmargin_;			continue;		}				int leftMargin = 0, rightMargin = 0, topMargin = 0, bottomMargin = 0;		if (arrangement_ == horizontal)		{			widget->AutoPack(position, unspecifiedPos, vmargin_, unspecifiedPos,				leftPos | preferredSize, topPos | preferredSize,				leftMargin, rightMargin, topMargin, bottomMargin);			size = GLOW_STD::max(size, widget->Height()+topMargin+bottomMargin);			position += widget->Width()+leftMargin+rightMargin+spacing_;		}		else		{			widget->AutoPack(hmargin_, unspecifiedPos, position, unspecifiedPos,				leftPos | preferredSize, topPos | preferredSize,				leftMargin, rightMargin, topMargin, bottomMargin);			size = GLOW_STD::max(size, widget->Width()+leftMargin+rightMargin);			position += widget->Height()+topMargin+bottomMargin+spacing_;		}	}		// Preferred width and height	int pwidth = 0, pheight = 0;	if (arrangement_ == horizontal)	{		pwidth = GLOW_STD::max(minWidth, position-spacing_+hmargin_);		pheight = size+vmargin_+vmargin_;	}	else	{		pwidth = GLOW_STD::max(minWidth, size+hmargin_+hmargin_);		pheight = position-spacing_+vmargin_;	}		// Panel width	int hnew = Width();	if (hOption == forcedSize || hOption == expandPreferredSize)	{		hnew = hSize;	}	else if (hOption == preferredSize)	{		hnew = pwidth;	}	if (hnew < pwidth)	{		return hAutoPackError;	}		// Panel height	int vnew = Height();//.........这里部分代码省略.........
开发者ID:gwax,项目名称:glow,代码行数:101,


示例25: GetWindowRect

void CSkinDialog::DrawFrame(Graphics & graphics){    CRect rcWindow;    GetWindowRect(&rcWindow);    Rect rc, rc1;    // Title Left    rc = m_bActive?m_mapRect["TitleLeftActive"]:m_mapRect["TitleLeft"];    rc1.X = 0;    rc1.Y = 0;    rc1.Width = rc.Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Title Center    rc = m_bActive?m_mapRect["TitleCenterActive"]:m_mapRect["TitleCenter"];    rc1.X = m_mapRect["TitleLeftActive"].Width;    rc1.Y = 0;    rc1.Width = rcWindow.Width()-m_mapRect["TitleLeftActive"].Width-m_mapRect["TitleRightActive"].Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Title Right    rc = m_bActive?m_mapRect["TitleRightActive"]:m_mapRect["TitleRight"];    rc1.X = rc1.GetRight();    rc1.Y = 0;    rc1.Width = rc.Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Border Left    rc = m_bActive?m_mapRect["BorderLeftActive"]:m_mapRect["BorderLeft"];    rc1.X = 0;    rc1.Y = m_mapRect["TitleLeft"].Height;    rc1.Width = rc.Width;    rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Border Bottom    rc = m_bActive?m_mapRect["BorderBotActive"]:m_mapRect["BorderBot"];    rc1.X = 0;    rc1.Y = rcWindow.Height()-rc.Height-1;    rc1.Width = rcWindow.Width();    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Border Right    rc = m_bActive?m_mapRect["BorderRightActive"]:m_mapRect["BorderRight"];    rc1.X = rcWindow.Width()-rc.Width-1;    rc1.Y = m_mapRect["TitleLeftActive"].Height;    rc1.Width = rc.Width;    rc1.Height = rcWindow.Height()-m_mapRect["TitleLeftActive"].Height-m_mapRect["BorderBotActive"].Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Close Button    rc = m_nButtonDown==HT_CLOSE?m_mapRect["NcBtnCloseDown"]:m_mapRect["NcBtnClose"];    rc1.X = rcWindow.Width()-m_mapRect["NcBtnClosePos"].X;    rc1.Y = m_mapRect["NcBtnClosePos"].Y;    rc1.Width = rc.Width;    rc1.Height = rc.Height;    graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    // Max Button    if(GetStyle()&WS_MAXIMIZEBOX)    {        rc = IsZoomed()?(m_nButtonDown==HT_MAX?m_mapRect["NcBtnResDown"]:m_mapRect["NcBtnRes"]):(m_nButtonDown==HT_MAX?m_mapRect["NcBtnMaxDown"]:m_mapRect["NcBtnMax"]);        rc1.X = rcWindow.Width()-m_mapRect["NcBtnMaxPos"].X;        rc1.Y = m_mapRect["NcBtnMaxPos"].Y;        rc1.Width = rc.Width;        rc1.Height = rc.Height;        graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    }    // Min Button    if(GetStyle()&WS_MINIMIZEBOX)    {        rc = m_nButtonDown==HT_MIN?m_mapRect["NcBtnMinDown"]:m_mapRect["NcBtnMin"];        rc1.X = rcWindow.Width()-m_mapRect["NcBtnMinPos"].X;        rc1.Y = m_mapRect["NcBtnMinPos"].Y;        rc1.Width = rc.Width;        rc1.Height = rc.Height;        graphics.DrawImage(m_pImg, rc1, rc.GetLeft(), rc.GetTop(), rc.Width, rc.Height, UnitPixel);    }    Font myFont(L"宋体", 9);    Color col(255,0,0,0);    col.SetFromCOLORREF(m_mapColor["Caption"]);    SolidBrush blackBrush(col);    StringFormat format;    format.SetAlignment(StringAlignmentNear);    RectF layoutRect(::GetSystemMetrics(SM_CYICON)+m_mapRect["TitleTextStart"].X, m_mapRect["TitleTextStart"].Y, rcWindow.Width(), rcWindow.Height());    WCHAR string[MAX_PATH] = {0};    CString str;    GetWindowText(str);    MultiByteToWideChar( CP_ACP, 0, str, -1, string, MAX_PATH) ;//.........这里部分代码省略.........
开发者ID:jin1818,项目名称:projectcodesync,代码行数:101,


示例26: RGB

void CClickList::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){	static const COLORREF 		COLOR_1 = RGB(239, 246, 249),		COLOR_2 = RGB(209, 226, 239);	ASSERT(NULL != lpDrawItemStruct);	ASSERT(NULL != lpDrawItemStruct->hDC);	CDC *pDC = CDC::FromHandle(lpDrawItemStruct->hDC);	ASSERT_VALID(pDC);	// The CWinApp idle-time handler will automatically call	// CDC::DeleteTempMap to delete any temporary CDC objects	// created by FromHandle	CRect rcItem(lpDrawItemStruct->rcItem);		int nItem = lpDrawItemStruct->itemID;	int nSavedDC = pDC->SaveDC();	// Get item image and state info	LV_ITEM lvi;	lvi.mask      = LVIF_IMAGE | LVIF_STATE;		lvi.iItem     = nItem;		lvi.iSubItem  = 0;	lvi.stateMask = -1;	GetItem(&lvi);	// Should the item be highlighted	bool bHighlight = LVIS_DROPHILITED == (lvi.state & LVIS_DROPHILITED) || 		LVIS_SELECTED == (lvi.state & LVIS_SELECTED) && (this == GetFocus() || 		LVS_SHOWSELALWAYS == (GetStyle() & LVS_SHOWSELALWAYS));	// Get rectangles for drawing		CRect rcBounds, rcLabel, rcIcon;	GetItemRect(nItem, rcBounds, LVIR_BOUNDS);	GetItemRect(nItem, rcLabel,  LVIR_LABEL);	GetItemRect(nItem, rcIcon,   LVIR_ICON);	CRect rcCol(rcBounds);	CString sLabel = GetItemText(nItem, 0);	// Labels are offset by a certain amount  	// This offset is related to the width of a space character	int offset = pDC->GetTextExtent(_T(" "), 1 ).cx * 2;	CRect rcHighlight;	CRect rcWnd;	int   nExt;	switch (m_HighlightType) {		case HT_NORMAL: 			nExt = pDC->GetOutputTextExtent(sLabel).cx + offset;			rcHighlight = rcLabel;			if (rcLabel.left + nExt < rcLabel.right)				rcHighlight.right = rcLabel.left + nExt;			break;					case HT_ALLCOLUMNS:			rcHighlight = rcBounds;			rcHighlight.left = rcLabel.left;			break;		case HT_ROW:			GetClientRect(&rcWnd);			rcHighlight       = rcBounds;			rcHighlight.left  = rcLabel.left;			rcHighlight.right = rcWnd.right;			break;		default:			ASSERT(false);	}	// Draw the background color	if (bHighlight)	{		pDC->SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));		pDC->SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));		pDC->FillRect(rcHighlight, &CBrush(::GetSysColor(COLOR_HIGHLIGHT)));	} 	else {		CRect rcClient, rcRow = rcItem;		GetClientRect(&rcClient);		rcRow.right = rcClient.right;		pDC->FillRect(rcRow, &CBrush(nItem % 2 ?  COLOR_1 : COLOR_2));		//pDC->FillRect(rcHighlight, &CBrush(::GetSysColor(COLOR_WINDOW)));		}	// Set clip region	rcCol.right = rcCol.left + GetColumnWidth(0);	CRgn rgn;	rgn.CreateRectRgnIndirect(&rcCol);	pDC->SelectClipRgn(&rgn);	rgn.DeleteObject();	// Draw state icon	CImageList *pImageList;		if (LVIS_STATEIMAGEMASK == (lvi.state & LVIS_STATEIMAGEMASK)) {		pImageList = GetImageList(LVSIL_STATE);		if (NULL != pImageList) {			int nImage = ((lvi.state & LVIS_STATEIMAGEMASK) >> 12) - 1;			pImageList->Draw(pDC, nImage, CPoint(rcCol.left, rcCol.top), //.........这里部分代码省略.........
开发者ID:HPCKP,项目名称:gridengine,代码行数:101,


示例27: STATIC_DOWNCAST

void CXTPChartPyramidSeriesView::CalculatePointLayout(CXTPChartDeviceContext* pDC, CRect rcBounds){	CXTPChartPyramidSeriesStyle* pStyle = STATIC_DOWNCAST(CXTPChartPyramidSeriesStyle, GetStyle());	rcBounds.DeflateRect(5, 5, 5, 5);	CXTPChartPyramidSeriesLabel* pLabel = (CXTPChartPyramidSeriesLabel*)pStyle->GetLabel();	if (pLabel->IsVisible() && !pLabel->IsInside())	{		CSize sz(0, 0);		for (int i = 0; i < m_pPointsView->GetCount(); i++)		{			CXTPChartPyramidSeriesPointView* pPointView = (CXTPChartPyramidSeriesPointView*)m_pPointsView->GetAt(i);			CXTPChartString text(pLabel->GetPointLabel(pPointView->GetPoint()));			CXTPChartTextPainter painter(pDC, text, pLabel);			sz.cx = max(sz.cx, (INT)painter.GetSize().Width);			sz.cy = max(sz.cy, (INT)painter.GetSize().Height);		}		int nLineLength = pStyle->GetLabel()->GetLineLength();		if (pLabel->GetPosition() == xtpChartPyramidLabelRight)			rcBounds.DeflateRect(0, 0, nLineLength + sz.cx, 0);		if (pLabel->GetPosition() == xtpChartPyramidLabelLeft)			rcBounds.DeflateRect(nLineLength + sz.cx, 0, 0, 0);	}	double dRatio = pStyle->GetHeightToWidthRatio();	if (dRatio > CXTPChartMathUtils::m_dEPS)	{		int nHeight = rcBounds.Height();		int nWidth = int(nHeight / dRatio);		if (nWidth > rcBounds.Width())		{			nWidth = rcBounds.Width();			nHeight = int(nWidth * dRatio);		}		CPoint ptTopLeft((rcBounds.left + rcBounds.right - nWidth) / 2, (rcBounds.top + rcBounds.bottom - nHeight) / 2);		rcBounds = CRect(ptTopLeft, CSize(nWidth, nHeight));	}	m_rcInnterBounds = rcBounds;	CalculateValues();	int nCount = m_pPointsView->GetCount();	double dFrom = 0;	for (int i = 0; i < nCount; i++)	{		CXTPChartPyramidSeriesPointView* pPointView = (CXTPChartPyramidSeriesPointView*)m_pPointsView->GetAt(i);		pPointView->CalculateLayout(i, nCount, dFrom, dFrom + pPointView->m_dValue);		dFrom += pPointView->m_dValue;	}}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:66,


示例28: ApplyImageList

void CUploadListCtrl::SetAllIcons(){    ApplyImageList(NULL);    m_ImageList.DeleteImageList();    m_ImageList.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);    //Xman Show correct Icons    /*    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkey")));    m_ImageList.Add(CTempIconLoader(_T("ClientCompatible")));    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkeyPlus")));    m_ImageList.Add(CTempIconLoader(_T("ClientCompatiblePlus")));    m_ImageList.Add(CTempIconLoader(_T("Friend")));    m_ImageList.Add(CTempIconLoader(_T("ClientMLDonkey")));    m_ImageList.Add(CTempIconLoader(_T("ClientMLDonkeyPlus")));    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkeyHybrid")));    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkeyHybridPlus")));    m_ImageList.Add(CTempIconLoader(_T("ClientShareaza")));    m_ImageList.Add(CTempIconLoader(_T("ClientShareazaPlus")));    m_ImageList.Add(CTempIconLoader(_T("ClientAMule")));    m_ImageList.Add(CTempIconLoader(_T("ClientAMulePlus")));    m_ImageList.Add(CTempIconLoader(_T("ClientLPhant")));    m_ImageList.Add(CTempIconLoader(_T("ClientLPhantPlus")));    */    m_ImageList.Add(CTempIconLoader(_T("ClientDefault")));		//0    m_ImageList.Add(CTempIconLoader(_T("ClientDefaultPlus")));	//1    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkey")));		//2    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkeyPlus")));	//3    m_ImageList.Add(CTempIconLoader(_T("ClientCompatible")));		//4    m_ImageList.Add(CTempIconLoader(_T("ClientCompatiblePlus")));	//5    m_ImageList.Add(CTempIconLoader(_T("ClientFriend")));			//6    m_ImageList.Add(CTempIconLoader(_T("ClientFriendPlus")));		//7    m_ImageList.Add(CTempIconLoader(_T("ClientMLDonkey")));		//8    m_ImageList.Add(CTempIconLoader(_T("ClientMLDonkeyPlus")));	//9    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkeyHybrid")));	//10    m_ImageList.Add(CTempIconLoader(_T("ClientEDonkeyHybridPlus")));//11    m_ImageList.Add(CTempIconLoader(_T("ClientShareaza")));		//12    m_ImageList.Add(CTempIconLoader(_T("ClientShareazaPlus")));	//13    m_ImageList.Add(CTempIconLoader(_T("ClientAMule")));			//14    m_ImageList.Add(CTempIconLoader(_T("ClientAMulePlus")));		//15    m_ImageList.Add(CTempIconLoader(_T("ClientLPhant")));			//16    m_ImageList.Add(CTempIconLoader(_T("ClientLPhantPlus")));		//17    m_ImageList.Add(CTempIconLoader(_T("LEECHER")));				//18 //Xman Anti-Leecher    //Xman friend visualization    m_ImageList.Add(CTempIconLoader(_T("ClientFriendSlotOvl"))); //19    //Xman end    //Xman End    // ==> Mod Icons - Stulle    m_ImageList.Add(CTempIconLoader(_T("AAAEMULEAPP"))); //20    m_ImageList.Add(CTempIconLoader(_T("STULLE"))); //21    m_ImageList.Add(CTempIconLoader(_T("XTREME"))); //22    m_ImageList.Add(CTempIconLoader(_T("MORPH"))); //23    m_ImageList.Add(CTempIconLoader(_T("EASTSHARE"))); //24    m_ImageList.Add(CTempIconLoader(_T("EMF"))); //25    m_ImageList.Add(CTempIconLoader(_T("NEO"))); //26    m_ImageList.Add(CTempIconLoader(_T("MEPHISTO"))); //27    m_ImageList.Add(CTempIconLoader(_T("XRAY"))); //28    m_ImageList.Add(CTempIconLoader(_T("MAGIC"))); //29    // <== Mod Icons - Stulle    m_ImageList.SetOverlayImage(m_ImageList.Add(CTempIconLoader(_T("ClientSecureOvl"))), 1);    m_ImageList.SetOverlayImage(m_ImageList.Add(CTempIconLoader(_T("OverlayObfu"))), 2);    m_ImageList.SetOverlayImage(m_ImageList.Add(CTempIconLoader(_T("OverlaySecureObfu"))), 3);    // ==> Mod Icons - Stulle    m_overlayimages.DeleteImageList ();    m_overlayimages.Create(16,16,theApp.m_iDfltImageListColorFlags|ILC_MASK,0,1);    m_overlayimages.SetBkColor(CLR_NONE);    m_overlayimages.Add(CTempIconLoader(_T("ClientCreditOvl")));    m_overlayimages.Add(CTempIconLoader(_T("ClientCreditSecureOvl")));    // <== Mod Icons - Stulle    // Apply the image list also to the listview control, even if we use our own 'DrawItem'.    // This is needed to give the listview control a chance to initialize the row height.    ASSERT( (GetStyle() & LVS_SHAREIMAGELISTS) != 0 );    VERIFY( ApplyImageList(m_ImageList) == NULL );}
开发者ID:tedlz123,项目名称:EMule-GIFC,代码行数:75,


示例29: GetParamNode

wxObject *wxPropertySheetDialogXmlHandler::DoCreateResource(){    if (m_class == wxT("propertysheetpage"))    {        wxXmlNode *n = GetParamNode(wxT("object"));        if (!n) n = GetParamNode(wxT("object_ref"));        if (n)        {            wxBookCtrlBase *bookctrl = m_dialog->GetBookCtrl();            bool old_ins = m_isInside;            m_isInside = false;            wxObject *item = CreateResFromNode(n, bookctrl, NULL);            m_isInside = old_ins;            wxWindow *wnd = wxDynamicCast(item, wxWindow);            if (wnd)            {                bookctrl->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")));                if (HasParam(wxT("bitmap")))                {                    wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);                    wxImageList *imgList = bookctrl->GetImageList();                    if (imgList == NULL)                    {                        imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight());                        bookctrl->AssignImageList(imgList);                    }                    int imgIndex = imgList->Add(bmp);                    bookctrl->SetPageImage(bookctrl->GetPageCount()-1, imgIndex);                }            }            else            {                ReportError(n, "propertysheetpage child must be a window");            }            return wnd;        }        else        {            ReportError("propertysheetpage must have a window child");            return NULL;        }    }    else    {        XRC_MAKE_INSTANCE(dlg, wxPropertySheetDialog)        dlg->Create(m_parentAsWindow,                   GetID(),                   GetText(wxT("title")),                   GetPosition(),                   GetSize(),                   GetStyle(),                   GetName());        if (HasParam(wxT("icon")))            dlg->SetIcons(GetIconBundle(wxT("icon"), wxART_FRAME_ICON));        SetupWindow(dlg);        wxPropertySheetDialog *old_par = m_dialog;        m_dialog = dlg;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_dialog, true/*only this handler*/);        m_isInside = old_ins;        m_dialog = old_par;        if (GetBool(wxT("centered"), false)) dlg->Centre();        wxString buttons = GetText(wxT("buttons"));        if (!buttons.IsEmpty())        {            int flags = 0;            if (buttons.Find(wxT("wxOK"))         != wxNOT_FOUND) flags |= wxOK;            if (buttons.Find(wxT("wxCANCEL"))     != wxNOT_FOUND) flags |= wxCANCEL;            if (buttons.Find(wxT("wxYES"))        != wxNOT_FOUND) flags |= wxYES;            if (buttons.Find(wxT("wxNO"))         != wxNOT_FOUND) flags |= wxNO;            if (buttons.Find(wxT("wxHELP"))       != wxNOT_FOUND) flags |= wxHELP;            if (buttons.Find(wxT("wxNO_DEFAULT")) != wxNOT_FOUND) flags |= wxNO_DEFAULT;            dlg->CreateButtons(flags);        }        return dlg;    }}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:88,



注:本文中的GetStyle函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetSubMenu函数代码示例
C++ GetStringValue函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。