GalleryBar Class Reference

A subclass of BaseBar that is the oil representation of a Gallery. More...

#include <galbar.h>

Inheritance diagram for GalleryBar:

BaseBar List of all members.

Public Member Functions

 GalleryBar ()
CSize GetGallerySize ()
afx_msg void OnNcCalcSize (BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR *lpncsp)
afx_msg void OnNcPaint ()
afx_msg UINT32 OnNcHitTest (CPoint point)
 Determines the part of window the point is over.
afx_msg void OnMouseMove (UINT32 nFlags, CPoint point)
afx_msg void OnNcLButtonDown (UINT32 nHitTest, CPoint point)
afx_msg BOOL OnMouseWheel (UINT32 nFlags, short zDelta, CPoint pt)
afx_msg LRESULT GetBarSize (WPARAM DockType, LPARAM ControlSize)
 To return a pointer to a rectangle of bar size.
afx_msg LRESULT SetGallerySize (WPARAM cx, LPARAM cy)
afx_msg LRESULT DoResize (WPARAM, LPARAM)
afx_msg LRESULT SetControlFocus (WPARAM, LPARAM State)

Protected Member Functions

void PaintWin95BarNonClient (BOOL IsActive)
virtual BOOL FormatBar (BOOL MoveWindows, ForceControlSize Force)
virtual BOOL FormatHorizontalBar (BOOL MoveWindows, ForceControlSize Force)
 Format a Horizontal toolbar with separators.
virtual BOOL FormatVerticalBar (BOOL MoveWindows, ForceControlSize Force)
 Format a Horizontal toolbar with separators.
virtual CRect SetBarSize (DockBarType BarType, BOOL DoRedraw=TRUE)
 Set the Window size.
virtual void AdjustFormattedBarSize (CSize *BarSize)
 Adjusts the proposed new size of a bar once formatting has taken place.
virtual BOOL PositionControls (BOOL DoRedraw=TRUE)
 Format and place controls according to docking bar type.
virtual INT32 CreateExtraControls ()
 Allows subclasses to create additional bar controls.
virtual void PositionExtraControls (CSize BarSize, INT32 xpos, INT32 ypos)
 Moves extra controls about once they have been created.
virtual BOOL SetStatusLineText ()
 actually put text on the status line
virtual BOOL GetStatusText (String_256 *StatusText)
 put stauts text in a buffer
virtual CRect GetFormatRect (DockBarType BarType)
 Get cached format size - if none available format and cache.

Private Attributes

CSize GallerySize
HWND ListBoxHWND
CFont * ListFont

Detailed Description

A subclass of BaseBar that is the oil representation of a Gallery.

Author:
Alex Bligh
Date:
22/6/94
See also:
GalleryBar

Definition at line 124 of file galbar.h.


Constructor & Destructor Documentation

GalleryBar::GalleryBar  ) 
 

Author:
Alex
Date:
1/7/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 210 of file galbar.cpp.

00210                        : BaseBar()
00211 {
00212     
00213     GallerySize.cx = 1; // This will make it appear at the minimum width for now
00214     GallerySize.cy = 256;
00215     ListBoxHWND = NULL;
00216     ListFont = FontFactory::GetCFont(STOCKFONT_GALLERYLIST);
00217 }


Member Function Documentation

void GalleryBar::AdjustFormattedBarSize CSize *  pBarSize  )  [protected, virtual]
 

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

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

Errors: -

See also:
GalleryBar::AdjustFormattedBarSize
This function adjust the size of a bar after the formatting has taken place.

The size of the formatted rectangle is in BarSize. We output the new bar size.

Definition at line 690 of file galbar.cpp.

00691 {
00692 //  TRACE( _T("AFBS BarSize (%d, %d)\n"), pBarSize->cx, pBarSize->cy);
00693 //  TRACE( _T("AFBS GalSize (%d, %d)\n"), GallerySize.cx, GallerySize.cy);
00694     GallerySize.cy = pBarSize->cy = MAX((pBarSize->cy + MINIMUM_GALLERY_HEIGHT), GallerySize.cy); 
00695 //  GallerySize.cy = pBarSize->cy = MAX(pBarSize->cy, GallerySize.cy); 
00696     GallerySize.cx = pBarSize->cx = MAX(pBarSize->cx, GallerySize.cx);
00697 //  INT32 Newx =  MAX(pBarSize->cx, GallerySize.cx);
00698 //  CRect Temp = GetFormatRect(DOCKBAR_BOTTOM);
00699 //  if(Newx >=Temp.Width())
00700 //        GallerySize.cx = pBarSize->cx =Newx;
00701     
00702     if (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
00703         ((SuperGallery * )pOp)->SetGallerySize(GallerySize);
00704 #ifdef _DEBUG
00705     else
00706         ERROR3("GalleryBar::AdjustFormattedBarSize - I'm not a SuperGallery!?!");
00707 #endif
00708 
00709 //  TRACE( _T("AFBS NewSize (%d, %d)\n"), pBarSize->cx, pBarSize->cy);
00710 }

INT32 GalleryBar::CreateExtraControls  )  [protected, virtual]
 

Allows subclasses to create additional bar controls.

Author:
Alex
Date:
1/7/94
Parameters:
None [INPUTS]
TRUE if successful, else FALSE [OUTPUTS]
Returns:
None

Errors: -

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

Reimplemented from BaseBar.

Definition at line 760 of file galbar.cpp.

