当前位置: 首页>>代码示例>>C++>>正文


C++ CImageList::Detach方法代码示例

本文整理汇总了C++中CImageList::Detach方法的典型用法代码示例。如果您正苦于以下问题:C++ CImageList::Detach方法的具体用法?C++ CImageList::Detach怎么用?C++ CImageList::Detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CImageList的用法示例。


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

示例1: SetAllIcons

void CSearchParamsWnd::SetAllIcons()
{
	CImageList iml;
	iml.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
	iml.Add(CTempIconLoader(_T("SearchMethod_KadServer")));
	iml.Add(CTempIconLoader(_T("SearchMethod_SERVER")));
	iml.Add(CTempIconLoader(_T("SearchMethod_GLOBAL")));
	iml.Add(CTempIconLoader(_T("SearchMethod_KADEMLIA")));
	iml.Add(CTempIconLoader(_T("SearchMethod_FILEDONKEY")));
	m_ctlMethod.SetImageList(&iml);
	m_imlSearchMethods.DeleteImageList();
	m_imlSearchMethods.Attach(iml.Detach());

	iml.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
	iml.Add(CTempIconLoader(_T("SearchFileType_Any")));
	iml.Add(CTempIconLoader(_T("SearchFileType_Archive")));
	iml.Add(CTempIconLoader(_T("SearchFileType_Audio")));
	iml.Add(CTempIconLoader(_T("SearchFileType_CDImage")));
	iml.Add(CTempIconLoader(_T("SearchFileType_Picture")));
	iml.Add(CTempIconLoader(_T("SearchFileType_Program")));
	iml.Add(CTempIconLoader(_T("SearchFileType_Video")));
	iml.Add(CTempIconLoader(_T("SearchFileType_Document")));
	iml.Add(CTempIconLoader(_T("AABCollectionFileType")));
	m_ctlFileType.SetImageList(&iml);
	m_imlFileType.DeleteImageList();
	m_imlFileType.Attach(iml.Detach());
}
开发者ID:dalinhuang,项目名称:dmibox,代码行数:27,代码来源:SearchParamsWnd.cpp

示例2: ChangeToolbarBitmap

