BaseBar Class Reference

#include <basebar.h>

Inheritance diagram for BaseBar:

GalleryBar List of all members.

Public Member Functions

 BaseBar ()
 The BaseBar constructor.
virtual ~BaseBar ()
 BaseBar destructor.
INT32 Create (DialogBarOp *Op)
 Creates a BaseBar window.
BOOL Hide (DialogBarOp *Op)
 Creates a BaseBar window.
BOOL Show (DialogBarOp *Op)
 Creates a BaseBar window.
BOOL Recreate (DockBarType DockBarTyp, BaseBar *BaseBar, DialogBarOp *Op, BOOL CanCopy)
BOOL RecreateAt (KernelBarPos Pos, DockBarType DockBarTyp, BaseBar *BaseBar, DialogBarOp *Op, wxWindow *OldHwnd)
 ReCreates an existing bar after a change of controlsize - as the bar stays in the same dock we don't need to release / reattach - we need only inform the docking bar of the new HWND.
void ConvertToolbarOnStartup ()
 Converts the toolbar from being docked to being floating.
BOOL FormatToolBar (INT32 NewWidth)
DialogBarOpGetDialogBarOp ()
wxRect GetBarsDims (DockBarType DockBarType)
 To return a pointer to a rectangle of bar size To return the size of the bar.
BOOL TidyUpControlDrag ()
 called to tidy up at the end of a control drag
BOOL TidyUpBarDrag ()
 called to tidy up at the end of a Bar drag
UINT32 GetNearestControl (wxPoint DropPoint)
 Return the nearest control given a mouse position in client coords.
BOOL IsBarActive ()
BOOL IsInfoBar ()
BOOL IsBarAllCtlBar ()
void SetBarActiveState (BOOL State)
virtual wxRect GetFormatRect (DockBarType BarType)
 Get cached format size - if none available format and cache.
void InitFormatRects ()
 Set all Cache Format rectangles empty.
String_32 GetBarName ()
LRESULT WindowProc (UINT32 message, WPARAM wParam, LPARAM lParam)
 The BaseBar's WindowProc firstly sends the message to the dialog manager so that it can dispatch it to the appropriate DialogBarOp (if neccessary). Then the message is processed as normal.

Static Public Member Functions

static BOOL DeclarePreferences ()
 Declares any preferences that the BaseBar class needs to decalre.
static BOOL PlotStretchedMaskedBitmap (wxDC *destDC, wxBitmap *srcBitmap, wxRect Pos)
static BOOL HaveNonClientMetricsChanged ()
 
  • called when an owner drawn child of this bars needs to be redrawSets ControlHasFocus flag if input focus with a writable control
  • nothing at the moment

Forces bars to be repainted to reflect active state attempt to force focus to mainframe

  • To Notify ControlHelper and DockingBar that BaseBar is about to die Command received when a list box receives the focus Command received when a list box receives the focus - assumes only galleries will have listbox controls To recreate this BaseBar after a change in control sizes returns TRUE if Non-Client metrics have changed

static BOOL IsDoingErrorBox ()
 Returns whether we're doing an error box or not...
static void StartErrorBox ()
 To set the variable which stops us grabbing back the focus in mainframe if the bar / gallery hasn't been created.
static void FinishErrorBox ()
 To reset the variable which stops us grabbing back the focus in mainframe if the bar / gallery hasn't been created.
static BOOL IsBarInRecreate ()
 BaseBar destructor.
static BOOL GetStatusLineText (String_256 *StatusText)
 called on idles to check whether I want to put some text on the status bar
static BOOL HasGalleryGotFocus ()
static BOOL AltPressed (BOOL state)
 called from DialogBarOp message handler when Alt is pressed allows user to enter control drag state
static BOOL CtlPressed (BOOL state)
 called from DialogBarOp message handler when Clt is pressed toggles between cut and copy drag control modes
static BOOL EscPressed (BOOL state)
 called from DialogBarOp message handler when Esc is pressed will end any bar type drag
static BOOL CancelAllDrags ()
 called from DialogBarOp message handler when Esc is pressed will end any bar type drag
static void ClearFocusFlags ()
static BaseBarGetPtrToToolBar ()
static BOOL IsDragging ()

Protected Member Functions

BOOL EndControlDrag (wxPoint point)
 called at the end of a control drag decides where to drop the dragged control... does it and tidies up the drag.
BOOL DropControl (wxPoint point, wxWindow *OverBar, BOOL InsertSeparator)
 Drops a dragged control onto a given Window.
void CacheAllDockRects ()
 allows bars to be move between docks on a WM_MOVEBAR message

Sets all check rectangles for drop hit testing at start of drag

void Paint3dPlinth (wxDC *pDC, wxRect *rect, BOOL PlinthOut)
 Draws a rectangular 3d plinth(Chicago/Win 3.1 styles) around the edge of the given rectangle.
virtual DockBarType BarCloseToDock (wxPoint CursorPos)
 Tests whether the cursor and its surrounding bar shape rectangle is close enough to a docking bar that the bar will stick onto that dock. NOTE! This function has the side effect that it adjusts the DragOffset before returning TRUE. NOTE ALSO! This routine uses SimpleIntersect instead of wxRect::Intersect because SimpleIntersect works how I want it to (I wrote it).
virtual void SetFormatVariables ()
 Sets up various formating variables according to dockbar type large/small controls etc .. must be called on every create.
virtual void PaintDialogNonClient (BOOL Active)
 This routine gets called by OnNcPaint to paint the non client area of a floating bar.
virtual void PaintWin95DialogNonClient (BOOL IsActive)
 This routine gets called by OnNcPaint to paint the non client area of a Windows 95 style floating bar.
virtual void PaintChicagoBorder ()
 This function is called when the non-client area needs to be updated to reflect its active or inactive state. Paints the client area of the dilog bar Scope: ProtectedThis routine gets called by OnNcPaint to paint the non client area of a docked Chicago bar.
void PaintXORDragRect (wxRect Rect, DockBarType DockBar)
 Draws an XOR drag rectangle anywhere on the display.
void PaintDragRect (wxRect Rect, wxRect OldRect, DockBarType DockBar, DockBarType OldBarType)
 Draws an XOR drag rectangle anywhere on the display.
virtual void StartDrag (wxPoint point, DlgDragType TypeOfDrag)
 Starts a Drag Scope: private.
virtual BOOL CanStartDrag (wxPoint point)
 decides whether we can start a Drag Scope: private
virtual DockBarType IsPointerOverDock (wxPoint point)
 Test whether the pointer is currently over a dockingbar.
void CloseCombos ()
 Close any drop-down windows.
virtual wxRect GetDragFormatRect (DockBarType BarType, wxPoint CursorPos, BOOL ToLeft, BOOL Below)
 Get cached format size and offset it appropriately around the current drag position.
virtual wxPoint CalcDragOffset (wxRect DragRect, wxPoint CursorPos, BOOL ToLeft, BOOL Below)
 Use the current drag rect the previous one and the current cursor pos to calculate the new offsets into the new drag rectangle.
virtual void CalcDragOffsetDirection (DockBarType BarType, wxPoint CursorPos)
 Resets the two drag offset flags which record which edges of the dragged outline should not move when the bar outline changes shape.
BOOL SimpleIntersect (const wxRect &rect1, const wxRect &rrect2)
 Replaces the brain-damaged wxRect::Intersect routine which insists on actually comuting the intersection in another rectangle, and most worryingly, returns FALSE when one of the rectangles is 0 pixels wide.
virtual wxRect GetDlgBarRect (DockBarType DockBar, wxRect CurrentBarRect)
 For finding the screen rectangle defining the shape of the BaseBar when over DockBar.
void InformControlsDead ()
 Copies the child controls of SrcBaseBar to this BaseBar. It does not do any positioning of controls. Scope: private.
BOOL CopyOrLoadControls (wxWindow *BarHwnd)
BOOL LoadResourceControls ()
BOOL CreateToolBtn (BarToolButton *pToolBtn)
 Creates tool bar button control.
virtual BOOL PositionControls (BOOL DoRedraw=TRUE)
 Format and place controls according to docking bar type.
HINSTANCE GetModuleInst (const BarControlInfo *pBarCtlInfo, UINT32 *ToolModuleID)
DLGITEMTEMPLATEGetPointerToControl (DLGTEMPLATE *pDlg, UINT32 CtlId)
BOOL CreateControlFromResource (BarControl *pBarItem)
 Create.
BOOL CreateInfoControlFromResource (BarControl *pBarItem, BOOL Init)
 Special case for info bars.
BOOL CreateControlItem (DLGITEMTEMPLATE *pCurrentControl, BarControl *pBarItem, HINSTANCE ModuleInst, UINT32 ToolModuleID)
 Creates the control and attaches it as a child of the BaseBars window,.
virtual BOOL FormatBar (BOOL MoveWindows, ForceControlSize Force)
virtual BOOL FormatFloatingBar (BOOL MoveWindows, ForceControlSize Force)
 Format a floating toolbar with separators and newlines.
virtual BOOL FormatHorizontalBar (BOOL MoveWindows, ForceControlSize Force)
 Format a Horizontal toolbar with separators.
virtual BOOL FormatVerticalBar (BOOL MoveWindows, ForceControlSize Force)
 Format a Vertical toolbar with separators.
BOOL TidyBarItemsAfterDrag ()
 Tidy up Linefeeds and Separators after dragging controls.
BOOL FormatLineFeeds (INT32 Targetx, wxSize *pBarSize=NULL, INT32 *pNoLfs=NULL)
 Reformat a floating toolbar.
KernelBarPosGetBarPosition ()
 

DockBarType GetDockBarType ()
 

BOOL HasOrientationChanged (DockBarType Old, DockBarType New)
 determine whether two docks have different orientation.
virtual wxRect SetBarSize (DockBarType BarType, BOOL DoRedraw=TRUE)
 Set the Window size.
virtual void AdjustFormattedBarSize (wxSize *BarSize)
 Adjusts the proposed new size of a bar once formatting has taken place.
virtual INT32 CreateExtraControls ()
 Allows subclasses to create additional bar controls.
virtual void PositionExtraControls (wxSize BarSize, INT32 xpos, INT32 ypos)
 Moves extra controls about once they have been created.
BOOL CacheFormatingData ()
BOOL GetBestCachedWidth (INT32 TargetHeight, INT32 *FoundWidth)
virtual BOOL SetStatusLineText ()
 base virtual function should never be called
virtual BOOL GetStatusText (String_256 *StatusTextBuf)
 base virtual function should never be called.
LPWSTR MovePastWideStr (LPWSTR pWideStr)
 Given a ptr to the first byte in a wide string (or char string if win16) return a ptr to the byte past the null.
size_t SizeDlgHeader (DLGTEMPLATE *pHeader)
 Given a ptr to DIALOGBOXHEADER, return its size. Scope: private.
size_t SizeCtrlData (DLGITEMTEMPLATE *pControl)
 Given a ptr to a controldata struct, return its length. Under Win32, all strings are UniCode (as they are in the res file).
DDeckerReadState IsDoubleDecker (BarItem *ThisControl, BarItem *Start, BarItem *End)
 to determine whether a given control is part of a double decker group

Static Protected Member Functions

static BOOL SwapCursors (DWORD CursorID)
 used to be sent by controls to inform bar that a control has got the focus not ****ing sure anymore . sent by controls to inform bar that a control is about to be dragged sent by controls to inform bar that a control is about to be dragged

Protected Attributes

DialogBarOppOp
DockBarType ParentDockBarType
DockBarType DragDockBarType
DockBarType OldDragBarType
DockBarType LastFixedDragType
OILDockingBarParentDockBar
wxPaintDC * PaintDC
wxBitmap BrushBitmap
BaseBarMode CurrentDlgBarMode
wxRect ScreenRect
wxRect TopRect
wxRect LeftRect
wxRect RightRect
wxRect BottomRect
wxRect SysMenuRect
wxRect TopBorderRect
wxRect BottomBorderRect
wxRect LeftBorderRect
wxRect RightBorderRect
wxRect CaptionBarRect
wxRect TopLeftGrowRect
wxRect BottomLeftGrowRect
wxRect TopRightGrowRect
wxRect BottomRightGrowRect
SeparatorWidths SeparatorWidth
INT32 HeightEstimate
double WidestFloat
double TallestFloat
List FormatPositions
wxRect DragStartRect
BOOL ListBoxHasFocus
wxPoint StartDragPoint
wxPoint DragOffset
BOOL DragOffsetFromTop
BOOL DragOffsetFromLeft
KernelBarPos LastSmallBarPos
wxPoint BorderOffset
wxRect FloatSmallRect
wxRect HorizontalSmallRect
wxRect VerticalSmallRect
wxRect FloatLargeRect
wxRect HorizontalLargeRect
wxRect VerticalLargeRect
wxFont * TitleFont
wxFont * BarFont
wxFont * SmallThinFont
wxFont * LargeThinFont
BOOL ThisIsAnInfoBar
BOOL Active
wxDC * pDisplayDC
INT32 OldDrawMode
wxBrush * pOldBrush
wxBrush * pDragBrush
DDeckerReadState DDeckerState
wxRect DragCtlClientRect
wxWindow * DragCtlHwnd
BOOL IsDraggingControl
wxPoint DragCtlOffset

Static Protected Attributes

static BaseBarCurrentBar = NULL
static CursorpCurrentCursor = NULL
static CursorpButtonCopyCursor = NULL
static CursorpButtonCutCursor = NULL
static INT32 CurrentCursorID = 0
static INT32 BorderWidth = 0
static INT32 TitleBarHeight = 0
static DlgDragType DragType = NONE
static BOOL InRecreate = FALSE
static BOOL DoingErrorBox = FALSE
static BOOL ControlHasFocus = FALSE
static wxWindow * HwndWithFocus = NULL
static BOOL GalleryHasFocus
static UINT32 GalButtonWidth = 0
static BOOL IsBackGroundRendering = FALSE
static wxRect OldDragRect
static wxWindow * LastWindowWithFocus = NULL
static wxRect LastCtlDragRect
static ControlDragMode CtlDragMode = CUT
static ControlDragState CtlDragState = NO_DRAG
static BaseBarPtrToToolBar = NULL

Detailed Description

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/03/94
See also:
DialogBarOp

Definition at line 227 of file basebar.h.


Constructor & Destructor Documentation

BaseBar::BaseBar  ) 
 

The BaseBar constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 323 of file basebar2.cpp.

00324 {
00325     // Get pointers to Stock Fonts for Title and controls
00326 //  TitleFont = FontFactory::GetwxFont(STOCKFONT_DIALOGBARTITLE);
00327 //  BarFont = FontFactory::GetwxFont(STOCKFONT_DIALOGBARCLIENT);
00328 //  SmallThinFont = FontFactory::GetwxFont(STOCKFONT_DIALOGBARSMALL);
00329 //  LargeThinFont = FontFactory::GetwxFont(STOCKFONT_DIALOGBARLARGE);
00330 
00331     // Get the System FrameWidth
00332     BorderWidth = wxSystemSettings::GetMetric( wxSYS_FRAMESIZE_X );
00333     
00334     // Get the height of the title bar  UIC
00335     // under '95 this is system wide    UIC
00336 
00337 #if defined(__WXMSW__)
00338     if(IS_CHICAGO)
00339     {
00340         TitleBarHeight = 14;   // UIC
00341         #if _MFC_VER >= 0x400
00342             TitleBarHeight = wxSystemSettings::GetMetric(SM_CYSMCAPTION);
00343         #endif
00344     }
00345     else
00346 #endif
00347     {
00348         TitleBarHeight = 10;   // UIC
00349     }
00350     // used in GrowNorth GrowSouth 
00351     TallestFloat = WidestFloat = 1;
00352 
00353     // init drag state  
00354     DragType = NONE;
00355     DragCtlHwnd = NULL;
00356     
00357     Active = TRUE;
00358     
00359     
00360     InitFormatRects();
00361     LastSmallBarPos.x = LastSmallBarPos.y = -1;
00362     
00363     // create a bitmap for the drag rendering
00364 #pragma message( __LOCMSG__ "Not using dither pattern" )
00365 //  WORD WindowsGray [] = { 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA } ;
00366 //  BrushBitmap.CreateBitmap (8, 8, 1, 1, (LPSTR) WindowsGray) ;
00367     BrushBitmap.Create( 8, 8, 1 );
00368 }

BaseBar::~BaseBar  )  [virtual]
 

BaseBar destructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 388 of file basebar2.cpp.

00389 {
00390     FormatPositions.DeleteAll();
00391 }


Member Function Documentation

void BaseBar::AdjustFormattedBarSize wxSize *  BarSize  )  [protected, virtual]
 

Adjusts the proposed new size of a bar once formatting has taken place.

Author:
Alex
Date:
1/7/94
Parameters:
Pointer to the bar size record to adjust [INPUTS]
- [OUTPUTS]
Returns:
None

Errors: -

See also:
GalleryBar::AdjustFormattedBarSize
This function does nothing in the base class, but may be overridden, for instance by Gallery Bars.

Definition at line 3161 of file basebar2.cpp.

03162 {
03163 }

BOOL BaseBar::AltPressed BOOL  state  )  [static]
 

called from DialogBarOp message handler when Alt is pressed allows user to enter control drag state

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/11/94
Parameters:
Alt state [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 6639 of file basebar2.cpp.

06640 {
06641     //TRACEUSER( "chris", _T("Atl state %d\n"),state);
06642 
06643     if(state)
06644     {
06645         if(CtlDragState==NO_DRAG)
06646         {
06647             //CtlDragState=READY;
06648             return FALSE;
06649         }
06650     }
06651     else
06652     {
06653         if(CtlDragState==DRAGGING || CtlDragState == READY)
06654         {
06655             return TRUE;
06656         }
06657     }
06658     return FALSE;
06659 }

DockBarType BaseBar::BarCloseToDock wxPoint  CursorPos  )  [protected, virtual]
 

Tests whether the cursor and its surrounding bar shape rectangle is close enough to a docking bar that the bar will stick onto that dock. NOTE! This function has the side effect that it adjusts the DragOffset before returning TRUE. NOTE ALSO! This routine uses SimpleIntersect instead of wxRect::Intersect because SimpleIntersect works how I want it to (I wrote it).

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Parameters:
CursorPos,: The position of the mouse cursor on screen [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
-

Definition at line 7573 of file basebar2.cpp.

07574 {
07575     wxRect Blobby;
07576     
07577     // if the user is holding down the Constrain key ( Clt ) we will not allow docking
07578     
07579     if(KeyPress::IsConstrainPressed())
07580         return DOCKBAR_INVALID;
07581     
07582     if(pOp->IsAllBarsOp())
07583         return DOCKBAR_INVALID; 
07584     
07585     // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
07586     // This Block is an attempt to fix a problem with the general drag algorithm
07587     // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
07588 
07589     if (DragDockBarType == DOCKBAR_FLOAT)
07590     {
07591         BOOL  FromLeft = CursorPos.x > LeftRect.GetLeft() ;
07592         BOOL  FromTop = CursorPos.y > TopRect.GetTop() ;
07593 
07594         if (!pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
07595         {
07596             Blobby = GetDragFormatRect(DOCKBAR_TOP, CursorPos,FromLeft, FromTop);
07597             if (SimpleIntersect(Blobby,TopRect))
07598             {
07599                 return(DOCKBAR_TOP);
07600             }                                                              
07601 
07602             // Test whether a horizontal shape bar would touch the bottom dock
07603             Blobby = GetDragFormatRect(DOCKBAR_BOTTOM, CursorPos,FromLeft,FromTop);
07604             if (SimpleIntersect(Blobby,BottomRect))
07605             {
07606                 return(DOCKBAR_BOTTOM);
07607             }
07608         }
07609 
07610         // Don't allow infobars to be dropped on the vertical docking bars...
07611         if (!ThisIsAnInfoBar)
07612         {
07613             // Test whether a vertical shape bar would touch the left dock
07614             Blobby = GetDragFormatRect(DOCKBAR_LEFT, CursorPos,FromLeft,FromTop);
07615             if (SimpleIntersect(Blobby,LeftRect))
07616             {
07617                 return(DOCKBAR_LEFT);
07618             }
07619 
07620             // Test whether a vertical shape bar would touch the right dock
07621             Blobby = GetDragFormatRect(DOCKBAR_RIGHT, CursorPos,FromLeft,FromTop);
07622             if (SimpleIntersect(Blobby,RightRect))
07623             {
07624                 return(DOCKBAR_RIGHT);
07625             }
07626         }
07627 
07628     }
07629     else
07630     {
07631         if (!pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
07632         {
07633             // Test whether a horizontal shape bar would touch the top dock
07634             Blobby = GetDragFormatRect(DOCKBAR_TOP, CursorPos, DragOffsetFromLeft, CursorPos.y > TopRect.GetBottom());
07635             if (SimpleIntersect(Blobby,TopRect))
07636             {
07637                 return(DOCKBAR_TOP);
07638             }                                                              
07639 
07640             // Test whether a horizontal shape bar would touch the bottom dock
07641             Blobby = GetDragFormatRect(DOCKBAR_BOTTOM, CursorPos, DragOffsetFromLeft, CursorPos.y > BottomRect.GetTop());
07642             if (SimpleIntersect(Blobby,BottomRect))
07643             {
07644                 return(DOCKBAR_BOTTOM);
07645             }
07646         }
07647 
07648         // Don't allow infobars to be dropped on the vertical docking bars...
07649         if (!ThisIsAnInfoBar)
07650         {
07651             // Test whether a vertical shape bar would touch the left dock
07652             Blobby = GetDragFormatRect(DOCKBAR_LEFT, CursorPos, CursorPos.x > LeftRect.GetRight(), DragOffsetFromTop);
07653             if (SimpleIntersect(Blobby,LeftRect))
07654             {
07655                 return(DOCKBAR_LEFT);
07656             }
07657 
07658             // Test whether a vertical shape bar would touch the right dock
07659             Blobby = GetDragFormatRect(DOCKBAR_RIGHT, CursorPos, CursorPos.x > RightRect.GetLeft(), DragOffsetFromTop);
07660             if (SimpleIntersect(Blobby,RightRect))
07661             {
07662                 return(DOCKBAR_RIGHT);
07663             }
07664         }
07665     } 
07666     return(DOCKBAR_INVALID);
07667 }

void BaseBar::CacheAllDockRects  )  [protected]
 

allows bars to be move between docks on a WM_MOVEBAR message

Sets all check rectangles for drop hit testing at start of drag

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 7533 of file basebar2.cpp.

07534 {
07535 #pragma message( __LOCMSG__ "BaseBar::CacheAllDockRects - do nothing" )
07536     TRACE( _T("Warning - BaseBar::CacheAllDockRects called") );
07537 /*  OILFixedDockingBar* DockBar;
07538 
07539     DockBar = (OILFixedDockingBar*)GetMainFrame()->GetDockBar(DOCKBAR_TOP);
07540     DockBar->GetDockScreenRect(&TopRect);
07541 
07542     DockBar = (OILFixedDockingBar*)GetMainFrame()->GetDockBar(DOCKBAR_BOTTOM);
07543     DockBar->GetDockScreenRect(&BottomRect);
07544 
07545     DockBar = (OILFixedDockingBar*)GetMainFrame()->GetDockBar(DOCKBAR_LEFT);
07546     DockBar->GetDockScreenRect(&LeftRect);
07547 
07548     DockBar = (OILFixedDockingBar*)GetMainFrame()->GetDockBar(DOCKBAR_RIGHT);
07549     DockBar->GetDockScreenRect(&RightRect); */
07550 }

BOOL BaseBar::CacheFormatingData  )  [protected]
 

Definition at line 1937 of file basebar2.cpp.

01938 {
01939     // delete the last cache
01940     if(!FormatPositions.IsEmpty())
01941         FormatPositions.DeleteAll();
01942 
01943     FormatPosition * pNewFP = NULL;
01944     wxSize BarSize(0,0);
01945     wxSize LastBarSize(0,0);
01946     INT32 NoLFs = -1;
01947 
01948     // incrementally call FormatLineFeeds - cache the value every time we get a new height
01949     // when there are no LF's in the bar we have found it's widest format
01950     for(INT32 TryWidth = 16;NoLFs!=0;TryWidth +=4)
01951     {
01952         FormatLineFeeds(TryWidth,&BarSize,&NoLFs);
01953     
01954         // there may be many valid widths that map to this height
01955         // we just cache the first one
01956         if(BarSize.x != LastBarSize.x)
01957         {
01958             LastBarSize = BarSize;
01959             pNewFP = new FormatPosition( TryWidth, BarSize.x );
01960             
01961             ERROR2IF(pNewFP == NULL,FALSE,"Couldn't create Format Position");
01962             
01963             // we add to new item to the head so that we can search from the shortest up
01964             // in  GetBestCachedWidth()
01965             FormatPositions.AddHead((ListItem *)pNewFP);    
01966         }
01967     }
01968     
01969     return TRUE;
01970 };

wxPoint BaseBar::CalcDragOffset wxRect  DragRect,
wxPoint  CursorPos,
BOOL  ToLeft,
BOOL  Below
[protected, virtual]
 

Use the current drag rect the previous one and the current cursor pos to calculate the new offsets into the new drag rectangle.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Parameters:
DragRect,: Current dragged rectangle [INPUTS] (and class statics) OldDragRect: Previous dragged rectangle DragOffset: Offset of cursor into previous rectangle DragOffsetFromLeft: TRUE when cursor is offset from left of previous DragOffsetFromTop: TRUE when cursor is offset from top of previous
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 624 of file basebar2.cpp.

00625 {
00626     wxPoint NewOffset;
00627 
00628     if (ToLeft)
00629     {
00630         NewOffset.x = DragOffset.x;
00631         if (NewOffset.x > DragRect.GetWidth())
00632             NewOffset.x = DragRect.GetWidth()-6;
00633     }
00634     else
00635     {
00636         NewOffset.x = DragRect.GetWidth()-(OldDragRect.GetWidth()-DragOffset.x);
00637         if (NewOffset.x < 0)
00638             NewOffset.x = 6;
00639     }
00640 
00641     if (Below)
00642     {
00643         NewOffset.y = DragOffset.y;
00644         if (NewOffset.y > DragRect.GetHeight())
00645             NewOffset.y = DragRect.GetHeight()-6;
00646     }
00647     else
00648     {
00649         NewOffset.y = DragRect.GetHeight()-(OldDragRect.GetHeight()-DragOffset.y);
00650         if (NewOffset.y < 0)
00651             NewOffset.y = 6;
00652     }
00653 
00654     return ( NewOffset );
00655 }

void BaseBar::CalcDragOffsetDirection DockBarType  BarType,
wxPoint  CursorPos
[protected, virtual]
 

Resets the two drag offset flags which record which edges of the dragged outline should not move when the bar outline changes shape.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/94
Parameters:
BarType,: Which type of bar we are dealing with [INPUTS] CursorPos: The position of the mouse cursor on screen
- [OUTPUTS]
Returns:
-

Errors: - Scope: private

See also:
-

Definition at line 7690 of file basebar2.cpp.

07691 {
07692     wxRect Blobby;
07693 
07694     switch (BarType)
07695     {
07696         case DOCKBAR_TOP:
07697             DragOffsetFromTop = CursorPos.y > TopRect.GetBottom();
07698 //          DragOffsetFromLeft = TRUE;
07699             break;
07700         case DOCKBAR_BOTTOM:
07701             DragOffsetFromTop = CursorPos.y > BottomRect.GetTop();
07702 //          DragOffsetFromLeft = TRUE;
07703             break;
07704         case DOCKBAR_LEFT:
07705             DragOffsetFromLeft = CursorPos.x > LeftRect.GetRight();
07706             break;
07707         case DOCKBAR_RIGHT:
07708             DragOffsetFromLeft = CursorPos.x > RightRect.GetLeft();
07709             break;
07710         default:
07711             ENSURE(FALSE,"CalcDragOffsetDirection called with invalid bar type");
07712             break;
07713     }
07714 }

BOOL BaseBar::CancelAllDrags  )  [static]
 