00761 {
00762     OILDockingBar * ThisDock =GetMainFrame()->GetDockBar(ParentDockBarType);
00763 
00764     DWORD ExtraStyleFlags = 0;
00765     // Ask op if the list box can have multiple selections or not.
00766     if (pOp->AllowMulSelInListBox())
00767         ExtraStyleFlags = LBS_EXTENDEDSEL | LBS_MULTIPLESEL;
00768 
00769     HWND CreatedWindow = NULL;
00770     if (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
00771     {
00772         // Create a kernel-redrawn control for the list box of a SuperGallery
00773         CreatedWindow = ::CreateWindowEx(
00774                             //#if WIN32
00775                             //  pCurrentControl->dwExtendedStyle,
00776                             //#else
00777                                 0,
00778                             //#endif
00779                                "cc_DialogDraw",     // Class name
00780                                0,           // Window title
00781                                WS_BORDER | WS_CHILD |WS_VISIBLE,
00782                                0,
00783                                0,
00784                                10,
00785                                10, // Control gets resized anyway, but should be cleared up
00786                                GetSafeHwnd(),               // this window is its parent 
00787                                (HMENU)_R(IDC_GALLERY_LISTBOX),
00788                                AfxGetApp()->m_hInstance,
00789                                0 //pCreationData                
00790                                );
00791     }
00792 
00793 
00794     if (CreatedWindow == NULL) 
00795         return FALSE;
00796 
00797     Ctl3dSubClassCtl(CreatedWindow);
00798 
00799     ListBoxHWND = CreatedWindow;
00800    /*
00801     ControlHelpInfo Info;
00802     Info.pOpDesc = NULL;
00803     Info.BubbleID = _R(IDBBL_NOOP);
00804     Info.StatusID = 0;
00805     Info.Parent = GetSafeHwnd();
00806 
00807     ControlHelper::NotifyControlCreated(CreatedWindow,&Info); 
00808    */
00809 
00810     CSize NewGallerySize;
00811     
00812     if (pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
00813         NewGallerySize =((SuperGallery *) pOp)->GetGallerySize();
00814 
00815     if (NewGallerySize.cx == 0 && NewGallerySize.cy == 0)
00816     {
00817         NewGallerySize = pOp->GetBarRect().BottomRight();
00818     }
00819 
00820     if (NewGallerySize.cx > 0)
00821         GallerySize.cx = NewGallerySize.cx; 
00822     if (NewGallerySize.cy > 0)
00823         GallerySize.cy = NewGallerySize.cy; 
00824     ::SendMessage( CreatedWindow, WM_SETFONT, (WPARAM)ListFont->m_hObject, 0);
00825     return TRUE ;   
00826 
00827 }

afx_msg LRESULT GalleryBar::DoResize WPARAM  ,
LPARAM 
 

BOOL GalleryBar::FormatBar BOOL  MoveWindows,
ForceControlSize  ForceSize
[protected, virtual]
 

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/11/2004
Parameters:
MoveWindows - [INPUTS] ForceSize -
Returns:
TRUE if ok, FALSE if bother

Reimplemented from BaseBar.

Definition at line 1033 of file galbar.cpp.

01034 {
01035     BOOL bRetVal = FALSE;
01036     switch(ParentDockBarType)
01037     {
01038         case DOCKBAR_FLOAT:
01039             bRetVal = FormatFloatingBar(MoveWindows, ForceSize);
01040             break;
01041 
01042         case DOCKBAR_LEFT:
01043         case DOCKBAR_RIGHT:
01044             bRetVal = FormatVerticalBar(MoveWindows, ForceSize);
01045             break;
01046     }
01047     return(bRetVal);
01048 }   

BOOL GalleryBar::FormatHorizontalBar BOOL  MoveControls,
ForceControlSize  ForceSize
[protected, virtual]
 

Format a Horizontal toolbar with separators.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/94
Parameters:
[INPUTS] MoveWindows - flag to force a set window pos on the controls Force normally we use the current dock size to format the bar - sometimes however we need to know how big the bar would be large or small.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 1068 of file galbar.cpp.

01069 {
01070     return(TRUE);
01071 //  return(FormatFloatingBar(MoveControls, ForceSize));
01072 }

BOOL GalleryBar::FormatVerticalBar BOOL  MoveControls,
ForceControlSize  ForceSize
[protected, virtual]
 

Format a Horizontal toolbar with separators.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/94
Parameters:
[INPUTS] MoveWindows - flag to force a set window pos on the controls Force normally we use the current dock size to format the bar - sometimes however we need to know how big the bar would be large or small.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 1091 of file galbar.cpp.

01092 {
01093 //  return(FormatFloatingBar(MoveControls, ForceSize));
01094 
01095 //  TRACEUSER( "Gerry", _T("FormatVerticalBar\n"));
01096 
01097     HWND hcontrol;
01098     CSize BarSize(0,0);
01099     INT32 xpos = BAR_BORDERSIZE;
01100     INT32 ypos = BAR_BORDERSIZE;
01101     INT32 yOffset   = 0;
01102     INT32 MaxWidth = 0;
01103     INT32 DDeckerStart = 0;
01104     INT32 DDeckerEnd = 0;
01105 
01106     BarItem * pBarItem; 
01107     BarItem * LastItem = NULL;
01108 
01109     // Check Current Control Sizes in this Docking Bar
01110     INT32 ControlWidth = 0;
01111     INT32 ControlHeight = 0;
01112     ControlSizes ControlSize;
01113 
01114     DDeckerReadState DDeckerState = DDECKER_NONE;
01115     DDeckerControlHeights DDeckerHeight = SMALL_DDECKERS;
01116 
01117     //if we are dragging a bar check the size of the dock we are over
01118     // otherwise use control size of parent dock 
01119     OILDockingBar * ThisDock ;
01120     DockBarType CurrentType;
01121 
01122     CurrentType = (DragType==MOVE) ? DragDockBarType : ParentDockBarType; 
01123     ThisDock = GetMainFrame()->GetDockBar(CurrentType);
01124     
01125     BarItemType ThisControl;
01126     BarItemType LastControl = OTHERCONTROL;
01127 
01128     INT32 LargeWidth  = LARGEBUTTONWIDTH;
01129     INT32 LargeHeight = LARGEBUTTONHEIGHT;
01130     INT32 SmallWidth  = SMALLBUTTONWIDTH;
01131     INT32 SmallHeight = SMALLBUTTONHEIGHT;
01132     INT32 Control =0;
01133 
01134     // Get the current control size for this dock
01135     if (ForceSize == USE_BAR)
01136     {
01137         ForceSize = ThisDock->IsBigControls() ? FORCE_LARGE : FORCE_SMALL;
01138     }
01139 
01140     if (ForceSize == FORCE_LARGE)
01141     {
01142         ControlWidth = LargeWidth;
01143         ControlHeight = LargeHeight;        
01144 
01145     }
01146     else if (ForceSize == FORCE_SMALL)
01147     {
01148         ControlWidth = SmallWidth;
01149         ControlHeight = SmallHeight;        
01150     }
01151     
01152     
01153     if (ControlHeight == LargeHeight )
01154     {
01155         ControlSize = LARGE_CONTROLS;
01156         DDeckerHeight = LARGE_DDECKERS ;
01157     }
01158     else
01159     {
01160         ControlSize =  SMALL_CONTROLS;
01161         DDeckerHeight = SMALL_DDECKERS ;
01162     }           
01163     // if list is empty just set a minimum size 
01164     if (! pOp->IsListEmpty())
01165     {
01166 //      TRACEUSER( "chris", _T("\n --- FORMAT ---\n"));
01167         pBarItem = pOp->GetPtrBarHead(); 
01168 
01169         while (pBarItem != NULL)
01170         {
01171             ThisControl = GetEnumItemType(pBarItem);
01172             // Double Decker stuff...
01173             switch(ThisControl)
01174             {
01175                 case DECKER_TOP:
01176                 {
01177                     DDeckerState = DDECKER_TOP;
01178                     // xpos to come back to
01179                     DDeckerStart = xpos;
01180                 }
01181                 break;
01182                 case DECKER_BOTTOM:
01183                 {
01184                     DDeckerState = DDECKER_BOTTOM;
01185                     // extent of double decker
01186                     DDeckerEnd = xpos;
01187                     // go back to start
01188                     xpos = DDeckerStart;
01189                 
01190                 }
01191                 break;
01192                 case DECKER_END:
01193                 {
01194                     DDeckerState = DDECKER_NONE;
01195                     // check for longest line top or bottom ?
01196                     if(xpos < DDeckerEnd)
01197                         xpos = DDeckerEnd;
01198                 }
01199                 break;
01200                 case SEPARATOR:
01201                 // insert a separator normally this is horizontal but if the last control was
01202                 // a LineFeed we do a vertical separator
01203                 {
01204                     if(LastItem)
01205                     {
01206                         if (LastItem->IsKindOf(CC_RUNTIME_CLASS(BarLineFeed)))
01207                             ypos += SeparatorWidth;
01208                         else
01209                             xpos += SeparatorWidth;
01210                     }
01211 //                  TRACEUSER( "chris", _T("Separator\n"));
01212                 }
01213                 break;
01214                 case LINEFEED:
01215                 // move down to next line and reset xpos
01216                 {
01217                     ypos += ControlHeight+VERTICAL_SPACE;               // Move down to the next line
01218                     if(IS_CHICAGO && pOp->IsKindOf(CC_RUNTIME_CLASS(SuperGallery)))
01219                         ypos +=4;
01220                     xpos = BAR_BORDERSIZE;
01221                     DDeckerStart = xpos;
01222                 }
01223                 break;
01224             }
01225             if (pBarItem->IsKindOf(CC_RUNTIME_CLASS(BarControl)))
01226             {
01227 //              TRACEUSER( "chris", _T("Control\n"));
01228                 hcontrol=(HWND)((BarControl*)pBarItem)->GetWinID(); // Get the Window Handle
01229                 CRect WindSize;
01230 
01231                 ::GetClientRect(hcontrol,&WindSize);                // Get the window size
01232                 switch (DDeckerState)
01233                 {
01234                 case DDECKER_TOP:
01235                     if(ThisControl == SMALLBITMAPBUTTON)
01236                     {
01237                         if (ControlSize == LARGE_CONTROLS)
01238                             yOffset = (ControlHeight / 2) - sLARGEBUTTONHEIGHT +1; //get offset to center control
01239                         else
01240                             yOffset = (ControlHeight / 2) - sSMALLBUTTONHEIGHT +1;
01241                         xpos++;
01242                     }
01243                     else
01244                     {
01245 //                      yOffset = (ControlHeight / 2) - WindSize.Height()+1;
01246                         yOffset = (ControlHeight / 2) - DDeckerHeight + 1 ;
01247                     }
01248 
01249                     // bodge to center static text
01250                     if(ThisControl == STATIC)
01251                         yOffset +=3;
01252 
01253                     break;
01254                 case DDECKER_BOTTOM :
01255                     yOffset = (ControlHeight / 2) ; //get offset to center control
01256                     // bodge to center static text
01257                     if(ThisControl == STATIC)
01258                         yOffset +=3;
01259                     if ( ThisControl == SMALLBITMAPBUTTON)
01260                     {
01261                         yOffset ++ ;
01262                         xpos ++;
01263                     }
01264                     if(IS_CHICAGO)
01265                     {
01266                         yOffset ++;
01267                     }
01268                     break;
01269                 case DDECKER_NONE :
01270                     yOffset = (ControlHeight - WindSize.Height()) / 2; //get offset to center control
01271                     break;
01272                 }
01273                 
01274                 if (MoveControls)
01275                     ::SetWindowPos(hcontrol,NULL,xpos,ypos + yOffset,0,0,   // Move the control 
01276                                    SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOZORDER|SWP_NOREDRAW);
01277                 
01278                 xpos += WindSize.Width()-1;
01279                 if(ThisControl == STATICBITMAP)
01280                     xpos ++;
01281                 else if(ThisControl == SLIDER)
01282                     xpos +=4;
01283                 LastControl = ThisControl ;
01284 
01285                 if(IS_CHICAGO)
01286                 {
01287                     if(ThisControl == EDIT)
01288                         xpos += 2;
01289                 }
01290                 
01291             }               
01292 
01293             // keep MaxWidth up to date 
01294             if (xpos > MaxWidth)
01295                     MaxWidth = xpos;
01296 
01297             // remember last control
01298             LastItem = pBarItem;
01299 
01300             // move to next item
01301             pBarItem = pOp->GetPtrBarNext(pBarItem); 
01302         }
01303     
01304         // 
01305         BarSize.cx = MaxWidth + BAR_BORDERSIZE + (1 * 2) + 1 ;
01306         BarSize.cy = ypos + ControlHeight + BAR_BORDERSIZE + (1 * 2)  ;
01307 
01308     }       
01309     // Set a Minimum Bar Height
01310     if (BarSize.cy < ControlHeight + (BAR_BORDERSIZE)+ (1 * 2))
01311         BarSize.cy = ControlHeight + (BAR_BORDERSIZE)+ (1 * 2); 
01312 
01313     // ----------------------------
01314     // Set a Minimum Bar Width
01315 
01316     String_32 Name = pOp->GetName();
01317 
01318     INT32 SmallestWidth = ControlWidth + (BAR_BORDERSIZE * 2)+ (1 * 2);
01319 
01320     // If this an empty bar make sure we can see the title
01321     if (pOp->IsListEmpty())
01322     { 
01323         // Select the title font into a screen dc and get the text extent of the title
01324         CDC *dc = GetWindowDC();
01325 
01326         CFont * OldFont=dc->SelectObject(TitleFont);
01327 
01328         CSize TextSize=dc->GetTextExtent(Name,camStrlen(Name));
01329 
01330         dc->SelectObject(OldFont);
01331 
01332         ReleaseDC(dc);
01333 
01334         // Check that the title string will be visible UIC
01335         if ((TextSize.cx + TitleBarHeight + (1 * 4) ) > SmallestWidth)
01336             SmallestWidth = TextSize.cx + TitleBarHeight + (1 * 4);
01337     }
01338 
01339     
01340     if (BarSize.cx < SmallestWidth)
01341         BarSize.cx = SmallestWidth ;    
01342 
01343     AdjustFormattedBarSize(&BarSize);
01344     if (MoveControls) 
01345         PositionExtraControls(BarSize,xpos,ypos+ControlHeight);
01346 
01347     // Cache the rectangle
01348     if (ForceSize == FORCE_LARGE)
01349     {
01350         VerticalLargeRect.right = BarSize.cx;
01351         VerticalLargeRect.bottom = BarSize.cy + TitleBarHeight;
01352     }
01353     else if (ForceSize == FORCE_SMALL)
01354     {
01355         VerticalSmallRect.right = BarSize.cx;
01356         VerticalSmallRect.bottom = BarSize.cy + TitleBarHeight;
01357     }
01358     return TRUE;
01359 }

LRESULT GalleryBar::GetBarSize WPARAM  DockType,
LPARAM  ControlS
 

To return a pointer to a rectangle of bar size.

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

Errors: -

See also:
-

Definition at line 964 of file galbar.cpp.

00965 {
00966     DockBarType ThisDock = (DockBarType) DockType;
00967     ControlSizes ControlSize = (ControlSizes) ControlS;
00968 
00969     if (ThisDock == DOCKBAR_FLOAT)
00970     {
00971         if (ControlSize == LARGE_CONTROLS)
00972             return (LRESULT) &FloatLargeRect;
00973         else
00974             return (LRESULT) &FloatSmallRect;
00975     }
00976     else
00977     {
00978         if(ControlSize == LARGE_CONTROLS)
00979             return (LRESULT) &VerticalLargeRect ;
00980         else
00981             return (LRESULT) &VerticalSmallRect ; 
00982     }
00983 
00984     return(0);
00985 }

CRect GalleryBar::GetFormatRect DockBarType  BarType  )  [protected, virtual]
 

Get cached format size - if none available format and cache.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/5/94
Parameters:
DockBarType [INPUTS]
- [OUTPUTS]
Returns:
Cached Rectangle according to dock and control size

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 907 of file galbar.cpp.

00908 {
00909     OILDockingBar* DockBar = GetMainFrame()->GetDockBar(BarType);
00910     if (BarType == DOCKBAR_FLOAT)
00911     {
00912         OILDockingBar* DockBar = GetMainFrame()->GetDockBar(BarType);
00913         if (DockBar->IsBigControls())
00914         {
00915             if (FloatLargeRect.IsRectEmpty())
00916                 FormatFloatingBar(FALSE,FORCE_LARGE);
00917             return FloatLargeRect;
00918         }
00919         else
00920         {
00921             if (FloatSmallRect.IsRectEmpty())
00922                 FormatFloatingBar(FALSE,FORCE_SMALL);
00923             return FloatSmallRect;
00924         }
00925     }
00926     else
00927     {
00928         if (DockBar->IsBigControls())
00929         {
00930             if (VerticalLargeRect.IsRectEmpty())
00931                 FormatVerticalBar(FALSE,FORCE_LARGE);
00932             return VerticalLargeRect;
00933         }
00934         else
00935         {
00936             if (VerticalSmallRect.IsRectEmpty())
00937                 FormatVerticalBar(FALSE,FORCE_SMALL);
00938             return VerticalSmallRect;
00939         }
00940     }
00941 
00942     return CRect(0,0,0,0);
00943     
00944 //  return(BaseBar::GetFormatRect(BarType));
00945 //  return(CRect(0, 0, GallerySize.cx, GallerySize.cy));
00946 }

CSize GalleryBar::GetGallerySize void   )  [inline]
 

Definition at line 130 of file galbar.h.

00130 { return GallerySize;}

BOOL GalleryBar::GetStatusText String_256 StatusText  )  [protected, virtual]
 

put stauts text in a buffer

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the buffer is valid FALSE otherwise

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 878 of file galbar.cpp.

00879 {
00880     switch (DragType)
00881     {
00882         case    MOVE :
00883             * StatusText = String_256(_R(IDS_STATUSLINE_GALLERYDRAG)); 
00884             return TRUE;
00885         case    GROW_NORTH:
00886         case    GROW_SOUTH:
00887         case    GROW_EAST:
00888         case    GROW_WEST:
00889             * StatusText = String_256(_R(IDS_STATUSLINE_BARRESIZE)); 
00890             return TRUE;
00891         case NONE:
00892             return FALSE;
00893     }
00894 
00895     return FALSE;
00896 }

void GalleryBar::OnMouseMove UINT32  Flags,
CPoint  Point
 

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

Errors: -

See also:
-

Definition at line 248 of file galbar.cpp.

00249 {
00250 
00251     static INT32 LastFormatWidth=0;
00252     
00253     // always use screen co-ords 
00254     ClientToScreen(&Point); 
00255 
00256     // We are trying to start a drag
00257     if (DragType == TRYING)
00258     {
00259         if (CanStartDrag(Point))// Ok we have moved the mouse far enough from the start drag 
00260         {
00261             // release the mouse this will be captured again in StartDrag
00262             ReleaseCapture();
00263             // XOR the initial drag rectangle 
00264             PaintXORDragRect(OldDragRect,ParentDockBarType);
00265             //start the drag for real from the original point
00266             StartDrag(StartDragPoint,MOVE);
00267         }        
00268     }
00269     if (DragType != NONE && DragType != TRYING)
00270     {
00271         // A drag is taking place                       
00272         // Calculate the new drag rect
00273 //      TRACEUSER( "Gerry", _T("DragPoint     = (%d, %d)\n"), Point.x, Point.y);
00274 //      TRACEUSER( "Gerry", _T("GallerySize   = (%d, %d)\n"), GallerySize.cx, GallerySize.cy);
00275          
00276         CRect NewDragRect = OldDragRect;
00277 
00278         switch (DragType)
00279         {
00280             case MOVE:
00281             {
00282                 // Try out the shapes of horz and vert bars to see if the touch a
00283                 // docking bar...
00284                 DockBarType TempDockBarType = BarCloseToDock(Point);
00285                 if ( TempDockBarType != DOCKBAR_INVALID )
00286                 {
00287                     // Bar is close enough to dock to change shape...
00288                     DragDockBarType = TempDockBarType;              // Set new shape type
00289                     CalcDragOffsetDirection(DragDockBarType, Point);// Alter offset directions
00290                     DragOffset = CalcDragOffset(GetFormatRect(DragDockBarType),
00291                                                 Point,
00292                                                 DragOffsetFromLeft,
00293                                                 DragOffsetFromTop); // Calc new offsets
00294                 }
00295                 else /* bar floats either inside or outside */
00296                 {
00297                     // Don't change directions of offset into floating shape!
00298                     DragDockBarType = DOCKBAR_FLOAT;
00299                     DragOffset = CalcDragOffset(GetFormatRect(DragDockBarType),
00300                                                 Point,
00301                                                 DragOffsetFromLeft,
00302                                                 DragOffsetFromTop); // Calc new offsets
00303                 }
00304                 // Set the new bar outline rect according to whatever was computed above
00305                 // and position it on screen according to the cursor position and the
00306                 // offsets computed above...
00307                 NewDragRect = GetFormatRect(DragDockBarType);
00308                 NewDragRect.OffsetRect(Point.x-DragOffset.x,Point.y - DragOffset.y); 
00309 
00310 //              DragDockBarType = DOCKBAR_FLOAT;
00311 //              NewDragRect = GetFormatRect(DragDockBarType);
00312 //              NewDragRect.OffsetRect(Point.x-DragOffset.x,Point.y - DragOffset.y); 
00313                 break;
00314             }
00315 
00316             case GROW_NORTH:
00317             {
00318                 INT32 NewWidth;
00319 
00320                 GallerySize.cx = MAX(0,DragStartRect.right-DragStartRect.left);
00321 //              GallerySize.cy = MAX(0,DragStartRect.bottom-Point.y-TITLE_BAR_HEIGHT+BorderOffset.y);
00322                 GallerySize.cy = MAX(0,DragStartRect.bottom-Point.y-TITLE_BAR_HEIGHT);
00323                 NewWidth = GallerySize.cx ;// -((BAR_BORDERSIZE*2)+(BorderWidth*2));
00324                 FormatLineFeeds(NewWidth);
00325                 FormatBar(FALSE,USE_BAR);  
00326 
00327                 CRect Temp = GetFormatRect(DragDockBarType);
00328                 CRect TempNew(DragStartRect.left,
00329                               DragStartRect.bottom - Temp.Height(),
00330                               DragStartRect.left + Temp.Width(),
00331                               DragStartRect.bottom);
00332 
00333                 NewDragRect = TempNew; 
00334                 LastFormatWidth = NewWidth;
00335                 break;
00336             }
00337             case GROW_NORTHWEST:
00338             {
00339                 INT32 NewWidth;
00340 
00341                 GallerySize.cx = MAX(0,DragStartRect.right-Point.x+BorderOffset.x);
00342                 GallerySize.cy = MAX(0,DragStartRect.bottom-Point.y-TITLE_BAR_HEIGHT+BorderOffset.y);
00343                 NewWidth = GallerySize.cx ;//-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00344                 FormatLineFeeds(NewWidth);
00345                 FormatBar(FALSE,USE_BAR);  
00346 
00347                 CRect Temp = GetFormatRect(DragDockBarType);
00348                 CRect TempNew(DragStartRect.right - Temp.Width(),
00349                               DragStartRect.bottom - Temp.Height(),
00350                               DragStartRect.right,
00351                               DragStartRect.bottom);
00352 
00353                 NewDragRect = TempNew; 
00354                 LastFormatWidth = NewWidth;
00355                 break;
00356             }
00357             case GROW_NORTHEAST:
00358             {
00359                 INT32 NewWidth;
00360 
00361                 
00362                 GallerySize.cx = MAX(0,Point.x-DragStartRect.left+BorderOffset.x);
00363                 GallerySize.cy = MAX(0,DragStartRect.bottom-Point.y-TITLE_BAR_HEIGHT+BorderOffset.y);
00364                 NewWidth = GallerySize.cx ;//-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00365                 FormatLineFeeds(NewWidth);
00366                 FormatBar(FALSE,USE_BAR);  
00367 
00368                 CRect Temp = GetFormatRect(DragDockBarType);
00369                 CRect TempNew(DragStartRect.left,
00370                               DragStartRect.bottom - Temp.Height(),
00371                               DragStartRect.left + Temp.Width(),
00372                               DragStartRect.bottom);
00373 
00374 
00375                 NewDragRect = TempNew; 
00376                 LastFormatWidth = NewWidth;
00377                 break;
00378             }
00379             case GROW_SOUTH:
00380             {
00381                 INT32 NewWidth;
00382 
00383                 GallerySize.cx = MAX(0,DragStartRect.right-DragStartRect.left);
00384                 GallerySize.cy = MAX(0,Point.y-DragStartRect.top-TITLE_BAR_HEIGHT+BorderOffset.y);
00385                 NewWidth = GallerySize.cx ;//-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00386 
00387                 FormatLineFeeds(NewWidth);
00388                 FormatBar(FALSE,USE_BAR);  
00389                 CRect Temp = GetFormatRect(DragDockBarType);
00390                 Temp.OffsetRect(DragStartRect.left,DragStartRect.top); 
00391                 NewDragRect = Temp; 
00392                 LastFormatWidth = NewWidth;
00393                 break;
00394 
00395             }
00396             case GROW_SOUTHEAST:
00397             {
00398                 INT32 NewWidth;
00399 
00400                 GallerySize.cx = MAX(0,Point.x-DragStartRect.left+BorderOffset.x);
00401                 GallerySize.cy = MAX(0,Point.y-DragStartRect.top-TITLE_BAR_HEIGHT+BorderOffset.y);
00402         
00403                 NewWidth = GallerySize.cx ;//-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00404 
00405                 FormatLineFeeds(NewWidth);
00406                 FormatBar(FALSE,USE_BAR);  
00407                 CRect Temp = GetFormatRect(DragDockBarType);
00408                 Temp.OffsetRect(DragStartRect.left,DragStartRect.top); 
00409                 NewDragRect = Temp; 
00410                 LastFormatWidth = NewWidth;
00411                 break;
00412 
00413             }
00414     
00415             case GROW_SOUTHWEST:
00416             {
00417                 INT32 NewWidth;
00418 
00419                 GallerySize.cx = MAX(0,DragStartRect.right-Point.x+BorderOffset.x);
00420                 GallerySize.cy = MAX(0,Point.y-DragStartRect.top-TITLE_BAR_HEIGHT+BorderOffset.y);
00421         
00422                 NewWidth = GallerySize.cx ;//-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00423 
00424                 FormatLineFeeds(NewWidth);
00425                 FormatBar(FALSE,USE_BAR);  
00426                 
00427                 CRect Temp = GetFormatRect(DragDockBarType); 
00428                 CRect TempNew(DragStartRect.right - Temp.Width(),
00429                               DragStartRect.top,
00430                               DragStartRect.right,
00431                               DragStartRect.top + Temp.Height());
00432         
00433                 NewDragRect = TempNew; 
00434                 LastFormatWidth = NewWidth;
00435                 break; 
00436             }
00437                         
00438             case GROW_EAST:
00439             {
00440                 INT32 NewWidth;
00441 
00442                 GallerySize.cx = MAX(0,Point.x-DragStartRect.left+BorderOffset.x);
00443 //              GallerySize.cy = MAX(0,DragStartRect.bottom-DragStartRect.top-TITLE_BAR_HEIGHT);
00444                 NewWidth = GallerySize.cx; //-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00445 
00446                 FormatLineFeeds(NewWidth);
00447                 FormatBar(FALSE,USE_BAR);
00448                   
00449                 CRect Temp = GetFormatRect(DragDockBarType);
00450                 Temp.OffsetRect(DragStartRect.left,DragStartRect.top); 
00451                 NewDragRect = Temp; 
00452                 LastFormatWidth = NewWidth;
00453                 break; 
00454             }
00455 
00456             case GROW_WEST:
00457             {
00458                 INT32 NewWidth;
00459 
00460                 GallerySize.cx = MAX(0,DragStartRect.right-Point.x+BorderOffset.x);
00461 //              GallerySize.cy = MAX(0,DragStartRect.bottom-DragStartRect.top-TITLE_BAR_HEIGHT);
00462                 NewWidth = GallerySize.cx;  //-((BAR_BORDERSIZE*2)+(BorderWidth*2));
00463 
00464                 FormatLineFeeds(NewWidth);
00465                 FormatBar(FALSE,USE_BAR);  
00466                 
00467                 CRect Temp = GetFormatRect(DragDockBarType); 
00468                 CRect TempNew(DragStartRect.right - Temp.Width(),
00469                               DragStartRect.top,
00470                               DragStartRect.right,
00471                               DragStartRect.top + Temp.Height());
00472         
00473                 NewDragRect = TempNew; 
00474                 LastFormatWidth = NewWidth;
00475                 break; 
00476             }
00477 
00478         }
00479 
00480         if(NewDragRect!=OldDragRect)
00481         {
00482 //          TRACEUSER( "Gerry", _T("NewDragRect   = (%d, %d) - (%d, %d)\n"), NewDragRect.left, NewDragRect.top, NewDragRect.Width(), NewDragRect.Height());
00483 //          PaintDragRect(NewDragRect,OldDragRect,DOCKBAR_FLOAT,DOCKBAR_FLOAT);
00484             PaintDragRect(NewDragRect,OldDragRect,DragDockBarType,OldDragBarType);
00485             OldDragBarType=DragDockBarType;
00486             OldDragRect = NewDragRect; 
00487         }
00488     }
00489                                                       
00490 }

BOOL GalleryBar::OnMouseWheel UINT32  nFlags,
short  zDelta,
CPoint  pt
 

Definition at line 900 of file galbar.cpp.

00901 {
00902     TRACEUSER( "Matt", _T("MouseWheel scrolled in GalleryBar!\n"));
00903     return TRUE;
00904 }

void GalleryBar::OnNcCalcSize BOOL  bCalcValidRects,
NCCALCSIZE_PARAMS FAR *  lpncsp
 

Definition at line 1417 of file galbar.cpp.

01418 {
01419     if (CurrentDlgBarMode == DIALOG)
01420     {
01421         BaseBar::OnNcCalcSize(bCalcValidRects, lpncsp);
01422     }
01423     else
01424     {
01425         lpncsp->rgrc[0].left += 1;
01426         lpncsp->rgrc[0].top += TitleBarHeight + 1;  // UIC
01427         lpncsp->rgrc[0].right -= 1;
01428         lpncsp->rgrc[0].bottom -= 1;
01429 
01430 //      CWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
01431 //      lpncsp->rgrc[0].top += TitleBarHeight;
01432     }
01433 }

UINT32 GalleryBar::OnNcHitTest CPoint  point  ) 
 

Determines the part of window the point is over.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/11/2004
Parameters:
point - Screen coordinate of point to test [INPUTS]
Returns:

