2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 21:43:35 -06:00
|
|
|
// Refer to the license.txt file included.
|
2009-03-20 13:12:04 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2009-02-24 12:31:32 -07:00
|
|
|
|
2013-02-27 21:37:38 -07:00
|
|
|
#include <string>
|
2016-01-19 16:46:10 -07:00
|
|
|
#include <wx/gdicmn.h>
|
2013-02-27 21:37:38 -07:00
|
|
|
#include <wx/string.h>
|
|
|
|
|
2014-02-22 15:36:30 -07:00
|
|
|
class wxBitmap;
|
2014-08-15 22:16:14 -06:00
|
|
|
class wxToolBar;
|
2014-02-22 15:36:30 -07:00
|
|
|
|
2013-02-27 21:37:38 -07:00
|
|
|
namespace WxUtils
|
|
|
|
{
|
2009-03-20 13:12:04 -06:00
|
|
|
// Launch a file according to its mime type
|
2014-03-12 13:33:41 -06:00
|
|
|
void Launch(const std::string& filename);
|
2009-03-20 13:12:04 -06:00
|
|
|
|
|
|
|
// Launch an file explorer window on a certain path
|
2014-03-12 13:33:41 -06:00
|
|
|
void Explore(const std::string& path);
|
2009-08-07 02:52:04 -06:00
|
|
|
|
2014-07-24 19:46:46 -06:00
|
|
|
// Displays a wxMessageBox geared for errors
|
|
|
|
void ShowErrorDialog(const wxString& error_msg);
|
|
|
|
|
2015-12-19 03:34:01 -07:00
|
|
|
// Reads a PNG from the Resources folder
|
2016-01-19 16:46:10 -07:00
|
|
|
wxBitmap LoadResourceBitmap(const std::string& name, const wxSize& padded_size = wxSize());
|
2014-02-22 15:36:30 -07:00
|
|
|
|
2014-08-15 22:16:14 -06: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
|
2016-06-24 02:43:46 -06:00
|
|
|
void AddToolbarButton(wxToolBar* toolbar, int toolID, const wxString& label, const wxBitmap& bitmap,
|
|
|
|
const wxString& shortHelp);
|
2014-08-15 22:16:14 -06:00
|
|
|
|
2009-03-20 13:12:04 -06:00
|
|
|
} // namespace
|
|
|
|
|
2013-02-27 21:37:38 -07:00
|
|
|
std::string WxStrToStr(const wxString& str);
|
|
|
|
wxString StrToWxStr(const std::string& str);
|