]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/docs/latex/fl/body.tex
Don't use a saved label size incase the size changes. Patch from Hong Yuan.
[wxWidgets.git] / contrib / docs / latex / fl / body.tex
index 3f9576640b0b0770ddda0686d6e71b76220268b3..e2cb8e4c09642d86bb57c6a97acd62ce60018ca2 100644 (file)
@@ -1,3 +1,14 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name:        body.tex
+%% Purpose:     FL documenation
+%% Author:      wxWidgets Team
+%% Modified by:
+%% Created:
+%% RCS-ID:      $Id$
+%% Copyright:   (c) wxWidgets Team
+%% License:     wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 \chapter{Introduction}\label{introduction}
 \pagenumbering{arabic}%
 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
@@ -30,7 +41,7 @@ is given as the moving bar displaces other bars.
 Other features: the splitter bar shows a dotted thick line as
 it's dragged. Single-clicking on a row handle minimizes it to
 a horizontal tab which is given its own narrow row. This allows
-the user to temporarily hide a row whilst allowing quick access
+the user to temporarily hide a row while allowing quick access
 to it when required.
 
 A close button (x) hides a bar completely. You can get it back again
@@ -109,53 +120,53 @@ user interface as illustrated in \helpref{What is FL?}{whatisfl}.
 #include "wx/fl/dyntbarhnd.h"    // control-bar dimension handler for it
 
 MyFrame::MyFrame(wxFrame *frame)
-    : wxFrame( frame, -1, "wxWindows 2.0 wxFrameLayout Test Application", wxDefaultPosition, 
-          wxSize( 700, 500 ), 
-          wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | 
-          wxTHICK_FRAME   | wxSYSTEM_MENU  | wxCAPTION, 
+    : wxFrame( frame, wxID_ANY, "wxWindows 2.0 wxFrameLayout Test Application", wxDefaultPosition,
+          wxSize( 700, 500 ),
+          wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
+          wxRESIZE_BORDER | wxSYSTEM_MENU  | wxCAPTION,
           "freimas" )
 {
     mpClientWnd = CreateTextCtrl( "Client window" );
-    
+
     mpLayout = new wxFrameLayout( this, mpClientWnd );
-    
+
     mpLayout->SetUpdatesManager( new cbGCUpdatesMgr() );
-    
+
     // setup plugins for testing
     mpLayout->PushDefaultPlugins();
-    
+
     mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // fancy "X"es and bevel for bars
     mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) );
     mpLayout->AddPlugin( CLASSINFO( cbRowDragPlugin  ) );
     mpLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) );
     mpLayout->AddPlugin( CLASSINFO( cbSimpleCustomizationPlugin ) );
-    
+
     // drop in some bars
-    cbDimInfo sizes0( 200,45, // when docked horizontally      
-                      200,85, // when docked vertically        
-                      175,35, // when floated                  
+    cbDimInfo sizes0( 200,45, // when docked horizontally
+                      200,85, // when docked vertically
+                      175,35, // when floated
                       FALSE,  // the bar is not fixed-size
                       4,      // vertical gap (bar border)
                       4       // horizontal gap (bar border)
-                    ); 
-    
-    cbDimInfo sizes1( 150,35, // when docked horizontally      
-                      150,85, // when docked vertically        
-                      175,35, // when floated                  
+                    );
+
+    cbDimInfo sizes1( 150,35, // when docked horizontally
+                      150,85, // when docked vertically
+                      175,35, // when floated
                       TRUE,   // the bar is not fixed-size
                       4,      // vertical gap (bar border)
                       4       // horizontal gap (bar border)
-                    ); 
-    
-    cbDimInfo sizes2( 175,45, // when docked horizontally      
-                      175,37, // when docked vertically        
-                      170,35, // when floated                  
+                    );
+
+    cbDimInfo sizes2( 175,45, // when docked horizontally
+                      175,37, // when docked vertically
+                      170,35, // when floated
                       TRUE,   // the bar is not fixed-size
                       4,      // vertical gap (bar border)
                       4,      // horizontal gap (bar border)
                       new cbDynToolBarDimHandler()
-                    ); 
-    
+                    );
+
     mpLayout->AddBar( CreateTextCtrl("Hello"),  // bar window
                       sizes0, FL_ALIGN_TOP,     // alignment ( 0-top,1-bottom, etc)
                       0,                        // insert into 0th row (vert. position)
@@ -163,7 +174,7 @@ MyFrame::MyFrame(wxFrame *frame)
                       "InfoViewer1",            // name for reference in customization pop-ups
                       TRUE
                     );