Definition at line 507 of file galbar.cpp.

00508 {
00509     if (DragType != NONE)
00510         return HTCLIENT; 
00511 
00512     if (CurrentDlgBarMode == DIALOG)
00513     {
00514         return(BaseBar::OnNcHitTest(point));
00515     }
00516     else
00517     {
00518         // Get the window dimensions
00519         CRect rect;
00520         GetWindowRect(&rect);
00521         CRect InsideBorderRect = rect;
00522         InsideBorderRect.InflateRect(-BorderWidth,-BorderWidth);
00523         CPoint NonClientPoint (point.x - rect.left, point.y - rect.top); 
00524 
00525 //      TRACE( _T("NcHitTest (%d, %d)\n"), NonClientPoint.x, NonClientPoint.y);
00526 
00527         // Determine what active area the cursor is over
00528         if (SysMenuRect.PtInRect(NonClientPoint))
00529         {
00530             return HTSYSMENU; 
00531         }
00532         else if (TopBorderRect.PtInRect(NonClientPoint))
00533         {
00534             return HTTOP; 
00535         }
00536         else if (BottomBorderRect.PtInRect(NonClientPoint))
00537         {
00538             return HTBOTTOM; 
00539         }
00540         else if (LeftBorderRect.PtInRect(NonClientPoint))
00541         {
00542             return HTLEFT; 
00543         }
00544         else if (RightBorderRect.PtInRect(NonClientPoint))
00545         {
00546             return HTRIGHT; 
00547         }
00548         else if (CaptionBarRect.PtInRect(NonClientPoint))
00549         {
00550             return HTCAPTION; 
00551         }
00552     }
00553 
00554     // Normal client area hit 
00555     return HTCLIENT; 
00556 }

