It is currently Tue Dec 10, 2019 7:17 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [5.70] ComboBox, ExplorerCombo resizing and DPI aware issue
PostPosted: Thu Feb 07, 2019 9:43 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Mar 09, 2006 9:24 am
Posts: 263
Location: S. Kor
Check the "Enable DPI aware executable" option, and then run the code.
Tested with PB 5.70 x86/x64 on Windows 10 x64 and 7 x64 (125% DPI).

Code:
If OpenWindow(0, 0, 0, 400, 300, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ComboBoxGadget(0, 10, 10, 200, 40)
  ExplorerComboGadget(1, 10, 80, 200, 40, "")
 
  Debug DesktopResolutionX()   ; 1.25
  Debug DesktopResolutionY()   ; 1.25
 
  Debug "------------"
 
  Debug "ComboBoxGadget"
  Debug GadgetWidth(0)    ;200
  Debug GadgetHeight(0)   ;40
 
  ResizeGadget(0, #PB_Ignore, #PB_Ignore, 200, #PB_Ignore)
 
  Debug "Resize width"
  Debug GadgetWidth(0)   ;200
  Debug GadgetHeight(0)  ;39    <-- wrong
 
  FreeGadget(0)
  ComboBoxGadget(0, 10, 10, 200, 40)
  ResizeGadget(0, #PB_Ignore, #PB_Ignore, #PB_Ignore, 40)
 
  Debug "Resize height"
  Debug GadgetWidth(0)   ;200
  Debug GadgetHeight(0)  ;39    <-- wrong
 
  FreeGadget(0)
  ComboBoxGadget(0, 10, 10, 200, 40)
  ResizeGadget(0, #PB_Ignore, #PB_Ignore, 200, 40)
 
  Debug "Resize width and height"
  Debug GadgetWidth(0)   ;200
  Debug GadgetHeight(0)  ;39    <-- wrong
 
  FreeGadget(0)
  ComboBoxGadget(0, 10, 10, 200, 40)
  ResizeGadget(0, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore)
 
  Debug "No resizing"
  Debug GadgetWidth(0)   ;200
  Debug GadgetHeight(0)  ;39    <-- wrong
 
  Debug "------------"
 
  Debug "ExplorerComboGadget"
  Debug GadgetWidth(1)    ;200
  Debug GadgetHeight(1)   ;40
 
  ResizeGadget(1, #PB_Ignore, #PB_Ignore, 200, #PB_Ignore)
 
  Debug "Resize width"
  Debug GadgetWidth(1)   ;200
  Debug GadgetHeight(1)  ;40
 
  FreeGadget(1)
  ExplorerComboGadget(1, 10, 80, 200, 40, "")
  ResizeGadget(1, #PB_Ignore, #PB_Ignore, #PB_Ignore, 40)
 
  Debug "Resize height"
  Debug GadgetWidth(1)   ;200
  Debug GadgetHeight(1)  ;32    <-- wrong
 
  FreeGadget(1)
  ExplorerComboGadget(1, 10, 80, 200, 40, "")
  ResizeGadget(1, #PB_Ignore, #PB_Ignore, 200, 40)
 
  Debug "Resize width and height"
  Debug GadgetWidth(1)   ;200
  Debug GadgetHeight(1)  ;32    <-- wrong
 
  FreeGadget(1)
  ExplorerComboGadget(1, 10, 80, 200, 40, "")
  ResizeGadget(1, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore)
 
  Debug "No resizing"
  Debug GadgetWidth(1)   ;200
  Debug GadgetHeight(1)  ;40
 
 
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf



Top
 Profile  
Reply with quote  
 Post subject: Re: [5.70] ComboBox, ExplorerCombo resizing and DPI aware is
PostPosted: Thu Feb 07, 2019 5:05 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3716
Location: Berlin, Germany
breeze4me wrote:
Check the "Enable DPI aware executable" option, and then run the code.
Tested with PB 5.70 x86/x64 on Windows 10 x64 and 7 x64 (125% DPI).

Looks the same here as it does when that option is not checked (except that the text is crisper).
Tested with PB 5.70 x64 on Windows 10 Pro (October 2018 Update) -- 125% DPI.

What is the issue that you are encountering?

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.70] ComboBox, ExplorerCombo resizing and DPI aware is
PostPosted: Thu Feb 07, 2019 5:40 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Mar 09, 2006 9:24 am
Posts: 263
Location: S. Kor
Little John wrote:
What is the issue that you are encountering?


When a ComboBox gadget or an ExplorerCombo gadget is resized, especially the width or the height of those gadgets, the size is shrunk.
If the DPI aware option is off, there is no problem.

Code:
Debug DesktopResolutionX()   ; 1.25
Debug DesktopResolutionY()   ; 1.25

If the DPI setting is not applied, then that value is 1.0. And the problem doesn't occur. i.e. 40 -> 40 no shrinking.


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.70] ComboBox, ExplorerCombo resizing and DPI aware is
PostPosted: Mon Jun 24, 2019 3:52 pm 
Offline
User
User
User avatar

Joined: Sun Feb 23, 2014 2:05 am
Posts: 79
Location: Australia
I was going to create a topic to report this same bug and came across this.

Run the code below in 5.70 with DPI aware enabled in compiler options and have Windows display size set to something other than the default 100%.

Resize the window and you will notice the ComboBoxGadget are not sizing correctly.

If you disable DPI aware in compiler options everything is all okay.

Tested in Windows 7 and 10.

Code:
Enumeration
  #Window
  #Combo1
  #Combo2
EndEnumeration

Declare.i SizeWindowHandler()

If OpenWindow(#Window, 0, 0, 400, 200, "Window", #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget)
  ComboBoxGadget(#Combo1, 005, 069, 315, 020, #PB_ComboBox_Editable)
  ComboBoxGadget(#Combo2, 005, 025, 070, 020)

  BindEvent(#PB_Event_SizeWindow, @SizeWindowHandler())
 
  Repeat
    Select WaitWindowEvent() 
      Case #PB_Event_CloseWindow
        Select EventWindow()
          Case #Window
            End
        EndSelect
    EndSelect
  ForEver
 
EndIf

Procedure.i SizeWindowHandler()

  ResizeGadget(#Combo1, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore)
  ResizeGadget(#Combo2, #PB_Ignore, #PB_Ignore, #PB_Ignore, #PB_Ignore)

EndProcedure


Ted.

_________________
https://tuts4you.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye