weird behavioural of StringGadget
Posted: Wed Oct 22, 2025 10:32 am
Hello:
in the following snippet, I can't get the focus on the String gadget #String+14, next to "Resolution" by clicking the mouse inside, I can get it using the TAB key, It works using older versions 5.73 and 6.04.
Any idea?
Other question: I prefer that the color of the panel gadget stay gray not white. If in compiler options, "enable DPI aware" is checked, panel is white, otherwise it's gray if unchecked. is there a trick to keep it gray with "enable DPI aware" checked?
using PB6.30b2 - W10.
in the following snippet, I can't get the focus on the String gadget #String+14, next to "Resolution" by clicking the mouse inside, I can get it using the TAB key, It works using older versions 5.73 and 6.04.
Code: Select all
EnableExplicit
UseJPEGImageEncoder()
UsePNGImageEncoder()
UsePNGImageDecoder()
InitSound()
Define InstID.i, Event.i, GadgetID.i, fname.s{1000}, cmd.s, prg.i, choix.b, directory.s
Define result.i, PageCount.i, size.i, OutBytes.i, *Buffer, dumy1.s, dumy2.s, flag.a
Define n1.u, n2.u, len.a, resol.s, minx.d, maxx.d, miny.d, maxy.d, xnull.w, Bkgcolor.l
Global tmp.s
Define *argv, dumy.s
Define.i orig_pdf, output, i
Dim pdfs.i(2)
Define range.i
;1pt = 1/72 inch = 0.0352777 cm 1cm=28.346457
Enumeration
#Form
#Panel
#Text=#Panel+100
#String=#Text+100
#Button=#String+100
#Editor=#Button+100
#Option=#Editor+100
#Spin=#Option+100
#Image=#Spin+100
#Check=#Image+100
EndEnumeration
SetGadgetFont(#PB_Default, LoadFont(0, "Arial", 9))
CreateImage(0,100,100)
OpenWindow(0,100, 100, 800, 400, "TOOLS1", #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar )
PanelGadget(#Panel, 10, 10, 600, 350)
AddGadgetItem(#Panel, -1, "Pdf2Image")
TextGadget(#Text+10,10,10,70,15,"File name:")
StringGadget(#String+12,80,10,200,20,"")
TextGadget(#Text+11,10,40,100,20,"Pages: From")
StringGadget(#String+10,115,40,40,20,"",#PB_String_ReadOnly)
TextGadget(#Text+12,170,40,15,20,"To")
StringGadget(#String+11,200,40,40,20,"",#PB_String_ReadOnly)
TextGadget(#Text+14,300,40,150,20,"Resolution:")
StringGadget(#String+14,375,40,60,20,"400")
CheckBoxGadget(#Check+1, 300,70,50,20,"File")
TextGadget(#Text+13,10,70,37,20,"Page:")
StringGadget(#String+13,50,70,50,23,"1")
ButtonGadget(#Button+10,285,10,30,20,"...")
ButtonGadget(#Button+11,320,10,60,20,"Convert")
EditorGadget(#Editor+2, 10,100,500,100,#PB_Editor_ReadOnly)
CloseGadgetList()
Repeat
Event = WaitWindowEvent()
GadgetID = EventGadget() ; Is it a gadget event?
Until Event = #PB_Event_CloseWindow
End
Other question: I prefer that the color of the panel gadget stay gray not white. If in compiler options, "enable DPI aware" is checked, panel is white, otherwise it's gray if unchecked. is there a trick to keep it gray with "enable DPI aware" checked?
using PB6.30b2 - W10.