called from DialogBarOp message handler when Esc is pressed will end any bar type drag

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 6676 of file basebar2.cpp.

06677 {
06678     //TRACEUSER( "chris", _T("Esc state %d\n"),state);
06679     if(CurrentBar == NULL)
06680         return FALSE;
06681     if(CtlDragState==DRAGGING)
06682     {   
06683         CurrentBar->PaintDragRect(CurrentBar->OldDragRect,wxRect(0,0,0,0),DOCKBAR_FLOAT,DOCKBAR_FLOAT);
06684         CurrentBar->TidyUpControlDrag();
06685     }
06686     else if(DragType != NONE)
06687     {
06688         CurrentBar->FormatLineFeeds(CurrentBar->DragStartRect.GetWidth());
06689         CurrentBar->InitFormatRects();
06690         CurrentBar->TidyUpBarDrag();
06691     }
06692 
06693     CtlDragState = NO_DRAG;
06694     DragType = NONE;
06695     return FALSE;
06696 }

BOOL BaseBar::CanStartDrag wxPoint  point  )  [protected, virtual]
 

decides whether we can start a Drag Scope: private

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/4/94
Parameters:
CursorPoint,: The screen cursor pos [INPUTS]
- [OUTPUTS]
Returns:
YES / NO

Errors: -

