Bug ReBar, ToolBar, Menu?

Bug ReBar, ToolBar, Menu?

Postby RenOmaS » Sun Nov 29, 2015 10:19 am

Buenas:

Alguien tiene este comportamiento com este ejemplo:

Image

Code: Select all  Expand view
#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
User avatar
RenOmaS
 
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm

Re: Bug ReBar, ToolBar, Menu?

Postby cnavarro » Sun Nov 29, 2015 10:38 am

Qué version de SO utilizas?
Qué versión de Fw ?

Image
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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug ReBar, ToolBar, Menu?

Postby RenOmaS » 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
User avatar
RenOmaS
 
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm

Re: Bug ReBar, ToolBar, Menu?

Postby cnavarro » Sun Nov 29, 2015 11:00 am

He utilizado tu ejemplo
Con la version 15.09
Una pregunta, has incluido en el .rc ?
Code: Select all  Expand view


#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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug ReBar, ToolBar, Menu?

Postby RenOmaS » Sun Nov 29, 2015 1:41 pm

Buenas Navarros

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

Code: Select all  Expand view

   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
User avatar
RenOmaS
 
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm

Re: Bug ReBar, ToolBar, Menu?

Postby RenOmaS » Sun Nov 29, 2015 3: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: Select all  Expand view
//----------------------------------------------------------------------------//

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
User avatar
RenOmaS
 
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm

Re: Bug ReBar, ToolBar, Menu?

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Bug ReBar, ToolBar, Menu?

Postby RenOmaS » Mon Nov 30, 2015 12:27 pm

Gracias.
Saludos/regards
RenOmaS

skype: americo.balboa
User avatar
RenOmaS
 
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm


Return to FiveWin para Harbour/xHarbour

Who is online

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