MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / ResizeColumnWidth

Method ResizeColumnWidth

sourcecommon/gridcolumns.cpp:75–115  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

73}
74//---------------------------------------------------------------------------
75void 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//---------------------------------------------------------------------------
117bool HaveScrollBar(HWND hwnd)
118{

Callers

nothing calls this directly

Calls 1

HaveScrollBarFunction · 0.85

Tested by

no test coverage detected