FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Problema con ReBar
Posts: 126
Joined: Fri Oct 07, 2005 04:20 PM
Problema con ReBar
Posted: Fri Feb 02, 2007 05:55 PM
Hola... :-)

Tengo el siguiente problema, cuando minimizo la ventana pricipal que tiene una ReBar sucede lo siguiente:

Esta imagen es cuando se inicia la 谩plicaci贸n.
[img]http://img119.imageshack.us/img119/19/error1dc9.jpg" alt="" loading="lazy">
[/img]

y esta despues de minimizar la aplicaci贸n.
[img]http://img109.imageshack.us/img109/1130/error2af5.jpg" alt="" loading="lazy">
[/img]

Como veran hace un espacio entre la ReBar y el Browse como si hubiera otra Rebar insertada.

Este es el codigo:
      DEFINE IMAGELIST ::oImageList SIZE 32, 32

             ::oImageList:AddMasked( TBitmap():Define( "Capturas",, ::oWndMain ), nRGB( 255, 0, 255 ) )
             ::oImageList:AddMasked( TBitmap():Define( "Bus",, ::oWndMain ), nRGB( 255, 0, 255  ) )
             ::oImageList:AddMasked( TBitmap():Define( "Rutas",, ::oWndMain ), nRGB( 255, 0, 255 ) )

      DEFINE IMAGELIST ::oImageList2 SIZE 32, 32

             ::oImageList2:AddMasked( TBitmap():Define( "Index",, ::oWndMain ), nRGB( 255, 0, 255 ) )
             ::oImageList2:AddMasked( TBitmap():Define( "Import",, ::oWndMain ), nRGB( 255, 0, 255  ) )

      DEFINE IMAGELIST ::oImageList3 SIZE 32, 32

             ::oImageList3:AddMasked( TBitmap():Define( "Respaldo",, ::oWndMain ), nRGB( 255, 0, 255 ) )
             ::oImageList3:AddMasked( TBitmap():Define( "Restaura",, ::oWndMain ), nRGB( 255, 0, 255 ) )

      DEFINE IMAGELIST ::oImageList4 SIZE 32, 32

             ::oImageList4:AddMasked( TBitmap():Define( "Salir",, ::oWndMain ), nRGB( 255, 0, 255 ) )


      ::oReBar  := TReBar():New( ::oWndMain )

      DEFINE TOOLBAR ::oBar OF ::oReBar SIZE 40, 40 IMAGELIST ::oImageList BALLOON

             DEFINE TBBUTTON OF ::oBar ;
                    ACTION  Captura()  ;
                    TOOLTIP i18n( "Capturas" ) ;
                    MESSAGE i18n( "Gesti贸n de Capturas de Ingresos y Egresos." )

             DEFINE TBBUTTON OF ::oBar ;
                    ACTION  Unidades() ;
                    TOOLTIP i18n( "Unidades" ) ;
                    MESSAGE i18n( "Flotilla de Unidades." )

             DEFINE TBBUTTON OF ::oBar ;
                    ACTION  Rutas()    ;
                    TOOLTIP i18n( "Rutas" )  ;
                    MESSAGE i18n( "Cat谩lago de Rutas." )


	DEFINE TOOLBAR ::oBar2 OF ::oReBar SIZE 40, 40 IMAGELIST ::oImageList2 BALLOON

             DEFINE TBBUTTON OF ::oBar2 ;
                    ACTION  Indices(.F., cEmpresa) ;
                    TOOLTIP i18n( "Verificar Archivos" ) ;
                    MESSAGE i18n( "Verificaci贸n de los Archivos del Sistema." )

             DEFINE TBBUTTON OF ::oBar2 ;
                    ACTION  ImporDatos() ;
                    TOOLTIP i18n( "Importaciones de Datos" ) ;
                    MESSAGE i18n( "Importaci贸n de Datos Externos." )


	DEFINE TOOLBAR ::oBar3 OF ::oReBar SIZE 40, 40 IMAGELIST ::oImageList3 BALLOON

             DEFINE TBBUTTON OF ::oBar3 ;
                    ACTION  Respaldo()    ;
                    TOOLTIP i18n( "Respaldo de Archivos" ) ;
                    MESSAGE i18n( "Respaldo de los Archivos del Sistema." )

             DEFINE TBBUTTON OF ::oBar3 ;
                   TOOLTIP i18n(AnsiToOem("Restauraci贸n de Archivos")
                   MESSAGE i18n( "Restaurar un Respaldo de los Archivos del Sistema." )


	DEFINE TOOLBAR ::oBar4 OF ::oReBar SIZE 40, 40 IMAGELIST ::oImageList4 BALLOON

             DEFINE TBBUTTON OF ::oBar4 ;
                    ACTION  ::ExitFromBtn() ;
                   TOOLTIP i18n( "Salir del Sistema" ) ;
                   MESSAGE i18n( "Finalizar el uso del Sistema." )

        ::oBar:nWidth   := 110
        ::oBar2:nWidth  :=  80
        ::oBar3:nWidth  :=  80
        ::oBar4:nWidth  := 330

        ::oReBar:InsertBand( ::oBar )
        ::oReBar:InsertBand( ::oBar2 )
        ::oReBar:InsertBand( ::oBar3 )
        ::oReBar:InsertBand( ::oBar4 )


Alguien le ha sucedido lo mismo o me podrian decir cual es mi error.

Saludos
Marco A. Delgado.
Posts: 244
Joined: Fri Oct 28, 2005 06:29 PM
.
Posted: Fri Feb 02, 2007 06:00 PM

Yo uso las rebars con tsbrowse y no tengo esos problemas,

Tienes puesto oWnd:SetControl( oBrw ) ?

Lo he colocado en la cl谩usula "on paint" al activar la ventana.

Salu2
Alejandro.

Alejandro Cebolido

Buenos Aires, Argentina
Posts: 126
Joined: Fri Oct 07, 2005 04:20 PM
Problema con ReBar
Posted: Fri Feb 02, 2007 06:11 PM

Hola

Estoy de acuerdo contigo, pero el browse (que es xBrowse) lo coloco sobre una ventana hija, la rebar esta sobre la ventana principal.

Saludos
Marco A. Delgado

Posts: 126
Joined: Fri Oct 07, 2005 04:20 PM
Problema con ReBar
Posted: Fri Feb 02, 2007 06:59 PM
Hola.

Siguiendo con el problema, ahora cuando le doy click al boton de restaurar de la ventana principal (MDI) sucede esto:

[img]http://img164.imageshack.us/img164/1480/error3rh2.jpg" alt="" loading="lazy">
[/img]

Como veran el error se corrige, pero la vuelvo a minimizar y restaurar, vuelve a suceder lo mismo:
[img]http://img119.imageshack.us/img119/7025/error4lu8.jpg" alt="" loading="lazy">
[/img]

Ahora maximizo la ventana y se corrige el problema.
[img]http://img109.imageshack.us/img109/4899/error5qg5.jpg" alt="" loading="lazy">
[/img]

Hay algun problema con las ventanas MDI y MDICHILD, ahora cambiando la ReBar por la Barra de Botones normales o la TSBAR, no sucede nada de esto solo con la Rebar, que es lo que estoy haciendo mal.


Saludos
Marco A. Delgado
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problema con ReBar
Posted: Sat Feb 03, 2007 09:29 AM

Marco,

Prueba esto:

::oReBar := TReBar():New( ::oWndMain )
::oReBar:nHeight = 40
...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 126
Joined: Fri Oct 07, 2005 04:20 PM
Problema con ReBar
Posted: Sat Feb 03, 2007 06:53 PM

Hola Antonio.

Gracias por responder, pero no funciona tu ejemplo, el error con la ReBar solo se da si son mas de 2 TOOLBAR dentro de la Rebar.

Saludos

Marco A. Delgado.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problema con ReBar
Posted: Sat Feb 03, 2007 08:35 PM

Marco,

Prueba a modificar el dato nTop del browse:

oBrw:nTop = oReBar:nHeight + 1

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 189
Joined: Wed Apr 05, 2006 09:48 PM
Problema con ReBar
Posted: Sun Feb 04, 2007 06:00 PM

El fallo no esta en la rebar es del xbrowse, algun hdc o algo va mal, cambialo por un twbrowse y veras como te funciona perfecto.

Posts: 126
Joined: Fri Oct 07, 2005 04:20 PM
Problema con ReBar
Posted: Mon Feb 05, 2007 06:33 PM

Ok, tal vez tengas razon, Frafive

Pero con solo poner una sola ToolBar en la ReBar, funciona perfectamente.

Seguire buscando, gracias a Todos por su ayuda, checare lo que me dice Antonio y ver si funciona.

Saludos.
Marco A. Delgado.

Posts: 214
Joined: Sat Aug 19, 2006 01:37 PM
Problema con ReBar
Posted: Wed Feb 14, 2007 06:08 PM

Buenas..

EStimado Marco,, encontraste la solucion a tu problema ,, ya q a mi me paso lo mismo

si es asi... me comentas

GRACIAS

Mi segundo amor es Programar
Posts: 126
Joined: Fri Oct 07, 2005 04:20 PM
Problema con ReBar
Posted: Thu Feb 15, 2007 03:32 PM

Hola A&C (la verdad...no se como te llamas)... :D

No lo he resuelto... aun...!! lo que hice es solo poner una toolbar y asi no hay problema.

Saludos
Marco A. Delgado.

Posts: 34
Joined: Tue Dec 30, 2008 07:22 PM
Re: Problema con ReBar
Posted: Mon Mar 01, 2010 11:04 PM
Alguien resolvi贸 este problema ?. A mi me ocurre s贸lo en la ventana principal, en las ventanas childs no ocurre lo mismo.

Al iniciar la aplicaci贸n, la toolbar y el fondo de la ventana se ven as铆:


Si se minimiza la aplicaci贸n, al restaurarla se ve as铆:


Es curioso porque en la ventana principal, si la redimensionas a su tama帽o se corrige el efecto y pinta el fondo de la venta principal correctamente.


Es un problema de la toolbar o es un problema de la ventana ?.

el c贸digo es :
Code (fw): Select all Collapse
 聽 DEFINE WINDOW oWinMain 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 FROM 0, 0 TO 24, 79 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 COLOR "W+/W" 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 TITLE 聽CompName() 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 MENU 聽 MainMenu() 聽 聽 聽 聽 聽 聽 聽 聽 聽;
聽 聽 聽 聽 聽 ICON 聽 oIcon 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 MDI menuinfo 4


// Barra de Botones ToolBar

聽 聽// First we build the imagelists with all the bitmaps
聽 聽DEFINE IMAGELIST oImgList1 SIZE 32, 32

聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_16" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_29" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_28" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_31" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_39" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_25" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_14" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_19" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_23" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_61" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_1" 聽 COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_40" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_70" 聽COLOR nRGB( 255, 0, 255 )
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_2" 聽COLOR nRGB( 255, 0, 255 ) 聽 // Tipo colab
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_59" 聽COLOR nRGB( 255, 0, 255 ) 聽 // Modopago
聽 聽DEFINE IMGBITMAP OF oImgList1 NAME "BITMAP_53" 聽COLOR nRGB( 255, 0, 255 ) 聽 // Peripago

聽 聽// Now we create the rebar
聽 聽DEFINE REBAR oReBar OF oWinMain

聽 聽// Now we create the toolbars and add the buttons
聽 聽DEFINE TOOLBAR oToolBar1 OF oReBar SIZE 37, 37 ;
聽 聽 聽 IMAGELIST oImgList1 //BALLOON


聽 聽// Now we create the toolbars2 without images, only for see the init picture in the bar
聽 聽DEFINE TOOLBAR oToolBar2 OF oReBar SIZE 0, 0

聽 聽//oToolBar2:lTransparent:=.T.
聽 聽//oToolBar1:nHeight -= 2
聽 聽//oToolBar2:nHeight -= 2


聽 聽 // We set the widths for each toolbar
聽 聽oToolBar1:nWidth =550
聽 聽oToolBar2:nWidth = 1

聽 聽// Now we insert the toolbars into the rebar
聽 聽oReBar:InsertBand( oToolBar1 )
聽 聽oReBar:InsertBand( oToolBar2 )


聽 聽// Definimos los botones
聽 聽DEFINE TBBUTTON OF oToolBar1 聽 ;
聽 聽 聽 ACTION 聽oWinMain:End() 聽 聽 聽;
聽 聽 聽 TOOLTIP "Cerrar aplicaci贸n"

聽 聽DEFINE TBSEPARATOR OF oToolBar1

聽 聽DEFINE TBBUTTON OF oToolBar1 聽 ;
聽 聽 聽 ACTION 聽paramgen( oWinMain ) 聽 聽 聽 聽;
聽 聽 聽 TOOLTIP "Par谩metros,"+chr(13)+"Configuraci贸n del sistema."

聽 聽DEFINE TBBUTTON OF oToolBar1 聽 ;
聽 聽 聽 ACTION 聽TipOfDay( ".\ASOCW.ini" ) 聽 ;
聽 聽 聽 TOOLTIP "Notas de ayuda r谩pidas"

聽 聽DEFINE TBBUTTON OF oToolBar1 聽 ;
聽 聽 聽 ACTION 聽HelpIndex() 聽 聽 聽 聽 聽 ;
聽 聽 聽 TOOLTIP "Indice de la Ayuda"
...

聽 ACTIVATE WINDOW oWinMain MAXIMIZED;
聽 聽 聽 聽 聽 ON INIT ( TipOfDay( ".\Asocw.ini" ) );
聽 聽 聽 聽 聽 ON PAINT (FillWnd( oWinmain:oWndClient, nColor, oBmpTiled, 7 ), oRebar:Refresh() );
聽 聽 聽 聽 聽 ON RIGHT CLICK ( nColor := ChooseColor(),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽IF(nColor<>0,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 FillWnd( oWinmain:oWndClient, nColor, oBmpTiled, 7 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 FillWnd( oWinmain:oWndClient, nColor:=nRGB( 230, 247, 255), oBmpTiled, 7 ) ) 聽);
聽 聽 聽 聽 聽 VALID ( 聽__ExitMsg() )

聽 oImgList1:End()

RETURN ( NIL )
Pedro

FWH9.06 / XMate 1.15 / Borland C++ 5.5.1 / xHarbour build 1.1.0 Intl. (SimpLex) (Rev. 6195)
Posts: 408
Joined: Fri Jan 29, 2010 08:14 PM
Re: Problema con ReBar
Posted: Tue Mar 02, 2010 02:36 PM

Hola a todos:

Acabo de probarlo y a mi no me sucede eso, defino la barra de esta forma:

/------------------------------------------------------------------------------/
Function FrameBar( oWnd )
/------------------------------------------------------------------------------/
LOCAL oCursor, nFor

 DEFINE CURSOR oCursor HAND

 DEFINE BUTTONBAR oBar _3D SIZE 45, 45 OF oWnd

 DEFINE BUTTON RESOURCE &quot;MenuP_Tablas&quot; OF oBar NOBORDER;
        TOOLTIP &quot;Tablas&quot;;
        MENU BuildPopup()

 DEFINE BUTTON RESOURCE &quot;MenuP_Indexar&quot; OF oBar NOBORDER;
        TOOLTIP &quot;Ordena Bases de Datos&quot;;
        ACTION ( CreaIndices( oWnd ) )

 DEFINE BUTTON RESOURCE &quot;BotonSalir&quot; OF oBar NOBORDER;
        TOOLTIP &quot;Salir del Programa&quot; ACTION Salir()

 oBar:bRClicked := {|| NIL }
 oWnd:lBalloon  := .T.

 FOR nFor := 1 TO len(oBar:aControls)
     oBar:aControls[nFor]:oCursor := oCursor
     SysRefresh()
 NEXT

Return( oBar )

Un saludo
JLL

Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
Posts: 34
Joined: Tue Dec 30, 2008 07:22 PM
Re: Problema con ReBar
Posted: Tue Mar 02, 2010 05:46 PM

Hola JLL,
el tema es que no estamos hablando de buttonbar sino de toolbar, es m谩s, hablamos de 2 toolbars en la ventana principal.

Saludos!

Pedro

FWH9.06 / XMate 1.15 / Borland C++ 5.5.1 / xHarbour build 1.1.0 Intl. (SimpLex) (Rev. 6195)
Posts: 408
Joined: Fri Jan 29, 2010 08:14 PM
Re: Problema con ReBar
Posted: Tue Mar 02, 2010 07:26 PM

Hola PedroG:

Perdon, copie la funcion que no era. Pero efectivamente con 2 o mas tiene el comportamiento que se comenta, pero en cambio con una solo no. Esto tendria que verificarlo antonio, ya que es un bug de la clase.

Intentare esta noche hacer algunas pruebas mas a ver.

Un saludo
JLL

Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com