tFolderex and tGroup control

tFolderex and tGroup control

Postby chiaiese » Wed Sep 13, 2023 11:36 pm

Hello,
I put a tGroup control in a tFolderEx tab and I get a 'dirty' behavior when changing tabs with animation

please compile the sample file testfx1.prg with the line added below, then switch between tabs "setting" and "exit" and see the result

Code: Select all  Expand view  RUN

   oFld:aDialogs[ 2 ]:SetBrush( oBrush2 )
   oCtrl := TGroup():New(2,2,5,30,"tGroup() class",oFld:aDialogs[ 7 ],,,.f.,,,.t.)  // this line added: tGroup control
   @ 3,3 SAY "UNDER CONSTRUCTION" OF oFld:aDialogs[ 7 ] TRANSPARENT
 


I have FWin 20.02
best regards
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: tFolderex and tGroup control

Postby chiaiese » Thu Sep 14, 2023 3:33 pm

Hi,
anybody knows how to solve this issue?

thank you
Roberto Chiaiese
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: tFolderex and tGroup control

Postby karinha » Thu Sep 14, 2023 3:48 pm

Code: Select all  Expand view  RUN

   @ 3,3 SAY "UNDER CONSTRUCTION" OF oFld:aDialogs[ 7 ] TRANSPARENT

   @ 080, 10 GROUP oGroup TO 160, 248 LABEL "UNDER" OF oFld:aDialogs[ 7 ] PIXEL ;
      TRANSPARENT
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: tFolderex and tGroup control

Postby chiaiese » Mon Sep 25, 2023 11:12 pm