void GalleryBar::OnNcLButtonDown UINT32  nHitTest,
CPoint  point
 

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

Errors: -

See also:
-

Definition at line 573 of file galbar.cpp.

00574 {
00575 
00576     ENSURE(DragType == NONE, "There should not be a drag going on"); 
00577     //SetFocus();
00578 //  if (CurrentDlgBarMode == DIALOG)
00579 //  {
00580         switch (nHitTest)
00581         {
00582             case HTCLIENT:
00583             {
00584                 CWnd::OnNcLButtonDown(nHitTest, point);
00585                 break;  
00586             }
00587         
00588             case HTSYSMENU:
00589             {
00590                 // Send a message to the GalleryBarOp to inform it that cancel has been selected
00591                 DialogMsg tmp(this->GetSafeHwnd(), DIM_CANCEL, NULL);
00592                 pOp->Message(&tmp); 
00593                 break;      
00594             }
00595 
00596             // The following hit test values all start a drag
00597 
00598             case HTCAPTION:
00599             {
00600                 StartDrag(point,MOVE); 
00601                 break; 
00602             }
00603 
00604             case HTTOP:
00605             {
00606                 StartDrag(point, GROW_NORTH); 
00607                 break; 
00608             }
00609 
00610             case HTBOTTOM:
00611             {
00612                 StartDrag(point, GROW_SOUTH); 
00613                 break; 
00614             }
00615 
00616             case HTLEFT:
00617             {
00618                 StartDrag(point, GROW_WEST); 
00619                 break; 
00620             }
00621 
00622             case HTRIGHT:
00623             {
00624                 StartDrag(point, GROW_EAST); 
00625                 break; 
00626             }
00627 
00628             
00629             case HTTOPLEFT:
00630             {
00631                 StartDrag(point, GROW_NORTHWEST); 
00632                 break; 
00633             }
00634 
00635             case HTBOTTOMLEFT:
00636             {
00637                 StartDrag(point, GROW_SOUTHWEST); 
00638                 break; 
00639             }
00640 
00641             case HTTOPRIGHT:
00642             {
00643                 StartDrag(point, GROW_NORTHEAST); 
00644                 break; 
00645             }
00646 
00647             case HTBOTTOMRIGHT:
00648             {
00649                 StartDrag(point, GROW_SOUTHEAST); 
00650                 break; 
00651             }
00652             default:
00653             {
00654                 ENSURE(FALSE,"Unknown Hit test value"); 
00655                 break;  
00656             }
00657 
00658         }
00659 //  }
00660 //  else 
00661 //  {
00662 //      // Don't do anything special with bar non client messages
00663 //      CWnd::OnNcLButtonDown(nHitTest, point);
00664 //  }
00665          
00666     return;     
00667 
00668 }

