Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CResizeDlg Class Reference

#include <resizedlg.h>

Inheritance diagram for CResizeDlg:

CDlg CScaleDlg List of all members.

Public Member Functions

 CResizeDlg (int DlgID, HWND hWndParent, HINSTANCE hInst)
virtual ~CResizeDlg ()
virtual BOOL CALLBACK DlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)
 PROPERTY (int, NumCols)
 PROPERTY (int, NumRows)
 PROPERTY (BOOL, Annotate)
 PROPERTY (int, RowWeight)
 PROPERTY (int, ColWeight)
 PROPERTY (int, ControlCount)

Protected Member Functions

void SpecialRowCol ()
void DeterminNumberOfControls ()
virtual void DoChangePos (WINDOWPOS *lpwp)
int FindCol (int pos)
int FindRow (int pos)
void AddToSystemMenu ()
void DoInitDialog ()
void PlaceControls ()
LONG HitTest (LONG lCurrent)
virtual void DeterminWeights ()
void Annotate ()
void Sort (CEdge **, int iCount)
void WalkControls ()
virtual void ResizeControls (WORD width, WORD height)
void FindControls ()
void MakeAttatchments ()
void FindBorders ()
void FindCommonGuides ()
void DeterminCols (CEdge **ppEdges, int iCount)
void DeterminRows (CEdge **ppEdges, int iCount)
virtual void AddGripper ()
virtual HDWP SetGripperPos (HDWP hdwp)

Protected Attributes

CControlList m_ControlList
CParentInfo m_ParentInfo
CHANNELm_Rows
CHANNELm_Cols
HWND m_hwndGripper
SPECIAL m_SpecialRow
SPECIAL m_SpecialCol

Private Types

typedef CDlg BASECLASS

Member Typedef Documentation

typedef CDlg CResizeDlg::BASECLASS [private]
 

Reimplemented in CScaleDlg.

Definition at line 38 of file resizedlg.h.

Referenced by CResizeDlg().


Constructor & Destructor Documentation

CResizeDlg::CResizeDlg int  DlgID,
HWND  hWndParent,
HINSTANCE  hInst
 

Definition at line 56 of file resizedlg.cpp.

References BASECLASS, CResizeDlg(), FALSE, hInst, m_hwndGripper, and NULL.

Referenced by CResizeDlg().

00057 : BASECLASS(DlgID, hWndParent, hInst) 00058 { 00059 SetAnnotate(FALSE); 00060 SetRowWeight(0); 00061 SetColWeight(0); 00062 m_hwndGripper=NULL; 00063 }

CResizeDlg::~CResizeDlg  )  [virtual]
 

Definition at line 65 of file resizedlg.cpp.

00066 { 00067 00068 }


Member Function Documentation

void CResizeDlg::AddGripper  )  [protected, virtual]
 

Definition at line 1065 of file resizedlg.cpp.

References GetClientRect(), GetSystemMetrics(), CDlg::GetWindow(), m_hwndGripper, and NULL.

Referenced by DlgProc().

01066 { 01067 int g_cxGrip = GetSystemMetrics( SM_CXVSCROLL ); 01068 int g_cyGrip = GetSystemMetrics( SM_CYHSCROLL ); 01069 RECT rc; 01070 GetClientRect( GetWindow(), &rc); 01071 m_hwndGripper = CreateWindow( TEXT("Scrollbar"), 01072 NULL, 01073 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | 01074 WS_CLIPCHILDREN | SBS_BOTTOMALIGN | SBS_SIZEGRIP | 01075 SBS_SIZEBOXBOTTOMRIGHTALIGN, 01076 rc.right - g_cxGrip, 01077 rc.bottom - g_cyGrip, 01078 g_cxGrip, 01079 g_cyGrip, 01080 GetWindow(), 01081 (HMENU)-1, 01082 (HINSTANCE)GetWindowLong( GetWindow(), GWL_HINSTANCE ) , // g_hinst, 01083 NULL ); 01084 }

void CResizeDlg::AddToSystemMenu  )  [protected]
 

Definition at line 1038 of file resizedlg.cpp.

Referenced by DoInitDialog().

01039 { 01040 /* 01041 // 01042 // Get the system menu - add an annotate option to it? 01043 // 01044 HMENU hm=GetSystemMenu(GetWindow(), false); 01045 TCHAR szAnnotate[128]; 01046 LoadString( GetInstance(), IDS_ANNOTATE, szAnnotate, 128); 01047 MENUITEMINFO minfo={ 01048 sizeof(MENUITEMINFO), 01049 MIIM_ID | MIIM_TYPE, 01050 MFT_STRING, 01051 0, 01052 IDS_ANNOTATE, // ID 01053 NULL, // SubMenu 01054 NULL, // Checked 01055 NULL, // Unchecked 01056 0, // Item data - app specific 01057 szAnnotate, // Content of the menu item 01058 lstrlen(szAnnotate)+1// Length of menu item data 01059 }; 01060 01061 InsertMenuItem( hm, -1, TRUE, &minfo); 01062 */ 01063 }

void CResizeDlg::Annotate  )  [protected]
 

Definition at line 723 of file resizedlg.cpp.

References GetDC, CDlg::GetWindow(), GetWindowRect(), tagCHANNEL::iFixed, m_Cols, m_Rows, NULL, and ReleaseDC().

Referenced by DlgProc().

