Page 1 of 1

Open a specific folder ON INIT

Posted: Thu Jan 26, 2017 5:47 pm
by Rick Lipkin
To All

I would like to open a specific folder ON INIT .. in this example I have 3 folders and I want to have the second folder open and be in focus ON INIT. This code does not seem to work.

Rick Lipkin

Code: Select all

ACTIVATE DIALOG oSchA NOWAIT    ;
     ON INIT ( _XbrGoToCol( oLbxA, 2),_XbrGoToCol( oLbxB, 2),_XbrGoToCol( oLbxC, 2),;
              IF( (xSUPER = 'Y'.or. xMGR = 'Y' .or. xADMIN = 'Y' .or. xDispatch = "Y"), ,oBTN7:HIDE() )) ;  // change motorpool hide
                VALID(!GETKEYSTATE( 27 ))


ACTIVATE WINDOW oWNDCHILD ;
         ON INIT ( oSchA:Move( 0,0, oWndChildA:nWidth, oWndChildA:nHeight, .T. ), ;
           oWndChildA:bResized := {|| _ReSizeUm( oSchA,oWndChildA,oLbxA,oFld ) }, ;
           oFld:aDialogs[2]:SetFocus());  //  <----  HERE
         VALID ( IIF( !lOK, _CloseRes(.T.,oFontB, oFontB1, oRsPdisp, oLbxA, @lOk ),.F. ))
 
Image

Re: Open a specific folder ON INIT

Posted: Thu Jan 26, 2017 6:01 pm
by cnavarro
Try oFolder:SetOption( 2 )

Re: Open a specific folder ON INIT

Posted: Thu Jan 26, 2017 6:21 pm
by Rick Lipkin
Thanks Cristobal .. that worked !

Rick Lipkin

Re: Open a specific folder ON INIT

Posted: Fri Jan 27, 2017 3:30 am
by Armando
Rick:

I have this code

Code: Select all

        oFld:SetOption(2)
        oFld:nOption := 2
        oFld:Refresh()
 
Regards

Re: Open a specific folder ON INIT

Posted: Sun Jan 29, 2017 6:28 am
by nageswaragunupudi
We use ON INIT when that is the only way to get what we need.

In case of folders we can specify an initial folder even during definition.

Code: Select all

@ r, c  (OR REDEFINE) FOLDER ....... <clauses> ;
    OPTION nInitialFolderNo ;
    <moreClauses,...>
 

Re: Open a specific folder ON INIT

Posted: Fri Apr 03, 2020 7:30 am
by pacotre
Buenos dias:
Como puedo bloquear el acceso a una pestaña de un folder si no está autorizado?

Gracias.

Re: Open a specific folder ON INIT

Posted: Fri Apr 03, 2020 8:47 am
by nageswaragunupudi

Code: Select all

oFolder:aEnable[ nDlg ] := .f.

Re: Open a specific folder ON INIT

Posted: Sun Apr 12, 2020 3:42 pm
by pacotre
Pero lo que yo necesito no es deshabilitar una pestaña. Lo que quiero es que una vez que se entra (se pincha), si la evaluación no es correcta, salir de esa pestaña nº 7 y volver a la 1 ó a la que sea, sin mostrar el dialogo de la 7.
No sé si me explico bien.
Pulso pestaña 7, compruebo si existe algo y si no existe rechazo la entrada a esa pestaña, simular esa deshabilitación comentada. No se trata de ON INIT, que eso sí lo tengo controlado.
Gracias