Bug em Rebar com Panel?

Post Reply
User avatar
RenOmaS
Posts: 205
Joined: Fri Oct 07, 2005 5:07 pm

Bug em Rebar com Panel?

Post 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
Last edited by RenOmaS on Mon May 16, 2016 8:15 pm, edited 1 time in total.
Saludos/regards
RenOmaS

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

Re: Bug em Rebar com Panel?

Post 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?
Saludos/regards
RenOmaS

skype: americo.balboa
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Bug em Rebar com Panel?

Post 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
 
João Santos - São Paulo - Brasil
Post Reply