00724 { 00725 if(GetAnnotate()==false) 00726 return; 00727 00728 HDC hdc=GetDC( GetWindow() ); 00729 // 00730 // Draw all the control edges on the screen. 00731 // 00732 // m_ParentInfo.Annotate( hdc ); 00733 00734 // 00735 // Now show the cols/rows 00736 // 00737 int iCount=GetNumRows(); 00738 int i; 00739 RECT r; 00740 GetWindowRect( GetWindow(), &r); 00741 int iWidth=r.right - r.left; 00742 int iHeight=r.bottom - r.top; 00743 00744 HPEN hFixedPen = CreatePen( PS_SOLID, 2, RGB( 0x00,0x00,0xff) ); 00745 HPEN hSizePen = CreatePen( PS_SOLID, 2, RGB( 0x00,0xff,0x00) ); 00746 HGDIOBJ holdPen= SelectObject( hdc, hFixedPen); 00747 00748 // 00749 // Horizontal lines 00750 // 00751 for(i=0;i<=iCount;i++) 00752 { 00753 if(m_Rows[i].iFixed >= 0 ) 00754 SelectObject( hdc, hSizePen ); 00755 else 00756 SelectObject( hdc, hFixedPen ); 00757 MoveToEx( hdc, 0, m_Rows[i].Pos, NULL ); 00758 LineTo( hdc, iWidth , m_Rows[i].Pos ); 00759 } 00760 00761 // 00762 // Vertical lines 00763 // 00764 iCount = GetNumCols(); 00765 for(i=0;i<=iCount;i++) 00766 { 00767 if(m_Cols[i].iFixed >= 0 ) 00768 SelectObject( hdc, hSizePen ); 00769 else 00770 SelectObject( hdc, hFixedPen ); 00771 MoveToEx( hdc, m_Cols[i].Pos, 0, NULL ); 00772 LineTo( hdc, m_Cols[i].Pos, iHeight ); 00773 } 00774 00775 SelectObject(hdc, holdPen); 00776 DeleteObject(hFixedPen); 00777 DeleteObject(hSizePen); 00778 00779 ReleaseDC( GetWindow(), hdc ); 00780 }

void CResizeDlg::DeterminCols CEdge **  ppEdges,
int  iCount
[protected]
 

Definition at line 522 of file resizedlg.cpp.

References DeterminCols(), FALSE, CEdge::GetPosition(), tagCHANNEL::iFixed, tagCHANNEL::iWeight, L, LEFT_AT, m_Cols, MIN_COL_SPACE, tagCHANNEL::Pos, RIGHT_AT, tagCHANNEL::Size, and TRACE.

Referenced by DeterminCols(), and FindCommonGuides().

00523 { 00524 // 00525 // First pass is just to work out positions of edges, 00526 // and if those edges constitute Columns. 00527 // 00528 int i; 00529 int iCols=0; 00530 int iLastGuide; 00531 int iThisGuide; 00532 int * iPos = new int[iCount]; // where the edges are 00533 iPos[0]=ppEdges[0]->GetPosition(); // we always use the first edge. 00534 int iLastPos=0; 00535 for(i=1; i<iCount;i++) 00536 { 00537 iThisGuide=ppEdges[i]->Attatchment() ; 00538 iLastGuide=ppEdges[i-1]->Attatchment(); 00539 TRACE(L"Edge:%02d - Attatched as %02d\n", i, iThisGuide); 00540 00541 // 00542 // Column between these two controls 00543 // 00544 if( (iLastGuide & RIGHT_AT ) && ( iThisGuide & LEFT_AT ) ) 00545 { 00546 iCols++; 00547 iPos[iCols] = ppEdges[i-1]->GetPosition() + ((ppEdges[i]->GetPosition() - ppEdges[i-1]->GetPosition())/2); 00548 continue; 00549 } 00550 00551 // 00552 // If we're starting another left edge of a control, needs a new guide 00553 // 00554 if( (iThisGuide & LEFT_AT ) ) 00555 { 00556 iCols++; 00557 iPos[iCols]= ppEdges[i]->GetPosition(); 00558 continue; 00559 } 00560 00561 // 00562 // If this is the last right edge 00563 // 00564 if( (iThisGuide & RIGHT_AT ) && ((i+1)==iCount) ) 00565 { 00566 iCols++; 00567 iPos[iCols] = ppEdges[i]->GetPosition() ; 00568 continue; // just incase you add anytyhing below 00569 } 00570 } 00571 00572 00573 // 00574 // Second pass is to make up the column information 00575 // we don't allow narrow colums, that is columns who are <2 appart. 00576 // 00577 TRACE(L"Column Widths are ...\n"); 00578 SetNumCols( iCols ); // 0 through n are USED. Not n-1 00579 m_Cols = new CHANNEL[iCols+1]; 00580 m_Cols[0].Pos=iPos[0]; 00581 iLastPos=0; 00582 int iThisCol=1; 00583 for(int iThisPos=1;iThisPos<=iCols;iThisPos++) 00584 { 00585 int iWidth=iPos[iThisPos]-iPos[iLastPos]; 00586 if( iWidth >= MIN_COL_SPACE ) 00587 { 00588 m_Cols[iThisCol].Pos = iPos[iThisPos]; 00589 m_Cols[iThisCol-1].Size = iWidth; 00590 m_Cols[iThisCol-1].iWeight=0; 00591 m_Cols[iThisCol-1].iFixed=FALSE; 00592 /* 00593 TRACE(L"Col:%02d Width:%03d Pos:%03d\n", 00594 iThisCol-1, 00595 m_Cols[iThisCol-1].Size, 00596 m_Cols[iThisCol-1].Pos); 00597 */ 00598 iLastPos=iThisPos; 00599 iThisCol++; 00600 } 00601 else 00602 { 00603 // TRACE(L"Skipping col #%d as it's only %d wide\n",iThisPos,iWidth); 00604 } 00605 } 00606 #ifdef _DEBUG 00607 if( (iThisCol-1) != iCols ) 00608 TRACE(L"Skipped %d rows\n",iThisCol-1-iCols); 00609 #endif 00610 SetNumCols( iThisCol-1 ); 00611 00612 delete [] iPos; 00613 }

void CResizeDlg::DeterminNumberOfControls  )  [protected]
 

Definition at line 1230 of file resizedlg.cpp.

References CDlg::GetWindow().

01231 { 01232 int iControlCount=0; 01233 HWND hCurrent; 01234 HWND hFirst; 01235 hCurrent=hFirst=::GetWindow(GetWindow(),GW_CHILD); 01236 if( hFirst ) 01237 { 01238 do { 01239 iControlCount++; 01240 } while (hCurrent=::GetWindow(hCurrent,GW_HWNDNEXT)); 01241 } 01242 m_ControlCount=iControlCount; 01243 }

void CResizeDlg::DeterminRows CEdge **  ppEdges,
int  iCount
[protected]
 

Definition at line 625 of file resizedlg.cpp.

References BOTTOM_AT, DeterminRows(), FALSE, CEdge::GetPosition(), tagCHANNEL::iFixed, tagCHANNEL::iWeight, L, m_Rows, MIN_ROW_SPACE, tagCHANNEL::Pos, tagCHANNEL::Size, TOP_AT, and TRACE.

Referenced by DeterminRows(), and FindCommonGuides().

00626 { 00627 int i; 00628 int iRows=0; 00629 int iLastGuide; 00630 int iThisGuide; 00631 int * iPos = new int[iCount]; 00632 00633 // 00634 // brute force, each edge is a row. 00635 // 00636 iRows=0; 00637 iPos[0]=ppEdges[0]->GetPosition(); 00638 int iLastPos=0; 00639 for(i=1; i<iCount;i++) 00640 { 00641 iThisGuide=ppEdges[i]->Attatchment() ; 00642 iLastGuide=ppEdges[i-1]->Attatchment(); 00643 TRACE(L"Edge:%02d - Attatched as %02d pos:%03d\n", i, iThisGuide, ppEdges[i]->GetPosition() ); 00644 00645 // 00646 // row between these two controls 00647 // 00648 if( (iLastGuide & BOTTOM_AT ) && ( iThisGuide & TOP_AT ) ) 00649 { 00650 iRows++; 00651 iPos[iRows] = ppEdges[i-1]->GetPosition() + ((ppEdges[i]->GetPosition() - ppEdges[i-1]->GetPosition())/2); 00652 continue; 00653 } 00654 00655 // 00656 // If we're starting another left edge of a control, needs a new guide 00657 // 00658 if( (iThisGuide & TOP_AT ) ) 00659 { 00660 iRows++; 00661 iPos[iRows]= ppEdges[i]->GetPosition(); 00662 continue; 00663 } 00664 00665 // 00666 // If this is the last right edge 00667 // 00668 if( (iThisGuide & BOTTOM_AT ) && ((i+1)==iCount) ) 00669 { 00670 iRows++; 00671 iPos[iRows] = ppEdges[i]->GetPosition() ; 00672 continue; // just incase you add anytyhing below 00673 } 00674 } 00675 00676 // 00677 // Second pass is to make up the column information 00678 // we don't allow narrow colums, that is columns who are <2 appart. 00679 // 00680 TRACE(L"Rowumn Widths are ...\n"); 00681 SetNumRows( iRows ); // 0 through n are USED. Not n-1 00682 m_Rows = new CHANNEL[iRows+1]; 00683 m_Rows[0].Pos=iPos[0]; 00684 iLastPos=0; 00685 int iThisRow=1; 00686 for(int iThisPos=1;iThisPos<=iRows;iThisPos++) 00687 { 00688 int iWidth=iPos[iThisPos]-iPos[iLastPos]; 00689 if( iWidth >= MIN_ROW_SPACE ) 00690 { 00691 m_Rows[iThisRow].Pos = iPos[iThisPos]; 00692 m_Rows[iThisRow-1].Size = iWidth; 00693 m_Rows[iThisRow-1].iWeight=0; 00694 m_Rows[iThisRow-1].iFixed=FALSE; 00695 /* 00696 TRACE(L"Row:%02d Width:%03d Pos:%03d\n", 00697 iThisRow-1, 00698 m_Rows[iThisRow-1].Size, 00699 m_Rows[iThisRow-1].Pos); 00700 */ 00701 iLastPos=iThisPos; 00702 iThisRow++; 00703 } 00704 else 00705 { 00706 // TRACE(L"Skipping Row #%d as it's only %d wide\n",iThisPos,iWidth); 00707 } 00708 } 00709 #ifdef _DEBUG 00710 if( (iThisRow-1) != iRows ) 00711 TRACE(L"Skipped %d rows\n",iThisRow-1-iRows); 00712 #endif 00713 SetNumRows( iThisRow-1 ); 00714 00715 delete [] iPos; 00716 }

void CResizeDlg::DeterminWeights  )  [protected, virtual]
 

Reimplemented in CScaleDlg.

Definition at line 821 of file resizedlg.cpp.

References tagCHANNEL::iFixed, tagCHANNEL::iWeight, m_Cols, and m_Rows.

Referenced by FindCommonGuides().

00822 { 00823 int iColWeight=0; 00824 { 00825 for( int fi=0;fi<= GetNumCols(); fi++) 00826 m_Cols[ fi ].iFixed<0 ? 0: iColWeight+=m_Cols[fi].iWeight; 00827 } 00828 int iRowWeight=0; 00829 { 00830 for( int fi=0;fi<= GetNumRows(); fi++) 00831 m_Rows[ fi ].iFixed<0 ? 0: iRowWeight+=m_Rows[fi].iWeight; 00832 } 00833 SetColWeight(iColWeight); 00834 SetRowWeight(iRowWeight); 00835 }

BOOL CALLBACK CResizeDlg::DlgProc HWND  hDlg,
UINT  uMessage,
WPARAM  wParam,
LPARAM  lParam
[virtual]
 

Reimplemented from CDlg.

Definition at line 75 of file resizedlg.cpp.

References AddGripper(), Annotate(), BOOL, DefWindowProc(), DlgProc(), DoChangePos(), DoInitDialog(), FALSE, GetWindowRect(), HitTest(), NULL, ResizeControls(), SetWindowPos, TRUE, and UINT.

Referenced by DlgProc().

00076 { 00077 switch( uMessage ) 00078 { 00079 case WM_NCHITTEST: 00080 { 00081 // Because we always turn on the resize frame, we must always hit test. 00082 // if( (GetRowWeight() !=0 ) || (GetColWeight() != 0 ) ) 00083 { 00084 // call def window proc to see what he wants to do 00085 LONG lRes= HitTest( DefWindowProc( hDlg, uMessage, wParam, lParam ) ); 00086 if( lRes != (HTERROR-1) ) 00087 { 00088 SetWindowLong( hDlg, DWL_MSGRESULT, lRes ); 00089 return TRUE; 00090 } 00091 } 00092 } 00093 break; 00094 00095 case WM_WINDOWPOSCHANGING: 00096 if( (GetRowWeight() !=0 ) || (GetColWeight() != 0 ) ) 00097 DoChangePos( (WINDOWPOS*)lParam); 00098 break; 00099 00100 case WM_ERASEBKGND: 00101 /* 00102 if( (GetRowWeight() !=0 ) || (GetColWeight() != 0 ) ) 00103 { 00104 HDC hdc=(HDC)wParam; 00105 RECT rcWindow; 00106 GetClientRect(hDlg, &rcWindow); 00107 int g_cxGrip = GetSystemMetrics( SM_CXVSCROLL ); 00108 int g_cyGrip = GetSystemMetrics( SM_CYHSCROLL ); 00109 rcWindow.left = rcWindow.right - g_cxGrip; // pWState->x_VSBArrow; 00110 rcWindow.top = rcWindow.bottom - g_cyGrip; // pWState->y_HSBArrow; 00111 DrawFrameControl(hdc, &rcWindow, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); 00112 } 00113 */ 00114 break; 00115 00116 case WM_INITDIALOG: 00117 SetWindow(hDlg); 00118 DoInitDialog(); 00119 // Re-adjusts the dialogs to what we think they should be 00120 // breaks some apps who are completely owner draw. 00121 if( (GetRowWeight() !=0 ) || (GetColWeight() != 0 ) ) 00122 { 00123 AddGripper(); // need to sit on the size meesage too. 00124 RECT r; 00125 GetWindowRect( hDlg, &r); 00126 SetWindowPos( 00127 NULL, NULL, 0,0, r.right - r.left, r.bottom - r.top, 00128 SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOOWNERZORDER | 00129 SWP_NOREDRAW | SWP_NOZORDER ); 00130 } 00131 return TRUE; 00132 break; 00133 00134 case WM_SIZE: 00135 if( (GetRowWeight() !=0 ) || (GetColWeight() != 0 ) ) 00136 { 00137 // Don't try to re-adjust to the size when initially shown. 00138 if( wParam == SIZE_RESTORED ) 00139 { 00140 WINDOWPOS pos={NULL, NULL, 0,0, LOWORD(lParam), HIWORD(lParam), 00141 SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOOWNERZORDER | 00142 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOZORDER }; 00143 DoChangePos( &pos ); 00144 ResizeControls(LOWORD( lParam ) , HIWORD (lParam) ); 00145 } 00146 } 00147 break; 00148 00149 case WM_PAINT: 00150 Annotate(); 00151 break; 00152 } 00153 return FALSE; 00154 }

void CResizeDlg::DoChangePos WINDOWPOS *  lpwp  )  [protected, virtual]
 

Reimplemented in CScaleDlg.

Definition at line 999 of file resizedlg.cpp.

References DIMENSION, DoChangePos(), FALSE, CDlg::GetWindow(), GetWindowRect(), tagDIMENSION::Height, m_ParentInfo, and tagDIMENSION::Width.

Referenced by DlgProc(), and DoChangePos().

01000 { 01001 if((lpwp->flags & SWP_NOSIZE) == FALSE) 01002 { 01003 // 01004 // We're being sized - size in screen area (ie. included title bar) 01005 // m_ParentInfo EXCLUDES title bar. 01006 // 01007 RECT r; 01008 GetWindowRect( GetWindow(), &r ); 01009 if( GetRowWeight() <= 0 ) 01010 lpwp->cy=r.bottom- r.top; 01011 if( GetColWeight() <= 0 ) 01012 lpwp->cx=r.right - r.left; 01013 DIMENSION dMin= m_ParentInfo.GetMinimumSize(); 01014 if( lpwp->cx < dMin.Width ) 01015 lpwp->cx=dMin.Width; 01016 if( lpwp->cy < dMin.Height ) 01017 lpwp->cy=dMin.Height; 01018 } 01019 }

void CResizeDlg::DoInitDialog  )  [protected]
 

Definition at line 1026 of file resizedlg.cpp.

References AddToSystemMenu(), CParentInfo::GetHeight(), CParentInfo::GetWidth(), m_ParentInfo, ResizeControls(), and WalkControls().

Referenced by DlgProc().

01027 { 01028 AddToSystemMenu(); 01029 WalkControls(); 01030 ResizeControls( (WORD)m_ParentInfo.GetWidth() , (WORD)m_ParentInfo.GetHeight() ); 01031 }

void CResizeDlg::FindBorders  )  [protected]
 

Definition at line 228 of file resizedlg.cpp.

00229 { 00230 }

int CResizeDlg::FindCol int  pos  )  [protected]
 

Definition at line 804 of file resizedlg.cpp.

References FindCol(), m_Cols, and tagCHANNEL::Pos.

Referenced by FindCol(), and PlaceControls().

00805 { 00806 int i=0; 00807 while( i<=GetNumCols() ) 00808 { 00809 if( m_Cols[i].Pos > pos ) 00810 return i-1; 00811 i++; 00812 } 00813 return GetNumCols(); 00814 }

void CResizeDlg::FindCommonGuides  )  [protected]
 

Definition at line 426 of file resizedlg.cpp.

References CEdge::Attatchment(), CGuide::Attatchment(), DeterminCols(), DeterminRows(), DeterminWeights(), CEdge::GetControlCount(), CEdge::GetGuide(), CParentInfo::GetHorizontalEdges(), CParentInfo::GetNumHoriz(), CParentInfo::GetNumVert(), CEdge::GetPosition(), CParentInfo::GetVerticalEdges(), L, m_ParentInfo, CGuide::NumAttatchments(), PlaceControls(), Sort(), and TRACE.

Referenced by WalkControls().

00427 { 00428 CEdge ** ppVert = m_ParentInfo.GetVerticalEdges(); 00429 CEdge ** ppHoriz = m_ParentInfo.GetHorizontalEdges(); 00430 00431 // 00432 // Work out which guides are used in columns. 00433 // 00434 int iCount,i; 00435 iCount=m_ParentInfo.GetNumVert(); 00436 Sort(ppVert, iCount ); 00437 #ifdef _DEBUG 00438 TRACE(L"Vertical edge information %d edges\n", iCount ); 00439 for(i=0;i<iCount;i++) 00440 { 00441 CEdge * pEdge=ppVert[i]; 00442 TRACE(L"Edge %02d: Edge@%02d times as 0x%02x, position %08d, Guide@%03d\n", 00443 i, pEdge->GetControlCount(), 00444 pEdge->GetGuide()->Attatchment(), 00445 pEdge->GetPosition(), 00446 pEdge->GetGuide()->NumAttatchments() 00447 ); 00448 } 00449 #endif 00450 00451 iCount=m_ParentInfo.GetNumHoriz(); 00452 Sort(ppHoriz, iCount ); 00453 #ifdef _DEBUG 00454 TRACE(L"Horiz edge information %d edges\n", iCount ); 00455 for(i=0;i<iCount;i++) 00456 { 00457 CEdge * pEdge=ppHoriz[i]; 00458 CGuide * pGuide=pEdge->GetGuide(); 00459 TRACE(L"Edge %02d: Edge@%02d times as 0x%02x, position %08d, Guide@%03d\n",i, 00460 pEdge->GetControlCount(), 00461 pEdge->Attatchment(), 00462 pGuide->GetPosition(), 00463 pEdge->GetGuide()->NumAttatchments() 00464 ); 00465 } 00466 #endif 00467 00468 // 00469 // Determin rows and columns 00470 // 00471 DeterminCols( ppVert, m_ParentInfo.GetNumVert() ); 00472 DeterminRows( ppHoriz, m_ParentInfo.GetNumHoriz() ); 00473 PlaceControls(); 00474 00475 delete [] ppVert; 00476 delete [] ppHoriz; 00477 00478 DeterminWeights(); 00479 }

void CResizeDlg::FindControls  )  [protected]
 

Definition at line 178 of file resizedlg.cpp.

References CDPA::Append(), CParentInfo::GetBottom(), CParentInfo::GetLeft(), CResizeControl::GetLocation(), CParentInfo::GetRight(), CParentInfo::GetTop(), CDlg::GetWindow(), L, m_ControlList, m_ParentInfo, TRACE, and CResizeControl::Valid().

Referenced by WalkControls().

00179 { 00180 HWND hCurrent; 00181 HWND hFirst; 00182 hCurrent=hFirst=::GetWindow(GetWindow(),GW_CHILD); 00183 TRACE(L"FindControls on 0x%0x\n", GetWindow() ); 00184 TRACE(L"Parent size is %d,%d by %d,%d\n", 00185 m_ParentInfo.GetLeft(), 00186 m_ParentInfo.GetTop(), 00187 m_ParentInfo.GetRight(), 00188 m_ParentInfo.GetBottom() ); 00189 00190 if( hFirst ) 00191 { 00192 do { 00193 CResizeControl * pC = new CResizeControl(hCurrent, m_ParentInfo); 00194 if( pC->Valid() ) 00195 { 00196 // 00197 // Make sure the control is wihin the bounds of our parent. 00198 // 00199 RECT r=pC->GetLocation(); 00200 TRACE(L"Control size is %d,%d by %d,%d\n", 00201 r.left, 00202 r.top, 00203 r.right, 00204 r.bottom); 00205 if( (r.right > m_ParentInfo.GetRight()) || 00206 (r.bottom > m_ParentInfo.GetBottom()) || 00207 (r.top < m_ParentInfo.GetTop()) || 00208 (r.left < m_ParentInfo.GetLeft()) ) 00209 { 00210 TRACE(L"Punting this control %s\n", pC->GetClassName() ); 00211 delete pC; // we don't play with these. 00212 } 00213 else 00214 m_ControlList.Append(pC); 00215 } 00216 else 00217 delete pC; 00218 } while (hCurrent=::GetWindow(hCurrent,GW_HWNDNEXT)); 00219 } 00220 }

int CResizeDlg::FindRow int  pos  )  [protected]
 

Definition at line 787 of file resizedlg.cpp.

References FindRow(), m_Rows, and tagCHANNEL::Pos.

Referenced by FindRow(), and PlaceControls().

00788 { 00789 int i=0; 00790 while( i<=GetNumRows() ) 00791 { 00792 if( m_Rows[i].Pos > pos ) 00793 return i-1; 00794 i++; 00795 } 00796 return GetNumRows(); 00797 }

LONG CResizeDlg::HitTest LONG  lCurrent  )  [protected]
 

Definition at line 843 of file resizedlg.cpp.

References HIGH, HitTest(), and WIDE.

Referenced by DlgProc(), and HitTest().

00844 { 00845 #define WIDE 1 00846 #define HIGH 2 00847 int iThisDlg = (GetRowWeight() ? HIGH : 0 ) | ( GetColWeight() ? WIDE : 0 ); 00848 00849 // TRACE(L"NC Hit Test %d - dlg is %d\n",lCurrent, iThisDlg); 00850 switch( lCurrent ) 00851 { 00852 case HTLEFT: // In the left border of a window 00853 case HTRIGHT: // In the rigcase HT border of a window 00854 if( iThisDlg==0) 00855 return HTNOWHERE; 00856 if( iThisDlg & WIDE ) 00857 return lCurrent; // OK 00858 return HTNOWHERE; 00859 00860 case HTTOP: // In the upper horizontal border of a window 00861 case HTBOTTOM: // In the lower horizontal border of a window 00862 if( iThisDlg==0) 00863 return HTNOWHERE; 00864 if( iThisDlg & HIGH ) 00865 return lCurrent; // OK 00866 return HTNOWHERE; // Can't make taller 00867 00868 case HTTOPLEFT: // In the upper-left corner of a window border 00869 case HTTOPRIGHT: // In the upper rigcase HT corner of a window border 00870 if( iThisDlg==0) 00871 return HTNOWHERE; 00872 00873 if( (iThisDlg & (HIGH | WIDE)) == (HIGH | WIDE )) 00874 return lCurrent; 00875 if( iThisDlg & HIGH ) 00876 return HTTOP; 00877 if( lCurrent == HTTOPLEFT ) 00878 return HTLEFT; 00879 return HTRIGHT; 00880 00881 case HTGROWBOX: // In a size box (same as case HTSIZE) 00882 if( iThisDlg==0) 00883 return HTNOWHERE; 00884 if( (iThisDlg & (HIGH | WIDE)) == (HIGH | WIDE )) 00885 return lCurrent; 00886 if( iThisDlg & HIGH ) 00887 return HTBOTTOM; 00888 return HTRIGHT; 00889 00890 case HTBOTTOMLEFT: // In the lower-left corner of a window border 00891 case HTBOTTOMRIGHT: // In the lower-rigcase HT corner of a window border 00892 if( iThisDlg==0) 00893 return HTNOWHERE; 00894 if( (iThisDlg & (HIGH | WIDE)) == (HIGH | WIDE )) 00895 return lCurrent; 00896 if( iThisDlg & HIGH ) 00897 return HTBOTTOM; 00898 if(lCurrent == HTBOTTOMRIGHT) 00899 return HTRIGHT; 00900 return HTLEFT; 00901 } 00902 return HTERROR-1; 00903 }

void CResizeDlg::MakeAttatchments  )  [protected]
 

Definition at line 239 of file resizedlg.cpp.

References CControlList::GetControl(), and m_ControlList.

Referenced by WalkControls().

00240 { 00241 CResizeControl * pC; 00242 int i=0; 00243 while( pC=m_ControlList.GetControl(i++) ) 00244 pC->DeterminLeftAttatchments(); 00245 00246 i=0; 00247 while( pC=m_ControlList.GetControl(i++) ) 00248 pC->DeterminTopAttatchments(); 00249 00250 i=0; 00251 while( pC=m_ControlList.GetControl(i++) ) 00252 pC->DeterminRightAttatchments(); 00253 00254 i=0; 00255 while( pC=m_ControlList.GetControl(i++) ) 00256 pC->DeterminBottomAttatchments(); 00257 00258 i=0; 00259 while( pC=m_ControlList.GetControl(i++) ) 00260 pC->SetControlAssociations(); 00261 }

void CResizeDlg::PlaceControls  )  [protected]
 

Definition at line 910 of file resizedlg.cpp.

References FindCol(), FindRow(), GetDlgCtrlID(), CResizeControl::GetLocation(), CDPA::GetPointer(), tagCHANNEL::iFixed, tagCHANNEL::iWeight, L, m_Cols, CResizeControl::m_Cons, m_ControlList, m_Rows, tagCHANNEL::Pos, and TRACE.

Referenced by FindCommonGuides().

00911 { 00912 // 00913 // Now setup the information for all of the controls, as to which cell they are in. 00914 // 00915 int i=0; 00916 CResizeControl * pC; 00917 CConstraint * pCons; 00918 while( pC=(CResizeControl *) m_ControlList.GetPointer(i++) ) 00919 { 00920 int Row, Col, RowH, ColW; 00921 00922 RECT r=pC->GetLocation(); 00923 pCons=&(pC->m_Cons); 00924 00925 Row = FindRow( r.top); 00926 RowH = FindRow( r.bottom ) - Row +1 ; 00927 if( RowH + Row > GetNumRows() ) 00928 RowH = GetNumRows() - Row; 00929 00930 Col = FindCol( r.left); 00931 ColW = FindCol( r.right ) - Col + 1; 00932 if( ColW + Col > GetNumCols() ) 00933 ColW = GetNumCols() - Col; 00934 00935 pCons->SetCol( Col ); 00936 pCons->SetRow( Row ); 00937 pCons->SetColW( ColW ); 00938 pCons->SetRowH( RowH ); 00939 00940 // 00941 // Now adjust the padding from the edges of the cell. 00942 // 00943 pCons->SetPadTop ( r.top - m_Rows[ Row ].Pos ); 00944 pCons->SetPadBottom( r.bottom - m_Rows[ Row + RowH ].Pos ); 00945 pCons->SetPadLeft ( r.left - m_Cols[ Col ].Pos ); 00946 pCons->SetPadRight ( r.right - m_Cols[ Col + ColW ].Pos ); 00947 00948 /* 00949 IF you're worried that you got the dimentions wrong 00950 TRACE(L"Component %03d [%06d] %s\n pos: l:%03d, r:%03d, t:%03d, b:%03d\nCell: l:%03d, r:%03d, t:%03d, b:%03d\n", 00951 i, GetDlgCtrlID( pC->GetControl()), pC->GetClassName(), r.left, r.right, r.top, r.bottom, 00952 m_Cols[pCons->GetCol()].Pos + pCons->GetPadLeft(), 00953 m_Cols[pCons->GetCol()+pCons->GetColW()].Pos + pCons->GetPadRight(), 00954 m_Rows[pCons->GetRow()].Pos + pCons->GetPadTop(), 00955 m_Rows[pCons->GetRow()+pCons->GetRowH()].Pos + pCons->GetPadBottom() ); 00956 */ 00957 00958 TRACE(L"Component %03d [%06d] %s\n pos: Cell: %03d,%03d by %03d x %03d\n Padding:l:%03d, r:%03d, t:%03d, b:%03d\n", 00959 i, GetDlgCtrlID( pC->GetControl()), pC->GetClassName(), 00960 pCons->GetCol(), pCons->GetRow(), pCons->GetColW(), pCons->GetRowH(), 00961 pCons->GetPadLeft(), pCons->GetPadRight(), pCons->GetPadTop(), pCons->GetPadBottom() ); 00962 00963 // 00964 // Mark each column this control spans as gets wider. 00965 // 00966 int iCol=pCons->GetCol(); 00967 int ic=pCons->GetColW(); 00968 while( ic-- ) 00969 { 00970 if( pC-> IsGrowsWide() == false ) 00971 m_Cols[ iCol+ic ].iFixed-=1; // can't make wider 00972 else 00973 { 00974 m_Cols[ iCol+ic ].iWeight++; 00975 m_Cols[ iCol+ic ].iFixed+=2; // can make wider 00976 } 00977 } 00978 00979 ic=pCons->GetRowH(); 00980 int iRow=pCons->GetRow(); 00981 while( ic-- ) 00982 { 00983 if( pC-> IsGrowsHigh() == false ) 00984 m_Rows[ iRow+ic ].iFixed-=1; // can't make wider 00985 else 00986 { 00987 m_Rows[ iRow+ic ].iWeight++; 00988 m_Rows[ iRow+ic ].iFixed+=2; // can make wider 00989 } 00990 } 00991 } 00992 }

CResizeDlg::PROPERTY int  ,
ControlCount 
 

CResizeDlg::PROPERTY int  ,
ColWeight 
 

CResizeDlg::PROPERTY int  ,
RowWeight 
 

CResizeDlg::PROPERTY BOOL  ,
Annotate 
 

CResizeDlg::PROPERTY int  ,
NumRows 
 

CResizeDlg::PROPERTY int  ,
NumCols 
 

void CResizeDlg::ResizeControls WORD  width,
WORD  height
[protected, virtual]
 

Reimplemented in CScaleDlg.

Definition at line 268 of file resizedlg.cpp.

References BeginDeferWindowPos(), BOOL, _tagSPECIAL::bSpecial, DeferWindowPos, EndDeferWindowPos(), CControlList::GetControlCount(), CDPA::GetPointer(), _tagSPECIAL::iAlignment, _tagSPECIAL::iMax, L, m_Cols, CResizeControl::m_Cons, m_ControlList, m_ParentInfo, m_Rows, m_SpecialCol, m_SpecialRow, NULL, tagCHANNEL::Pos, ResizeControls(), and SetGripperPos().

Referenced by DlgProc(), DoInitDialog(), and ResizeControls().

00269 { 00270 int iSpecialRow = GetNumRows()-1; 00271 int iSpecialCol = GetNumCols()-1; 00272 00273 // 00274 // Add free space 00275 // 00276 if( GetColWeight()>0 ) 00277 { 00278 int FreeW = width - m_Cols[ GetNumCols() ].Pos - m_ParentInfo.GetRightBorder(); 00279 if( FreeW != 0 ) 00280 { 00281 int iPadding=0; 00282 int iPad=FreeW/GetColWeight(); 00283 for( int fi=0;fi<= GetNumCols(); fi++) 00284 { 00285 m_Cols[ fi ].Pos += iPadding; 00286 if( m_Cols[fi].iFixed>=0) 00287 iPadding+=iPad * m_Cols[fi].iWeight; 00288 } 00289 } 00290 } 00291 00292 // 00293 // Add free row. 00294 // 00295 if( GetRowWeight()>0 ) 00296 { 00297 int Free = height - m_Rows[ GetNumRows() ].Pos - m_ParentInfo.GetBottomBorder(); 00298 if( Free != 0 ) 00299 { 00300 int iPadding=0; 00301 int iPad=Free/GetRowWeight(); 00302 for( int fi=0;fi<= GetNumRows(); fi++) 00303 { 00304 m_Rows[ fi ].Pos += iPadding; 00305 if( m_Rows[fi].iFixed>=0) 00306 iPadding+=iPad * m_Rows[fi].iWeight; 00307 } 00308 } 00309 } 00310 00311 // 00312 // Now setup the information for all of the controls, as to which cell they are in. 00313 // 00314 HDWP hdwp = BeginDeferWindowPos( m_ControlList.GetControlCount() ); 00315 int i=0; 00316 CResizeControl * pC; 00317 CConstraint * pCons; 00318 while( pC=(CResizeControl *) m_ControlList.GetPointer(i++) ) 00319 { 00320 pCons=&(pC->m_Cons); 00321 int x=m_Cols[pCons->GetCol()].Pos + pCons->GetPadLeft(); 00322 int y=m_Rows[pCons->GetRow()].Pos + pCons->GetPadTop(); 00323 int w,h; 00324 00325 BOOL bMove=true; BOOL bSize=false; 00326 if( pC->IsGrowsWide() ) 00327 { 00328 w=m_Cols[pCons->GetCol()+pCons->GetColW()].Pos + pCons->GetPadRight() -x; 00329 bSize=true; 00330 } 00331 else 00332 w=pC->GetWidth(); 00333 00334 if( pC->IsGrowsHigh() ) 00335 { 00336 h=m_Rows[pCons->GetRow()+pCons->GetRowH()].Pos + pCons->GetPadBottom() -y; 00337 bSize=true; 00338 } 00339 else 00340 h=pC->GetHeight(); 00341 00342 // 00343 // Here we special case the ComboBox - yuck. 00344 // 00345 if( lstrcmp( pC->GetClassName(), L"Button") ==0) 00346 { 00347 // 00348 // Check box button is OK though. 00349 // 00350 int ibs=GetWindowStyle( pC->GetControl() ); 00351 if( (ibs & 0xf) == BS_GROUPBOX ) 00352 { 00353 // 00354 // Force the width / height. 00355 // 00356 w=m_Cols[pCons->GetCol()+pCons->GetColW()].Pos + pCons->GetPadRight() -x; 00357 h=m_Rows[pCons->GetRow()+pCons->GetRowH()].Pos + pCons->GetPadBottom() -y; 00358 bSize=true; 00359 } 00360 } 00361 00362 // 00363 // If they are in special row / columns we do something special to them. 00364 // 00365 if( m_SpecialCol.bSpecial && ( pCons->GetCol() == iSpecialCol ) ) 00366 { 00367 // alignment issues 00368 if(m_SpecialCol.iAlignment == -1 ) 00369 { 00370 y=pC->GetTopGap(); 00371 } 00372 else 00373 if(m_SpecialCol.iAlignment == 1 ) 00374 { 00375 // 00376 // Right aligned. 00377 // 00378 y=pC->GetTopGap() + height - m_SpecialCol.iMax - m_ParentInfo.GetTopBorder(); 00379 } 00380 else 00381 { 00382 // 00383 // Center aligned 00384 // 00385 y=pC->GetTopGap() + ((height - m_SpecialCol.iMax - m_ParentInfo.GetTopBorder())/2); 00386 } 00387 } 00388 00389 if( m_SpecialRow.bSpecial && ( pCons->GetRow() == iSpecialRow ) ) 00390 { 00391 // alignment issues 00392 if(m_SpecialRow.iAlignment == -1 ) 00393 { 00394 x=pC->GetLeftGap(); 00395 } 00396 else 00397 if(m_SpecialRow.iAlignment == 1 ) // right aligned. 00398 { 00399 x=pC->GetLeftGap() + width - m_SpecialRow.iMax - m_ParentInfo.GetRightBorder(); 00400 } 00401 else 00402 { 00403 x=pC->GetLeftGap() + ((width - m_SpecialRow.iMax - m_ParentInfo.GetRightBorder()) / 2); 00404 } 00405 } 00406 00407 hdwp = DeferWindowPos( hdwp, pC->GetControl(), NULL, 00408 x, y, w , h, 00409 (bMove ? 0: SWP_NOMOVE) | (bSize ? 0: SWP_NOSIZE) | SWP_NOZORDER ); 00410 00411 } 00412 00413 // 00414 // Move the gripper 00415 // 00416 SetGripperPos(hdwp); 00417 00418 EndDeferWindowPos( hdwp ); 00419 }

HDWP CResizeDlg::SetGripperPos HDWP  hdwp  )  [protected, virtual]
 

Definition at line 1086 of file resizedlg.cpp.

References DeferWindowPos, GetClientRect(), GetSystemMetrics(), CDlg::GetWindow(), m_hwndGripper, NULL, and SetGripperPos().

Referenced by ResizeControls(), and SetGripperPos().

01087 { 01088 if( m_hwndGripper != NULL ) 01089 { 01090 int g_cxGrip = GetSystemMetrics( SM_CXVSCROLL ); 01091 int g_cyGrip = GetSystemMetrics( SM_CYHSCROLL ); 01092 RECT rc; 01093 GetClientRect( GetWindow(), &rc); 01094 return DeferWindowPos( hdwp, m_hwndGripper, NULL, 01095 rc.right - g_cxGrip, 01096 rc.bottom - g_cyGrip, 01097 g_cxGrip, 01098 g_cyGrip, 01099 SWP_NOZORDER | SWP_NOSIZE ); 01100 } 01101 else 01102 return hdwp; 01103 }

void CResizeDlg::Sort CEdge **  ,
int  iCount
[protected]
 

Definition at line 486 of file resizedlg.cpp.

References CEdge::GetPosition(), and Sort().

Referenced by FindCommonGuides(), and Sort().

00487 { 00488 // 00489 // Lame sort BB fix later. 00490 // 00491 int iInsert=0; 00492 while ( iInsert < iCount ) 00493 { 00494 int iSmallest=iInsert; 00495 for(int iMatch=iInsert; iMatch<iCount; iMatch++) 00496 { 00497 if( ppEdges[iMatch]->GetPosition() < ppEdges[iSmallest]->GetPosition() ) 00498 iSmallest=iMatch; 00499 } 00500 if( iSmallest > iInsert ) 00501 { 00502 CEdge * pTemp=ppEdges[iInsert]; 00503 ppEdges[iInsert]=ppEdges[iSmallest]; 00504 ppEdges[iSmallest]=pTemp; 00505 } 00506 // TRACE(L"%02d is %08d\n", iInsert, ppEdges[iInsert]->GetPosition() ); 00507 iInsert++; 00508 } 00509 }

void CResizeDlg::SpecialRowCol  )  [protected]
 

Definition at line 1250 of file resizedlg.cpp.

References BOOL, _tagSPECIAL::bSpecial, FALSE, CParentInfo::GetHeight(), CResizeControl::GetLocation(), CDPA::GetPointer(), CParentInfo::GetWidth(), _tagSPECIAL::iAlignment, _tagSPECIAL::iDiff, _tagSPECIAL::iMax, _tagSPECIAL::iMin, CResizeControl::m_Cons, m_ControlList, m_ParentInfo, m_SpecialCol, m_SpecialRow, TRACE, and TRUE.

Referenced by WalkControls().

01251 { 01252 TRACE("There are %d rows, and %d columns\n", GetNumRows(), GetNumCols() ); 01253 01254 // 01255 // Walk the controls, find the row/col they are in. 01256 // 01257 BOOL bSpecialRow=TRUE; 01258 BOOL bSpecialCol=TRUE; 01259 int iNumRows=GetNumRows()-1; 01260 int iNumCols=GetNumCols()-1; 01261 01262 // 01263 // It is a special row if all the heights are the same 01264 // it is a special col if all the widths are the same 01265 // 01266 int iRowHeight=0; 01267 int iColWidth=0; 01268 01269 // 01270 // It's a row/col if there is more than one control there 01271 // 01272 int iRowCount=0; 01273 int iColCount=0; 01274 01275 // 01276 // We remember the bounds of the rows/cols 01277 // left/right is the left of the left button, and the right of the right 01278 // top/bottom is the top of the topmost, and the bottom of the bottom most. 01279 // 01280 RECT bounds; // this is the 01281 bounds.left=m_ParentInfo.GetWidth(); 01282 bounds.right=0; 01283 bounds.top=m_ParentInfo.GetHeight(); 01284 bounds.bottom=0; 01285 01286 int i=0; 01287 CResizeControl * pC; 01288 CConstraint * pCons; 01289 while( pC=(CResizeControl *) m_ControlList.GetPointer(i++) ) 01290 { 01291 pCons=&(pC->m_Cons); 01292 01293 // 01294 // Column work (widths same) 01295 // 01296 if( bSpecialCol ) 01297 { 01298 if( ((pCons->GetCol() == iNumCols ) || (pCons->GetCol() + pCons->GetColW() > iNumCols) )) 01299 { 01300 if( iColWidth==0 ) 01301 iColWidth=pC->GetWidth(); 01302 if( pC->GetWidth() != iColWidth ) 01303 bSpecialCol=FALSE; 01304 iColCount++; 01305 } 01306 01307 // 01308 // If this item is wholy in this column 01309 // 01310 if( pCons->GetCol() == iNumCols ) 01311 { 01312 RECT r=pC->GetLocation(); 01313 if( r.top < bounds.top ) 01314 bounds.top = r.top; 01315 if( r.bottom > bounds.bottom ) 01316 bounds.bottom = r.bottom; 01317 } 01318 } 01319 01320 if( bSpecialRow ) 01321 { 01322 if( (pCons->GetRow() == iNumRows ) || (pCons->GetRow() + pCons->GetRowH() > iNumRows) ) 01323 { 01324 if( iRowHeight==0 ) 01325 iRowHeight=pC->GetHeight(); 01326 if( pC->GetHeight() != iRowHeight ) 01327 bSpecialRow=FALSE; 01328 iRowCount++; 01329 } 01330 01331 // 01332 // If this item is wholy in this row 01333 // 01334 if( pCons->GetRow() == iNumRows ) 01335 { 01336 RECT r=pC->GetLocation(); 01337 if( r.left < bounds.left ) 01338 bounds.left = r.left; 01339 if( r.right > bounds.right ) 01340 bounds.right = r.right; 01341 } 01342 } 01343 01344 if( (bSpecialCol==FALSE) && ( bSpecialRow==FALSE ) ) 01345 break; 01346 } 01347 01348 m_SpecialRow.bSpecial = iRowCount>1?bSpecialRow:FALSE; 01349 m_SpecialCol.bSpecial = iColCount>1?bSpecialCol:FALSE; 01350 01351 // 01352 // Check the row alignment. 01353 // 01354 if( m_SpecialRow.bSpecial ) 01355 { 01356 int lGap = bounds.left - m_ParentInfo.GetLeftBorder(); 01357 int rGap = m_ParentInfo.GetWidth() - m_ParentInfo.GetRightBorder() - bounds.right; 01358 TRACE("Constraits on the special row are: left %d, right %d\n",bounds.left, bounds.right ); 01359 TRACE("Parent info is: left %d, right %d\n", m_ParentInfo.GetLeftBorder(), m_ParentInfo.GetWidth() - m_ParentInfo.GetRightBorder() ); 01360 TRACE("Gaps are: left %d, right %d\n", lGap, rGap ); 01361 int GapDiff = lGap - rGap; 01362 m_SpecialRow.bSpecial = TRUE; 01363 m_SpecialRow.iMin = bounds.left; 01364 m_SpecialRow.iMax = bounds.right; 01365 if( GapDiff < -10 ) 01366 { 01367 TRACE("Probably a left aligned thing\n"); 01368 m_SpecialRow.iAlignment = -1; 01369 } 01370 else 01371 if( GapDiff > 10 ) 01372 { 01373 TRACE(" Probably a right aligned thing\n"); 01374 m_SpecialRow.iAlignment = 1; 01375 } 01376 else 01377 { 01378 TRACE(" Probably a centered thing\n"); 01379 m_SpecialRow.iAlignment = 0; 01380 } 01381 m_SpecialRow.iDiff=GapDiff; 01382 } 01383 01384 // 01385 // Check the Col alignment. 01386 // 01387 if( m_SpecialCol.bSpecial ) 01388 { 01389 int tGap = bounds.top - m_ParentInfo.GetTopBorder(); 01390 int bGap = m_ParentInfo.GetHeight() - m_ParentInfo.GetBottomBorder() - bounds.bottom; 01391 TRACE("Constraits on the special Col are: top %d, bottom %d\n",bounds.top, bounds.bottom); 01392 TRACE("Parent info is: top %d, bottom %d\n", m_ParentInfo.GetTopBorder(), m_ParentInfo.GetHeight() - m_ParentInfo.GetBottomBorder() ); 01393 TRACE("Gaps are: top %d, bottom %d\n", tGap, bGap ); 01394 int GapDiff = tGap - bGap; 01395 m_SpecialCol.iMin = bounds.top; 01396 m_SpecialCol.iMax = bounds.bottom; 01397 if( GapDiff < -10 ) 01398 { 01399 TRACE("Probably a left aligned thing\n"); 01400 m_SpecialCol.iAlignment = -1; 01401 } 01402 else 01403 if( GapDiff > 10 ) 01404 { 01405 TRACE(" Probably a right aligned thing\n"); 01406 m_SpecialCol.iAlignment = 1; 01407 } 01408 else 01409 { 01410 TRACE(" Probably a centered thing\n"); 01411 m_SpecialCol.iAlignment = 0; 01412 } 01413 m_SpecialCol.iDiff=GapDiff; 01414 } 01415 }

void CResizeDlg::WalkControls  )  [protected]
 

Definition at line 162 of file resizedlg.cpp.

References CParentInfo::DeterminBorders(), FindCommonGuides(), FindControls(), CDlg::GetWindow(), CParentInfo::Init(), m_ControlList, m_ParentInfo, MakeAttatchments(), and SpecialRowCol().

Referenced by DoInitDialog().

00163 { 00164 m_ParentInfo.Init( GetWindow() ); 00165 FindControls(); 00166 m_ParentInfo.DeterminBorders( &m_ControlList ); 00167 MakeAttatchments(); 00168 FindCommonGuides(); 00169 SpecialRowCol(); 00170 }


Member Data Documentation

CHANNEL* CResizeDlg::m_Cols [protected]
 

Definition at line 78 of file resizedlg.h.

Referenced by Annotate(), DeterminCols(), DeterminWeights(), FindCol(), PlaceControls(), and ResizeControls().

CControlList CResizeDlg::m_ControlList [protected]
 

Definition at line 67 of file resizedlg.h.

Referenced by FindControls(), MakeAttatchments(), PlaceControls(), ResizeControls(), SpecialRowCol(), and WalkControls().

HWND CResizeDlg::m_hwndGripper [protected]
 

Definition at line 82 of file resizedlg.h.

Referenced by AddGripper(), CResizeDlg(), and SetGripperPos().

CParentInfo CResizeDlg::m_ParentInfo [protected]
 

Definition at line 68 of file resizedlg.h.

Referenced by DoChangePos(), DoInitDialog(), FindCommonGuides(), FindControls(), ResizeControls(), SpecialRowCol(), and WalkControls().

CHANNEL* CResizeDlg::m_Rows [protected]
 

Definition at line 77 of file resizedlg.h.

Referenced by Annotate(), DeterminRows(), DeterminWeights(), FindRow(), PlaceControls(), and ResizeControls().

SPECIAL CResizeDlg::m_SpecialCol [protected]
 

Definition at line 85 of file resizedlg.h.

Referenced by ResizeControls(), and SpecialRowCol().

SPECIAL CResizeDlg::m_SpecialRow [protected]
 

Definition at line 84 of file resizedlg.h.

Referenced by ResizeControls(), and SpecialRowCol().


The documentation for this class was generated from the following files:
Generated on Sat May 15 19:46:28 2004 for test by doxygen 1.3.7