Hi Fred, thanks for the answer.
This is really a strange thing, it's nothing new either, but I could never locate what caused this behavior.
Only these new high computationally intensive Wizzard routines made it possible to recognize cause and effect.
Please see if this little reduced demo codes works for you.
The first is wizzard dependent and must be copied into the demo code archive of the wizzard.
It corresponds to the GIF in the thread above.
The error is triggered after seconds with this code.
With the very small stand alone code further down you don't see it well,
but with this stand alone code you can see exactly what happens at the bottom from the window.
The stand alone code also triggers the effect immediately and change the running OS.
To remove the effekt you must reboot the OS.
Hi Barry, no, that won't work, this one sits much deeper and is something completely different.
Best Regards Saki
Wizzard enhanced
Code: Select all
; ************** Dynamic Window / GUI creating module ***************
XIncludeFile("./GFX_Wizzard_BF.pbi")
EnableExplicit
DeclareModule CreateGUI_1
EnableExplicit
UseModule GFX_Wizzard_BF
Declare CreateGUI_1(window_x, window_y, window_width_output, window_height_output)
EndDeclareModule
Module CreateGUI_1
Global window_width_developing=920 ; Developing size
Global window_height_developing=400
Global window_min_width=200 ; Minimum window size
Global window_min_height=150
Global window_x, window_y, window_width_output, window_height_output
Global window_flags=#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Invisible
Global window_ID=OpenWindow(#PB_Any, 0, 0, window_width_developing, window_height_developing,
"Dynamic Window and GUI creating", Window_flags)
WindowBounds(window_ID, window_min_width, window_min_height, #PB_Ignore, #PB_Ignore)
Global get_all_window_events ; Auxiliary variable for callback procedure WindowEvent handling
Define Image_ID=LoadImage(#PB_Any, "./Image_Set/Sunset.jpg")
Global Image_1_ID=LoadImage(#PB_Any, "./Image_Set/Foxy.png")
; Global Image_2_ID=LoadImage(#PB_Any, "./Image_Set/Cat_01.jpg")
; Create ButtonImageGadget _1 for using ==========================================
Global ButtonImageGadget_1_width=600
Global ButtonImageGadget_1_height=150
Global ButtonImageGadget_1_x=WindowWidth(window_ID)/2-ButtonImageGadget_1_width/2
Global ButtonImageGadget_1_y=WindowHeight(window_ID)/2-ButtonImageGadget_1_height/2
Define text_1$="Hello World"
Global Gadget_1_ID=MagicTextGadget_BF(0, ; 0 = ButtonImageGadget - 1 = CanvasGadget
text_1$, ; Text
ButtonImageGadget_1_x, ; Gadget output x pos
ButtonImageGadget_1_y, ; Gadget output y pos
ButtonImageGadget_1_width, ; Gadget width
ButtonImageGadget_1_height, ; Gadget height
ButtonImageGadget_1_width, ; Text width
ButtonImageGadget_1_height, ; Text height
1, ; Text stretching x - Headline mode
1, ; Text stretching y - Headline mode
1, ; padding_x
1, ; Padding y
#Black, ; Text color - Alpha channel supported
-1, ; Background color - Alpha channel supported - For invisible background set to -1
1, ; Text flag - Text center=1 - Text right=2 - Text vertical=3
"Georgia", ; Font type - more is not needed - accept also ""
#PB_Font_Bold, ; Font style
0) ; #PB_Canvas_Border ; Border flag)
; ############## Resize procedure for callback ##############################
Procedure WindowResizing_BindEvent_CreateGUI_1()
; ============= Init the scaling variables ==============
Global set_x.d=100/window_width_developing*WindowWidth(window_ID)/100
Global set_y.d=100/window_height_developing*WindowHeight(window_ID)/100
Define button_width.d=600 ; Text width
Define button_height.d=200 ; Text height
Define fitted_text_width.d=ButtonImageGadget_1_width*set_x ; Fitted text width - Negative values available
Define fitted_text_height.d=ButtonImageGadget_1_height*set_y ; Fitted text height - Negative values available
ResizeWindow(window_ID, #PB_Ignore, #PB_Ignore, WindowWidth(window_ID), WindowWidth(window_ID)/1.5)
SetMagicTextGadget_BF(gadget_1_ID, ; Gadget_ID - look the demo code for using
ButtonImageGadget_1_width*set_x, ; Button width
ButtonImageGadget_1_height*set_y, ; Button height
ButtonImageGadget_1_width*1.3, ; Text width
ButtonImageGadget_1_height*1.8, ; Text height
ButtonImageGadget_1_x*set_x, ; Gadget output x pos
ButtonImageGadget_1_y*set_y, ; Gadget output y pos
"", ; Text
-1, ; Text stretching x - Headline mode
-1, ; Text stretching y - Headline mode
-1, ; Padding x
-1, ; Padding_y
-1, ; Text color
-1) ; Background color
EndProcedure
; ===========================================================================
Procedure CreateGUI_1(window_x, window_y, window_width_output, window_height_output)
; =============== Calculate the output position and size =================
Deactivate_DPI_ResizeFactor_BF(1) ; We use here the DPI aware compiler option
window_width_output*DPI_ResizeFactor_BF() : window_height_output*DPI_ResizeFactor_BF()
If window_x=-1 : window_x=WindowX(window_ID)-(window_width_output-WindowWidth(window_ID))/2
Else : window_x*DPI_ResizeFactor_BF() : EndIf
If window_y=-1 : window_y=WindowY(window_ID)-(window_height_output-WindowHeight(window_ID))/2
Else : window_y*DPI_ResizeFactor_BF() : EndIf
ResizeWindow(window_ID, window_x, window_y, window_width_output, window_height_output)
; ================= Init the resize procedure callback ======================
BindEvent(#PB_Event_SizeWindow, @WindowResizing_BindEvent_CreateGUI_1())
; ====== Init all gadgets - Call simple the resize callback procedure =======
Macro Refresh_all_Gadgets ; Refresh the gadgets
Get_all_Window_Events_BF(1) ; Activate for fixing output problems with complex text and textboxes on MacOS
; For using inside a callback procedure deactivate
WindowResizing_BindEvent_CreateGUI_1()
Get_all_Window_Events_BF(0) ; Activate for fixing output problems with complex text and textboxes on MacOS
; For using inside a callback procedure deactivate
EndMacro
; ============================= Show the result =============================
Deactivate_DPI_ResizeFactor_BF(0)
Refresh_all_Gadgets
HideWindow(window_ID, 0)
Repeat
Define win_event=WaitWindowEvent()
Until win_event=#PB_Event_CloseWindow
EndProcedure
EndModule
UseModule CreateGUI_1
CompilerIf #PB_Compiler_IsMainFile
; ========================== Run the module, ====================================
; Debug DPI_ResizeFactor_BF() ; Get the actual DPI resize factor
; Deactivate_DPI_ResizeFactor_BF(1) ; This function deactivate the DPI aware feature
CreateGUI_1(-1, -1, 900, 550) ; x, y, width, height - x=-1 center the output x - y=-1 center the output y
CompilerEndIf
Stand alone
Code: Select all
EnableExplicit
DeclareModule CreateGUI_1
EnableExplicit
Declare CreateGUI_1(window_x, window_y, window_width_output, window_height_output)
EndDeclareModule
Module CreateGUI_1
Global window_width_developing=620 ; Developing size
Global window_height_developing=400
Global window_min_width=200 ; Minimum window size
Global window_min_height=150
Global window_x, window_y, window_width_output, window_height_output
Global window_flags=#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_Invisible
Global window_ID=OpenWindow(#PB_Any, 0, 0, window_width_developing, window_height_developing,
"Dynamic Window and GUI creating", Window_flags)
WindowBounds(window_ID, window_min_width, window_min_height, #PB_Ignore, #PB_Ignore)
Global get_all_window_events ; Auxiliary variable for callback procedure WindowEvent handling
; Create ButtonImageGadget _1 for using ==========================================
Global ButtonImageGadget_1_width=300
Global ButtonImageGadget_1_height=350
Global ButtonImageGadget_1_x=WindowWidth(window_ID)/2-ButtonImageGadget_1_width/2
Global ButtonImageGadget_1_y=WindowHeight(window_ID)/2-ButtonImageGadget_1_height/2
Global image_ID=CreateImage(#PB_Any, 120, 120, 24, #Red)
Global Gadget_1_ID=ButtonImageGadget(#PB_Any,
ButtonImageGadget_1_x, ; Gadget output x pos
ButtonImageGadget_1_y, ; Gadget output y pos
ButtonImageGadget_1_width, ; Gadget width
ButtonImageGadget_1_height, ImageID(image_ID)) ; Gadget height
; ############## Resize procedure for callback ##############################
Procedure WindowResizing_BindEvent_CreateGUI_1()
; ============= Init the scaling variables ==============
Global set_x.d=100/window_width_developing*WindowWidth(window_ID)/100
Global set_y.d=100/window_height_developing*WindowHeight(window_ID)/100
Define button_width.d=600 ; Text width
Define button_height.d=200 ; Text height
Define fitted_text_width.d=ButtonImageGadget_1_width*set_x ; Fitted text width - Negative values available
Define fitted_text_height.d=ButtonImageGadget_1_height*set_y ; Fitted text height - Negative values available
ResizeWindow(window_ID, #PB_Ignore, #PB_Ignore, WindowWidth(window_ID), WindowWidth(window_ID)/1.5)
ResizeGadget(gadget_1_ID,
ButtonImageGadget_1_x*set_x,
ButtonImageGadget_1_y*set_y,
ButtonImageGadget_1_width*set_x,
ButtonImageGadget_1_height*set_y)
EndProcedure
; ===========================================================================
Procedure CreateGUI_1(window_x, window_y, window_width_output, window_height_output)
; ================= Init the resize procedure callback ======================
BindEvent(#PB_Event_SizeWindow, @WindowResizing_BindEvent_CreateGUI_1())
; ====== Init all gadgets - Call simple the resize callback procedure =======
Macro Refresh_all_Gadgets ; Refresh the gadgets
WindowResizing_BindEvent_CreateGUI_1()
EndMacro
; ============================= Show the result =============================
Refresh_all_Gadgets
HideWindow(window_ID, 0)
Repeat
Define win_event=WaitWindowEvent()
Until win_event=#PB_Event_CloseWindow
EndProcedure
EndModule
UseModule CreateGUI_1
CompilerIf #PB_Compiler_IsMainFile
; ========================== Run the module, ====================================
; Debug DPI_ResizeFactor_BF() ; Get the actual DPI resize factor
; Deactivate_DPI_ResizeFactor_BF(1) ; This function deactivate the DPI aware feature
CreateGUI_1(-1, -1, 900, 550) ; x, y, width, height - x=-1 center the output x - y=-1 center the output y
CompilerEndIf