PDA

View Full Version : Docking Pane little trick



Nicole Wright
13-Feb-2010, 07:49 PM
I was frustrated by the inability to see a docking panel in the studio so I searched around and tried different things then came up with this little trick, sorry if you all already know about this but if you don't hope it helps.

Create a subclass of the dbcontainer3d: code below


Use DFClient.pkg
{ DesignerClass = cDTView } //this tricks the studio
Class cPanelContainer is a dbContainer3d

Procedure Construct_Object
Forward Send Construct_Object
Set Location to 0 0 //this places the control in the studio at 0 0 at design time
End_Procedure
Procedure End_Construct_Object
Forward Send End_Construct_Object
End_Procedure
Procedure Activating
Set location to -1000 -1000 // this hides the control on activation
// so it doesn't float around at runtime
Forward Send Activating
End_Procedure
End_Class


Then create your panel package example below, the key thing to remember is not to set the location property in your package:



Use cPanelContainer.pkg
Object oPerformancePanel is a cPanelContainer
Set Border_Style to Border_None
Set Size to 358 160
End_Object


Now you can drag and drop controls in the studio design view.

Regards,
Nick

Pieter van Dieren
14-Feb-2010, 11:24 AM
Nick,

Thanks.
For docking panes that host DDO's, you can use this:



Use Dfclient.pkg

{ DesignerClass = cDTView }
{ OverrideProperty=Border_Style InitialValue=Border_None }
{ DDOHost=True } // This allows you to maintain your DDO structure in the studio as well.
Class cDbDockingPane is a DbContainer3d

// Construct_Object
Procedure Construct_Object
Forward Send Construct_Object
Set Location to 0 0
Set Border_Style to Border_None
End_Procedure

Procedure End_Construct_Object
Forward Send End_Construct_Object
End_Procedure

Procedure Activating
Set location to -1000 -1000
Forward Send Activating
End_Procedure
End_Class

Nicole Wright
14-Feb-2010, 10:33 PM
Thanks Pieter,

Nice.