#include <basebar.h>
Inheritance diagram for BaseBar:
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) |
DialogBarOp * | GetDialogBarOp () |
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 () |
Forces bars to be repainted to reflect active state attempt to force focus to mainframe
| |
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 BaseBar * | GetPtrToToolBar () |
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) |
DLGITEMTEMPLATE * | GetPointerToControl (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. | |
KernelBarPos * | GetBarPosition () |
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 | |
DialogBarOp * | pOp |
DockBarType | ParentDockBarType |
DockBarType | DragDockBarType |
DockBarType | OldDragBarType |
DockBarType | LastFixedDragType |
OILDockingBar * | ParentDockBar |
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 BaseBar * | CurrentBar = NULL |
static Cursor * | pCurrentCursor = NULL |
static Cursor * | pButtonCopyCursor = NULL |
static Cursor * | pButtonCutCursor = 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 BaseBar * | PtrToToolBar = NULL |
Definition at line 227 of file basebar.h.
|
The BaseBar constructor.
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 destructor.
Definition at line 388 of file basebar2.cpp. 00389 { 00390 FormatPositions.DeleteAll(); 00391 }
|
|
Adjusts the proposed new size of a bar once formatting has taken place.
Definition at line 3161 of file basebar2.cpp.
|
|
called from DialogBarOp message handler when Alt is pressed allows user to enter control drag state
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 }
|
|
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).
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 }
|
|
allows bars to be move between docks on a WM_MOVEBAR message Sets all check rectangles for drop hit testing at start of drag
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 }
|
|
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 };
|
|
Use the current drag rect the previous one and the current cursor pos to calculate the new offsets into the new drag rectangle.
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 }
|
|
Resets the two drag offset flags which record which edges of the dragged outline should not move when the bar outline changes shape.
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 }
|
|
called from DialogBarOp message handler when Esc is pressed will end any bar type drag
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 }
|
|
decides whether we can start a Drag Scope: private
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 }
|
|
Definition at line 260 of file basebar.h. 00260 {ControlHasFocus = FALSE;HwndWithFocus =(wxWindow*)0;}; // used to be ControlHasFocus+=NULL ???
|
|
Close any drop-down windows.
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 }
|
|
Converts the toolbar from being docked to being floating.
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 }
|
|
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 };
|
|
Creates a BaseBar window.
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 InRecreate = FALSE; 01051 return FALSE; 01052 } 01053 #endif 01054 01055 ParentDockBarType = pOp->GetDockBarType(); // Get the current dock bar 01056 01057 //TRACE( _T("Create now %d"),ParentDockBarType); 01058 ParentDockBar = GetMainFrame()->GetDockBar(ParentDockBarType); 01059 01060 ENSURE(ParentDockBar != NULL, "Could not find docking bar"); 01061 01062 // init control size etc .. 01063 SetFormatVariables(); 01064 01065 KernelBarPos ThisPos; 01066 ThisPos.Dock = ParentDockBarType; 01067 01068 BOOL WindowCreated ; 01069 01070 wxPoint p ; 01071 01072 if (ParentDockBarType == DOCKBAR_FLOAT) 01073 // || pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 01074 { 01075 // Get x/y position of floating bar 01076 wxPoint FloatPos = pOp->GetFloatingwxPoint(); 01077 01078 if (!MonitorFromPoint(FloatPos, MONITOR_DEFAULTTONULL)) 01079 { 01080 // The float pos is not on any monitor in the system so lets use the top left 01081 // corner of the monitor nearest the point 01082 MONITORINFO mi; 01083 mi.cbSize = sizeof(MONITORINFO); 01084 if (GetMonitorInfo(MonitorFromPoint(FloatPos, MONITOR_DEFAULTTONEAREST), &mi)) 01085 { 01086 FloatPos.x = mi.rcWork.left; 01087 FloatPos.y = mi.rcWork.GetTop(); 01088 } 01089 else 01090 { 01091 FloatPos.x = FloatPos.y = 0; 01092 } 01093 } 01094 01095 ThisPos.x=FloatPos.x; 01096 ThisPos.y=FloatPos.y; 01097 01098 01099 //TRACE( _T("FLOAT At %d %d"),ThisPos.Slot,ThisPos.Position); 01100 // Set bar mode 01101 CurrentDlgBarMode = DIALOG; 01102 01103 // Create a popup floater 01104 WindowCreated = CreateEx(0, // WS_EX_TOOLWINDOW - I think we should've used one of these, Matt 1/11/00 01105 NULL, 01106 NULL, WS_POPUP |WS_CHILD,// | WS_BORDER, 01107 FloatPos.x, FloatPos.y,0,0, 01108 GetMainFrame()->GetSafeHwnd(), // Parent is the frame window 01109 NULL); 01110 } 01111 else 01112 { 01113 // Get slot/offset position of docked bar 01114 ThisPos.Slot = pOp->GetSlot(); 01115 ThisPos.Position = pOp->GetOffset(); 01116 CurrentDlgBarMode = BAR; 01117 01118 // Get a pointer to the docking bar 01119 OILFixedDockingBar * FixedDock = (OILFixedDockingBar*)GetMainFrame()-> 01120 GetDockBar(ParentDockBarType); 01121 01122 // Get a client coordinate for this slot/offset 01123 FixedDock->BarPosToScreen(ThisPos,&p); 01124 01125 // Create a child window of the docking bar 01126 WindowCreated = CreateEx(0, NULL, 01127 NULL, WS_CHILD | WS_BORDER, 01128 p.x,p.y,0,0, 01129 ParentDockBar->GetSafeHwnd(), 01130 NULL); 01131 } 01132 01133 if (!WindowCreated) 01134 { 01135 InRecreate = FALSE; 01136 return FALSE; 01137 } 01138 01139 if (!LoadResourceControls()|| (!CreateExtraControls())) 01140 { 01141 // We failed to load the controls 01142 // Delete the window, and all children which may have been created 01143 CCamApp::GetDlgManager()->Delete(GetSafeHwnd(), Op); 01144 InRecreate = FALSE; 01145 return FALSE; 01146 } 01147 01148 if (!PositionControls()) 01149 { 01150 InRecreate = FALSE; 01151 return FALSE; 01152 } 01153 // Attach the BaseBar to the docking bar 01154 ParentDockBar->PlaceBar(GetSafeHwnd(),ThisPos); 01155 01156 // send a create to info bars so they can set the state of controls before 01157 // we show the window 01158 01159 pOp->WindowID = (CWindowID)(GetSafeHwnd()); 01160 BROADCAST_TO_CLASS(DialogMsg(GetSafeHwnd(), DIM_CREATE, NULL) ,DialogBarOp); 01161 01162 // Update the bar's state before showing 01163 Op->UpdateState(); 01164 01165 // Show the Window 01166 ShowWindow(SW_SHOW); 01167 ::InvalidateRect(GetSafeHwnd(),NULL,TRUE); 01168 ::UpdateWindow(GetSafeHwnd()); 01169 01170 // inform help system 01171 ControlHelper::NotifyBarCreated(GetSafeHwnd()); 01172 01173 FormatHorizontalBar(FALSE,FORCE_SMALL); 01174 FormatVerticalBar(FALSE,FORCE_SMALL); 01175 FormatFloatingBar(FALSE,FORCE_SMALL); 01176 FormatHorizontalBar(FALSE,FORCE_LARGE); 01177 FormatVerticalBar(FALSE,FORCE_LARGE); 01178 FormatFloatingBar(FALSE,FORCE_LARGE); 01179 01180 InRecreate = FALSE; 01181 01182 SetWindowText(Op->GetName()); 01183 01184 // ZZZZ 01185 LastSmallBarPos = ThisPos; 01186 01187 // get a pointer to the toolbar - so that we can do things with it! 01188 01189 if (Op->GetName () == String_32 (TEXT ("Toolbar"))) 01190 { 01191 PtrToToolBar = this; 01192 } */ 01193 01194 return TRUE; 01195 }
|
|
Create.
Definition at line 3490 of file basebar2.cpp. 03491 { 03492 PORTNOTETRACE( "dialog", "BaseBar::CreateControlFromResource - do nothing - Resource usage" ); 03493 #ifndef EXCLUDE_FROM_XARALX 03494 const BarControlInfo*pBarCtlInfo; 03495 03496 if (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 03497 { 03498 pBarCtlInfo = &(pBarControl->GetHorzControl()->BarCtrlInfo); 03499 } 03500 else 03501 { 03502 switch(ParentDockBarType) 03503 { 03504 case DOCKBAR_TOP: 03505 case DOCKBAR_BOTTOM: 03506 case DOCKBAR_FLOAT: 03507 pBarCtlInfo =&(pBarControl->GetHorzControl()->BarCtrlInfo); 03508 break; 03509 case DOCKBAR_LEFT: 03510 case DOCKBAR_RIGHT: 03511 pBarCtlInfo =&(pBarControl->GetVertControl()->BarCtrlInfo); 03512 break; 03513 } 03514 } 03515 03516 HINSTANCE ModuleInst = NULL; 03517 UINT32 ToolModuleID = 0; 03518 03519 ModuleInst = GetModuleInst(pBarCtlInfo,&ToolModuleID); 03520 03521 // ------------------------------------------------------------------------------------- 03522 // Try to find, load and lock the dialog resource 03523 03524 HRSRC hRes = FindResource(ModuleInst, MAKEINTRESOURCE(pBarCtlInfo->ResourceID), RT_DIALOG); 03525 03526 ENSURE(hRes != NULL, "Could not find resource"); 03527 if (hRes == NULL) 03528 return FALSE; 03529 03530 // Try to get handle to global block containing resource data 03531 HGLOBAL hGlobalRes = LoadResource(ModuleInst, hRes); 03532 ENSURE(hGlobalRes != NULL, "Could not load resource"); 03533 if (hGlobalRes == NULL) 03534 return FALSE; 03535 03536 // Get the dialog resource 03537 DLGTEMPLATE* pDlg = (DLGTEMPLATE *) LockResource(hGlobalRes); 03538 ENSURE(pDlg != NULL, "Could not lock resource"); 03539 if (pDlg == NULL) 03540 return FALSE; 03541 03542 03543 // We are totally disinterested in the Dialog itself as it's only a recepticle for storing 03544 // control resources 03545 03546 03547 BOOL CreatedControl = FALSE; 03548 03549 // Loop until we have found the control to create 03550 03551 WORD NumControls = pDlg->cdit; // The number of items in the dialog 03552 03553 TRACEUSER( "Simon", _T("Dialog has %d controls"), NumControls); 03554 03555 // Get pointer to first control 03556 DLGITEMTEMPLATE *pCurrentControl = (DLGITEMTEMPLATE *) (((ADDR)pDlg) + SizeDlgHeader(pDlg)); 03557 03558 ENSURE(pCurrentControl != NULL, "Hideous Error in Load Controls"); 03559 03560 for (UINT32 i = 0; i< NumControls; i++) 03561 { 03562 if (pCurrentControl->id == pBarCtlInfo->ControlID) 03563 { 03564 // Yippee ! We have found the control required 03565 // Lets create it 03566 if (CreateControlItem(pCurrentControl,pBarControl,ModuleInst,ToolModuleID)) 03567 { 03568 CreatedControl = TRUE; 03569 } 03570 break; 03571 } 03572 pCurrentControl = (DLGITEMTEMPLATE *) 03573 (((ADDR)pCurrentControl) + SizeCtrlData(pCurrentControl)); 03574 } 03575 03576 // Lets do the nice thing 03577 UnlockResource(hGlobalRes); 03578 FreeResource(hGlobalRes); 03579 03580 return (CreatedControl); 03581 #else 03582 return FALSE; 03583 #endif 03584 }
|
|
Creates the control and attaches it as a child of the BaseBars window,.
Definition at line 3609 of file basebar2.cpp. 03613 { 03614 #pragma message( __LOCMSG__ "BaseBar::GetModuleInst - do nothing" ) 03615 TRACE( _T("Warning - BaseBar::GetModuleInst called") ); 03616 /* BarItemType ThisControlType = OTHERCONTROL; 03617 03618 BOOL ResizeWithFont = FALSE; 03619 03620 #if WIN32 03621 // Get pointer to the data after the DLGITEMTEMPLATE structure. 03622 WORD *pData = (WORD *) (pCurrentControl + 1); 03623 03624 // Obtain the class 03625 LPWSTR pClass; 03626 03627 if (*pData == 0xFFFF) 03628 { 03629 // Convert the atom value into a string 03630 03631 switch((*(pData+1))) 03632 { 03633 case 0x0080: 03634 { 03635 pClass = L"Button"; 03636 ThisControlType = BUTTON; 03637 ResizeWithFont = TRUE; 03638 break; 03639 } 03640 case 0x0081: 03641 { 03642 pClass = L"Edit"; 03643 ThisControlType = EDIT; 03644 ResizeWithFont = TRUE; 03645 break; 03646 } 03647 case 0x0082: 03648 { 03649 pClass = L"Static"; 03650 ThisControlType = STATIC; 03651 ResizeWithFont = TRUE; 03652 break; 03653 } 03654 case 0x0083: 03655 { 03656 pClass = L"Listbox"; 03657 ThisControlType = LIST; 03658 ResizeWithFont = TRUE; 03659 break; 03660 } 03661 case 0x0084: 03662 { 03663 pClass = L"Scrollbar"; 03664 ThisControlType = SCROLLBAR; 03665 break; 03666 } 03667 case 0x0085: 03668 { 03669 pClass = L"Combobox"; 03670 ThisControlType = COMBO; 03671 ResizeWithFont = TRUE; 03672 break; 03673 } 03674 } 03675 03676 pData += 2; 03677 } 03678 else 03679 { 03680 // The class is specified as a string 03681 pClass = (LPWSTR)pData; 03682 pData = (WORD *) MovePastWideStr((LPWSTR) pData); 03683 } 03684 03685 // Obtain the windows title 03686 LPWSTR pTitle; 03687 03688 if (*pData == 0xFFFF) 03689 { 03690 // It's a resource 03691 pTitle = (LPWSTR) (pData+1); 03692 03693 pData += 2; 03694 } 03695 else 03696 { 03697 pTitle = (LPWSTR) pData; 03698 // The title array is a string - skip it 03699 pData = (WORD *) MovePastWideStr((LPWSTR) pData); 03700 } 03701 03702 // Obtain the creation data 03703 LPVOID pCreationData = (LPVOID*) (pData+2); 03704 03705 03706 // ------------------------------------------------------------------------------------ 03707 03708 #else 03709 // Get pointer to the data after the DLGITEMTEMPLATE structure. 03710 ADDR pData = (ADDR) (pCurrentControl + 1); 03711 // Obtain the class 03712 03713 LPCTSTR pClass; 03714 LPCTSTR pTitle; 03715 03716 if ((*pData) & 0x80) 03717 { 03718 // An atom is specified 03719 03720 // Convert the atom 03721 switch((*(pData+1))) 03722 { 03723 case 0x0080: 03724 { 03725 pClass = "Button"; 03726 ThisControlType = BUTTON; 03727 ResizeWithFont = TRUE; 03728 break; 03729 } 03730 case 0x0081: 03731 { 03732 pClass = "Edit"; 03733 ThisControlType = EDIT; 03734 ResizeWithFont = TRUE; 03735 break; 03736 } 03737 case 0x0082: 03738 { 03739 pClass = "Static"; 03740 ThisControlType = STATIC; 03741 ResizeWithFont = TRUE; 03742 break; 03743 } 03744 case 0x0083: 03745 { 03746 pClass = "Listbox"; 03747 ThisControlType = LIST; 03748 ResizeWithFont = TRUE; 03749 break; 03750 } 03751 case 0x0084: 03752 { 03753 pClass = "Scrollbar"; 03754 ThisControlType = SCROLLBAR; 03755 break; 03756 } 03757 case 0x0085: 03758 { 03759 pClass = "Combobox"; 03760 ThisControlType = COMBO; 03761 ResizeWithFont = TRUE; 03762 break; 03763 } 03764 } 03765 pData++; 03766 03767 } 03768 else 03769 { 03770 pClass = (LPCTSTR)pData; // Get the class string 03771 03772 pData = (ADDR) MovePastWideStr((LPWSTR) pData); 03773 } 03774 03775 // Obtain the windows title 03776 pTitle = (LPCTSTR) pData; 03777 pData = (ADDR) MovePastWideStr((LPWSTR) pData); 03778 03779 // Obtain the creation data 03780 LPVOID pCreationData = (LPVOID*) pData+1; // Skip the length 03781 03782 #endif 03783 03784 // get the dialog base units so that we can convert to pixels 03785 INT32 BaseUnits = GetDialogBaseUnits(); 03786 03787 // A bit of nasty this.. hard code base units in so controls don't change size 03788 // if the user switches to LARGE FONTS 03789 03790 WORD DialogUnitX = X_BASEUNITS ;//LOWORD((UINT32)BaseUnits); 03791 WORD DialogUnitY = Y_BASEUNITS ;//HIWORD((UINT32)BaseUnits); 03792 03793 char AnsiClass[256]; 03794 char AnsiTitle[256]; 03795 03796 #if WIN32 03797 // we cannot pass Unicode strings under Win32s, so we convert to multibyte strings. 03798 // If we ever need a Chinese NT version then we could pass these directly onto 03799 // ::CreateWindowExW, but currently we always convert down to Ansi 03800 // INT32 result; 03801 03802 // really we should use WideCharToMultiByte, but it refuses to work under Win32s 1.1 03803 // returning zero with a GetLastError of 2, so we use camWcstombs instead. 03804 camWcstombs( AnsiClass, pClass, sizeof(AnsiClass) ); 03805 camWcstombs( AnsiTitle, pTitle, sizeof(AnsiTitle) ); 03806 #else 03807 // 16-bit version needs no conversion, but we have to copy them because we 03808 // crap upon them 03809 camStrcpy( AnsiClass, pClass ); 03810 camStrcpy( AnsiTitle, pTitle ); 03811 #endif 03812 03813 // Check for type here if not already set 03814 if(ThisControlType == OTHERCONTROL) 03815 { 03816 if (camStricmp(AnsiClass, "cc_BitmapButton") == 0) // Internal 03817 ThisControlType = BITMAPBUTTON; 03818 else if (camStricmp(AnsiClass, "cc_SmallButton") == 0) // Internal 03819 ThisControlType = SMALLBITMAPBUTTON; 03820 else if (camStricmp(AnsiClass, "cc_StaticBitmap") == 0) // Internal 03821 ThisControlType = STATICBITMAP; 03822 else if (camStricmp(AnsiClass, "cc_Text3D") == 0) // Internal 03823 ThisControlType = TEXT3D; 03824 else if (camStricmp(AnsiClass, "cc_Grid")==0) // Internal 03825 ThisControlType = ROTATEGRID; 03826 else if (camStricmp(AnsiClass,"cc_Slider")==0) // Internal 03827 ThisControlType = SLIDER; 03828 else if (camStricmp(AnsiClass, "cc_1dBitmapComboBoxEdit") == 0) // internal 03829 ThisControlType = BITMAPCOMBO1D; 03830 else if (camStricmp(AnsiClass, "cc_2dBitmapComboBoxEdit") == 0) // internal 03831 ThisControlType = BITMAPCOMBO2D; 03832 } 03833 03834 03835 DWORD Style = pCurrentControl->style; 03836 03837 OpDescriptor* OpDesc ; 03838 if (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 03839 { 03840 OpDesc = (pBarControl)->GetOpDescriptor(Horizontal); 03841 } 03842 else 03843 { 03844 switch(ParentDockBarType) 03845 { 03846 case DOCKBAR_TOP: 03847 case DOCKBAR_BOTTOM: 03848 case DOCKBAR_FLOAT: 03849 OpDesc = (pBarControl)-> GetOpDescriptor(Horizontal); 03850 break; 03851 case DOCKBAR_LEFT: 03852 case DOCKBAR_RIGHT: 03853 OpDesc = (pBarControl)-> GetOpDescriptor(Vertical); 03854 break; 03855 } 03856 } 03857 03858 if (OpDesc != NULL) 03859 { 03860 String_256 Desc; 03861 OpState NewState = OpDesc->GetOpsState(&Desc); 03862 if(NewState.Greyed) 03863 { 03864 Style |= BS_DISABLED; 03865 } 03866 else 03867 { 03868 Style &= (~BS_DISABLED); 03869 } 03870 } 03871 03872 OILDockingBar * ThisDock =GetMainFrame()->GetDockBar(ParentDockBarType); 03873 03874 if( ThisControlType == ROTATEGRID || 03875 ThisControlType == TEXT3D) 03876 ResizeWithFont = TRUE; 03877 03878 03879 if( ThisControlType == BITMAPBUTTON || 03880 ThisControlType == STATICBITMAP || 03881 ThisControlType == SMALLBITMAPBUTTON) 03882 { 03883 if (ThisDock->IsBigControls()) 03884 { 03885 Style &= (~BS_HALFSIZE); 03886 } 03887 else 03888 { 03889 Style |= BS_HALFSIZE; 03890 } 03891 } 03892 03893 // CHICAGO BODGE - this is something to do with dialog units/system font in Chicago 03894 // but until finalised this will do.. 03895 03896 INT32 XSize = (pCurrentControl->cx * DialogUnitX) / 4; 03897 INT32 YSize = (pCurrentControl->cy * DialogUnitY) / 8; 03898 03899 Style &= (~WS_VISIBLE); 03900 HWND CreatedWindow = ::CreateWindowEx( 03901 #if WIN32 03902 pCurrentControl->dwExtendedStyle, 03903 #else 03904 0, 03905 #endif 03906 AnsiClass, 03907 AnsiTitle, 03908 Style, 03909 0, 03910 0, 03911 XSize, 03912 YSize, 03913 GetSafeHwnd(), // this window is its parent 03914 (HMENU)pBarControl->GetUniqueGadgetID(), 03915 AfxGetApp()->m_hInstance, 03916 pCreationData 03917 ); 03918 03919 // if the class is a Jason button bar then we need to set its bitmap 03920 if (CreatedWindow != NULL) 03921 { 03922 // Store Hwnd in BarControl list 03923 pBarControl->SetWinID((CWindowID)CreatedWindow); 03924 ThisControlType = GetEnumItemType((BarItem *)pBarControl); 03925 03926 // Send old style messages to cc_StaticBitmap because that class doesn't yet have 03927 // PNG rendering ability 03928 if (ThisControlType == STATICBITMAP) 03929 { 03930 BitmapButtonInfo BtnInfo; 03931 03932 // find the position of the specifier's separator 03933 INT32 SeparatorPos = 0; 03934 while (AnsiTitle[SeparatorPos] != 0 && AnsiTitle[SeparatorPos] != '.') 03935 SeparatorPos++; 03936 03937 INT32 Index = 0; // Default to using icon index 0 if no '.' separator was found 03938 if (AnsiTitle[SeparatorPos] == '.') 03939 { 03940 // We found a separator. In that case, truncate the resource string at the '.' 03941 // so we can extract the bitmap name, and convert the text after the '.' into 03942 // an integer index. 03943 Index = _ttoi( AnsiTitle + SeparatorPos+1 ); 03944 AnsiTitle[SeparatorPos] = 0; 03945 } 03946 03947 // Fill in the BtnInfo structure 03948 BtnInfo.hAppInstance = ModuleInst; // We assume that the bitmap resouce can be 03949 // found in the same module as this control. 03950 String_256 Title =("L"); 03951 Title += TEXT(AnsiTitle); 03952 03953 BtnInfo.Bitmap[BMP_L_UNSELECTED] = (LPTSTR)Title; 03954 BtnInfo.Bitmap[BMP_S_UNSELECTED] = (LPTSTR)AnsiTitle; 03955 03956 BtnInfo.Bitmap[BMP_S_SELECTED] = NULL; // NULL, or name of selected bitmap 03957 BtnInfo.Bitmap[BMP_L_SELECTED] = NULL; // NULL, or name of selected bitmap 03958 03959 BtnInfo.UnselectedIndex=Index; // Indices of glyph bitmaps within the 03960 BtnInfo.SelectedIndex=Index; // Unselected/Selected bitmaps 03961 03962 ::SendMessage( CreatedWindow, WM_SETBITMAPS, 0, ((LPARAM) &BtnInfo)); 03963 } 03964 03965 // Send new style messages to the button classes because they can use PNG 03966 // resources 03967 if( ThisControlType == BITMAPBUTTON || 03968 ThisControlType == SMALLBITMAPBUTTON) 03969 { 03970 DialogManager::SetGadgetBitmaps(CreatedWindow, ModuleInst); 03971 } 03972 03973 03974 BOOL Horz=TRUE; 03975 if(ParentDockBarType == DOCKBAR_LEFT || ParentDockBarType == DOCKBAR_RIGHT) 03976 Horz = FALSE; 03977 03978 // Inform the help system that a control has been created 03979 ControlHelpInfo Info; 03980 Info.pOpDesc = pBarControl->GetOpDescriptor(Horz); 03981 Info.ModuleID = ToolModuleID; 03982 03983 // Are we making a tool ?? if so we'll have to set it's select state ... 03984 if (Info.pOpDesc) 03985 { 03986 if ((Info.pOpDesc)->IsKindOf(CC_RUNTIME_CLASS(ToolOpDescriptor))) 03987 { 03988 ToolOpDescriptor * ThisOpDesc = (ToolOpDescriptor *)Info.pOpDesc; 03989 ::SendMessage(CreatedWindow, BM_SETSTATE,(WORD)ThisOpDesc->IsCurrentTool(),0L); 03990 } 03991 } 03992 03993 if (Info.pOpDesc == NULL) 03994 { 03995 Info.BubbleID = pBarControl->GetBubbleID(Horz); 03996 Info.StatusID = pBarControl->GetStatusID(Horz); 03997 } 03998 else 03999 { 04000 Info.BubbleID = _R(IDBBL_NOOP); 04001 Info.StatusID = 0; 04002 } 04003 04004 if ( ThisControlType != BITMAPBUTTON && 04005 DDeckerState == DDECKER_NONE) 04006 { 04007 Ctl3dSubClassCtl(CreatedWindow); 04008 } 04009 04010 ControlHelper::NotifyControlCreated(CreatedWindow,&Info); 04011 04012 if(ThisControlType == SLIDER) 04013 { 04014 if(Horz == FALSE) 04015 { 04016 ::SetWindowPos(CreatedWindow,NULL,0,0,YSize,XSize, 04017 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04018 04019 } 04020 04021 04022 } 04023 // Create correctly sized normal and double decker controls 04024 // Add new controls to here as necessary 04025 if (ResizeWithFont) 04026 { 04027 // Reset the font of this control... 04028 if(DDeckerState == DDECKER_NONE) 04029 { 04030 ::SendMessage( CreatedWindow, WM_SETFONT, (WPARAM)BarFont->m_hObject, 0); 04031 switch (ThisControlType) 04032 { 04033 case BUTTON: 04034 case BITMAPBUTTON: 04035 { 04036 wxRect cRect; 04037 ::GetClientRect(CreatedWindow,&cRect); 04038 if(ParentDockBar->IsBigControls()) 04039 ::SetWindowPos(CreatedWindow,NULL,0,0,cRect.GetWidth(),LARGEBUTTONHEIGHT, 04040 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04041 else 04042 ::SetWindowPos(CreatedWindow,NULL,0,0,cRect.GetWidth(),SMALLBUTTONHEIGHT, 04043 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04044 break; 04045 } 04046 case EDIT: 04047 case COMBO: 04048 { 04049 wxRect cRect; 04050 ::GetClientRect(CreatedWindow,&cRect); 04051 ::SetWindowPos(CreatedWindow,NULL,0,0,cRect.GetWidth(),COMBOHEIGHT, 04052 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04053 break; 04054 } 04055 case ROTATEGRID: 04056 if(ParentDockBar->IsBigControls()) 04057 ::SetWindowPos(CreatedWindow,NULL,0,0,LARGEBUTTONHEIGHT,LARGEBUTTONHEIGHT, 04058 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04059 else 04060 ::SetWindowPos(CreatedWindow,NULL,0,0,SMALLBUTTONHEIGHT,SMALLBUTTONHEIGHT, 04061 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04062 break; 04063 } 04064 04065 } 04066 // Double decker 04067 else 04068 { 04069 DDeckerControlHeights DDeckerHeight; 04070 wxFont * ThisFont ; 04071 if(ParentDockBar->IsBigControls()) 04072 { 04073 if (ThisControlType == BITMAPBUTTON ||ThisControlType == BUTTON) 04074 ThisFont = FontFactory::GetwxFont(STOCKFONT_DIALOGBARLARGE); 04075 else 04076 ThisFont = FontFactory::GetwxFont(STOCKFONT_EDITFIELDLARGE); 04077 ::SendMessage( CreatedWindow, WM_SETFONT, (WPARAM)ThisFont->m_hObject, 0); 04078 DDeckerHeight = LARGE_DDECKERS ; 04079 } 04080 else 04081 { 04082 if (ThisControlType == BITMAPBUTTON ||ThisControlType == BUTTON) 04083 ThisFont = FontFactory::GetwxFont(STOCKFONT_DIALOGBARSMALL); 04084 else 04085 ThisFont = FontFactory::GetwxFont(STOCKFONT_EDITFIELDSMALL); 04086 ::SendMessage( CreatedWindow, WM_SETFONT, (WPARAM)ThisFont->m_hObject, 0); 04087 DDeckerHeight = SMALL_DDECKERS ; 04088 } 04089 04090 04091 switch(ThisControlType) 04092 { 04093 case BUTTON: 04094 case BITMAPBUTTON: 04095 { 04096 // NEW BUTTON STUFF 04097 if(pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 04098 ::SetWindowPos(CreatedWindow,NULL,0,0,GalButtonWidth,DDeckerHeight , 04099 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04100 else 04101 { 04102 wxRect cRect; 04103 ::GetClientRect(CreatedWindow,&cRect); 04104 ::SetWindowPos(CreatedWindow,NULL,0,0,cRect.GetWidth(),DDeckerHeight , 04105 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04106 } 04107 04108 04109 break; 04110 } 04111 case EDIT: 04112 case STATIC: 04113 { 04114 wxRect cRect; 04115 ::GetClientRect(CreatedWindow,&cRect); 04116 ::SetWindowPos(CreatedWindow,NULL,0,0,cRect.GetWidth(),DDeckerHeight, 04117 SWP_NOZORDER|SWP_NOMOVE|SWP_NOREDRAW); 04118 break; 04119 } 04120 case COMBO: 04121 ::SendMessage(CreatedWindow,CB_SETITEMHEIGHT,(WPARAM)-1,(LPARAM)DDeckerHeight); 04122 ::SendMessage(CreatedWindow,CB_SETITEMHEIGHT,(WPARAM)0,(LPARAM)DDeckerHeight); 04123 break; 04124 } 04125 } 04126 } 04127 } 04128 return (CreatedWindow != NULL); */ 04129 04130 return false; 04131 }
|
|
Allows subclasses to create additional bar controls.
Reimplemented in GalleryBar. Definition at line 3205 of file basebar2.cpp. 03206 { 03207 return TRUE; 03208 }
|
|
Special case for info bars.
Definition at line 3311 of file basebar2.cpp. 03312 { 03313 PORTNOTETRACE( "dialog", "BaseBar::CreateInfoControlFromResource - do nothing" ); 03314 #ifndef EXCLUDE_FROM_XARALX 03315 const BarControlInfo * pBarCtlInfo; 03316 static DLGITEMTEMPLATE * pCurrentControl; 03317 static HINSTANCE ModuleInst = NULL; 03318 static UINT32 ResID =0; 03319 static UINT32 ControlID; 03320 static HRSRC hRes = NULL; 03321 static DLGTEMPLATE* pDlg; 03322 static HGLOBAL hGlobalRes = NULL; 03323 03324 UINT32 ToolModuleID = 0; 03325 HINSTANCE ThisModuleInst = NULL; 03326 03327 // DISABLE CACHING FOR NOW ! 03328 Init = TRUE; 03329 03330 if(pBarControl==NULL) 03331 { if(hGlobalRes != NULL) 03332 { 03333 // Lets do the nice thing 03334 UnlockResource(hGlobalRes); 03335 FreeResource(hGlobalRes); 03336 } 03337 return FALSE; 03338 } 03339 03340 // Get control info 03341 if (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 03342 { 03343 pBarCtlInfo = &(pBarControl->GetHorzControl()->BarCtrlInfo); 03344 } 03345 else 03346 { 03347 switch(ParentDockBarType) 03348 { 03349 case DOCKBAR_TOP: 03350 case DOCKBAR_BOTTOM: 03351 case DOCKBAR_FLOAT: 03352 pBarCtlInfo =&(pBarControl->GetHorzControl()->BarCtrlInfo); 03353 break; 03354 case DOCKBAR_LEFT: 03355 case DOCKBAR_RIGHT: 03356 pBarCtlInfo =&(pBarControl->GetVertControl()->BarCtrlInfo); 03357 break; 03358 } 03359 } 03360 03361 // initialise ModuleInst 03362 if(Init) 03363 { 03364 ModuleInst = GetModuleInst(pBarCtlInfo,&ToolModuleID); 03365 } 03366 // normally just check if we need the same module 03367 else 03368 { 03369 ThisModuleInst = GetModuleInst(pBarCtlInfo,&ToolModuleID); 03370 if(ThisModuleInst != ModuleInst) 03371 { 03372 Init = TRUE; 03373 ModuleInst = ThisModuleInst; 03374 } 03375 if(ModuleInst == NULL) 03376 ENSURE(FALSE,"Can't find Module Instance"); 03377 if(pBarCtlInfo->ResourceID != ResID) 03378 { 03379 Init = TRUE; 03380 ResID = pBarCtlInfo->ResourceID; 03381 } 03382 } 03383 03384 BOOL CreatedControl = FALSE; 03385 03386 // Try to find, load and lock the dialog resource 03387 if(Init) 03388 { 03389 if(hGlobalRes!=NULL) 03390 { 03391 // Lets do the nice thing 03392 UnlockResource(hGlobalRes); 03393 FreeResource(hGlobalRes); 03394 } 03395 03396 hRes = FindResource(ModuleInst, MAKEINTRESOURCE(pBarCtlInfo->ResourceID), RT_DIALOG); 03397 if (hRes == NULL) 03398 { 03399 ERROR3_PF( ("Could not find RT_DIALOG id %u in %x", pBarCtlInfo->ResourceID, 03400 ModuleInst ) ); 03401 return FALSE; 03402 } 03403 // Try to get handle to global block containing resource data 03404 hGlobalRes = LoadResource(ModuleInst, hRes); 03405 ENSURE(hGlobalRes != NULL, "Could not load resource"); 03406 if (hGlobalRes == NULL) 03407 return FALSE; 03408 03409 // Get the dialog resource 03410 pDlg = (DLGTEMPLATE *) LockResource(hGlobalRes); 03411 ENSURE(pDlg != NULL, "Could not lock resource"); 03412 if (pDlg == NULL) 03413 return FALSE; 03414 03415 pCurrentControl = (DLGITEMTEMPLATE *) (((ADDR)pDlg) + SizeDlgHeader(pDlg)); 03416 } 03417 03418 //TRACE( _T("found %d after %d"),pCurrentControl->id,pBarCtlInfo->ControlID); 03419 03420 if(!Init) 03421 { 03422 if (pCurrentControl->id == pBarCtlInfo->ControlID ) 03423 { 03424 // Yippee ! We have found the control required 03425 // Lets create it 03426 if (CreateControlItem(pCurrentControl,pBarControl,ModuleInst,ToolModuleID)) 03427 { 03428 return TRUE; 03429 } 03430 else 03431 { 03432 ENSURE(FALSE,"Failed to create control"); 03433 return FALSE; 03434 } 03435 pCurrentControl = (DLGITEMTEMPLATE *) 03436 (((ADDR)pCurrentControl) + SizeCtrlData(pCurrentControl)); 03437 } 03438 else 03439 { 03440 Init =TRUE; 03441 return CreateInfoControlFromResource(pBarControl,TRUE); 03442 } 03443 } 03444 03445 03446 if(Init) 03447 { 03448 03449 DLGITEMTEMPLATE * ThisControl = GetPointerToControl(pDlg ,pBarCtlInfo->ControlID); 03450 if(ThisControl==NULL) 03451 { 03452 //ENSURE(FALSE,"Can't find Control in Resource"); 03453 ERROR3_PF(("Can't find Control (%d / 0x%x) in Resource (%d / 0x%x)", pBarCtlInfo->ControlID, pBarCtlInfo->ControlID, pBarCtlInfo->ResourceID, pBarCtlInfo->ResourceID)); 03454 return FALSE; 03455 } 03456 if (CreateControlItem(ThisControl,pBarControl,ModuleInst,ToolModuleID)) 03457 { 03458 return TRUE; 03459 } 03460 else 03461 { 03462 return FALSE; 03463 } 03464 pCurrentControl = (DLGITEMTEMPLATE *) 03465 (((ADDR)ThisControl) + SizeCtrlData(ThisControl)); 03466 } 03467 03468 return (CreatedControl); 03469 #else 03470 return FALSE; 03471 #endif 03472 }
|
|
Creates tool bar button control.
Definition at line 3228 of file basebar2.cpp. 03229 { 03230 return TRUE ; 03231 }
|
|
called from DialogBarOp message handler when Clt is pressed toggles between cut and copy drag control modes
Definition at line 6752 of file basebar2.cpp. 06753 { 06754 //TRACEUSER( "chris", _T("Ctl state %d\n"),state); 06755 06756 if(CtlDragState == NO_DRAG) 06757 return FALSE; 06758 if(state) 06759 { 06760 if(CtlDragMode==CUT) 06761 { 06762 // check we have a cursor to swap ! 06763 if(pCurrentCursor) 06764 SwapCursors( _R(IDC_BUTTONDRAGCOPY) ); 06765 CtlDragMode=COPY; 06766 } 06767 } 06768 else 06769 { 06770 if(CtlDragMode==COPY) 06771 { 06772 if(pCurrentCursor) 06773 SwapCursors( _R(IDC_BUTTONDRAGCUT) ); 06774 CtlDragMode=CUT; 06775 } 06776 } 06777 return FALSE; 06778 }
|
|
Declares any preferences that the BaseBar class needs to decalre.
Definition at line 295 of file basebar2.cpp. 00296 { 00297 // Use a built-in resource rather than an ini file setting... 00298 INT32 TempWidth = 72; 00299 Convert::StringToLong( String_8( _R(IDS_DEFAULT_GAL_BUTTON_SIZE) ), &TempWidth ); 00300 GalButtonWidth = (UINT32)TempWidth; 00301 return TRUE; 00302 00303 // GalButtonWidth = 72; 00304 // return Camelot.DeclareSection("Galleries",2) 00305 // && Camelot.DeclarePref("Galleries", "ButtonWidth", &GalButtonWidth); 00306 }
|
|
Drops a dragged control onto a given Window.
Definition at line 6904 of file basebar2.cpp. 06905 { 06906 #pragma message( __LOCMSG__ "BaseBar::DropControl - do nothing" ) 06907 TRACE( _T("Warning - BaseBar::DropControl called") ); 06908 /* BOOL DeleteSeparator = FALSE; 06909 06910 // get a wxWindow from this HWND 06911 BaseBar * DropBar = (BaseBar*)FromHandlePermanent(OverBar); 06912 DialogBarOp * DropOp; 06913 06914 //Get the DialogOp for this HWND 06915 DropOp = DialogBarOp::FindDialogBarOp((UINT32)OverBar ); 06916 if(DropOp) 06917 { 06918 // make a copy of the control we are dragging 06919 BarControl * foundControl = (BarControl*)pOp->GetBarItem(DragCtlHwnd); 06920 BarControl * newControl = new BarControl(*foundControl); 06921 UINT32 NewID; 06922 06923 ERROR2IF(foundControl == NULL,FALSE,"Can't find Bar Item"); 06924 ERROR2IF(newControl == NULL,FALSE,"Can't create new Bar Control"); 06925 06926 // check orientation of the bar we are dropping on 06927 BOOL Horizontal = DropOp->IsHorizontal(); 06928 06929 // give the control a unique id in this bar 06930 newControl->SetUniqueGadgetID(NewID=DropOp->GetUniqueID()); 06931 06932 INT32 ControlIndex; 06933 wxPoint ClientPos = point; 06934 DropBar->ScreenToClient(&ClientPos); 06935 06936 // find position for new control in bar 06937 ControlIndex = DropBar->GetNearestControl(ClientPos); 06938 06939 // **************************************************** 06940 // Insertion / Deletion of Separators 06941 06942 //have we dropped this control back onto itself ? 06943 // if so should we 06944 // a) insert a new separator 06945 // b) delete an existing one 06946 06947 06948 // get the window rect of the control we are dragging 06949 // and convert to Client coords 06950 wxRect DragWnd; 06951 ::GetWindowRect(DragCtlHwnd,&DragWnd); 06952 ScreenToClient(&DragWnd); 06953 06954 // check the last item 06955 BarItem* pLastItem = NULL ; 06956 if((ControlIndex-1)>=0) 06957 pLastItem = DropOp->GetPtrBarItem(ControlIndex-1); 06958 06959 // if the last item is a separator allow us to drop onto it 06960 // by growing the hittest rectangle 06961 if(pLastItem) 06962 { 06963 if(pLastItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 06964 { 06965 DragWnd.GetTop() -= SeparatorWidth; 06966 DragWnd.GetLeft() -= SeparatorWidth; 06967 } 06968 } 06969 06970 // is the mouse over the dragged control or it's preceeding separator 06971 if(DragWnd.PtInRect(ClientPos)) 06972 { 06973 06974 wxPoint StartDrag(DragCtlOffset); 06975 ::ClientToScreen(DragCtlHwnd,&StartDrag); 06976 ScreenToClient(&StartDrag); 06977 06978 INT32 CheckPos = ClientPos.x; 06979 INT32 StartPos = StartDrag.x; 06980 06981 // if the control is at the fromt of a slot we want to use y movement 06982 // to determine insertion or deletion 06983 // this is the case if the prev item is a LF or the bar is vertical 06984 // or if the prev item is a SP and it's prev is a LF (!) 06985 if(pLastItem) 06986 { 06987 if(pLastItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))|| !Horizontal) 06988 { 06989 CheckPos = ClientPos.y; 06990 StartPos = StartDrag.y; 06991 } 06992 06993 if(pLastItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 06994 { 06995 BarItem* pPrevLastItem = NULL ; 06996 if((ControlIndex -2)>=0) 06997 pPrevLastItem = DropOp->GetPtrBarItem(ControlIndex-2); 06998 if(pPrevLastItem) 06999 { 07000 if(pPrevLastItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))||!Horizontal) 07001 { 07002 CheckPos = ClientPos.y; 07003 StartPos = StartDrag.y; 07004 } 07005 } 07006 07007 // StartPos -= SeparatorWidth; 07008 } 07009 } 07010 07011 // which way have we moved ? 07012 if(CheckPos>StartPos) 07013 InsertSeparator = TRUE; 07014 else 07015 DeleteSeparator = TRUE; 07016 } 07017 07018 07019 if(InsertSeparator && ControlIndex>0) // don't insert a separator at the head of the bar 07020 { 07021 07022 // BarItem* LastItem = NULL ; 07023 // LastItem = DropOp->GetPtrBarItem(ControlIndex-1); 07024 if(pLastItem!=NULL) 07025 { 07026 if(!pLastItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 07027 { 07028 BarSeparator* newSep=NULL; 07029 newSep = new BarSeparator; 07030 if(newSep) 07031 { 07032 DropOp->InsertItemAfter(ControlIndex-1,newSep); 07033 07034 //TRACEUSER( "chris", _T("Just added a separator at %d\n"),ControlNumber-1); 07035 ControlIndex ++; 07036 } 07037 } 07038 } 07039 } 07040 07041 // insert the item 07042 DropOp->InsertItemAfter(ControlIndex-1,(BarItem *)newControl); 07043 07044 // create the windows control 07045 DropBar->CreateControlFromResource(newControl); 07046 07047 // send a create message to allow the control to init itself 07048 OpDescControlCreateMsg op(newControl->GetOpDescriptor(Horizontal), 07049 newControl->GetBarControlInfo(Horizontal).ControlID, 07050 NewID, 07051 DropOp); 07052 07053 newControl->GetOpDescriptor(Horizontal)->Message(&op); 07054 if(pOp!=DropOp) 07055 { 07056 // format and size the bar we have dropped on 07057 switch(DropBar->GetDockBarType()) 07058 { 07059 case DOCKBAR_FLOAT: 07060 { 07061 DropBar->FormatFloatingBar(TRUE,USE_BAR); 07062 } 07063 break; 07064 case DOCKBAR_LEFT: 07065 case DOCKBAR_RIGHT: 07066 DropBar->FormatVerticalBar(TRUE,USE_BAR); 07067 break; 07068 case DOCKBAR_TOP: 07069 case DOCKBAR_BOTTOM: 07070 DropBar->FormatHorizontalBar(TRUE,USE_BAR); 07071 break; 07072 } 07073 DropBar->SetBarSize(DropBar->GetDockBarType()); 07074 DropBar->InvalidateRect(NULL,TRUE); 07075 } 07076 } 07077 return DeleteSeparator; */ 07078 07079 return false; 07080 }
|
|
called at the end of a control drag decides where to drop the dragged control... does it and tidies up the drag.
Definition at line 7097 of file basebar2.cpp. 07098 { 07099 #pragma message( __LOCMSG__ "BaseBar::EndControlDrag - do nothing" ) 07100 TRACE( _T("Warning - BaseBar::EndControlDrag called") ); 07101 /* // go to screen co-ords - we may be dropping on a different bar 07102 wxPoint sPnt= point; 07103 ClientToScreen(&sPnt); 07104 BOOL MovingSeparator = FALSE; 07105 BOOL DeleteLineFeed = FALSE; 07106 07107 BaseBar * DropBar=NULL; 07108 07109 // check if the drag has finished over an existing bar 07110 HWND OverBar = GetMainFrame()->IsScreenPointInBar(sPnt); 07111 07112 PaintDragRect(OldDragRect,wxRect(0,0,0,0),DOCKBAR_FLOAT,DOCKBAR_FLOAT); 07113 07114 CtlDragState = NO_DRAG; 07115 if(OverBar) 07116 { 07117 DropBar = (BaseBar*)FromHandlePermanent(OverBar); 07118 07119 // can't drop into an info bar 07120 // but as the user might think we can... we'll just cancel 07121 // the drag 07122 if(DropBar->IsInfoBar()) 07123 { 07124 TidyUpControlDrag(); 07125 // we haven't deleted the bar so return FALSE 07126 return FALSE; 07127 } 07128 07129 // can't drop on the control bank 07130 if(DropBar->IsBarAllCtlBar()) 07131 OverBar = NULL ; 07132 07133 // we don't want to copy a control onto the same bar ! 07134 if(DropBar==this && CtlDragMode == COPY) 07135 { 07136 TidyUpControlDrag(); 07137 // we haven't deleted the bar so return FALSE 07138 return FALSE; 07139 } 07140 } 07141 07142 ERROR2IF(pOp==NULL,FALSE,"Null BarOp"); 07143 07144 07145 BarItem * LastItem = NULL; 07146 BarItem * thisItem = pOp->GetBarItem((CWindowID)DragCtlHwnd); 07147 07148 07149 // Check if the control has an preceeding separator 07150 LastItem = pOp->GetPtrBarPrev(thisItem); 07151 if ( LastItem ) 07152 if ( LastItem->IsKindOf( CC_RUNTIME_CLASS(BarSeparator))) 07153 MovingSeparator = TRUE; 07154 07155 07156 // drop the control into the bar 07157 BOOL DeleteSeparator = FALSE; 07158 BOOL DoTidyOverlap=FALSE; 07159 07160 if (OverBar) 07161 DeleteSeparator = DropControl(sPnt,OverBar,FALSE ); //MovingSeparator); 07162 07163 // check for cut mode 07164 if (( CtlDragMode == CUT || DeleteSeparator == TRUE ) && !pOp->IsAllBarsOp() ) 07165 { 07166 // delete the separator 07167 if (MovingSeparator && DeleteSeparator) 07168 { 07169 delete pOp->RemoveBarItem(LastItem); 07170 } 07171 07172 // delete the item from the kernel list 07173 pOp->DeleteBarItem((CWindowID)DragCtlHwnd); 07174 07175 // and destroy the window 07176 ::DestroyWindow(DragCtlHwnd); 07177 07178 // inform subclassing 07179 ControlHelper::NotifyControlDeleted(DragCtlHwnd); 07180 07181 // remove leading, trailing and multiple linefeeds 07182 TidyBarItemsAfterDrag(); 07183 07184 07185 07186 // no controls left on the bar so delete it 07187 if(pOp->IsListEmpty()) 07188 { 07189 TidyUpControlDrag(); 07190 07191 BROADCAST_TO_CLASS(DialogMsg(GetSafeHwnd(), DIM_CANCEL, NULL), DialogOp); 07192 07193 return TRUE; 07194 } 07195 // else reformat and invalidate 07196 else 07197 { 07198 switch(GetDockBarType()) 07199 { 07200 case DOCKBAR_FLOAT: 07201 FormatFloatingBar(TRUE,USE_BAR); 07202 break; 07203 case DOCKBAR_LEFT: 07204 case DOCKBAR_RIGHT: 07205 DoTidyOverlap=TRUE; 07206 FormatVerticalBar(TRUE,USE_BAR); 07207 break; 07208 case DOCKBAR_TOP: 07209 case DOCKBAR_BOTTOM: 07210 DoTidyOverlap=TRUE; 07211 FormatHorizontalBar(TRUE,USE_BAR); 07212 break; 07213 } 07214 SetBarSize(GetDockBarType()); 07215 InvalidateRect(NULL,TRUE); 07216 } 07217 } 07218 if(DropBar) 07219 { 07220 OILDockingBar * ThisDock = GetMainFrame()->GetDockBar(DropBar->GetDockBarType() ); 07221 switch(DropBar->GetDockBarType()) 07222 { 07223 case DOCKBAR_LEFT: 07224 case DOCKBAR_RIGHT: 07225 case DOCKBAR_TOP: 07226 case DOCKBAR_BOTTOM: 07227 ((OILFixedDockingBar*)ThisDock)->CheckAndCorrectOverlap(); 07228 break; 07229 } 07230 } 07231 // tidy up and out of here 07232 TidyUpControlDrag(); */ 07233 return FALSE; 07234 }
|
|
called from DialogBarOp message handler when Esc is pressed will end any bar type drag
Definition at line 6713 of file basebar2.cpp. 06714 { 06715 //TRACEUSER( "chris", _T("Esc state %d\n"),state); 06716 if(CurrentBar == NULL) 06717 return FALSE; 06718 if(CtlDragState==DRAGGING) 06719 { 06720 06721 CurrentBar->PaintDragRect(CurrentBar->OldDragRect,wxRect(0,0,0,0),DOCKBAR_FLOAT,DOCKBAR_FLOAT); 06722 CurrentBar->TidyUpControlDrag(); 06723 06724 return TRUE; 06725 } 06726 else if(DragType != NONE) 06727 { 06728 CurrentBar->FormatLineFeeds(CurrentBar->DragStartRect.GetWidth()); 06729 CurrentBar->InitFormatRects(); 06730 CurrentBar->TidyUpBarDrag(); 06731 return TRUE; 06732 } 06733 return FALSE; 06734 }
|
|
To reset the variable which stops us grabbing back the focus in mainframe if the bar / gallery hasn't been created.
Definition at line 475 of file basebar2.cpp. 00476 { 00477 DoingErrorBox = FALSE; 00478 }
|
|
Reimplemented in GalleryBar. Definition at line 2418 of file basebar2.cpp. 02419 { 02420 switch(ParentDockBarType) 02421 { 02422 case DOCKBAR_FLOAT: 02423 return(FormatFloatingBar(MoveWindows, ForceSize)); 02424 break; 02425 02426 case DOCKBAR_TOP: 02427 case DOCKBAR_BOTTOM: 02428 return(FormatHorizontalBar(MoveWindows, ForceSize)); 02429 break; 02430 02431 case DOCKBAR_LEFT: 02432 case DOCKBAR_RIGHT: 02433 return(FormatVerticalBar(MoveWindows, ForceSize)); 02434 break; 02435 02436 default: 02437 break; 02438 } 02439 return(FALSE); 02440 }
|
|
Format a floating toolbar with separators and newlines.
Definition at line 2460 of file basebar2.cpp. 02461 { 02462 // TRACEUSER( "Gerry", _T("FormatFloatingBar\n")); 02463 02464 #pragma message( __LOCMSG__ "BaseBar::FormatFloatingBar - do nothing" ) 02465 TRACE( _T("Warning - BaseBar::FormatFloatingBar called") ); 02466 /* HWND hcontrol; 02467 wxSize BarSize(0,0); 02468 INT32 xpos = BAR_BORDERSIZE; 02469 INT32 ypos = BAR_BORDERSIZE; 02470 INT32 yOffset = 0; 02471 INT32 MaxWidth = 0; 02472 INT32 DDeckerStart = 0; 02473 INT32 DDeckerEnd = 0; 02474 02475 BarItem * pBarItem; 02476 BarItem * LastItem = NULL; 02477 02478 // Check Current Control Sizes in this Docking Bar 02479 INT32 ControlWidth = 0; 02480 INT32 ControlHeight = 0; 02481 ControlSizes ControlSize; 02482 02483 DDeckerReadState DDeckerState = DDECKER_NONE; 02484 DDeckerControlHeights DDeckerHeight = SMALL_DDECKERS; 02485 02486 //if we are dragging a bar check the size of the dock we are over 02487 // otherwise use control size of parent dock 02488 OILDockingBar * ThisDock ; 02489 DockBarType CurrentType; 02490 02491 CurrentType = (DragType==MOVE) ? DragDockBarType : ParentDockBarType; 02492 ThisDock = GetMainFrame()->GetDockBar(CurrentType); 02493 02494 BarItemType ThisControl; 02495 BarItemType LastControl = OTHERCONTROL; 02496 02497 INT32 LargeWidth = LARGEBUTTONWIDTH; 02498 INT32 LargeHeight = LARGEBUTTONHEIGHT; 02499 INT32 SmallWidth = SMALLBUTTONWIDTH; 02500 INT32 SmallHeight = SMALLBUTTONHEIGHT; 02501 INT32 Control =0; 02502 02503 // Get the current control size for this dock 02504 if (ForceSize == USE_BAR) 02505 { 02506 if (ThisDock->IsBigControls()) 02507 { 02508 ControlWidth = LargeWidth; 02509 ControlHeight = LargeHeight; 02510 } 02511 else 02512 { 02513 ControlWidth = SmallWidth; 02514 ControlHeight = SmallHeight; 02515 } 02516 } 02517 else if (ForceSize == FORCE_LARGE) 02518 { 02519 ControlWidth = LargeWidth; 02520 ControlHeight = LargeHeight; 02521 02522 } 02523 else if (ForceSize == FORCE_SMALL) 02524 { 02525 ControlWidth = SmallWidth; 02526 ControlHeight = SmallHeight; 02527 } 02528 02529 02530 if (ControlHeight == LargeHeight ) 02531 { 02532 ControlSize = LARGE_CONTROLS; 02533 DDeckerHeight = LARGE_DDECKERS ; 02534 } 02535 else 02536 { 02537 ControlSize = SMALL_CONTROLS; 02538 DDeckerHeight = SMALL_DDECKERS ; 02539 } 02540 // if list is empty just set a minimum size 02541 if (! pOp->IsListEmpty()) 02542 { 02543 // TRACEUSER( "chris", _T("\n --- FORMAT ---\n")); 02544 pBarItem = pOp->GetPtrBarHead(); 02545 02546 while (pBarItem != NULL) 02547 { 02548 ThisControl = GetEnumItemType(pBarItem); 02549 // Double Decker stuff... 02550 switch(ThisControl) 02551 { 02552 case DECKER_TOP: 02553 { 02554 DDeckerState = DDECKER_TOP; 02555 // xpos to come back to 02556 DDeckerStart = xpos; 02557 } 02558 break; 02559 case DECKER_BOTTOM: 02560 { 02561 DDeckerState = DDECKER_BOTTOM; 02562 // extent of double decker 02563 DDeckerEnd = xpos; 02564 // go back to start 02565 xpos = DDeckerStart; 02566 02567 } 02568 break; 02569 case DECKER_END: 02570 { 02571 DDeckerState = DDECKER_NONE; 02572 // check for longest line top or bottom ? 02573 if(xpos < DDeckerEnd) 02574 xpos = DDeckerEnd; 02575 } 02576 break; 02577 case SEPARATOR: 02578 // insert a separator normally this is horizontal but if the last control was 02579 // a LineFeed we do a vertical separator 02580 { 02581 if(LastItem) 02582 { 02583 if (LastItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))) 02584 ypos += SeparatorWidth; 02585 else 02586 xpos += SeparatorWidth; 02587 } 02588 // TRACEUSER( "chris", _T("Separator\n")); 02589 } 02590 break; 02591 case LINEFEED: 02592 // move down to next line and reset xpos 02593 { 02594 ypos += ControlHeight+VERTICAL_SPACE; // Move down to the next line 02595 if(IS_CHICAGO && pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 02596 ypos +=4; 02597 xpos = BAR_BORDERSIZE; 02598 DDeckerStart = xpos; 02599 } 02600 break; 02601 } 02602 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 02603 { 02604 // TRACEUSER( "chris", _T("Control\n")); 02605 hcontrol=(HWND)((BarControl*)pBarItem)->GetWinID(); // Get the Window Handle 02606 wxRect WindSize; 02607 02608 ::GetClientRect(hcontrol,&WindSize); // Get the window size 02609 switch (DDeckerState) 02610 { 02611 case DDECKER_TOP: 02612 if(ThisControl == SMALLBITMAPBUTTON) 02613 { 02614 if (ControlSize == LARGE_CONTROLS) 02615 yOffset = (ControlHeight / 2) - sLARGEBUTTONHEIGHT +1; //get offset to center control 02616 else 02617 yOffset = (ControlHeight / 2) - sSMALLBUTTONHEIGHT +1; 02618 xpos++; 02619 } 02620 else 02621 { 02622 yOffset = (ControlHeight / 2) - // WindSize.GetHeight()+1; 02623 DDeckerHeight + 1 ; 02624 } 02625 02626 // bodge to center static text 02627 if(ThisControl == STATIC) 02628 yOffset +=3; 02629 02630 break; 02631 case DDECKER_BOTTOM : 02632 yOffset = (ControlHeight / 2) ; //get offset to center control 02633 // bodge to center static text 02634 if(ThisControl == STATIC) 02635 yOffset +=3; 02636 if ( ThisControl == SMALLBITMAPBUTTON) 02637 { 02638 yOffset ++ ; 02639 xpos ++; 02640 } 02641 if(IS_CHICAGO) 02642 { 02643 yOffset ++; 02644 } 02645 break; 02646 case DDECKER_NONE : 02647 yOffset = (ControlHeight - WindSize.GetHeight()) / 2; //get offset to center control 02648 break; 02649 } 02650 02651 if (MoveWindows) 02652 ::SetWindowPos(hcontrol,NULL,xpos,ypos + yOffset,0,0, // Move the control 02653 SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOZORDER|SWP_NOREDRAW); 02654 02655 xpos += WindSize.GetWidth()-1; 02656 if(ThisControl == STATICBITMAP) 02657 xpos ++; 02658 else if(ThisControl == SLIDER) 02659 xpos +=4; 02660 LastControl = ThisControl ; 02661 02662 if(IS_CHICAGO) 02663 { 02664 if(ThisControl == EDIT) 02665 xpos += 2; 02666 } 02667 02668 } 02669 02670 // keep MaxWidth up to date 02671 if (xpos > MaxWidth) 02672 MaxWidth = xpos; 02673 02674 // remember last control 02675 LastItem = pBarItem; 02676 02677 // move to next item 02678 pBarItem = pOp->GetPtrBarNext(pBarItem); 02679 } 02680 02681 02682 // 02683 BarSize.width = MaxWidth + BAR_BORDERSIZE + (BorderWidth * 2) + 1 ; 02684 BarSize.cx = ypos + ControlHeight + BAR_BORDERSIZE + (BorderWidth * 2) ; 02685 02686 } 02687 // Set a Minimum Bar Height 02688 if (BarSize.cx < ControlHeight + (BAR_BORDERSIZE)+ (BorderWidth * 2)) 02689 BarSize.cx = ControlHeight + (BAR_BORDERSIZE)+ (BorderWidth * 2); 02690 02691 // ---------------------------- 02692 // Set a Minimum Bar Width 02693 02694 String_32 Name = pOp->GetName(); 02695 02696 INT32 SmallestWidth = ControlWidth + (BAR_BORDERSIZE * 2)+ (BorderWidth * 2); 02697 02698 // If this an empty bar make sure we can see the title 02699 if (pOp->IsListEmpty()) 02700 { 02701 // Select the title font into a screen dc and get the text extent of the title 02702 wxDC *dc = GetWindowDC(); 02703 02704 wxFont * OldFont=dc->SelectObject(TitleFont); 02705 02706 wxSize TextSize=dc->GetTextExtent(Name,camStrlen(Name)); 02707 02708 dc->SelectObject(OldFont); 02709 02710 ReleaseDC(dc); 02711 02712 // Check that the title string will be visible UIC 02713 if ((TextSize.width + TitleBarHeight + (BorderWidth * 4) ) > SmallestWidth) 02714 SmallestWidth = TextSize.width + TitleBarHeight + (BorderWidth * 4); 02715 } 02716 02717 02718 if (BarSize.width < SmallestWidth) 02719 BarSize.width = SmallestWidth ; 02720 02721 AdjustFormattedBarSize(&BarSize); 02722 if (MoveWindows) 02723 PositionExtraControls(BarSize,xpos,ypos+ControlHeight); 02724 // Cache the rectangle 02725 if (ForceSize == USE_BAR) 02726 { 02727 if (ThisDock->IsBigControls()) 02728 { 02729 FloatLargeRect.GetRight() = BarSize.width; 02730 FloatLargeRect.GetBottom() = BarSize.cx + TitleBarHeight; // UIC 02731 } 02732 else 02733 { 02734 FloatSmallRect.GetRight() = BarSize.width; 02735 FloatSmallRect.GetBottom() = BarSize.cx + TitleBarHeight; // UIC 02736 } 02737 } 02738 else if (ForceSize == FORCE_LARGE) 02739 { 02740 FloatLargeRect.GetRight() = BarSize.width; 02741 FloatLargeRect.GetBottom() = BarSize.cx + TitleBarHeight; // UIC 02742 } 02743 else if (ForceSize == FORCE_SMALL) 02744 { 02745 FloatSmallRect.GetRight() = BarSize.width; 02746 FloatSmallRect.GetBottom() = BarSize.cx + TitleBarHeight; // UIC 02747 } */ 02748 return TRUE; 02749 };
|
|
Format a Horizontal toolbar with separators.
Reimplemented in GalleryBar. Definition at line 2768 of file basebar2.cpp. 02769 { 02770 // TRACEUSER( "Gerry", _T("FormatHorizontalBar\n")); 02771 02772 #pragma message( __LOCMSG__ "BaseBar::FormatHorizontalBar - do nothing" ) 02773 TRACE( _T("Warning - BaseBar::FormatHorizontalBar called") ); 02774 /* BOOL AtFront = TRUE; 02775 HWND hcontrol; 02776 // Find out how many bar items 02777 UINT32 NumBarItems = pOp->GetNumBarItems(); 02778 INT32 ypos = 0 ; 02779 INT32 xpos = BAR_BORDERSIZE; 02780 INT32 yOffset = 0; 02781 INT32 DDeckerStart = 0; 02782 INT32 DDeckerEnd = 0; 02783 wxSize BarSize(0,0); 02784 BarItem* pBarItem; 02785 ControlSizes ControlSize; 02786 DDeckerReadState DDeckerState = DDECKER_NONE; 02787 DDeckerControlHeights DDeckerHeight = SMALL_DDECKERS; 02788 INT32 ButtonSize; 02789 BarItemType ThisControl ; 02790 BarItemType LastControl = OTHERCONTROL; 02791 // if we are dragging a bar check the size of the dock we are over 02792 // otherwise use control size of parent dock 02793 02794 OILDockingBar * ThisDock ; 02795 DockBarType CurrentType; 02796 02797 CurrentType = (DragType==MOVE) ? DragDockBarType : ParentDockBarType; 02798 ThisDock = GetMainFrame()->GetDockBar(CurrentType); 02799 02800 // Get the current control size for this dock 02801 if (ForceSize == USE_BAR) 02802 { 02803 if (ThisDock->IsBigControls()) 02804 ControlSize = LARGE_CONTROLS; 02805 else 02806 ControlSize = SMALL_CONTROLS; 02807 } 02808 else if (ForceSize == FORCE_LARGE) 02809 { 02810 ControlSize = LARGE_CONTROLS; 02811 } 02812 else if (ForceSize == FORCE_SMALL) 02813 { 02814 ControlSize = SMALL_CONTROLS; 02815 } 02816 02817 02818 if (ControlSize == LARGE_CONTROLS) 02819 { 02820 ButtonSize = LARGEBUTTONWIDTH-1; 02821 DDeckerHeight = LARGE_DDECKERS ; 02822 } 02823 else 02824 { 02825 ButtonSize = SMALLBUTTONWIDTH-1; 02826 DDeckerHeight = SMALL_DDECKERS ; 02827 } 02828 // if list is empty just set a minimum size 02829 if (! pOp->IsListEmpty()||ThisIsAnInfoBar) 02830 { 02831 02832 pBarItem = pOp->GetPtrBarHead(); 02833 02834 while(pBarItem!=NULL) 02835 { 02836 // Get the next BarItem 02837 ThisControl = GetEnumItemType(pBarItem); 02838 switch ( ThisControl ) 02839 { 02840 case DECKER_TOP: 02841 { 02842 DDeckerState = DDECKER_TOP; 02843 // xpos to come back to 02844 DDeckerStart = xpos; 02845 } 02846 break; 02847 case DECKER_BOTTOM: 02848 { 02849 DDeckerState = DDECKER_BOTTOM; 02850 // extent of double decker 02851 DDeckerEnd = xpos; 02852 // go back to start 02853 xpos = DDeckerStart; 02854 02855 } 02856 break; 02857 case DECKER_END: 02858 { 02859 DDeckerState = DDECKER_NONE; 02860 // check for longest line top or bottom ? 02861 if ( xpos < DDeckerEnd) 02862 xpos = DDeckerEnd; 02863 } 02864 break; 02865 case SEPARATOR: 02866 { 02867 if( ! AtFront ) // don't separate at the front of a bar 02868 { 02869 xpos += SeparatorWidth; 02870 } 02871 } 02872 break; 02873 } 02874 02875 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 02876 { 02877 hcontrol=(HWND)((BarControl*)pBarItem)->GetWinID(); // Get the Window Handle 02878 02879 wxRect WindSize; 02880 ::GetClientRect(hcontrol,&WindSize); 02881 switch (DDeckerState) 02882 { 02883 case DDECKER_TOP: 02884 02885 // this is all rather messy because SMALLBITMAPBUTTONS and Chicago 02886 // buttons don't overlap where normal pre chicago buttons do ... 02887 02888 if ( ThisControl == SMALLBITMAPBUTTON) 02889 { 02890 if (ControlSize == LARGE_CONTROLS) 02891 yOffset = (ControlSize / 2) - sLARGEBUTTONHEIGHT +1 ; //get offset to center control 02892 else 02893 yOffset = (ControlSize / 2) - sSMALLBUTTONHEIGHT +1 ; 02894 02895 xpos++; 02896 } 02897 else 02898 { 02899 yOffset = (ControlSize / 2) - DDeckerHeight +1; 02900 02901 } 02902 // bodge to center static text 02903 if(ThisControl == STATIC) 02904 yOffset +=3; 02905 02906 02907 break; 02908 case DDECKER_BOTTOM : 02909 02910 yOffset = (ControlSize / 2) ; //get offset to center control 02911 02912 if ( ThisControl == SMALLBITMAPBUTTON) 02913 { 02914 yOffset ++ ; 02915 xpos ++; 02916 } 02917 if ( ThisControl == STATIC) 02918 { 02919 yOffset +=3; 02920 } 02921 break; 02922 case DDECKER_NONE : 02923 yOffset = (ControlSize - WindSize.GetHeight()) / 2; //get offset to center control 02924 break; 02925 } 02926 if ( MoveControls ) 02927 ::SetWindowPos(hcontrol,NULL,xpos,ypos + yOffset,0,0, 02928 SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOZORDER|SWP_NOREDRAW); 02929 02930 xpos += WindSize.GetWidth()-1; 02931 02932 if(ThisControl == STATICBITMAP) 02933 xpos++; 02934 02935 LastControl = ThisControl ; 02936 if(IS_CHICAGO) 02937 { 02938 if(ThisControl == EDIT) 02939 xpos += 2; 02940 } 02941 } 02942 AtFront = FALSE; 02943 pBarItem = pOp->GetPtrBarNext(pBarItem); 02944 }// end while 02945 02946 BarSize.width = xpos + (BAR_BORDERSIZE*2)-1; 02947 02948 } 02949 // Set a Minimum Bar Size 02950 if (BarSize.width < ControlSize + (BAR_BORDERSIZE *2)) 02951 { 02952 BarSize.width = ControlSize + (BAR_BORDERSIZE *2); 02953 } 02954 02955 // This test forces horizontal infobars to be a set width 02956 if (ThisIsAnInfoBar && ! pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 02957 { 02958 if(ControlSize == LARGE_CONTROLS) 02959 BarSize.width = LARGE_INFO_BAR; 02960 else 02961 BarSize.width = SMALL_INFO_BAR; 02962 } 02963 02964 BarSize.cx = ControlSize +1; 02965 02966 if(IS_CHICAGO) 02967 BarSize.height--; 02968 02969 // Cache this bar size 02970 if (ForceSize == USE_BAR) 02971 { 02972 if (ThisDock->IsBigControls()) 02973 { 02974 HorizontalLargeRect.GetRight() = BarSize.width; 02975 HorizontalLargeRect.GetBottom() = BarSize.height; 02976 } 02977 else 02978 { 02979 HorizontalSmallRect.GetRight() = BarSize.width; 02980 HorizontalSmallRect.GetBottom() = BarSize.height; 02981 } 02982 } 02983 else if (ForceSize == FORCE_LARGE) 02984 { 02985 HorizontalLargeRect.GetRight() = BarSize.width; 02986 HorizontalLargeRect.GetBottom() = BarSize.height; 02987 } 02988 else if (ForceSize == FORCE_SMALL) 02989 { 02990 HorizontalSmallRect.GetRight() = BarSize.width; 02991 HorizontalSmallRect.GetBottom() = BarSize.height; 02992 } */ 02993 return TRUE; 02994 };
|
|
Reformat a floating toolbar.
Definition at line 2030 of file basebar2.cpp. 02031 { 02032 #pragma message( __LOCMSG__ "BaseBar::FormatLineFeeds - do nothing" ) 02033 TRACE( _T("Warning - BaseBar::FormatLineFeeds called") ); 02034 /* //List is empty just return 02035 if (pOp->IsListEmpty()) 02036 return FALSE; 02037 02038 INT32 xpos = 0; 02039 INT32 WidestControl=0; 02040 INT32 CarryWidth = 0; 02041 INT32 LastWidth = 0; 02042 INT32 StartControlX =0; 02043 INT32 ControlHeight ; 02044 INT32 BarWidth =0; 02045 02046 if(pNoLFs) 02047 (* pNoLFs) = 0; 02048 02049 OILDockingBar * ThisDock ; 02050 ThisDock = GetMainFrame()->GetDockBar(DOCKBAR_FLOAT); 02051 02052 // are we on a big/small dock 02053 if (ThisDock->IsBigControls()) 02054 ControlHeight = LARGEBUTTONHEIGHT; 02055 else 02056 ControlHeight = SMALLBUTTONHEIGHT; 02057 02058 INT32 BarHeight = ControlHeight+TitleBarHeight; // UIC 02059 02060 INT32 DDeckerStart = 0; 02061 INT32 DDeckerEnd = 0; 02062 02063 Targetx += BAR_BORDERSIZE; 02064 02065 BarItem * pBarItem = NULL; 02066 BarItem * SeparatorPtr = NULL; 02067 BarItem * head = NULL; 02068 BOOL GroupSplit = FALSE; 02069 BOOL LastItemWasDDTop = FALSE; 02070 BOOL FirstControlInDecker = FALSE; 02071 BOOL ItsABarItem = FALSE; 02072 DDeckerReadState DDeckerState = DDECKER_NONE; 02073 02074 // Remove the existing linefeeds 02075 pBarItem = pOp->GetPtrBarHead(); 02076 02077 while (pBarItem != NULL) 02078 { 02079 if ( pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 02080 { 02081 wxRect WindSize; 02082 ::GetClientRect((HWND)((BarControl*)pBarItem)->GetWinID(),&WindSize); 02083 if(WindSize.GetWidth()>WidestControl) 02084 WidestControl = WindSize.GetWidth(); 02085 } 02086 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))) 02087 { 02088 BarItem * FoundItem = pBarItem; 02089 pBarItem = pOp->GetPtrBarNext(pBarItem); 02090 pOp->RemoveBarItem(FoundItem); 02091 delete FoundItem; 02092 } 02093 else 02094 pBarItem = pOp->GetPtrBarNext(pBarItem); 02095 } 02096 // we can't make the bar narrower than the widest control 02097 if(Targetx <(WidestControl+(BAR_BORDERSIZE*2))) 02098 { 02099 Targetx = WidestControl + (BAR_BORDERSIZE*2) ; 02100 } 02101 //TRACEUSER( "chris", _T("\n -- Format line feeds -- \n\n")); 02102 // Insert new LineFeeds 02103 head = pBarItem = pOp->GetPtrBarHead(); 02104 02105 while ( pBarItem != NULL ) 02106 { 02107 02108 ENSURE(!pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed)),"LineFeed still in List"); 02109 // Double Decker stuff... 02110 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerTop))) 02111 { 02112 DDeckerState = DDECKER_TOP; 02113 DDeckerStart = xpos; 02114 LastItemWasDDTop = TRUE; 02115 // TRACEUSER( "chris", _T("DD Top\n")); 02116 } 02117 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerBottom))) 02118 { 02119 DDeckerState = DDECKER_BOTTOM; 02120 DDeckerEnd = xpos; 02121 // go back to start 02122 xpos = DDeckerStart; 02123 // TRACEUSER( "chris", _T("DD Bottom\n")); 02124 } 02125 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerEnd))) 02126 { 02127 DDeckerState = DDECKER_NONE; 02128 if(xpos < DDeckerEnd) 02129 xpos = DDeckerEnd; 02130 // TRACEUSER( "chris", _T("DD End\n")); 02131 } 02132 if ( pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator)) ) 02133 { 02134 if( DDeckerState == DDECKER_NONE) 02135 { 02136 if(pBarItem!=head) 02137 { 02138 SeparatorPtr = pBarItem; 02139 CarryWidth = xpos; 02140 } 02141 } 02142 xpos += SeparatorWidth; 02143 } 02144 else if ( (ItsABarItem = pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl)))||DDeckerState != DDECKER_NONE ) 02145 { 02146 if ( ItsABarItem) 02147 { 02148 wxRect WindSize; 02149 ::GetClientRect((HWND)((BarControl*)pBarItem)->GetWinID(),&WindSize); 02150 02151 LastWidth = WindSize.GetWidth(); 02152 xpos += WindSize.GetWidth(); 02153 // we need a record of the widest line 02154 if(xpos>BarWidth) 02155 BarWidth= xpos; 02156 FirstControlInDecker = FALSE; 02157 if(LastItemWasDDTop) 02158 { 02159 FirstControlInDecker = TRUE; 02160 LastItemWasDDTop = FALSE; 02161 } 02162 // TRACEUSER( "chris", _T("Control Size %d"),LastWidth); 02163 } 02164 // TRACEUSER( "chris", _T("targetx - %d xpos - %d \n"),Targetx,xpos); 02165 // Control overlaps TargetWidth - don't insert at head of list 02166 if ( xpos >= Targetx && pBarItem != head) 02167 { 02168 // We can't split if we are in a double decker control 02169 BOOL CanSplit = FALSE; 02170 if(FirstControlInDecker) 02171 CanSplit = TRUE; 02172 if(DDeckerState == DDECKER_NONE) 02173 CanSplit = TRUE; 02174 // TRACEUSER( "chris", _T("%s\n",CanSplit ?"Can Split ":"Can't Split")); 02175 if(CanSplit) 02176 { 02177 BarItem * NewLineFeed = new BarLineFeed; 02178 if(pNoLFs) 02179 (* pNoLFs)++; 02180 BarHeight += ControlHeight+VERTICAL_SPACE; 02181 if ( SeparatorPtr != NULL ) // insert a LineFeed before the last separator 02182 { 02183 pOp->InsertItemBefore(SeparatorPtr,NewLineFeed); 02184 SeparatorPtr = NULL; 02185 xpos -= CarryWidth; // decrease xpos by pos of last separator 02186 DDeckerStart = xpos; 02187 GroupSplit = FALSE; 02188 BarHeight += SeparatorWidth; 02189 // TRACEUSER( "chris", _T("Separator split - xpos %d\n"),xpos); 02190 } 02191 else // no separator on this line 02192 { 02193 02194 if(!FirstControlInDecker) 02195 pOp->InsertItemBefore(pBarItem,NewLineFeed); 02196 else 02197 pOp->InsertItemBefore(pOp->GetPtrBarPrev(pBarItem),NewLineFeed); 02198 xpos = LastWidth; // xpos set to width of last control 02199 if(FirstControlInDecker) 02200 DDeckerStart = xpos-LastWidth; 02201 GroupSplit = TRUE ; // we must have split a group 02202 // TRACEUSER( "chris", _T("Normal split - xpos %d\n"),xpos); 02203 //LastWidth = 0; 02204 } 02205 } 02206 } 02207 else if (GroupSplit && SeparatorPtr) 02208 { 02209 02210 BarItem * NewLineFeed = new BarLineFeed; 02211 if(pNoLFs) 02212 (* pNoLFs)++; 02213 pOp->InsertItemBefore(SeparatorPtr,NewLineFeed); 02214 SeparatorPtr = NULL; 02215 xpos -= CarryWidth; // decrease xpos by pos of last separator 02216 DDeckerStart = xpos; 02217 GroupSplit = FALSE; 02218 // TRACEUSER( "chris", _T("Group split - xpos %d\n"),xpos); 02219 BarHeight += ControlHeight+VERTICAL_SPACE + SeparatorWidth; 02220 } 02221 } 02222 pBarItem = pOp->GetPtrBarNext(pBarItem); 02223 } 02224 02225 HeightEstimate = BarHeight; 02226 if(pBarSize) 02227 * pBarSize = wxSize(BarWidth,BarHeight); */ 02228 return TRUE; 02229 };
|
|
Definition at line 2386 of file basebar2.cpp. 02387 { 02388 if (this != PtrToToolBar) 02389 { 02390 return (FALSE); 02391 } 02392 else 02393 { 02394 FormatLineFeeds (NewWidth); 02395 FormatFloatingBar(FALSE,USE_BAR); 02396 02397 return (TRUE); 02398 } 02399 }
|
|
Format a Vertical toolbar with separators.
Reimplemented in GalleryBar. Definition at line 3018 of file basebar2.cpp. 03019 { 03020 // TRACEUSER( "Gerry", _T("FormatVerticalBar\n")); 03021 #pragma message( __LOCMSG__ "BaseBar::FormatVerticalBar - do nothing" ) 03022 TRACE( _T("Warning - BaseBar::FormatVerticalBar called") ); 03023 /* BOOL AtFront = TRUE; 03024 HWND hcontrol; 03025 03026 // Find out how many bar items 03027 UINT32 NumBarItems = pOp->GetNumBarItems(); 03028 INT32 xpos = BAR_VERTICAL_CENTEROFFSET; 03029 INT32 ypos = BAR_BORDERSIZE; 03030 BarItem* pBarItem; 03031 BarItemType ThisControl; 03032 ControlSizes ControlSize; 03033 INT32 ButtonSize; 03034 03035 wxSize BarSize(0,0) ; 03036 03037 //if we are dragging a bar check the size of the dock we are over 03038 // otherwise use control size of parent dock 03039 OILDockingBar * ThisDock ; 03040 DockBarType CurrentType; 03041 03042 CurrentType = (DragType==MOVE) ? DragDockBarType : ParentDockBarType; 03043 ThisDock = GetMainFrame()->GetDockBar(CurrentType); 03044 03045 // Get the current control size for this dock 03046 if (ForceSize == USE_BAR) 03047 { 03048 if (ThisDock->IsBigControls()) 03049 ControlSize = LARGE_CONTROLS; 03050 else 03051 ControlSize = SMALL_CONTROLS; 03052 } 03053 else if (ForceSize == FORCE_LARGE) 03054 { 03055 ControlSize = LARGE_CONTROLS; 03056 } 03057 else if (ForceSize == FORCE_SMALL) 03058 { 03059 ControlSize = SMALL_CONTROLS; 03060 } 03061 03062 if (ControlSize == LARGE_CONTROLS) 03063 ButtonSize = LARGEBUTTONHEIGHT-1; 03064 else 03065 ButtonSize = SMALLBUTTONHEIGHT-1; 03066 03067 // if list is empty just set a minimum size 03068 if (! pOp->IsListEmpty()) 03069 { 03070 03071 pBarItem = pOp->GetPtrBarHead(); 03072 while (pBarItem != NULL) 03073 { 03074 ThisControl = GetEnumItemType(pBarItem); 03075 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 03076 { 03077 if(!AtFront ) // don't separate at the front of a bar 03078 { 03079 ypos += SeparatorWidth; 03080 } 03081 } 03082 else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 03083 { 03084 hcontrol=(HWND)((BarControl*)pBarItem)->GetWinID(); // Get the Window Handle 03085 wxRect WindSize; 03086 ::GetClientRect(hcontrol,&WindSize); 03087 INT32 Offset = (ControlSize - WindSize.GetWidth())/2; 03088 if (MoveControls) 03089 ::SetWindowPos(hcontrol,NULL,Offset,ypos,0,0, 03090 SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOZORDER|SWP_NOREDRAW); 03091 03092 if(ThisControl == SLIDER) 03093 { 03094 ypos += WindSize.GetHeight(); 03095 } 03096 else 03097 { 03098 ypos += ButtonSize; 03099 } 03100 } 03101 AtFront = FALSE; 03102 pBarItem = pOp->GetPtrBarNext(pBarItem); 03103 } 03104 03105 BarSize.height = ypos + (BAR_BORDERSIZE*2)-1; 03106 } 03107 // Set a Minimum Bar Size 03108 if (BarSize.height < ControlSize + (BAR_BORDERSIZE *2)) 03109 BarSize.height = ControlSize + (BAR_BORDERSIZE *2); 03110 03111 BarSize.width = ControlSize +1; 03112 03113 if(IS_CHICAGO) 03114 BarSize.width--; 03115 03116 if (ForceSize == USE_BAR) 03117 { 03118 if (ThisDock->IsBigControls()) 03119 { 03120 VerticalLargeRect.GetRight() = BarSize.width; 03121 VerticalLargeRect.GetBottom() = BarSize.height; 03122 } 03123 else 03124 { 03125 VerticalSmallRect.GetRight() = BarSize.width; 03126 VerticalSmallRect.GetBottom() = BarSize.height; 03127 } 03128 } 03129 else if (ForceSize == FORCE_LARGE) 03130 { 03131 VerticalLargeRect.GetRight() = BarSize.width; 03132 VerticalLargeRect.GetBottom() = BarSize.height; 03133 } 03134 else if (ForceSize == FORCE_SMALL) 03135 { 03136 VerticalSmallRect.GetRight() = BarSize.width; 03137 VerticalSmallRect.GetBottom() = BarSize.height; 03138 } */ 03139 03140 return TRUE; 03141 };
|
|
Definition at line 283 of file basebar.h.
|
|
Definition at line 1669 of file basebar2.cpp. 01670 { 01671 #pragma message( __LOCMSG__ "BaseBar::GetBarPosition - do nothing" ) 01672 TRACE( _T("Warning - BaseBar::GetBarPosition called") ); 01673 // return GetMainFrame()->GetDockBar(ParentDockBarType)->GetBarPos(GetSafeHwnd()); 01674 01675 return NULL; 01676 };
|
|
To return a pointer to a rectangle of bar size To return the size of the bar.
Definition at line 5274 of file basebar2.cpp. 05275 { 05276 wxRect ReturnRect(0,0,0,0); 05277 05278 #pragma message( __LOCMSG__ "BaseBar::GetBarsDims - do nothing" ) 05279 TRACE( _T("Warning - BaseBar::GetBarsDims called") ); 05280 /* OILDockingBar* FloatBars = GetMainFrame ()->GetDockBar (DockBarType);//DOCKBAR_FLOAT); 05281 BOOL BigControls = FloatBars->IsBigControls (); 05282 05283 switch (DockBarType) 05284 { 05285 case DOCKBAR_TOP: 05286 case DOCKBAR_BOTTOM: 05287 if (BigControls) 05288 ReturnRect = HorizontalLargeRect; 05289 else 05290 ReturnRect = HorizontalSmallRect; 05291 case DOCKBAR_LEFT: 05292 case DOCKBAR_RIGHT: 05293 if (BigControls) 05294 ReturnRect = VerticalLargeRect; 05295 else 05296 ReturnRect = VerticalSmallRect; 05297 05298 case DOCKBAR_FLOAT: 05299 if (BigControls) 05300 ReturnRect = FloatLargeRect; 05301 else 05302 ReturnRect = FloatSmallRect; 05303 } */ 05304 05305 return ReturnRect; 05306 }
|
|
Definition at line 1986 of file basebar2.cpp. 01987 { 01988 ERROR2IF(FormatPositions.IsEmpty(),FALSE,"No Format Cache"); 01989 01990 FormatPosition * pFormatPosition=(FormatPosition *) FormatPositions.GetHead(); 01991 01992 ERROR2IF(pFormatPosition==NULL,FALSE,"No Format Cache"); 01993 01994 INT32 LastWidth = pFormatPosition->Width; 01995 01996 // find the cached Width that maps onto the target height 01997 while (pFormatPosition) 01998 { 01999 // break if we have gone past the target height 02000 if (pFormatPosition->Height>TargetHeight) //found the bar 02001 break; 02002 02003 // record this width - we will output the "last" value 02004 LastWidth = pFormatPosition->Width; 02005 pFormatPosition =(FormatPosition *) FormatPositions.GetNext(pFormatPosition); 02006 02007 }// end while 02008 02009 * FoundWidth = LastWidth; 02010 02011 return TRUE; 02012 };
|
|
Definition at line 265 of file basebar.h. 00265 { return (pOp); }
|
|
For finding the screen rectangle defining the shape of the BaseBar when over DockBar.
Definition at line 4345 of file basebar2.cpp. 04346 { 04347 /* OILDockingBar* DockBar = GetMainFrame()->GetDockBar(DockBarType); 04348 switch (DockBarType) 04349 { 04350 case DOCKBAR_TOP: 04351 case DOCKBAR_BOTTOM: 04352 if (DockBar->IsBigControls()) 04353 { 04354 if (HorizontalLargeRect.IsEmpty()()) 04355 { 04356 FormatHorizontalBar(FALSE,USE_BAR); 04357 } 04358 } 04359 else 04360 { 04361 if (HorizontalSmallRect.IsEmpty()()) 04362 { 04363 FormatHorizontalBar(FALSE,USE_BAR); 04364 } 04365 } 04366 break; 04367 case DOCKBAR_LEFT: 04368 case DOCKBAR_RIGHT: 04369 if (DockBar->IsBigControls()) 04370 { 04371 if (VerticalLargeRect.IsEmpty()()) 04372 { 04373 FormatVerticalBar(FALSE,USE_BAR); 04374 } 04375 } 04376 else 04377 { 04378 if (VerticalSmallRect.IsEmpty()()) 04379 { 04380 FormatVerticalBar(FALSE,USE_BAR); 04381 } 04382 } 04383 break; 04384 default: 04385 { 04386 ENSURE(DockBarType == DOCKBAR_FLOAT, "Unknown Dockbar type"); 04387 if (DockBar->IsBigControls()) 04388 { 04389 if (FloatLargeRect.IsEmpty()()) 04390 { 04391 FormatFloatingBar(FALSE,USE_BAR); 04392 } 04393 } 04394 else 04395 { 04396 if (FloatSmallRect.IsEmpty()()) 04397 { 04398 FormatFloatingBar(FALSE,USE_BAR); 04399 } 04400 } 04401 04402 break; 04403 04404 } 04405 }*/ 04406 wxRect temp =GetFormatRect(DockBarType); 04407 temp.Offset(CurrentBarRect.GetLeft(),CurrentBarRect.GetRight()); 04408 // temp.OffsetRect(CurrentBarRect.GetLeft(), CurrentBarRect.GetTop()); 04409 return temp; 04410 }
|
|
Definition at line 1693 of file basebar2.cpp. 01694 { 01695 01696 return ParentDockBarType; 01697 01698 };
|
|
Get cached format size and offset it appropriately around the current drag position.
Definition at line 581 of file basebar2.cpp. 00583 { 00584 wxRect DragRect(0,0,0,0); 00585 DragRect = GetFormatRect(BarType); 00586 00587 // TRACEUSER( "Gerry", _T("FormatRect(%d) = (%d, %d) - (%d, %d)\n"), BarType, DragRect.left, DragRect.top, DragRect.GetRight(), DragRect.GetBottom()); 00588 00589 wxPoint NewOffset = CalcDragOffset(DragRect, CursorPos, ToLeft, Below); 00590 00591 // TRACEUSER( "Gerry", _T("Offset = (%d, %d)\n"), NewOffset.x, NewOffset.y); 00592 00593 DragRect.Offset( CursorPos.x - NewOffset.x, CursorPos.y - NewOffset.y ); 00594 00595 // TRACEUSER( "Gerry", _T("After Offset = (%d, %d) - (%d, %d)\n"), DragRect.left, DragRect.GetTop(), DragRect.GetRight(), DragRect.GetBottom()); 00596 00597 return ( DragRect ); 00598 }
|
|
Get cached format size - if none available format and cache.
Reimplemented in GalleryBar. Definition at line 700 of file basebar2.cpp. 00701 { 00702 #pragma message( __LOCMSG__ "BaseBar::GetFormatRect - do nothing" ) 00703 TRACE( _T("Warning - BaseBar::GetFormatRect called") ); 00704 /* OILDockingBar* DockBar = GetMainFrame()->GetDockBar(BarType); 00705 switch(BarType) 00706 { 00707 case DOCKBAR_FLOAT: 00708 if (DockBar->IsBigControls()) 00709 { 00710 if (FloatLargeRect.IsEmpty()) 00711 FormatFloatingBar(FALSE,USE_BAR); 00712 return FloatLargeRect; 00713 } 00714 else 00715 { 00716 if (FloatSmallRect.IsEmpty()) 00717 FormatFloatingBar(FALSE,USE_BAR); 00718 return FloatSmallRect; 00719 } 00720 break; 00721 case DOCKBAR_LEFT: 00722 case DOCKBAR_RIGHT: 00723 if (DockBar->IsBigControls()) 00724 { 00725 if (VerticalLargeRect.IsEmpty()) 00726 FormatVerticalBar(FALSE,USE_BAR); 00727 return VerticalLargeRect; 00728 } 00729 else 00730 { 00731 if (VerticalSmallRect.IsEmpty()) 00732 FormatVerticalBar(FALSE,USE_BAR); 00733 return VerticalSmallRect; 00734 } 00735 break; 00736 00737 case DOCKBAR_TOP: 00738 case DOCKBAR_BOTTOM: 00739 if (DockBar->IsBigControls()) 00740 { 00741 if (HorizontalLargeRect.IsEmpty()) 00742 FormatHorizontalBar(FALSE,USE_BAR); 00743 return HorizontalLargeRect; 00744 } 00745 else 00746 { 00747 if (HorizontalSmallRect.IsEmpty()) 00748 FormatHorizontalBar(FALSE,USE_BAR); 00749 return HorizontalSmallRect; 00750 } 00751 break; 00752 default: 00753 ENSURE(FALSE,"Unknown Dockbar Type"); 00754 00755 } */ 00756 return wxRect(0,0,0,0) ; 00757 }
|
|
Definition at line 3255 of file basebar2.cpp. 03256 { 03257 #pragma message( __LOCMSG__ "BaseBar::GetModuleInst - do nothing" ) 03258 TRACE( _T("Warning - BaseBar::GetModuleInst called") ); 03259 /* *ToolModuleID = Tool::GetModuleID(pBarCtlInfo->ToolID); 03260 03261 // tools.dll not loaded, chances are the resources are in with the rest 03262 if(DLLs[0] == (HINSTANCE)HINSTANCE_ERROR || DLLs[0] == 0) 03263 return AfxGetResourceHandle(); 03264 03265 return ResHelp::GetInstanceFromID( pBarCtlInfo->ResourceID ); 03266 03267 #if 0 03268 // old code before Andy got to it 03269 HINSTANCE ModuleInst; 03270 if (pBarCtlInfo->ToolID != 0) // We want to get control from tool DLL 03271 { 03272 // Try to get the tools module ID 03273 *ToolModuleID = Tool::GetModuleID(pBarCtlInfo->ToolID); 03274 03275 ENSURE(*ToolModuleID != 0, "Could not find module ID"); 03276 if (*ToolModuleID == 0) 03277 return NULL; 03278 // Now try to get the module's instance 03279 ModuleInst = OILModule::GetInstance(*ToolModuleID); 03280 ENSURE (ModuleInst != (HINSTANCE)HINSTANCE_ERROR, "Could not obtain module instance"); 03281 if (ModuleInst == (HINSTANCE)HINSTANCE_ERROR) 03282 return NULL; 03283 else 03284 return ModuleInst; 03285 } 03286 else 03287 { 03288 // get controls from exe 03289 return AfxGetApp()->m_hInstance; 03290 } 03291 #endif */ 03292 03293 return HINSTANCE(-1); 03294 }
|
|
Return the nearest control given a mouse position in client coords.
Definition at line 2247 of file basebar2.cpp. 02248 { 02249 #pragma message( __LOCMSG__ "BaseBar::GetNearestControl - do nothing" ) 02250 TRACE( _T("Warning - BaseBar::GetNearestControl called") ); 02251 /* HWND hcontrol; // handle of current control 02252 INT32 ControlIndex = 0; // index in bar item list 02253 BarItem * pBarItem; // baritem pointer 02254 BarItemType ThisControl; // type of current item 02255 DDeckerReadState DDeckerState = DDECKER_NONE; // enum to record current double decker state 02256 // check orientation of the bar we are dropping on 02257 BOOL bIsHorizontal = pOp->IsHorizontal(); 02258 02259 02260 // if the bar is empty it must be the first item on the list 02261 if (pOp->IsListEmpty()) 02262 return ControlIndex ; 02263 02264 // get head item of the bar item list 02265 pBarItem = pOp->GetPtrBarHead(); 02266 02267 while (pBarItem != NULL) 02268 { 02269 02270 ThisControl = GetEnumItemType(pBarItem); 02271 // Double Decker stuff... 02272 switch(ThisControl) 02273 { 02274 case DECKER_TOP: 02275 DDeckerState = DDECKER_TOP; 02276 break; 02277 case DECKER_BOTTOM: 02278 DDeckerState = DDECKER_BOTTOM; 02279 break; 02280 case DECKER_END: 02281 DDeckerState = DDECKER_NONE; 02282 break; 02283 } 02284 02285 if(DDeckerState != DDECKER_TOP) 02286 { 02287 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 02288 { 02289 02290 // get the handle 02291 hcontrol=(HWND)((BarControl*)pBarItem)->GetWinID(); 02292 02293 // Get window rect - screen coords 02294 wxRect WindSize; 02295 ::GetWindowRect(hcontrol,&WindSize); 02296 02297 // to Client - mouse messages are in client coords 02298 ScreenToClient(&WindSize); 02299 02300 // expand the rect slightly to the top and bottom 02301 wxRect HitTest(WindSize.GetLeft(),WindSize.GetTop()-4,WindSize.GetRight(),WindSize.GetBottom()+4); 02302 02303 // check the next item - if it's a line feed we might have a load of empty space to the right 02304 // of this control - in which case we'll expand the hit test rect to include it 02305 BarItem * pNextBarItem = pOp->GetPtrBarNext(pBarItem); 02306 if(pNextBarItem ) 02307 { 02308 if(bIsHorizontal) 02309 { 02310 if(pNextBarItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))) 02311 { 02312 wxRect ThisWindowRect; 02313 GetWindowRect(&ThisWindowRect); 02314 HitTest.GetRight() += (ThisWindowRect.GetRight() - WindSize.GetRight()); 02315 } 02316 else if (pNextBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 02317 { 02318 // get the handle 02319 HWND hNextControl=(HWND)((BarControl*)pNextBarItem)->GetWinID(); 02320 // Get window rect - screen coords 02321 wxRect NextWindSize; 02322 ::GetWindowRect(hNextControl,&NextWindSize); 02323 // to Client - mouse messages are in client coords 02324 ScreenToClient(&NextWindSize); 02325 02326 // the hit test area should extends from the control's left edge 02327 // to the next control's left edge 02328 if(NextWindSize.GetLeft() > HitTest.GetRight()) 02329 HitTest.GetRight() = NextWindSize.GetLeft(); 02330 } 02331 } 02332 BarItem * pLastBarItem = pOp->GetPtrBarPrev(pBarItem); 02333 if(pLastBarItem) 02334 { 02335 if (pLastBarItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 02336 { 02337 if(bIsHorizontal) 02338 HitTest.GetLeft() -= SeparatorWidth; 02339 else 02340 HitTest.GetTop() -=SeparatorWidth; 02341 } 02342 } 02343 } 02344 02345 // if the mouse is in this area we have found our drop point 02346 if(HitTest.PtInRect(DropPoint)) 02347 return ControlIndex ; 02348 02349 } 02350 } 02351 02352 // increment index 02353 ControlIndex ++; 02354 02355 // we skip past the dragged control as it will be deleted later 02356 // this avoids the problem where a control is dropped into the 02357 // correct place only to be shifted to the left after the original control is deleted 02358 if(DragCtlHwnd==hcontrol) 02359 ControlIndex ++; 02360 02361 // move to next item 02362 pBarItem = pOp->GetPtrBarNext(pBarItem); 02363 } 02364 02365 // off the end ! 02366 // return index of last item 02367 return pOp->GetNumBarItems(); */ 02368 02369 return (UINT32)-1; 02370 };
|
|
Definition at line 3234 of file basebar2.cpp. 03235 { 03236 PORTNOTETRACE( "dialog", "BaseBar::GetPointerToControl - do nothing - DLGITEMTEMPLATE usage" ); 03237 #ifndef EXCLUDE_FROM_XARALX 03238 DLGITEMTEMPLATE* pCurrentControl = (DLGITEMTEMPLATE *) (((ADDR)pDlg) + SizeDlgHeader(pDlg)); 03239 WORD NumControls = pDlg->cdit; 03240 ENSURE(pCurrentControl != NULL, "Hideous Error in Load Controls"); 03241 03242 for (UINT32 i = 0; i< NumControls; i++) 03243 { 03244 if (pCurrentControl->id == CtlId) 03245 { 03246 return pCurrentControl; 03247 } 03248 pCurrentControl = (DLGITEMTEMPLATE *) 03249 (((ADDR)pCurrentControl) + SizeCtrlData(pCurrentControl)); 03250 } 03251 #endif 03252 return NULL; 03253 }
|
|
Definition at line 263 of file basebar.h. 00263 { return (PtrToToolBar); }
|
|
called on idles to check whether I want to put some text on the status bar
Definition at line 6572 of file basebar2.cpp. 06573 { 06574 ERROR2IF(pStatusText==NULL,FALSE,"BaseBar::GetStatusLineText() - pStatusText==NULL!"); 06575 06576 BOOL ReturnValue=FALSE; 06577 if (CurrentBar!=NULL) 06578 ReturnValue=CurrentBar->GetStatusText(pStatusText); 06579 return ReturnValue; 06580 }
|
|
base virtual function should never be called.
Reimplemented in GalleryBar. Definition at line 6618 of file basebar2.cpp. 06619 { 06620 return FALSE; 06621 }
|
|
Definition at line 254 of file basebar.h. 00254 {return GalleryHasFocus;};
|
|
determine whether two docks have different orientation.
Definition at line 6798 of file basebar2.cpp. 06799 { 06800 if(Old == New) 06801 return FALSE ; 06802 if( (Old== DOCKBAR_RIGHT ||Old == DOCKBAR_LEFT) && 06803 (New== DOCKBAR_RIGHT ||New == DOCKBAR_LEFT)) 06804 return FALSE; 06805 if( (Old== DOCKBAR_TOP ||Old == DOCKBAR_BOTTOM||Old == DOCKBAR_FLOAT) && 06806 (New== DOCKBAR_TOP ||New == DOCKBAR_BOTTOM||New == DOCKBAR_FLOAT)) 06807 return FALSE; 06808 return TRUE; 06809 }
|
|
Forces bars to be repainted to reflect active state attempt to force focus to mainframe
Definition at line 5196 of file basebar2.cpp. 05197 { 05198 BOOL returnVal = FALSE; 05199 05200 #if _MFC_VER >= 0x400 05201 05202 if( TitleBarHeight != wxSystemSettings::GetMetric(SM_CYSMCAPTION)) 05203 returnVal = TRUE; 05204 if(BorderWidth != wxSystemSettings::GetMetric(SM_CXFRAME)) 05205 returnVal = TRUE; 05206 if(FontFactory::CheckSystemBarFontsChanged()) 05207 returnVal = TRUE; 05208 05209 #endif 05210 05211 return returnVal; 05212 }
|
|
Creates a BaseBar window.
Definition at line 1001 of file basebar2.cpp. 01002 { 01003 #pragma message( __LOCMSG__ "BaseBar::Hide - do nothing" ) 01004 TRACE( _T("Warning - BaseBar::Hide called") ); 01005 /* BOOL DoTidy = DO_TIDY; 01006 01007 ShowWindow(SW_HIDE); 01008 01009 if (Op->IS_KIND_OF(InformationBarOp)) 01010 ((InformationBarOp*)Op)->GetInfo(); 01011 01012 #ifndef STANDALONE 01013 // we dont want a tidy (reposition and redraw of bars) 01014 // if we are just switching out of the Selector Tool 01015 if(SelectorTool::IsSelectorCaching()) 01016 DoTidy = DONT_TIDY; 01017 #endif 01018 01019 GetMainFrame()->GetDockBar(ParentDockBarType)->ReleaseBar(this->GetSafeHwnd(),DoTidy); 01020 //TRACE( _T("Hide now %d"),ParentDockBarType); */ 01021 return TRUE; 01022 }
|
|
Copies the child controls of SrcBaseBar to this BaseBar. It does not do any positioning of controls. Scope: private.
Definition at line 4311 of file basebar2.cpp. 04312 { 04313 #pragma message( __LOCMSG__ "BaseBar::InformControlsDead - do nothing" ) 04314 TRACE( _T("Warning - BaseBar::InformControlsDead called") ); 04315 /* HWND CurrentChild; 04316 HWND NextChild; 04317 for (CurrentChild = ::GetWindow(GetSafeHwnd(),GW_CHILD); 04318 CurrentChild != NULL; 04319 CurrentChild = NextChild) 04320 { 04321 ControlHelper::NotifyControlDeleted(CurrentChild); 04322 NextChild = ::GetWindow(CurrentChild,GW_HWNDNEXT); 04323 } */ 04324 }
|
|
Set all Cache Format rectangles empty.
Definition at line 673 of file basebar2.cpp. 00674 { 00675 00676 FloatLargeRect = wxRect(); 00677 VerticalLargeRect = wxRect(); 00678 HorizontalLargeRect = wxRect(); 00679 FloatSmallRect = wxRect(); 00680 VerticalSmallRect = wxRect(); 00681 HorizontalSmallRect = wxRect(); 00682 00683 }
|
|
Definition at line 272 of file basebar.h. 00272 {return Active;};
|
|
Definition at line 274 of file basebar.h. 00274 {return pOp->IsAllBarsOp(); };
|
|
BaseBar destructor.
Definition at line 408 of file basebar2.cpp. 00409 { 00410 return InRecreate; 00411 }
|
|
Returns whether we're doing an error box or not...
Definition at line 429 of file basebar2.cpp. 00430 { 00431 // If it's an MFC exception, etc... 00432 /* if(CCamApp::IsDisabled()) 00433 return TRUE;*/ 00434 00435 return DoingErrorBox; 00436 }
|
|
to determine whether a given control is part of a double decker group
Definition at line 1718 of file basebar2.cpp. 01719 { 01720 BarItem * pBarItem = pOp->GetPtrBarNext(ThisControl) ; 01721 BarItem * LastItem = NULL; 01722 // Test assumes that the bar list will contain DDeckerTop/DDeckerBottom/DDeckerEnd 01723 // in that order 01724 01725 DDeckerReadState State = DDECKER_NONE; 01726 while ( pBarItem != NULL ) 01727 { 01728 01729 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerTop))) 01730 { 01731 State = DDECKER_NONE; 01732 } 01733 01734 else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerBottom))) 01735 { 01736 State = DDECKER_TOP; 01737 } 01738 01739 else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerEnd))) 01740 { 01741 if(State == DDECKER_NONE) 01742 State = DDECKER_BOTTOM; 01743 01744 // point End to last control in group 01745 if(LastItem != NULL && End != NULL) 01746 End = LastItem; 01747 } 01748 01749 // keep a pointer to the last control 01750 else if ( pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 01751 { 01752 LastItem = pBarItem; 01753 } 01754 pBarItem = pOp->GetPtrBarNext(pBarItem); 01755 } 01756 01757 // point Start to the first control in this group 01758 if(Start != NULL && State != DDECKER_NONE ) 01759 { 01760 01761 pBarItem = ThisControl; 01762 BarItem * Head = pOp->GetPtrBarHead(); 01763 01764 // run backwards through the list until we find the start 01765 // of the double decker or get to the head of the bar list 01766 while(pBarItem != Head) 01767 { 01768 // check for start of double decker 01769 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerTop))) 01770 { 01771 Start = LastItem; 01772 break; 01773 } 01774 01775 // keep a pointer to the last control 01776 else if ( pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 01777 { 01778 LastItem = pBarItem; 01779 } 01780 pBarItem = pOp->GetPtrBarPrev(pBarItem); 01781 } 01782 } 01783 01784 // not a double decker - set Start and End to NULL 01785 if( State == DDECKER_NONE) 01786 Start = End = NULL; 01787 01788 return State; 01789 };
|
|
Definition at line 612 of file basebar.h. 00612 { return DragType != 0; /* DlgDragType::NONE */ }
|
|
Definition at line 273 of file basebar.h. 00273 { return ThisIsAnInfoBar ;} ;
|
|
Test whether the pointer is currently over a dockingbar.
Definition at line 774 of file basebar2.cpp. 00775 { 00776 #pragma message( __LOCMSG__ "BaseBar::IsPointerOverDock - do nothing" ) 00777 TRACE( _T("Warning - BaseBar::IsPointerOverDock called") ); 00778 /* wxRect temp ; 00779 OILFixedDockingBar * ParentDockBar; 00780 00781 ParentDockBar = (OILFixedDockingBar * )GetMainFrame()->GetDockBar(DOCKBAR_LEFT); 00782 ParentDockBar->GetDockScreenRect(&temp); 00783 if (temp.PtInRect(point)) 00784 return DOCKBAR_LEFT; 00785 00786 ParentDockBar = (OILFixedDockingBar * )GetMainFrame()->GetDockBar(DOCKBAR_RIGHT); 00787 ParentDockBar->GetDockScreenRect(&temp); 00788 if (temp.PtInRect(point)) 00789 return DOCKBAR_RIGHT; 00790 00791 ParentDockBar = (OILFixedDockingBar * )GetMainFrame()->GetDockBar(DOCKBAR_TOP); 00792 ParentDockBar->GetDockScreenRect(&temp); 00793 if (temp.PtInRect(point)) 00794 return DOCKBAR_TOP; 00795 00796 ParentDockBar = (OILFixedDockingBar * )GetMainFrame()->GetDockBar(DOCKBAR_BOTTOM); 00797 ParentDockBar->GetDockScreenRect(&temp); 00798 if (temp.PtInRect(point)) 00799 return DOCKBAR_BOTTOM; */ 00800 00801 return DOCKBAR_FLOAT; 00802 }
|
|
Definition at line 1485 of file basebar2.cpp. 01486 { 01487 // Find out how many bar items 01488 UINT32 NumBarItems = pOp->GetNumBarItems(); 01489 01490 BarItem* pBarItem; 01491 01492 // track ddecker state 01493 DDeckerState = DDECKER_NONE; 01494 01495 // ThisIsAnInfoBar = ( (pOp->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp))) 01496 // || (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) ); 01497 01498 ThisIsAnInfoBar = pOp->IsKindOf(CC_RUNTIME_CLASS(InformationBarOp)); 01499 BOOL ThisIsAGallery = pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)); 01500 01501 for (UINT32 i = 0; i< NumBarItems; i++) 01502 { 01503 // Get the next BarItem 01504 pBarItem = pOp->GetPtrBarItem(i); 01505 01506 ENSURE(pBarItem != NULL, "NumBarItems is incorrect"); 01507 // Check whether we need to create thin items for double deckers 01508 01509 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 01510 { 01511 BarControl * pBarControl = (BarControl*)pBarItem; 01512 if (ThisIsAnInfoBar || ThisIsAGallery) 01513 { 01514 // If the DialogBarOp is an InformationBarOp then the Bar controls 01515 // control ID will be unique for the InformationBar's Message handler 01516 pBarControl->SetUniqueGadgetID( 01517 pBarControl->GetBarControlInfo(pOp->IsHorizontal()).ControlID); 01518 } 01519 else 01520 { 01521 // use index as gadget id 01522 pBarControl->SetUniqueGadgetID(i + 100); 01523 } 01524 // create the control i==0 indicates initialise 01525 if (!CreateInfoControlFromResource(pBarControl,i==0)) 01526 { 01527 // We failed to create the control 01528 //ENSURE(FALSE,"Failed to create control"); 01529 return FALSE ; 01530 } 01531 } 01532 else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerTop))) 01533 { 01534 DDeckerState = DDECKER_TOP; 01535 } 01536 else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerBottom))) 01537 { 01538 DDeckerState = DDECKER_BOTTOM; 01539 } 01540 else if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(DDeckerEnd))) 01541 { 01542 DDeckerState = DDECKER_NONE; 01543 } 01544 } 01545 01546 // call to free resources; 01547 CreateInfoControlFromResource(NULL,0); 01548 return TRUE; 01549 };
|
|
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.
Definition at line 4146 of file basebar2.cpp. 04147 { 04148 // Skip the string 04149 while (*pWideStr++) 04150 ; 04151 04152 // Return the address of the following character 04153 return pWideStr; 04154 }
|
|
Draws a rectangular 3d plinth(Chicago/Win 3.1 styles) around the edge of the given rectangle.
Definition at line 4651 of file basebar2.cpp. 04652 { 04653 #pragma message( __LOCMSG__ "BaseBar::Paint3dPlinth - do nothing" ) 04654 TRACE( _T("Warning - BaseBar::Paint3dPlinth called") ); 04655 /* if((LOBYTE(LOWORD(GetVersion()))) > 3 ) 04656 { 04657 // create brush for the background 04658 wxBrush Back(GetSysColor(COLOR_BTNFACE)); 04659 04660 // select into dc 04661 wxBrush * OldBrush = (wxBrush *) pDC->SelectObject(&Back); 04662 wxRect Fill(rect); 04663 Fill.Inflate(-1,-1); 04664 //Fill.OffsetRect(1,1); 04665 // fill in the background 04666 pDC->FillRect(&Fill, &Back); 04667 04668 // restore dc state 04669 pDC->SelectObject(OldBrush); 04670 04671 04672 COLORREF TopLeft; 04673 COLORREF BotRight; 04674 COLORREF TopLeftInside; 04675 COLORREF BotRightInside; 04676 04677 04678 if (!PlinthOut) 04679 { 04680 TopLeft = GetSysColor(COLOR_WINDOWFRAME); 04681 BotRight = GetSysColor(COLOR_BTNHIGHLIGHT); 04682 TopLeftInside = GetSysColor(COLOR_BTNSHADOW); 04683 BotRightInside = GetSysColor(COLOR_BTNFACE); 04684 } 04685 else 04686 { 04687 TopLeft = GetSysColor(COLOR_BTNHIGHLIGHT); 04688 BotRight = GetSysColor(COLOR_WINDOWFRAME); 04689 TopLeftInside = GetSysColor(COLOR_BTNFACE); 04690 BotRightInside = GetSysColor(COLOR_BTNSHADOW); 04691 } 04692 INT32 x = rect->GetLeft(); 04693 INT32 y = rect->GetTop(); 04694 INT32 dx = rect->GetWidth()-1; 04695 INT32 dy = rect->GetHeight(); 04696 04697 // The plinth is always made up of 4 right-angle elements 04698 // When indented, the colours are swapped, but the elements retain position 04699 PatB(pDC, x, y, 1, dy-1, TopLeft); 04700 PatB(pDC, x, y, dx-1, 1, TopLeft); 04701 04702 PatB(pDC, x+dx-1, y, 1, dy, BotRight); 04703 PatB(pDC, x, y+dy-1, dx, 1, BotRight); 04704 04705 PatB(pDC, x+1, y+1, 1, dy-2, TopLeftInside); 04706 PatB(pDC, x+1, y+1, dx-2, 1, TopLeftInside); 04707 04708 PatB(pDC, x+dx-2, y+1, 1, dy-2, BotRightInside); 04709 PatB(pDC, x+1, y+dy-2, dx-2, 1, BotRightInside); 04710 } 04711 else 04712 { 04713 // create brushes /pens etc.. 04714 wxPen Black(PS_SOLID, 0,RGB(0,0,0)); 04715 wxPen Shadow(PS_SOLID, 0, GetSysColor(COLOR_BTNSHADOW)); 04716 wxPen White(PS_SOLID, 0, GetSysColor(COLOR_BTNHIGHLIGHT)); 04717 wxBrush Back(GetSysColor(COLOR_BTNFACE)); 04718 04719 // select into dc 04720 wxPen *OldPen = (wxPen *) pDC->SelectObject(&Black); 04721 wxBrush * OldBrush = (wxBrush *) pDC->SelectObject(&Back); 04722 04723 // fill in the background 04724 pDC->FillRect(rect, &Back); 04725 04726 // draw the black outline 04727 pDC->MoveTo(rect->GetLeft(), rect->bottom-2); 04728 pDC->LineTo(rect->GetLeft(), rect->GetTop()); 04729 pDC->MoveTo(rect->right-1, rect->bottom-2); 04730 pDC->LineTo(rect->right-1, rect->GetTop()); 04731 pDC->MoveTo(rect->GetLeft()+1, rect->bottom-1); 04732 pDC->LineTo(rect->right-1, rect->bottom-1); 04733 pDC->MoveTo(rect->GetLeft()+1, rect->GetTop()); 04734 pDC->LineTo(rect->right-1, rect->GetTop()); 04735 04736 04737 // draw the 3d slabbing 04738 pDC->SelectObject(((PlinthOut) ? &White : &Shadow)); 04739 pDC->MoveTo(rect->GetLeft()+1, rect->bottom-2); 04740 pDC->LineTo(rect->GetLeft()+1, rect->GetTop()+1); 04741 pDC->LineTo(rect->right-1, rect->GetTop()+1); 04742 04743 pDC->SelectObject(((PlinthOut) ? &Shadow : &White)); 04744 pDC->MoveTo(rect->right-2, rect->GetTop()+2); // Ensure corner pixel is correct 04745 pDC->LineTo(rect->right-2, rect->bottom-2); 04746 pDC->LineTo(rect->GetLeft()+1, rect->bottom-2); 04747 04748 // restore dc state 04749 pDC->SelectObject(OldPen); 04750 pDC->SelectObject(OldBrush); 04751 } */ 04752 04753 }
|
|
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.
Definition at line 6283 of file basebar2.cpp. 06284 { 06285 #pragma message( __LOCMSG__ "BaseBar::PaintChicagoBorder - do nothing" ) 06286 TRACE( _T("Warning - BaseBar::PaintChicagoBorder called") ); 06287 /* wxRect WinRect( GetClientRect() ); 06288 wxRect ParWin( GetParent()->GetRect() ); 06289 wxRect ScreenWin( GetRect() ); 06290 06291 DWORD TopCol = GetSysColor(COLOR_BTNHIGHLIGHT); 06292 DWORD BottomCol = GetSysColor(COLOR_BTNSHADOW); 06293 DWORD LeftCol = GetSysColor(COLOR_BTNHIGHLIGHT); 06294 DWORD RightCol = GetSysColor(COLOR_BTNSHADOW); 06295 06296 // Get a context onto the entire window area 06297 wxDC *DC = GetWindowDC(); 06298 WinRect.Inflate(1,1); 06299 if(!IS_CHICAGO) 06300 { 06301 switch(ParentDockBarType) 06302 { 06303 case DOCKBAR_LEFT: 06304 06305 break; 06306 case DOCKBAR_RIGHT: 06307 if(ScreenWin.GetRight()==ParWin.GetRight()) 06308 RightCol = GetSysColor(COLOR_WINDOWFRAME); 06309 break; 06310 case DOCKBAR_TOP: 06311 if(ScreenWin.GetBottom()==ParWin.GetBottom()) 06312 BottomCol = GetSysColor(COLOR_WINDOWFRAME); 06313 break; 06314 case DOCKBAR_BOTTOM: 06315 06316 break; 06317 } 06318 } 06319 06320 PatB(DC,0,0,1,WinRect.GetBottom(),LeftCol); 06321 06322 PatB(DC,0,0,WinRect.GetRight(),1,TopCol); 06323 06324 PatB(DC,WinRect.GetRight(),0,1,WinRect.GetBottom(),RightCol); 06325 06326 PatB(DC,0,WinRect.GetBottom() ,WinRect.GetRight()+1,1,BottomCol); */ 06327 06328 }
|
|
This routine gets called by OnNcPaint to paint the non client area of a floating bar.
Definition at line 5992 of file basebar2.cpp. 05993 { 05994 #pragma message( __LOCMSG__ "BaseBar::PaintDialogNonClient - do nothing" ) 05995 TRACE( _T("Warning - BaseBar::PaintDialogNonClient called") ); 05996 /* // Get the System Frame Size 05997 BorderWidth=wxSystemSettings::GetMetric(SM_CXFRAME); 05998 05999 // When the BaseBar is in DIALOG mode we have to paint the fancy non-client area. 06000 06001 // Get the size of the window 06002 wxRect WinRect( GetRect() ); 06003 06004 // Set up the active non-client regions 06005 SysMenuRect = wxRect(BorderWidth-1, 06006 BorderWidth-1, 06007 BorderWidth + TitleBarHeight+1, 06008 BorderWidth-1 + TitleBarHeight + 1); 06009 06010 TopBorderRect = wxRect(0, 06011 0, 06012 WinRect.GetWidth(), 06013 BorderWidth); 06014 06015 BottomBorderRect = wxRect(0, 06016 WinRect.GetHeight() - BorderWidth, 06017 WinRect.GetWidth(), 06018 WinRect.GetHeight()); 06019 06020 LeftBorderRect = wxRect(0, 06021 0, 06022 BorderWidth, 06023 WinRect.GetHeight()); 06024 06025 RightBorderRect = wxRect(WinRect.GetWidth() - BorderWidth, 06026 0, 06027 WinRect.GetWidth(), 06028 WinRect.GetHeight()); 06029 06030 CaptionBarRect = wxRect(BorderWidth - 1 + TitleBarHeight+1, 06031 BorderWidth - 1, 06032 WinRect.GetWidth() - BorderWidth + 1, 06033 BorderWidth + TitleBarHeight); 06034 06035 TopLeftGrowRect = wxRect(0, 06036 0, 06037 TitleBarHeight + BorderWidth +1, 06038 TitleBarHeight + BorderWidth); 06039 06040 TopRightGrowRect = wxRect(WinRect.GetWidth() - BorderWidth - TitleBarHeight -1 , 06041 0, 06042 WinRect.GetWidth(), 06043 TitleBarHeight + BorderWidth); 06044 06045 06046 BottomLeftGrowRect = wxRect(0, 06047 WinRect.GetHeight() - BorderWidth - TitleBarHeight , 06048 TitleBarHeight + BorderWidth +1 , 06049 WinRect.GetHeight()); 06050 06051 BottomRightGrowRect = wxRect(WinRect.GetWidth() - BorderWidth - TitleBarHeight -1 , 06052 WinRect.GetHeight() - BorderWidth - TitleBarHeight, 06053 WinRect.GetWidth(), 06054 WinRect.GetHeight()); 06055 06056 06057 // Get a context onto the entire window area 06058 wxClientDC dc( this ); 06059 06060 // ------------------------------------------------------------------------------------- 06061 // Paint the borders 06062 06063 // Create the pen. 06064 wxPen BorderPen(PS_NULL, 0, GetSysColor(COLOR_WINDOWFRAME)); 06065 06066 // Get standard border brush 06067 INT32 BorderColour = IsActive ? COLOR_ACTIVEBORDER: COLOR_INACTIVEBORDER; 06068 wxBrush BorderBrush(GetSysColor(BorderColour)); 06069 06070 // Select these into the DC 06071 dc.SetBrush( BorderBrush ); 06072 dc.SetPen( BorderPen ); 06073 dc.SetFont( TitleFont ); 06074 06075 // Top 06076 dc.DrawRectangle( TopBorderRect ); 06077 // Bottom 06078 dc.DrawRectangle( BottomBorderRect ); 06079 // Left 06080 dc.DrawRectangle( LeftBorderRect ); 06081 // Right 06082 dc.DrawRectangle( RightBorderRect ); 06083 06084 06085 // ------------------------------------------------------------------------------------- 06086 // Paint the borders frame 06087 06088 wxPen FramePen( GetSysColor(COLOR_WINDOWFRAME), wxSolid ); 06089 06090 // Get standard hollow brush 06091 wxBrush FrameBrush; 06092 FrameBrush.CreateStockObject(HOLLOW_BRUSH); 06093 06094 // Select these into the DC 06095 dc.SetBrush( FrameBrush ); 06096 dc.SetPen( FramePen ); 06097 06098 dc.DrawRectangle(0, 0, WinRect.GetWidth(), WinRect.GetHeight()); 06099 06100 dc.DrawRectangle(BorderWidth-1, 06101 BorderWidth-1, 06102 WinRect.GetWidth() - BorderWidth + 1, 06103 WinRect.GetHeight() - BorderWidth + 1); 06104 06105 // Galleries have corner grow controls 06106 if( pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)) ) 06107 { 06108 dc.DrawRectangle(TopLeftGrowRect); 06109 dc.DrawRectangle(TopRightGrowRect); 06110 06111 // Bottom Left Grow 06112 dc.DrawLine( BottomLeftGrowRect.GetLeft(),BottomLeftGrowRect.GetTop(), 06113 BorderWidth -1 ,BottomLeftGrowRect.GetTop() ); 06114 dc.DrawLine( BottomLeftGrowRect.GetRight(),BottomLeftGrowRect.GetBottom(), 06115 BottomLeftGrowRect.GetRight(),BottomLeftGrowRect.GetBottom() - BorderWidth - 1 ); 06116 06117 // Bottom Right Grow 06118 dc.DrawLine(BottomRightGrowRect.GetRight() - BorderWidth +1,BottomRightGrowRect.GetTop(), 06119 BottomRightGrowRect.GetRight(),BottomRightGrowRect.GetTop()); 06120 dc.DrawLine(BottomRightGrowRect.GetLeft(),BottomRightGrowRect.GetBottom(), 06121 BottomRightGrowRect.GetLeft(),BottomLeftGrowRect.GetBottom() - BorderWidth - 1); 06122 06123 //remove corner grow rects from border rects 06124 TopBorderRect.Inflate(-TopLeftGrowRect.GetRight(),0); 06125 06126 LeftBorderRect.Inflate(0,-TopLeftGrowRect.GetRight()); 06127 06128 BottomBorderRect.Inflate(-TopLeftGrowRect.GetRight(),0); 06129 06130 RightBorderRect.Inflate(0,-TopLeftGrowRect.GetRight()); 06131 06132 } 06133 06134 // ------------------------------------------------------------------------------------- 06135 // Paint the Close Button 06136 06137 wxBrush ButtonBrush(GetSysColor(COLOR_BTNFACE)); 06138 dc.SetBrush( ButtonBrush ); 06139 dc.DrawRectangle(SysMenuRect); 06140 06141 // Paint the Shadow 06142 wxBrush ShadowBrush(GetSysColor(COLOR_BTNSHADOW)); 06143 dc.SetPen(GetStockObject(NULL_PEN)); 06144 dc.SetBrush(&ShadowBrush); 06145 dc.DrawRectangle(BorderWidth - 1 + (TitleBarHeight/2)-1, 06146 BorderWidth + 4, 06147 BorderWidth - 1 + (TitleBarHeight/2)+6, 06148 BorderWidth + 8 ); 06149 06150 // Paint the Rectangle/Highlight 06151 dc.SetPen(GetStockObject(BLACK_PEN)); 06152 dc.SetBrush(GetStockObject(WHITE_BRUSH)); 06153 dc.DrawRectangle(BorderWidth - 1 + (TitleBarHeight/2)-2, 06154 BorderWidth + 3, 06155 BorderWidth - 1 + (TitleBarHeight/2)+4, 06156 BorderWidth + 6 ); 06157 06158 06159 // ------------------------------------------------------------------------------------- 06160 // Paint the caption bar 06161 06162 INT32 CaptionColour = IsActive ? COLOR_ACTIVECAPTION: COLOR_INACTIVECAPTION; 06163 06164 wxBrush CaptionBrush(GetSysColor(CaptionColour)); 06165 06166 dc.SetBrush(CaptionBrush); 06167 dc.DrawRectangle(CaptionBarRect); 06168 06169 // ------------------------------------------------------------------------------------ 06170 // Print the Title 06171 06172 INT32 TextColour = IsActive ? COLOR_CAPTIONTEXT: COLOR_INACTIVECAPTIONTEXT; 06173 06174 // Text Bounding Box 06175 wxRect BoundBox(BorderWidth +TitleBarHeight, 06176 BorderWidth-1, 06177 WinRect.GetWidth() - (BorderWidth*2) + 1, 06178 BorderWidth + TitleBarHeight); 06179 06180 // Get the Dialog Name 06181 String_32 Name = pOp->GetName(); 06182 06183 // Set the Text Colour 06184 dc.SetTextForeground(GetSysColor(TextColour)); 06185 dc.SetBackgroundMode( wxTRANSPARENT ); 06186 06187 // Check that the text will not overlap to the left 06188 wxSize TextSize=dc->GetTextExtent(Name,camStrlen(Name)); 06189 06190 if (TextSize.width<BoundBox.GetWidth()) 06191 dc->DrawText(Name,-1,BoundBox,DT_CENTER|DT_VCENTER|DT_SINGLELINE); // UIC 06192 //dc->DrawText(Name,camStrlen(Name),BoundBox,DT_CENTER); 06193 else 06194 dc->DrawText(Name,camStrlen(Name),BoundBox,DT_LEFT|DT_VCENTER |DT_SINGLELINE); // UIC 06195 //dc->DrawText(Name,camStrlen(Name),BoundBox,DT_LEFT); 06196 06197 // Clean up and release the DC 06198 06199 dc->SelectObject(OldBrush); 06200 dc->SelectObject(OldPen); 06201 dc->SelectObject(OldFont); */ 06202 06203 }
|
|
Draws an XOR drag rectangle anywhere on the display.
Definition at line 7774 of file basebar2.cpp. 07775 { 07776 wxScreenDC DisplayDC; 07777 07778 wxSize NewSize(1,1); 07779 wxSize OldSize(1,1); 07780 07781 if (DockBar == DOCKBAR_FLOAT) 07782 { 07783 NewSize.x = NewSize.y = BorderWidth; 07784 } 07785 07786 if (OldBarType == DOCKBAR_FLOAT) 07787 { 07788 OldSize.x = OldSize.y = BorderWidth; 07789 } 07790 07791 // MFC DrawDragRect function 07792 #pragma message( __LOCMSG__ "Remove DrawDragRect usage" ) 07793 // pDisplayDC->DrawDragRect( &Rect, NewSize, &OldRect, OldSize ); 07794 07795 /* 07796 // paint a + to the right side of the box if we are doing a control copy drag 07797 if(CtlDragState != NO_DRAG) 07798 { 07799 if(CtlDragMode == COPY) 07800 { 07801 07802 pDragBrush = new wxBrush(RGB(255,255,255)) ; 07803 07804 // Select into the DC 07805 pOldBrush = pDisplayDC->SelectObject(pDragBrush); 07806 07807 07808 pDisplayDC->PatBlt(OldRect.GetRight()+2, OldRect.GetBottom()-8, 5, 1,PATINVERT); 07809 pDisplayDC->PatBlt(OldRect.GetRight()+4, OldRect.GetBottom()-10, 1, 5,PATINVERT); 07810 07811 // draw the + 07812 pDisplayDC->PatBlt(Rect.GetRight()+2, Rect.GetBottom()-8, 5, 1,PATINVERT); 07813 pDisplayDC->PatBlt(Rect.GetRight()+4, Rect.GetBottom()-10, 1, 5,PATINVERT); 07814 07815 pDisplayDC->SelectObject(pOldBrush); 07816 07817 pDragBrush->DeleteObject(); 07818 delete pDragBrush; 07819 } 07820 07821 } 07822 07823 */ 07824 07825 delete pDisplayDC; 07826 }
|
|
This routine gets called by OnNcPaint to paint the non client area of a Windows 95 style floating bar.
Definition at line 5753 of file basebar2.cpp. 05754 { 05755 /* if( pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)) ) 05756 { 05757 IsActive = ( this == GetActiveWindow() ); 05758 } 05759 */ 05760 05761 // When the BaseBar is in DIALOG mode we have to paint the fancy non-client area. 05762 05763 // Get the size of the window 05764 wxRect WinRect( GetRect() ); 05765 05766 // Set up the active non-client regions 05767 SysMenuRect = wxRect(WinRect.GetWidth() - TitleBarHeight - BorderWidth+2, 05768 BorderWidth + 1, 05769 WinRect.GetWidth() - BorderWidth , 05770 BorderWidth - 2 + TitleBarHeight ); 05771 // TRACE( _T("SMRB = (%d, %d)\n"), SysMenuRect.GetWidth(), SysMenuRect.GetHeight()); 05772 05773 TopBorderRect = wxRect(0, 05774 0, 05775 WinRect.GetWidth(), 05776 BorderWidth); 05777 05778 BottomBorderRect = wxRect(0, 05779 WinRect.GetHeight() - BorderWidth, 05780 WinRect.GetWidth(), 05781 WinRect.GetHeight()); 05782 05783 LeftBorderRect = wxRect(0, 05784 0, 05785 BorderWidth, 05786 WinRect.GetHeight()); 05787 05788 RightBorderRect = wxRect(WinRect.GetWidth() - BorderWidth, 05789 0, 05790 WinRect.GetWidth(), 05791 WinRect.GetHeight()); 05792 05793 CaptionBarRect = wxRect(BorderWidth , 05794 BorderWidth-1 , 05795 WinRect.GetWidth() - BorderWidth + 1, 05796 TitleBarHeight+BorderWidth); 05797 05798 05799 TopLeftGrowRect = wxRect(0, 05800 0, 05801 TitleBarHeight + BorderWidth +1, 05802 TitleBarHeight + BorderWidth); 05803 05804 TopRightGrowRect = wxRect(WinRect.GetWidth() - BorderWidth - TitleBarHeight -1 , 05805 0, 05806 WinRect.GetWidth(), 05807 TitleBarHeight + BorderWidth); 05808 05809 05810 BottomLeftGrowRect = wxRect(0, 05811 WinRect.GetHeight() - BorderWidth - TitleBarHeight , 05812 TitleBarHeight + BorderWidth +1 , 05813 WinRect.GetHeight()); 05814 05815 BottomRightGrowRect = wxRect(WinRect.GetWidth() - BorderWidth - TitleBarHeight -1 , 05816 WinRect.GetHeight() - BorderWidth - TitleBarHeight, 05817 WinRect.GetWidth(), 05818 WinRect.GetHeight()); 05819 05820 05821 // Get a context onto the entire window area 05822 wxClientDC dc( this ); 05823 05824 05825 // ------------------------------------------------------------------------------------- 05826 /* // Paint the borders UIC commented out 05827 05828 // Create the pen. 05829 wxPen BorderPen(PS_NULL, 0, GetSysColor(COLOR_WINDOWFRAME)); 05830 05831 // Get standard border brush 05832 wxBrush BorderBrush(GetSysColor(COLOR_BTNFACE)); 05833 05834 // Select these into the DC 05835 wxBrush *OldBrush = dc->SelectObject(&BorderBrush); 05836 wxPen *OldPen = dc->SelectObject(&BorderPen); 05837 wxFont * OldFont=dc->SelectObject(TitleFont); 05838 05839 05840 // ------------------------------------------------------------------------------------- 05841 // Paint the borders frame */ 05842 05843 05844 // Get standard hollow brush 05845 wxBrush FrameBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); 05846 05847 dc.SetBrush( FrameBrush ); 05848 dc.DrawRectangle( TopBorderRect); 05849 dc.DrawRectangle( BottomBorderRect); 05850 dc.DrawRectangle( LeftBorderRect); 05851 dc.DrawRectangle( RightBorderRect); 05852 dc.SetBrush( wxNullBrush ); 05853 05854 wxColour TopLeft = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNHIGHLIGHT ); 05855 wxColour BotRight = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWFRAME ); 05856 wxColour TopLeftInside = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); 05857 wxColour BotRightInside = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNSHADOW ); 05858 05859 INT32 x = 1; 05860 INT32 y = 1; 05861 INT32 dx = WinRect.GetWidth()-1; 05862 INT32 dy = WinRect.GetHeight()-1; 05863 05864 // The plinth is always made up of 4 right-angle elements 05865 // When indented, the colours are swapped, but the elements retain position 05866 PatB(dc, x, y, 1, dy-1, TopLeft); 05867 PatB(dc, x, y, dx-1, 1, TopLeft); 05868 05869 PatB(dc, x+dx-1, y-1, 1, dy+1, BotRight); 05870 PatB(dc, x-1, y+dy-1, dx+2, 1, BotRight); 05871 05872 PatB(dc, x+1, y+1, 1, dy-2, TopLeftInside); 05873 PatB(dc, x+1, y+1, dx-2, 1, TopLeftInside); 05874 05875 PatB(dc, x+dx-2, y, 1, dy-1, BotRightInside); 05876 PatB(dc, x, y+dy-2, dx-2, 1, BotRightInside); 05877 05878 05879 05880 05881 // ------------------------------------------------------------------------------------- 05882 /* // Paint the caption bar 05883 05884 INT32 CaptionColour = IsActive ? COLOR_ACTIVECAPTION: COLOR_INACTIVECAPTION; 05885 05886 wxBrush CaptionBrush(GetSysColor(CaptionColour)); 05887 05888 dc->FillRect(&CaptionBarRect,&CaptionBrush); 05889 */ 05890 // Make sure weve got diagonal resizing for the galleries 05891 if( pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)) ) 05892 { 05893 //remove corner grow rects from border rects 05894 TopBorderRect.Inflate(-TopLeftGrowRect.GetRight(),0); 05895 05896 LeftBorderRect.Inflate(0,-TopLeftGrowRect.GetRight()); 05897 05898 BottomBorderRect.Inflate(-TopLeftGrowRect.GetRight(),0); 05899 05900 RightBorderRect.Inflate(0,-TopLeftGrowRect.GetRight()); 05901 } 05902 05903 /* // ------------------------------------------------------------------------------------- 05904 // Paint the Close Button UIC commnented out next 2 functions 05905 05906 Paint3dPlinth(dc,&SysMenuRect,TRUE); 05907 // Get standard Black Pen 05908 wxPen BlackPen; 05909 BlackPen.CreateStockObject(BLACK_PEN); 05910 dc->SelectObject(&BlackPen); 05911 05912 dc->MoveTo(SysMenuRect.BottomRight()-(wxSize(5,4))); 05913 dc->LineTo(SysMenuRect.TopLeft()+(wxSize(2,2))); 05914 05915 dc->MoveTo(SysMenuRect.BottomRight()-(wxSize(6,4))); 05916 dc->LineTo(SysMenuRect.TopLeft()+(wxSize(1,2))); 05917 05918 dc->MoveTo(SysMenuRect.BottomRight()-(wxSize(10,4))); 05919 dc->LineTo(SysMenuRect.TopLeft()+(wxSize(7,2))); 05920 dc->MoveTo(SysMenuRect.BottomRight()-(wxSize(9,4))); 05921 dc->LineTo(SysMenuRect.TopLeft()+(wxSize(8,2))); 05922 05923 // ------------------------------------------------------------------------------------ 05924 // Print the Title 05925 05926 INT32 TextColour = IsActive ? COLOR_CAPTIONTEXT: COLOR_INACTIVECAPTIONTEXT; 05927 05928 // Text Bounding Box 05929 wxRect BoundBox(BorderWidth + 1, 05930 BorderWidth - 1, 05931 WinRect.GetWidth() - (BorderWidth*2) + 1 - TitleBarHeight, 05932 BorderWidth + TitleBarHeight); 05933 05934 // Get the Dialog Name 05935 String_32 Name = pOp->GetName(); 05936 05937 // Set the Text Colour 05938 dc->SetTextColor(GetSysColor(TextColour)); 05939 dc->SetBkMode(TRANSPARENT); 05940 05941 // Check that the text will not overlap to the left 05942 wxSize TextSize=dc->GetTextExtent(Name,camStrlen(Name)); 05943 05944 dc->DrawText(Name,camStrlen(Name),BoundBox,DT_LEFT); 05945 05946 // Clean up and release the DC 05947 05948 dc->SelectObject(OldBrush); 05949 dc->SelectObject(OldPen); 05950 dc->SelectObject(OldFont); 05951 ReleaseDC(dc); 05952 05953 } 05954 05955 */ 05956 // Paint the caption UIC 05957 05958 // make sure that DrawCaption shows the correct title 05959 SetLabel( pOp->GetName() ); 05960 05961 #pragma message( __LOCMSG__ "Remove MSW frame redrawing stuff" ) 05962 /* UINT32 DrawFlags = DC_TEXT|DC_SMALLCAP; 05963 05964 if(IsActive) 05965 DrawFlags|=DC_ACTIVE; 05966 05967 // draw the caption 05968 ::DrawCaption( this, dc, &CaptionBarRect, DrawFlags ); 05969 05970 // draw the new stretchy close button 05971 dc->DrawFrameControl( &SysMenuRect, DFC_CAPTION, DFCS_CAPTIONCLOSE ); */ 05972 }
|
|
Draws an XOR drag rectangle anywhere on the display.
Definition at line 7848 of file basebar2.cpp. 07849 { 07850 #pragma message( __LOCMSG__ "Remove DC::PatBlt usage" ) 07851 /* DWORD dwRop = PATINVERT; 07852 07853 wxScreenDC DisplayDC; 07854 07855 // Create a pattern brush from our gray bitmap 07856 wxBrush DragBrush( BrushBitmap ); 07857 07858 // Select these into the DC 07859 DisplayDC.SetBrush( DragBrush ); 07860 07861 if (DockBar==DOCKBAR_FLOAT) 07862 { 07863 // left vertical 07864 pDisplayDC->PatBlt(Rect.GetLeft(), Rect.GetTop(), BorderWidth, Rect.GetHeight(),dwRop); 07865 // top horizontal 07866 pDisplayDC->PatBlt(Rect.GetLeft()+BorderWidth, Rect.GetTop(), 07867 Rect.GetWidth()-(BorderWidth*2), BorderWidth,dwRop); 07868 // right vertical 07869 pDisplayDC->PatBlt(Rect.GetRight()-BorderWidth, Rect.GetTop(), 07870 BorderWidth, Rect.GetHeight(), dwRop); 07871 // bottom horizontal 07872 pDisplayDC->PatBlt(Rect.GetLeft()+BorderWidth, Rect.GetBottom()-BorderWidth, 07873 Rect.GetWidth()-(BorderWidth*2), BorderWidth, dwRop); 07874 } 07875 else 07876 { 07877 // left vertical 07878 pDisplayDC->PatBlt(Rect.GetLeft(), Rect.GetTop(), 1, Rect.GetHeight(), dwRop); 07879 // top horizontal 07880 pDisplayDC->PatBlt(Rect.GetLeft()+1, Rect.GetTop(), Rect.GetWidth()-2, 1, dwRop); 07881 // right vertical 07882 pDisplayDC->PatBlt(Rect.GetRight()-1, Rect.GetTop(), 1, Rect.GetHeight(), dwRop); 07883 // bottom horizontal 07884 pDisplayDC->PatBlt(Rect.GetLeft()+1, Rect.GetBottom()-1, Rect.GetWidth()-2, 1, dwRop); 07885 } */ 07886 /* 07887 // paint a + to the right side of the box if we are doing a control copy drag 07888 if(CtlDragState != NO_DRAG) 07889 { 07890 if(CtlDragMode == COPY) 07891 { 07892 pDisplayDC->SelectObject(pOldBrush); 07893 pDragBrush->DeleteObject(); 07894 delete pDragBrush; 07895 07896 pDragBrush = new wxBrush(RGB(255,255,255)) ; 07897 07898 // Select into the DC 07899 pOldBrush = pDisplayDC->SelectObject(pDragBrush); 07900 07901 // draw the + 07902 pDisplayDC->PatBlt(Rect.GetRight()+2, Rect.GetBottom()-8, 5, 1, dwRop); 07903 pDisplayDC->PatBlt(Rect.GetRight()+4, Rect.GetBottom()-10, 1, 5, dwRop); 07904 07905 } 07906 07907 } 07908 07909 DisplayDC.SetBrush( wxNullBrush ); */ 07910 }
|
|
|
|
Format and place controls according to docking bar type.
Reimplemented in GalleryBar. Definition at line 875 of file basebar2.cpp. 00876 { 00877 // Position the controls in the bar 00878 switch(ParentDockBarType) 00879 { 00880 case DOCKBAR_FLOAT: 00881 FormatFloatingBar(TRUE,USE_BAR); 00882 pOp->SetCurrentOrientation(Horizontal); 00883 break; 00884 00885 case DOCKBAR_LEFT: 00886 case DOCKBAR_RIGHT: 00887 FormatVerticalBar(TRUE,USE_BAR); 00888 pOp->SetCurrentOrientation(Vertical); 00889 break; 00890 00891 case DOCKBAR_TOP: 00892 case DOCKBAR_BOTTOM: 00893 FormatHorizontalBar(TRUE,USE_BAR); 00894 pOp->SetCurrentOrientation(Horizontal); 00895 break; 00896 default: 00897 ENSURE(FALSE,"Unknown Parent DockBar"); 00898 } 00899 // Size the window correctly 00900 SetBarSize(ParentDockBarType, DoRedraw); 00901 return TRUE ; 00902 }
|
|
Moves extra controls about once they have been created.
Definition at line 3183 of file basebar2.cpp.
|
|
Definition at line 1344 of file basebar2.cpp. 01345 { 01346 #pragma message( __LOCMSG__ "BaseBar::Recreate - do nothing" ) 01347 TRACE( _T("Warning - BaseBar::Recreate called") ); 01348 /* pOp = Op; 01349 ParentDockBarType = DockBarTyp; // Record the current dock ba 01350 01351 ParentDockBar = GetMainFrame()->GetDockBar(DockBarTyp); 01352 01353 SetFormatVariables(); 01354 01355 wxRect NewBarSize = OldDragRect; // Screen coords 01356 01358 01359 // 'dynamic' infobar update logic 01360 01362 01363 String_32 dialogBarOpName = Op->GetName (); 01364 01365 if (dialogBarOpName == TEXT (String_32 (_R(IDS_FILLTOOL_FILLINFOBARNAME)))) 01366 // || add the name of your 'dynamic' infobar here 01367 { 01368 //pOp->ResetHiddenGadgetStates (); 01369 } 01370 01372 01373 if (DockBarTyp == DOCKBAR_FLOAT) 01374 { 01375 CurrentDlgBarMode = DIALOG; // For now 01376 01377 // Create a popup floater 01378 CreateEx(0, NULL, 01379 NULL, WS_POPUP |WS_CHILD,// | WS_BORDER , 01380 NewBarSize.GetLeft()+(NewBarSize.GetWidth()/2), NewBarSize.GetTop()+(NewBarSize.GetHeight()/2), NewBarSize.GetWidth(), NewBarSize.GetHeight(), 01381 GetMainFrame()->GetSafeHwnd(), // Parent is the frame window 01382 NULL); 01383 01384 } 01385 else 01386 { 01387 CurrentDlgBarMode = BAR; // For now 01388 01389 // Convert the NewBarSize to client coords 01390 ::ScreenToClient(ParentDockBar->GetSafeHwnd(), &NewBarSize.TopLeft()); 01391 ::ScreenToClient(ParentDockBar->GetSafeHwnd(), &NewBarSize.BottomRight()); 01392 01393 // Create a child bar 01394 CreateEx(0, NULL, NULL, WS_CHILD| WS_BORDER , 01395 NewBarSize.GetLeft(), NewBarSize.GetTop(), NewBarSize.GetWidth(), NewBarSize.GetHeight(), 01396 ParentDockBar->GetSafeHwnd(), 01397 NULL); 01398 01399 } 01400 if (CanCopy) 01401 { 01402 if (!CopyOrLoadControls(GetSafeHwnd())|| (!CreateExtraControls())) 01403 { 01404 // We failed to load the controls 01405 // Delete the window, and all children which may have been created 01406 CCamApp::GetDlgManager()->Delete(GetSafeHwnd(),Op); 01407 return FALSE; 01408 } 01409 } 01410 else 01411 { 01412 if (!LoadResourceControls()|| (!CreateExtraControls())) 01413 { 01414 // We failed to load the controls 01415 // Delete the window, and all children which may have been created 01416 CCamApp::GetDlgManager()->Delete(GetSafeHwnd(),Op); 01417 return FALSE; 01418 } 01419 } 01420 if (! PositionControls()) 01421 return FALSE; 01422 01423 // Attach the BaseBar to the docking bar 01424 ParentDockBar->PlaceBar(GetSafeHwnd(), wxPoint(OldDragRect.GetLeft(), OldDragRect.GetTop())); 01425 // inform help system 01426 01427 pOp->WindowID = (CWindowID)(GetSafeHwnd()); 01428 01429 BROADCAST_TO_CLASS(DialogMsg(GetSafeHwnd(), DIM_CREATE, NULL) ,DialogBarOp); 01430 01431 wxRect temprect; 01432 GetClientRect(&temprect); 01433 01434 // Update the bar's state before showing 01435 Op->UpdateState(); 01436 01437 //if (Op->GetName () != String_32 (TEXT ("Toolbar"))) 01438 { 01439 // Show the Window 01440 ShowWindow(SW_SHOW); 01441 01442 ::InvalidateRect(GetSafeHwnd(),NULL,TRUE); 01443 ::UpdateWindow(GetSafeHwnd()); 01444 } 01445 01446 ControlHelper::NotifyBarCreated(GetSafeHwnd()); 01447 01448 FormatHorizontalBar(FALSE,FORCE_SMALL); 01449 FormatVerticalBar(FALSE,FORCE_SMALL); 01450 FormatFloatingBar(FALSE,FORCE_SMALL); 01451 FormatHorizontalBar(FALSE,FORCE_LARGE); 01452 FormatVerticalBar(FALSE,FORCE_LARGE); 01453 FormatFloatingBar(FALSE,FORCE_LARGE); 01454 01455 SetWindowText(Op->GetName()); 01456 01457 // ZZZZZ 01458 LastSmallBarPos = * GetMainFrame()->GetDockBar(ParentDockBarType)-> 01459 GetBarPos(this->GetSafeHwnd()); 01460 01461 if (Op->GetName () == String_32 (TEXT ("Toolbar"))) 01462 { 01463 PtrToToolBar = this; 01464 } */ 01465 01466 return TRUE; 01467 }
|
|
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.
Definition at line 1223 of file basebar2.cpp. 01225 { 01226 #pragma message( __LOCMSG__ "BaseBar::RecreateAt - do nothing" ) 01227 TRACE( _T("Warning - BaseBar::RecreateAt called") ); 01228 /* LastSmallBarPos = Pos; 01229 pOp = Op; 01230 ParentDockBarType = DockBarTyp; // Record the current dock bar 01231 01232 ParentDockBar = GetMainFrame()->GetDockBar(DockBarTyp); 01233 01234 SetFormatVariables(); 01235 01236 wxRect NewBarSize = OldDragRect; // Screen coords 01237 if (DockBarTyp == DOCKBAR_FLOAT) 01238 // || pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 01239 { 01240 CurrentDlgBarMode = DIALOG; // For now 01241 01242 // Create a popup floater 01243 CreateEx(0, NULL, 01244 NULL, WS_POPUP |WS_CHILD, //| WS_BORDER , 01245 Pos.x, Pos.y,0,0, 01246 GetMainFrame()->GetSafeHwnd(), // Parent is the frame window 01247 NULL); 01248 01249 } 01250 else 01251 { 01252 CurrentDlgBarMode = BAR; // For now 01253 OILFixedDockingBar * FixedDock = 01254 (OILFixedDockingBar*)GetMainFrame()->GetDockBar(DockBarTyp); 01255 wxPoint p; 01256 FixedDock->BarPosToScreen(Pos,&p); 01257 // Create a child bar 01258 CreateEx(0, NULL, 01259 NULL, WS_CHILD | WS_BORDER , 01260 p.x,p.y,0,0, 01261 ParentDockBar->GetSafeHwnd(), 01262 NULL); 01263 } 01264 if (!LoadResourceControls()|| (!CreateExtraControls())) 01265 { 01266 // We failed to load the controls 01267 // Delete the window, and all children which may have been created 01268 CCamApp::GetDlgManager()->Delete(GetSafeHwnd(), Op); 01269 return FALSE; 01270 } 01271 01272 if (!PositionControls()) 01273 return FALSE; 01274 01275 01276 //TRACE( _T("Done Recreate %d"),GetSafeHwnd()); 01277 // Place BaseBar via docking bar 01278 if (DockBarTyp == DOCKBAR_FLOAT) 01279 { 01280 ParentDockBar->PlaceBar(GetSafeHwnd(),Pos); 01281 } 01282 else 01283 { 01284 OILFixedDockingBar * FixedDock = 01285 (OILFixedDockingBar*)GetMainFrame()->GetDockBar(DockBarTyp); 01286 if ((ParentDockBar->SetNewHwnd(OldHwnd,GetSafeHwnd()))==NULL) 01287 return FALSE; 01288 FixedDock->PlaceBarAt(GetSafeHwnd(),Pos); 01289 01290 } 01291 // inform help system 01292 ControlHelper::NotifyBarCreated(GetSafeHwnd()); 01293 01294 // send a create to info bars so they can set the state of controls before 01295 // we show the window 01296 01297 pOp->WindowID = (CWindowID)(GetSafeHwnd()); 01298 BROADCAST_TO_CLASS(DialogMsg(GetSafeHwnd(), DIM_CREATE, NULL) ,DialogBarOp); 01299 01300 // Update the bar's state before showing 01301 Op->UpdateState(); 01302 01303 // Show the Window 01304 ShowWindow(SW_SHOW); 01305 01306 ::InvalidateRect(GetSafeHwnd(),NULL,TRUE); 01307 ::UpdateWindow(GetSafeHwnd()); 01308 01309 FormatHorizontalBar(FALSE,FORCE_SMALL); 01310 FormatVerticalBar(FALSE,FORCE_SMALL); 01311 FormatFloatingBar(FALSE,FORCE_SMALL); 01312 FormatHorizontalBar(FALSE,FORCE_LARGE); 01313 FormatVerticalBar(FALSE,FORCE_LARGE); 01314 FormatFloatingBar(FALSE,FORCE_LARGE); 01315 01316 SetWindowText(Op->GetName()); 01317 01318 if (Op->GetName () == String_32 (TEXT ("Toolbar"))) 01319 { 01320 PtrToToolBar = this; 01321 } */ 01322 01323 return TRUE; 01324 }
|
|
Definition at line 276 of file basebar.h. 00276 { Active = State;};
|
|
Set the Window size.
Reimplemented in GalleryBar. Definition at line 821 of file basebar2.cpp. 00822 { 00823 wxRect temp; 00824 00825 #pragma message( __LOCMSG__ "BaseBar::SetBarSize - do nothing" ) 00826 TRACE( _T("Warning - BaseBar::SetBarSize called") ); 00827 /* switch(BarType) 00828 { 00829 case DOCKBAR_FLOAT: 00830 if (ParentDockBar->IsBigControls()) 00831 temp = FloatLargeRect; 00832 else 00833 temp = FloatSmallRect; 00834 break; 00835 00836 case DOCKBAR_LEFT: 00837 case DOCKBAR_RIGHT: 00838 if (ParentDockBar->IsBigControls()) 00839 temp = VerticalLargeRect; 00840 else 00841 temp = VerticalSmallRect; 00842 break; 00843 00844 case DOCKBAR_TOP: 00845 case DOCKBAR_BOTTOM: 00846 if (ParentDockBar->IsBigControls()) 00847 temp = HorizontalLargeRect; 00848 else 00849 temp = HorizontalSmallRect; 00850 break; 00851 } 00852 UINT32 flags = SWP_NOMOVE|SWP_NOZORDER; 00853 if(! DoRedraw) 00854 flags |= SWP_NOREDRAW; 00855 SetWindowPos( NULL, 0, 0, temp.GetRight(), temp.GetBottom(), flags ); */ 00856 00857 return temp; 00858 }
|
|
Sets up various formating variables according to dockbar type large/small controls etc .. must be called on every create.
Definition at line 497 of file basebar2.cpp. 00498 { 00499 #pragma message( __LOCMSG__ "BaseBar::SetFormatVariables - do nothing" ) 00500 TRACE( _T("Warning - BaseBar::SetFormatVariables called") ); 00501 /* if (GetMainFrame()->GetDockBar(ParentDockBarType)->IsBigControls()) 00502 SeparatorWidth = LARGE_SEPARATOR; 00503 else 00504 SeparatorWidth = SMALL_SEPARATOR; */ 00505 }
|
|
base virtual function should never be called
Reimplemented in GalleryBar. Definition at line 6597 of file basebar2.cpp. 06598 { 06599 return FALSE; 06600 }
|
|
Creates a BaseBar window.
Definition at line 921 of file basebar2.cpp. 00922 { 00923 #pragma message( __LOCMSG__ "BaseBar::Show - do nothing" ) 00924 TRACE( _T("Warning - BaseBar::Show called") ); 00925 /* if (Op->IS_KIND_OF(InformationBarOp)) 00926 ((InformationBarOp*)Op)->SetInfo(); 00927 DockBarType InfoDock; 00928 00929 InfoDock = Op->GetDockBarType(); 00930 if(InfoDock != ParentDockBarType) 00931 { 00932 00933 OILDockingBar * NewDock ; 00934 OILDockingBar * OldDock ; 00935 BOOL CanCopy; 00936 NewDock = GetMainFrame()->GetDockBar(InfoDock); 00937 OldDock = GetMainFrame()->GetDockBar(ParentDockBarType); 00938 CanCopy = NewDock->IsBigControls() == OldDock->IsBigControls(); 00939 if(HasOrientationChanged(ParentDockBarType,DragDockBarType)) 00940 CanCopy = FALSE; 00941 00942 // dynamically create a new BaseBar/derived Bar 00943 BaseBar* NewBaseBar = (BaseBar *)GetClassInfo()->CreateObject(); 00944 00945 NewBaseBar->Recreate(InfoDock, this, Op,CanCopy); 00946 // The current BaseBar dies 00947 CCamApp::GetDlgManager()->Delete(GetSafeHwnd(),Op); 00948 return TRUE; 00949 } 00950 00951 KernelBarPos ThisPos; 00952 ThisPos.Dock = ParentDockBarType; 00953 00954 if (ParentDockBarType == DOCKBAR_FLOAT) 00955 { 00956 // Get x/y position of floating bar 00957 wxPoint FloatPos = Op->GetFloatingCPoint(); 00958 ThisPos.x=FloatPos.x; 00959 ThisPos.y=FloatPos.y; 00960 } 00961 else 00962 { 00963 // Get slot/offset position of docked bar 00964 ThisPos.Slot = Op->GetSlot(); 00965 ThisPos.Position = Op->GetOffset(); 00966 // Get a pointer to the docking bar 00967 OILFixedDockingBar * FixedDock = (OILFixedDockingBar*)GetMainFrame()-> 00968 GetDockBar(ParentDockBarType); 00969 } 00970 // Attach the BaseBar to the docking bar 00971 ParentDockBar->PlaceBar(GetSafeHwnd(),ThisPos); 00972 00973 SetWindowText(Op->GetName()); 00974 00975 // send a create to info bars so they can set the state of controls before 00976 // we show the window 00977 00978 // Show the Window 00979 ShowWindow(SW_SHOW); 00980 00981 InvalidateRect(NULL,TRUE); 00982 UpdateWindow(); */ 00983 00984 return TRUE; 00985 }
|
|
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.
Algorithm is: check whether rect1 is completely to left or right of rect2 and check whether rect1 is completely above or below rect2
Definition at line 7745 of file basebar2.cpp. 07746 { 07747 return( !( ( rect1.GetRight() < rect2.GetLeft() ) || 07748 ( rect1.GetLeft() >= rect2.GetRight() ) 07749 ) && 07750 !( ( rect1.GetBottom() < rect2.GetTop() ) || 07751 ( rect1.GetTop() >= rect2.GetBottom() ) 07752 ) 07753 ); 07754 }
|
|
Given a ptr to a controldata struct, return its length. Under Win32, all strings are UniCode (as they are in the res file).
Definition at line 4237 of file basebar2.cpp. 04238 { 04239 #if WIN32 04240 // Get pointer to the data after the DLGITEMTEMPLATE structure. 04241 WORD *pData = (WORD *) (pControl + 1); 04242 04243 // Skip the class 04244 if (*pData == 0xFFFF) 04245 // There is only one more word - the atom of the window class - skip it. 04246 pData += 2; 04247 else 04248 // The class is specified as a string - skip it 04249 pData = (WORD *) MovePastWideStr((LPWSTR) pData); 04250 04251 // Skip the 'title' array 04252 if (*pData == 0xFFFF) 04253 // There is only one more word - it is a resource ID - skip it. 04254 pData += 2; 04255 else 04256 // The title array is a string - skip it 04257 pData = (WORD *) MovePastWideStr((LPWSTR) pData); 04258 04259 // Skip the creation data. 04260 UINT32 Extra = (UINT32) *pData; 04261 pData++; 04262 04263 #else 04264 // Get pointer to the data after the DLGITEMTEMPLATE structure. 04265 ADDR pData = (ADDR) (pControl + 1); 04266 04267 // Skip the class 04268 if ((*pData) & 0x80) 04269 pData++; 04270 else 04271 pData = (ADDR) MovePastWideStr((LPWSTR) pData); 04272 04273 // Skip the 'text' array 04274 pData = (ADDR) MovePastWideStr((LPWSTR) pData); 04275 04276 // Skip the creation data. 04277 BYTE Extra = *pData; 04278 pData++; 04279 04280 #endif 04281 04282 // Get end pointer and double-word align it. 04283 ADDR pEnd = (ADDR) pData; 04284 DWORD_ALIGN(pEnd); 04285 04286 // Compute size of control data and return it. 04287 ADDR pStart = (ADDR) pControl; 04288 pEnd += Extra; 04289 return (size_t) (pEnd - pStart); 04290 }
|
|
Given a ptr to DIALOGBOXHEADER, return its size. Scope: private.
Definition at line 4170 of file basebar2.cpp. 04171 { 04172 PORTNOTETRACE( "dialog", "BaseBar::CreateControlFromResource - do nothing - Resource usage" ); 04173 #ifndef EXCLUDE_FROM_XARALX 04174 // Move past the header 04175 ADDR pResult = (ADDR) (pHeader + 1); 04176 04177 // skip szMenuName 04178 04179 #if WIN32 04180 04181 pResult = (ADDR) MovePastWideStr((LPWSTR) pResult); 04182 04183 #else 04184 04185 switch (*pResult++) 04186 { 04187 // See SDK help file (Dialog Box Resource) for details 04188 case 0: 04189 break; 04190 04191 case 0xFF: 04192 pResult += 2; 04193 break; 04194 04195 default: 04196 pResult += camStrlen((LPTCHAR) (pResult)) + 1; 04197 break; 04198 } 04199 04200 #endif 04201 04202 // then skip szClassName 04203 04204 pResult = (ADDR) MovePastWideStr((LPWSTR) pResult); 04205 04206 // then the caption 04207 04208 pResult = (ADDR) MovePastWideStr((LPWSTR) pResult); 04209 04210 // then the font stuff 04211 if ((pHeader->style) & DS_SETFONT) 04212 pResult = (ADDR) MovePastWideStr((LPWSTR) (pResult + 2)); // skip font size too 04213 04214 DWORD_ALIGN(pResult); 04215 04216 // Compute the size of the header and return it. 04217 return (size_t) (pResult - ((ADDR) pHeader)); 04218 #else 04219 return 0; 04220 #endif 04221 }
|
|
Starts a Drag Scope: private.
Definition at line 4463 of file basebar2.cpp. 04464 { 04465 #pragma message( __LOCMSG__ "BaseBar::StartDrag - do nothing" ) 04466 TRACE( _T("Warning - BaseBar::StartDrag called") ); 04467 /*#ifdef STANDALONE 04468 #ifndef EXCLUDE_GALS 04469 // In StandAlone version we only let the user drag Galleries around 04470 if (!this->IsKindOf(RUNTIME_CLASS(GalleryBar))) 04471 { 04472 return; 04473 } 04474 #endif 04475 #endif 04476 04477 //ControlHelper::BubbleHelpDisable(); 04478 04479 // disable resizing of an empty bar 04480 if (TypeOfDrag != MOVE) 04481 { 04482 if (pOp->IsListEmpty()) 04483 return ; 04484 } 04485 04486 ScreenRect.SetRect(0,0,wxSystemSettings::GetMetric(SM_CXSCREEN),wxSystemSettings::GetMetric(SM_CYSCREEN)); 04487 04488 BorderOffset = wxPoint(0,0); 04489 04490 RECT rect; 04491 GetWindowRect(&rect); 04492 DragStartRect=rect; 04493 DragType = TypeOfDrag; 04494 CurrentBar = this; 04495 OldDragBarType = DragDockBarType = ParentDockBarType; 04496 04497 04498 04499 if (TypeOfDrag == GROW_SOUTH || TypeOfDrag == GROW_NORTH) 04500 { 04501 OILDockingBar* DockBar = GetMainFrame()->GetDockBar(DragDockBarType); 04502 if (DockBar->IsBigControls()) 04503 { 04504 WidestFloat = HorizontalLargeRect.GetWidth(); 04505 TallestFloat = VerticalLargeRect.GetHeight(); 04506 } 04507 else 04508 { 04509 WidestFloat = HorizontalSmallRect.GetWidth(); 04510 TallestFloat = VerticalSmallRect.GetHeight(); 04511 } 04512 CacheFormatingData(); 04513 } 04514 04515 switch (TypeOfDrag) 04516 { 04517 case MOVE : 04518 // Calculate drag offsets, used only by move drags 04519 DragOffset = wxPoint(point.x - rect.GetLeft(), point.y - rect.GetTop()); 04520 DragOffsetFromTop = TRUE; 04521 DragOffsetFromLeft = TRUE; 04522 CacheAllDockRects(); 04523 // Close any drop-down windows in this bar 04524 CloseCombos(); 04525 break; 04526 case GROW_WEST : 04527 BorderOffset = wxPoint(point.x - rect.GetLeft(),0); 04528 break; 04529 case GROW_EAST : 04530 BorderOffset = wxPoint(rect.GetRight() - point.x,0); 04531 break; 04532 case GROW_NORTH : 04533 BorderOffset = wxPoint(0,point.y - rect.GetTop()); 04534 break; 04535 case GROW_SOUTH : 04536 BorderOffset = wxPoint(0,rect.GetBottom() - point.y); 04537 break; 04538 case GROW_NORTHWEST : 04539 BorderOffset = wxPoint(point.x - rect.GetLeft(),point.y - rect.GetTop()); 04540 break; 04541 case GROW_NORTHEAST : 04542 BorderOffset = wxPoint(rect.GetRight() - point.x,point.y - rect.GetTop()); 04543 break; 04544 case GROW_SOUTHEAST : 04545 BorderOffset = wxPoint(rect.GetRight() - point.x,rect.GetBottom() - point.y); 04546 break; 04547 case GROW_SOUTHWEST : 04548 BorderOffset = wxPoint(point.x - rect.GetLeft(),rect.GetBottom() - point.y); 04549 break; 04550 } 04551 04552 // TRACEUSER( "Gerry", _T("DragPoint = (%d, %d)\n"), point.x, point.y); 04553 // TRACEUSER( "Gerry", _T("DragStartRect = (%d, %d) - (%d, %d)\n"), DragStartRect.GetLeft(), DragStartRect.top, DragStartRect.Width(), DragStartRect.GetHeight()); 04554 // TRACEUSER( "Gerry", _T("BorderOffset = (%d, %d)\n"), BorderOffset.x, BorderOffset.y); 04555 04556 SetCapture(); // Capture the mouse 04557 DragManagerOp::SetDragActive(TRUE); 04558 // Keep a copy of the rectangle so we can XOR it off 04559 OldDragRect = rect; 04560 PaintDragRect(OldDragRect,wxRect(0,0,0,0),DragDockBarType,DragDockBarType); */ 04561 }
|
|
To set the variable which stops us grabbing back the focus in mainframe if the bar / gallery hasn't been created.
Definition at line 454 of file basebar2.cpp. 00455 { 00456 DoingErrorBox = TRUE; 00457 }
|
|
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
Definition at line 5470 of file basebar2.cpp. 05471 { 05472 ERROR2IF(pCurrentCursor==NULL,FALSE,"Null last Cursor in SwapCursors"); 05473 ERROR2IF(CurrentCursorID==0,FALSE,"CurrentID 0 in SwapCursors"); 05474 05475 if(pCurrentCursor) 05476 { 05477 CursorStack::GPop(CurrentCursorID); 05478 delete pCurrentCursor; 05479 pCurrentCursor = NULL; 05480 CurrentCursorID = 0; 05481 } 05482 05483 pCurrentCursor = new Cursor(CursorID); 05484 05485 // Did the cursor create ok ? 05486 if (pCurrentCursor && pCurrentCursor->IsValid()) 05487 { 05488 CurrentCursorID = CursorStack::GPush(pCurrentCursor, TRUE); // Push cursor, and display now 05489 } 05490 else 05491 return FALSE; 05492 05493 return TRUE ; 05494 }
|
|
Tidy up Linefeeds and Separators after dragging controls.
Definition at line 1804 of file basebar2.cpp. 01805 { 01806 // nothing to tidy 01807 if(pOp->GetNumBarItems()==0) 01808 return TRUE; 01809 01810 // remove any SP's that preceed LF's 01811 BarItem * pBarItem = pOp->GetPtrBarHead(); 01812 while (pBarItem != NULL) 01813 { 01814 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))) 01815 { 01816 BarItem * pLastItem = pOp->GetPtrBarPrev(pBarItem); 01817 if(pLastItem) 01818 { 01819 if(pLastItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 01820 { 01821 pOp->RemoveBarItem(pLastItem); 01822 delete pLastItem; 01823 } 01824 } 01825 } 01826 pBarItem = pOp->GetPtrBarNext(pBarItem); 01827 } 01828 01829 // stip leading and multiple line feeds - we can get into this state after dragging controls around 01830 BOOL LF = FALSE; 01831 BOOL FoundControl=FALSE; 01832 BarItem * pLastControl = NULL; 01833 pBarItem = pOp->GetPtrBarHead(); 01834 01835 while (pBarItem != NULL) 01836 { 01837 // keep a record of the last control so that we can strip any trailing LFs 01838 if ( pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 01839 { 01840 pLastControl = pBarItem; 01841 FoundControl = TRUE; 01842 } 01843 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed))) 01844 { 01845 BarItem * pFoundItem = pBarItem; 01846 pBarItem = pOp->GetPtrBarNext(pBarItem); 01847 01848 // either it's a mulitiple (LF is set) or we haven't found any controls yet 01849 if(LF || !FoundControl) 01850 { 01851 pOp->RemoveBarItem(pFoundItem); 01852 delete pFoundItem; 01853 } 01854 else 01855 { 01856 if(FoundControl) 01857 LF = TRUE; 01858 } 01859 } 01860 else 01861 { 01862 LF = FALSE; 01863 pBarItem = pOp->GetPtrBarNext(pBarItem); 01864 } 01865 } 01866 01867 // stip leading and multiple Separators - we can get into this state after dragging controls around 01868 BOOL SP = FALSE; 01869 FoundControl=FALSE; 01870 pLastControl = NULL; 01871 pBarItem = pOp->GetPtrBarHead(); 01872 01873 while (pBarItem != NULL) 01874 { 01875 // keep a record of the last control so that we can strip any trailing SPs 01876 if ( pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl))) 01877 { 01878 pLastControl = pBarItem; 01879 FoundControl = TRUE; 01880 } 01881 if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarSeparator))) 01882 { 01883 BarItem * pFoundItem = pBarItem; 01884 pBarItem = pOp->GetPtrBarNext(pBarItem); 01885 // either it's a mulitiple (SP is set) or we haven't found any controls yet 01886 if(SP || !FoundControl) 01887 { 01888 pOp->RemoveBarItem(pFoundItem); 01889 delete pFoundItem; 01890 } 01891 else 01892 { 01893 if(FoundControl) 01894 SP = TRUE; 01895 } 01896 } 01897 else 01898 { 01899 SP = FALSE; 01900 pBarItem = pOp->GetPtrBarNext(pBarItem); 01901 } 01902 } 01903 01904 // we don't need anything after the last control 01905 // so.... move past it 01906 pLastControl = pOp->GetPtrBarNext(pLastControl); 01907 01908 // and delete the rest 01909 while(pLastControl) 01910 { 01911 BarItem * pItem = pLastControl; 01912 pLastControl = pOp->GetPtrBarNext(pLastControl); 01913 delete pOp->RemoveBarItem(pItem); 01914 } 01915 01916 return TRUE; 01917 };
|
|
called to tidy up at the end of a Bar drag
Definition at line 6874 of file basebar2.cpp. 06875 { 06876 PaintDragRect(OldDragRect,wxRect(0,0,0,0),OldDragBarType,DOCKBAR_FLOAT); 06877 InRecreate = TRUE; 06878 ReleaseMouse(); 06879 DragType = NONE; 06880 InRecreate = FALSE; 06881 CurrentBar = NULL; 06882 06883 #pragma message( __LOCMSG__ "Remove DragManagerOp::SetDragActive usage" ) 06884 // DragManagerOp::SetDragActive(FALSE); 06885 return TRUE; 06886 }
|
|
called to tidy up at the end of a control drag
Definition at line 6826 of file basebar2.cpp. 06827 { 06828 #pragma message( __LOCMSG__ "BaseBar::TidyUpControlDrag - do nothing" ) 06829 TRACE( _T("Warning - BaseBar::TidyUpControlDrag called") ); 06830 /* CtlDragState = NO_DRAG; 06831 DragManagerOp::SetDragActive(FALSE); 06832 06833 // if alt is still held down we should be ready to drag 06834 if(KeyPress::IsAlternativePressed()) 06835 CtlDragState = READY; 06836 06837 OldDragRect.SetRectEmpty(); 06838 // release mouse 06839 ReleaseCapture(); 06840 06841 InRecreate = FALSE; 06842 06843 GetMainFrame()->SetActiveWindow(); 06844 06845 CurrentBar = NULL; 06846 06847 ERROR2IF(pCurrentCursor==NULL,FALSE,"Null last Cursor in TidyUpControlDrag"); 06848 06849 if(pCurrentCursor!= NULL) 06850 { 06851 CursorStack::GPop(CurrentCursorID); 06852 delete pCurrentCursor; 06853 pCurrentCursor = NULL; 06854 CurrentCursorID = 0; 06855 } */ 06856 06857 return TRUE; 06858 }
|
|
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.
Definition at line 5516 of file basebar2.cpp. 05517 { 05518 #pragma message( __LOCMSG__ "BaseBar::WindowProc - do nothing" ) 05519 TRACE( _T("Warning - BaseBar::WindowProc called") ); 05520 /* // First send the message to the dialog manager 05521 DialogManager::SendDialogMessage(this, 05522 Message, 05523 wParam, 05524 lParam); 05525 05526 05527 // this checks to see whether this Window is still around 05528 // it is possible that the kernel just deleted this window 05529 // no further proceesing if this is the case ! 05530 if(!(IsWindow(GetSafeHwnd()))) return 0; 05531 // return brush for ctl3d 05532 switch(Message) 05533 { 05534 case WM_COMMAND: 05535 //TRACEUSER( "chris", _T("WM_COMMAND to %d\n"),GetSafeHwnd()); 05536 // user has closed down a combo list - return focus to mainframe 05537 if(HIWORD(wParam)==CBN_CLOSEUP) 05538 GetMainFrame()->SetFocus(); 05539 05540 break; 05541 #ifdef WIN32 05542 case WM_CTLCOLORBTN: 05543 case WM_CTLCOLORDLG: 05544 case WM_CTLCOLOREDIT: 05545 case WM_CTLCOLORLISTBOX: 05546 case WM_CTLCOLORMSGBOX: 05547 case WM_CTLCOLORSCROLLBAR: 05548 case WM_CTLCOLORSTATIC: 05549 #else 05550 case WM_CTLCOLOR: 05551 #endif 05552 HBRUSH hbrush = DoCtl3dCtlColorEx(Message, wParam, lParam); 05553 if (hbrush != NULL) 05554 return (LRESULT)hbrush; 05555 } 05556 // Now process the message normally 05557 return(wxWindow::WindowProc( Message, wParam, lParam )); */ 05558 05559 return 0; 05560 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|