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; }
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(); }
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; }
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(); }
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); }
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 ); }
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; }
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); }
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; }
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; }
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; }
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)); }
//--------------------------------------------------------------------------------------------------------------// 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; }
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; }
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); }
WBinaryPageList::WBinaryPageList(class WBinaryPage* parent, wxWindowID id) : wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_VIRTUAL | wxLC_SINGLE_SEL), binpage(*parent) { wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL); SetFont(font); unsigned int size = binpage.bindata.GetDataLen(); SetItemCount((size / 16) + ((size % 16) != 0)); InsertColumn(0, _T("Offset"), wxLIST_FORMAT_RIGHT, 32); InsertColumn(1, _T("Hexadecimal"), wxLIST_FORMAT_LEFT, 400); InsertColumn(2, _T("ASCII"), wxLIST_FORMAT_LEFT); wxWindowDC dc(this); wxCoord textwidth, textheight; dc.SetFont(font); dc.GetTextExtent(_T("000000000"), &textwidth, &textheight); SetColumnWidth(0, textwidth); dc.GetTextExtent(_T("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "), &textwidth, &textheight); SetColumnWidth(1, textwidth); dc.GetTextExtent(_T("0000000000000000 "), &textwidth, &textheight); SetColumnWidth(2, textwidth); SetItemCount((size / 16) + ((size % 16) != 0)); }
//============================================================================== 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); }
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; }
ValueListCtrl::ValueListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : wxListCtrl(parent, id, pos, size, style | wxLC_REPORT | wxLC_SINGLE_SEL, validator, name) { InsertColumn(0, "Name"); InsertColumn(1, "Type"); InsertColumn(2, "Data"); }
// Constructor main_listctrl::main_listctrl( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name ) : wxListCtrl( parent, id, pos, size, style, validator, name ) { m_parent = parent; // This listctrl needs to insert its columns in the constructor, since as soon // as the listctrl is built, it is resized and grafted onto an "unknown" XRC // placeholder. This induces an OnSize() event, calling the overrriden OnSize function for // this class, which needs to have 3 columns to resize (else an assert on WXGTK debug // build). InsertColumn( NAME_COLUMN, _( "Channel name" ), wxLIST_FORMAT_LEFT, 160 ); InsertColumn( DUE_COLUMN, _( "Due" ), wxLIST_FORMAT_LEFT, 100 ); // Workaround to prevent a zero width column from bleeding beyond column in ports // using the generic listctrl. Also make it a width of 1 pixel so #if ( setupUSE_FIX_FOR_ZERO_WIDTH_COLUMNS_IN_LISTCTRLS ) InsertColumn( SECTION_COLUMN, "", wxLIST_FORMAT_LEFT, 1 ); #else InsertColumn( SECTION_COLUMN, _( "Section" ), wxLIST_FORMAT_LEFT, 0 ); #endif #if ( setupUSE_DRAG_AND_DROP ) // Associate a filename drop targets with this listctrl SetDropTarget( new dnd_file( this ) ); #endif }
//设置列信息 bool CUserListView::SetColumnDescribe(tagColumnItem ColumnItem[], WORD wColumnCount) { //效验状态 ASSERT(ColumnItem!=NULL); if (GetSafeHwnd()==NULL) return false; //删除旧信息 m_wColumnCount=0; WORD wTempCount=m_SkinHeadCtrl.GetItemCount(); for (WORD i=0;i<wTempCount;i++) DeleteColumn(0); //调整参数 wColumnCount=__min(MAX_COLUMN-1,wColumnCount); //插入新信息 SetRedraw(FALSE); for (WORD i=0;i<wColumnCount;i++) { m_wDataDescribe[i]=ColumnItem[i].wDataDescribe; if (m_wColumnCount==0) InsertColumn(m_wColumnCount++,ColumnItem[i].szColumnName,LVCFMT_LEFT,ColumnItem[i].wColumnWidth+m_uImageSpace); else InsertColumn(m_wColumnCount++,ColumnItem[i].szColumnName,LVCFMT_LEFT,ColumnItem[i].wColumnWidth); } SetRedraw(TRUE); return true; }
void COutputWnd::InitGridColumn() { InsertColumn(0,_T("ID"),80); InsertColumn(1,_T("Ãû³Æ"),80); InsertColumn(2,_T("½Ç¶È"),80); InsertColumn(3,_T("λÖÃ"),80); InsertColumn(4,_T("²îÒì¶È"),80); }
void CIrcNickListCtrl::Init() { InsertColumn(0,GetResString(IDS_IRC_NICK),LVCFMT_LEFT,90); InsertColumn(1,GetResString(IDS_STATUS),LVCFMT_LEFT,70); LoadSettings(); SetSortArrow(); SortItems(&SortProc, GetSortItem() + ( (GetSortAscending()) ? 0:10) ); }
void PoeditListCtrl::CreateColumns() { DeleteAllColumns(); InsertColumn(0, _("Source text")); InsertColumn(1, _("Translation")); if (m_displayLines) InsertColumn(2, _("Line"), wxLIST_FORMAT_RIGHT); SizeColumns(); }
///////////////////////////////////////////////////////////////////////////// // startup information ///////////////////////////////////////////////////////////////////////////// void CCustomListCtrl::PreSubclassWindow() { //set the column information InsertColumn(0, "Color", LVCFMT_CENTER, 40); InsertColumn(1, "Player", LVCFMT_LEFT, 150, 2); //normal handling CSortListCtrl::PreSubclassWindow(); }
void CIrcChannelListCtrl::Init() { InsertColumn(0, GetResString(IDS_IRC_NAME), LVCFMT_LEFT, 203); InsertColumn(1, GetResString(IDS_UUSERS), LVCFMT_LEFT, 50); InsertColumn(2, GetResString(IDS_DESCRIPTION), LVCFMT_LEFT, 350); LoadSettings(); SetSortArrow(); SortItems(&SortProc, GetSortItem() + (GetSortAscending() ? 0 : 10)); }
bool CListProcess::TransferDataToWindow() { wxString sTime; bool bStartTime = false; bool bStopTime = false; bool bRtn = true; bool bIsShown = IsShownOnScreen(); if(bIsShown) { Show(false); } size_t n = m_pDirList->GetCount(); long nItem; CDirEntry *pDirEntry; ClearAll(); InsertColumn(ITEM_DIR,_T("Directory"),wxLIST_FORMAT_LEFT); InsertColumn(ITEM_START,_T("Start"),wxLIST_FORMAT_LEFT); InsertColumn(ITEM_STOP,_T("Stop"),wxLIST_FORMAT_LEFT); InsertColumn(ITEM_STATUS,_T("Status"),wxLIST_FORMAT_LEFT); for(size_t i = 0; (i < n) && bRtn; i++) { pDirEntry = m_pDirList->At(i); const wxString &sInput(pDirEntry->GetInputDir()); const wxString &sStatus(pDirEntry->GetStatusString()); nItem = InsertItem((long)i,sInput); sTime = pDirEntry->FormatStartTime(); SetItem(nItem,ITEM_START,sTime); if(!sTime.IsEmpty()) { bStartTime = true; } sTime = pDirEntry->FormatStopTime(); SetItem(nItem,ITEM_STOP,sTime); if(!sTime.IsEmpty()) { bStopTime = true; } SetItem(nItem,ITEM_STATUS,sStatus); SetItemTextColour(nItem,pDirEntry->GetStatusColour()); } SetColumnWidth(ITEM_DIR,wxLIST_AUTOSIZE ); #define HEADER_SIZE 80 SetColumnWidth(ITEM_START,bStartTime ? wxLIST_AUTOSIZE : HEADER_SIZE); SetColumnWidth(ITEM_STOP,bStopTime ? wxLIST_AUTOSIZE : HEADER_SIZE); #undef HEADER_SIZE SetColumnWidth(ITEM_STATUS,wxLIST_AUTOSIZE ); if(bIsShown) { Show(true); } Refresh(); return bRtn; }
console::TELLFuncList::TELLFuncList(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxListView(parent, id, pos, size, style) { InsertColumn(0, "type"); InsertColumn(1, "name"); InsertColumn(2, "arguments"); SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER); SetColumnWidth(2, wxLIST_AUTOSIZE_USEHEADER); }
void wxGxContentView::InitColumns(void) { if(GetColumnCount() < 4) { InsertColumn(0, _("Name"), wxLIST_FORMAT_LEFT, 150); InsertColumn(1, _("Type"), wxLIST_FORMAT_LEFT, 250); InsertColumn(2, _("Size"), wxLIST_FORMAT_RIGHT, 80); InsertColumn(3, _("Modification date"), wxLIST_FORMAT_LEFT, 80); //InsertColumn(4, _("Geometry type"), wxLIST_FORMAT_LEFT, 100); } }
void CDataWnd::CreateSurvey () { uvar32_64 n, len; for (n = 0, len = GetHeaderCtrl()->GetItemCount(); n < len; ++n) DeleteColumn (0); DeleteAllItems (); if (m_pDoc->Surveis(aimActive).GetCount () != 1) return; InsertColumn (0, "", LVCFMT_RIGHT, 20, 0); for (n = 0, len = m_pDoc->Surveis[aimActive].Fields.GetCount (); n < len; ++n) InsertColumn (n + 1, m_pDoc->Surveis[aimActive].Fields[n].GetName (), LVCFMT_LEFT, 80, n + 1); }