Ventanas Mdi y MdiChild

Ventanas Mdi y MdiChild

Postby Loren » Thu Oct 16, 2008 9: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:
Code: Select all  Expand view
        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:
Image

A la espera de respuestas y sugerencias, saluda
Lorenzo
Desde Cádiz
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41864
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Loren » 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
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España

Postby Antonio Linares » Thu Oct 16, 2008 10:46 am

Lorenzo,

Prueba este ejemplo:
Code: Select all  Expand view
// 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41864
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests