Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Splitter Winows behaviour in VFP
Message
De
07/04/2003 07:35:30
 
 
À
07/04/2003 06:55:22
Devrishi Bhogra
Escorts Claas Limited
Faridabad, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00774630
Message ID:
00774636
Vues:
14
Can any body guide me in implementing the "Splitter Windows" behaviour in Visual Foxpro .

You drop a shape onto the form that looks like a splitter bar. You also drop two transparent shapes on top of each "window" in your form. This code in the splitter shape's mouse down:
LPARAMETERS nButton, nShift, nXCoord, nYCoord
*!* Put the shape on top so we can drag and drop on it
Thisform.shpDataLocator.ZOrder( 0 )
This.Drag( 1 )
and this code in the splitter shape's MouseUp()
LPARAMETERS nButton, nShift, nXCoord, nYCoord
This.Drag( 2 )
This code in the DragDrop() method of the two transparent shapes over the "windows in your form:


LPARAMETERS toSource, tnXCoord, tnYCoord
*** See if we are re-sizing
IF LOWER( toSource.Name ) = 'shpsplitter'
Thisform.SizeControls( toSource, tnXCoord, tnYCoord )
*!* Put the shape on the bottom after we have dropped
This.ZOrder( 1 )
ELSE
DODEFAULT( toSource, tnXCoord, tnYCoord )
ENDIF


Code like this in the form's SizeControls() method:
LPARAMETERS toBar, tnXCoord, tnYCoord
LOCAL lnBarLeft, lnTreeWidth, lnDataContainerLeft, lnDataContainerWidth

*** This will always be on a form so always lock it
ThisForm.LockScreen = .T.

WITH ThisForm
  *** Save the position of the bar's left position
  lnBarLeft = tnXCoord 
  toBar.Left = lnBarLeft
  *** Check for minimum widths of the tree and list
  Thisform.CheckMinWidth( toBar, @lnBarLeft )
  *** If we have altered the bar position, do it here
  IF lnBarLeft # toBar.Left
    toBar.Left = lnBarLeft
  ENDIF
  *** Calculate the Left Position of the Data Container
  lnDataContainerLeft = lnBarLeft + toBar.Width
  *** Calculate the Width of the TreeView
  lnTreeWidth = toBar.Left - .oTree.Left 
  *** Calculate the Width of the Data Container
  lnDataContainerWidth = .Width - ( lnBarLeft + toBar.Width + 15 )

  *** Now set the heights of the controls
  .oTree.Width = lnTreeWidth
  IF TYPE( 'Thisform.oDataContainer' ) = 'O' AND NOT ISNULL( Thisform.oDataContainer )
    .oDataContainer.Left = lnDataContainerLeft 
    .oDataContainer.Width = lnDataContainerWidth 
  ENDIF
ENDWITH
*!* And send the data locator shape to the back again
Thisform.shpDataLocator.ZOrder( 1 )
ThisForm.LockScreen = .F.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform