How to ... and Where to ...

Post Reply
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

How to ... and Where to ...

Post 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

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
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

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

Post by Enrico Maria Giordano »

1) From mget.prg:

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

2) oWnd:SetControl( oBrw )

3) Ask to Antonio

EMG
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post by kronos911 »

Thank you for your reply. As a newbee to FW I find that a forum like this is very helpfull.
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post 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
DanielPuente
Posts: 108
Joined: Sun Oct 09, 2005 6:12 pm
Location: Mar del Plata - Argentina
Contact:

Post by DanielPuente »

Kronos:

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

Regards,
Daniel Puente
Mar del Plata, Argentina
danielpuente@speedy.com.ar
puenteda@hotmail.com
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post 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

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.
DanielPuente
Posts: 108
Joined: Sun Oct 09, 2005 6:12 pm
Location: Mar del Plata - Argentina
Contact:

Post 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,
Daniel Puente
Mar del Plata, Argentina
danielpuente@speedy.com.ar
puenteda@hotmail.com
kronos911
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Post by kronos911 »

Thanks I'll give it a try.
Post Reply