Test Functions in FWPPC , exists or no?

Test Functions in FWPPC , exists or no?

Postby xVar » Fri Feb 06, 2009 2:57 pm

Hi everybody!

I look for test functions. (Can't find its in help.)

Is any functions like IsWindowActive () or IsWIndowDefined() ?

A make my fist aplication and test simple dialog box. If dialog box is opened, and I try open it on second case , dialoog box not showed, but activ in backgrownd (when I close main window I loook it for one second ).

So I need test when oDlg is active.

For example in "test06.prg", is work, but if I use this code in another applications and open dialog box not from menu but from button, if dialogBox lost focus it is not visible, but active ...



Regards Andrej.
xVar
 
Posts: 35
Joined: Mon Jan 19, 2009 9:14 am

Re: Test Functions in FWPPC , exists or no?

Postby Antonio Linares » Fri Feb 06, 2009 9:21 pm

Andrej,

Here you have a working example:
Code: Select all  Expand view
#include "FWCE.ch"

function Main()

   local oDlg
   
   if FindWindow( 0, "Test" ) != 0
      MsgInfo( "Application already working" )
      return nil
   endif   

   DEFINE DIALOG oDlg TITLE "Test" SIZE 200, 200

   ACTIVATE DIALOG oDlg CENTERED

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

OK, I will try.

Postby xVar » Mon Feb 09, 2009 8:00 am

This way is good if If I use 2 buttons, that use one function.

But if I use One button for show Dialog , and click on Main window or Button that start dialog - dialog go to backend, and I can't show it.
Dialog not like "Dialog", it is normal window:( . But, if I run "tutor06" application dialog is run normally ... In "tutor10" dialog is not run in modal mode.

What I make worst ?

FindWindow( ) is not help me.

It is a code :


// Dialog Test

#include "fwce.ch"
#include "dll.ch"




function Main()
Local oWnd


DEFINE FONT oFontS NAME 'Arial' SIZE 0, -10
DEFINE WINDOW oWnd TITLE "RFID_OMME"

@ 5, 0 BUTTON "Test Button" ;
SIZE 204, 26 ;
FONT oFontS;
ACTION ShowDialog()

ACTIVATE WINDOW oWnd
oFontS:End()
oDld:End()
oWnd:End()
return nil

//-------------------------------------------------------------------------//
STATIC FUNCTION ShowDialog()
//-------------------------------------------------------------------------//


local oDlg
LOCAL cText := 'Try click on MainWindow, please'

if FindWindow( 0, "Test" ) != 0
MsgInfo( "Application already working" )
return nil
endif

DEFINE DIALOG oDlg TITLE "Test" SIZE 200, 200
@ 1, 1 SAY cText SIZE 70, 20

ACTIVATE DIALOG oDlg CENTERED
oDlg:End()

RETURN NIL
xVar
 
Posts: 35
Joined: Mon Jan 19, 2009 9:14 am

Re: Test Functions in FWPPC , exists or no?

Postby Antonio Linares » Mon Feb 09, 2009 6:27 pm

Andrej,

Please make these changes in your code:

@ 5, 0 BUTTON "Test Button" ;
SIZE 204, 26 ;
FONT oFontS;
ACTION ShowDialog( oWnd )

...

STATIC FUNCTION ShowDialog( oWnd )

...

DEFINE DIALOG oDlg TITLE "Test" SIZE 200, 200 OF oWnd
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Thanks Antonio. Its work.

Postby xVar » Tue Feb 10, 2009 10:28 am

My First Application is ready :).

Regards
Andrej.
xVar
 
Posts: 35
Joined: Mon Jan 19, 2009 9:14 am

Re: Test Functions in FWPPC , exists or no?

Postby Antonio Linares » Tue Feb 10, 2009 12:22 pm

Very good! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 22 guests