MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / MsgSize

Function MsgSize

src/Notepad2.c:1535–1585  ·  view source on GitHub ↗

============================================================================= MsgSize() - Handles WM_SIZE

Source from the content-addressed store, hash-verified

1533//
1534//
1535void MsgSize ( HWND hwnd, WPARAM wParam, LPARAM lParam )
1536{
1537 RECT rc;
1538 int x, y, cx, cy;
1539 HDWP hdwp;
1540 // Statusbar
1541 int aWidth[6];
1542 if ( wParam == SIZE_MINIMIZED ) {
1543 return;
1544 }
1545 x = 0;
1546 y = 0;
1547 cx = LOWORD ( lParam );
1548 cy = HIWORD ( lParam );
1549 if ( bShowToolbar ) {
1550 /* SendMessage(hwndToolbar,WM_SIZE,0,0);
1551 GetWindowRect(hwndToolbar,&rc);
1552 y = (rc.bottom - rc.top);
1553 cy -= (rc.bottom - rc.top);*/
1554 //SendMessage(hwndToolbar,TB_GETITEMRECT,0,(LPARAM)&rc);
1555 SetWindowPos ( hwndReBar, NULL, 0, 0, LOWORD ( lParam ), cyReBar, SWP_NOZORDER );
1556 // the ReBar automatically sets the correct height
1557 // calling SetWindowPos() with the height of one toolbar button
1558 // causes the control not to temporarily use the whole client area
1559 // and prevents flickering
1560 //GetWindowRect(hwndReBar,&rc);
1561 y = cyReBar + cyReBarFrame; // define
1562 cy -= cyReBar + cyReBarFrame; // border
1563 }
1564 if ( bShowStatusbar ) {
1565 SendMessage ( hwndStatus, WM_SIZE, 0, 0 );
1566 GetWindowRect ( hwndStatus, &rc );
1567 cy -= ( rc.bottom - rc.top );
1568 }
1569 hdwp = BeginDeferWindowPos ( 2 );
1570 DeferWindowPos ( hdwp, hwndEditFrame, NULL, x, y, cx, cy,
1571 SWP_NOZORDER | SWP_NOACTIVATE );
1572 DeferWindowPos ( hdwp, hwndEdit, NULL, x + cxEditFrame, y + cyEditFrame,
1573 cx - 2 * cxEditFrame, cy - 2 * cyEditFrame,
1574 SWP_NOZORDER | SWP_NOACTIVATE );
1575 EndDeferWindowPos ( hdwp );
1576 // Statusbar width
1577 aWidth[0] = max ( 120, min ( cx / 3, StatusCalcPaneWidth ( hwndStatus, L"Ln 9'999'999 : 9'999'999 Col 9'999'999 : 999 Sel 9'999'999" ) ) );
1578 aWidth[1] = aWidth[0] + StatusCalcPaneWidth ( hwndStatus, L"9'999'999 Bytes" );
1579 aWidth[2] = aWidth[1] + StatusCalcPaneWidth ( hwndStatus, L"Unicode BE BOM" );
1580 aWidth[3] = aWidth[2] + StatusCalcPaneWidth ( hwndStatus, L"CR+LF" );
1581 aWidth[4] = aWidth[3] + StatusCalcPaneWidth ( hwndStatus, L"OVR" );
1582 aWidth[5] = -1;
1583 SendMessage ( hwndStatus, SB_SETPARTS, COUNTOF ( aWidth ), ( LPARAM ) aWidth );
1584 //UpdateStatusbar();
1585}
1586
1587
1588//=============================================================================

Callers 1

MainWndProcFunction · 0.85

Calls 1

StatusCalcPaneWidthFunction · 0.85

Tested by

no test coverage detected