FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Hide Dialog until move complete.
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Hide Dialog until move complete.
Posted: Tue May 20, 2025 12:14 AM

I am creating a series of dialogs that are calendars for a scheduling app. As I place them on the screen I like them to start at the top left of the desktop, and they stack next to each other as I keep adding them. The problem I see is that the dialog flashes on the screen inside the MDI area before the move. Just looks annoying. I have tried lVisible := .f., EnableWindow( oDlg:hWnd,.f.), oDlg:Hide(), also tried the From and To coordinates on the "Define Dialog" command. The Move happens during the "On Init" part of the Activate command. Anybody know the trick to make this happen.

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Hide Dialog until move complete.
Posted: Tue May 20, 2025 01:59 AM

Dear Byron,

Could you provide a small PRG example to see how you are doing it ?

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Hide Dialog until move complete.
Posted: Tue May 20, 2025 03:49 AM

Sir,

Define Dialog oDlg Resource "CALSELECT_5" Title cTitle of oWnd

oDlg:Hide()

oDlg:lVisible := .f.

EnableWindow( oDlg:hWnd,.f.)

Activate Dialog oDlg NoModal On Init ( oDlg:Move( nTop,nLeft,,,.t.),CalendarSetUp( oDlg,lOnly35 ) )

oDlg:Show() // Dialog shows with or without this statement, it was never hiden.

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Hide Dialog until move complete.
Posted: Tue May 20, 2025 05:59 AM

Dear Byron,

Have you tried to modify the dialog coordinates in the resources ?

This way you don't have to move it

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Hide Dialog until move complete.
Posted: Tue May 20, 2025 04:00 PM

I believe this is the syntax of the RC statement.

nameID DIALOG x, y, width, height [optional-statements] {control-statement . . . }

I changed the x, and the y to 0 (zero).

Compiled and run the program again and I expected the dialog to appear at the top left side of the screen.

Or maybe the top left side of the MDI.

Neither happened it seems to appear centered with the top a little above the top of the MDI.

Then it moves because of my Move command.

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Hide Dialog until move complete.
Posted: Tue May 20, 2025 04:58 PM
Good afternoon, what do you want to do is something like this?

Buenas tardes, ¿queréis hacer es algo así?
// C:\FWH\SAMPLES\BIEL.PRG .and. BIEL.RC -> example.

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, oFld, aFld, lAdd, lSave

   // MsgInfo( "start" )

   SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

   aFld := { 1, 4300, 121, "Descripción        " }

   lAdd := .F.

   DEFINE DIALOG oDlg RESOURCE "CtaAux" TRANSPARENT

   REDEFINE FOLDER oFld ID 4001 OF oDlg ;
      PROMPTS "&1-Principal", "&2-Identificación", "&3-Est.Balances";
      DIALOGS "CtaAux1", "CtaAux2", "CtaAux3"

   // --Principal
   REDEFINE GET aFld[ 1 ] ID 600 OF oFld:aDialogs[ 1 ] WHEN .F.

   REDEFINE GET aFld[ 2 ] ID 601 OF oFld:aDialogs[ 1 ] WHEN lAdd

   REDEFINE GET aFld[ 3 ] ID 602 OF oFld:aDialogs[ 1 ] WHEN lAdd

   REDEFINE GET aFld[ 4 ] ID 603 OF oFld:aDialogs[ 1 ]

   REDEFINE BUTTON ID 1 OF oDlg ACTION ( oDlg:End(), lSave := .T. ) // OK

   REDEFINE BUTTON ID 2 OF oDlg ACTION ( oDlg:End(), lSave := .F. )

   oDlg:bInit := { || oDlgAjustar( oDlg ) }

   ACTIVATE DIALOG oDlg CENTERED

   IF lSave
      // MsgInfo('ok')
   ENDIF

RETURN NIL

FUNCTION oDlgAjustar( oDlg )

   LOCAL aCoors := GetCoors( GetDesktopWindow() )

   oDlg:Move( 0, 0, aCoors[ 2 ], aCoors[ 4 ], .T. )

RETURN( .T. )

//  FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Hide Dialog until move complete.
Posted: Thu May 22, 2025 07:12 AM

Hello, try with oDlg:bStart := { || .... } instead of bInit

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Hide Dialog until move complete.
Posted: Thu May 22, 2025 03:52 PM

Didn't seem to help. Oddly enough it flashes before it moves it, and when I hit OK it flashes again in the same spot when created after it was moved successfully. I am producing small bit of code to duplicate.

Thanks,

Byron Hopp

Matrix Computer Services

Continue the discussion