WxUtils.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2009 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include <wx/string.h>
  7. class wxBitmap;
  8. class wxToolBar;
  9. // A shortcut to access the bitmaps
  10. #define wxGetBitmapFromMemory(name) WxUtils::_wxGetBitmapFromMemory(name, sizeof(name))
  11. namespace WxUtils
  12. {
  13. // Launch a file according to its mime type
  14. void Launch(const std::string& filename);
  15. // Launch an file explorer window on a certain path
  16. void Explore(const std::string& path);
  17. // Displays a wxMessageBox geared for errors
  18. void ShowErrorDialog(const wxString& error_msg);
  19. wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length);
  20. // From a wxBitmap, creates the corresponding disabled version for toolbar buttons
  21. wxBitmap CreateDisabledButtonBitmap(const wxBitmap& original);
  22. // Helper function to add a button to a toolbar
  23. void AddToolbarButton(wxToolBar* toolbar, int toolID, const wxString& label, const wxBitmap& bitmap, const wxString& shortHelp);
  24. } // namespace
  25. std::string WxStrToStr(const wxString& str);
  26. wxString StrToWxStr(const std::string& str);