|
From: Alexander S.K. <al...@be...> - 2014-12-19 07:23:35
|
Itamar M. Lins Jr. Lins writes:
> Hi!
> If I use "NOEXIT" Valid {||} not work, if use dialog close compulsorily!
>
> #include "hwgui.ch <http://hwgui.ch>"
>
> Function main
> local oDlg, oTab, cGetA := cGetB := space(5)
>
> INIT DIALOG oDlg CLIPPER AT 100,100 SIZE 640,480 STYLE DS_CENTER
>
> @ 10,10 TAB oTab ITEMS {} SIZE 400,200 OF oDlg
>
> BEGIN PAGE "TAB A" OF oTAB
>
> @ 5,30 get oGetA Var cGetA size 100,30 ;
> Valid {||hwg_msginfo("does not close because it has elsewhere to
> type"),oGetB:SetFocus(),.t.}
>
> END PAGE OF oTAB
> BEGIN PAGE "TAB B" OF oTAB
>
> @ 5,30 get oGetB Var cGetB size 100,30
>
> END PAGE OF oTAB
>
> ACTIVATE Dialog oDlg
>
> The user has to type more, but the dialog closes. With no command to do so.
>
Yes, because the get item on a tab is last get item.
If you don't want to use buttons, you may use additional invisible get
item, as I suggested in previous message. There is no need to set in in
every tab page - just one out of tab.
BTW, to set focus on an item in other tab page, it is needed to set this
page directly, using the oTab:SetTab( n )
So, in your sample, if you want to go automatically to a second page
after leaving the first get item and to close a dialog after leaving the
second get, you need to insert out of tab:
@ 5,100 get cGet size 0,0 WHEN
{||Iif(oTab:GetActivePage()==1,(oTab:Settab(2),oGetB:SetFocus(),.t.),(hwg_enddialog(),.t.))}
Regards, Alexander.
|