Menu

GetDockWidth no this function ?

Help
Erik Don
2021-01-18
2021-01-20
  • Erik Don

    Erik Don - 2021-01-18

    Hi, David,
    Hope you can check this issue, the chm for V8.8 has a function CDocker::GetDockWidth() .
    but I can't call it by this statement: CDockGetDockFromID(ID_DOCK_MULTI)->GetDockWidth(), the compiler has error : error: 'class Win32xx::CDocker' has no member named GetDockWidth. By searching result 0 from the include folder for Win32++, it seems V8.8 don't has this function. Would you please help check?

     
  • David

    David - 2021-01-18

    Hi Erik,

    Use GetDockSize instead of GetDockWidth.
    I'll update the documentation in due course.

    Best regards,
    David

     
    • Erik Don

      Erik Don - 2021-01-18

      Hi, David,
      Thank you very much, I want re-size columns of listview control inside a ctab. the OnSize may have assert , than I set a member bool variable in CDockList::OnInitialUpdate(), than do resize as follow: My question is do we have other more direct method than this ?

      LRESULT CDockList::OnSize(UINT msg, WPARAM wparam, LPARAM lparam)
      {
      CDocker::OnSize( msg, wparam, lparam);
      if(m_bInitialized && m_pViewlist->IsWindow())
      {
      CRect rect = GetWindowRect();
      int width = rect.Width()/3;
      / int width = LOWORD( lparam ); /
      m_pViewlist->SetColumnWidth(0, width);
      m_pViewlist->SetColumnWidth(1, width);
      m_pViewlist->SetColumnWidth(2, width);

          m_pViewlist->RedrawWindow();
          m_pViewlist->UpdateWindow();
      }
      
      return 1;
      

      }

       
  • David

    David - 2021-01-20

    Hi Erik

    Yes you can handle the WM_SIZE message if you want the columns of the ListView to be resized when the ListView is resized.

    It would be better to handle the WM_SIZE message for m_pViewList's class rather than in CDockList. That way you could do away with the tests for IsWindow and m_bInitialized.

    Best regards,
    David

     

Log in to post a comment.