Page 1 of 1

How to ... and Where to ...

PostPosted: Tue Oct 25, 2005 9:23 pm
by kronos911
1) How can I track the length of a multi line get. I understand that the UDF of the ON CHANGE clause is the trick. What parameters are passed to it (the NG file is missing that kind of info). Will something like this work for the UDF
Code: Select all  Expand view
PROCEDURE MemoLenChk(nLen)
  IF LEN(oGetMemo:cText()) <= nLen
    oGetMemo:KeyChar()
  ENDIF
RETURN


2) How can I make the size of a listbox "lock" to the size of the window it's drawn in? When a user zooms a window the listbox should "follow" the window's size and redraw itself to that size.

3) Where can I find a detaled hlp or ng file for fivewin 2,3. A fellow coleague has lost the original one and cant find the setup files

Thanks
------
Using 1.92 demo version of FW for Clipper

Re: How to ... and Where to ...

PostPosted: Tue Oct 25, 2005 9:35 pm
by Enrico Maria Giordano
1) From mget.prg:

Eval( ::bChange, nKey, nFlags, Self )

2) oWnd:SetControl( oBrw )

3) Ask to Antonio

EMG

PostPosted: Wed Oct 26, 2005 8:57 am
by kronos911
Thank you for your reply. As a newbee to FW I find that a forum like this is very helpfull.

PostPosted: Wed Oct 26, 2005 8:17 pm
by kronos911
Ok next question. How to make a GET object that is editing a Date field popup an datepicker when there is a bad date.
I know recompile and relink the TGET.PRG with a moded lValid METHOD. (The datepicker is the msgdate source code I got from a colleges 2.3 installation and will mod it to support Greek language).
I want to know if there is an easy way to do it.
Thanks

PostPosted: Thu Oct 27, 2005 12:35 am
by DanielPuente
Kronos:

Use the valid clause of the get (redefine get .... VALID Valfecha(cFecha), and in valfecha() you evaluate the date.)

Regards,

PostPosted: Fri Nov 04, 2005 12:59 am
by kronos911
I want to display a login dialog box after the MDI framework loads and before the main app starts. What I have gotten so far is to display that dialog before everything.

Code: Select all  Expand view
PROCEDURE MAIN()


  DEFINE WINDOW oMainWin MDI TITLE OemToAnsi(“IFT - …”)
    IF LogInUser()
      IF OpenDbfs()
         // display the main MDI child browser window and set up the menu system
      ENDIF
    ELSE
       oMainWin:End()
    ENDIF
  ACTIVATE WINDOW oMainWin
RETURN

STATIC FUNCTION LogInUser()
  LOCAL oLogIn, lGo := .F., oGet1, oGet2, oOKBtn, oCancelBtn

  DEFINE DIALOG oLogIn of oMainWin
  ….
  …
  ACTIVATE DIALOG oLogIn CENTER
RETURN lGo


If I have to use MDI child windows instead of dialogs how can I make the app stop at them until the user passes or fails the authorization prossess.

PostPosted: Fri Nov 04, 2005 3:35 am
by DanielPuente
Kronos:

IF you call loginuser() BEFORE the activate window, obviously the windows does not appears until you close that dialog. You have to use the ON INIT clause of the ACTIVATE WINDOW, so the windows is activated and the login dialog appears over it, and if the user don't pass the login dialog you close the window. Something like this:

ACTIVATE WINDOW oWnd maximized ON INIT (oSpl:AdjRight(),IF(Login(),(cLogin:=.T.,Start(),MuestraUsuario()), oWnd:End()));
valid IF(cLogin.and.vPrevia(cLogin),MsgYesNo( "Abandona el Sistema ?"," Confirme: "),IF(cLogin,.F.,.T.))


In your case:

ACTIVATE WINDOW oWnd maximized ON INIT IF(LogInUser(),,oWnd:End())

Regards,

PostPosted: Fri Nov 04, 2005 11:10 am
by kronos911
Thanks I'll give it a try.