Strange SET DIALOGBOX POSITION behaviour
Moderator: Rathinagiri
Strange SET DIALOGBOX POSITION behaviour
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:
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:
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.
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:
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:
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.
Re: Strange SET DIALOGBOX POSITION behaviour
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')
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')
- 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
Hello Theo,
I experience the same problem. Maybe Claudio knows why and how to resolve?
Greetings, Serge
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...
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Strange SET DIALOGBOX POSITION behaviour
I will check.
Re: Strange SET DIALOGBOX POSITION behaviour
Thanks Serge for checking, hopefully Claudio will find a solution !
Re: Strange SET DIALOGBOX POSITION behaviour
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.
InputWindow
InputBox
The last one is always centered, the first you can change the row and the column.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Strange SET DIALOGBOX POSITION behaviour
InputWindow and InputBox not are dialog Box, are normal windows
Re: Strange SET DIALOGBOX POSITION behaviour
Claudio, thanks for answering.
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.
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 ?srvet_claudio wrote:InputWindow and InputBox not are dialog Box, are normal windows
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.
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.
Re: Strange SET DIALOGBOX POSITION behaviour
In this case, you need to create your own inputbox function or modify sources.
Re: Strange SET DIALOGBOX POSITION behaviour
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
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
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
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