Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
grid-like behaviour for fox 2.x
Message
From
29/06/2000 16:18:43
 
 
To
29/06/2000 15:37:39
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00386446
Message ID:
00386721
Views:
11
This message has been marked as the solution to the initial question of the thread.
Chuck,

If you want the parent data to show in ordinary fields instead of in a browse window, you can try the example below. I have included some (ugly) navigation buttons at the bottom of the screen.

I have used the screen designer for this window. You have to make two different windows and combine them in a screen set. The browse window is defined in the screen setup of the screen set. You can't have any fields in the main window (text or graphics is ok), this will only have the purpose of a "container" for the other screens.

In the setup snippet of the top and bottom window, you must include the line:
#WCLAUSES IN WINDOW winbrows
You must also register the name (actually the first word of the window title) of the individual windows in the "Associated windows" button of the screen set.

I have made a small project out of this. If you like, I can mail it to you.

Jens Erik

Here's the code:
#REGION 1

***: Create the cursors for this test

CREATE CURSOR Parent;
 (Par_Id N(6,0), ParName C(60))

INDEX ON par_id			TAG par_id
INDEX ON UPPER(ParName)	TAG ParName
SET ORDER TO TAG ParName

INSERT INTO Parent;
 (Par_Id, ParName) VALUES (1, "Parent 1")
INSERT INTO Parent;
 (Par_Id, ParName) VALUES (2, "Parent 2")

CREATE CURSOR Child;
 (Chi_Id N(6,0), Chi_Par N(6, 0), ChiName C(60))

INDEX ON Chi_id		TAG Chi_id
INDEX ON Chi_par	TAG Chi_par
SET ORDER TO TAG Chi_par

INSERT INTO Child;
 (Chi_Id, Chi_par, ChiName);
 VALUES;
 (1, 1, "Child 1, Parent 1")

INSERT INTO Child;
 (Chi_Id, Chi_par, ChiName);
 VALUES;
 (2, 1, "Child 2, Parent 1")

INSERT INTO Child;
 (Chi_Id, Chi_par, ChiName);
 VALUES;
 (3, 2, "Child 1, Parent 2")

***: Set up relationship

SELECT Parent
GO TOP
SET RELATION TO Parent.Par_id INTO Child


#REGION 0
REGIONAL m.currarea, m.talkstat, m.compstat

IF SET("TALK") = "ON"
	SET TALK OFF
	m.talkstat = "ON"
ELSE
	m.talkstat = "OFF"
ENDIF
m.compstat = SET("COMPATIBLE")
SET COMPATIBLE FOXPLUS

m.rborder = SET("READBORDER")
SET READBORDER ON

*       *********************************************************
*       *                                                         
*       *               Windows Window definitions                
*       *                                                         
*       *********************************************************
*

IF NOT WEXIST("winbrows") ;
	OR UPPER(WTITLE("WINBROWS")) == "WINBROWS.PJX" ;
	OR UPPER(WTITLE("WINBROWS")) == "WINBROWS.SCX" ;
	OR UPPER(WTITLE("WINBROWS")) == "WINBROWS.MNX" ;
	OR UPPER(WTITLE("WINBROWS")) == "WINBROWS.PRG" ;
	OR UPPER(WTITLE("WINBROWS")) == "WINBROWS.FRX" ;
	OR UPPER(WTITLE("WINBROWS")) == "WINBROWS.QPR"
	DEFINE WINDOW winbrows ;
		AT  0.000, 0.000  ;
		SIZE 24.333,126.000 ;
		TITLE "Main" ;
		FONT "Arial", 9 ;
		FLOAT ;
		NOCLOSE ;
		MINIMIZE ;
		SYSTEM ;
		COLOR RGB(,,,192,192,192)
	MOVE WINDOW winbrows CENTER
ENDIF

IF NOT WEXIST("winbottom") ;
	OR UPPER(WTITLE("WINBOTTOM")) == "WINBOTTOM.PJX" ;
	OR UPPER(WTITLE("WINBOTTOM")) == "WINBOTTOM.SCX" ;
	OR UPPER(WTITLE("WINBOTTOM")) == "WINBOTTOM.MNX" ;
	OR UPPER(WTITLE("WINBOTTOM")) == "WINBOTTOM.PRG" ;
	OR UPPER(WTITLE("WINBOTTOM")) == "WINBOTTOM.FRX" ;
	OR UPPER(WTITLE("WINBOTTOM")) == "WINBOTTOM.QPR"
	DEFINE WINDOW winbottom ;
		AT 0.000, 0.000 ;
		SIZE 6.267,119.200 ;
		FONT "Arial", 9 ;
		NOFLOAT ;
		NOCLOSE ;
		NOMINIMIZE ;
		NONE ;
		COLOR RGB(,,,192,192,192) ;
		IN WINDOW WINBROWS
ENDIF

IF NOT WEXIST("_0511b0iqk")
	DEFINE WINDOW _0511b0iqk ;
		AT 21.000, 0.000 ;
		SIZE 4.533,119.000 ;
		FONT "Arial", 9 ;
		NOFLOAT ;
		NOCLOSE ;
		NOMINIMIZE ;
		NONE ;
		COLOR RGB(,,,192,192,192) ;
		IN WINDOW WINBROWS
ENDIF


*       *********************************************************
*       *                                                         
*       *           TEST/Windows Setup Code - SECTION 2           
*       *                                                         
*       *********************************************************
*

