Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 To: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 Tags
Subject: RE: DIFFRERENT SHAPE VFP FORMS
Thread ID: 395778 Message ID: 395847 # Views: 60 # Ratings: 2
Version: Not Applicable Category: Win32API programming
Date: Monday, January 20, 2014 11:22:19 AM         
   


>
> Yes, back in 2006-2008 I had my General Ledger (Accounting) App's main screen as shown below with just a view lines of codes in the load/init using similar techniques. The letters "GL" are on form positioned in a hole cut off the blue elliptical shape
> (could not quote the codes here as source is in another laptop which is still broken)
>

Please don't be upset for me posting again, but it is funny. (c)

* CTRL+F4 to close any form
#define RGN_OR 2
#define RGN_AND 1
#define RGN_XOR 3
#define RGN_DIFF 4
#define RGN_COPY 5
#define NULLREGION 1
#define SIMPLEREGION 2
#define COMPLEXREGION 3
#define r_ERROR 0
Declare Long CombineRgn IN WIN32API Long hrgnDest, Long hrgnSrc1, Long hrgnSrc2, Long fnCombineMode
Declare Long SetWindowRgn IN WIN32API Long hWnd, Long hRgn, String bRedraw
Declare Long CreateEllipticRgn IN WIN32API Long X1, Long Y1, Long X2, Long Y2
Declare Long CreateRectRgn IN WIN32API Long X1, Long Y1, Long X2, Long Y2
Declare Long DeleteObject IN WIN32API LONG hObject

PUBLIC ofrm,oFrm2,oFrm3,oFrm4,oFrm5
ofrm=CREATEOBJECT("MyForm")
oFrm.visible=.T.
ofrm2=CREATEOBJECT("MyForm2")
oFrm2.visible=.T.
ofrm3=CREATEOBJECT("MyForm3")
oFrm3.visible=.T.
ofrm4=CREATEOBJECT("MyForm4")
oFrm4.visible=.T.
ofrm5=CREATEOBJECT("MyForm5")
oFrm5.visible=.T.

DEFINE CLASS MyForm as Form
	PROCEDURE lOAD
		This.reshape
	ENDPROC
	PROCEDURE resize
		This.reshape
	ENDPROC
	PROCEDURE reshape
		LOCAL x1,x2
		x1=CreateEllipticRgn(0,0,(This.width+2*SYSMETRIC(3))*3/4,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		x2=CreateEllipticRgn((This.width+2*SYSMETRIC(3))/4,0,(This.width+2*SYSMETRIC(3)),This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		IF CombineRgn(x1,x1,x2,RGN_DIFF)!=r_ERROR
			DeleteObject(x2)
			SetWindowRgn(thisform.hwnd, x1, "True")
		ENDIF
	ENDPROC
ENDDEFINE

DEFINE CLASS MyForm2 as Form
	left=400
	PROCEDURE lOAD
		This.reshape
	ENDPROC
	PROCEDURE resize
		This.reshape
	ENDPROC
	PROCEDURE reshape
		LOCAL x1,x2
		x1=CreateEllipticRgn(0,0,(This.width+2*SYSMETRIC(3))*3/4,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		x2=CreateEllipticRgn((This.width+2*SYSMETRIC(3))/4,0,(This.width+2*SYSMETRIC(3)),This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		IF CombineRgn(x1,x1,x2,RGN_XOR)!=r_ERROR
			DeleteObject(x2)
			SetWindowRgn(thisform.hwnd, x1, "True")
		ENDIF
	ENDPROC
ENDDEFINE

DEFINE CLASS MyForm3 as Form
	Top=300
	PROCEDURE lOAD
		This.reshape
	ENDPROC
	PROCEDURE resize
		This.reshape
	ENDPROC
	PROCEDURE reshape
		LOCAL x1,x2
		x1=CreateEllipticRgn(0,0,(This.width+2*SYSMETRIC(3))*3/4,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		x2=CreateEllipticRgn((This.width+2*SYSMETRIC(3))/4,0,(This.width+2*SYSMETRIC(3)),This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		IF CombineRgn(x1,x1,x2,RGN_OR)!=r_ERROR
			DeleteObject(x2)
			SetWindowRgn(thisform.hwnd, x1, "True")
		ENDIF
	ENDPROC
ENDDEFINE

DEFINE CLASS MyForm4 as Form
	nSteps=100
	Top=300
	left=400
	PROCEDURE lOAD
		This.reshape
	ENDPROC
	PROCEDURE resize
		This.reshape
	ENDPROC
	PROCEDURE reshape
		LOCAL x1,x2
		x1=CreateEllipticRgn(0,0,(This.width+2*SYSMETRIC(3))*(1+This.nSteps)/2/This.nSteps,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		FOR lni=1 TO This.nSteps-1
			x2=CreateEllipticRgn((This.width+2*SYSMETRIC(3))*(lni)/2/This.nSteps,0,(This.width+2*SYSMETRIC(3))*(lni+1+This.nSteps)/2/This.nSteps,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
			CombineRgn(x1,x1,x2,RGN_OR)
			DeleteObject(x2)
		NEXT
		SetWindowRgn(thisform.hwnd, x1, "True")
	ENDPROC
ENDDEFINE

DEFINE CLASS MyForm5 as Form
	nSteps=300
	nStepW=20
	Top=300
	Left=800
	PROCEDURE lOAD
		This.reshape
	ENDPROC
	PROCEDURE resize
		This.reshape
	ENDPROC
	PROCEDURE reshape
		IF This.nSteps<This.nStepW
			RETURN
		ENDIF
		LOCAL x1,x2
		x1=CreateEllipticRgn(0,0,(This.width+2*SYSMETRIC(3))*This.nStepW/This.nSteps,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
		FOR lni=1 TO This.nSteps-This.nStepW+1
			x2=CreateEllipticRgn((This.width+2*SYSMETRIC(3))*lni/This.nSteps,0,(This.width+2*SYSMETRIC(3))*(lni+This.nStepW)/This.nSteps,This.height+2*SYSMETRIC(4)+SYSMETRIC(9))
			CombineRgn(x1,x1,x2,RGN_OR)
			DeleteObject(x2)
		NEXT
		SetWindowRgn(thisform.hwnd, x1, "True")
	ENDPROC
ENDDEFINE





My respects

ENTIRE THREAD

DIFFRERENT SHAPE VFP FORMS Posted by David Mustakim @ 1/19/2014 7:48:34 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Rick C. Hodgin @ 1/19/2014 1:46:10 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by David Mustakim @ 1/19/2014 3:18:13 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Rick C. Hodgin @ 1/19/2014 7:03:23 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by David Mustakim @ 1/19/2014 7:16:59 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Vilhelm-Ion Praisach @ 1/20/2014 9:17:24 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by David Mustakim @ 1/20/2014 10:16:40 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Vilhelm-Ion Praisach @ 1/20/2014 11:22:19 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by David Mustakim @ 1/20/2014 11:32:48 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Vilhelm-Ion Praisach @ 1/19/2014 7:44:58 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Rick C. Hodgin @ 1/19/2014 11:17:05 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Jun Tangunan @ 1/20/2014 12:00:40 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Tony Vignone @ 1/19/2014 8:48:24 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by David Mustakim @ 1/19/2014 8:53:07 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Tony Vignone @ 1/20/2014 3:35:10 AM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Vilhelm-Ion Praisach @ 1/19/2014 9:27:53 PM
RE: DIFFRERENT SHAPE VFP FORMS Posted by Tony Vignone @ 1/20/2014 3:33:57 AM