============================================================================= Style_SetStyles()
| 2812 | // Style_SetStyles() |
| 2813 | // |
| 2814 | void Style_SetStyles ( HWND hwnd, int iStyle, LPCWSTR lpszStyle ) |
| 2815 | { |
| 2816 | WCHAR tch[256]; |
| 2817 | WCHAR *p; |
| 2818 | int iValue; |
| 2819 | // Font |
| 2820 | if ( Style_StrGetFont ( lpszStyle, tch, COUNTOF ( tch ) ) ) { |
| 2821 | char mch[256] = "Lucida Console"; |
| 2822 | if ( fIsConsolasAvailable || lstrcmpi ( tch, L"Consolas" ) ) { |
| 2823 | WideCharToMultiByte ( CP_ACP, 0, tch, -1, mch, COUNTOF ( mch ), NULL, NULL ); |
| 2824 | } |
| 2825 | SendMessage ( hwnd, SCI_STYLESETFONT, iStyle, ( LPARAM ) mch ); |
| 2826 | } |
| 2827 | // Size |
| 2828 | if ( Style_StrGetSize ( lpszStyle, &iValue ) ) { |
| 2829 | SendMessage ( hwnd, SCI_STYLESETSIZE, iStyle, ( LPARAM ) iValue ); |
| 2830 | } |
| 2831 | // Fore |
| 2832 | if ( Style_StrGetColor ( TRUE, lpszStyle, &iValue ) ) { |
| 2833 | SendMessage ( hwnd, SCI_STYLESETFORE, iStyle, ( LPARAM ) iValue ); |
| 2834 | } |
| 2835 | // Back |
| 2836 | if ( Style_StrGetColor ( FALSE, lpszStyle, &iValue ) ) { |
| 2837 | SendMessage ( hwnd, SCI_STYLESETBACK, iStyle, ( LPARAM ) iValue ); |
| 2838 | } |
| 2839 | // Bold |
| 2840 | if ( p = StrStrI ( lpszStyle, L"bold" ) ) { |
| 2841 | SendMessage ( hwnd, SCI_STYLESETBOLD, iStyle, ( LPARAM ) TRUE ); |
| 2842 | } else { |
| 2843 | SendMessage ( hwnd, SCI_STYLESETBOLD, iStyle, ( LPARAM ) FALSE ); |
| 2844 | } |
| 2845 | // Italic |
| 2846 | if ( p = StrStrI ( lpszStyle, L"italic" ) ) { |
| 2847 | SendMessage ( hwnd, SCI_STYLESETITALIC, iStyle, ( LPARAM ) TRUE ); |
| 2848 | } else { |
| 2849 | SendMessage ( hwnd, SCI_STYLESETITALIC, iStyle, ( LPARAM ) FALSE ); |
| 2850 | } |
| 2851 | // Underline |
| 2852 | if ( p = StrStrI ( lpszStyle, L"underline" ) ) { |
| 2853 | SendMessage ( hwnd, SCI_STYLESETUNDERLINE, iStyle, ( LPARAM ) TRUE ); |
| 2854 | } else { |
| 2855 | SendMessage ( hwnd, SCI_STYLESETUNDERLINE, iStyle, ( LPARAM ) FALSE ); |
| 2856 | } |
| 2857 | // EOL Filled |
| 2858 | if ( p = StrStrI ( lpszStyle, L"eolfilled" ) ) { |
| 2859 | SendMessage ( hwnd, SCI_STYLESETEOLFILLED, iStyle, ( LPARAM ) TRUE ); |
| 2860 | } else { |
| 2861 | SendMessage ( hwnd, SCI_STYLESETEOLFILLED, iStyle, ( LPARAM ) FALSE ); |
| 2862 | } |
| 2863 | // Case |
| 2864 | if ( Style_StrGetCase ( lpszStyle, &iValue ) ) { |
| 2865 | SendMessage ( hwnd, SCI_STYLESETCASE, iStyle, ( LPARAM ) iValue ); |
| 2866 | } |
| 2867 | // Character Set |
| 2868 | if ( Style_StrGetCharSet ( lpszStyle, &iValue ) ) { |
| 2869 | SendMessage ( hwnd, SCI_STYLESETCHARACTERSET, iStyle, ( LPARAM ) iValue ); |
| 2870 | } |
| 2871 | } |
no test coverage detected