Shark007 Posted May 8, 2021 Author Share Posted May 8, 2021 I am at your service, bring it. Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 I found it necessary to remove the scaling on line 561 - I still have minor issues with message width. Local $hMsgGUI = GUICreate($sTitle, $iDialog_Width, $iMsg_Height, $iHpos, $iVPos, BitOR(0x80880000, 0x00C00000), $iExtStyle, $iParent_Win) I also had some positioning issues with your setup but since I use ini files to track location, I completely removed your screen positioning to substitute my own. I'll look at that again as time permits. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 Shark007, I do not understand how scaling cannot be required when creating the main dialog. If all the internal controls are scaled, surely the GUI in which they are positioned must also be scaled or it will be to small to hold them. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 The gui is just too large. To me, it looks like the scaling is getting applied twice for the main GUI. The width issue: The message gui looks fine @ 100% scaling but @ 225% it becomes too skinny. I'll follow up with some Pics soon. Morning coffee isn't even ready yet. Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 (edited) Using your latest posting of ExtMsgBox_DPI.au3 and the following context in my App (my app is aprox 500x300 for reference) Screen positioning is handled by ExtMsgBox_DPI and all of the following pics were positioned by ExtMsgBox_DPI _ExtMsgBoxSet(0, 0, $Contrast) _ExtMsgBoxDPIScale($iScale) _ExtMsgBox(0, 0, 'Instruction', "This button will created 2 WMP shortcuts in the Open With list." & _ "The lower one is always the 64bit player. ALWAYS select to choose another app and also check the box to Always use," & _ " then select your prefered player. After doing all filetypes with permission errors," & _ "Select the appropriate player to use in the App", 0, $SetApp, 0, False) @225% scaling, I see the following And @100% i see this When I remove the scaling as I pointed out earlier, @225 I see this And @100% it is identical to my previous graphic @100 which does look OK. Edited May 9, 2021 by Shark007 Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 I'm going to continue my experimentation and keep an eye here to see if you post anything new to try. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 Shark007, Using your code I can see some size anomalies too. The dialog size is set by using my StringSize UDF to measure the space needed to display the content - I am wondering if that UDF also needs some tweaking to cope with the DPI scaling. I did say this was likely to get messy! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 14 minutes ago, Melba23 said: Using your code I can see some size anomalies too. The dialog size is set by using my StringSize UDF to measure the space needed to display the content - I am wondering if that UDF also needs some tweaking to cope with the DPI scaling. I did say this was likely to get messy! M23 Yes, I have come to this same conclusion about StringSize also and was hoping you could get me started with something and I could tweak. I had a look at it but I'm hoping you could point me in the right direction to get started. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 Shark007, The problem is definitely the return from the call to StringSize. In my tests the label is sized at 350x79 when at 100% - while at 175% it returns 350x274. I will continue looking into the problem as time allows. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 I have made good progress tweaking the positioning in relation to a parent gui. (completed) The StringSize issue is also affecting the message body as it is missing the [OK] button @ any DPI other than 100% I am in no hurry for results. I am testing this with a function that I intend to deprecate and my initial reason for looking at this has been resolved using SplashTextOn. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 Shark007, It seems that you need to factor the text size passed to StringSize - or to be correct to the GetTextExtentPoint32W API call within the UDF - to get a sensible result. Strangely it seems you need to divide by the DPI scaling factor rather then multiply like everywhere else - perhaps because (as you pointed out) Windows automatically scales the font itself. Anyway, the results are much better, but still not perfect so I will continue to work on the issue. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 (edited) I like that you mentioned 'division because I also am getting better results with the following Local $hMsgGUI = GUICreate($sTitle, $iDialog_Width * $iDPI, $iMsg_Height / $iDPI + 25 * $iDPI, $iHpos, $iVPos, BitOR(0x80880000, 0x00C00000), $iExtStyle, $iParent_Win) I'm not even sure why I did that ... lol (i'm old, and forgetful) Edited May 9, 2021 by Shark007 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 Shark007, Try this for size: ExtMsgBox_DPI.au3 M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 Wholly Crap! That worked right out of the box. I tested @ 225% (4-4 message) and 100% (9-9 message) , both were perfect. Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 Have a look at the bottom row of text. Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 That text anomaly at the bottom is @ 225% It is not occuring @ 100% Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 Shark007, I noticed that too and tried to get round it with code like this: ; DPI Aware code Local $iDPI = $g_aEMB_Settings[14] Local $iDPIFontSize = Ceiling($g_aEMB_Settings[4] / $iDPI) Local $iDPIDefFontSize = Ceiling($g_aEMB_Settings[10] / $iDPI) so that the font was always a trifle on the large side. It seemed to work for me at 175% but the problem obviously still exists at your extreme 225% scaling. You could try adding a bit to the font value and see if that gives a better result: ; DPI Aware code Local $iDPI = $g_aEMB_Settings[14] Local $iDPI_Factor = ($iDPI - 1) / 2 Local $iDPIFontSize = Ceiling(($g_aEMB_Settings[4] + $iDPI_Factor) / $iDPI) Local $iDPIDefFontSize = Ceiling(($g_aEMB_Settings[10] + $iDPI_Factor) / $iDPI) That way we are scaling the increase to the scaling factor rather than adding the same amount regardless. And the factoring expression might need a bit of juggling - I leave that to you. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 To my eyes, It seems the entire block of text has shifted downwards and getting impacted by the button space. Is it possible to shift that entire block upwards 5 pixels? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 9, 2021 Moderators Share Posted May 9, 2021 (edited) Shark007, Quote To my eyes, It seems the entire block of text has shifted downwards That is not the problem - it is the reduced results from the StringSize call making the whole label too small for the text at high scaling settings. That is why the text no longer fits and appears cut off. Adding 5 pixels to the label height would be a pure "fudge factor" to get over this and would affect label size at all scalings. I prefer to look for a programmatic solution if possible. M23 Edited May 9, 2021 by Melba23 Added a bit Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Shark007 Posted May 9, 2021 Author Share Posted May 9, 2021 I'm currently working with the code you presented. back soon Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now