Hi Karinha,
the problem is still there. Only the position changes but the tGroup control appears as a five-cells grid and the "under" caption repeated 5 times. (I don't know how to upload an image here)
Just removing the 'animate speed 50' clause makes it working good

regards
Roberto
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: tFolderex and tGroup control

Postby nageswaragunupudi » Tue Sep 26, 2023 11:47 am

Just removing the 'animate speed 50' clause makes it working good

Thanks
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: tFolderex and tGroup control

Postby chiaiese » Mon Oct 02, 2023 4:52 pm

.OR.
you have to set the tGroup control transparent off and set the right back color,
this works for me:

Code: Select all  Expand view  RUN

oCtrl := TGroup():New(2,2,5,30,"tGroup class()",oFld:aDialogs[ 7 ],,CLR_WHITE,.f.,,,.f.)    // this line added: tGroup control
 


regards
Roberto
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: tFolderex and tGroup control

Postby karinha » Mon Oct 02, 2023 5:42 pm

I'm sorry, but I can't understand what you mean. Show me the program below, please.

Lo siento, pero no puedo entender lo que quieres decir. Muéstrame el programa a continuación, por favor.

Code: Select all  Expand view  RUN

// C:\FWH..\SAMPLES\TESTFX1.PRG

#include "FiveWin.ch"
#include "xbrowse.ch"
#include "gif.ch"

function main()

   local oWnd, i, oBrw, oBrush2, oCtrl, oGroup
   local oFld, oFld1, aList
   local aMonths := {"January", "February", "March", ;
                     "April", "May", "June", ;
                     "July", "August", "September", ;
                     "October", "November", "December"}
   local aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp",;
                      "..\bitmaps\alphabmp\windows.bmp",;
                      "..\bitmaps\alphabmp\game.bmp",;
                      "..\bitmaps\alphabmp\viddler.bmp",;
                      "..\bitmaps\alphabmp\mail.bmp",;
                      "..\bitmaps\alphabmp\call.bmp",;
                      "..\bitmaps\alphabmp\settings2.bmp",;
                      "..\bitmaps\alphabmp\exit.bmp" }
                     
   DEFINE BRUSH oBrush2 FILE "..\bitmaps\backgrnd\metal.bmp"                      
   
    DEFINE WINDOW oWnd TITLE "TFolderex - Testing -"
     
   @ 3, 3 FOLDEREX oFld PIXEL ADJUST;
          PROMPT  "&Social1", "&OS2", "&Games3", "&Movies4", "&Email5", "Mo&nths6", "Se&tting7", "E&xit";
          BITMAPS aBitmaps;
          ACTION( If( nOption == 8, oWnd:End(), ;
                     MsgInfo( "Action defined to " + StrTran( ::aPrompts[ nOption ], "&", "" ) ) ) );
          ON PAINT TAB PaintTab( Self, nOption );
          POPUP MenuTabs( Self, nOption );
          ON CHANGE ( If( nOption == 8, If( MsgYesNo( "Do you want exit??" ), ;
                                           oWnd:End(), ( ::SetOption( nOldOption ), ::Refresh() ) ), ) );
          ON PAINT TEXT( If( nOption == ::nOption .and. nOption == 2, CLR_YELLOW, CLR_BLACK ) );
          TOP OPTION 2 ALIGN  AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_RIGHT;
          ANIMATE SPEED 50
         
   oFld:SetBrightBmp( "..\bitmaps\alphabmp\exit2.bmp", 8 )  
   
   //Dialog Social
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 1 ] PIXEL SIZE 450, 190 ;
         PROMPT "Facebook", "MySpace", "Twitter" ;
         BITMAPS "..\bitmaps\alphabmp\Facebook.bmp", ;
                 "..\bitmaps\alphabmp\myspace.bmp", ;
                 "..\bitmaps\alphabmp\Twitter.bmp"

   //Dialog OS
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 2 ] PIXEL SIZE 450, 190 ;
         PROMPT "", "", "";
         BITMAPS "..\bitmaps\alphabmp\windows.bmp", ;
                  "..\bitmaps\alphabmp\apple.bmp",;
                  "..\bitmaps\alphabmp\ubuntu.bmp";
         ALIGN AL_LEFT, AL_CENTER, AL_RIGHT
         
   //Dialog Game
   aList = {}
   for i := 1 to 20
      AAdd( aList, { "Game-" + Chr(64+i), ;
                     "Description for Game-" + Chr(64+i), ;
                     Round( hb_Random( 100, 999 ), 2 ) } )
   next i  
   @ 0,0 xBrowse oBrw OF oFld:aDialogs[ 3 ] ARRAY aList LINES
   
   oBrw:CreateFromCode()
   oFld:aDialogs[ 3 ]:oClient = oBrw

   //Dialog Game
   
   @ 1,   1 GIF FILE "..\gifs\matrix4.gif" OF oFld:aDialogs[ 4 ]
   @ 1, 165 GIF FILE "..\gifs\matrix5.gif" OF oFld:aDialogs[ 4 ]
   @ 1, 330 GIF FILE "..\gifs\matrix.gif" OF oFld:aDialogs[ 4 ] SIZE 176, 262 ADJUST
   @ 125, 1 GIF FILE "..\gifs\matrix3.gif" OF oFld:aDialogs[ 4 ] SIZE 324, 137 ADJUST

   //Dialog Mail
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 5 ] PIXEL SIZE 450, 190 ;
         PROMPT "Gmail", "Outlook", "Yahoo";
         BITMAPS "..\bitmaps\alphabmp\gmail.bmp", ;
                 "..\bitmaps\alphabmp\Outlook.bmp", ;
                 "..\bitmaps\alphabmp\yahoo.bmp";
         TAB HEIGHT 45 ROUND 5
         
   //Dialog Months
   // Suport Arrays and list
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 6 ] PIXEL SIZE 450, 190 ;
         PROMPT aMonths ;
         TAB HEIGHT 18 ROUND 0;
         ON PAINT TAB ChangeClr( Self, nOption );
         ON PAINT TEXT ChangeTxtClr( Self, nOption )

   //Dialog Setting        
   oFld:aDialogs[ 2 ]:SetBrush( oBrush2 )

   @ 3,10 FOLDEREX OF oFld:aDialogs[ 7 ] PIXEL SIZE 450, 190 /*;
         PROMPT aMonths ;
         TAB HEIGHT 18 ROUND 0;
         ON PAINT TAB ChangeClr( Self, nOption );
         ON PAINT TEXT ChangeTxtClr( Self, nOption )*/


   // oCtrl := TGroup():New(2,2,5,30,"tGroup class()",oFld:aDialogs[ 7 ],,CLR_WHITE,.f.,,,.f.)    // this line added: tGroup control

   @ 040, 10 GROUP oGroup TO 150, 248 LABEL "tGroup class()" OF oFld:aDialogs[ 7 ] PIXEL ;
      TRANSPARENT

   @ 05, 3 SAY "UNDER CONSTRUCTION" OF oFld:aDialogs[ 7 ] TRANSPARENT
   
   ACTIVATE WINDOW oWnd;
            ON INIT oFld:Resize()
   
