Dialog Box Sizes and Locations Incorrect

Post Reply
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

Hello:
I have just started using BasicMaker and, almost immediately, I have found a problem that I cannot fix and I am hoping someone can set me straight.
First, let me provide a couple of statements from the manual: The definitions:
Begin Dialog DialogName [X, Y,] Width, Height,
Next, the definition of these values:
X, Y Optional. Sets the screen coordinates for the upper left corner of the dialog box (in screen pixels).
Width, Height Sets the width and height of the dialog (in screen pixels).
Next, a short program illustrating my problem:

Code: Select all

Sub Main
Dim pm as Object
Set pm = CreateObject("PlanMaker.Application")
Begin Dialog Welcome 500, 500, 400, 200, "Test of Dialog Sizes"
	Text 100, 25, 150, 45, "This is Test Message 1"
	Text 100, 50, 150, 75, "This is Test Message 2"
	PushButton 100, 75, 50, 25, "Continue"
	PushButton 100, 125, 50, 70, "Exit"
End Dialog
Dim WelcomeDialog As Welcome
DialogReturn% = Dialog(WelcomeDialog)
End Sub
Then, finally the dialog box that the BasicMaker program drew:Image
The first thing to notice is the red box - The program calls for a dialog box 400x200px; BM drew one that is 1000x500px! From the picture, it is easy to see that the locations of the texts are wrong as are the locations and sizes of the buttons!
I hope someone can point out to me where I am going wrong. Thanks in advance.
Attachments
Test Dialog Box.png
Test Dialog Box.png (10.24 KiB) Viewed 34516 times
miguel-c
SoftMaker Team
SoftMaker Team
Posts: 1233
Joined: Wed Jun 05, 2019 12:02 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by miguel-c »

I was able to reproduce the issue:
The XY coordinates are correct, but the width and height are more than doubled.
I reported it to the developers.
miguel-c
SoftMaker Team
SoftMaker Team
Posts: 1233
Joined: Wed Jun 05, 2019 12:02 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by miguel-c »

Reply from the developers:
For dialog width and height, we use "dialog units"
These dialog units are then converted to pixels depending on the currently used dialog font (that way text should always fit, regardless of the dialog font you use, because it adapts to the font).
We will correct the manual to mention that (X,Y) is display pixels and (W,H) is dialog units.
miguel-c
SoftMaker Team
SoftMaker Team
Posts: 1233
Joined: Wed Jun 05, 2019 12:02 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by miguel-c »

We updated the web manual and the PDF manual will be updated on the next service pack for version 2024.
https://help.softmaker.com/basicmaker20 ... ition.html
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

Hello:
Thank you for replying but please explain the term "Dialog Units" and how in the world it's of any use to me. In order to get a dialog box to the size I want it to be, I have to get the correct value by trial and error, sometimes a very lengthy process.
I would also appreciate an explanation as to why you can't use pixels. When you want to determine the width and heigth of a figure, that seems to me to be the most logical thing to use.
Thank you in advance.
martin-k
SoftMaker Team
SoftMaker Team
Posts: 3088
Joined: Fri Nov 21, 2003 4:57 pm
Location: Nürnberg, Germany
Contact:

Re: Dialog Box Sizes and Locations Incorrect

Post by martin-k »

We use dialog box units because Windows uses dialog box units:

https://techsupt.winbatch.com/webcgi/we ... lained.txt
Martin Kotulla
SoftMaker Software GmbH
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

Hello, again:
Thank you for the information; however, the discussion at the link you provided mentions a document "Windows Interface Language" help file. I can find no reference to that help file and I think I need that help file to make sense of the document. Can you help?
martin-k
SoftMaker Team
SoftMaker Team
Posts: 3088
Joined: Fri Nov 21, 2003 4:57 pm
Location: Nürnberg, Germany
Contact:

Re: Dialog Box Sizes and Locations Incorrect

Post by martin-k »

Google "Windows dialog box units" to find many discussions on the subject.
Martin Kotulla
SoftMaker Software GmbH
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

Hello Martin:
I have now found some sources for dialog units. Before today I had never heard of them! As one source warned, I was using a pixel-based editor.
Would it be reasonable, in view of the large number of hours I wasted trying to create a number of dialog boxes based upon an incorrect BasicMaker manual for Softmaker to grant me a licence to the SoftMaker Office 2024? That would be nice considering the fact that the manual was in error.
Regardless, thank you for your insights into this puzzling problem.
SuperTech
SoftMaker Team
SoftMaker Team
Posts: 2951
Joined: Wed Mar 11, 2020 5:31 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by SuperTech »

You can upgrade your SoftMaker Office 2021 license to SoftMaker Office 2024/NX from our online shop.
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

Actually, what I need is a set of functions, in Softmaker BasicMaker, so that I can make use of this information. If SoftMaker uses these units, then Softmaker needs to provide the functions required to use them. When, as you suggested, I Google "Windows dialog box units", I get tons of information but it assumes knowledge of C++, something I don't have.
SuperTech
SoftMaker Team
SoftMaker Team
Posts: 2951
Joined: Wed Mar 11, 2020 5:31 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by SuperTech »

Knowledge of C++ is not required for BasicMaker but to understand these technical terms, some technical knowledge of Windows programming is required.
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

The discussions of the dialog units and a function to compute it are written in C++. These functions need to be provided by BasicMaker - either that or, built in to the dialog function is the conversion. In other words, the width and height of the desired dialog box would still be provided by the user in pixels; unknown to the user, in the code that creates the dialog box, conversion from pixels to dialog units is done behind the scenes. This would be a better solution in my opinion than forcing the user to understand dialog units.
SuperTech
SoftMaker Team
SoftMaker Team
Posts: 2951
Joined: Wed Mar 11, 2020 5:31 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by SuperTech »

The first search result I got is independent of any coding and just explaining the dialog units (DLUs).
TheArtfulDodger
Posts: 14
Joined: Fri Jun 20, 2014 3:25 pm

Re: Dialog Box Sizes and Locations Incorrect

Post by TheArtfulDodger »

OK, I didn't come across that page but, and it's a big BUT, please explain where I find the function GetDialogBaseUnits, and I'm willing to bet it isn't a function that BasicMaker recognizes! That is exactly the problem I found in all the articles - "all you have to do is use XYZ() function to get the value"! So, please, if you are going to reference an article, reference an article that applies to BasicMaker and that works in BasicMaker!
Post Reply

Return to “BasicMaker 2021 for Windows”