Guidance
指路人
g.yi.org
Upload / Forum Attachment / Reginald Rexx Programming Language Compiler User Forum Attachments and Pictures / 13296-test_wm_size.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* */
PROCEDURE EXPOSE wdw_size. window_size guiwindow resize_error;

PARSE ARG control

guierr = "SYNTAX"
guiheading = 1
/* Break window_size into its constituent parts:-
	 The old window size along the X-axis
	 The old window size along the Y-axis
	 The new window size along the X-axis
	 The new window size along the Y-axis
*/	 
IF WORDS(window_size) \= 4 THEN
	DO
		rc = wdwsay.rex('Invalid definition in window_size 'window_size, 'STOP')
		RETURN 0
	END	 

PARSE VAR window_size wdw_old_x wdw_old_y wdw_new_x wdw_new_y

rc = change_controls(control)
SAY 'We are in test_wm_size.rex'

RETURN 0
/******************************************************************
 We've changed the window size - time to move/resize the various   
 controls                                                          
******************************************************************/
change_controls:

PARSE ARG control
SAY 'In change_controls'

/* Used as a "global" variable in case of errors in the control    
   resizing expressions */
resize_error = ''

/* Ensure the variables are available for the interpret clause */
oldx = wdw_old_x
newx = wdw_new_x
oldy = wdw_old_y
newy = wdw_new_y
 
DO i = 1 TO wdw_size.0

	IF i = 6 THEN				/* Allow us to debug a specific control */
		NOP
	/* See comments above for the constituent parts of each item in 
     wdw_size. */
	PARSE VAR wdw_size.i next_ctrl handle x_pos y_pos x_size y_size ,
						resize x_change y_change bx_change by_change
	sw_resize = 1					/* By default, we'll resize */
	SELECT
	
		WHEN TRANSLATE(next_ctrl) = 'UNDEFINED_CONTROL' THEN
			/* A field with no name - ignore it */
			sw_resize = 0

		WHEN control <> "" & next_ctrl <> control THEN
			/* They passed a SPECIFIC control for resizing, and the 
			   current control ani't it - skip */
			sw_resize = 0

		WHEN resize = 'M' THEN
			rc = move_the_field('M') 			/* Move the field */
		
		WHEN resize = 'S' THEN
			rc = resize_the_field('S')		/* No, resize it instead */
					
		WHEN resize = 'B' THEN
			DO
				/* .... or do both */
				rc = move_the_field('M')		/* First move the field ... */
				rc = resize_the_field('B') 	/* ... then resize it */
			END
			
		OTHERWISE
			DO
				temp = 'Group 'i' contains an invalid size variable',
               '***'wdw_size.i'***resize='resize'***'
				SAY 'temp = 'temp               
				RAISE user 1 DESCRIPTION (temp)				
			END	
	END

	IF sw_resize = 1 THEN
		/* we DO want to resize */
		rc = call_guisetctlplacement(next_ctrl, handle, x_pos, y_pos, x_size, y_size)
	
END

RETURN 0
/******************************************************************
 We're moving the field - either left/right, up/down or both       
                                                                   
 Argument	ctrl_type is used to "tell" analyze_resize_parms whether 
			we're after size/move parms 1 & 2 or 3 & 4 (the former two   
			are when we're ONLY moving/resizing a control. The latter    
			when we're BOTH moving NAD resizing it)                       
******************************************************************/ 
move_the_field:

ARG ctrl_type
SAY 'In move_the_field'

/* Set tempx and tempy to the current X/Y positions of the control */
tempx = x_pos; tempy = y_pos
/*
rc = analyze_resize_parms(ctrl_type)

select
	when oldy = newy then
		rc = move_left_or_right()
	when oldx = newx then		
		rc = move_up_or_down()			
	otherwise
		do
			rc = move_left_or_right()	/* First move left/right .... */
			rc = move_up_or_down()		/* ... and then up/down 			*/
		end
end

x_pos = tempx
y_pos = tempy
*/
RETURN 0
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-5-4  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-03-30 18:07:11