RETURN NIL

FUNCTION PaintTab( o, nOption )
   LOCAL hBrush, hBmp, nLastRow

   IF nOption == o:nOption .and. nOption == 2
      hBmp = ReadBitmap( 0, "..\bitmaps\backgrnd\metal.bmp" )
      hBrush = CreatePatternBrush( hBmp )
      DeleteObject( hBmp )
      nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 2 ] + o:nFolderHeight
      SetBrushOrgEx( o:hDC, 1, nLastRow + 2 )
      RETURN hBrush
   ENDIF  
   
RETURN o:SetFldColors( o, nOption )      


FUNCTION ChangeClr( o, n )
   
   LOCAL nMonth := Month( Date() )
   LOCAL aGrad1 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 255, 240, 180 ) },;
                     { 0.5,  nRGB( 255, 240, 180 ), nRGB( 255, 200, 140 ) } }

   LOCAL aGrad2 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 200, 200, 240 ) },;
                     { 0.5,  nRGB( 200, 200, 240 ), nRGB( 100, 100, 240 ) } }

   LOCAL aGrad3 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 255, 240, 240 ) },;
                     { 0.5,  nRGB( 255, 240, 240 ), nRGB( 255, 200, 200 ) } }

   LOCAL aGradMonth := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 185, 207, 147 ) },;
                         { 0.5,  nRGB( 185, 207, 147 ), nRGB( 85, 107, 47 ) } }
   
   LOCAL hBrush, aGrad
   
   IF n == nMonth
      aGrad = aGradMonth
   ELSE
      IF n > 0 .AND. n < 5
         aGrad = aGrad1
      ELSEIF n > 4 .AND. n < 9
         aGrad = aGrad2
      ELSE
         aGrad = aGrad3
      ENDIF
   ENDIF
   o:aGradUnSel = aGrad
   hBrush = o:SetFldColors( o, n )
     
RETURN hBrush

FUNCTION ChangeTxtClr( o, n )
   
   LOCAL nMonth := Month( Date() )
   LOCAL nClr := CLR_BLACK, ;
         nClr1 := CLR_HRED
   
   IF n > 0 .AND. n < 7
      nClr = nClr1
   ENDIF
     
RETURN nClr
       


FUNCTION MenuTabs( oFld, nOpt )
   LOCAL oMenu

   MENU oMenu POPUP 2007
      MENUITEM oFld:aPrompts[ nOpt ]
      SEPARATOR
      MenuAddItem( "Show", , ;
                    oFld:aVisible[ nOpt ], ,;
                    {|| If( oFld:aVisible[ nOpt ], ;
                            oFld:HideTab( nOpt ), ;
                            oFld:ShowTab( nOpt ) ) } )
      MenuAddItem( "Enabled", , ;
                    oFld:aEnable[ nOpt ], ,;
                    {|| If( oFld:aEnable[ nOpt ], ;
                            oFld:DisableTab( nOpt ), ;
                            oFld:EnableTab( nOpt ) ) } )
   ENDMENU
   
RETURN oMenu

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: tFolderex and tGroup control

Postby chiaiese » Tue Oct 03, 2023 4:27 pm

please completely remove the tFolderex at line 97 and see the result

Roberto
Roberto Chiaiese
R&C Informatica S.n.c.
http://www.recinformatica.it
info@recinformatica.it
chiaiese
 
Posts: 84
Joined: Wed Feb 08, 2006 10:32 pm
Location: Roma, Italia

Re: tFolderex and tGroup control

Postby karinha » Tue Oct 03, 2023 4:41 pm

Code: Select all  Expand view  RUN

// C:\FWH..\SAMPLES\TESTFX1.PRG

