-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add JSON header library * Themes and BrushCache first pass Implementing basic functions for Themes (Get/Set colors, load default settings) and BrushCache (Reset, Get color from cache) * Switch brushes to use themes and brush cache * WIP - Loading from file * Implement Theme switching from menu * Create New Theme opens CMT file for editing * Support numpad entry * Fix Warnings * Stub out ability to take an action once a user stops typing * First pass at being able to preview edits to a theme as you make them. * Set active theme to the new one on create * Better error handling when loading a theme by name
- Loading branch information
Showing
14 changed files
with
25,474 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "stdafx.h" | ||
|
||
// Recursively look for the menu and position pair for the item identified by searchId | ||
bool FindMenuPos(HMENU baseMenu, UINT searchId, HMENU& outRealBaseMenu, int& outPos) | ||
{ | ||
int myPos; | ||
if (baseMenu == NULL) | ||
{ | ||
// Sorry, Wrong Number | ||
outRealBaseMenu = NULL; | ||
outPos = -1; | ||
return true; | ||
} | ||
for (myPos = GetMenuItemCount(baseMenu) - 1; myPos >= 0; myPos--) | ||
{ | ||
int Status = GetMenuState(baseMenu, myPos, MF_BYPOSITION); | ||
HMENU mNewMenu; | ||
|
||
if (Status == 0xFFFFFFFF) | ||
{ | ||
// That was not a legal Menu/Position-Combination | ||
outRealBaseMenu = NULL; | ||
outPos = -1; | ||
return true; | ||
} | ||
// Is this the real one? | ||
if (GetMenuItemID(baseMenu, myPos) == searchId) | ||
{ | ||
// Yep! | ||
outRealBaseMenu = baseMenu; | ||
outPos = myPos; | ||
return true; | ||
} | ||
// Maybe a subMenu? | ||
mNewMenu = GetSubMenu(baseMenu, myPos); | ||
// This function will return NULL if ther is NO SubMenu | ||
if (mNewMenu != NULL) | ||
{ | ||
// recursivly look for the right menu, depth first search | ||
bool found = FindMenuPos(mNewMenu, searchId, outRealBaseMenu, outPos); | ||
if (found) | ||
return true; // return this loop | ||
} | ||
} | ||
return false; // iterate in the upper stackframe | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
bool FindMenuPos(HMENU baseMenu, UINT myID, HMENU& outMenu, int& pos); |
Oops, something went wrong.