Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deep Level on AutoResize!! Help!
Message
De
19/03/1998 09:18:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Deep Level on AutoResize!! Help!
Divers
Thread ID:
00085631
Message ID:
00085631
Vues:
63
I want to fix the min. size when resize to start width and height!
and fix the max. size for resize to just FIT the screen with a
MsOffice BAR at Right!

i.e. Allow Resize from 558x406 to 759x483
(Current revolution is 800x600)

I have study the download autoreszie in File Section already...
And using the concept, I make following code:

* FReports.Init
THISFORM.DWIDTH = THIS.WIDTH && Default Min. Width and Height!!
THISFORM.DHEIGHT = THIS.HEIGHT
THISFORM.CWIDTH = THIS.WIDTH && Current Width and Height!!
THISFORM.CHEIGHT = THIS.HEIGHT

* FReports.Resize
#DEFINE DEFWIDTH	759
#DEFINE DEFHEIGHT	483

LOCAL NWIDTH, NHEIGHT
LOCAL NWIDTHRATE, NHEIGHTRATE

WITH THIS
	.LOCKSCREEN = .T.
	.TOP = 0
	.LEFT = 0
	DO CASE
	CASE .WIDTH<THISFORM.DWIDTH
	  .WIDTH = THISFORM.DWIDTH
	  NWIDTHRATE = .WIDTH / THISFORM.CWIDTH
	CASE .WIDTH>DEFWIDTH
	  NWIDTHRATE = DEFWIDTH / THISFORM.CWIDTH
	  .WIDTH = DEFWIDTH
	OTHERWISE
	  NWIDTHRATE = .WIDTH / THISFORM.CWIDTH
	ENDCASE
	DO CASE
	CASE .HEIGHT<THISFORM.DHEIGHT
	  .HEIGHT = THISFORM.DHEIGHT
	  NHEIGHTRATE = .HEIGHT / THISFORM.CHEIGHT
	CASE THIS.HEIGHT>DEFHEIGHT
	  NHEIGHTRATE = DEFHEIGHT / THISFORM.CHEIGHT
	  .HEIGHT = DEFHEIGHT
	OTHERWISE
	  NHEIGHTRATE = .HEIGHT / THISFORM.CHEIGHT
	ENDCASE

	.CHEIGHT = .HEIGHT
	.CWIDTH = .WIDTH
	*-- Resize and reposition current form
*	.Width	= .Width * nWidthRate
*	.Height	= .Height * nHeightRate
*	.Left	= .Left * nWidthRate
*	.Top	= .Top * nHeightRate

	*-- Resize and reposition all objects for the current form
	FOR nControlLoop = 1 TO .ControlCount
	.Controls[nControlLoop].Width = ;
		.Controls[nControlLoop].Width * nWidthRate
	.Controls[nControlLoop].Height = ;
		.Controls[nControlLoop].Height * nHeightRate
	.Controls[nControlLoop].Left = ;
		.Controls[nControlLoop].Left * nWidthRate
	.Controls[nControlLoop].Top = ;
		.Controls[nControlLoop].Top * nHeightRate

	IF PEMSTATUS(.Controls[nControlLoop],"FontSize",5)
	.Controls[nControlLoop].FontSize = ;
	ROUND(.Controls[nControlLoop].FontSize * NHeightRate,0)
	ENDIF

	ENDFOR
	.LOCKSCREEN = .F.
ENDWITH
Generally, It works well if user make a GREAT Change
on resizing form....
But Problem is: If user just move sightly on resize...
The font size will not change....
(Notice that: Original is even worse! Use Int() not Round())

Should I use Original Window Revolution on Finding the
scale to enlarge the fonts?!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Répondre
Fil
Voir

Click here to load this message in the networking platform