See also:
-

Definition at line 4429 of file basebar2.cpp.

04430 {
04431 #ifdef STANDALONE
04432 #ifndef EXCLUDE_GALS
04433     if (!this->IsKindOf(RUNTIME_CLASS(GalleryBar)))
04434         return FALSE;
04435 #endif
04436 #endif
04437 
04438  return (point.x < (StartDragPoint.x - DRAG_START_MARGIN) ||
04439          point.x > (StartDragPoint.x + DRAG_START_MARGIN) ||
04440          point.y < (StartDragPoint.y - DRAG_START_MARGIN) ||
04441          point.y > (StartDragPoint.y + DRAG_START_MARGIN) 
04442          );
04443 }   

static void BaseBar::ClearFocusFlags  )  [inline, static]
 

Definition at line 260 of file basebar.h.

00260 {ControlHasFocus = FALSE;HwndWithFocus =(wxWindow*)0;}; // used to be ControlHasFocus+=NULL ???

void BaseBar::CloseCombos  )  [protected]
 

Close any drop-down windows.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/5/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 525 of file basebar2.cpp.

00526 {                                                            
00527 #pragma message( __LOCMSG__ "BaseBar::CloseCombos - do nothing" )
00528     TRACE( _T("Warning - BaseBar::CloseCombos called") );
00529 /*  String_256 ClassNameStr;
00530     HWND CurrentChild;
00531     HWND NextChild;
00532 
00533     // Get control HWND's 
00534     for (CurrentChild = ::GetWindow(GetSafeHwnd(),GW_CHILD);
00535          CurrentChild != NULL; 
00536          CurrentChild = NextChild)
00537     {
00538         GetClassName(CurrentChild, (TCHAR*)ClassNameStr, 255);
00539         // check for ComboBox/ListBox
00540         if ( (ClassNameStr == String_8(TEXT("ListBox"))) ||
00541              (ClassNameStr == String_8(TEXT("ComboBox"))) ||
00542              (ClassNameStr == String_64(TEXT("cc_1dBitmapComboBoxEdit"))) ||
00543              (ClassNameStr == String_64(TEXT("cc_2dBitmapComboBoxEdit")))
00544            )
00545         {
00546             // send close message
00547             ::SendMessage(CurrentChild,CB_SHOWDROPDOWN,FALSE,0);
00548         }
00549         NextChild = ::GetWindow(CurrentChild,GW_HWNDNEXT);
00550     } */
00551 
00552 }

void BaseBar::ConvertToolbarOnStartup  ) 
 

Converts the toolbar from being docked to being floating.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/5/2000
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: An ERROR3 goes off in debug if this function is called for anything BUT the toolbar.

See also:
-

Definition at line 7365 of file basebar2.cpp.

