Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Problem with Showing Slider Control in the Toolbar Collapse All
Subject Author Date
Saroj Acharya Jul 12, 2005 - 12:29 PM

Hi Customer Support,


 


My application has two slider controls in the toobar. Both of these controls are placed in the window derived from CExtResizableDialog. My problem is that they are not visible when I first display the window. But when I resize the same window, both of the slider controls will appear in the right place. I tried calling various functions such as pSliderControl->Show(),  pSliderControl->RecalcSliderLayout() or m_wndToolBar.Invalidate() & m_wndToolBar.RedrawWindow(), but none of them help.


Can you help me with this problem ? The only thing that will show these controls is to resize the window by slightly changing it’s size. When another window (lets sat Windows Explorer) totally covers this wiondow and it reappears, the controls will not reappear. That means WM_PAINT is not helping.


Thanks for your help.


Saroj


 

Technical Support Jul 12, 2005 - 1:06 PM

Please make sure that you use the RepositionBars method. It should be called at the end of the OnInitDialog method:

BOOL CPageToolbars::OnInitDialog() 

{

    CPageBase::OnInitDialog();

    ...    

    ...

    ...

    CWnd::RepositionBars(0,0xFFFF,0);

    return TRUE;

}
and in the WM_SIZE handler:
void CPageToolbars::OnSize(UINT nType, int cx, int cy) 

{

    CPageBase::OnSize(nType, cx, cy);

    if( nType != SIZE_MINIMIZED )

        CWnd::RepositionBars(0,0xFFFF,0);

}
If you changes content of the toolbar at runtime, you should also call
CWnd::RepositionBars(0,0xFFFF,0);
If this does not help, try to use the SetWindowPos() method to send WM_SIZE to the toolbar window:
m_wndToolBar.SetWindowPos(

        NULL, 0, 0, 0, 0,

        SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER

        |SWP_NOCOPYBITS|SWP_NOACTIVATE

        |SWP_FRAMECHANGED

        );


Saroj Acharya Jul 12, 2005 - 1:22 PM

Thanks for the prompt reply.


I double checked my code and looks like I had everything in my code you mentioned in the email except the code to send WM_SIZE message to the window. I try putting that code in, and I still do not see those two Slider controls when the application first starts. But it will appear as soon as I change the size of that window.


Any idea why ? I could send you my entire project if you would like to have a look.


Regards,


Saroj

Technical Support Jul 12, 2005 - 2:01 PM

Please also try to update you toolbar in this way:

    CRect rcWindow;

    m_wndToolBar.GetWindowRect( &rcWindow );

    m_wndToolBar.SetWindowPos(

        NULL, 0, 0, 

        rcWindow.Width(), rcWindow.Height(),

        SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER

        |SWP_NOCOPYBITS|SWP_NOACTIVATE

        |SWP_FRAMECHANGED

        );


Saroj Acharya Jul 13, 2005 - 8:38 AM

I even tried this latest code, it does not help. I still do not see those two slider controls in the toolbar. BUt when the window is re-sized, they appear.


Saroj

Technical Support Jul 12, 2005 - 1:26 PM

If you send us your project that would help us to quickly find out what’s wrong with this issue.

Saroj Acharya Jul 13, 2005 - 8:37 AM

I sent you my project and hopefully it will help you find the problem.

Technical Support Jul 13, 2005 - 11:17 AM

We tested your project and found no problems. The slider is always visible when the control bar becomes visible. We sent you our recommendations and advice by e-mail.

Saroj Acharya Jul 18, 2005 - 8:54 AM

Thanks for the splendid support. As discussed in the email, the problem is resolved.


Thanks again !!!