Page 1 of 1

Bug em Rebar com Panel?

Posted: Mon May 16, 2016 7:45 pm
by RenOmaS
Buenas

En este ejemplo, da error al querer pintar el Panel da segunda banda del Rebar.

Code: Select all

#include "FiveWin.ch"

function Main()

   local oWnd, oReBar, oToolBar, oPanel, oBtn1, oFolder, oToolBar2
   local oImageList, oHand

   DEFINE WINDOW oWnd TITLE "Testing rebars and toolbars" ;
      MENU BuildMenu()

   DEFINE CURSOR oHand RESOURCE "hand"

   oReBar = TReBar():New( oWnd )

   oPanel := TPanel():New( 0, 0, 35, 300, oReBar )

   oReBar:InsertBand( oPanel )

   oPanel := TPanel():New( 0, 0, 45, 300, oReBar )

   oReBar:InsertBand( oPanel )

   DEFINE STATUSBAR OF oWnd PROMPT "Rebars and Toolbars test"

   ACTIVATE WINDOW oWnd MAXIMIZED

   oImageList:End()

return nil

Re: Bug em Rebar com Panel?

Posted: Mon May 16, 2016 8:14 pm
by RenOmaS
Buenas

Si modificamos la Tpanel en el metodo Paint

Code: Select all

METHOD Paint() CLASS TPanel

   local nTop, nLeft, nHeight, nWidth, nBevel
   local aInfo := ::DispBegin()

   If ::oBrush != Nil //ROS
   FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
   EndIf //ROS
...
 
Se pinta de esta manera.
Image

Como se puede pintar el Panel de forma transparente?

Re: Bug em Rebar com Panel?

Posted: Mon May 16, 2016 8:16 pm
by karinha

Code: Select all

#include "FiveWin.ch"

function Main()

   local oWnd, oReBar, oToolBar, oPanel, oBtn1, oFolder, oToolBar2
   local oImageList, oHand

   DEFINE WINDOW oWnd TITLE "Testing rebars and toolbars" ;
      MENU BuildMenu()

   DEFINE CURSOR oHand RESOURCE "hand"

   oReBar = TReBar():New( oWnd )

   oPanel := TPanel():New( 0, 0, 75, 300, oReBar )

   oImageList = TImageList():New()

   oImageList:AddMasked( TBitmap():Define( , "..\bitmaps\16x16\new2.bmp", oWnd ),;
                         nRGB( 255, 0, 255 ) )    
   oImageList:AddMasked( TBitmap():Define( , "..\bitmaps\16x16\open2.bmp", oWnd ),;
                         nRGB( 255, 0, 255 ) )    
   
   oImageList:Add( TBitmap():Define( , "..\bitmaps\16x16\icon.bmp", oWnd ),;
                   TBitmap():Define( , "..\bitmaps\16x16\icoMask.bmp", oWnd ) )

   oToolBar = TToolBar():New( oPanel, 33, 33, oImageList )
   oToolBar:nLeft = 5
   oToolBar:AddButton( { || MsgInfo( "New" ) }, "New" ) // , "new file" )
   oToolBar:AddButton( { || MsgInfo( "Open" ) }, "Open" )
   oToolBar:AddButton( { || MsgInfo( "three" ) }, "three" )
   oToolBar:AddSeparator()
   oToolBar:AddButton( { || MsgInfo( "four" ) }, "four" )
   oToolBar:oCursor = oHand 

   oReBar:InsertBand( oPanel )

   /*
   @ 10, 2 FOLDER oFolder PROMPTS "One", "Two", "Three" SIZE 400, 62

   oToolBar2 = TToolBar():New( oFolder:aDialogs[ 1 ],,, oImageList )
   oToolBar2:AddButton( { || MsgInfo( "pointer" ) }, "pointer" )
   oToolBar2:AddSeparator()
   oToolBar2:AddButton( ,"label" )
   oToolBar2:AddButton( ,"button" )

   oReBar:InsertBand( oFolder )
   */

   DEFINE STATUSBAR OF oWnd PROMPT "Rebars and Toolbars test"

   ACTIVATE WINDOW oWnd MAXIMIZED
   
   oImageList:End()

return nil

FUNCTION BuildMenu()

   LOCAL oMenu

   MENU oMenu
      MENUITEM "&File"
      MENU
         MENUITEM "&New..." ACTION MsgInfo( "Hello" )
      ENDMENU
   ENDMENU

RETURN oMenu