• Welcome to Jose's Read Only Forum 2023.
 

(Phoenix) Dockbar Control

Started by Theo Gottwald, May 19, 2007, 03:39:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

'###############################################################################
' BEGIN phnx_DockBar_Class32
'###############################################################################

' Dock edges
%DOCKED_NONE      = 0
%DOCKED_LEFT      = 1
%DOCKED_TOP       = 2
%DOCKED_RIGHT     = 3
%DOCKED_BOTTOM    = 4
%DOCKED_NEAREST   = 5

' Hit-test values
%DB_HTNOWHERE     = 0
%DB_HTCAPTION     = 1
%DB_HTCLOSE       = 2
%DB_HTFRAME       = 3
%DB_HTRESIZE      = 4
%DB_HTRESIZEAUX   = 5
%DB_HTEXPAND      = 6

' Used by DBN_SIZECHANGED notification
TYPE DOCKBARSIZE  ' dbs
  hdr             AS NMHDR
  cxClient        AS LONG         ' width of client area of control
  cyClient        AS LONG         ' height of client area of control
END TYPE

' Used by DBN_DOCKING and DBN_DOCKED notifications
TYPE DOCKBAR      ' db
  hdr             AS NMHDR
  lEdgeNew        AS LONG         ' edge on which the control is docked or is about to be docked
  lEdgeOld        AS LONG         ' edge on which the control was docked
END TYPE

' Used by the DBN_NONCLIENTACTIVATE notification
TYPE DOCKBARNCACTIVATE  ' dbnca
  hdr             AS NMHDR
  fState          AS LONG         ' flag indicating the active/inactive state of the caption
  hWnd            AS DWORD        ' handle of window being activated or deactivated
  hWndFloating    AS DWORD        ' handle of floating window
END TYPE

' Used by the DBN_ACTIVATE notification
TYPE DOCKBARACTIVATE  ' dba
  hdr             AS NMHDR
  fActive         AS LONG         ' flag indicating whether the window is being activated or deactivated
  fMinimized      AS LONG         ' the minimized state of the window being activated or deactivated
  hWnd            AS DWORD        ' handle of window being activated or deactivated
END TYPE

' fActive: specifies whether the window is being activated or deactivated. This parameter
'          can be one of the following values:
'          Value          Meaning
'          ------         -------
'          WA_ACTIVE      Activated by some method other than a mouse click
'                         (FOR example, by a call to the SetActiveWindow function
'                         or by use of the keyboard interface to select the window).
'          WA_CLICKACTIVE Activated by a mouse click.
'          WA_INACTIVE    Deactivated.
' fMinimized: specifies the minimized state of the window being activated or deactivated.
'             A nonzero value indicates the window is minimized.
' hWnd: identifies the window being activated or deactivated, depending on the value
'       of the fActive parameter. If the value of fActive is WA_INACTIVE, hwnd is the
'       handle of the window being activated. If the value of fActive is WA_ACTIVE or
'       WA_CLICKACTIVE, hwnd is the handle of the window being deactivated. This handle
'       can be NULL.

' Used by the DBN_SHOW notification
TYPE DOCKBARSHOWCONTROL ' dbsc
  hdr             AS NMHDR
  fShow           AS LONG         ' flag indicating whether the control is being hidden or shown
END TYPE

' fShow: specifies whether the control is being shown.
'        It is TRUE if the control is being shown or
'        FALSE if the control is being hidden.

' Used by the DBN_DRAGRESIZED notification
TYPE DOCKBARDRAGRESIZED ' dbdr
  hdr             AS NMHDR
  bResizebar      AS BYTE         ' resizebar that was dragged (DB_HTRESIZE, DB_HTRESIZEAUX)
END TYPE

' phnx_DockBar_Class32 styles
' ---------------------------
%DBS_CAPTION                                = &H0010??
' The control displays a caption when it is docked.

%DBS_GRIPPER                                = &H0020??
' The control displays drag grips when it is docked.

%DBS_RESIZEABLE                             = &H0040??
' The control is resizable.  It displays a sizing bar when it is docked.

%DBS_NOFLOAT                                = &H0080??
' The control can be moved to different edges of its parent client area but cannot be undocked from its parent window.

%DBS_NODIVIDER                              = &H0100??
' The control does not draw a dividing highlight on its docking edge.

