MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / ApplyColorScheme

Method ApplyColorScheme

Source/PatternEditor.cpp:253–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251// Drawing
252
253void CPatternEditor::ApplyColorScheme()
254{
255 // The color scheme has changed
256 //
257
258 const CSettings *pSettings = FTEnv.GetSettings();
259
260 COLORREF ColBackground = pSettings->Appearance.iColBackground;
261
262 // Fetch font size
263 m_iPatternFontSize = pSettings->Appearance.iFontSize; // // //
264 m_iCharWidth = m_iPatternFontSize - 1;
265 m_iColumnSpacing = (m_iPatternFontSize + 1) / 3;
266 m_iRowColumnWidth = m_iCharWidth * 3 + 2;
267 m_iRowHeight = m_iPatternFontSize;
268
269 CalcLayout();
270
271 // Create pattern font
272 if (m_fontPattern.m_hObject != NULL)
273 m_fontPattern.DeleteObject();
274 m_fontPattern.CreateFontW(-m_iPatternFontSize, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
275 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, pSettings->Appearance.strFont.data()); // // //
276
277 // Create header font
278 if (m_fontHeader.m_hObject != NULL)
279 m_fontHeader.DeleteObject();
280 m_fontHeader.CreateFontW(-DEFAULT_HEADER_FONT_SIZE, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
281 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, DEFAULT_HEADER_FONT); // // //
282
283 if (m_fontCourierNew.m_hObject == NULL) // // // smaller
284 m_fontCourierNew.CreateFontW(14, 0, 0, 0, 0, FALSE, FALSE, FALSE, 0, 0, 0, DRAFT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Courier New");
285
286 // Cache some colors
287 m_colSeparator = BLEND(ColBackground, Invert(ColBackground), SHADE_LEVEL::SEPARATOR);
288 m_colEmptyBg = DIM(FTEnv.GetSettings()->Appearance.iColBackground, SHADE_LEVEL::EMPTY_BG);
289
290 m_colHead1 = GetSysColor(COLOR_3DFACE);
291 m_colHead2 = GetSysColor(COLOR_BTNHIGHLIGHT);
292 m_colHead3 = GetSysColor(COLOR_APPWORKSPACE);
293 m_colHead4 = BLEND(m_colHead3, MakeRGB(240, 64, 64), .8);
294 m_colHead5 = BLEND(m_colHead3, MakeRGB(64, 240, 64), .6); // // //
295
296 InvalidateBackground();
297 InvalidatePatternData();
298 InvalidateHeader();
299}
300
301void CPatternEditor::SetDocument(CFamiTrackerModule *pModule, CFamiTrackerView *pView) { // // //
302 // Set a new document and view, reset everything

Callers 2

OnCreateMethod · 0.80
SetupColorsMethod · 0.80

Calls 6

BLENDFunction · 0.85
InvertFunction · 0.85
DIMFunction · 0.85
MakeRGBFunction · 0.85
GetSettingsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected