Wow, thanks - a lot of interesting comments.
But this is the problem that I'm trying to correct.
Using a button as an example in this test code.
I need to keep the button size at the same size on it's form.
That windows setting just changes the text size.
In the following code example, I use three buttons to adjust the text size
to show how if I could possibly detect that setting from windows to
adjust the text size. If for example that 125% was needed, I would use
the setting that would increase the font size - and still appear larger under
the 125% setting, but still be within the button.
So the 125% button would be set to a lower size font, but so that the text
would still be within the button.
Code: Select all
;{- Enumerations / DataSections
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#TS100_btn
#Test_btn
#TS125_btn
#TS150_btn
#Test_Font1
#Test_Font2
#Test_Font3
#msg_txt
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 450, 200, 312, 213, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ButtonGadget(#TS100_btn, 49, 55, 91, 36, "Default = 100%")
ButtonGadget(#Test_btn, 181, 102, 91, 36, "TEST TEXT")
ButtonGadget(#TS125_btn, 49, 101, 91, 36, "125%")
ButtonGadget(#TS150_btn, 49, 147, 91, 36, "150%")
LoadFont(#Test_Font1, "Tahoma", 8);100
LoadFont(#Test_Font2, "Tahoma", 10);125
LoadFont(#Test_Font3, "Tahoma", 12.5);150
SetGadgetFont(#Test_btn, FontID(#Test_Font1))
TextGadget(#msg_txt, 172, 147, 121, 33, "Button size needs to stay the same size.")
; Gadget Colors
PureCOLOR_SetButtonColor(#TS100_btn, #PureCOLOR_SystemColor, $C0C0C0)
PureCOLOR_SetButtonColor(#Test_btn, #PureCOLOR_SystemColor, $C0C0C0)
PureCOLOR_SetButtonColor(#TS125_btn, #PureCOLOR_SystemColor, $C0C0C0)
PureCOLOR_SetButtonColor(#TS150_btn, #PureCOLOR_SystemColor, $C0C0C0)
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent(5)
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #TS100_btn
SetGadgetFont(#Test_btn, FontID(#Test_Font1))
SetGadgetText(#Test_btn,"TEST TEXT")
ElseIf EventGadget = #TS125_btn
SetGadgetFont(#Test_btn, FontID(#Test_Font2))
SetGadgetText(#Test_btn,"TEST TEXT")
ElseIf EventGadget = #TS150_btn
SetGadgetFont(#Test_btn, FontID(#Test_Font3))
SetGadgetText(#Test_btn,"TEST TEXT")
EndIf
; ////////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
;
;}
Doing some search on line, I found this link which illustrates this problem.
http://dascomputerconsultants.com/Magni ... Issues.htm
I don't use Visual Studio, but he fixed it using AutoScaleMode with option set to DPI.
Is something like that possible with PB? And if it is, I need to ask the experts here
how one could go about writing that code. Please
