LRESULT PropPageTextStyles::onEditTextStyle(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	int iNdx = m_lsbList.GetCurSel();
	TextStyles[ iNdx ].EditTextStyle();

	_tcscpy( m_Font.lfFaceName, TextStyles[ iNdx ].szFaceName );
	m_Font.lfCharSet = TextStyles[ iNdx ].bCharSet;
	m_Font.lfHeight = TextStyles[ iNdx ].yHeight;

	if ( iNdx == TS_GENERAL ) {
		if ( ( TextStyles[ iNdx ].dwEffects & CFE_ITALIC ) == CFE_ITALIC )
			m_Font.lfItalic = true;
		if ( ( TextStyles[ iNdx ].dwEffects & CFE_BOLD ) == CFE_BOLD )
			m_Font.lfWeight = FW_BOLD;
	}

	for ( int i = 0; i < TS_LAST; i++ ) {
		_tcscpy( TextStyles[ iNdx ].szFaceName, m_Font.lfFaceName );
		TextStyles[ i ].bCharSet = m_Font.lfCharSet;
		TextStyles[ i ].yHeight = m_Font.lfHeight;
// TODO		m_Preview.AppendText(_T("My nick"), _T("12:34 "), Text::toT(TextStyles[i].m_sPreviewText).c_str(), TextStyles[i]);
	}
	fontdirty = true;
	RefreshPreview();
	return TRUE;
}
LRESULT PropPageTextStyles::onTabListChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	COLORREF color = colours[ctrlTabList.GetCurSel()].value;
	setForeColor(ctrlTabExample, color);
	RefreshPreview();
	return S_OK;
}
LRESULT PropPageTextStyles::onEditForeColor(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	int iNdx = m_lsbList.GetCurSel();
	TextStyles[ iNdx ].EditForeColor();
	RefreshPreview();
	return TRUE;
}
LRESULT PropPageTextStyles::onEditTextStyle(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	int iNdx = m_lsbList.GetCurSel();
	TextStyles[ iNdx ].EditTextStyle();
	
	_tcscpy(m_Font.lfFaceName, TextStyles[ iNdx ].szFaceName);
	m_Font.lfCharSet = TextStyles[ iNdx ].bCharSet;
	m_Font.lfHeight = TextStyles[ iNdx ].yHeight;
	
	if (iNdx == TS_GENERAL)
	{
		if ((TextStyles[ iNdx ].dwEffects & CFE_ITALIC) == CFE_ITALIC)
			m_Font.lfItalic = TRUE;
		if ((TextStyles[ iNdx ].dwEffects & CFE_BOLD) == CFE_BOLD)
			m_Font.lfWeight = FW_BOLD;
	}
	
	for (int i = 0; i < TS_LAST; i++)
	{
		_tcscpy(TextStyles[ iNdx ].szFaceName, m_Font.lfFaceName);
		TextStyles[ i ].bCharSet = m_Font.lfCharSet;
		TextStyles[ i ].yHeight = m_Font.lfHeight;
		const ChatCtrl::CFlyChatCache l_message(ClientManager::getFlylinkDCIdentity(), false, true, _T("12:34 "), Text::toT(TextStyles[i].m_sPreviewText), TextStyles[i], true);
		m_Preview.AppendText(l_message);
	}
	
	RefreshPreview();
	return TRUE;
}
void FWidgetBlueprintEditor::Tick(float DeltaTime)
{
	FBlueprintEditor::Tick(DeltaTime);

	// Tick the preview scene world.
	if ( !GIntraFrameDebuggingGameThread )
	{
		// Allow full tick only if preview simulation is enabled and we're not currently in an active SIE or PIE session
		if ( bIsSimulateEnabled && GEditor->PlayWorld == nullptr && !GEditor->bIsSimulatingInEditor )
		{
			PreviewScene.GetWorld()->Tick(bIsRealTime ? LEVELTICK_All : LEVELTICK_TimeOnly, DeltaTime);
		}
		else
		{
			PreviewScene.GetWorld()->Tick(bIsRealTime ? LEVELTICK_ViewportsOnly : LEVELTICK_TimeOnly, DeltaTime);
		}
	}

	// Note: The weak ptr can become stale if the actor is reinstanced due to a Blueprint change, etc. In that case we 
	//       look to see if we can find the new instance in the preview world and then update the weak ptr.
	if ( PreviewWidgetPtr.IsStale(true) || bPreviewInvalidated )
	{
		bPreviewInvalidated = false;
		RefreshPreview();
	}
}
Example #6
0
static void LoadItem(HWND hWnd, PFolderItem item)
{
	if (!item)
		return;

	SetEditText(hWnd, item->GetFormat());
	RefreshPreview(hWnd);
}
void FWidgetBlueprintEditor::OnBlueprintChangedImpl(UBlueprint* InBlueprint, bool bIsJustBeingCompiled )
{
	DestroyPreview();

	FBlueprintEditor::OnBlueprintChangedImpl(InBlueprint, bIsJustBeingCompiled);

	if ( InBlueprint )
	{
		RefreshPreview();
	}
}
LRESULT PropPageTextStyles::onClientSelectTabColor(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/){
	CColorDialog d(colours[ctrlTabList.GetCurSel()].value, 0, *this);
	if (d.DoModal() == IDOK) {
		colours[ctrlTabList.GetCurSel()].value = d.GetColor();
		switch(ctrlTabList.GetCurSel()) {
			case 0: bg = d.GetColor(); break;
		}
		setForeColor(ctrlTabExample, d.GetColor());
		RefreshPreview();
	}
	return S_OK;
}
LRESULT PropPageTextStyles::onDefaultStyles(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	bg = RGB(255, 255, 255);
	fg = RGB(67, 98, 154);
	::GetObject((HFONT)GetStockObject(DEFAULT_GUI_FONT), sizeof(m_Font), &m_Font);
	TextStyles[ TS_GENERAL ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_GENERAL ].crTextColor = RGB(67, 98, 154);
	TextStyles[ TS_GENERAL ].dwEffects = 0;
	
	TextStyles[ TS_MYNICK ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_MYNICK ].crTextColor = RGB(67, 98, 154);
	TextStyles[ TS_MYNICK ].dwEffects = CFE_BOLD;
	
	TextStyles[ TS_MYMSG ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_MYMSG ].crTextColor = RGB(67, 98, 154);
	TextStyles[ TS_MYMSG ].dwEffects = 0;
	
	TextStyles[ TS_PRIVATE ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_PRIVATE ].crTextColor = RGB(67, 98, 154);
	TextStyles[ TS_PRIVATE ].dwEffects = CFE_ITALIC;
	
	TextStyles[ TS_SYSTEM ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_SYSTEM ].crTextColor = RGB(0, 128, 64);
	TextStyles[ TS_SYSTEM ].dwEffects = CFE_BOLD;
	
	TextStyles[ TS_SERVER ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_SERVER ].crTextColor = RGB(0, 128, 64);
	TextStyles[ TS_SERVER ].dwEffects = CFE_BOLD;
	
	TextStyles[ TS_TIMESTAMP ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_TIMESTAMP ].crTextColor = RGB(67, 98, 154);
	TextStyles[ TS_TIMESTAMP ].dwEffects = 0;
	
	TextStyles[ TS_URL ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_URL ].crTextColor = RGB(0, 0, 255);
	TextStyles[ TS_URL ].dwEffects = 0;
	
	TextStyles[ TS_FAVORITE ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_FAVORITE ].crTextColor = RGB(67, 98, 154);
	TextStyles[ TS_FAVORITE ].dwEffects = CFE_BOLD;
	
	TextStyles[ TS_FAV_ENEMY ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_FAV_ENEMY ].crTextColor = RGB(255, 165, 121);
	TextStyles[ TS_FAV_ENEMY ].dwEffects = CFE_BOLD;
	
	TextStyles[ TS_OP ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_OP ].crTextColor = RGB(0, 128, 64);
	TextStyles[ TS_OP ].dwEffects = CFE_BOLD;
	
	RefreshPreview();
	return TRUE;
}
LRESULT PropPageTextStyles::onClickedText(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	LOGFONT tmp = m_Font;
	CFontDialog d(&tmp, CF_EFFECTS | CF_SCREENFONTS | CF_FORCEFONTEXIST, NULL, *this); // !SMT!-F
	d.m_cf.rgbColors = fg;
	if (d.DoModal() == IDOK)
	{
		m_Font = tmp;
		fg = d.GetColor();
	}
	RefreshPreview();
	return TRUE;
}
LRESULT PropPageTextStyles::onBlackAndWhite(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	bg = RGB(255, 255, 255);
	fg = RGB(0, 0, 0);
	TextStyles[ TS_GENERAL ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_GENERAL ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_GENERAL ].dwEffects = 0;
	
	TextStyles[ TS_MYNICK ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_MYNICK ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_MYNICK ].dwEffects = 0;
	
	TextStyles[ TS_MYMSG ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_MYMSG ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_MYMSG ].dwEffects = 0;
	
	TextStyles[ TS_PRIVATE ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_PRIVATE ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_PRIVATE ].dwEffects = 0;
	
	TextStyles[ TS_SYSTEM ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_SYSTEM ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_SYSTEM ].dwEffects = 0;
	
	TextStyles[ TS_SERVER ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_SERVER ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_SERVER ].dwEffects = 0;
	
	TextStyles[ TS_TIMESTAMP ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_TIMESTAMP ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_TIMESTAMP ].dwEffects = 0;
	
	TextStyles[ TS_URL ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_URL ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_URL ].dwEffects = 0;
	
	TextStyles[ TS_FAVORITE ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_FAVORITE ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_FAVORITE ].dwEffects = 0;
	
	TextStyles[ TS_FAV_ENEMY ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_FAV_ENEMY ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_FAV_ENEMY ].dwEffects = 0;
	
	TextStyles[ TS_OP ].crBackColor = RGB(255, 255, 255);
	TextStyles[ TS_OP ].crTextColor = RGB(37, 60, 121);
	TextStyles[ TS_OP ].dwEffects = 0;
	
	RefreshPreview();
	return TRUE;
}
Example #12
0
void TileScene::EyedropTile(QPoint pos)
{
    if(!tileController || !currentLayer)
        return;

    //translate the position to tile coordinates
    int tileW = tileController->GetTileWidth();
    int tileH = tileController->GetTileHeight();

    int tileX = pos.x() / tileW;
    int tileY = pos.y() / tileH;

    //if the position is beyond the bounds of the scene, ignore it
    //EVENTUALLY THE PARALLAX WILL NEED TO BE CONSIDERED
    if(tileX >= tileController->GetCurrentLayerWidth() || tileY >= tileController->GetCurrentLayerHeight())
        return;

    emit SelectNewTile(tileController->GetTileOrigin(tileX, tileY));

    RefreshPreview();
}
LRESULT PropPageTextStyles::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	PropPage::translate((HWND)(*this), texts);
	PropPage::read((HWND)*this, items);
	
	SettingsManager::getInstance()->addListener(this);

	m_lsbList.Attach( GetDlgItem(IDC_TEXT_STYLES) );
	m_lsbList.ResetContent();
	m_Preview.Attach( GetDlgItem(IDC_PREVIEW) );

	WinUtil::decodeFont(Text::toT(SETTING(TEXT_FONT)), m_Font);
	m_BackColor = SETTING(BACKGROUND_COLOR);
	m_ForeColor = SETTING(TEXT_COLOR);

	fg = SETTING(TEXT_COLOR);
	bg = SETTING(BACKGROUND_COLOR);

	TextStyles[ TS_GENERAL ].Init( 
	this, settings, STRING(PROPPAGE_GENERAL_TEXT).c_str(), STRING(PROPPAGE_GENERAL_CHAT_TEXT).c_str(),
	SettingsManager::TEXT_GENERAL_BACK_COLOR, SettingsManager::TEXT_GENERAL_FORE_COLOR, 
	SettingsManager::TEXT_GENERAL_BOLD, SettingsManager::TEXT_GENERAL_ITALIC );

	TextStyles[ TS_MYNICK ].Init( 
	this, settings, STRING(PROPPAGE_MY_NICK).c_str(), STRING(PROPPAGE_MY_NICK).c_str(),
	SettingsManager::TEXT_MYNICK_BACK_COLOR, SettingsManager::TEXT_MYNICK_FORE_COLOR, 
	SettingsManager::TEXT_MYNICK_BOLD, SettingsManager::TEXT_MYNICK_ITALIC );

	TextStyles[ TS_MYMSG ].Init( 
	this, settings, STRING(PROPPAGE_MY_OWN_MSG).c_str(), STRING(PROPPAGE_MY_OWN_MSG).c_str(),
	SettingsManager::TEXT_MYOWN_BACK_COLOR, SettingsManager::TEXT_MYOWN_FORE_COLOR, 
	SettingsManager::TEXT_MYOWN_BOLD, SettingsManager::TEXT_MYOWN_ITALIC );

	TextStyles[ TS_PRIVATE ].Init( 
	this, settings, STRING(PROPPAGE_PRIVATE_MSG).c_str(), STRING(PROPPAGE_PRIVATE_MSG).c_str(),
	SettingsManager::TEXT_PRIVATE_BACK_COLOR, SettingsManager::TEXT_PRIVATE_FORE_COLOR, 
	SettingsManager::TEXT_PRIVATE_BOLD, SettingsManager::TEXT_PRIVATE_ITALIC );

	TextStyles[ TS_SYSTEM ].Init( 
	this, settings, STRING(PROPPAGE_SYSTEM_MSG).c_str(), STRING(PROPPAGE_SYSTEM_MSG).c_str(),
	SettingsManager::TEXT_SYSTEM_BACK_COLOR, SettingsManager::TEXT_SYSTEM_FORE_COLOR, 
	SettingsManager::TEXT_SYSTEM_BOLD, SettingsManager::TEXT_SYSTEM_ITALIC );

	TextStyles[ TS_SERVER ].Init( 
	this, settings, STRING(PROPPAGE_SERVER_MSG).c_str(), STRING(PROPPAGE_SERVER_MSG).c_str(),
	SettingsManager::TEXT_SERVER_BACK_COLOR, SettingsManager::TEXT_SERVER_FORE_COLOR, 
	SettingsManager::TEXT_SERVER_BOLD, SettingsManager::TEXT_SERVER_ITALIC );

	TextStyles[ TS_TIMESTAMP ].Init( 
	this, settings, STRING(PROPPAGE_TIMESTAMP).c_str(), STRING(PROPPAGE_STYLE_TIMESTAMP).c_str(),
	SettingsManager::TEXT_TIMESTAMP_BACK_COLOR, SettingsManager::TEXT_TIMESTAMP_FORE_COLOR, 
	SettingsManager::TEXT_TIMESTAMP_BOLD, SettingsManager::TEXT_TIMESTAMP_ITALIC );

	TextStyles[ TS_URL ].Init( 
	this, settings, (STRING(PROPPAGE_URL) + " (http, mailto, ...)").c_str(), STRING(PROPPAGE_URL).c_str(),
	SettingsManager::TEXT_URL_BACK_COLOR, SettingsManager::TEXT_URL_FORE_COLOR, 
	SettingsManager::TEXT_URL_BOLD, SettingsManager::TEXT_URL_ITALIC );

	TextStyles[ TS_SHARE_DUPE ].Init(
	this, settings, STRING(PROPPAGE_SHARE_DUPE_TEXT).c_str(), STRING(PROPPAGE_DUPE_MSG).c_str(),
	SettingsManager::TEXT_DUPE_BACK_COLOR, SettingsManager::DUPE_COLOR, 
	SettingsManager::TEXT_DUPE_BOLD, SettingsManager::TEXT_DUPE_ITALIC );

	TextStyles[ TS_QUEUE_DUPE ].Init(
	this, settings, STRING(PROPPAGE_QUEUE_DUPE_TEXT).c_str(), STRING(PROPPAGE_DUPE_MSG).c_str(),
	SettingsManager::TEXT_QUEUE_BACK_COLOR, SettingsManager::QUEUE_COLOR, 
	SettingsManager::TEXT_QUEUE_BOLD, SettingsManager::TEXT_QUEUE_ITALIC );

	TextStyles[ TS_FAVORITE ].Init( 
	this, settings, STRING(PROPPAGE_FAV_USER).c_str(), STRING(PROPPAGE_FAV_USER).c_str(),
	SettingsManager::TEXT_FAV_BACK_COLOR, SettingsManager::TEXT_FAV_FORE_COLOR, 
	SettingsManager::TEXT_FAV_BOLD, SettingsManager::TEXT_FAV_ITALIC );

	TextStyles[ TS_OP ].Init( 
	this, settings, STRING(PROPPAGE_OPERATOR).c_str(), STRING(PROPPAGE_OPERATOR).c_str(),
	SettingsManager::TEXT_OP_BACK_COLOR, SettingsManager::TEXT_OP_FORE_COLOR, 
	SettingsManager::TEXT_OP_BOLD, SettingsManager::TEXT_OP_ITALIC );

	TextStyles[ TS_NORM ].Init( 
	this, settings, STRING(PROPPAGE_NORM).c_str(), STRING(PROPPAGE_NORM).c_str(),
	SettingsManager::TEXT_NORM_BACK_COLOR, SettingsManager::TEXT_NORM_FORE_COLOR, 
	SettingsManager::TEXT_NORM_BOLD, SettingsManager::TEXT_NORM_ITALIC );


	for ( int i = 0; i < TS_LAST; i++ ) {
		TextStyles[ i ].LoadSettings();
		_tcscpy(TextStyles[i].szFaceName, m_Font.lfFaceName );
		TextStyles[ i ].bCharSet = m_Font.lfCharSet;
		TextStyles[ i ].yHeight = m_Font.lfHeight;
		m_lsbList.AddString(Text::toT(TextStyles[i].m_sText).c_str() );
	}
	m_lsbList.SetCurSel( 0 );

	ctrlTabList.Attach(GetDlgItem(IDC_TABCOLOR_LIST));
	cmdResetTab.Attach(GetDlgItem(IDC_RESET_TAB_COLOR));
	cmdSetTabColor.Attach(GetDlgItem(IDC_SELECT_TAB_COLOR));
	ctrlTabExample.Attach(GetDlgItem(IDC_SAMPLE_TAB_COLOR));
	ctrlTheme.Attach(GetDlgItem(IDC_THEMES));
	
	PopulateThemes();

	ctrlTabList.ResetContent();
	for(int i=0; i < sizeof(colours) / sizeof(clrs); i++){				
		ctrlTabList.AddString(Text::toT(ResourceManager::getInstance()->getString(colours[i].name)).c_str());
		onResetColor(i);
	}

	setForeColor(ctrlTabExample, GetSysColor(COLOR_3DFACE));	

	ctrlTabList.SetCurSel(0);
	BOOL bTmp;
	onTabListChange(0,0,0,bTmp);
	fontdirty = false;

	RefreshPreview();

	return TRUE;
}
Example #14
0
static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	PFolderItem item;

	switch (msg) {
	case WM_INITDIALOG:
		lastItem = NULL;
		TranslateDialogDefault(hWnd);
		bInitializing = 1;
		LoadRegisteredFolderSections(hWnd);
		bInitializing = 0;
		break;

	case WM_COMMAND:
		switch (LOWORD(wParam)) {
		case IDC_FOLDER_EDIT:
			switch (HIWORD(wParam)) {
			case EN_CHANGE:
				RefreshPreview(hWnd);
				if (!bInitializing)
					SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0); //show the apply button.
			}
			break;

		case IDC_REFRESH_BUTTON:
			RefreshPreview(hWnd);
			break;

		case IDC_HELP_BUTTON:
			ShowWindow( CreateDialog(hInstance, MAKEINTRESOURCE(IDD_VARIABLES_HELP), hWnd, DlgProcVariables), SW_SHOW);
			break;

		case IDC_FOLDERS_SECTIONS_LIST:
			switch (HIWORD(wParam)) {
			case LBN_SELCHANGE:
				CheckForChanges(hWnd);
				LoadRegisteredFolderItems(hWnd);
				lastItem = NULL;
				SetEditText(hWnd, L"");
				RefreshPreview(hWnd);
			}
			break;

		case IDC_FOLDERS_ITEMS_LIST:
			switch (HIWORD(wParam)) {
			case LBN_SELCHANGE:
				item = GetSelectedItem(hWnd);
				if (item != NULL) {
					CheckForChanges(hWnd);
					LoadItem(hWnd, item);
				}
				lastItem = item;
			}
		}
		break;

	case WM_NOTIFY:
		switch(((LPNMHDR)lParam)->idFrom) {
		case 0:
			switch (((LPNMHDR)lParam)->code) {
			case PSN_APPLY:
				item = GetSelectedItem(hWnd);
				if (item) {
					SaveItem(hWnd, item, FALSE);
					LoadItem(hWnd, item);
				}

				for (int i=0; i < lstRegisteredFolders.getCount(); i++)
					lstRegisteredFolders[i].Save();
				CallPathChangedEvents();
			}
		}
		break;
	}

	return 0;
}
LRESULT PropPageTextStyles::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	memset(&m_Font, 0, sizeof(m_Font));
	m_Preview.disable_chat_cache();
	PropPage::translate((HWND)(*this), texts);
	PropPage::read((HWND)*this, items);
	
	m_maincolor_changed = false;
	m_tempfile = Text::toT(Util::getThemesPath() + "temp.dctmp");
	
	m_lsbList.Attach(GetDlgItem(IDC_TEXT_STYLES));
	m_lsbList.ResetContent();
	m_Preview.Attach(GetDlgItem(IDC_PREVIEW));
	
	Fonts::decodeFont(Text::toT(SETTING(TEXT_FONT)), m_Font);
	m_BackColor = SETTING(BACKGROUND_COLOR);
	m_ForeColor = SETTING(TEXT_COLOR);
	
	fg = SETTING(TEXT_COLOR);
	bg = SETTING(BACKGROUND_COLOR);
	
	TextStyles[ TS_GENERAL ].Init(
	    this, (char*)CSTRING(GENERAL_TEXT), (char*)CSTRING(GENERAL_TEXT),
	    SettingsManager::TEXT_GENERAL_BACK_COLOR, SettingsManager::TEXT_GENERAL_FORE_COLOR,
	    SettingsManager::TEXT_GENERAL_BOLD, SettingsManager::TEXT_GENERAL_ITALIC);
	    
	TextStyles[ TS_MYNICK ].Init(
	    this, (char*)CSTRING(MY_NICK), (char*)CSTRING(MY_NICK),
	    SettingsManager::TEXT_MYNICK_BACK_COLOR, SettingsManager::TEXT_MYNICK_FORE_COLOR,
	    SettingsManager::TEXT_MYNICK_BOLD, SettingsManager::TEXT_MYNICK_ITALIC);
	    
	TextStyles[ TS_MYMSG ].Init(
	    this, (char*)CSTRING(MY_MESSAGE), (char*)CSTRING(MY_MESSAGE),
	    SettingsManager::TEXT_MYOWN_BACK_COLOR, SettingsManager::TEXT_MYOWN_FORE_COLOR,
	    SettingsManager::TEXT_MYOWN_BOLD, SettingsManager::TEXT_MYOWN_ITALIC);
	    
	TextStyles[ TS_PRIVATE ].Init(
	    this, (char*)CSTRING(PRIVATE_MESSAGE), (char*)CSTRING(PRIVATE_MESSAGE),
	    SettingsManager::TEXT_PRIVATE_BACK_COLOR, SettingsManager::TEXT_PRIVATE_FORE_COLOR,
	    SettingsManager::TEXT_PRIVATE_BOLD, SettingsManager::TEXT_PRIVATE_ITALIC);
	    
	TextStyles[ TS_SYSTEM ].Init(
	    this, (char*)CSTRING(SYSTEM_MESSAGE), (char*)CSTRING(SYSTEM_MESSAGE),
	    SettingsManager::TEXT_SYSTEM_BACK_COLOR, SettingsManager::TEXT_SYSTEM_FORE_COLOR,
	    SettingsManager::TEXT_SYSTEM_BOLD, SettingsManager::TEXT_SYSTEM_ITALIC);
	    
	TextStyles[ TS_SERVER ].Init(
	    this, (char*)CSTRING(SERVER_MESSAGE), (char*)CSTRING(SERVER_MESSAGE),
	    SettingsManager::TEXT_SERVER_BACK_COLOR, SettingsManager::TEXT_SERVER_FORE_COLOR,
	    SettingsManager::TEXT_SERVER_BOLD, SettingsManager::TEXT_SERVER_ITALIC);
	    
	TextStyles[ TS_TIMESTAMP ].Init(
	    this, (char*)CSTRING(TIMESTAMP), (char*)CSTRING(TEXT_STYLE_TIME_SAMPLE),
	    SettingsManager::TEXT_TIMESTAMP_BACK_COLOR, SettingsManager::TEXT_TIMESTAMP_FORE_COLOR,
	    SettingsManager::TEXT_TIMESTAMP_BOLD, SettingsManager::TEXT_TIMESTAMP_ITALIC);
	    
	TextStyles[ TS_URL ].Init(
	    this, (char*)CSTRING(TEXT_STYLE_URL), (char*)CSTRING(TEXT_STYLE_URL_SAMPLE),
	    SettingsManager::TEXT_URL_BACK_COLOR, SettingsManager::TEXT_URL_FORE_COLOR,
	    SettingsManager::TEXT_URL_BOLD, SettingsManager::TEXT_URL_ITALIC);
	    
	TextStyles[ TS_FAVORITE ].Init(
	    this, (char*)CSTRING(FAV_USER), (char*)CSTRING(FAV_USER),
	    SettingsManager::TEXT_FAV_BACK_COLOR, SettingsManager::TEXT_FAV_FORE_COLOR,
	    SettingsManager::TEXT_FAV_BOLD, SettingsManager::TEXT_FAV_ITALIC);
	    
	TextStyles[ TS_FAV_ENEMY ].Init(
	    this, (char*)CSTRING(FAV_ENEMY_USER), (char*)CSTRING(FAV_ENEMY_USER),
	    SettingsManager::TEXT_ENEMY_BACK_COLOR, SettingsManager::TEXT_ENEMY_FORE_COLOR,
	    SettingsManager::TEXT_ENEMY_BOLD, SettingsManager::TEXT_ENEMY_ITALIC);
	    
	TextStyles[ TS_OP ].Init(
	    this, (char*)CSTRING(OPERATOR), (char*)CSTRING(OPERATOR),
	    SettingsManager::TEXT_OP_BACK_COLOR, SettingsManager::TEXT_OP_FORE_COLOR,
	    SettingsManager::TEXT_OP_BOLD, SettingsManager::TEXT_OP_ITALIC);
	    
	for (int i = 0; i < TS_LAST; i++)
	{
		TextStyles[ i ].LoadSettings();
		_tcscpy(TextStyles[i].szFaceName, m_Font.lfFaceName);
		TextStyles[ i ].bCharSet = m_Font.lfCharSet;
		TextStyles[ i ].yHeight = m_Font.lfHeight;
		m_lsbList.AddString(Text::toT(TextStyles[i].m_sText).c_str());
	}
	m_lsbList.SetCurSel(0);
	
	ctrlTabList.Attach(GetDlgItem(IDC_TABCOLOR_LIST));
	cmdResetTab.Attach(GetDlgItem(IDC_RESET_TAB_COLOR));
	cmdSetTabColor.Attach(GetDlgItem(IDC_SELECT_TAB_COLOR));
	ctrlTabExample.Attach(GetDlgItem(IDC_SAMPLE_TAB_COLOR));
	
	ctrlTabList.ResetContent();
	for (int i = 0; i < _countof(colours); i++)
	{
		ctrlTabList.AddString(Text::toT(ResourceManager::getString(colours[i].name)).c_str());
		onResetColor(i);
	}
	
	setForeColor(ctrlTabExample, GetSysColor(COLOR_3DFACE));
	
	ctrlTabList.SetCurSel(0);
	BOOL bTmp;
	onTabListChange(0, 0, 0, bTmp);
	
	ctrlTheme.Attach(GetDlgItem(IDC_THEME_COMBO2));
	GetThemeList();
	ctrlTheme.Detach();
	
	RefreshPreview();
	return TRUE;
}
Example #16
0
LRESULT PropPageTextStyles::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	PropPage::translate((HWND)(*this), texts);
	PropPage::read((HWND)*this, items);

	m_lsbList.Attach( GetDlgItem(IDC_TEXT_STYLES) );
	m_lsbList.ResetContent();
	m_Preview.Attach( GetDlgItem(IDC_PREVIEW) );

	WinUtil::decodeFont(Text::toT(SETTING(TEXT_FONT)), m_Font);
	m_BackColor = SETTING(BACKGROUND_COLOR);
	m_ForeColor = SETTING(TEXT_COLOR);

	fg = SETTING(TEXT_COLOR);
	bg = SETTING(BACKGROUND_COLOR);

	TextStyles[ TS_GENERAL ].Init( 
	this, settings, "General text", "General chat text",
	SettingsManager::TEXT_GENERAL_BACK_COLOR, SettingsManager::TEXT_GENERAL_FORE_COLOR, 
	SettingsManager::TEXT_GENERAL_BOLD, SettingsManager::TEXT_GENERAL_ITALIC );

	TextStyles[ TS_MYNICK ].Init( 
	this, settings, "My nick", "My nick",
	SettingsManager::TEXT_MYNICK_BACK_COLOR, SettingsManager::TEXT_MYNICK_FORE_COLOR, 
	SettingsManager::TEXT_MYNICK_BOLD, SettingsManager::TEXT_MYNICK_ITALIC );

	TextStyles[ TS_MYMSG ].Init( 
	this, settings, "My own message", "My own message",
	SettingsManager::TEXT_MYOWN_BACK_COLOR, SettingsManager::TEXT_MYOWN_FORE_COLOR, 
	SettingsManager::TEXT_MYOWN_BOLD, SettingsManager::TEXT_MYOWN_ITALIC );

	TextStyles[ TS_PRIVATE ].Init( 
	this, settings, "Private message", "Private message",
	SettingsManager::TEXT_PRIVATE_BACK_COLOR, SettingsManager::TEXT_PRIVATE_FORE_COLOR, 
	SettingsManager::TEXT_PRIVATE_BOLD, SettingsManager::TEXT_PRIVATE_ITALIC );

	TextStyles[ TS_SYSTEM ].Init( 
	this, settings, "System message", "System message ",
	SettingsManager::TEXT_SYSTEM_BACK_COLOR, SettingsManager::TEXT_SYSTEM_FORE_COLOR, 
	SettingsManager::TEXT_SYSTEM_BOLD, SettingsManager::TEXT_SYSTEM_ITALIC );

	TextStyles[ TS_SERVER ].Init( 
	this, settings, "Server message", "Server message",
	SettingsManager::TEXT_SERVER_BACK_COLOR, SettingsManager::TEXT_SERVER_FORE_COLOR, 
	SettingsManager::TEXT_SERVER_BOLD, SettingsManager::TEXT_SERVER_ITALIC );

	TextStyles[ TS_TIMESTAMP ].Init( 
	this, settings, "Timestamp", "The style for timestamp",
	SettingsManager::TEXT_TIMESTAMP_BACK_COLOR, SettingsManager::TEXT_TIMESTAMP_FORE_COLOR, 
	SettingsManager::TEXT_TIMESTAMP_BOLD, SettingsManager::TEXT_TIMESTAMP_ITALIC );

	TextStyles[ TS_URL ].Init( 
	this, settings, "URL (http, mailto, ...)", "URL",
	SettingsManager::TEXT_URL_BACK_COLOR, SettingsManager::TEXT_URL_FORE_COLOR, 
	SettingsManager::TEXT_URL_BOLD, SettingsManager::TEXT_URL_ITALIC );

	TextStyles[ TS_FAVORITE ].Init( 
	this, settings, "Favorite user", "Favorite user",
	SettingsManager::TEXT_FAV_BACK_COLOR, SettingsManager::TEXT_FAV_FORE_COLOR, 
	SettingsManager::TEXT_FAV_BOLD, SettingsManager::TEXT_FAV_ITALIC );

	TextStyles[ TS_OP ].Init( 
	this, settings, "Operator", "Operator",
	SettingsManager::TEXT_OP_BACK_COLOR, SettingsManager::TEXT_OP_FORE_COLOR, 
	SettingsManager::TEXT_OP_BOLD, SettingsManager::TEXT_OP_ITALIC );

	for ( int i = 0; i < TS_LAST; i++ ) {
		TextStyles[ i ].LoadSettings();
		_tcscpy(TextStyles[i].szFaceName, m_Font.lfFaceName );
		TextStyles[ i ].bCharSet = m_Font.lfCharSet;
		TextStyles[ i ].yHeight = m_Font.lfHeight;
		m_lsbList.AddString(Text::toT(TextStyles[i].m_sText).c_str() );
	}
	m_lsbList.SetCurSel( 0 );

	ctrlTabList.Attach(GetDlgItem(IDC_TABCOLOR_LIST));
	cmdResetTab.Attach(GetDlgItem(IDC_RESET_TAB_COLOR));
	cmdSetTabColor.Attach(GetDlgItem(IDC_SELECT_TAB_COLOR));
	ctrlTabExample.Attach(GetDlgItem(IDC_SAMPLE_TAB_COLOR));

	ctrlTabList.ResetContent();
	for(int i=0; i < sizeof(colours) / sizeof(clrs); i++){				
		ctrlTabList.AddString(Text::toT(ResourceManager::getInstance()->getString(colours[i].name)).c_str());
		onResetColor(i);
	}

	setForeColor(ctrlTabExample, GetSysColor(COLOR_3DFACE));	

	ctrlTabList.SetCurSel(0);
	BOOL bTmp;
	onTabListChange(0,0,0,bTmp);

	RefreshPreview();
	return TRUE;
}