void GalleryBar::OnNcPaint  ) 
 

Definition at line 1405 of file galbar.cpp.

01406 {
01407     if (CurrentDlgBarMode == DIALOG)
01408     {
01409         PaintWin95DialogNonClient(Active);
01410     }
01411     else
01412     {
01413         PaintWin95BarNonClient(Active);
01414     }
01415 }

void GalleryBar::PaintWin95BarNonClient BOOL  IsActive  )  [protected]
 

Definition at line 1436 of file galbar.cpp.

01437 {
01438     // When the GalleryBar is in BAR mode we have to paint the fancy non-client area. 
01439 
01440     // Get the size of the window   
01441     CRect WinRect;
01442     GetWindowRect(&WinRect);
01443 
01444     // Set up the active non-client regions 
01445     SysMenuRect = CRect(WinRect.Width() - TitleBarHeight, 
01446                          3, 
01447                          WinRect.Width() - 2, 
01448                          TitleBarHeight);
01449 
01450 //  TRACE( _T("SMRG = (%d, %d)\n"), SysMenuRect.Width(), SysMenuRect.Height());
01451 
01452     TopBorderRect = CRect(0, 0, WinRect.Width(), 2);
01453 
01454     BottomBorderRect = CRect(0, WinRect.Height() - 2, WinRect.Width(), WinRect.Height());
01455 
01456     LeftBorderRect = CRect(0, 0, 2, WinRect.Height());
01457                          
01458     RightBorderRect = CRect(WinRect.Width() - 2, 0, WinRect.Width(), WinRect.Height());
01459 
01460     CaptionBarRect = CRect(1, 1, WinRect.Width() - 1, TitleBarHeight + 1);
01461 
01462     // Get a context onto the entire window area
01463     CDC *dc = GetWindowDC();
01464     
01465     // -------------------------------------------------------------------------------------
01466     // Paint the borders frame
01467 
01468 //  CRect WholeRect(0, 0, WinRect.Width(), WinRect.Height());
01469 //  CBrush TempBrush(GetSysColor(COLOR_INACTIVECAPTION));
01470 //  dc->FillRect(&WholeRect, &TempBrush);
01471 
01472 //  CBrush FrameBrush(GetSysColor(COLOR_BTNFACE));
01473 
01474 //  dc->FillRect(&TopBorderRect, &FrameBrush);
01475 //  dc->FillRect(&BottomBorderRect, &FrameBrush);
01476 //  dc->FillRect(&LeftBorderRect, &FrameBrush);
01477 //  dc->FillRect(&RightBorderRect, &FrameBrush);
01478     
01479     DWORD TopLeftCol = GetSysColor(COLOR_BTNHIGHLIGHT);
01480     DWORD BottomRightCol = GetSysColor(COLOR_BTNSHADOW);
01481 
01482     PatB(dc, 0, 0, 1, WinRect.Height(), TopLeftCol);
01483     
01484     PatB(dc, 0, 0, WinRect.Width(), 1, TopLeftCol);
01485     
01486     PatB(dc, WinRect.Width()-1, 0, 1, WinRect.Height(), BottomRightCol);
01487     
01488     PatB(dc, 0, WinRect.Height()-1, WinRect.Width(), 1, BottomRightCol);
01489 
01490     // Paint the caption
01491     // make sure that DrawCaption shows the correct title
01492     SetWindowText(pOp->GetName());
01493     
01494     UINT32 DrawFlags = DC_TEXT|DC_SMALLCAP;
01495     
01496     if (IsActive)
01497         DrawFlags |= DC_ACTIVE;
01498 
01499     // draw the caption
01500     ::DrawCaption(GetSafeHwnd(), dc->m_hDC, &CaptionBarRect, DrawFlags);
01501     
01502     // draw the new stretchy close button
01503     dc->DrawFrameControl(&SysMenuRect, DFC_CAPTION, DFCS_CAPTIONCLOSE);
01504 
01505     // Clean up release the DC
01506     ReleaseDC(dc) ;
01507     
01508 }   

