本文整理汇总了C++中SetImageList函数的典型用法代码示例。如果您正苦于以下问题:C++ SetImageList函数的具体用法?C++ SetImageList怎么用?C++ SetImageList使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetImageList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
BOOL CFolderListCtrl::SetViewType( FLViewType vt )
{
if( vt == m_flvtViewType )
return TRUE;
if( m_ListStyles[m_flvtViewType] != m_ListStyles[vt] )
if( !ModifyStyle( m_ListStyles[m_flvtViewType], m_ListStyles[vt], SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER ) )
return FALSE;
switch( vt )
{
case flvtThumbnail:
SetImageList( m_pimlThumbnails, LVSIL_NORMAL );
break;
case flvtLargeIcon:
SetImageList( &m_imlLargeIcons, LVSIL_NORMAL );
break;
case flvtSmallIcon: break;
case flvtList: break;
case flvtDetails: break;
case flvtSize: break;
default: break;
}
m_flvtViewType = vt;
for( int i = GetItemCount() - 1; i >= 0; i-- )
SetValidItemImage( i );
SortItems( m_flciColumns[m_nCurColumn].m_fnCmp, m_bSortAscending );
Arrange( LVA_DEFAULT );
return TRUE;
}
示例2: SetImageList
HRESULT CMenuToolbarBase::UpdateImageLists()
{
if ((m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL) // not vertical.
{
// No image list, prevents the buttons from having a margin at the left side
SetImageList(NULL);
return S_OK;
}
// Assign the correct imagelist and padding based on the current icon size
int shiml;
if (m_menuBand->UseBigIcons())
{
shiml = SHIL_LARGE;
SetPadding(4, 0);
}
else
{
shiml = SHIL_SMALL;
SetPadding(4, 4);
}
IImageList * piml;
HRESULT hr = SHGetImageList(shiml, IID_PPV_ARG(IImageList, &piml));
if (FAILED_UNEXPECTEDLY(hr))
{
SetImageList(NULL);
}
else
{
SetImageList((HIMAGELIST)piml);
}
return S_OK;
}
示例3: SetImageList
void CSourcesListBox::ShowIcons()
{
if ( wxGetApp().Prefs.bShowSourcesIcons == 0 )
SetImageList( g_NullImageList, wxIMAGE_LIST_SMALL );
else
SetImageList( g_SourcesImages, wxIMAGE_LIST_SMALL );
}
示例4: RGB
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();
}
}
示例5: m_pComboParent
CDropListBox::CDropListBox( CAdvComboBox* pComboParent, CDropWnd* pDropWnd )
: m_pComboParent( pComboParent ), m_pDropWnd( pDropWnd )
{
m_nLastTopIdx = 0;
m_nSpaceX = 4;
memset(m_pImageList, 0, sizeof(m_pImageList));
SetImageList(GetSysResMgr()->GetImageList(ILID_STATE), DLBIL_STATE);
SetImageList(GetSysResMgr()->GetImageList(ILID_NORMAL), DLBIL_NORMAL);
}
示例6: DeleteAllButtons
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;
}
示例7: wxListCtrl
wxFileCtrl::wxFileCtrl(wxWindow *win,
wxWindowID id,
const wxString& wild,
bool showHidden,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator &validator,
const wxString &name)
: wxListCtrl(win, id, pos, size, style, validator, name),
m_wild(wild)
{
wxImageList *imageList = wxTheFileIconsTable->GetSmallImageList();
SetImageList( imageList, wxIMAGE_LIST_SMALL );
m_showHidden = showHidden;
m_sort_foward = 1;
m_sort_field = wxFileData::FileList_Name;
m_dirName = wxT("*");
if (style & wxLC_REPORT)
ChangeToReportMode();
}
示例8: SetName
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));
}
示例9: wxListCtrl
//==============================================================================
browsers::topedlay_list::topedlay_list(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style) :
wxListCtrl(parent, id, pos, size, style) {
InsertColumn(0, wxT(" No "));
InsertColumn(1, wxT(" Name "));
InsertColumn(2, wxT(" S "));
SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
SetColumnWidth(2, wxLIST_AUTOSIZE_USEHEADER);
_imageList = DEBUG_NEW wxImageList(16, 16, TRUE);
#ifdef __WXMSW__
/*@TODO : Under windows - resource loading*/
// m_imageListNormal->Add( wxIcon(_T("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) );
//
#else
//SGREM!!! Troubles with the gdb on Linux with threads!
// I spent a night debugging a stupid mistake with traversing the tree
// to realize finally that the gdb is doing some funny things when
// stepping over next two lines. The troble comes from wxIcon constructor,
// that internally is calling gdk_pixmap_create_from_xpm_d
_imageList->Add( wxIcon( activelay ) );
_imageList->Add( wxIcon( lock ) );
#endif
// SetBackgroundColour(wxColour("LIGHTGREY"));
SetImageList(_imageList,wxIMAGE_LIST_SMALL);
_llfont_normal.SetPointSize(9);
_llfont_bold.SetPointSize(9);
_llfont_bold.SetWeight(wxBOLD);
}
示例10: SetExtendedStyle
void CHistoryCombo::SetStylesAndImageList()
{
SetExtendedStyle(CBES_EX_PATHWORDBREAKPROC|CBES_EX_CASESENSITIVE, CBES_EX_PATHWORDBREAKPROC|CBES_EX_CASESENSITIVE);
#ifdef HISTORYCOMBO_WITH_SYSIMAGELIST
SetImageList(&SYS_IMAGE_LIST());
#endif
}
示例11: rc
BOOL CDownloads_Deleted::Create(CWnd *pParent)
{
CRect rc (0, 0, 0, 0);
if (FALSE == CListCtrlEx::Create (LVS_REPORT|LVS_OWNERDRAWFIXED|LVS_SHOWSELALWAYS,
rc, pParent, 0x5A9))
return FALSE;
SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_INFOTIP);
m_images.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1);
CBitmap bmp;
bmp.Attach (SBMP (IDB_DOWNLOADSTASKS));
m_images.Add (&bmp, RGB (255, 0, 255));
SetImageList (&m_images, LVSIL_SMALL);
m_selimages.Create (16, 17, ILC_COLOR24 | ILC_MASK, 7, 1);
CBitmap bmp2;
bmp2.Attach (SBMP (IDB_DOWNLOADSTASKS_SEL));
m_selimages.Add (&bmp2, RGB (255, 0, 255));
SetSelectedImages (&m_selimages);
InsertColumn (0, "", LVCFMT_LEFT, 200, 0);
InsertColumn (1, "", LVCFMT_LEFT, 50, 0);
InsertColumn (2, "", LVCFMT_LEFT, 100, 0);
InsertColumn (3, "", LVCFMT_LEFT, 58, 0);
InsertColumn (4, "", LVCFMT_LEFT, 200, 0);
ReadState ("DownloadsDeleted");
return TRUE;
}
示例12: SetImageList
int CTDLLanguageComboBox::AddString(LPCTSTR szLanguage, HBITMAP hbmFlag, DWORD dwItemData)
{
// create and associate the image list first time around
if (m_il.GetSafeHandle() == NULL)
{
m_il.Create(16, 11, ILC_COLOR32 | ILC_MASK, 1, 1);
SetImageList(&m_il);
}
COMBOBOXEXITEM cbe;
cbe.mask = CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_TEXT | CBEIF_LPARAM;
cbe.iItem = GetCount();
cbe.pszText = (LPTSTR)szLanguage;
cbe.lParam = dwItemData;
cbe.iImage = cbe.iSelectedImage = GetCount();
if (hbmFlag == NULL)
hbmFlag = CEnBitmap::LoadImageResource(IDR_YOURLANG_FLAG, _T("GIF"));
CBitmap tmp;
tmp.Attach(hbmFlag); // will auto cleanup
m_il.Add(&tmp, (COLORREF)-1);
return InsertItem(&cbe);
}
示例13: CStateEventHandler
CLocalListView::CLocalListView(wxWindow* pParent, CState *pState, CQueueView *pQueue)
: CFileListCtrl<CLocalFileData>(pParent, pState, pQueue),
CStateEventHandler(pState)
{
wxGetApp().AddStartupProfileRecord(_T("CLocalListView::CLocalListView"));
m_pState->RegisterHandler(this, STATECHANGE_LOCAL_DIR);
m_pState->RegisterHandler(this, STATECHANGE_APPLYFILTER);
m_pState->RegisterHandler(this, STATECHANGE_LOCAL_REFRESH_FILE);
m_dropTarget = -1;
const unsigned long widths[4] = { 120, 80, 100, 120 };
AddColumn(_("Filename"), wxLIST_FORMAT_LEFT, widths[0], true);
AddColumn(_("Filesize"), wxLIST_FORMAT_RIGHT, widths[1]);
AddColumn(_("Filetype"), wxLIST_FORMAT_LEFT, widths[2]);
AddColumn(_("Last modified"), wxLIST_FORMAT_LEFT, widths[3]);
LoadColumnSettings(OPTION_LOCALFILELIST_COLUMN_WIDTHS, OPTION_LOCALFILELIST_COLUMN_SHOWN, OPTION_LOCALFILELIST_COLUMN_ORDER);
InitSort(OPTION_LOCALFILELIST_SORTORDER);
SetImageList(GetSystemImageList(), wxIMAGE_LIST_SMALL);
#ifdef __WXMSW__
m_pVolumeEnumeratorThread = 0;
#endif
InitHeaderSortImageList();
SetDropTarget(new CLocalListViewDropTarget(this));
EnablePrefixSearch(true);
}
示例14: m_searchDialog
CSearchDialogFileList::CSearchDialogFileList(CSearchDialog* pParent, CState* pState, CQueueView* pQueue)
: CFileListCtrl<CSearchFileData>(pParent, pState, pQueue, true),
m_searchDialog(pParent)
{
m_hasParent = false;
SetImageList(GetSystemImageList(), wxIMAGE_LIST_SMALL);
m_dirIcon = GetIconIndex(dir);
InitSort(OPTION_SEARCH_SORTORDER);
InitHeaderSortImageList();
const unsigned long widths[7] = { 130, 130, 75, 80, 120, 80, 80 };
AddColumn(_("Filename"), wxLIST_FORMAT_LEFT, widths[0]);
AddColumn(_("Path"), wxLIST_FORMAT_LEFT, widths[1]);
AddColumn(_("Filesize"), wxLIST_FORMAT_RIGHT, widths[2]);
AddColumn(_("Filetype"), wxLIST_FORMAT_LEFT, widths[3]);
AddColumn(_("Last modified"), wxLIST_FORMAT_LEFT, widths[4]);
AddColumn(_("Permissions"), wxLIST_FORMAT_LEFT, widths[5]);
AddColumn(_("Owner/Group"), wxLIST_FORMAT_LEFT, widths[6]);
LoadColumnSettings(OPTION_SEARCH_COLUMN_WIDTHS, OPTION_SEARCH_COLUMN_SHOWN, OPTION_SEARCH_COLUMN_ORDER);
}
示例15: wxTreeCtrlEx
CLocalTreeView::CLocalTreeView(wxWindow* parent, wxWindowID id, CState *pState, CQueueView *pQueueView)
: wxTreeCtrlEx(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxTR_EDIT_LABELS | wxTR_LINES_AT_ROOT | wxTR_HAS_BUTTONS | wxNO_BORDER),
CSystemImageList(16),
CStateEventHandler(pState),
m_pQueueView(pQueueView)
{
wxGetApp().AddStartupProfileRecord(_T("CLocalTreeView::CLocalTreeView"));
#ifdef __WXMAC__
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
#endif
pState->RegisterHandler(this, STATECHANGE_LOCAL_DIR);
pState->RegisterHandler(this, STATECHANGE_APPLYFILTER);
SetImageList(GetSystemImageList());
#ifdef __WXMSW__
m_pVolumeEnumeratorThread = 0;
CreateRoot();
#else
wxTreeItemId root = AddRoot(_T("/"));
SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Normal);
SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_Selected);
SetItemImage(root, GetIconIndex(dir), wxTreeItemIcon_Expanded);
SetItemImage(root, GetIconIndex(opened_dir), wxTreeItemIcon_SelectedExpanded);
SetDir(_T("/"));
#endif
SetDropTarget(new CLocalTreeViewDropTarget(this));
}