FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Bug ReBar, ToolBar, Menu?
Posts: 205
Joined: Fri Oct 07, 2005 05:07 PM
Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 10:19 AM
Buenas:

Alguien tiene este comportamiento com este ejemplo:



Code (fw): Select all Collapse
#include "FiveWin.ch"

static oToolBar

function Main()

   local oWnd, oImageList, oReBar


   DEFINE WINDOW oWnd TITLE "FWH - Testing Win32 Toolbars" ;
      MENU BuildMenu()

   oReBar   := TReBar():New( oWnd )

   // First we build an ImageList with all the bitmaps
   DEFINE IMAGELIST oImageList SIZE 32, 32

   DEFINE IMGBITMAP OF oImageList NAME "new"      COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "open"     COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "check"    COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "search"   COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "print"    COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "internet" COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "keys"     COLOR nRGB( 255, 0, 255 )
   DEFINE IMGBITMAP OF oImageList NAME "quit"     COLOR nRGB( 255, 0, 255 )

   // Now we create the toolbar and add the buttons

   DEFINE TOOLBAR oToolBar OF oReBar SIZE 50, 58 ; // 50, 50 ;
      IMAGELIST oImageList BALLOON // tooltips balloon style

   oToolBar:SetTextRows( 2 )

   DEFINE TBBUTTON OF oToolBar ;
      ACTION  oToolbar:SetText( 1, "Hello" ) ; // Modify first button text
      TOOLTIP "New" ;
      PROMPT  "&New project" ;
      MESSAGE "New"

   DEFINE TBBUTTON OF oToolBar ;
      ACTION  oToolBar:SetChecked( 2, .t. ) ; // Set pressed the second button
      TOOLTIP "Open" ;
      PROMPT  "Open project" ;
      MESSAGE "Open"

   DEFINE TBSEPARATOR OF oToolBar

   DEFINE TBMENU OF oToolBar ;
      ACTION  MsgInfo( "Menu" ) ;
      TOOLTIP "Menu" ;
      PROMPT  "Menu" ;
      MENU    BuildPopup()

   DEFINE TBBUTTON OF oToolBar ;
      ACTION  oToolBar:SetChecked( 2, .f. ) ; // MsgInfo( "Search" ) ;
      TOOLTIP "Search" ;
      PROMPT  "Search"

   DEFINE TBBUTTON OF oToolBar ;
      ACTION  MsgInfo( "Print" ) ;
      TOOLTIP "Print a report" ;
      PROMPT  "Print a report"

   DEFINE TBSEPARATOR OF oToolBar

   DEFINE TBBUTTON OF oToolBar ;
      ACTION  MsgInfo( "Upgrade" ) ;
      TOOLTIP "Search for new versions" ;
      PROMPT  "Upgrade"

   DEFINE TBBUTTON OF oToolBar ;
      ACTION MsgInfo( "Users" ) ;
      TOOLTIP "Users management" ;
      PROMPT "Users"

   DEFINE TBSEPARATOR OF oToolBar

   DEFINE TBBUTTON OF oToolBar ;
      ACTION  oWnd:End() ;
      TOOLTIP "End Application" ;
      PROMPT  "Exit"

      oReBar:InsertBand( oToolBar )

   DEFINE STATUSBAR OF oWnd PROMPT "Toolbars test"

   ACTIVATE WINDOW oWnd MAXIMIZED

   oImageList:End()

return nil

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "&Project"
      MENU
         MENUITEM "&New..." ACTION MsgInfo( "New" ) MESSAGE "New"
         MENUITEM "&Open..." ACTION MsgInfo( "Open" ) MESSAGE "Open"
         SEPARATOR
         MENUITEM "&Exit..." ACTION MsgInfo( "End" ) MESSAGE "Exit"
      ENDMENU

      MENUITEM "&Edit"
      MENU
         MENUITEM "&Search..." ACTION MsgInfo( "Search" )
         MENUITEM "&Print..." ACTION MsgInfo( "Print" )
      ENDMENU

      MENUITEM "&Utilities"
      MENU
         MENUITEM "&Disable button..." ACTION oToolBar:EnableButton( 3, .f. )
         MENUITEM "&Enable button..." ACTION oToolBar:EnableButton( 3, .t. )
      ENDMENU
   ENDMENU

return oMenu

function BuildPopup()

   local oMenu

   MENU oMenu POPUP
      MENUITEM "One"   ACTION MsgInfo( "One" )
      MENUITEM "Two"   ACTION MsgInfo( "Two" )
      MENUITEM "Three" ACTION MsgInfo( "Three" )
   ENDMENU

return oMenu

procedure AppSys // XBase++ requirement

return
Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 10:38 AM
Qué version de SO utilizas?
Qué versión de Fw ?

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: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 10:42 AM

Versão 15.07, windows7 e XP.

En el ejemplo (es un ejemplo modificado) de arriba hay una linea
oReBar := TReBar():New( oWnd )

Es insertado un toolbar dentro de un Rebar.

c.

Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 11:00 AM
He utilizado tu ejemplo
Con la version 15.09
Una pregunta, has incluido en el .rc ?
Code (fw): Select all Collapse
#ifdef __FLAT__
   1 24 "./WinXP/WindowsXP.Manifest"
#endif

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif


Voy a probar con la version 15.07
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: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 01:41 PM
Buenas Navarros

El ejemplo es un ejemplo modificado de la pasta de samples de fw, solo hemos hecho estas modificaciones

Code (fw): Select all Collapse
   oReBar   := TReBar():New( oWnd )
..
  //definimos el toolbar com rebar
   DEFINE TOOLBAR oToolBar OF oReBar SIZE 50, 58 ; // 50, 50 ;
      IMAGELIST oImageList BALLOON // tooltips balloon style

...
  //insertamos el Toolbar
  oReBar:InsertBand( oToolBar )


Em fwh1501 funciona bien.
Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 03:01 PM
Buenas Cristobal

Ya que no podemos ver los fuentes de la function: TrackPopupMenu(..)

Agregando esto en la clase TMenu, me funciona correctamente
Code (fw): Select all Collapse
//----------------------------------------------------------------------------//

METHOD Activate( nRow, nCol, oWnd, lEnd, nFlags ) CLASS TMenu
   local aPoint := { nRow, nCol }

   DEFAULT lEnd := .t., nFlags := 0
   //ROS fwh.1507
   If oWnd:ClassName() == 'TREBAR'
      oWnd := oWnd:oWnd
   Endif
   //

Saludos.
Saludos/regards

RenOmaS



skype: americo.balboa
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Sun Nov 29, 2015 10:54 PM

Hola,
Como he comentado, la imagen que he puesto la he obtenido con el source que has puesto en el foro, no con el original de samples
Esa modificacion que propones en la clase no la tengo incluida en la version 15.09 y funciona correctamente
Lo investigaré de todas formas

Saludos

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: 205
Joined: Fri Oct 07, 2005 05:07 PM
Re: Bug ReBar, ToolBar, Menu?
Posted: Mon Nov 30, 2015 12:27 PM

Gracias.

Saludos/regards

RenOmaS



skype: americo.balboa

Continue the discussion