Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible to make two or more panes with splitter bar?
Message
De
08/12/2003 20:02:50
 
 
À
07/12/2003 07:10:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00856642
Message ID:
00857031
Vues:
23
Hi Marcia,

This is great! I obviously dont do drag and drop (oops). Think it's about time.

A few more questions though:

- how do you make the splitter bar (shape) look like it's 'embossed'? (I tried it out and make SpecialEffect to 3D but still doesnt look like a 'legit' splitter bar

- so in your example the left pane is the treeview control and the right pane is shpDataLocator with the splitter bar (also a shape right?) in between the two controls - why is a shape control used on the right pane? can it contain (like a vfp container) other controls like labels and textboxes

Sorry if my questions seem stupid.

Dennis


>Hello Dennis.
>
>Is it possible to use pure VFP to create a control or container class which can be dropped on a form that contains two panes with a splitter bar similar to popular interfaces like Windows Explorer or Outlook?
>
>Sure. I have a form class with a TreeView on the left and an editing pane on the right. The "splitter" bar is nothing more than a VFP shape with its MousePointer property set to "9 - Size W E". A transparent shape (called shpDataLocator) sits behind the data editing pane. This code in the "splitter" bar's MouseDown:
>
>
>*!* 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" bar's MouseUP:
>
>
>This.Drag( 2 )
>
>
>This code in shpDataLocator's DragDrop():
>
>
>*** 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
>
>
>Finally, this code goes in the form's SizeControl's method:
>
>
>LPARAMETERS toBar, tnXCoord, tnYCoord
>LOCAL lnBarLeft, lnTreeWidth, lnDataContainerLeft, lnDataContainerWidth
>
>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