2015-04-07 20:19:05 -04:00
|
|
|
/**
|
|
|
|
* Common header for widget classes
|
2015-04-07 17:08:28 -04:00
|
|
|
*/
|
2016-01-13 09:29:09 -05:00
|
|
|
#pragma once
|
2015-04-07 17:08:28 -04:00
|
|
|
|
2019-05-24 16:16:40 -04:00
|
|
|
#include <libgen.h>
|
|
|
|
|
2015-04-07 17:08:28 -04:00
|
|
|
#include "common.h"
|
|
|
|
|
2015-06-12 16:50:27 -04:00
|
|
|
// Disable annoying warning
|
2015-05-27 11:37:02 -04:00
|
|
|
#ifndef __WXMAC__
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wpotentially-evaluated-expression"
|
|
|
|
#endif
|
|
|
|
|
2015-04-07 17:08:28 -04:00
|
|
|
#ifdef WX_PRECOMP
|
|
|
|
#include "wx_pch.h"
|
|
|
|
#endif
|
|
|
|
#ifndef WX_PRECOMP
|
|
|
|
#include <wx/wx.h>
|
|
|
|
#endif
|
|
|
|
|
2015-05-12 16:30:22 -04:00
|
|
|
// Common helpers/functionality
|
|
|
|
#include <wx/debug.h>
|
2015-06-12 16:50:27 -04:00
|
|
|
#include <wx/utils.h>
|
|
|
|
#include <wx/version.h>
|
2015-05-12 16:30:22 -04:00
|
|
|
#include <wx/cmdline.h>
|
|
|
|
#include <wx/config.h>
|
2019-05-16 15:21:32 -04:00
|
|
|
#include <wx/display.h>
|
2015-06-12 16:50:27 -04:00
|
|
|
#include <wx/font.h>
|
2015-04-10 15:11:15 -04:00
|
|
|
#include <wx/stdpaths.h>
|
2015-06-12 16:50:27 -04:00
|
|
|
#include <wx/platinfo.h>
|
2015-04-10 15:11:15 -04:00
|
|
|
#include <wx/filename.h>
|
2015-04-16 09:37:20 -04:00
|
|
|
#include <wx/artprov.h>
|
2015-04-10 15:11:15 -04:00
|
|
|
|
2015-05-27 11:37:02 -04:00
|
|
|
#ifndef __WXMAC__
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
#endif
|
|
|
|
|
2019-05-16 15:21:32 -04:00
|
|
|
/**
|
|
|
|
* Calculate original window size based on size of the current monitor
|
|
|
|
*/
|
|
|
|
wxSize static CalculateWindowSize()
|
2015-06-12 16:50:27 -04:00
|
|
|
{
|
2019-05-16 15:21:32 -04:00
|
|
|
wxDisplay display;
|
|
|
|
wxVideoMode mode = display.GetCurrentMode();
|
|
|
|
|
|
|
|
wxLogDebug("Current display: %ix%i", mode.w, mode.h);
|
|
|
|
|
|
|
|
wxSize base((int)((float)mode.w * 0.9), (int)((float)mode.h * 0.9));
|
|
|
|
|
|
|
|
return base;
|
2015-06-12 16:50:27 -04:00
|
|
|
}
|
|
|
|
|
2019-05-24 16:16:40 -04:00
|
|
|
wxString static BaseName(wxString path)
|
|
|
|
{
|
|
|
|
auto fullPath = path.char_str();
|
|
|
|
auto base = basename(fullPath);
|
|
|
|
|
|
|
|
return (wxString) base;
|
|
|
|
}
|
|
|
|
|
2015-05-12 16:30:22 -04:00
|
|
|
// Tyro-specific variables
|
2019-05-16 15:21:32 -04:00
|
|
|
#include "definitions.h"
|