Jump to content
Fivewin Brasil

tem como dar um HIDE() numa aba do Folder ?


gibaf

Recommended Posts

ola a todos !

A classe Folder tem a opcao de oFolder:Enable( .T. , .F. , .T. , .F. , .T. )

 

entretanto...

tipo, imaginem um folder, tipo, com umas 5 abas (hipoteticamente)...

agora, imaginem, q por uma necessidade, algumas delas precisam estar :HIDE() e outras permanecendo :SHOW()

 

tem com fazer com Hide/Show ? q o Enable nao me atende para o caso em questao.

 

ate ja tentei (nao da error, mas tambem nao faz - hehe)

oFolder:aDialogs[1]:Show()

oFolder:aDialogs[2]:Hide()

oFolder:aDialogs[3]:Show()

oFolder:aDialogs[4]:Hide()

oFolder:aDialogs[5]:Show()

 

Por fim, o mais ideal q consegui fazer eh o oFolder:SetPrompts( aAba ) mas o froid q toda escolha do ComboBox (nao falei, mas antes do folder tem esse combobox q o usuario seleciona a sua opcao) tem q refazer tudo as coisas (say, get, brw, etc)

 

seria perfeito se funcionaria o HIDE/SHOW

se alguem puder me dar alguma dica, eu ficarei muito agradecido !

 

MUITO OBRIGADO

Link to comment
Share on other sites

8 minutos atrás, Theotokos disse:

talvez: tenta ai

oFolder:aEnable[1] := .T.

oFolder:aEnable[2] := .F.

oFolder:aEnable[3] := .T.

 

 

 

ola...

primeiramente, obrigado por responder...

pois, eu nao sei vc compreendeu a minha necessidade .. o Enable nao me atende... o q me atenderia mil% seria o HIDE/SHOW

obrigado +1x pela resposta

Link to comment
Share on other sites

Veja com este "truque" se resolve:

Teste e comente:

// \samples\testfx4.prg
	#include "FiveWin.ch"
	function main()
   local oWnd, i, oBrush2
   local oFld
                      
   DEFINE BRUSH oBrush2 FILE "..\bitmaps\backgrnd\metal.bmp"                      
   
   DEFINE WINDOW oWnd TITLE "TFolderex - Testing -"
     
   @ 3, 3 FOLDEREX oFld PIXEL ADJUST;
          PROMPT  "&Social", "&OS", "&Games", "&Movies", "&Email", "Mo&nths", "Se&tting", "E&xit";
          ON PAINT TAB PaintTab( 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_BLUE, CLR_BLACK ) );
          TOP OPTION 2 ALIGN 2, 2, 2 
	   @   5, 140 BUTTONBMP PROMPT "" BITMAP "..\bitmaps\bartop.bmp"   OF oFld:aDialogs[ 2 ] PIXEL;
       ACTION ( oFld:SetLayOut( 1 ) ) 
          
   @ 105, 140 BUTTONBMP PROMPT "" BITMAP "..\bitmaps\barDown.bmp"  OF oFld:aDialogs[ 2 ] PIXEL;
       ACTION ( oFld:SetLayOut( 3 ) )    
       
   @  55,  80 BUTTONBMP PROMPT "" BITMAP "..\bitmaps\barleft.bmp"  OF oFld:aDialogs[ 2 ] PIXEL;
       ACTION ( oFld:SetLayOut( 2 ) )    
   
   @  55, 200 BUTTONBMP PROMPT "" BITMAP "..\bitmaps\barright.bmp" OF oFld:aDialogs[ 2 ] PIXEL;
       ACTION ( oFld:SetLayOut( 4 ) )    
	        
   oFld:aDialogs[ 2 ]:SetBrush( oBrush2 )
   // oFld:aDialogs[ 02 ]:Hide()  // No funciona
	   ACTIVATE WINDOW oWnd ;
      ON INIT( ESCONDE_FOLDER( oFld ) )
	//      ON INIT( oFld:Resize(), oFld:aDialogs[ 02 ]:Hide() ) // no funciona
   
RETURN NIL
	STATIC FUNCTION ESCONDE_FOLDER( oFld )
	   oFld:aEnable := { .T., .T., .F., .T., .T., .T., .T., .T., .F. } //-> Inibe as Orelhas(Abas)
	   oFld:nOption := 3 // "Games"
	   oFld:DelItem()
	   // oFld:aDialogs[3]:Hide()  // Nao funciona
	   oFld:SetOption(2)
	   oFld:Refresh()
	   oFld:SetFocus()
	RETURN( .T. )
	FUNCTION PaintTab( o, nOption )
	   LOCAL hBrush, hBmp, nLastRow
	   IF nOption == o:nOver .OR. nOption == o:nOption
      o:SetAlphaLevel( nOption, 255 )
   ELSE 
      o:SetAlphaLevel( nOption, 50 )
   ENDIF 
   
   IF nOption == o:nOption .and. nOption == 2
      hBmp = ReadBitmap( 0, "..\bitmaps\backgrnd\metal.bmp" )
      hBrush = CreatePatternBrush( hBmp )
      DeleteObject( hBmp )
      IF o:nLayOut == 2
         nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 1 ] + o:nFolderHeight
         SetBrushOrgEx( o:hDC, nLastRow + 2, 1 )  
      ELSE 
         SetBrushOrgEx( o:hDC, 2, 2 ) 
      ENDIF
      RETURN hBrush
   ENDIF   
   
RETURN o:SetFldColors( o, nOption )
	// fin / end

Regards, saludos.

 

 

Regards, saludos.

Link to comment
Share on other sites

1 hora atrás, giovanyvecchi disse:

Se quiser esconder a segunda aba seria assim

oFld:aVisible := {.T.,.F.,.T.,.T.}

Boa garoto. Se bem que fica um "buraco" horroroso. kkkkkkkk

https://forums.fivetechsupport.com/viewtopic.php?f=6&t=24099&p=129835&hilit=oFld%3AaVisible&sid=67223e9a38d3804f1ad19ff92a2151cc#p129835

Regards, saludos.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...