mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
ci: attempt a action based build
ci: add workflow_dispatch ci: adjust msys install instructions ci: switch msystem ci: try different cmake installation ci: try mingw64 instead ci: unix makefiles? ci: switch to mingw64 shell ci: install cmake via pacboy? ci: switch to Ninja? misc: remove some outdated XP compatibility preprocessor symbols? https://docs.wxwidgets.org/trunk/page_wxusedef.html ci: switch main to master misc: more attempts at correcting build errors misc: bitmap/image conversions? ci: trying to get a static build ci: try to find hunspell dll ci: hunt down hunspell ci: modify static flags
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
name: windows-build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: msys2 {0}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: MINGW64
|
||||||
|
update: true
|
||||||
|
install: >-
|
||||||
|
git
|
||||||
|
mingw-w64-x86_64-cc
|
||||||
|
mingw-w64-x86_64-gcc
|
||||||
|
mingw-w64-x86_64-wxWidgets
|
||||||
|
mingw-w64-x86_64-boost
|
||||||
|
mingw-w64-x86_64-hunspell
|
||||||
|
pacboy: >-
|
||||||
|
cmake:p
|
||||||
|
ninja:p
|
||||||
|
- name: CI-Build
|
||||||
|
run: |
|
||||||
|
ls /mingw64/bin/ || true
|
||||||
|
cmake -G "Ninja" -H. -Bbuild -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
||||||
|
cmake --build build
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: build
|
||||||
|
path: |
|
||||||
|
./build/magicseteditor*
|
||||||
|
/mingw64/bin/libhunspell-1.7-0.dll
|
||||||
+5
-84
@@ -14,17 +14,6 @@
|
|||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
#include <gfx/gfx.hpp>
|
#include <gfx/gfx.hpp>
|
||||||
|
|
||||||
#if wxUSE_UXTHEME && defined(__WXMSW__)
|
|
||||||
#include <wx/msw/uxtheme.h>
|
|
||||||
#if defined(HAVE_VSSYM32)
|
|
||||||
#include <vssym32.h>
|
|
||||||
#else
|
|
||||||
#include <tmschema.h>
|
|
||||||
#endif
|
|
||||||
#include <shlobj.h>
|
|
||||||
#include <wx/mstream.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Window related
|
// ----------------------------------------------------------------------------- : Window related
|
||||||
|
|
||||||
// Id of the control that has the focus, or -1 if no control has the focus
|
// Id of the control that has the focus, or -1 if no control has the focus
|
||||||
@@ -245,13 +234,7 @@ void set_menu_item_image(wxMenuItem* item, const String& resource) {
|
|||||||
if (item->GetKind() == wxITEM_CHECK) return; // check items can't have icons
|
if (item->GetKind() == wxITEM_CHECK) return; // check items can't have icons
|
||||||
#endif
|
#endif
|
||||||
Image bitmap = load_resource_tool_image(resource);
|
Image bitmap = load_resource_tool_image(resource);
|
||||||
#if defined(__WXMSW__)
|
item->SetBitmap(bitmap);
|
||||||
Image disabled_bitmap = generate_disabled_image(bitmap);
|
|
||||||
item->SetBitmaps(bitmap, bitmap);
|
|
||||||
item->SetDisabledBitmap(disabled_bitmap);
|
|
||||||
#else
|
|
||||||
item->SetBitmap(bitmap);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenuItem* make_menu_item(wxMenu* menu, int id, const char* resource, const String& text, const String& help, wxItemKind kind, wxMenu* submenu) {
|
wxMenuItem* make_menu_item(wxMenu* menu, int id, const char* resource, const String& text, const String& help, wxItemKind kind, wxMenu* submenu) {
|
||||||
@@ -380,18 +363,6 @@ wxImage load_resource_tool_image(const String& name) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Platform look
|
|
||||||
|
|
||||||
#if wxUSE_UXTHEME && defined(__WXMSW__)
|
|
||||||
RECT msw_rect(wxRect const& rect, int dl = 0, int dt = 0, int dr = 0, int db=0) {
|
|
||||||
RECT r;
|
|
||||||
r.left = rect.x - dl;
|
|
||||||
r.top = rect.y - dt;
|
|
||||||
r.right = rect.x + rect.width + dr;
|
|
||||||
r.bottom = rect.y + rect.height + db;
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Draw a basic 3D border
|
// Draw a basic 3D border
|
||||||
void draw3DBorder(DC& dc, int x1, int y1, int x2, int y2) {
|
void draw3DBorder(DC& dc, int x1, int y1, int x2, int y2) {
|
||||||
@@ -410,39 +381,13 @@ void draw3DBorder(DC& dc, int x1, int y1, int x2, int y2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void draw_control_box(Window* win, DC& dc, const wxRect& rect, bool focused, bool enabled) {
|
void draw_control_box(Window* win, DC& dc, const wxRect& rect, bool focused, bool enabled) {
|
||||||
#if wxUSE_UXTHEME && defined(__WXMSW__)
|
|
||||||
RECT r = msw_rect(rect, 1,1,1,1);
|
|
||||||
if (wxUxThemeIsActive()) {
|
|
||||||
HTHEME hTheme = (HTHEME)::OpenThemeData(GetHwndOf(win), VSCLASS_EDIT);
|
|
||||||
if (hTheme) {
|
|
||||||
::DrawThemeBackground(
|
|
||||||
hTheme,
|
|
||||||
(HDC)dc.GetHDC(),
|
|
||||||
EP_EDITTEXT,
|
|
||||||
!enabled ? ETS_DISABLED : focused ? ETS_NORMAL : ETS_NORMAL,
|
|
||||||
&r,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// otherwise, draw a standard border
|
// otherwise, draw a standard border
|
||||||
// clear the background
|
// clear the background
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||||
dc.DrawRectangle(rect);
|
dc.DrawRectangle(rect);
|
||||||
// draw the border
|
// draw a 3D border
|
||||||
#if defined(__WXMSW__)
|
draw3DBorder(dc, rect.x - 1, rect.y - 1, rect.x + rect.width, rect.y + rect.height);
|
||||||
r.left = rect.x - 2;
|
|
||||||
r.top = rect.y - 2;
|
|
||||||
r.right = rect.x + rect.width + 2;
|
|
||||||
r.bottom = rect.y + rect.height + 2;
|
|
||||||
DrawEdge((HDC)dc.GetHDC(), &r, EDGE_SUNKEN, BF_RECT);
|
|
||||||
#else
|
|
||||||
// draw a 3D border
|
|
||||||
draw3DBorder(dc, rect.x - 1, rect.y - 1, rect.x + rect.width, rect.y + rect.height);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_button(Window* win, DC& dc, const wxRect& rect, bool focused, bool down, bool enabled) {
|
void draw_button(Window* win, DC& dc, const wxRect& rect, bool focused, bool down, bool enabled) {
|
||||||
@@ -486,9 +431,6 @@ void draw_drop_down_arrow(Window* win, DC& dc, const wxRect& rect, bool active)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void draw_checkbox(const Window* win, DC& dc, const wxRect& rect, bool checked, bool enabled) {
|
void draw_checkbox(const Window* win, DC& dc, const wxRect& rect, bool checked, bool enabled) {
|
||||||
#if defined(__WXMSW__)
|
|
||||||
if (win == nullptr) win = dc.GetWindow();
|
|
||||||
#endif
|
|
||||||
if (win) {
|
if (win) {
|
||||||
wxRendererNative& rn = wxRendererNative::GetDefault();
|
wxRendererNative& rn = wxRendererNative::GetDefault();
|
||||||
rn.DrawCheckBox(const_cast<wxWindow*>(win), dc, rect, (checked ? wxCONTROL_CHECKED : 0) | (enabled ? 0 : wxCONTROL_DISABLED));
|
rn.DrawCheckBox(const_cast<wxWindow*>(win), dc, rect, (checked ? wxCONTROL_CHECKED : 0) | (enabled ? 0 : wxCONTROL_DISABLED));
|
||||||
@@ -505,9 +447,6 @@ void draw_checkbox(const Window* win, DC& dc, const wxRect& rect, bool checked,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void draw_radiobox(const Window* win, DC& dc, const wxRect& rect, bool checked, bool enabled) {
|
void draw_radiobox(const Window* win, DC& dc, const wxRect& rect, bool checked, bool enabled) {
|
||||||
#if defined(__WXMSW__)
|
|
||||||
if (win == nullptr) win = dc.GetWindow();
|
|
||||||
#endif
|
|
||||||
if (win) {
|
if (win) {
|
||||||
wxRendererNative& rn = wxRendererNative::GetDefault();
|
wxRendererNative& rn = wxRendererNative::GetDefault();
|
||||||
rn.DrawRadioBitmap(const_cast<wxWindow*>(win), dc, rect, (checked ? wxCONTROL_CHECKED : 0) | (enabled ? 0 : wxCONTROL_DISABLED));
|
rn.DrawRadioBitmap(const_cast<wxWindow*>(win), dc, rect, (checked ? wxCONTROL_CHECKED : 0) | (enabled ? 0 : wxCONTROL_DISABLED));
|
||||||
@@ -529,27 +468,9 @@ void draw_radiobox(const Window* win, DC& dc, const wxRect& rect, bool checked,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool selected, bool focused, bool hot) {
|
void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool selected, bool focused, bool hot) {
|
||||||
#if wxUSE_UXTHEME && defined(__WXMSW__)
|
|
||||||
HTHEME hTheme = (HTHEME)::OpenThemeData(GetHwndOf(win), VSCLASS_LISTVIEW);
|
|
||||||
if (hTheme) {
|
|
||||||
RECT r = msw_rect(rect);
|
|
||||||
::DrawThemeBackground(
|
|
||||||
hTheme,
|
|
||||||
(HDC)dc.GetHDC(),
|
|
||||||
LVP_LISTITEM,
|
|
||||||
hot&&selected ? LISS_HOTSELECTED : hot ? LISS_HOT :selected&&focused ? LISS_SELECTED : selected ? LISS_SELECTEDNOTFOCUS : LISS_NORMAL,
|
|
||||||
&r,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void enable_themed_selection_rectangle(Window* win) {
|
void enable_themed_selection_rectangle(Window* win) {
|
||||||
#if wxUSE_UXTHEME && defined(__WXMSW__)
|
|
||||||
if (wxUxThemeIsActive()) {
|
|
||||||
::SetWindowTheme((HWND)win->GetHWND(), L"Explorer", NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void ChoiceThumbnailRequest::store(const Image& img) {
|
|||||||
if (img.Ok()) {
|
if (img.Ok()) {
|
||||||
ChoiceThumbnail& thumbnail = style().thumbnails[id];
|
ChoiceThumbnail& thumbnail = style().thumbnails[id];
|
||||||
ChoiceThumbnailLock lock(thumbnail.mutex);
|
ChoiceThumbnailLock lock(thumbnail.mutex);
|
||||||
thumbnail.bitmap = img;
|
thumbnail.bitmap = wxBitmap(img, -1);
|
||||||
thumbnail.status = THUMB_OK;
|
thumbnail.status = THUMB_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user