Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wxutil::getBitmap() helper function
Add a simple utility function to replace the very common and somewhat verbose combination of wxArtProvider::GetBitmap and IUIManager::ArtIdPrefix.
- Loading branch information
Matthew Mott
committed
Jan 6, 2021
1 parent
a338cde
commit 9af13d3
Showing
2 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "iuimanager.h" | ||
|
||
#include <wx/artprov.h> | ||
|
||
namespace wxutil | ||
{ | ||
|
||
/** | ||
* \brief | ||
* Get a wxBitmap from the art provider | ||
* | ||
* \param name | ||
* Image file name with no prefix, e.g. "something.png" | ||
*/ | ||
wxBitmap getBitmap(const std::string& name) | ||
{ | ||
return wxArtProvider::GetBitmap(GlobalUIManager().ArtIdPrefix() + name); | ||
} | ||
|
||
} |
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