Não centraliza DIALOG

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Não centraliza DIALOG

Mensagem por JoséQuintas »

Estou com esse problema, e é muuuuuito interessante

Tenho a dialog "main"

Código: Selecionar todos

FUNCTION gui_MainMenu( xDlg, aMenuList, aAllSetup, cTitle )

   LOCAL aGroupList, cDBF

   gui_DialogCreate( @xDlg, 0, 0,1024, 768, cTitle )
   MENU OF xDlg
      FOR EACH aGroupList IN aMenuList
         MENU TITLE "Data" + Ltrim( Str( aGroupList:__EnumIndex ) )
            FOR EACH cDBF IN aGroupList
               MENUITEM cDBF ACTION frm_Main( cDBF, aAllSetup )
            NEXT
         ENDMENU
      NEXT
      MENU TITLE "Exit"
         MENUITEM "&Exit" ACTION gui_DialogClose( xDlg )
      ENDMENU
   ENDMENU
   gui_DialogActivate( xDlg )

   RETURN Nil
que chama a criação genérica de dialog

Código: Selecionar todos

FUNCTION gui_DialogCreate( xDlg, nRow, nCol, nWidth, nHeight, cTitle, bInit )

   LOCAL oFont

   IF Empty( bInit )
      bInit := { || Nil }
   ENDIF
   oFont := HFont():Add( DEFAULT_FONTNAME, 0, -11 )
   INIT DIALOG xDlg ;
      CLIPPER ;
      FONT oFont ;
      NOEXIT ;
      TITLE     cTitle ;
      AT        nRow, nCol ;
      SIZE      nWidth, nHeight ;
      BACKCOLOR COLOR_WHITE ;
      ON INIT   bInit

   RETURN Nil
ou seja, Main ou não, cria sempre do mesmo jeito.

E tem o activate, também igual pra qualquer dialog, que faz a centralização.

Código: Selecionar todos

FUNCTION gui_DialogActivate( xDlg, bCode )

   xDlg:Center()
   IF Empty( bCode )
      xDlg:Activate()
   ELSE
      ACTIVATE DIALOG xDlg ON ACTIVATE bCode
   ENDIF

   RETURN Nil
É tudo igual, é tudo centralizando... mas... a dialog principal não centraliza.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Não centraliza DIALOG

Mensagem por JoséQuintas »

Resolvido REMOVENDO OOP

Código: Selecionar todos

FUNCTION gui_DialogActivate( xDlg, bCode )

   // xDlg:Center()
   IF Empty( bCode )
      ACTIVATE DIALOG xDLG CENTER // xDlg:Activate()
   ELSE
      ACTIVATE DIALOG xDlg CENTER ON ACTIVATE bCode
   ENDIF

   RETURN Nil
Pois é...
Não é só MINIGUI que tem dessas coisas..

Centralizar os comandos em funções acaba em fornecer uma solução definitiva pra qualquer situação !!!

E dizem por aí que é usuário console que não sabe usar gui kkkkk
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder