Scope
ScopeColorComboCtrl.cpp
1 #include "stdafx.h"
2 #include "ScopeColorComboCtrl.h"
3 #include "helpers\lut.h"
4 #include "resource.h"
5 
6 namespace scope {
7  namespace gui {
8 
10 
11 CScopeColorComboCtrl::CScopeColorComboCtrl() {
12  // Create image list (only once)
13  if ( imagelist.IsNull() )
14  imagelist.Create(MAKEINTRESOURCE(IDB_COLORCOMBO), 16, 16, ILC_COLOR24);
15 
16  // possible resource leak -> imagelist is never destroyed... (I do not care, at program exit everything gets flushed anyway)
17 }
18 
20  SetImageList(imagelist);
21 
22  COMBOBOXEXITEM cbi;
23 
24  for ( uint32_t i = 0 ; i < gColorStrings.size() ; i++ ) {
25  cbi.iItem = i;
26  cbi.pszText = (LPWSTR)(LPCWSTR)gColorStrings[i];
27  cbi.mask = CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE;
28  cbi.cchTextMax = gColorStrings[i].GetLength();
29  cbi.iImage = i;
30  cbi.iSelectedImage = i;
31  InsertItem(&cbi);
32  }
33 
34 }
35 
36 
37 }
38 
39 }
This is the include file for standard system include files, or project specific include files that ar...
static CImageList imagelist
The image list with the color bitmap.
following http://www.mochima.com/articles/LUT/lut_h.html