#include "FiveWin.ch"
#include "xbrowse.ch"
#include "gif.ch"

function main()

   local oWnd, i, oBrw, oBrush2, oCtrl, oGroup
   local oFld, oFld1, aList
   local aMonths := {"January", "February", "March", ;
                     "April", "May", "June", ;
                     "July", "August", "September", ;
                     "October", "November", "December"}
   local aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp",;
                      "..\bitmaps\alphabmp\windows.bmp",;
                      "..\bitmaps\alphabmp\game.bmp",;
                      "..\bitmaps\alphabmp\viddler.bmp",;
                      "..\bitmaps\alphabmp\mail.bmp",;
                      "..\bitmaps\alphabmp\call.bmp",;
                      "..\bitmaps\alphabmp\settings2.bmp",;
                      "..\bitmaps\alphabmp\exit.bmp" }
                     
   DEFINE BRUSH oBrush2 FILE "..\bitmaps\backgrnd\metal.bmp"                      
   
    DEFINE WINDOW oWnd TITLE "TFolderex - Testing -"
     
   @ 3, 3 FOLDEREX oFld PIXEL ADJUST;
          PROMPT  "&Social1", "&OS2", "&Games3", "&Movies4", "&Email5", "Mo&nths6", "Se&tting7", "E&xit";
          BITMAPS aBitmaps;
          ACTION( If( nOption == 8, oWnd:End(), ;
                     MsgInfo( "Action defined to " + StrTran( ::aPrompts[ nOption ], "&", "" ) ) ) );
          ON PAINT TAB PaintTab( Self, nOption );
          POPUP MenuTabs( Self, nOption );
          ON CHANGE ( If( nOption == 8, If( MsgYesNo( "Do you want exit??" ), ;
                                           oWnd:End(), ( ::SetOption( nOldOption ), ::Refresh() ) ), ) );
          ON PAINT TEXT( If( nOption == ::nOption .and. nOption == 2, CLR_YELLOW, CLR_BLACK ) );
          TOP OPTION 2 ALIGN  AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_LEFT, AL_RIGHT;
          ANIMATE SPEED 50
         
   oFld:SetBrightBmp( "..\bitmaps\alphabmp\exit2.bmp", 8 )  
   
   //Dialog Social
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 1 ] PIXEL SIZE 450, 190 ;
         PROMPT "Facebook", "MySpace", "Twitter" ;
         BITMAPS "..\bitmaps\alphabmp\Facebook.bmp", ;
                 "..\bitmaps\alphabmp\myspace.bmp", ;
                 "..\bitmaps\alphabmp\Twitter.bmp"

   //Dialog OS
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 2 ] PIXEL SIZE 450, 190 ;
         PROMPT "", "", "";
         BITMAPS "..\bitmaps\alphabmp\windows.bmp", ;
                  "..\bitmaps\alphabmp\apple.bmp",;
                  "..\bitmaps\alphabmp\ubuntu.bmp";
         ALIGN AL_LEFT, AL_CENTER, AL_RIGHT
         
   //Dialog Game
   aList = {}
   for i := 1 to 20
      AAdd( aList, { "Game-" + Chr(64+i), ;
                     "Description for Game-" + Chr(64+i), ;
                     Round( hb_Random( 100, 999 ), 2 ) } )
   next i  
   @ 0,0 xBrowse oBrw OF oFld:aDialogs[ 3 ] ARRAY aList LINES
   
   oBrw:CreateFromCode()
   oFld:aDialogs[ 3 ]:oClient = oBrw

   //Dialog Game
   
   @ 1,   1 GIF FILE "..\gifs\matrix4.gif" OF oFld:aDialogs[ 4 ]
   @ 1, 165 GIF FILE "..\gifs\matrix5.gif" OF oFld:aDialogs[ 4 ]
   @ 1, 330 GIF FILE "..\gifs\matrix.gif" OF oFld:aDialogs[ 4 ] SIZE 176, 262 ADJUST
   @ 125, 1 GIF FILE "..\gifs\matrix3.gif" OF oFld:aDialogs[ 4 ] SIZE 324, 137 ADJUST

   //Dialog Mail
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 5 ] PIXEL SIZE 450, 190 ;
         PROMPT "Gmail", "Outlook", "Yahoo";
         BITMAPS "..\bitmaps\alphabmp\gmail.bmp", ;
                 "..\bitmaps\alphabmp\Outlook.bmp", ;
                 "..\bitmaps\alphabmp\yahoo.bmp";
         TAB HEIGHT 45 ROUND 5
         
   //Dialog Months
   // Suport Arrays and list
   @ 3,10 FOLDEREX OF oFld:aDialogs[ 6 ] PIXEL SIZE 450, 190 ;
         PROMPT aMonths ;
         TAB HEIGHT 18 ROUND 0;
         ON PAINT TAB ChangeClr( Self, nOption );
         ON PAINT TEXT ChangeTxtClr( Self, nOption )

   //Dialog Setting        
   oFld:aDialogs[ 2 ]:SetBrush( oBrush2 )

   // SIN LINE 97 - funciona normal.
   
   ACTIVATE WINDOW oWnd;
            ON INIT oFld:Resize()
   