%DBS_NOCLOSE                                = &H0200??
' The hide button is not displayed when the control is docked and is disabled when the control is undocked.

%DBS_DYNAMICRESIZE                          = &H0400??
' The control is resized as its sizing bar is dragged.

%DBS_TOOLTIPS                               = &H0800??
' The control creates a tooltip control when it is created.

%DBS_HORZCAPTION                            = &H1000??
' The caption or gripper is always drawn horizontally.

%DBS_STACK                                  = &H2000??
' Controls are tiled end to end along the edge of the parent window.
' By default, controls are tiled side by side along an edge.

%DBS_EXPAND                                 = &H4000??
' The control displays an expand button which can be used to expand or collapse it.

%DBS_RAISED                                 = &H8000??
' The free edge of a docked nonresizeable control has a raised appearance.

' phnx_DockBar_Class32 messages
' -----------------------------
%DBM_DOCKWINDOW                             = %WM_USER + &H0065??
' Purpose: Sent to dock or undock a control.
' wParam:  If TRUE, lParam is the address of a POINTAPI structure
' lParam:  The edge or screen coordinates at which the control should be docked
' Return:  No Return value.

%DBM_HIDEWINDOW                             = %WM_USER + &H0066??
' Purpose: Sent to show or hide a control.
' wParam:  show or hide flag. If TRUE, the control is hidden, If FALSE, it is shown
' lParam:  N/A
' Return:  N/A

%DBM_GETDOCKEDEDGE                          = %WM_USER + &H0067??
' Purpose: Sent to determine on which edge of the parent's client area
'          the specified control is docked.
' wParam:  N/A
' lParam:  N/A
' Return:  The return value is the edge on which the control is docked.

%DBM_GETIDEALDOCKEDSIZE                     = %WM_USER + &H0068??
' Purpose: Sent to get the initial width (vertical docking) and height
'          (horizontal docking) the control assumes when it docks.
' wParam:  N/A
' lParam:  N/A
' Return:  The low-order word of the return value is the width,
'          and the high-order word is the height.

%DBM_SETIDEALDOCKEDSIZE                     = %WM_USER + &H0069??
' Purpose: Sent to set the initial width (vertical docking) and height
'          (horizontal docking) the control assumes when it docks.  A
'          value of zero sets the ideal size to the default.
' wParam:  N/A
' lParam:  the low-order word is the width and the hight-order word is the height
' Return:  No return value.

%DBM_GETDOCKINGRECT                         = %WM_USER + &H006A??
' Purpose: Sent to retrieve the client coordinates of the bounding
'          rectangle of the section of the parent's client area that
'          is not covered by toolbars, statusbars, and docking controls.
' wParam:  N/A
' lParam:  address of RECT structure to receive the coordinates
' Return:  No return value.

%DBM_GETBACKGROUNDCOLOR                     = %WM_USER + &H006B??
' Purpose: Set to retrieve the backgound color of the control.
' wParam:  N/A
' lParam:  N/A
' Return:  The return value is the current background color.

%DBM_SETBACKGROUNDCOLOR                     = %WM_USER + &H006C??
' Purpose: Sent to set the new background color of the control. Set
'          lParam to &HFFFFFFFF to set the default color.
' wParam:  N/A
' lParam:  the new background color
' Return:  The return value is the previous background color.

%DBM_GETTOOLTIPS                            = %WM_USER + &H006D??
' Purpose: Sent to retrieve the handle to the tooltip control, if any, associated with a docking control.
' wParam:  N/A
' lParam:  N/A
' Return:  Returns the handle to the tooltip control or NULL if the docking control has no associated tooltip.

%DBM_SETTOOLTIPS                            = %WM_USER + &H006E??
' Purpose: Sent to associate a tooltip control with a docking control.
' wParam:  Handle to the tooltip control
' lParam:  N/A
' Return:  No return value.

%DBM_SETSIZEBARPOS                          = %WM_USER + &H006F??
' Purpose: Sent to change the position of the size bar in a docked control.
'          The amount of change can be positive or negative.
' wParam:  the size bar to change (DB_HTRESIZE or DB_HTRESIZEAUX)
' lParam:  the amount by which the current position changes
' Return:  No return value.

