Hide controls in a dialog before activating it.

User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Hide controls in a dialog before activating it.

Post by James Bott »

Antonio,

Then maybe these methods should be something like this?

Code: Select all

   METHOD Hide() INLINE ::lVisibile:=.F., ShowWindow( ::hWnd, SW_HIDE )

   METHOD Show() INLINE  ::lVisible:=.T., ShowWindow( ::hWnd, SW_SHOWNA )
However, I have not looked at the code to see how the var lVisible is actually used.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Hide controls in a dialog before activating it.

Post by Antonio Linares »

James,

Actually DATA lVisible just stores the visible status but it does not perform any action if we change it, in example if we do oControl:lVisible := .F. then the control will not be hidden.

Thats why in order to implement that functionality, DATA lVisible should be turned into a Method. But I am afraid that such change could break existing users code, meanwhile such functionality can be done using Methods Hide() and Show().
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marcelo Via Giglio
Posts: 1033
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Hide controls in a dialog before activating it.

Post by Marcelo Via Giglio »

Hello,

this remember me this topic http://forums.fivetechsupport.com/viewt ... =22&t=9676 in the TO DO forum isn't it?

regards

Marcelo
User avatar
concentra
Posts: 107
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: Hide controls in a dialog before activating it.

Post by concentra »

Antonio Linares wrote:James,

Actually DATA lVisible just stores the visible status but it does not perform any action if we change it, in example if we do oControl:lVisible := .F. then the control will not be hidden.

such functionality can be done using Methods Hide() and Show().

Anyway, if I call a HIDE() in an control before the dialog is initialized, when the dialog is shown the control is not hidden and lVisible := .F. !
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Hide controls in a dialog before activating it.

Post by Antonio Linares »

Concentra,

Yes, you are right, as the control still does not have a valid Windows handle. We could modify this, but actually it is implemented this way.

So the calls to oControl:Hide() or oControl:Show() must be issued from the ON INIT clause of the dialog, as from that moment on, the controls have a valid Windows handle.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: Hide controls in a dialog before activating it.

Post by Manuel Valdenebro »

ukoenig wrote:You can Hide a Control on Dialog-Init :

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( GradBrush( oDlg, { { 0.50, 16314573, 14853684 }, ;
{ 0.50, 14853684, 16314573 } }, .T. ), ;
oSay1:Hide() ) ;
Ich benutze Heute das.

Gracias por tu ayuda ( Danke Uwe für deine Hilfe).

Tschüss
Un saludo

Manuel
Post Reply