RETURN NIL

FUNCTION PaintTab( o, nOption )
   LOCAL hBrush, hBmp, nLastRow

   IF nOption == o:nOption .and. nOption == 2
      hBmp = ReadBitmap( 0, "..\bitmaps\backgrnd\metal.bmp" )
      hBrush = CreatePatternBrush( hBmp )
      DeleteObject( hBmp )
      nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 2 ] + o:nFolderHeight
      SetBrushOrgEx( o:hDC, 1, nLastRow + 2 )
      RETURN hBrush
   ENDIF  
   
RETURN o:SetFldColors( o, nOption )      


FUNCTION ChangeClr( o, n )
   
   LOCAL nMonth := Month( Date() )
   LOCAL aGrad1 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 255, 240, 180 ) },;
                     { 0.5,  nRGB( 255, 240, 180 ), nRGB( 255, 200, 140 ) } }

   LOCAL aGrad2 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 200, 200, 240 ) },;
                     { 0.5,  nRGB( 200, 200, 240 ), nRGB( 100, 100, 240 ) } }

   LOCAL aGrad3 := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 255, 240, 240 ) },;
                     { 0.5,  nRGB( 255, 240, 240 ), nRGB( 255, 200, 200 ) } }

   LOCAL aGradMonth := { { 0.5, nRGB( 255, 255, 255 ), nRGB( 185, 207, 147 ) },;
                         { 0.5,  nRGB( 185, 207, 147 ), nRGB( 85, 107, 47 ) } }
   
   LOCAL hBrush, aGrad
   
   IF n == nMonth
      aGrad = aGradMonth
   ELSE
      IF n > 0 .AND. n < 5
         aGrad = aGrad1
      ELSEIF n > 4 .AND. n < 9
         aGrad = aGrad2
      ELSE
         aGrad = aGrad3
      ENDIF
   ENDIF
   o:aGradUnSel = aGrad
   hBrush = o:SetFldColors( o, n )
     
RETURN hBrush

FUNCTION ChangeTxtClr( o, n )
   
   LOCAL nMonth := Month( Date() )
   LOCAL nClr := CLR_BLACK, ;
         nClr1 := CLR_HRED
   
   IF n > 0 .AND. n < 7
      nClr = nClr1
   ENDIF
     
RETURN nClr
       


FUNCTION MenuTabs( oFld, nOpt )
   LOCAL oMenu

   MENU oMenu POPUP 2007
      MENUITEM oFld:aPrompts[ nOpt ]
      SEPARATOR
      MenuAddItem( "Show", , ;
                    oFld:aVisible[ nOpt ], ,;
                    {|| If( oFld:aVisible[ nOpt ], ;
                            oFld:HideTab( nOpt ), ;
                            oFld:ShowTab( nOpt ) ) } )
      MenuAddItem( "Enabled", , ;
                    oFld:aEnable[ nOpt ], ,;
                    {|| If( oFld:aEnable[ nOpt ], ;
                            oFld:DisableTab( nOpt ), ;
                            oFld:EnableTab( nOpt ) ) } )
   ENDMENU
   
RETURN oMenu

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Surasak and 17 guests