FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour problemas con TPanel en una ventana
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
problemas con TPanel en una ventana
Posted: Thu Sep 05, 2013 05:06 PM
Quiero poner un panel en una ventana, pero no aparece nada. Aqu铆 el c贸digo

Code (fw): Select all Collapse
聽 聽 Define Font oFont1 Name 'Arial' 聽Size 0, 10
聽 聽 Define Font oFont2 Name 'Tahoma' Size 0, -9 Bold
聽 聽 
聽 聽 Define Window oWndDeduc From 50, 50 To 500, 800 Pixel //NoSysMenu NoZoom

聽 聽 聽 聽 oPanel := TPanel() : New( 50, 20, 50, 300, oWndDeduc  )
聽 聽 聽 聽 //@ 250, 0 Splitter oSplit Horizontal Size 750, 2 Of oWndDeduc Pixel 
聽 聽 
聽 聽 Activate Window oWndDeduc On Init( SetWindowPos( oWndDeduc : hWnd, -1, 0, 0, 0, 0, 3 ) )

Alguna idea ?? desde ya muchas gracias.
Saludos
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: problemas con TPanel en una ventana
Posted: Thu Sep 05, 2013 05:35 PM
horacio wrote:Quiero poner un panel en una ventana, pero no aparece nada. Aqu铆 el c贸digo

Code (fw): Select all Collapse
聽 聽 Define Font oFont1 Name 'Arial' 聽Size 0, 10
聽 聽 Define Font oFont2 Name 'Tahoma' Size 0, -9 Bold
聽 聽 
聽 聽 Define Window oWndDeduc From 50, 50 To 500, 800 Pixel //NoSysMenu NoZoom

聽 聽 聽 聽 oPanel := TPanel() : New( 50, 20, 50, 300, oWndDeduc 聽)
聽 聽 聽 聽 //@ 250, 0 Splitter oSplit Horizontal Size 750, 2 Of oWndDeduc Pixel 
聽 聽 
聽 聽 Activate Window oWndDeduc On Init( SetWindowPos( oWndDeduc : hWnd, -1, 0, 0, 0, 0, 3 ) )

Alguna idea ?? desde ya muchas gracias.
Saludos



Horacio, prueba asi:

Code (fw): Select all Collapse
oPanel := TPanel() : New( 50, 20, 50, 300, oWndDeduc:oWndClient )
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: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: problemas con TPanel en una ventana
Posted: Thu Sep 05, 2013 05:47 PM
Gracias Cristobal por responder, no funciona con esa modificaci贸n. Este es el error que arroja

Code (fw): Select all Collapse
Application
===========
   Path and name: C:\sipep_sql\SIPEP.EXE (32 bits)
   Size: 3,233,280 bytes
   Compiler version: Harbour 3.1.0dev (Rev. 17222)
   FiveWin  Version: FWH 12.03
   Windows version: 5.1, Build 2600 Service Pack 2

   Time from start: 0 hours 0 mins 3 secs 
   Error occurred at: 06/09/2013, 14:45:23
   Error description: Error BASE/1004  Message not found: TWINDOW:OWNDCLIENT
   Args:
     [   1] = O   TWINDOW

Stack Calls
===========
   Called from:  => __ERRRT_SBASE( 0 )
   Called from: ../../../tobject.prg => TWINDOW:ERROR( 0 )
   Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
   Called from: ../../../tobject.prg => TWINDOW:MSGNOTFOUND( 0 )
   Called from: ../../../tobject.prg => TWINDOW:OWNDCLIENT( 0 )
   Called from: C:\sipep_sql\PADRON.PRG => CAJAINGRESODEDUCCIONES( 1270 )
   Called from: C:\sipep_sql\PADRON.PRG => (b)INICIA( 131 )
   Called from: C:\sipep_sql\trbtn.prg => TRBTN:CLICK( 676 )
   Called from: C:\sipep_sql\trbtn.prg => TRBTN:LBUTTONUP( 855 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
   Called from: C:\sipep_sql\trbtn.prg => TRBTN:HANDLEEVENT( 1521 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 980 )
   Called from: C:\sipep_sql\Sipep.prg => EMPIEZA( 200 )
   Called from: C:\sipep_sql\Sipep.prg => MAIN( 20 )

Saludos
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: problemas con TPanel en una ventana
Posted: Thu Sep 05, 2013 05:53 PM

Horacio
Claro, no me he dado cuenta que lo que te he dicho es para ventanas MDI

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: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: problemas con TPanel en una ventana
Posted: Fri Sep 06, 2013 12:49 AM
Hola Horacio, te comento que yo acostumbro a pintar el panel para darme cuenta de las dimensiones del mismo.
Code (fw): Select all Collapse
#include "FIVEWIN.ch"

Function main()
聽 聽 LOCAL oWndDeduc, oFont1, oFont2, oPanel
聽 聽 Define Font oFont1 Name 'Arial' 聽Size 0, 10
聽 聽 Define Font oFont2 Name 'Tahoma' Size 0, -9 Bold

聽 聽 Define Window oWndDeduc From 50, 50 To 500, 800 Pixel //NoSysMenu NoZoom

聽 聽 聽 聽 聽 聽oPanel := TPanel():New( 50, 20, 100, 300, oWndDeduc 聽)
聽 聽 聽 聽 聽 聽oPanel:SetColor( "N/B" )

聽 聽 Activate Window oWndDeduc On Init( SetWindowPos( oWndDeduc : hWnd, -1, 0, 0, 0, 0, 3 ) )

Return nil


Saludos
Marcelo
FWH - Harbour - BCC7 - PellesC
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: problemas con TPanel en una ventana
Posted: Fri Sep 06, 2013 01:35 PM

Gracias Marcelo por tu respuesta, era eso. Supuse que me mostrar铆a un borde, pero nop. Nuevamente gracias.

Saludos

Posts: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: problemas con TPanel en una ventana
Posted: Fri Sep 06, 2013 01:39 PM

Por nada Horacio, despu茅s una vez que te das cuenta de que dibujaste el panel que querias, le sacas el color de fondo y le podes poner una imagen de fondo.
Saludos
Marcelo

FWH - Harbour - BCC7 - PellesC

Continue the discussion