%DBM_SETEDGE                                = %WM_USER + &H0070??
' Purpose: Sent to set the edge on which the control is docked.  This
'          message does not dock the control.  It is used during the
'          initial layout of docking controls on the parent window.
' wParam:  N/A
' lParam:  The edge on which the control is docked
' Return:  No return value.

%DBM_LAYOUT                                 = %WM_USER + &H0073??
' Purpose: Sent to adjust docked controls when the size of the docking area changes.
' wParam:  N/A
' lParam:  N/A
' Return:  No return value.

%DBM_SETMINMAXTRACKSIZE                     = %WM_USER + &H0074??
' Purpose: Sets the minimum and maximum sizes that the control can be sized
'          to by dragging its borders when it is resizeable and not docked.
' wParam:  low-order word is the minimum width, high-order word the minimum height
' lParam:  low-order word is the maximum width, high-order word the maximum height
' Return:  No return value.

%DBM_COLLAPSE                               = %WM_USER + &H0075??
' Purpose: Sent to toggle the collapsed state of the control.  If the control
'          is collapsed, it is expanded.  If it is expanded, it is collapsed.
' wParam:  N/A
' lParam:  N/A
' Return:  No return value.

' phnx_DockBar_Class32 notifications
' ----------------------------------
%DBN_BEGINDRAG                              = %WM_USER + &H0064??
' Purpose: Sent when the user begins dragging a docked control.
' wParam:  identifier of control
' lParam:  address of NMHDR structure
' Return:  Return TRUE to prevent the operation, FALSE to allow it.

%DBN_SIZECHANGED                            = %WM_USER + &H0065??
' Purpose: Sent when the size of the control changes.
' wParam:  identifier of control
' lParam:  address of DOCKBARSIZE structure
' Return:  No return value.

%DBN_DOCKING                                = %WM_USER + &H0066??
' Purpose: Sent when a control is about to be docked.
' wParam:  identifier of control
' lParam:  address of DOCKBAR structure
' Return:  Return TRUE to prevent the docking operation.

%DBN_DOCKED                                 = %WM_USER + &H0067??
' Purpose: Sent after the control is docked or undocked.
' wParam:  identifier of control
' lParam:  address of DOCKBAR structure
' Return:  No return value.

%DBN_RCLICK                                 = %WM_USER + &H0068??
' Purpose: Sent when the user clicks the control with the right mouse button.
'          This message can be used to display a context menu that is
'          associated with the control.
' wParam:  identifier of control
' lParam:  address of NMHDR structure
' Return:  Return TRUE to prevent the default operation.

%DBN_NONCLIENTACTIVATE                      = %WM_USER + &H0069??
' Purpose: Sent when the caption of the undocked control is about
'          to change to indicate an active or inactive state.  This
'          notification requires the DBS_CAPTION style.
' wParam:  identifier of control
' lParam:  address of DOCKBARNCACTIVATE structure
' Return:  No return value.

%DBN_ACTIVATE                               = %WM_USER + &H006A??
' Purpose: Sent when the undocked control is about to be activated or deactivated.
' wParam:  identifier of control
' lParam:  address of DOCKBARACTIVATE structure
' Return:  N/A

%DBN_CLICKEDONDISABLED                      = %WM_USER + &H006B??
' Purpose: Sent when the user clicks the disabled control with the left mouse button.
' wParam:  identifier of control
' lParam:  address of NMHDR structure
' Return:  No return value.

%DBN_SHOW                                   = %WM_USER + &H006C??
' Purpose: Sent when the control is about to be hidden or shown.
' wParam:  identifier of control
' lParam:  address of DOCKBARSHOWCONTROL structure
' Return:  The return value is ignored.

%DBN_DRAGRESIZED                            = %WM_USER + &H006D??
' Purpose: Sent when the user has dragged a resize bar or has collapsed
'          or expanded the control.  This notification is also sent in response
'          to the DBM_HIDEWINDOW message.
' wParam:  identifier of control
' lParam:  address of DOCKBARDRAGRESIZED structure
' Return:  The return value is ignored.

DECLARE FUNCTION InitDockingControl LIB "DOCKBAR.DLL" ALIAS "InitDockingControl" () AS LONG

'###############################################################################
' END phnx_DockBar_Class32
'###############################################################################