当前位置: 首页>>代码示例>>C++>>正文


C++ JString::clear方法代码示例

本文整理汇总了C++中JString::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ JString::clear方法的具体用法?C++ JString::clear怎么用?C++ JString::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JString的用法示例。


在下文中一共展示了JString::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MediaPropProc_SimpleTag

BOOL CALLBACK MediaPropProc_SimpleTag(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
#if 0
	//TRACE("Simple Tag Tab Msg: %X wParam: %i lParam: %i \n", uMsg, wParam, lParam);
	CRASH_PROTECT_START;
	//Get the dialog data
	MatroskaPages *pageData = (MatroskaPages *)GetWindowLong(hwndDlg, DWL_USER);
	switch(uMsg) {
		case WM_INITDIALOG:
		{
			INITCOMMONCONTROLSEX common;			
			common.dwICC = ICC_DATE_CLASSES; 
			common.dwSize = sizeof(common);
			InitCommonControlsEx(&common);
			
			SendDlgItemMessage(hwndDlg, IDC_SPIN_TAG_RATING, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)10, (short)-10));

			//Store the MatroskaPages struct in the DWL_USER
			SetWindowLong(hwndDlg, DWL_USER, (LONG)lParam);
			pageData = (MatroskaPages *)lParam;
#ifdef MATROSKA_PROP
			MoreData *pm;
			// When the shell creates a dialog box for a property sheet page,
      // it passes the pointer to the PROPSHEETPAGE data structure as
      // lParam. The dialog procedures of extensions typically store it
      // in the DWL_USER of the dialog box window.
      SetWindowLong(hwndDlg, DWL_USER, lParam);
      pm = (MoreData *)lParam;      
      pageData = pm->pObjPageData;
			pageData->AddRef();
			//Store the Matroska Infomation dialog handle
			pageData->g_hSimpleTagDialog = hwndDlg;
			//Store the MatroskaPages struct in the DWL_USER
			SetWindowLong(hwndDlg, DWL_USER, (LONG)pageData);

			ODS("Displaying Tag Tab");			
			if ((pageData->parser == NULL) || !pageData->parser->found_tags)
			{
				delete pageData->parser;
				pageData->parser = new MatroskaInfoParser(pm->pObjPageData->szFile);
				pageData->parser->m_parseSeekHead = true;
				pageData->parser->m_parseAttachments = true;
				pageData->parser->m_parseTags = true;
				ParseFileMT(pageData, hwndDlg);
				//pageData->parser->ParseFile();
			}			

			DisplaySimpleTagTrackList(pageData->g_hSimpleTagDialog, pageData->parser);			

			// Update the tabs
			if (pageData->g_hInfoDialog != NULL)
				DisplayMainTrackList(pageData->g_hInfoDialog, pageData->parser);
			if (pageData->g_hAttachmentDialog != NULL)
				DisplayAttachmentList(pageData->g_hAttachmentDialog, pageData->parser);
			if (pageData->g_hTagDialog != NULL)
				DisplayTagEntryList(pageData->g_hTagDialog, pageData->parser);
#endif
			return TRUE;
			break;
		}
		case WM_DESTROY:
		{
#ifdef MATROSKA_PROP
			pageData->Release();
#endif // MATROSKA_PROP
			break;
		}
		case WM_COMMAND:
		{
			switch (LOWORD(wParam))	{ /* Find which control the message applies to */
			case IDC_COMBO_TAG_SIMPLE_TRACKS:
			{
				switch (HIWORD(wParam)) 
				{ 
					case CBN_SELCHANGE: 
					{
						HWND hwndTrackCombo;
						int nItem = 0;
						MatroskaTrackInfo *selected_track = NULL;

						hwndTrackCombo = GetDlgItem(hwndDlg, IDC_COMBO_TAG_SIMPLE_TRACKS); 
						nItem = SendMessage(hwndTrackCombo, CB_GETCURSEL, 0, 0); 
						selected_track = reinterpret_cast<MatroskaTrackInfo *>(SendMessage(hwndTrackCombo, CB_GETITEMDATA, (nItem), 0));

						if ((selected_track != NULL) && (nItem != -1))
						{
							JString tagString;
							tagString.clear();

							//Fill out the Track Info fields								
							tagString = JString(_W("Track UID")) + JString::Format(L": %u", selected_track->GetTrackUID());
							SetDlgItemText(hwndDlg, IDC_STATIC_TRACK_UID,	tagString.t_str());						

							tagString = pageData->parser->GetTagAlbum(selected_track->GetTagInfo());
							SetDlgItemText(hwndDlg, IDC_EDIT_TAG_ALBUM, tagString.t_str());
							
							tagString = pageData->parser->GetTagArtist(selected_track->GetTagInfo());
							SetDlgItemText(hwndDlg, IDC_EDIT_TAG_ARTIST, tagString.t_str());
							
							tagString = JString::Format("%f", pageData->parser->GetTagBPM(selected_track->GetTagInfo()));
							SetDlgItemText(hwndDlg, IDC_EDIT_TAG_BPM, tagString.t_str());
//.........这里部分代码省略.........
开发者ID:Matroska-Org,项目名称:matroskautils,代码行数:101,代码来源:MatroskaPagesTagSimple.cpp


注:本文中的JString::clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。