FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ventanas Mdi y MdiChild
Posts: 479
Joined: Fri Feb 16, 2007 10:29 AM
Ventanas Mdi y MdiChild
Posted: Thu Oct 16, 2008 09:39 AM
Compañeros:

Hasta ahora todas mis aplicaciones las diseñaba con un Define Windows y el resto de opciones y menus a través de Dialogs.
Ahora, intentando mejorar mi IDE estoy haciendo pruebas con MDI (donde incluyo un define OUTLOOK2003) y MdiChild pero la hija no se ajusta al tamaño que resta en la MDI, a pesar de especificar la clausula maximized.

Adjunto un Codigo simple:
        Define Window oWin Title "Menú Principal" MDI ICON ICONOPRIN BRUSH oBrush menu opciones()
         Set Message To "" Keyboard Date Of oWin 2007
         Set Font OF oWin TO oFont
         Define buttonbar obarra 3D SIZE 60, 60 OF oWin 2007
           DEFINE BUTTON OF oBarra RESOURCE "salir" prompt "Salir" ACTION oWin:End() TOOLTIP 'Salir del programa'
           DEFINE OUTLOOK2003 oOutLook2003 OF oWin PROMPTS "Clientes", "Recibos","Utilidades" BITMAPS "Cancelar16", "","aceptar16"
            oWin:oLeft = nil
            @ 1, 2 BUTTON "Altas" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION clie()
            SetParent( oOutLook2003:hWnd, oWin:hWnd )
            oWin:oClient = nil
            @ 0, 191 SPLITTER oSplit VERTICAL _3DLOOK PREVIOUS CONTROLS oOutLook2003 HINDS CONTROLS oWin:oWndClient SIZE 4, oWin:nHeight - 70 PIXEL OF oWin
            SetParent( oSplit:hWnd, oWin:hWnd )
        activate window oWin maximized valid msgnoyes('¿Abandonar el programa?', 'Salir') ON RESIZE oSplit:Adjust()
return

FUNCT opciones()
 MENU oMenu 2007
 menuitem '&Ficheros' MESSAGE 'Acceso a las tablas principales del programa'
  menu
   menuitem '&Clientes' resource 'Cliente'
  endmenu
 endmenu
return

funct clie
 Define Window oWnd1 MdiChild Title 'Ventana hija' of oWin &&FROM 1, 25 TO 39, 128
  Set Message To "" Of oWnd1 2007
   Define ButtonBar oBar2 Size 50, 45 Of oWnd1 2007
    DEFINE BUTTON OF obar2 RESOURCE "salir" prompt "Salir" ACTION oWnd1:End() TOOLTIP 'Salir del programa'
 Activate Window oWnd1
return


... y esta es la pantalla:


A la espera de respuestas y sugerencias, saluda
Lorenzo
Desde Cádiz
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Ventanas Mdi y MdiChild
Posted: Thu Oct 16, 2008 10:18 AM

Lorenzo,

Haz una búsqueda en estos foros por NoGPF y encontrarás varias conversaciones en donde se ha mostrado como corregir ese comportamiento que comentas, gracias

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 479
Joined: Fri Feb 16, 2007 10:29 AM
Ventanas Mdi y MdiChild
Posted: Thu Oct 16, 2008 10:44 AM

Antonio,

Perdón por mi insistencia, pero me leí todas las conversaciones y todas hacen referencia a un problema de pintado y no de tamaño de ventanas.

Mil gracias.
LORENZO

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Ventanas Mdi y MdiChild
Posted: Thu Oct 16, 2008 10:46 AM
Lorenzo,

Prueba este ejemplo:
// FWH Class TOutLook2003

#include "FiveWin.ch"
#include "Splitter.ch"

static lExit := .F.

//----------------------------------------------------------------------------//

function Main()

   local oWnd, oOutLook2003, oStatusBar, oSplit, cCombo, oRad, nValue := 1
   local oFont

   DEFINE WINDOW oWnd TITLE "FWH new Class TOutLook2003" MDI // ;
      // MENU BuildMenu()

   DEFINE OUTLOOK2003 oOutLook2003 OF oWnd ;
      PROMPTS "Mail", "Calendar", "Contacts", "" ;
      BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp"
      
   oWnd:oLeft = nil // Because the splitter is going to control the resize   
      
   @ 1, 2 BUTTON "New" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION BuildDlg()

   @ 3, 2 BUTTON "Edit" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Edit" )   

   @ 5, 2 BUTTON "Search" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Search" )   

   @ 1, 1 COMBOBOX cCombo ITEMS { "January", "February", "March", "April", "May" } ;
      OF oOutLook2003:aDialogs[ 2 ] SIZE 170, 100 
   
   DEFINE FONT oFont NAME "Arial" SIZE 0, -10
   
   @ 12, 10 SAY Date() OF oOutLook2003:aDialogs[ 2 ] SIZE 80, 20 FONT oFont
   
   @ 3, 1 RADIO oRad VAR nValue OF oOutLook2003:aDialogs[ 2 ] ;
      ITEMS "&Day", "&Week", "&Month" SIZE 100, 20
      
   oRad:SetFont( oFont )   

   #ifndef __CLIPPER__
      DEFINE STATUSBAR oStatusBar PROMPT "  FWH Class TOutLook2003" OF oWnd
   #else   
      DEFINE MESSAGE oStatusBar PROMPT "  FWH Class TOutLook2003" OF oWnd
   #endif   

   SetParent( oOutLook2003:hWnd, oWnd:hWnd )
   
   oWnd:oClient = nil
   
   @ 0, 191 SPLITTER oSplit ;
      VERTICAL _3DLOOK ;
      PREVIOUS CONTROLS oOutLook2003 ; 
      HINDS CONTROLS oWnd:oWndClient ;
      SIZE 4, oWnd:nHeight - 70 PIXEL ;
      OF oWnd

   SetParent( oSplit:hWnd, oWnd:hWnd )

   ACTIVATE WINDOW oWnd ;
      ON RESIZE ( oSplit:Adjust(),;
                  WndLeft( oWnd:oWndClient:hWnd, oSplit:nRight + 1 ),;
                  WndWidth( oWnd:oWndClient:hWnd, oWnd:nWidth - oOutLook2003:nWidth + 80 ) ) ;
      VALID lExit := .T.

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu
   
   MENU oMenu
      MENUITEM "&One"
      MENUITEM "&Two"
      MENUITEM "&Three"
   ENDMENU
   
return oMenu   

//----------------------------------------------------------------------------//

function BuildDlg()

   local oDlg, oOutL2003
   
   DEFINE DIALOG oDlg RESOURCE "Test"
   
   REDEFINE OUTLOOK2003 oOutL2003 ID 110 OF oDlg ;
      PROMPTS "One", "Two", "Three" ;
      BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp" ;
      DIALOGS "Page1", "Page2", "Page3"

   REDEFINE BUTTON ID 110 OF oOutL2003:aDialogs[ 1 ] ACTION MsgInfo( "Click" )
      
   ACTIVATE DIALOG oDlg CENTERED
   
return nil      

//----------------------------------------------------------------------------//

function WinRun()

   while NoGPF()
      if lExit
         PostQuitMessage( 0 )
      endif   
   end
   
return nil         
                
//----------------------------------------------------------------------------//

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

BOOL SysRefresh( void );

HB_FUNC( NOGPF )
{
   __try
   {
      hb_retl( SysRefresh() );
   }
   __except ( ( hb_retl( TRUE ), TRUE ) )
   {} 
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion