예제 #1
0
파일: Logger.cpp 프로젝트: ACUVE/TVTest
bool CLogger::CopyToClipboard(HWND hwnd)
{
	TVTest::String LogText;

	m_Lock.Lock();

	for (auto itr=m_LogList.begin();itr!=m_LogList.end();++itr) {
		TCHAR szText[MAX_LOG_TEXT_LENGTH];

		(*itr)->Format(szText,lengthof(szText));
		LogText+=szText;
		LogText+=TEXT("\r\n");
	}

	m_Lock.Unlock();

	return CopyTextToClipboard(hwnd,LogText.c_str());
}
예제 #2
0
bool COperationOptions::ReadSettings(CSettings &Settings)
{
	int Value;

	Settings.Read(TEXT("DisplayDragMove"),&m_fDisplayDragMove);
	Settings.Read(TEXT("HideCursor"),&m_fHideCursor);
	Settings.Read(TEXT("VolumeStep"),&m_VolumeStep);
	Settings.Read(TEXT("AudioDelayStep"),&m_AudioDelayStep);

	// ver.0.9.0 より前との互換用
	static const int WheelModeList[] = {
		0,
		CM_WHEEL_VOLUME,
		CM_WHEEL_CHANNEL,
		CM_WHEEL_AUDIO,
		CM_WHEEL_ZOOM,
		CM_WHEEL_ASPECTRATIO,
	};
	TVTest::String Command;
	if (Settings.Read(TEXT("WheelCommand"),&Command)) {
		m_WheelCommand=m_WheelCommandManager.ParseCommand(Command.c_str());
	} else if (Settings.Read(TEXT("WheelMode"),&Value)
			&& Value>=0 && Value<lengthof(WheelModeList)) {
		m_WheelCommand=WheelModeList[Value];
	}
	if (Settings.Read(TEXT("WheelShiftCommand"),&Command)) {
		m_WheelShiftCommand=m_WheelCommandManager.ParseCommand(Command.c_str());
	} else if (Settings.Read(TEXT("WheelShiftMode"),&Value)
			&& Value>=0 && Value<lengthof(WheelModeList)) {
		m_WheelShiftCommand=WheelModeList[Value];
	}
	if (Settings.Read(TEXT("WheelCtrlCommand"),&Command)) {
		m_WheelCtrlCommand=m_WheelCommandManager.ParseCommand(Command.c_str());
	} else if (Settings.Read(TEXT("WheelCtrlMode"),&Value)
			&& Value>=0 && Value<lengthof(WheelModeList)) {
		m_WheelCtrlCommand=WheelModeList[Value];
	}
	if (Settings.Read(TEXT("WheelTiltCommand"),&Command)) {
		m_WheelTiltCommand=m_WheelCommandManager.ParseCommand(Command.c_str());
	} else if (Settings.Read(TEXT("WheelTiltMode"),&Value)
			&& Value>=0 && Value<lengthof(WheelModeList)) {
		m_WheelTiltCommand=WheelModeList[Value];
	}

	Settings.Read(TEXT("StatusBarWheel"),&m_fStatusBarWheel);
	Settings.Read(TEXT("ReverseWheelChannel"),&m_fWheelChannelReverse);
	Settings.Read(TEXT("ReverseWheelVolume"),&m_fWheelVolumeReverse);
	if (Settings.Read(TEXT("WheelChannelDelay"),&Value)) {
		if (Value<WHEEL_CHANNEL_DELAY_MIN)
			Value=WHEEL_CHANNEL_DELAY_MIN;
		m_WheelChannelDelay=Value;
	}
	Settings.Read(TEXT("WheelZoomStep"),&m_WheelZoomStep);

	if (m_pCommandList!=NULL) {
		TCHAR szText[CCommandList::MAX_COMMAND_TEXT];

		if (Settings.Read(TEXT("LeftDoubleClickCommand"),szText,lengthof(szText))) {
			m_LeftDoubleClickCommand=m_pCommandList->ParseText(szText);
		}
		if (Settings.Read(TEXT("RightClickCommand"),szText,lengthof(szText))) {
			m_RightClickCommand=m_pCommandList->ParseText(szText);
		}
		if (Settings.Read(TEXT("MiddleClickCommand"),szText,lengthof(szText))) {
			m_MiddleClickCommand=m_pCommandList->ParseText(szText);
		}
	}

	return true;
}
예제 #3
0
bool CPanelOptions::ReadSettings(CSettings &Settings)
{
	int Value;

	Settings.Read(TEXT("InfoCurTab"),&m_LastTab);
	Settings.Read(TEXT("PanelFirstTab"),&m_InitialTab);
	Settings.Read(TEXT("PanelSnapAtMainWindow"),&m_fSnapAtMainWindow);
	Settings.Read(TEXT("PanelAttachToMainWindow"),&m_fAttachToMainWindow);
	if (Settings.Read(TEXT("PanelOpacity"),&m_Opacity))
		GetAppClass().Panel.Frame.SetPanelOpacity(m_Opacity*255/100);

	// Font
	TCHAR szFont[LF_FACESIZE];
	if (Settings.Read(TEXT("PanelFontName"),szFont,LF_FACESIZE) && szFont[0]!='\0') {
		::lstrcpy(m_Font.lfFaceName,szFont);
		m_Font.lfEscapement=0;
		m_Font.lfOrientation=0;
		m_Font.lfUnderline=0;
		m_Font.lfStrikeOut=0;
		m_Font.lfCharSet=DEFAULT_CHARSET;
		m_Font.lfOutPrecision=OUT_DEFAULT_PRECIS;
		m_Font.lfClipPrecision=CLIP_DEFAULT_PRECIS;
		m_Font.lfQuality=DRAFT_QUALITY;
		m_Font.lfPitchAndFamily=DEFAULT_PITCH | FF_DONTCARE;
	}
	if (Settings.Read(TEXT("PanelFontSize"),&Value)) {
		m_Font.lfHeight=Value;
		m_Font.lfWidth=0;
	}
	if (Settings.Read(TEXT("PanelFontWeight"),&Value))
		m_Font.lfWeight=Value;
	if (Settings.Read(TEXT("PanelFontItalic"),&Value))
		m_Font.lfItalic=Value;
	Settings.Read(TEXT("CaptionPanelFontSpec"),&m_fSpecCaptionFont);
	if (!Settings.Read(TEXT("CaptionPanelFont"),&m_CaptionFont))
		m_CaptionFont=m_Font;

	if (Settings.Read(TEXT("PanelTabStyle"),&Value)
			&& Value>=CPanelForm::TABSTYLE_FIRST && Value<=CPanelForm::TABSTYLE_LAST)
		m_TabStyle=static_cast<CPanelForm::TabStyle>(Value);

	Settings.Read(TEXT("PanelTabTooltip"),&m_fTabTooltip);

	int TabCount;
	if (Settings.Read(TEXT("PanelTabCount"),&TabCount) && TabCount>0) {
		PanelItemInfoList ItemList;
		TVTest::String ID;

		for (int i=0;i<TabCount;i++) {
			TCHAR szName[32];

			StdUtil::snprintf(szName,lengthof(szName),TEXT("PanelTab%d_ID"),i);
			if (!Settings.Read(szName,&ID) || ID.empty())
				continue;

			PanelItemInfo Item;
			LPTSTR p;
			long IDNum=std::_tcstol(ID.c_str(),&p,10);
			if (*p==_T('\0')) {
				if (IDNum<PANEL_ID_FIRST || IDNum>PANEL_ID_LAST)
					continue;
				Item.ID=m_AvailItemList[IDNum].ID;
			} else {
				Item.ID=ID;
			}
			size_t j;
			for (j=0;j<ItemList.size();j++) {
				if (CompareID(ItemList[j].ID,Item.ID))
					break;
			}
			if (j<ItemList.size())
				continue;

			StdUtil::snprintf(szName,lengthof(szName),TEXT("PanelTab%d_Visible"),i);
			if (!Settings.Read(szName,&Item.fVisible))
				Item.fVisible=true;

			ItemList.push_back(Item);
		}

#if 0
		for (size_t i=0;i<m_AvailItemList.size();i++) {
			const TVTest::String &ID=m_AvailItemList[i].ID;
			if (std::find_if(ItemList.begin(),ItemList.end(),
					[&](const PanelItemInfo &Item) -> bool {
						return CompareID(Item.ID,ID); })==ItemList.end()) {
				PanelItemInfo Item;
				Item.ID=ID;
				Item.fVisible=false;
				ItemList.push_back(Item);
			}
		}
#endif

		m_ItemList=ItemList;
	}

	Settings.Read(TEXT("InfoPanelUseRichEdit"),&m_fProgramInfoUseRichEdit);

	return true;
}