diff --git a/prj/NAppCompilers.cmake b/prj/NAppCompilers.cmake index 1a9f7311..9017986d 100644 --- a/prj/NAppCompilers.cmake +++ b/prj/NAppCompilers.cmake @@ -200,7 +200,7 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set_property(CACHE CMAKE_ARCHITECTURE PROPERTY STRINGS arm64) # ARM 32 bits - elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "armv7") + elseif (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "armv7.*") set(CMAKE_HOST_ARCHITECTURE "arm") set(CMAKE_ARCHITECTURE "arm" CACHE STRING "Processor architecture") set_property(CACHE CMAKE_ARCHITECTURE PROPERTY STRINGS arm) diff --git a/prj/NAppGCC.cmake b/prj/NAppGCC.cmake index 62ec2657..1c0c366c 100644 --- a/prj/NAppGCC.cmake +++ b/prj/NAppGCC.cmake @@ -247,7 +247,7 @@ macro(nap_gcc_warns) # Disable flags # In future try to adapt NAppGUI to remove these flags, making the code more robust set(CFLAGS "${CFLAGS} -Wno-bad-function-cast -Wno-missing-prototypes -Wno-missing-declarations") - set(FLAGS "${FLAGS} -Wno-long-long -Wno-overlength-strings -Wno-aggregate-return -Wno-cast-qual -Wno-padded -Wno-switch-default -Wno-conversion -Wno-float-equal -Wno-format-nonliteral -Wno-switch-enum -Wno-redundant-decls -Wno-shadow -Wno-undef -Wno-missing-noreturn -Wno-stack-protector -Wno-missing-include-dirs") + set(FLAGS "${FLAGS} -Wno-long-long -Wno-overlength-strings -Wno-aggregate-return -Wno-cast-qual -Wno-padded -Wno-switch-default -Wno-conversion -Wno-float-equal -Wno-format-nonliteral -Wno-switch-enum -Wno-redundant-decls -Wno-shadow -Wno-undef -Wno-missing-noreturn -Wno-stack-protector -Wno-missing-include-dirs -Wno-cast-align") set(CXXFLAGS "${CXXFLAGS} -Wnon-virtual-dtor -Woverloaded-virtual") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS} ${CFLAGS}") diff --git a/prj/build.txt b/prj/build.txt index 521332e0..54bf5947 100644 --- a/prj/build.txt +++ b/prj/build.txt @@ -1 +1 @@ -4987 +4993 diff --git a/src/gui/panel.c b/src/gui/panel.c index e85e4c8a..319a9a3b 100644 --- a/src/gui/panel.c +++ b/src/gui/panel.c @@ -257,6 +257,30 @@ static void i_hide_component(GuiComponent *component) /*---------------------------------------------------------------------------*/ +/* + * This function is not used in a general Layout-based composer. + * Is required for out-of-the-box uses of NAppGUI (eg. GTNAP) + */ +void _panel_dettach_component(Panel *panel, GuiComponent *component) +{ + uint32_t index = UINT32_MAX; + cassert_no_null(panel); + cassert_no_null(component); + + /* Prevent flickering in Windows because destroyed component new parent + will be set to NULL (Desktop HWND) when is detached from this panel. */ +#if defined(__WINDOWS__) + i_hide_component(component); +#endif + + _component_set_parent_window(component, NULL); + _component_detach_from_panel(&panel->component, component); + index = arrpt_find(panel->children, component, GuiComponent); + arrpt_delete(panel->children, index, NULL, GuiComponent); +} + +/*---------------------------------------------------------------------------*/ + void _panel_destroy_component(Panel *panel, GuiComponent *component) { bool_t exists = FALSE; diff --git a/src/gui/panel.inl b/src/gui/panel.inl index 3d037f88..52086794 100644 --- a/src/gui/panel.inl +++ b/src/gui/panel.inl @@ -20,6 +20,8 @@ void _panel_destroy_all(Panel **panel); void _panel_attach_component(Panel *panel, GuiComponent *component); +void _panel_dettach_component(Panel *panel, GuiComponent *component); + void _panel_destroy_component(Panel *panel, GuiComponent *component); void _panel_hide_all(Panel *panel); diff --git a/src/osgui/osx/ostext.m b/src/osgui/osx/ostext.m index 0152b47f..6f646c03 100644 --- a/src/osgui/osx/ostext.m +++ b/src/osgui/osx/ostext.m @@ -564,10 +564,10 @@ void ostext_editable(OSText *view, const bool_t is_editable) void ostext_scroller_visible(OSText *view, const bool_t horizontal, const bool_t vertical) { - unref(view); - unref(horizontal); - unref(vertical); - cassert(FALSE); + NSScrollView *sview = (NSScrollView *)view; + cassert_no_null(sview); + [sview setHasHorizontalScroller:(BOOL)horizontal]; + [sview setHasVerticalScroller:(BOOL)vertical]; } /*---------------------------------------------------------------------------*/ diff --git a/src/osgui/win/osgui_win.cpp b/src/osgui/win/osgui_win.cpp index 62f93f9c..5f813f9c 100644 --- a/src/osgui/win/osgui_win.cpp +++ b/src/osgui/win/osgui_win.cpp @@ -712,8 +712,10 @@ void _osgui_remove_accelerator(WORD cmd) arrst_foreach(accel, i_ACCELERATORS, ACCEL) if (accel->cmd == cmd) + { i = accel_i; - break; + break; + } arrst_end() cassert(i < arrst_size(i_ACCELERATORS, ACCEL));