本文整理汇总了C++中AddItem函数的典型用法代码示例。如果您正苦于以下问题:C++ AddItem函数的具体用法?C++ AddItem怎么用?C++ AddItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TAP_Hdd_ChangeDir
void AutoStartPage::PopulateList()
{
m_taps.clear();
// Get a list of TAPs in the current Auto Start
TAP_Hdd_ChangeDir( autoStartPath );
TYPE_File file;
int index = 0;
for ( dword totalEntry = TAP_Hdd_FindFirst( &file ); totalEntry > 0; )
{
if ( file.attr == ATTR_NORMAL )
{
char* ext = strrchr(file.name, '.');
if ( ext )
{
// ensure we're only looking at .tap files
++ext;
bool enabled = stricmp( ext, "tap" ) == 0;
if ( enabled || stricmp( ext, "nap" ) == 0 )
{
// that we can open
TYPE_File* f = TAP_Hdd_Fopen( file.name );
if ( f )
{
// read the TAP header
tTAPHeader header;
memset( &header, 0, sizeof(header) );
TAP_Hdd_Fread( &header, sizeof(header), 1, f );
TAP_Hdd_Fclose( f );
// ensure that it's actually a TAP format file
if ( strncmp( header.Signature, "TFAPMIPS", 8 ) == 0 )
{
m_taps.push_back(AutoStartTAP());
AutoStartTAP& t = m_taps.back();
// store the filename with the extension .tap in the order array
*ext = 't';
t.index = index;
t.filename = file.name;
t.enabled = enabled;
t.id = header.TAPID;
t.name = header.Name;
// and generate the text that will be shown in the footer
t.footer.format( "%s\n%s\n%s\n", header.Description, header.AuthorName, header.EtcStr );
++index;
}
}
}
}
}
dword currentEntry = TAP_Hdd_FindNext( &file );
if ( totalEntry == currentEntry || currentEntry == 0 )
break;
}
// Remove the Loading message and redraw the window contents
DiscardItems();
for (unsigned int i=0; i < m_taps.size(); ++i)
AddItem(new TAPListItem(this, i));
AddItem(new FooterActionListItem(this, &Commit, "Press OK to save the new TAP order\nTAPs will be loaded in this order next time the unit wakes from standby", 0, "", "Save Changes"));
AddItem(new FooterActionListItem(this, &Backup, "Press OK to backup the TAP order and enabled state as listed above", 0, "", "Backup"));
AddItem(new FooterActionListItem(this, &Restore, "Press OK to restore the previous backup to the list above\nThis does not save changes to disk", 0, "", "Restore"));
Draw();
}
开发者ID:BackupTheBerlios,项目名称:tap-svn,代码行数:67,代码来源:AutoStartPage.cpp
示例2: connect
void VSCSearch::SetupConnections()
{
connect( this->ui.pushButtonStart, SIGNAL( clicked() ), this, SLOT(StartSearch()));
connect( this->ui.pushButtonStop, SIGNAL( clicked() ), this, SLOT(StopSearch()));
connect( this->ui.pushButtonAdd, SIGNAL( clicked() ), this, SLOT(AddAll()));
connect( this->ui.pushButtonSelect, SIGNAL( clicked() ), this, SLOT(SelectAll()));
connect( this, SIGNAL(NewSearchedItem(astring, astring, astring, astring, astring, astring) ), this, SLOT(AddItem(astring, astring, astring, astring, astring, astring)), Qt::QueuedConnection);
//Qt::QueuedConnection
}
开发者ID:Wonderful2014,项目名称:vdc,代码行数:9,代码来源:vscsearch.cpp
示例3: self
void
TExpandoMenuBar::AttachedToWindow()
{
BMessenger self(this);
BList teamList;
TBarApp::Subscribe(self, &teamList);
float width = fVertical ? Frame().Width() : kMinimumWindowWidth;
float height = -1.0f;
// top or bottom mode, add be menu and sep for menubar tracking consistency
if (!fVertical) {
TBeMenu *beMenu = new TBeMenu(fBarView);
TBarWindow::SetBeMenu(beMenu);
fBeMenuItem = new TBarMenuTitle(kBeMenuWidth, Frame().Height(),
AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_BeLogoIcon), beMenu, true);
AddItem(fBeMenuItem);
fSeparatorItem = new TTeamMenuItem(kSepItemWidth, height, fVertical);
AddItem(fSeparatorItem);
fSeparatorItem->SetEnabled(false);
fFirstApp = 2;
} else {
fBeMenuItem = NULL;
fSeparatorItem = NULL;
}
desk_settings *settings = ((TBarApp *)be_app)->Settings();
if (settings->sortRunningApps)
teamList.SortItems(CompareByName);
int32 count = teamList.CountItems();
for (int32 i = 0; i < count; i++) {
BarTeamInfo *barInfo = (BarTeamInfo *)teamList.ItemAt(i);
if ((barInfo->flags & B_BACKGROUND_APP) == 0
&& strcasecmp(barInfo->sig, TASK_BAR_MIME_SIG) != 0) {
if ((settings->trackerAlwaysFirst)
&& (strcmp(barInfo->sig, kTrackerSignature)) == 0) {
AddItem(new TTeamMenuItem(barInfo->teams, barInfo->icon,
barInfo->name, barInfo->sig, width, height,
fDrawLabel, fVertical), fFirstApp);
} else {
AddItem(new TTeamMenuItem(barInfo->teams, barInfo->icon,
barInfo->name, barInfo->sig, width, height,
fDrawLabel, fVertical));
}
barInfo->teams = NULL;
barInfo->icon = NULL;
barInfo->name = NULL;
barInfo->sig = NULL;
}
delete barInfo;
}
BMenuBar::AttachedToWindow();
if (fVertical) {
sDoMonitor = true;
sMonThread = spawn_thread(monitor_team_windows,
"Expando Window Watcher", B_LOW_PRIORITY, this);
resume_thread(sMonThread);
}
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:65,代码来源:ExpandoMenuBar.cpp
示例4: AddItem
void CServerListView::Add(IRCQuery *pQuery)
{
AddItem(STI_QUERY,(void *)pQuery);
}
开发者ID:HydraIRC,项目名称:hydrairc,代码行数:4,代码来源:ServerList.cpp
示例5: AddItem
void CSitesWnd::AddSiteToList(fsSiteInfo *pSite)
{
int iItem = AddItem ("", GetSysColor (COLOR_WINDOW), GetSysColor (COLOR_WINDOWTEXT));
SetItemData (iItem, (DWORD)pSite);
UpdateSite (pSite);
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:6,代码来源:SitesWnd.cpp
示例6: AddItem
//增加一个内容为{keyword, font}的配置(QRichConfigureItem)到配置列表中(QRichConfigureList),
//缺少的字体颜色(color)项根据默认配置(defaultItem)的对应项(color)补全
bool QRichConfigureList::AddItem(const QString keyword, const QFont font)
{
return AddItem(keyword, font, defaultItem.color);
}
开发者ID:RTNelo,项目名称:Lutetium,代码行数:6,代码来源:qrichconfigure.cpp
示例7: _
void PixelInfoListCtrl::AddSurfaceItem( LayerSurface* surf, double* pos, bool bUpdateCount )
{
if ( m_bShowSurfaceCoordinates )
{
double sf_pos[3];
surf->GetSurfaceRASAtTarget( pos, sf_pos );
wxString strg;
strg.Printf( _("[%.2f, %.2f, %.2f]"), sf_pos[0], sf_pos[1], sf_pos[2] );
wxString text = ( AppendSpaceString( _("Coordinate") ) << strg );
AddItem( wxString::FromAscii( surf->GetName() ), text, (long)surf );
}
int nVertex = surf->GetVertexIndexAtTarget( pos, NULL );
if ( nVertex < 0 )
{
if ( !m_bShowSurfaceCoordinates )
AddItem( wxString::FromAscii( surf->GetName() ), _(""), (long)surf, bUpdateCount );
}
else
{
wxString text = AppendSpaceString( _("Vertex") );
text << nVertex;
double ras[3];
surf->GetSurfaceRASAtVertex( nVertex, ras );
wxString strg;
strg.Printf( _("[%.2f, %.2f, %.2f]"), ras[0], ras[1], ras[2] );
text = ( AppendSpaceString(text) << strg );
AddItem( ( m_bShowSurfaceCoordinates ? wxString("") : wxString::FromAscii( surf->GetName() ) ), text, (long)surf );
double vec[3];
surf->GetNormalAtVertex( nVertex, vec );
strg.Printf( _("[%.2f, %.2f, %.2f]"), vec[0], vec[1], vec[2] );
text = ( AppendSpaceString( _("Normal") ) << strg );
AddItem( _(""), text );
if ( surf->GetActiveVector() >= 0 )
{
surf->GetVectorAtVertex( nVertex, vec );
wxString strg;
strg.Printf( _("[%.2f, %.2f, %.2f]"), vec[0], vec[1], vec[2] );
text = ( AppendSpaceString( _("Vector") ) << strg );
AddItem( _(""), text );
}
if ( surf->HasCurvature() && m_bShowSurfaceCurvature )
AddItem( _(""), ( AppendSpaceString( _("Curvature") ) << surf->GetCurvatureValue( nVertex ) ), 0, bUpdateCount );
int nOverlays = surf->GetNumberOfOverlays();
for ( int i = 0; i < nOverlays; i++ )
{
SurfaceOverlay* overlay = surf->GetOverlay( i );
wxString strg = overlay->GetName();
AddItem( _(""), ( AppendSpaceString( strg ) << overlay->GetDataAtVertex( nVertex ) ), 0, bUpdateCount );
}
int nAnnotations = surf->GetNumberOfAnnotations();
for ( int i = 0; i < nAnnotations; i++ )
{
SurfaceAnnotation* annot = surf->GetAnnotation( i );
wxString strg = annot->GetName();
AddItem( _(""), ( AppendSpaceString( strg ) << annot->GetAnnotationNameAtVertex( nVertex ).c_str() ), 0, bUpdateCount );
}
}
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:64,代码来源:PixelInfoPanel.cpp
示例8: SetFont
void
TWindowMenu::AttachedToWindow()
{
SetFont(be_plain_font);
RemoveItems(0, CountItems(), true);
int32 miniCount = 0;
bool dragging = false;
TBarView* barview =(static_cast<TBarApp*>(be_app))->BarView();
if (barview && barview->LockLooper()) {
// 'dragging' mode set in BarView::CacheDragData
// invoke in MouseEnter in ExpandoMenuBar
dragging = barview->Dragging();
if (dragging) {
// We don't want to show the menu when dragging, but it's not
// possible to remove a submenu once it exists, so we simply hide it
// Don't call BMenu::Hide(), it causes the menu to pop up every now
// and then.
Window()->Hide();
// if in expando (horizontal or vertical)
if (barview->Expando()) {
SetTrackingHook(barview->MenuTrackingHook,
barview->GetTrackingHookData());
}
barview->DragStart();
}
barview->UnlockLooper();
}
int32 parentMenuItems = 0;
int32 numTeams = fTeam->CountItems();
for (int32 i = 0; i < numTeams; i++) {
team_id theTeam = (team_id)fTeam->ItemAt(i);
int32 count = 0;
int32* tokens = get_token_list(theTeam, &count);
for (int32 j = 0; j < count; j++) {
client_window_info* wInfo = get_window_info(tokens[j]);
if (wInfo == NULL)
continue;
if (WindowShouldBeListed(wInfo->feel)
&& (wInfo->show_hide_level <= 0 || wInfo->is_mini)) {
// Don't add new items if we're expanded. We've already done
// this, they've just been moved.
int32 numItems = CountItems();
int32 addIndex = 0;
for (; addIndex < numItems; addIndex++)
if (strcasecmp(ItemAt(addIndex)->Label(), wInfo->name) > 0)
break;
if (!fExpanded) {
TWindowMenuItem* item = new TWindowMenuItem(wInfo->name,
wInfo->server_token, wInfo->is_mini,
((1 << current_workspace()) & wInfo->workspaces) != 0,
dragging);
// disable app's window dropping for now
if (dragging)
item->SetEnabled(false);
AddItem(item,
TWindowMenuItem::InsertIndexFor(this, 0, item));
} else {
TTeamMenuItem* parentItem
= static_cast<TTeamMenuItem*>(Superitem());
if (parentItem->ExpandedWindowItem(wInfo->server_token)) {
TWindowMenuItem* item = parentItem->ExpandedWindowItem(
wInfo->server_token);
if (item == NULL)
continue;
item->SetTo(wInfo->name, wInfo->server_token,
wInfo->is_mini,
((1 << current_workspace()) & wInfo->workspaces)
!= 0, dragging);
parentMenuItems++;
}
}
if (wInfo->is_mini)
miniCount++;
}
free(wInfo);
}
free(tokens);
}
int32 itemCount = CountItems() + parentMenuItems;
if (itemCount < 1) {
TWindowMenuItem* noWindowsItem =
new TWindowMenuItem("No windows", -1, false, false);
noWindowsItem->SetEnabled(false);
AddItem(noWindowsItem);
//.........这里部分代码省略.........
开发者ID:mmanley,项目名称:Antares,代码行数:101,代码来源:WindowMenu.cpp
示例9: AddItems
//---------------------------------------------------------------------------
//Add Items
void AddItems() {
for (int i = 0; i < iItemNum; i++)
itmRoot = AddItem(itmRoot, rand() % iWeightRange + 1, rand() % iProfitRange + 1);
}
开发者ID:YI-YING,项目名称:Algorithm,代码行数:8,代码来源:Knapsack.cpp
示例10: GetDlgItem
/*
** Called when tab is displayed.
**
*/
void CDialogAbout::CTabLog::Initialize()
{
m_Initialized = true;
// Add columns to the list view
HWND item = GetDlgItem(m_Window, IDC_ABOUTLOG_ITEMS_LISTVIEW);
ListView_SetExtendedListViewStyleEx(item, 0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
// Set folder/.ini icons for tree list
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
HMODULE hDLL = GetModuleHandle(L"user32");
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(103), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImageList, hIcon);
DeleteObject(hIcon);
hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(101), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImageList, hIcon);
DeleteObject(hIcon);
hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(104), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImageList, hIcon);
DeleteObject(hIcon);
ListView_SetImageList(item, (WPARAM)hImageList, LVSIL_SMALL);
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT; // left-aligned column
lvc.iSubItem = 0;
lvc.cx = 75;
lvc.pszText = GetString(ID_STR_TYPE);
ListView_InsertColumn(item, 0, &lvc);
lvc.iSubItem = 1;
lvc.cx = 85;
lvc.pszText = GetString(ID_STR_TIME);
ListView_InsertColumn(item, 1, &lvc);
lvc.iSubItem = 2;
lvc.cx = 370;
lvc.pszText = GetString(ID_STR_MESSAGE);
ListView_InsertColumn(item, 2, &lvc);
// Add stored entires
std::list<CRainmeter::LOG_INFO>::const_iterator iter = Rainmeter->GetAboutLogData().begin();
for ( ; iter != Rainmeter->GetAboutLogData().end(); ++iter)
{
AddItem((*iter).level, (*iter).timestamp.c_str(), (*iter).message.c_str());
}
item = GetDlgItem(m_Window, IDC_ABOUTLOG_ERROR_CHECKBOX);
Button_SetCheck(item, BST_CHECKED);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_WARNING_CHECKBOX);
Button_SetCheck(item, BST_CHECKED);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_NOTICE_CHECKBOX);
Button_SetCheck(item, BST_CHECKED);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_DEBUG_CHECKBOX);
Button_SetCheck(item, BST_CHECKED);
}
开发者ID:testaccountx,项目名称:testrepo,代码行数:65,代码来源:DialogAbout.cpp
示例11: while
int MD5Calc::do_check(FILE *chkf)
{
int rc, ex = 0, failed = 0, checked = 0;
unsigned char chk_digest[16], file_digest[16];
char filename[256];
FILE *fp;
unsigned int flen = 14;
while ((rc = get_md5_line(chkf, chk_digest, filename)) >= 0) {
if (rc == 0) /* not an md5 line */
continue;
if(filename[strlen(filename)-1] == '\r' ||
filename[strlen(filename)-1] == '\n')
filename[strlen(filename)-1] = 0;
if (verbose) {
if (strlen(filename) > flen)
flen = strlen(filename);
fprintf(stderr, "%-*s ", flen, filename);
}
if (bin_mode || rc == 2)
fp = fopen(filename, FOPRBIN);
else
fp = fopen(filename, FOPRTXT);
if (fp == NULL) {
AddItem(filename,chk_digest,file_digest,2);
fprintf(stderr, "%s: can't open %s\n", progname, filename);
ex = 2;
continue;
}
if (mdfile(fp, file_digest)) {
AddItem(filename,chk_digest,file_digest,2);
fprintf(stderr, "%s: error reading %s\n", progname, filename);
ex = 2;
fclose(fp);
continue;
}
fclose(fp);
if (memcmp(chk_digest, file_digest, 16) != 0) {
AddItem(filename,chk_digest,file_digest, 0);
if (verbose)
fprintf(stderr, "FAILED\n");
else
fprintf(stderr, "%s: MD5 check failed for '%s'\n", progname, filename);
++failed;
} else {
if (verbose)
fprintf(stderr, "OK\n");
AddItem(filename,chk_digest,file_digest,1);
}
++checked;
}
if (verbose && failed)
fprintf(stderr, "%s: %d of %d file(s) failed MD5 check\n", progname, failed, checked);
if (!checked) {
fprintf(stderr, "%s: no files checked\n", progname);
return 3;
}
if (!ex && failed)
ex = 1;
return ex;
}
开发者ID:camillemuller,项目名称:Galaxy-flash-heimball-mac,代码行数:63,代码来源:md5calc.cpp
示例12: AddItem
void Game_Party::RemoveItem(int item_id, int amount) {
AddItem(item_id, -amount);
}
开发者ID:glynnc,项目名称:Player,代码行数:3,代码来源:game_party.cpp
示例13: switch
dword AutoStartPage::OnKey( dword key, dword extKey )
{
switch ( key )
{
case RKEY_Exit:
if ( CanExit() )
Close();
return 0;
case RKEY_Mute:
// pass Mute to the firmware
return key;
case RKEY_Menu:
{
if (menuActivates)
{
Close();
return key;
}
Replace(new ConfigPage());
return 0;
}
case RKEY_PlayList:
if ( CanExit() )
Replace(new LoadedTAPPage());
return 0;
case RKEY_VolUp:
{
int index = GetSelectedIndex();
if ( index < (int)m_taps.size()-1 )
{
// swap the filenames
AutoStartTAP t = m_taps[index];
m_taps[index] = m_taps[index+1];
m_taps[index+1] = t;
// move the selection
MoveSelection( 1, false );
m_dirty = true;
}
return 0;
}
case RKEY_VolDown:
{
int index = GetSelectedIndex();
if ( index > 0 && index < (int)m_taps.size() )
{
// swap the filenames
AutoStartTAP t = m_taps[index];
m_taps[index] = m_taps[index-1];
m_taps[index-1] = t;
// move the selection
MoveSelection( -1, false );
m_dirty = true;
}
return 0;
}
case RKEY_NewF1:
{
// enable/disable TAP
int index = GetSelectedIndex();
EnableTAP( index, !m_taps[index].enabled );
return 0;
}
case RKEY_F2:
{
int index = GetSelectedIndex();
if ( index < (int)m_taps.size() )
{
bool enable = !m_taps[index].enabled;
for ( unsigned int i = 0; i < m_taps.size(); ++i )
EnableTAP( i, enable );
}
return 0;
}
// Discard changes
case RKEY_Recall:
// get rid of the list items, then the
DiscardItems();
AddItem(new SimpleTextListItem(this, 0, "", "Loading..."));
Draw();
PopulateList();
m_dirty = false;
return 0;
// Save Changes
case RKEY_Record:
Save();
Close();
return 0;
}
ListPage::OnKey( key, extKey );
return 0;
}
开发者ID:BackupTheBerlios,项目名称:tap-svn,代码行数:92,代码来源:AutoStartPage.cpp
示例14: FillListView
void FillListView ( void ) {
AddItem(IDS_TOOLS_CMD_NAME, IDS_TOOLS_CMD_DESCR, IDS_TOOLS_CMD_CMD, IDS_TOOLS_CMD_PARAM, CSIDL_SYSTEM);
AddItem(IDS_TOOLS_REGEDIT_NAME, IDS_TOOLS_REGEDIT_DESCR, IDS_TOOLS_REGEDIT_CMD,IDS_TOOLS_REGEDIT_PARAM, CSIDL_WINDOWS);
AddItem(IDS_TOOLS_SYSDM_NAME, IDS_TOOLS_SYSDM_DESCR, IDS_TOOLS_SYSDM_CMD, IDS_TOOLS_SYSDM_PARAM, CSIDL_SYSTEM);
AddItem(IDS_TOOLS_INFO_NAME, IDS_TOOLS_INFO_DESCR, IDS_TOOLS_INFO_CMD, IDS_TOOLS_INFO_PARAM, CSIDL_SYSTEM);
}
开发者ID:AmineKhaldi,项目名称:reactos,代码行数:6,代码来源:toolspage.c
示例15: AddItem
void CPlayerPlaylistBar::AddItem(CString fn, CAtlList<CString>* subs)
{
CAtlList<CString> sl;
sl.AddTail(fn);
AddItem(sl, subs);
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:6,代码来源:PlayerPlaylistBar.cpp
示例16: strcpy
void CSearchView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
m_listSearch.m_nType = SEARCHVIEW; // 리스트가 지신의 기능만을 처리할수 있는 타입값
// 접속되어있는 클라이언트의 목록을 추가
m_comboFilter.AddString("전체");
int count = ((CMainFrame *)AfxGetMainWnd())->m_myIOCPSocket.m_nClntCount;
char szClntName[256];
char szClntIP[20];
for(int i=0; i<count; i++){
strcpy(szClntName, ((CMainFrame *)AfxGetMainWnd())->m_myIOCPSocket.m_clntSock[i].clntName);
strcpy(szClntIP, inet_ntoa(((CMainFrame *)AfxGetMainWnd())->m_myIOCPSocket.m_clntSock[i].pClntData->clntAddr.sin_addr));
sprintf(szClntName, "%s [%s]", szClntName, szClntIP);
m_comboFilter.AddString(szClntName);
}
m_comboFilter.SetCurSel(0);
InsertColumn(); // 컬럼 추가
// 처음에 탭내용이 하나도 없으면 탭컨트롤이 안보이게(처음부터 보이면 모양이 이상해짐)
if(m_nTabCnt == 0){
m_tabSearch.ShowWindow(FALSE);
}
CMainFrame *pMain = ((CMainFrame *)AfxGetMainWnd());
pMain->GetSysImgList(m_listSearch, m_imgSmallList); // 시스템아이콘얻기
// 다른메뉴를 선택했다가 다시 이뷰를 선택하면 다시 초기화가 되므로 생성되었던 탭을 생성
if(m_nTabCnt != 0){
UINT cnt = 0;
CString strName; // 검색된 파일이름
UINT nFileCnt; // 검색된 파일수
UINT nImage; // 아이콘 이미지
while(cnt != m_nTabCnt){
strName = pMain->m_searchListData[cnt].strSearchListFileName;
nFileCnt = pMain->m_searchListData[cnt].nSearchListSize;
nImage = 0;
if(nFileCnt > 5){ // 검색된게 많으면 아이콘을 바꿈
nImage = 1;
}
CreateTab(strName, nFileCnt, nImage); // 동적으로 탭추가, 두번째 파라미터로 마지막 생성되는것만 리스트에 데이타를 넣는다
cnt ++;
}
CString strFileName; // 파일명
UINT nSize; // 파일사이즈
CString strServerName; // 서버이름
CString strServerIP; // 서버아이피
CString strServerInfo; // 서버정보
for(UINT i=0; i<nFileCnt; i++){ // 리스트 내용
strFileName = pMain->m_searchListData[m_nTabCnt - 1].searchListData[i].strFileName;
nSize = pMain->m_searchListData[m_nTabCnt - 1].searchListData[i].nByte;
strServerName.Format("%s", pMain->m_searchListData[m_nTabCnt - 1].strServerName[i]); // 서버이름
strServerIP.Format("%s", pMain->m_searchListData[m_nTabCnt - 1].strServerIP[i]); // 서버아이피
strServerInfo.Format("%s [%s]", strServerName, strServerIP);
AddItem(strFileName, nSize, strServerInfo, FALSE);
}
}
GetDlgItem(IDC_EDIT_SEARCHKEY)->SetFocus();
}
开发者ID:hoonio,项目名称:distributed-system,代码行数:70,代码来源:SearchView.cpp
示例17: Reset
void PixelInfoListCtrl::DoUpdateList()
{
Reset();
LayerCollection* lc_mri = MainWindow::GetMainWindowPointer()->GetLayerCollection( "MRI" );
LayerCollection* lc_surf = MainWindow::GetMainWindowPointer()->GetLayerCollection( "Surface" );
if ( !lc_mri || !lc_surf )
{
// collection does not exist. program must be in exiting process.
return;
}
if ( lc_mri->IsEmpty() && lc_surf->IsEmpty() )
{
SetItemCount( 0 );
return;
}
else
AddItem( _("RAS"), _(""), 1, false );
if ( !lc_mri->IsEmpty() )
{
LayerMRI* mri = ( LayerMRI* )lc_mri->GetLayer( 0 );
double ras[3];
mri->RemapPositionToRealRAS( m_dRASPosition, ras );
m_listValue[0].Printf( _("%.2f, %.2f, %.2f"), ras[0], ras[1], ras[2] );
int nIndex[3];
std::vector<Layer*> layers = lc_mri->GetLayers();
for ( size_t i = 0; i < layers.size(); i++ )
{
if ( layers[i]->GetProperties()->GetShowInfo() )
{
((LayerMRI*)layers[i])->RASToOriginalIndex( ras, nIndex );
// double dvalue = ( (LayerMRI*)layers[i] )->GetVoxelValueByOriginalIndex( nIndex[0], nIndex[1], nIndex[2] );
double dvalue = ( (LayerMRI*)layers[i] )->GetVoxelValue( m_dRASPosition );
wxString coordStrg;
if ( m_bShowVoxelCoordinates )
coordStrg.Printf( _("[%d, %d, %d] "), nIndex[0], nIndex[1], nIndex[2] );
wxString labelStrg;
if (layers[i]->IsTypeOf("PLabel"))
{
labelStrg = wxString::FromAscii( ( (LayerPLabel*)layers[i] )->GetLabelName( m_dRASPosition ).c_str() );
}
else
{
labelStrg = wxString::FromAscii( ( (LayerMRI*)layers[i] )->GetLabelName( dvalue ).c_str() );
if ( m_bShowShortName )
labelStrg = GetShortName( labelStrg );
}
AddItem( wxString::FromAscii( layers[i]->GetName() ),
AppendSpaceString( ( wxString() << dvalue ) ) + coordStrg + _(" ") + labelStrg,
(long)layers[i],
false );
}
}
}
if ( !lc_surf->IsEmpty() )
{
if ( lc_mri->IsEmpty() )
{
double ras[3] = { m_dRASPosition[0], m_dRASPosition[1], m_dRASPosition[2] };
// mri->RemapPositionToRealRAS( m_dRASPosition, ras );
m_listValue[0].Printf( _("%.2f, %.2f, %.2f"), ras[0], ras[1], ras[2] );
}
std::vector<Layer*> layers = lc_surf->GetLayers();
for ( size_t i = 0; i < layers.size(); i++ )
{
if ( layers[i]->GetProperties()->GetShowInfo() )
{
LayerSurface* surf = ( LayerSurface* )layers[i];
AddSurfaceItem( surf, m_dRASPosition, false );
}
}
}
SetItemCount( m_listName.Count() );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:80,代码来源:PixelInfoPanel.cpp
示例18: throw
void
BDirMenu::Populate(const BEntry* startEntry, BWindow* originatingWindow,
bool includeStartEntry, bool select, bool reverse, bool addShortcuts,
bool navMenuEntries)
{
try {
if (!startEntry)
throw (status_t)B_ERROR;
Model model(startEntry);
ThrowOnInitCheckError(&model);
ModelMenuItem* menu = new ModelMenuItem(&model, this, true, true);
if (fMenuBar)
fMenuBar->AddItem(menu);
BEntry entry(*startEntry);
bool showDesktop, showDisksIcon;
{
TrackerSettings settings;
showDesktop = settings.DesktopFilePanelRoot();
showDisksIcon = settings.ShowDisksIcon();
}
// might start one level above startEntry
if (!includeStartEntry) {
BDirectory parent;
BDirectory dir(&entry);
if (!showDesktop && dir.InitCheck() == B_OK
&& dir.IsRootDirectory()) {
// if we're at the root directory skip "mnt" and
// go straight to "/"
parent.SetTo("/");
} else
entry.GetParent(&parent);
parent.GetEntry(&entry);
}
BDirectory desktopDir;
FSGetDeskDir(&desktopDir);
BEntry desktopEntry;
desktopDir.GetEntry(&desktopEntry);
for (;;) {
BNode node(&entry);
ThrowOnInitCheckError(&node);
PoseInfo info;
ReadAttrResult result = ReadAttr(&node, kAttrPoseInfo,
kAttrPoseInfoForeign, B_RAW_TYPE, 0, &info, sizeof(PoseInfo),
&PoseInfo::EndianSwap);
BDirectory parent;
entry.GetParent(&parent);
bool hitRoot = false;
BDirectory dir(&entry);
if (!showDesktop && dir.InitCheck() == B_OK
&& dir.IsRootDirectory()) {
// if we're at the root directory skip "mnt" and
// go straight to "/"
hitRoot = true;
parent.SetTo("/");
}
if (showDesktop) {
BEntry root("/");
// warp from "/" to Desktop properly
if (entry == root) {
if (showDisksIcon)
AddDisksIconToMenu(reverse);
entry = desktopEntry;
}
if (entry == desktopEntry)
hitRoot = true;
}
if (result == kReadAttrFailed || !info.fInvisible
|| (showDesktop && desktopEntry == entry)) {
AddItemToDirMenu(&entry, originatingWindow, reverse,
addShortcuts, navMenuEntries);
}
if (hitRoot) {
if (!showDesktop && showDisksIcon && *startEntry != "/")
AddDisksIconToMenu(reverse);
break;
}
parent.GetEntry(&entry);
}
// select last item in menu
if (!select)
//.........这里部分代码省略.........
开发者ID:RTOSkit,项目名称:haiku,代码行数:101,代码来源:DirMenu.cpp
示例19: AddItem
void TradeTable_CTP::AddTrade( Trade_Ptr apOrder )
{
AddItem(apOrder);
}
开发者ID:xiongyang,项目名称:MyToolBox,代码行数:4,代码来源:TradeTable_CTP.cpp
示例20: IPopupMenuItem
IPopupMenuItem* IPopupMenu::AddItem(const char* text, int index, int itemFlags)
{
IPopupMenuItem* item = new IPopupMenuItem (text, itemFlags);
return AddItem(item, index);
}
开发者ID:b-vesco,项目名称:wdl-ol,代码行数:5,代码来源:IPopupMenu.cpp
注:本文中的AddItem函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论