Strange SET DIALOGBOX POSITION behaviour

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Strange SET DIALOGBOX POSITION behaviour

Post 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
Attachments
Imputbox.zip
(1.53 KiB) Downloaded 295 times
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post 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
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post 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?
Attachments
h_controlmisc.zip
(55.61 KiB) Downloaded 247 times
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 »

Nice
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 »

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
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post 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.
User avatar
serge_girard
Posts: 3161
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 »

Theo, I really wouldn't know how to solve!

Serge
There's nothing you can do that can't be done...
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, 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 :(
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Strange SET DIALOGBOX POSITION behaviour

Post 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.)
Andrés González López
Desde Guadalajara, Jalisco. México.
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Strange SET DIALOGBOX POSITION behaviour

Post 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
Post Reply