#REGION 1

wby1 =  10.00
wby2 =  18.00
wbx1 =   0.00
wbx2 = 122.00

DEFINE WINDOW winChild;
 FROM wby1,wbx1 TO wby2,wbx2;
 FONT "ARIAL",9;
 TITLE "Child";
 NOFLOAT;
 NOCLOSE;
 NOGROW;
 NOZOOM;
 DOUBLE;
 IN WINDOW winBrows

SELECT Child

BROWSE FIELDS;
 ChiName :H="Child name";
 WINDOW winChild;
 IN WINDOW winBrows;
 LOCK 0;
 NODELETE;
 NOCLEAR;
 NOMENU;
 NOWAIT;
 SAVE

SELECT PARENT


*       *********************************************************
*       *                                                         
*       *         TESTTOP/Windows Setup Code - SECTION 2          
*       *                                                         
*       *********************************************************
*

#REGION 2


*       *********************************************************
*       *                                                         
*       *         TESTBOT/Windows Setup Code - SECTION 2          
*       *                                                         
*       *********************************************************
*

#REGION 3


*       *********************************************************
*       *                                                         
*       *               TEST/Windows Screen Layout                
*       *                                                         
*       *********************************************************
*

#REGION 1
IF WVISIBLE("winbrows")
	ACTIVATE WINDOW winbrows SAME
ELSE
	ACTIVATE WINDOW winbrows NOSHOW
ENDIF




*       *********************************************************
*       *                                                         
*       *              TESTTOP/Windows Screen Layout              
*       *                                                         
*       *********************************************************
*

#REGION 2
IF WVISIBLE("winbottom")
	ACTIVATE WINDOW winbottom SAME
ELSE
	ACTIVATE WINDOW winbottom NOSHOW
ENDIF
@ 1.067,3.600 SAY "Parent name:" ;
	FONT "Arial", 9 ;
	STYLE "T"
@ 1.067,20.200 GET parent.parname ;
	SIZE 1.000,37.000 ;
	DEFAULT " " ;
	FONT "Arial", 9 ;
	PICTURE "@K" ;
	COLOR ,RGB(,,,255,255,255)




*       *********************************************************
*       *                                                         
*       *              TESTBOT/Windows Screen Layout              
*       *                                                         
*       *********************************************************
*

#REGION 3
IF WVISIBLE("_0511b0iqk")
	ACTIVATE WINDOW _0511b0iqk SAME
ELSE
	ACTIVATE WINDOW _0511b0iqk NOSHOW
ENDIF
@ 0.400,55.800 GET m.close ;
	PICTURE "@*HT Close" ;
	SIZE 1.533,12.800,0.800 ;
	DEFAULT 1 ;
	FONT "Arial", 9
@ 0.400,3.000 GET m.move ;
	PICTURE "@*HN <<;<;>;>>" ;
	SIZE 1.533,5.400,0.800 ;
	DEFAULT 1 ;
	FONT "Arial", 9 ;
	VALID _0511b0isa()

IF NOT WVISIBLE("_0511b0iqk")
	ACTIVATE WINDOW _0511b0iqk
ENDIF
IF NOT WVISIBLE("winbottom")
	ACTIVATE WINDOW winbottom
ENDIF
IF NOT WVISIBLE("winbrows")
	ACTIVATE WINDOW winbrows
ENDIF


READ CYCLE MODAL ;
	DEACTIVATE _0511b0iry() ;
	WITH parent,child,main,winbrows

RELEASE WINDOW _0511b0iqk
RELEASE WINDOW winbottom
RELEASE WINDOW winbrows

#REGION 0

SET READBORDER &rborder

IF m.talkstat = "ON"
	SET TALK ON
ENDIF
IF m.compstat = "ON"
	SET COMPATIBLE ON
ENDIF


*       *********************************************************
*       *                                                         
*       * _0511B0ISA           m.move VALID                       
*       *                                                         
*       * Function Origin:                                        
*       *                                                         
*       * From Platform:       Windows                            
*       * From Screen:         TESTBOT,     Record Number:    3   
*       * Variable:            m.move                             
*       * Called By:           VALID Clause                       
*       * Object Type:         Push Button                        
*       * Snippet Number:      1                                  
*       *                                                         
*       *********************************************************
*
FUNCTION _0511b0isa     &&  m.move VALID
#REGION 3
SELECT Parent

DO CASE
CASE m.move = 1
	GO TOP

CASE m.move = 2
	IF !BOF()
		SKIP -1
		IF BOF()
			GO TOP
		ENDIF
	ENDIF

CASE m.move = 3
	IF !EOF()
		SKIP
		IF EOF()
			GO BOTTOM
		ENDIF
	ENDIF

CASE m.move = 4
	GO BOTTOM

ENDCASE

SHOW GETS


*       *********************************************************
*       *                                                         
*       * _0511B0IRY           Read Level Deactivate              
*       *                                                         
*       * Function Origin:                                        
*       *                                                         
*       *                                                         
*       * From Platform:       Windows                            
*       * From Screen:         Multiple Screens                   
*       * Called By:           READ Statement                     
*       * Snippet Number:      2                                  
*       *                                                         
*       *********************************************************
*
FUNCTION _0511b0iry     && Read Level Deactivate
*
* Deactivate Code from screen: TEST
*
#REGION 1
RETURN NOT WREAD()
Previous
Reply
Map
View

Click here to load this message in the networking platform