Strange SET DIALOGBOX POSITION behaviour

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Strange SET DIALOGBOX POSITION behaviour

Post by trmpluym »

I experience strange behaviour with the 'SET DIALOGBOX POSITION' function.

The line below is used to center the dialog boxes to the center of the windows named "wndWindow1"

SET DIALOGBOX POSITION CENTER OF "wndWindow1"

When i try to close the "wndWindow1" (by using the red X button in the right top) the screen looks like this:
Demo1.png
Demo1.png (13.65 KiB) Viewed 8284 times
This is expected (correct) behaviour. I can repeat this (pressing No) without problems.

But when i afterwards use the 'Test' menu to display (for example) a debug message and then close the "wndWindow1" (by using the red X button in the right top) the screen looks like this:
Demo3.png
Demo3.png (13 KiB) Viewed 8284 times
The message is NOT centered in the "wndWindow1" but centered in the desktop screen.

A demonstration program of the strange behaviour is in the attachement (DIALOGBOX.zip).

I tried it using HMG 3.4.3 and 3.4.2, same problem.
Attachments
DIALOGBOX.zip
(1.5 MiB) Downloaded 323 times
Last edited by trmpluym on Sun Jul 03, 2016 11:46 pm, edited 1 time in total.
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post by trmpluym »

Some extra info. The problem seems to be related to the menu.

When i use an ON KEY procedure and call the same function (MsgDebug('TEST')) the problem does not occur.

ON KEY F2 OF wndWindow1 ACTION MsgDebug('TEST')
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Strange SET DIALOGBOX POSITION behaviour

Post by serge_girard »

Hello Theo,

I experience the same problem. Maybe Claudio knows why and how to resolve?

Greetings, Serge
There's nothing you can do that can't be done...
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Strange SET DIALOGBOX POSITION behaviour

Post by srvet_claudio »

I will check.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post by trmpluym »

Thanks Serge for checking, hopefully Claudio will find a solution !
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post by trmpluym »

Also the following functions do not use 'SET DIALOGBOX POSITION'

InputWindow
InputBox

The last one is always centered, the first you can change the row and the column.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Strange SET DIALOGBOX POSITION behaviour

Post by srvet_claudio »

InputWindow and InputBox not are dialog Box, are normal windows
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post by trmpluym »

Claudio, thanks for answering.
srvet_claudio wrote:InputWindow and InputBox not are dialog Box, are normal windows
But maybe do you know a way to center the InputBox to the center of the parent form an stead of the center of the screen ?

Code: Select all

InputBox() : Displays a modal window used for input Of a single string

Syntax:
InputBox ( cInputPrompt [, cWindowTitle] [, cDefaultValue] [, nTimeout ,  cTimeoutValue] [, lMultiLine ] [, nWidth ] )
* New optional nWidth parameter, responsable to fix window width size.
There is only a nWidth parameter, but no way to change the location. Maybe it is possible to implement [, nRow] [, nCol] ?

The goal is to make the software independent of the location on the screen. Right now after using the menu dialog boxes do not center to the middle of the parent screen and it also not possible to change the InputBox location. So the interface looks strange when the main form is dragged to the edges of the screen.
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Strange SET DIALOGBOX POSITION behaviour

Post by mol »

In this case, you need to create your own inputbox function or modify sources.
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post by trmpluym »

Hi Marek,

You are right, i can create my own 'InputBox' function.

But maybe it is a better idea to add the [, nRow] [, nCol] parameters, so not every HMG user have to develop their own InputBox version ? This way HMG would get better and more universal every release :D

But again this is not urgent, i can workaround this issue programming my own 'InputBox' version.

My main concern is now the bug in the 'SET DIALOGBOX POSITION' command like demonstrated in the sample code i posted. I cannot fix this my selves.

Theo
Post Reply