void CMuleToolbarCtrl::ChangeToolbarBitmap(const CString& path, bool bRefresh)
{
	bool bResult = false;
	CImageList ImageList;
	CEnBitmap Bitmap;
	if (!path.IsEmpty() && Bitmap.LoadImage(path))
	{
		BITMAP bm = {0};
		Bitmap.GetObject(sizeof(bm), &bm);
		if (bm.bmWidth == NUM_BUTTON_BITMAPS*m_sizBtnBmp.cx && bm.bmHeight == m_sizBtnBmp.cy)
		{
			bool bAlpha = bm.bmBitsPixel > 24;
			if (ImageList.Create(m_sizBtnBmp.cx, bm.bmHeight, bAlpha ? ILC_COLOR32 : (theApp.m_iDfltImageListColorFlags | ILC_MASK), 0, 1))
			{
				ImageList.Add(&Bitmap,  bAlpha ? 0xFF000000 : RGB(255, 0, 255));
				CImageList* pimlOld = SetImageList(&ImageList);
				ImageList.Detach();
				if (pimlOld)
					pimlOld->DeleteImageList();
				bResult = true;
			}
		}
		Bitmap.DeleteObject();
	}

	// if image file loading or image list creation failed, create default image list.
	if (!bResult)
	{
		// load from icon ressources
		ImageList.Create(m_sizBtnBmp.cx, m_sizBtnBmp.cy, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
		ImageList.Add(CTempIconLoader(_T("CONNECT"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("DISCONNECT"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("STOPCONNECTING"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("KADEMLIA"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("SERVER"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("TRANSFER"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("SEARCH"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("SharedFiles"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("MESSAGES"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("IRC"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("STATISTICS"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("PREFERENCES"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("TOOLS"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ImageList.Add(CTempIconLoader(_T("HELP"), m_sizBtnBmp.cx, m_sizBtnBmp.cy));
		ASSERT( ImageList.GetImageCount() == NUM_BUTTON_BITMAPS );
		CImageList* pimlOld = SetImageList(&ImageList);
		ImageList.Detach();
		if (pimlOld)
			pimlOld->DeleteImageList();
	}

	if (bRefresh)
	{
		UpdateBackground();
		Invalidate();
		Refresh();
	}
}
开发者ID:acat,项目名称:emule,代码行数:58,代码来源:MuleToolBarCtrl.cpp

示例3: OnCreate

int CContentsView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
  if (CListCtrl::OnCreate(lpCreateStruct) == -1)
    return -1;

  ReloadSettings();

  // _virtualMode = false;
  // _sortIndex = 0;
  _sortID = kpidName;
  _ascending = true;

  ListView_SetUnicodeFormat(*this, TRUE);

  HIMAGELIST hImg = GetSysImageList(true);
  CImageList *pImgList = CImageList::FromHandlePermanent(hImg);
  if (pImgList == NULL) {
    CImageList img;
    img.Attach(hImg);
    this->SetImageList(&img, LVSIL_SMALL);
    img.Detach();
  }
  else
    this->SetImageList(pImgList, LVSIL_SMALL);
  hImg = GetSysImageList(false);
  pImgList = CImageList::FromHandlePermanent(hImg);
  if (pImgList == NULL) {
    CImageList img;
    img.Attach(hImg);
    this->SetImageList(&img, LVSIL_NORMAL);
    img.Detach();
  }
  else
    this->SetImageList(pImgList, LVSIL_NORMAL);

  CWnd *pParent = GetTopLevelParent();
  _dropTargetSpec = new CDropTarget(pParent);
  _dropTarget = _dropTargetSpec;
  // ::DragAcceptFiles(hWnd, TRUE);
  RegisterDragDrop(*pParent, _dropTarget);

  // _exStyle |= LVS_EX_HEADERDRAGDROP;
  // DWORD extendedStyle = _listView.GetExtendedListViewStyle();
  // extendedStyle |= _exStyle;
  //  _listView.SetExtendedListViewStyle(extendedStyle);
  // this->SetExtendedStyle(_exStyle);

  SetTimer(kTimerID, kTimerElapse, NULL);

  return 0;
}
开发者ID:wyrover,项目名称:7-Zip-Pro,代码行数:51,代码来源:ContentsView.cpp

示例4: Init

void CDownloadClientsCtrl::Init()
{
	SetName(_T("DownloadClientsCtrl"));
	CImageList ilDummyImageList; //dummy list for getting the proper height of listview entries
	ilDummyImageList.Create(1, theApp.GetSmallSytemIconSize().cy,theApp.m_iDfltImageListColorFlags|ILC_MASK, 1, 1); 
	SetImageList(&ilDummyImageList, LVSIL_SMALL);
	ASSERT( (GetStyle() & LVS_SHAREIMAGELISTS) == 0 );
	ilDummyImageList.Detach();

	SetExtendedStyle(LVS_EX_FULLROWSELECT);

	InsertColumn(0,	GetResString(IDS_QL_USERNAME), LVCFMT_LEFT, 165);
	InsertColumn(1,	GetResString(IDS_CD_CSOFT), LVCFMT_LEFT, 90); 
	InsertColumn(2,	GetResString(IDS_FILE), LVCFMT_LEFT, 235);
	InsertColumn(3,	GetResString(IDS_DL_SPEED), LVCFMT_LEFT, 65);
	InsertColumn(4, GetResString(IDS_AVAILABLEPARTS), LVCFMT_LEFT, 150);
	InsertColumn(5,	GetResString(IDS_CL_TRANSFDOWN), LVCFMT_LEFT, 115);
	InsertColumn(6,	GetResString(IDS_CL_TRANSFUP), LVCFMT_LEFT, 115);
	InsertColumn(7,	GetResString(IDS_META_SRCTYPE), LVCFMT_LEFT, 60);


	SetAllIcons();
	Localize();
	LoadSettings();

	// Barry - Use preferred sort order from preferences
	SetSortArrow();
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:28,代码来源:DownloadClientsCtrl.cpp

示例5: Create

BOOL CEditButton::Create(CWnd* pWnd, SEARCH_TYPE eType, UINT nMenu)
{
	ASSERT(eType != -1);
	ASSERT_VALID(pWnd);
	m_eType = eType;
	m_nMenu = nMenu;
	m_pWnd = pWnd;
	CWnd* pWndParent = m_pWnd->GetParent();
	ASSERT_VALID(pWndParent);
	
	CRect rc;
	m_pWnd->GetWindowRect(&rc);
	m_pWnd->SetWindowPos(NULL, 0, 0, rc.Width()-23,
		rc.Height(), SWP_NOZORDER|SWP_NOMOVE);
	pWndParent->ScreenToClient(&rc);
	rc.left = rc.right-18;

	DWORD dwStyle = WS_VISIBLE|WS_CHILD|WS_TABSTOP|BS_CENTER|BS_VCENTER;
	switch (m_eType)
	{
	case SEARCH_DIRECTORY:
	case SEARCH_FILE:
		{
			if (CButton::Create(_T("..."), dwStyle, rc,
				pWndParent, GetNextID(pWndParent)))
			{
				SetWindowPos(m_pWnd, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE);
				EnableWindow(m_pWnd->IsWindowEnabled());
				SetFont(&m_Font);
				return TRUE;
			}
		}

	case SEARCH_POPUP:
		{
			if (CButton::Create(_T("..."), dwStyle|BS_ICON, rc,
				pWndParent, GetNextID(pWndParent)))
			{
				SetWindowPos(m_pWnd, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE);
				EnableWindow(m_pWnd->IsWindowEnabled());
				SetFont(&m_Font);

				CImageList imageList;
				CBitmap    bitmap;

				bitmap.LoadBitmap(IDB_BTN_ARROW);
				imageList.Create(15, 17, ILC_COLORDDB|ILC_MASK, 1, 1);
				imageList.Add(&bitmap, RGB(255,0,255));

				SetIcon(imageList.ExtractIcon(0));

				imageList.Detach();
				bitmap.Detach();
				return TRUE;
			}
		}
	}

	return FALSE;
}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:60,代码来源:CJSearchEdit.cpp

示例6: InitToolBar

int CGuiFrameWnd::InitToolBar(UINT uIDMenu)
{

	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,CRect(0,0,0,0),uIDMenu) ||
		!m_wndToolBar.LoadToolBar(uIDMenu))
		{
		TRACE0("Failed to create toolbar\n");
		return -1; // fail to create
	}
// new code:  Serge Koroleuve

	IMAGEINFO ii;
	m_wndToolBar.GetToolBarCtrl().GetImageList()->GetImageInfo(0, &ii);
	int cx = ii.rcImage.right - ii.rcImage.left;
	int cy = ii.rcImage.bottom - ii.rcImage.top;
	int nCount = m_wndToolBar.GetToolBarCtrl().GetImageList()->GetImageCount();

	CImageList imageList;
	CBitmap bitmap;

	bitmap.LoadBitmap(uIDMenu);
	imageList.Create(cx, cy, ILC_COLORDDB|ILC_MASK, nCount, 0);
	imageList.Add(&bitmap, RGB(192,192,192));
	m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);
	imageList.Detach();
	bitmap.Detach();
// end of new code
return 0;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:30,代码来源:GuiFrameWnd.cpp

示例7: Init

void CClientListCtrl::Init()
{
	SetName(_T("ClientListCtrl"));
	CImageList ilDummyImageList; //dummy list for getting the proper height of listview entries
	ilDummyImageList.Create(1, theApp.GetSmallSytemIconSize().cy,theApp.m_iDfltImageListColorFlags|ILC_MASK, 1, 1); 
	SetImageList(&ilDummyImageList, LVSIL_SMALL);
	ASSERT( (GetStyle() & LVS_SHAREIMAGELISTS) == 0 );
	ilDummyImageList.Detach();

	SetExtendedStyle(LVS_EX_FULLROWSELECT);
	InsertColumn(0,GetResString(IDS_QL_USERNAME),LVCFMT_LEFT,150,0);
	InsertColumn(1,GetResString(IDS_CL_UPLOADSTATUS),LVCFMT_LEFT,150,1);
	InsertColumn(2,GetResString(IDS_CL_TRANSFUP),LVCFMT_LEFT,150,2);
	InsertColumn(3,GetResString(IDS_CL_DOWNLSTATUS),LVCFMT_LEFT,150,3);
	InsertColumn(4,GetResString(IDS_CL_TRANSFDOWN),LVCFMT_LEFT,150,4);
	InsertColumn(5,GetResString(IDS_CD_CSOFT),LVCFMT_LEFT,150,5);
	InsertColumn(6,GetResString(IDS_CONNECTED),LVCFMT_LEFT,150,6);
	CString coltemp;
	coltemp=GetResString(IDS_CD_UHASH);coltemp.Remove(':');
	InsertColumn(7,coltemp,LVCFMT_LEFT,150,7);
	
	SetAllIcons();
	Localize();
	LoadSettings();
	SetSortArrow();
	SortItems(SortProc, GetSortItem()+ (GetSortAscending()? 0:100));
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:27,代码来源:ClientListCtrl.cpp

示例8: SetTrueColorToolBar

BOOL CTrueColorToolBar::SetTrueColorToolBar(UINT uToolBarType, 
							     	        UINT uToolBar,
										    int  nBtnWidth)
{
	CImageList	cImageList;
	CBitmap		cBitmap;
	BITMAP		bmBitmap;
	
	if (!cBitmap.Attach(LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(uToolBar),
								  IMAGE_BITMAP, 0, 0,
								  LR_DEFAULTSIZE|LR_CREATEDIBSECTION)) ||
	    !cBitmap.GetBitmap(&bmBitmap))
		return FALSE;

	CSize		cSize(bmBitmap.bmWidth, bmBitmap.bmHeight); 
	int			nNbBtn	= cSize.cx/nBtnWidth;
	RGBTRIPLE*	rgb		= (RGBTRIPLE*)(bmBitmap.bmBits);
	COLORREF	rgbMask	= RGB(rgb[0].rgbtRed, rgb[0].rgbtGreen, rgb[0].rgbtBlue);
	
	if (!cImageList.Create(nBtnWidth, cSize.cy, ILC_COLOR24|ILC_MASK, nNbBtn, 0))
		return FALSE;
	
	if (cImageList.Add(&cBitmap, rgbMask) == -1)
		return FALSE;

	SendMessage(uToolBarType, 0, (LPARAM)cImageList.m_hImageList);
	cImageList.Detach(); 
	cBitmap.Detach();
	
	return TRUE;
}
开发者ID:src-kun,项目名称:gh0st,代码行数:31,代码来源:TrueColorToolBar.cpp

示例9: _CreateMeshPanel

bool CMainFrame::_CreateMeshPanel( CImageList& imageList, Ogre::StringVectorPtr& meshNames )
{
	if (!m_resourceSelector.Create(WS_CHILD|WS_VISIBLE, CRect(200,100,400,300), this, IDS_ResourceSelector))
		return false;

	m_resourceSelector.SetOwner(this);
	m_resourceSelector.SetIconSize(CSize(MESH_ICON_SIZE, MESH_ICON_SIZE));
	CXTPTaskPanelGroup* pGroup = m_resourceSelector.AddGroup(IDS_ResourceSelector_Mesh);

	int itemCount = imageList.GetImageCount();
 	m_resourceSelector.GetImageManager()->SetImageList(imageList.Detach(), 0);
	
	for (int i=0; i<itemCount; ++i)
	{
		std::wstring meshname(Utility::EngineToUnicode(meshNames->at(i)));
		meshname.erase(meshname.length()-5);
		// Add folder entries
		CXTPTaskPanelGroupItem* pItem = pGroup->AddLinkItem(i, 0);
		pItem->SetIconIndex(i);
		pItem->SetCaption(meshname.c_str());
	}
					
	m_resourceSelector.SetBehaviour(xtpTaskPanelBehaviourList);
	m_resourceSelector.SetSelectItemOnFocus(TRUE);
	m_resourceSelector.SetMultiColumn(TRUE);
	m_resourceSelector.SetColumnWidth(RES_SELECTOR_COLUMN_WIDTH);
	m_resourceSelector.GetAt(0)->SetExpanded(TRUE);
	//拖拽支持
	m_resourceSelector.AllowDrag(xtpTaskItemAllowDragCopyOutsideControl);

	return true;
}
开发者ID:mavaL,项目名称:MiniCraft,代码行数:32,代码来源:MainFrm.cpp

示例10: Init

BOOL CDropDownButton::Init(bool bSingleDropDownBtn, bool bWholeDropDown)
{
	DeleteAllButtons();
	m_bSingleDropDownBtn = bSingleDropDownBtn;

	// If a toolbar control was created indirectly via a dialog resource one can not
	// add any buttons without setting an image list before. (?)
	// So, for this to work, we have to attach an image list to the toolbar control!
	// The image list can be empty, and it does not need to be used at all, but it has
	// to be attached.
	CImageList* piml = GetImageList();
	if (piml == NULL || piml->m_hImageList == NULL)
	{
		CImageList iml;
		iml.Create(16, 16, ILC_COLOR, 0, 0);
		SetImageList(&iml);
		iml.Detach();
	}
	if (m_bSingleDropDownBtn)
	{
		TBBUTTON atb[1] = {0};
		atb[0].iBitmap = -1;
		atb[0].idCommand = GetWindowLong(m_hWnd, GWL_ID);
		atb[0].fsState = TBSTATE_ENABLED;
		atb[0].fsStyle = m_bSingleDropDownBtn ? (bWholeDropDown ? BTNS_WHOLEDROPDOWN : BTNS_DROPDOWN) : BTNS_BUTTON;
		atb[0].iString = -1;
		VERIFY( AddButtons(1, atb) );

		ResizeToMaxWidth();
		SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
	}
	return TRUE;
}
开发者ID:HackLinux,项目名称:eMule-IS-Mod,代码行数:33,代码来源:DropDownButton.cpp

示例11: CreateTab

void CSearchView::CreateTab(CString searchName, UINT cnt, UINT nImage)
{
	// 256 칼라 이상 적용(icon) 
	CImageList imageList;
	CBitmap bitmap;
	bitmap.LoadBitmap(IDB_BITMAP_SEARCH_TAB);
	imageList.Create(16, 16, ILC_COLORDDB  | ILC_MASK, 16, 1);
	imageList.Add(&bitmap, RGB(255, 255, 255)); 
	//m_wndToolBar.SendMessage(TB_SETIMAGELIST, 0, (LPARAM)imageList.m_hImageList);  // 활성이미지
	m_tabSearch.SetImageList(&imageList);
	imageList.Detach();
	bitmap.Detach();

	// 처음에 탭내용이 하나도 없으면 탭컨트롤이 안보이게 설정했으므로 탭컨트롤을 보이게 (처음부터 보이면 모양이 이상해짐)
	m_tabSearch.ShowWindow(TRUE);
	
	
	CString temp;
	temp.Format("%s [%d]", searchName, cnt);
	m_tabSearch.InsertItem(m_nTabCnt, temp, nImage);	
	m_tabSearch.SetCurSel(m_nTabCnt - 1);

	if(cnt == 0  ||  cnt == m_nTabCnt){	// 버튼클릭으로 생성되거나, OnInitialUpdate에서 마지막것만
		
	}
}
开发者ID:hoonio,项目名称:distributed-system,代码行数:26,代码来源:SearchView.cpp

示例12: CreateToolBar

BOOL CMainFrame::CreateToolBar()
{
    const DWORD TOOLBAR_STYLE = WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC;

    // NOTE: LoadToolBar 只能加载 16 色位图, 如果加载 24bit 位图会显示为黑色
    if (!m_ToolBar.CreateEx(this, TBSTYLE_FLAT, TOOLBAR_STYLE) || !m_ToolBar.LoadToolBar(ID_TOOLBAR)) {
        SHOWBMP_TRACE("failed to create toolbar");
        return FALSE;
    }

    // 为 ToolBar 加载 24bit 位图
    CBitmap bmp;
    BITMAP bm;
    CImageList imgList;
    bmp.LoadBitmap(ID_TOOLBAR);
    bmp.GetBitmap(&bm);
    imgList.Create(bm.bmHeight, bm.bmHeight, ILC_COLOR24, bm.bmWidth / bm.bmHeight, 0);
    imgList.Add(&bmp, (CBitmap*) 0);
    m_ToolBar.GetToolBarCtrl().SetImageList(&imgList);
    imgList.Detach();
    bmp.Detach();

    // 使 ToolBar 变为可停靠的
    m_ToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_ToolBar);

    return TRUE;
}
开发者ID:7zhang,项目名称:studies,代码行数:29,代码来源:MainFrame.cpp

示例13: Init

void CQueueListCtrl::Init()
{
    SetName(_T("QueueListCtrl"));
    CImageList ilDummyImageList; //dummy list for getting the proper height of listview entries
    ilDummyImageList.Create(1, theApp.GetSmallSytemIconSize().cy,theApp.m_iDfltImageListColorFlags|ILC_MASK, 1, 1);
    SetImageList(&ilDummyImageList, LVSIL_SMALL);
    ASSERT( (GetStyle() & LVS_SHAREIMAGELISTS) == 0 );
    ilDummyImageList.Detach();

    SetExtendedStyle(LVS_EX_FULLROWSELECT);
    InsertColumn(0,GetResString(IDS_QL_USERNAME),LVCFMT_LEFT,150,0);
    InsertColumn(1,GetResString(IDS_FILE),LVCFMT_LEFT,275,1);
    InsertColumn(2,GetResString(IDS_FILEPRIO),LVCFMT_LEFT,110,2);
    InsertColumn(3,GetResString(IDS_QL_RATING),LVCFMT_LEFT,60,3);
    InsertColumn(4,GetResString(IDS_SCORE),LVCFMT_LEFT,60,4);
    InsertColumn(5,GetResString(IDS_ASKED),LVCFMT_LEFT,60,5);
    InsertColumn(6,GetResString(IDS_LASTSEEN),LVCFMT_LEFT,110,6);
    InsertColumn(7,GetResString(IDS_ENTERQUEUE),LVCFMT_LEFT,110,7);
    InsertColumn(8,GetResString(IDS_BANNED),LVCFMT_LEFT,60,8);
    InsertColumn(9,GetResString(IDS_UPSTATUS),LVCFMT_LEFT,100,9);
//==>Modversion [shadow2004]
#ifdef MODVERSION
    InsertColumn(10,GetResString(IDS_CLIENTSOFTWARE),LVCFMT_LEFT,100,10);
#endif //Modversion
//<==Modversion [shadow2004]

    SetAllIcons();
    Localize();
    LoadSettings();
    // Barry - Use preferred sort order from preferences
    SetSortArrow();
    SortItems(SortProc, GetSortItem() + (GetSortAscending() ? 0:100));
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:33,代码来源:QueueListCtrl.cpp

示例14: OnInitDialog

BOOL CConnectDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_listServer.m_nType = CONNECTDLG;	// 리스트가 지신의 기능만을 처리할수 있는 타입값

	m_nClient = 0;	// 라디오박스
	m_bViewFolder = TRUE;	// 폴더공유
	UpdateData(false);
	
	m_listServer.InsertColumn(0, "", LVCFMT_CENTER, 22);	// 이미지
	m_listServer.InsertColumn(1, "Server Name", LVCFMT_LEFT, 116);
	m_listServer.InsertColumn(2, "Server IP", LVCFMT_LEFT, 110);
	m_listServer.InsertColumn(3, "User ID", LVCFMT_LEFT, 100);
	m_listServer.InsertColumn(4, "View Folder", LVCFMT_CENTER, 90);
	m_listServer.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);	// 밑줄나오게 설정

	// 256 칼라 이상 적용(icon) 
	CImageList imageList;
	CBitmap bitmap;
	bitmap.LoadBitmap(IDB_BITMAP_LIST_LIBRARY_CONNECT);
	imageList.Create(16, 16, ILC_COLORDDB  | ILC_MASK, 16, 1);
	imageList.Add(&bitmap, RGB(255, 255, 255)); 
	m_listServer.SetImageList(&imageList, LVSIL_SMALL);
	imageList.Detach();
	bitmap.Detach();
	/**
	// listCtrl 에 아이콘 256 칼라 넣기
	m_imageList.Create(16, 16, ILC_COLOR8 | ILC_MASK, 16, 1);
	HICON hIcon = (HICON)::LoadImage(AfxGetInstanceHandle(), 
								 MAKEINTRESOURCE(IDI_ICON_LIST_LIBRARY_CONNECT), 
								 IMAGE_ICON, SM_CXICON, SM_CYICON, LR_SHARED | LR_LOADTRANSPARENT);
	m_imageList.Add(hIcon);
	hIcon = (HICON)::LoadImage(AfxGetInstanceHandle(), 
								 MAKEINTRESOURCE(IDI_ICON_LIST_LIBRARY_DISCONNECT), 
								 IMAGE_ICON, SM_CXICON, SM_CYICON, LR_SHARED | LR_LOADTRANSPARENT);	
	m_imageList.Add(hIcon);
	m_listServer.SetImageList(&m_imageList, LVSIL_SMALL);
	**/

	// 파일로드
	LoadFile();

	// 처음에 데이타가 한개라도 있으면 첫번째 데이타를 보이게 
	if(m_listServer.GetItemCount() > 0){
		m_strServerName = m_listServer.GetItemText(0, 1);
		m_ipAddressServerIP.SetWindowText(m_listServer.GetItemText(0, 2));
		m_strUserID = m_listServer.GetItemText(0, 3);
		m_bViewFolder = (m_listServer.GetItemText(0, 4) == "YES" ? 1 : 0);
		UpdateData(FALSE);
	}

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:hoonio,项目名称:distributed-system,代码行数:57,代码来源:ConnectDlg.cpp

示例15: SetAllIcons

void CServerListCtrl::SetAllIcons()
{
	CImageList iml;
	iml.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
	iml.Add(CTempIconLoader(_T("Server")));
	HIMAGELIST himl = ApplyImageList(iml.Detach());
	if (himl)
		ImageList_Destroy(himl);
}
开发者ID:dalinhuang,项目名称:ffmpeg-port,代码行数:9,代码来源:ServerListCtrl.cpp


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