Page 2 of 4

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Sat Jul 23, 2016 1:19 pm
by mustafa
Hola Theo (trmpluym)
Te mando un sample que hice hace
Tiempo para sustituir Inputbox

No es lo que tú buscas pero aquí está
Es una ventana CHILD que no deja moverse
Tiene un DEFINE TIMER Timer_1 y no se puede
Anular con las Teclas ( Control+F4 )
Solo sale con el Botón [Cancel] o con [Esc]

Un saludo
*-------------------- Google ---------------------*
Hi Theo (trmpluym)
I send you a sample I made ago
Time to replace Inputbox

It's not what you want but here's
It is a child window that leaves move
It has a DEFINE TIMER timer_1 and can not be
Cancel with the keys (Ctrl + F4)
Just goes with the button [Cancel] or [Esc]

greeting
Mustafa

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Sat Jul 23, 2016 1:30 pm
by trmpluym
Hi Mustafa,

Thanks for the nice sample !

I never used 'DEFINE TIME' i certainly can use it 8-)

Still learning everyday ...

Greetings from the Netherlands.

Theo

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Mon Jul 25, 2016 9:02 pm
by trmpluym
I changed the source file c:\hmg.3.4.3\SOURCE\h_controlmisc.prg with only four lines to add the possibility to center the InputWindow in the parent window.

The lines i added are line 3099 ...

Code: Select all

Local cParentWindowName:=ThisWindow.Name 
... and 3876 to 3878

Code: Select all

If nRow < 0 .or. nCol < 0                                     
   CENTER WINDOW _InputWindow IN &cParentWindowName           
EndIf 


The orignal syntax is:

Code: Select all

InputWindow( [cTitle], acLabels, aValues, aFormats [, nRow] [, nCol] [, aBackColor] [, aToolTips] [, aHotKeys] [, aStyles] [, bCode] ) -->  aResult
nRow and nCol are optional. When nRow or nCol are 0 the InputWindow is positioned in the center of the screen.

With the modification i made the functionality stays the same but when nRow of nCol is a negative number (<0) the InputWindow is positioned in the center of the parent form.

Maybe an idea to include in the next release?

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Tue Jul 26, 2016 12:40 am
by srvet_claudio
Nice

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Sat Aug 06, 2016 9:45 am
by trmpluym
srvet_claudio wrote:I will check.
Hi Claudio,

Sorry for holding on, but unfortunately i am not able to fix this problem my selves :? .

Where you able to find the source of the bug ?

It seems to be related to the menu function.

Theo

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Sun Sep 11, 2016 10:44 am
by trmpluym
Help ?

Anybody else knows how to solve this problem (see first message in this post) ? It looks very sloppy when the dialog messages pop-up in completely the wrong position after using a menu function.

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Sun Sep 11, 2016 11:43 am
by serge_girard
Theo, I really wouldn't know how to solve!

Serge

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Wed Sep 14, 2016 9:26 pm
by trmpluym
Thanks Serge, hopefully somebody else is able and willing to fix this nasty bug soon !

I developed an application but because of this bug i cannot release my application :(

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Wed Sep 14, 2016 9:52 pm
by andyglezl
Hola trmpluym

Si cambias por la función MSGYESNO(), funciona OK.
-----------------------------------------------------------------------
Hello trm Pluym
If you change the MSGYESNO () function works OK.

Code: Select all

Function EndProg()
   
IF MSGYESNO('Quit program ?','Quit?',MB_ICONQUESTION + MB_YESNO)
   Return(.T.)
ENDIF

Return(.F.)

Re: Strange SET DIALOGBOX POSITION behaviour

Posted: Mon Sep 19, 2016 6:40 pm
by trmpluym
Thanks Andrés,

You are right the problematic behaviour does not occur using the MsgYesNo() function.

So the bug is narrowed down to the it MessageBoxTimeout() function !

I switched over to the MessageBoxTimeout because it is more flexible than MsgYesNo(). With the MessageBoxTimeout() function (when functioning correct) normally i can achieve the same functionality as the MsgYesNo() function but also the functionality of the MsgStop() function and the MsgRetryCancel() function.

But until Claudio who has programmed the MessageBoxTimeout() function ( see: viewtopic.php?t=3273 ) or anybody else who understands the source finds a solution for the bug, i have to switch back to the older less powerfull MsgYesNo(), MsgStop(), .., .. functions.

But now i have a workaround and i can finish my program !

Many thanks again Andrés :D