-    
+
     mpLayout->AddBar( CreateTextCtrl("Bye"),    // bar window
                       sizes0, FL_ALIGN_TOP,     // alignment ( 0-top,1-bottom, etc)
                       1,                        // insert into 0th row (vert. position)
@@ -171,7 +182,7 @@ MyFrame::MyFrame(wxFrame *frame)
                       "InfoViewer2",            // name for reference in customization pop-ups
                       TRUE
                     );
-    
+
     mpLayout->AddBar( CreateTextCtrl("Fixed0"), // bar window
                       sizes1, FL_ALIGN_TOP,     // alignment ( 0-top,1-bottom, etc)
                       0,                        // insert into 0th row (vert. position)
@@ -179,21 +190,21 @@ MyFrame::MyFrame(wxFrame *frame)
                       "ToolBar1",               // name for reference in customization pop-ups
                       TRUE
                     );
-    
+
     wxDynamicToolBar* pToolBar = new wxDynamicToolBar();
-    
+
     pToolBar->Create( this, -1 );
-    
+
     // 1001-1006 ids of command events fired by added tool-buttons
-    
+
     pToolBar->AddTool( 1001, BMP_DIR "new.bmp" );
     pToolBar->AddTool( 1002, BMP_DIR "open.bmp" );
     pToolBar->AddTool( 1003, BMP_DIR "save.bmp" );
-    
+
     pToolBar->AddTool( 1004, BMP_DIR "cut.bmp" );
     pToolBar->AddTool( 1005, BMP_DIR "copy.bmp" );
-    pToolBar->AddTool( 1006, BMP_DIR "paste.bmp" );   
-    
+    pToolBar->AddTool( 1006, BMP_DIR "paste.bmp" );
+
     mpLayout->AddBar( pToolBar,             // bar window (can be NULL)
                       sizes2, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc)
                       0,                    // insert into 0th row (vert. position)
@@ -201,14 +212,58 @@ MyFrame::MyFrame(wxFrame *frame)
                       "ToolBar2",           // name for reference in customization pop-ups
                       FALSE
                     );
-    
+
     mpLayout->EnableFloating( TRUE ); // off, thinking about wxGtk...
 }
 
 MyFrame::~MyFrame()
 {
-    if ( mpLayout) 
+    if ( mpLayout)
         delete mpLayout; // should be destroyed manually
 }
 \end{verbatim}
 
+\section{Controlling dragging behaviour}\label{controllingdragbehav}
+
+Various pane-dragging behaviours are supported. FL can
+show an outline of where the window would be docked
+if you stopped dragging at that point.
+
+This is a list of properties of interest in the cbCommonPaneProperties
+structure:
+
+\begin{verbatim}
+    bool mRealTimeUpdatesOn;     // default: ON
+    bool mOutOfPaneDragOn;       // default: ON
+    bool mExactDockPredictionOn; // default: OFF
+    bool mNonDestructFrictionOn; // default: OFF
+\end{verbatim}
+
+To get behaviour similar to Microsoft's DevStudio drag-ghost behaviour,
+mRealTimeUpdatesOn have to be set to FALSE, for example:
+
+\begin{verbatim}
+    cbCommonPaneProperties props;
+    ....
+    ....
+    props.mRealTimeUpdatesOn = FALSE;
+    fl->SetPaneProperties( props, wxALL_PANES );
+\end{verbatim}
+
+{\it mOutOfPaneDragOn} specifies whether bars can be dragged
+away from this pane. (Note: this may not currently be working.)
+
+{\it mExactDockPredictionOn} is only relevant when {\it mRealTimeUpdatesOn} is FALSE,
+and then the hint rectangle behaves a little jumpily. It tries to show
+exatly how the bar would look and where it would be docked if the dragging finished right
+now, i.e. the final position, with all the 'friction-physics' calculated.
+Otherwise the hint flies smothly above the surface only hinting whether the bar
+will be docked vertically or horizontally if dropped now.
+This is a feature you won't find anywhere else!
+
+{\it mNonDestructFirctionOn} causes the bars not being dragged
+to stay where they are, while the currently dragged one is 'diving'
+through the underlaying panes, docking itself in and out in real time.
+Otherwise the stationary bars would be pushed around messing up the composition permanently.
+This flag is irelevant when {\it mRealTimeUpdatesOn} is FALSE, as the ghost-rect
+does not do any docking until the drag finishes.