---------------------------------------------------------------------------
| 73 | } |
| 74 | //--------------------------------------------------------------------------- |
| 75 | void TStringGridLivingColumns::ResizeColumnWidth(void) |
| 76 | { |
| 77 | int cw = SG->ClientWidth; |
| 78 | // ������� ������ ����� OnResize ��� ������ ����� |
| 79 | if( oldClientWidth == cw ) |
| 80 | return; |
| 81 | |
| 82 | // ������, ��� ��� ��������� ������ ����. ������ |
| 83 | // SG->ClientWidth ���������� �� �� ������ |
| 84 | // �������������� ��������� ������ ������� ������������ |
| 85 | // �� ������ ����� ��� ������ ����. ������ |
| 86 | |
| 87 | // ������� ����� ��� ������ ����. ������, |
| 88 | // ���� ������ ����. ������ ��� |
| 89 | if( ! HaveScrollBar(SG->Handle) ) |
| 90 | { |
| 91 | int ScrolBarWidth = GetSystemMetrics(SM_CXVSCROLL); |
| 92 | cw -= ScrolBarWidth; |
| 93 | } |
| 94 | |
| 95 | int AllColWidth = GetAllColumnsWidth(); |
| 96 | |
| 97 | if( oldClientWidth > cw ) // ���� ���������� |
| 98 | { |
| 99 | oldClientWidth = cw; |
| 100 | // ���� ���������� �� �������� ������� - �� �������� �� ������ |
| 101 | if( AllColWidth < cw ) |
| 102 | return; |
| 103 | } |
| 104 | else if( oldClientWidth < cw ) // ���� ���������� |
| 105 | { |
| 106 | oldClientWidth = cw; |
| 107 | // ���� �� ��� ������� ������ - �� �������� �� ������ |
| 108 | if( AllColWidth > cw ) |
| 109 | return; |
| 110 | } |
| 111 | |
| 112 | // ������� ������ ������� |
| 113 | for(int i=0, c=SG->ColCount; i<c; i++) |
| 114 | SG->ColWidths[i] = ColumnKoeff[i] * (double)cw; |
| 115 | } |
| 116 | //--------------------------------------------------------------------------- |
| 117 | bool HaveScrollBar(HWND hwnd) |
| 118 | { |
nothing calls this directly
no test coverage detected