BOOL GalleryBar::PositionControls BOOL  DoRedraw = TRUE  )  [protected, virtual]
 

Format and place controls according to docking bar type.

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

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 1003 of file galbar.cpp.

01004 {
01005     // Position the controls in the bar
01006     // We also format the other type of bar so that strange things
01007     // don't happen to the window size when docking/undocking
01008     switch(ParentDockBarType)
01009     {
01010     case DOCKBAR_FLOAT:
01011         FormatFloatingBar(TRUE,USE_BAR);
01012         FormatVerticalBar(FALSE,USE_BAR);
01013         pOp->SetCurrentOrientation(Horizontal); 
01014         break;
01015 
01016     case DOCKBAR_LEFT:
01017     case DOCKBAR_RIGHT:
01018         FormatVerticalBar(TRUE,USE_BAR);
01019         FormatFloatingBar(FALSE,USE_BAR);
01020         pOp->SetCurrentOrientation(Horizontal); 
01021         break;
01022     
01023     default:
01024         ENSURE(FALSE,"Unknown Parent DockBar");
01025     }
01026     // Size the window correctly but don't redraw
01027     if (DoRedraw)
01028         SetBarSize(ParentDockBarType, DoRedraw);
01029     return TRUE ;
01030 }

void GalleryBar::PositionExtraControls CSize  BarSize,
INT32  xpos,
INT32  ypos
[protected, virtual]
 

Moves extra controls about once they have been created.

Author:
Alex
Date:
1/7/94
Parameters:
Bar size record, x & y coord of current format position. [INPUTS]
- [OUTPUTS]
Returns:
None

Errors: -

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

Definition at line 732 of file galbar.cpp.

00733 {
00734     ::SetWindowPos(ListBoxHWND,NULL,
00735                     BAR_BORDERSIZE,
00736                     ypos + BAR_BORDERSIZE,
00737                     BarSize.cx - 2 * BAR_BORDERSIZE -  (BorderWidth * 2),
00738                     BarSize.cy-ypos - 2 * BAR_BORDERSIZE - (BorderWidth * 2),   // Move the control 
00739                     SWP_NOZORDER);
00740 }

CRect GalleryBar::SetBarSize DockBarType  BarType,
BOOL  DoRedraw = TRUE
[protected, virtual]
 

Set the Window size.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/5/94
Parameters:
BarType - type of dock the bar is attached to [INPUTS] Redraw - flag to indicate a redraw is needed
- [OUTPUTS]
Returns:
new size

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 1378 of file galbar.cpp.

01379 {
01380     CRect temp;
01381     if (BarType == DOCKBAR_FLOAT)
01382     {
01383         if (ParentDockBar->IsBigControls())     
01384             temp = FloatLargeRect;
01385         else
01386             temp = FloatSmallRect;
01387     }
01388     else
01389     {
01390         if (ParentDockBar->IsBigControls())     
01391             temp = VerticalLargeRect;
01392         else
01393             temp = VerticalSmallRect;
01394     }
01395 
01396     UINT32 flags = SWP_NOMOVE|SWP_NOZORDER;
01397     if (!DoRedraw)
01398         flags |= SWP_NOREDRAW;
01399     SetWindowPos(NULL,0,0,temp.right,temp.bottom,flags);
01400 
01401     return temp;
01402 }

afx_msg LRESULT GalleryBar::SetControlFocus WPARAM  ,
LPARAM  State
 

LRESULT GalleryBar::SetGallerySize WPARAM  cx,
LPARAM  cy
 

Definition at line 221 of file galbar.cpp.

00222 {
00223     // Set this gallery to be the new size
00224     GallerySize.cx = cx;
00225     GallerySize.cy = cy - TitleBarHeight;
00226 
00227     FormatLineFeeds(cx);
00228     PositionControls();
00229 
00230     return(0);
00231 }

BOOL GalleryBar::SetStatusLineText  )  [protected, virtual]
 

actually put text on the status line

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/11/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if I have put text on the StatusLine FALSE otherwise

Errors: -

See also:
-

Reimplemented from BaseBar.

Definition at line 843 of file galbar.cpp.

00844 {
00845     switch (DragType)
00846     {
00847         case    MOVE :
00848             GetApplication()->UpdateStatusBarText(&(String_256(_R(IDS_STATUSLINE_GALLERYDRAG))),FALSE); 
00849             return TRUE;
00850         case    GROW_NORTH:
00851         case    GROW_SOUTH:
00852         case    GROW_EAST:
00853         case    GROW_WEST:
00854             GetApplication()->UpdateStatusBarText(&(String_256(_R(IDS_STATUSLINE_BARRESIZE))),FALSE); 
00855             return TRUE;
00856         case NONE:
00857             return FALSE;
00858     }
00859 
00860     return FALSE;
00861 }


Member Data Documentation

CSize GalleryBar::GallerySize [private]
 

Definition at line 192 of file galbar.h.

HWND GalleryBar::ListBoxHWND [private]
 

Definition at line 193 of file galbar.h.

CFont* GalleryBar::ListFont [private]
 

Definition at line 194 of file galbar.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:54:40 2007 for Camelot by  doxygen 1.4.4