本文整理汇总了C++中InsertColumn函数的典型用法代码示例。如果您正苦于以下问题:C++ InsertColumn函数的具体用法?C++ InsertColumn怎么用?C++ InsertColumn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InsertColumn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitColumnInfo
int CMyListCtrl::OnCreate(LPCREATESTRUCT lp)
{
InitColumnInfo();
LoadSkin();
if( __super::OnCreate(lp) == -1 )
{
return -1;
}
for(map<int,MYLIST_COLUMN_INFO>::iterator it = m_mapColumnInfo.begin();
it != m_mapColumnInfo.end();
it++)
{
MYLIST_COLUMN_INFO& columnInfo = it->second;
if( columnInfo.enumColumnType == MYLIST_COLUMN_INFO::COLUMN_TYPE_IMAGE)
{
InsertColumn( columnInfo.iColumnIndex, columnInfo.strColumnName.c_str(), LVCFMT_IMAGE,columnInfo.iColumnWidth );
}
else
{
LVCOLUMN lvColumn;
lvColumn.mask = LVCF_IMAGE | LVCF_TEXT | LVCF_FMT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_LEFT; //LVCFMT_IMAGE | LVCF_TEXT;
//lvColumn.iSubItem = columnInfo.iColumnIndex;
lvColumn.cx = columnInfo.iColumnWidth;
lvColumn.pszText = (char*) columnInfo.strColumnName.c_str();
InsertColumn( columnInfo.iColumnIndex,&lvColumn);
}
}
AfxGetUIManager()->UIGetSkinMgr()->AddSkinWnd( this );
return 1;
}
示例2: DeleteAllColumns
void PoeditListCtrl::CreateColumns()
{
DeleteAllColumns();
int curr = 0;
m_colSource = (int)InsertColumn(curr++, _("Source text"));
if (m_catalog && m_catalog->HasCapability(Catalog::Cap::Translations))
m_colTrans = (int)InsertColumn(curr++, _("Translation"));
else
m_colTrans = -1;
if (m_displayIDs)
m_colId = (int)InsertColumn(curr++, _("ID"), wxLIST_FORMAT_RIGHT);
else
m_colId = -1;
#ifdef __WXMSW__
if (m_appIsRTL)
{
// another wx quirk: if we truly need left alignment, we must lie under RTL locales
wxListItem colInfoOrig;
colInfoOrig.SetAlign(wxLIST_FORMAT_RIGHT);
SetColumn(m_colSource, colInfoOrig);
}
#endif
SizeColumns();
}
示例3: SetBkColor
void CIOSFileList::Init(CIOSDirectoryTree *iosDirectoryTree)
{
SetBkColor(RGB(255,255,255));
SetExtendedStyle(GetExtendedStyle()|LVS_EX_FULLROWSELECT);
CRect rect;
GetClientRect(rect);
int width = (int)(rect.Width() * 0.15);
InsertColumn(0, _T("名称"), LVCFMT_LEFT, rect.Width() - width * 4);
InsertColumn(1, _T("类型"), LVCFMT_LEFT, width);
InsertColumn(2, _T("大小"), LVCFMT_RIGHT, width);
InsertColumn(3, _T("块大小"), LVCFMT_RIGHT, width);
InsertColumn(4, _T("链接数"), LVCFMT_LEFT, width);
m_imageList.Create(16,16,ILC_COLOR8 | ILC_MASK,2,2);
m_imageList.SetBkColor(RGB(255,255,255));
CBitmap bitmap[2];
bitmap[0].LoadBitmap(IDB_FOLDER);
m_imageList.Add(&bitmap[0], RGB(255,255,255));
bitmap[1].LoadBitmap(IDB_SYMBOL_LINK);
m_imageList.Add(&bitmap[1], RGB(255,255,255));
SetImageList(&m_imageList, LVSIL_SMALL);
m_indexList = iosDirectoryTree;
}
示例4: SetExtendedListViewStyle
void CClipSpyListCtrl::Init()
{
SetExtendedListViewStyle ( LVS_EX_FULLROWSELECT );
InsertColumn ( 0, _T("Format"), LVCFMT_LEFT, 0, 0 );
InsertColumn ( 1, _T("Data size"), LVCFMT_LEFT, 0, 1 );
SetColumnWidth ( 0, LVSCW_AUTOSIZE_USEHEADER );
SetColumnWidth ( 1, LVSCW_AUTOSIZE_USEHEADER );
// Register this window as a clipboard viewer. This makes us get the
// WM_DRAWCLIPBOARD and WM_CHANGECBCHAIN messages. The
// m_bCallingSetClipboardViewer is necessary because SetClipboardViewer()
// sends us a WM_DRAWCLIPBOARD but we must not process it. See
// OnDrawClipboard() for more details.
m_bCallingSetClipboardViewer = true;
m_hwndNextClipboardViewer = SetClipboardViewer();
m_bCallingSetClipboardViewer = false;
// Init our drop target object
// m_pDropTarget = CDropTargetImpl<CClipSpyListCtrl>::CreateMe ( this );
//
// if ( m_pDropTarget )
// m_pDropTarget->InitializeDT();
// Read the stuff on the clipboard, if there is any.
ReadClipboard();
}
示例5: InsertColumn
BOOL
PropPageFormats::OnInitDialog ()
{
BOOL ret = CPropertyPage::OnInitDialog();
try
{
listControl.SetExtendedStyle (listControl.GetExtendedStyle()
| LVS_EX_FULLROWSELECT);
InsertColumn (0, T_("Key"), T_("pdfjadetex "));
InsertColumn (1, T_("Description"), T_("pdfLaTeX bla bla "));
InsertColumn (2, T_("Attributes"), T_("Exclude, bla bla "));
Refresh ();
}
catch (const MiKTeXException & e)
{
ErrorDialog::DoModal (this, e);
}
catch (const exception & e)
{
ErrorDialog::DoModal (this, e);
}
return (ret);
}
示例6: wxListCtrl
HOTKEY_LIST_CTRL::HOTKEY_LIST_CTRL( wxWindow *aParent, struct EDA_HOTKEY_CONFIG* aSection ) :
wxListCtrl( aParent, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VIRTUAL )
{
m_sectionTag = aSection->m_SectionTag;
m_curEditingRow = -1;
InsertColumn( 0, _( "Command" ) );
InsertColumn( 1, _( "Hotkey" ) );
// Add a dummy hotkey_spec which is a header before each hotkey list
EDA_HOTKEY** hotkey_descr_list;
// Add a copy of hotkeys to our list
for( hotkey_descr_list = aSection->m_HK_InfoList; *hotkey_descr_list; hotkey_descr_list++ )
{
EDA_HOTKEY* hotkey_descr = *hotkey_descr_list;
m_hotkeys.push_back( new EDA_HOTKEY( hotkey_descr ) );
}
// Set item count to hotkey size, this gets it to autoload the entries
SetItemCount( m_hotkeys.size() );
SetColumnWidth( 0, wxLIST_AUTOSIZE );
SetColumnWidth( 1, wxLIST_AUTOSIZE );
Bind( wxEVT_CHAR, &HOTKEY_LIST_CTRL::OnChar, this );
Bind( wxEVT_LIST_ITEM_SELECTED, &HOTKEY_LIST_CTRL::OnListItemSelected, this );
Bind( wxEVT_SIZE, &HOTKEY_LIST_CTRL::OnSize, this );
}
示例7: SetImageList
BOOL MyListCtrl::init()
{
//Create Image list.
m_ImageListThumb.DeleteImageList();
m_IconWidth=2;
m_IconHeight=27;
m_ImageListThumb.Create(m_IconWidth, m_IconHeight, ILC_COLOR24, 0, 1);
SetImageList(&m_ImageListThumb, LVSIL_SMALL);
m_ShowIcons=FALSE;
Arrange(LVSCW_AUTOSIZE);
//LVSCW_AUTOSIZE
FreeListItems();
// For the resize problem......
m_iNumberOfColumns=2;
m_iColumnWidthArray[0]=60;
m_iColumnWidthArray[1]=40;
m_iColumnWidthArray[2]=110;
m_iColumnWidthArray[3]=100;
InsertColumn(0,"Name",LVCFMT_LEFT,m_iColumnWidthArray[0]);
InsertColumn(1,"Address",LVCFMT_LEFT,m_iColumnWidthArray[1]);
// nice flat list-
SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FLATSB |
LVS_EX_FULLROWSELECT );
//
// Setting the header INFO
//
// Loading header images..
m_HeaderImages.DeleteImageList();
m_HeaderImages.Create(IDB_HEADER, 9*2, 1, RGB(255,255,255));
CHeaderCtrl* pHeader=GetHeaderCtrl();
if(pHeader)
{
pHeader->SetImageList(&m_HeaderImages);
for (int i=0; i < pHeader->GetItemCount(); i++)
{
SetHeaderIcon(i,-1);
}
SetBkColor(RGB(255,255,255));
SetTextBkColor(RGB(255,255,255));
SetTextColor(RGB(0,0,0));
SetHeaderIcon(0,0);
m_iCurrentSortColumn=0;
}
ResizeColumns();
return TRUE;
}
示例8: wxSortedListCtrl
ThreadList::ThreadList(wxWindow *parent, const wxPoint& pos,
const wxSize& size, wxButton *_ok_button, wxButton *_all_button)
: wxSortedListCtrl(parent, THREADS_LIST, pos, size, wxLC_REPORT),
timer(this, THREADS_LIST_TIMER),
ok_button(_ok_button), all_button(_all_button)
{
InitSort();
wxListItem itemCol;
itemCol.m_mask = wxLIST_MASK_TEXT/* | wxLIST_MASK_IMAGE*/;
itemCol.m_text = _T("Thread");
itemCol.m_image = -1;
InsertColumn(COL_ID, itemCol);
itemCol.m_text = _T("Location");
InsertColumn(COL_LOCATION, itemCol);
itemCol.m_text = _T("Thread Usage");
InsertColumn(COL_CPUUSAGE, itemCol);
SetColumnWidth(COL_ID, 50);
SetColumnWidth(COL_LOCATION, 200);
SetColumnWidth(COL_CPUUSAGE, 120);
sort_column = COL_CPUUSAGE;
sort_dir = SORT_DOWN;
SetSortImage(sort_column, sort_dir);
process_handle = NULL;
syminfo = NULL;
lastTime = wxGetLocalTimeMillis();
updateThreads(NULL, NULL);
timer.Start(UPDATE_DELAY);
}
示例9: rc
BOOL CWndLog::Create(CWnd *pParent)
{
CRect rc (0, 0, 50, 50);
if (FALSE == CListCtrl::Create (LVS_REPORT|LVS_NOSORTHEADER|LVS_SHOWSELALWAYS|LVS_OWNERDRAWFIXED, rc, pParent, 0x76329))
return FALSE;
SetExtendedStyle (LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP);
m_images.Create (16, 15, ILC_COLOR24 | ILC_MASK, 6, 1);
CBitmap bmp;
bmp.Attach (SBMP (IDB_LOGSTATES));
m_images.Add (&bmp, RGB (255, 0, 255));
SetImageList (&m_images, LVSIL_SMALL);
InsertColumn (0, "Time", LVCFMT_LEFT, 80, 0);
InsertColumn (1, "Date", LVCFMT_LEFT, 100, 0);
InsertColumn (2, "Information", LVCFMT_LEFT, 400, 0);
ShowWindow (SW_SHOW);
return TRUE;
}
示例10: ModifyStyle
int CArgumentsTableCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
ModifyStyle(0,LVS_REPORT | LVS_EDITLABELS | LVS_NOSORTHEADER | LVS_SINGLESEL);
ModifyStyleEx(0,WS_EX_STATICEDGE);
SetExtendedStyle(GetExtendedStyle()|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
CRect rcClient;
GetClientRect(&rcClient);
InsertColumn(0,"Type",LVCFMT_LEFT,rcClient.Width()/2);
InsertColumn(1,"Value",LVCFMT_LEFT,rcClient.Width()/2);
int nRow = 0;
if(m_pArgs!=NULL) {
int nCount = m_pArgs->GetCount();
POSITION nIdx = m_pArgs->GetHeadPosition();
while(nIdx!=NULL) {
CArgument* pArg = m_pArgs->GetNext(nIdx);
InsertItem(nRow,pArg->GetType());
SetItemText(nRow,1,pArg->GetName());
nRow++;
}
}
InsertItem(nRow,CString(""));
SetItemText(nRow,1,CString(""));
return 0;
}
示例11: InsertColumn
bool HistList::Create(wxWindow* parent, wxWindowID id )
{
bool res = wxListView::Create(parent, id, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxLC_VIRTUAL | wxLC_SINGLE_SEL );
wxListItem col1;
//wxListItem col2;
//col1.SetColumn(0);
col1.SetText(wxString(wxT("Last time")));
//col1.SetWidth(wxLIST_AUTOSIZE);
col1.SetAlign(wxLIST_FORMAT_CENTRE);
InsertColumn( 0, col1 );
col1.SetAlign(wxLIST_FORMAT_LEFT);
col1.SetText(wxString(wxT("Book")));
InsertColumn( 1, col1 );
col1.SetText(wxString(wxT("Pos")));
InsertColumn( 2, col1 );
SetItemCount(20);
UpdateColumns();
Update();
//SetColumnWidth(0, wxLIST_AUTOSIZE);
//col1.
//col2.SetColumn(1);
//SetColumnWidth(1, wxLIST_AUTOSIZE);
//SetColumn( 0, col1 );
//SetColumn( 1, col2 );
//SetColumn( 2, col3 );
return res;
}
示例12: 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 | LVS_EX_INFOTIP);
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);
SetAllIcons();
Localize();
LoadSettings();
// Barry - Use preferred sort order from preferences
SetSortArrow();
SortItems(SortProc, GetSortItem() + (GetSortAscending() ? 0:100));
}
示例13: RGB
//--------------------------------------------------------------------------------------------------------------//
int CChildView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
m_ilImageList.Create(MAKEINTRESOURCE(IDB_LOG_TYPE), 16, 3, RGB(0xFF,0x00,0xFF));
SetImageList(&m_ilImageList, LVSIL_SMALL);
CXMLParamsHelper XMLParams;
XMLParams.LoadXMLParams();
long nTypeW = COLUMN_TYPE_W;
long nDateW = COLUMN_DATE_W;
long nTimeW = COLUMN_TIME_W;
long nDescW = COLUMN_DESC_W;
XMLParams.GetXMLLong(_T("ETS\\CIBCTradeFeedAdapter\\Log"), COLUMN_TYPE, &nTypeW, COLUMN_TYPE_W);
XMLParams.GetXMLLong(_T("ETS\\CIBCTradeFeedAdapter\\Log"), COLUMN_DATE, &nDateW, COLUMN_DATE_W);
XMLParams.GetXMLLong(_T("ETS\\CIBCTradeFeedAdapter\\Log"), COLUMN_TIME, &nTimeW, COLUMN_TIME_W);
XMLParams.GetXMLLong(_T("ETS\\CIBCTradeFeedAdapter\\Log"), COLUMN_DESC, &nDescW, COLUMN_DESC_W);
int i = 0;
InsertColumn(i++, COLUMN_TYPE, LVCFMT_LEFT, nTypeW);
InsertColumn(i++, COLUMN_DATE, LVCFMT_LEFT, nDateW);
InsertColumn(i++, COLUMN_TIME, LVCFMT_LEFT, nTimeW);
InsertColumn(i++, COLUMN_DESC, LVCFMT_LEFT, nDescW);
return 0;
}
示例14: InsertColumn
int CObjectListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
InsertColumn(0, _T("name"), LVCFMT_LEFT, 100);
InsertColumn(1, _T("position"), LVCFMT_LEFT, 130);
InsertColumn(2, _T("Rotation"), LVCFMT_LEFT, 130);
InsertColumn(3, _T("Euler angle"), LVCFMT_LEFT, 130);
InsertColumn(4, _T("Quarternion"), LVCFMT_LEFT, 160);
// TODO: 여기에 특수화된 작성 코드를 추가합니다.
const list<GroundControl::Node*>& nodelist = GroundControlManager.getNodeList();
for (list<GroundControl::Node*>::const_iterator iter = nodelist.begin(); iter != nodelist.end(); iter++)
{
const GroundControl::Node* nodeinfo = *iter;
wstring nodename = wstring(nodeinfo->name().begin(), nodeinfo->name().end());
InsertObjectData(nodename.c_str(), nodeinfo->pos(), nodeinfo->rot(), nodeinfo->Euler(), nodeinfo->Quarternion());
}
return 0;
}
示例15: SetExtendedStyle
void CGitProgressList::Init()
{
SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
DeleteAllItems();
int c = ((CHeaderCtrl*)(GetDlgItem(0)))->GetItemCount()-1;
while (c>=0)
DeleteColumn(c--);
CString temp;
temp.LoadString(IDS_PROGRS_ACTION);
InsertColumn(0, temp);
temp.LoadString(IDS_PROGRS_PATH);
InsertColumn(1, temp);
m_pThread = AfxBeginThread(ProgressThreadEntry, this, THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
if (m_pThread==NULL)
{
ReportError(CString(MAKEINTRESOURCE(IDS_ERR_THREADSTARTFAILED)));
}
else
{
m_pThread->m_bAutoDelete = FALSE;
m_pThread->ResumeThread();
}
// Call this early so that the column headings aren't hidden before any
// text gets added.
ResizeColumns();
SetTimer(VISIBLETIMER, 300, NULL);
}