07366 {
07367 #pragma message( __LOCMSG__ "BaseBar::ConvertToolbarOnStartup - do nothing" )
07368     TRACE( _T("Warning - BaseBar::ConvertToolbarOnStartup called") );
07369 /*  ERROR3IF (pOp->GetName () != String_32 (TEXT ("Toolbar")), "BaseBar::ConvertToolbarOnStartup () - Call that a toolbar!");
07370     
07371     InRecreate = TRUE;
07372 
07373     // Remove this BaseBar from its current docking bar 
07374     GetMainFrame()->GetDockBar(ParentDockBarType)->ReleaseBar(this->GetSafeHwnd(),DONT_TIDY); 
07375     
07376     // dynamically create a new BaseBar/derived Bar
07377     BaseBar* NewBaseBar = (BaseBar *)GetClassInfo()->CreateObject();
07378 
07379     if (NewBaseBar)
07380     {       
07381         // Recreate the Dialog
07382         NewBaseBar->Recreate(DOCKBAR_FLOAT, this, pOp, FALSE);
07383         NewBaseBar->GetDialogBarOp ()->SetDockBarType (DOCKBAR_FLOAT);
07384             
07385         // The current BaseBar dies
07386         CCamApp::GetDlgManager()->Delete(GetSafeHwnd(),pOp);  
07387         //delete this;
07388 
07389         InRecreate = FALSE;
07390         CurrentBar = NULL;
07391         
07392         PtrToToolBar = NewBaseBar;
07393     } */
07394 }

BOOL BaseBar::CopyOrLoadControls wxWindow *  BarHwnd  )  [protected]
 

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/4/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1566 of file basebar2.cpp.

01567 {
01568     PORTNOTETRACE( "dialog", "BaseBar::CopyOrLoadControls - do nothing" );
01569 #ifndef EXCLUDE_FROM_XARALX
01570     // Find out how many bar items
01571     UINT32 NumBarItems = pOp->GetNumBarItems(); 
01572 
01573     // track ddecker state 
01574     DDeckerState = DDECKER_NONE;
01575 
01576     BarItem* pBarItem; 
01577 
01578     ThisIsAnInfoBar = (pOp->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp)));
01579 
01580     for (UINT32 i = 0; i< NumBarItems; i++)
01581     {
01582         // Get the next BarItem
01583         pBarItem = pOp->GetPtrBarItem(i); 
01584 
01585         ENSURE(pBarItem != NULL, "NumBarItems is incorrect"); 
01586 
01587         // Check whether we need to create thin items for double deckers
01588     
01589         if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl)))
01590         {
01591             BarControl * pBarControl = (BarControl*)pBarItem;
01592             
01593 
01594             // Obtain handle to the controls HWnd
01595             HWND hWndControl=(HWND)(pBarControl)->GetWinID();  
01596             // -------------------------------------------------------
01597             // Find out if the control is copyable
01598             // - This code may appear a little on the brink of insanity, however
01599             // it is neccessary cos windows is edit/combo/list set parently 
01600             // challenged.
01601 
01602             // Determine the control's class
01603             
01604             switch (GetEnumItemType(pBarItem))
01605             {
01606                 case BUTTON:
01607                 case LIST:
01608                 case COMBO:
01609                 case STATIC:
01610                 case EDIT:
01611                 case BITMAPCOMBO1D:     // IF THIS ISN'T HERE - THEN FOR SOME
01612                                         // BIZARRE REASON - OUR CONTROL CANNOT ACCESS
01613                                         // ITS DATA, AND CAMELOT FALLS OVER!
01614                 case BITMAPCOMBO2D:
01615                 {
01616                     // The control cannot be copied, so must be recreated from the
01617                     // resource.
01618 
01619                     if (!CreateInfoControlFromResource(pBarControl,i==0))
01620                     {
01621                         // We failed to create the control 
01622                         ENSURE(FALSE,"Failed to create control"); 
01623                         return(FALSE);
01624                     }
01625                 }
01626                 break;
01627                 default :
01628                 {
01629                     // We can safely copy the control to its new parent
01630                     ::SetParent(hWndControl, BarHwnd);
01631                 }
01632                 break;
01633             }
01634         }
01635         else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerTop)))
01636         {
01637             DDeckerState = DDECKER_TOP;
01638         }
01639         else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerBottom)))
01640         {
01641             DDeckerState = DDECKER_BOTTOM;
01642         }
01643         else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerEnd)))
01644         {
01645             DDeckerState = DDECKER_NONE;
01646         } 
01647     }
01648     CreateInfoControlFromResource(NULL,0);
01649 #endif
01650     return TRUE; 
01651 }; 

BOOL BaseBar::Create DialogBarOp Op  ) 
 

Creates a BaseBar window.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, else FALSE

Errors: -

See also:
-

Definition at line 1039 of file basebar2.cpp.

01040 {
01041 #pragma message( __LOCMSG__ "BaseBar::Create - do nothing" )
01042     TRACE( _T("Warning - BaseBar::Create called") );
01043 /*  InRecreate = TRUE;
01044     pOp = Op; 
01045 
01046     #ifdef STANDALONE
01047     if (pOp->IS_KIND_OF(InformationBarOp))
01048     {   // We don't want any info bars in the standalone version.
01049         
01050         InRecrea