dolphin/Source/Core/DolphinWX/WxUtils.h

40 lines
1.1 KiB
C
Raw Normal View History

// Copyright 2009 Dolphin Emulator Project
2015-05-18 01:08:10 +02:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <string>
#include <wx/string.h>
2014-02-22 23:36:30 +01:00
class wxBitmap;
2014-08-16 06:16:14 +02:00
class wxToolBar;
2014-02-22 23:36:30 +01:00
// A shortcut to access the bitmaps
#define wxGetBitmapFromMemory(name) WxUtils::_wxGetBitmapFromMemory(name, sizeof(name))
namespace WxUtils
{
// Launch a file according to its mime type
void Launch(const std::string& filename);
// Launch an file explorer window on a certain path
void Explore(const std::string& path);
// Displays a wxMessageBox geared for errors
void ShowErrorDialog(const wxString& error_msg);
2014-02-22 23:36:30 +01:00
wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length);
2014-08-16 06:16:14 +02:00
// From a wxBitmap, creates the corresponding disabled version for toolbar buttons
wxBitmap CreateDisabledButtonBitmap(const wxBitmap& original);
// Helper function to add a button to a toolbar
void AddToolbarButton(wxToolBar* toolbar, int toolID, const wxString& label, const wxBitmap& bitmap, const wxString& shortHelp);
} // namespace
std::string WxStrToStr(const wxString& str);
wxString StrToWxStr(const std::string& str);