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 » Simple CExtBarSliderButton Example Collapse All
Subject Author Date
Brett Cook Oct 30, 2006 - 6:37 PM

Dear Tech Support,

Try as I might, I’m having difficulty getting a CExtBarSliderButton to show up. I am following the examples in AviFrames and ThemeColorizer as closely as possible, but to no avail.

Is there a small code snippet available on how to get this working?

Thanks,
Brett

Technical Support Oct 31, 2006 - 10:15 AM

Here is a simple SDI project with two CExtBarSliderButton buttons in the toolbar. It handles scroll pos change events from these buttons.

Brett Cook Oct 31, 2006 - 12:49 PM

Thank you for the example. However, after following the code to the letter, the scrollbar still refuses to show up in my application. All I get is a blank button at the end of the toolbar. I’ve been tracing the code, and it looks like the RecalcSliderLayout() is called but PaintCompound() and OnPaintScrollArea() are not.

I will put together a UI-only version of my app to send to you, if you don’t mind.

Technical Support Nov 2, 2006 - 4:12 AM

There was a bug with painting the slider button in some older version, but now it is fixed. Please download the latest stable source code from our FTP site.

Brett Cook Nov 9, 2006 - 3:36 PM

I have 2.61 installed. Is there a newer stable source available? If so, how do I get to the FTP site?

Thanks

Technical Support Nov 10, 2006 - 11:14 AM

You can always download the latest stable source code from our ftp site. Please contact us by e-mail at support@prof-uis.com so we can provide you with the details.

Brett Cook Nov 10, 2006 - 12:17 PM

I was able to track this problem (slider not showing up in toolbar) down to the customization options. If I disable customization in Prof-UIS, the slider bar shows up.

I have sent a new version of my shell UI that demonstrates this problem.

Technical Support Nov 13, 2006 - 12:52 PM

The CExtCustomizeSite class supports some types of built-in toolbar buttons including the simple push button, drop-down button, split button, text field, combo field, undo/redo button and date/time field. The slider button is not supported as a built-in button type in this class. You can work around this by overriding the CExtCustomizeSite::OnCreateToolbarButton() virtual method:

    virtual CExtBarButton *  OnCreateToolbarButton(
        CExtToolControlBar * pBar,
        CExtCustomizeCmdTreeNode * pNodeI,
        CExtCustomizeCmdTreeNode * pNodeC
        );

CExtBarButton * CMainFrame::OnCreateToolbarButton(
    CExtToolControlBar * pBar,
    CExtCustomizeCmdTreeNode * pNodeI,
    CExtCustomizeCmdTreeNode * pNodeC
    )
{
UINT nCmdID = 0;
    if( pNodeI != NULL )
        nCmdID = pNodeI->GetCmdID( false );
    else if( pNodeC != NULL )
        nCmdID = pNodeC->GetCmdID( false );
    if( nCmdID == ID_MYEXTBTN_SLIDER )
    {
        CMyBarSliderButton * pZoomSliderTBB =
            new CMyBarSliderButton(
                pBar, ID_MYEXTBTN_SLIDER,
                0, 50, 25, 0, 0, 0, 100, 100
                );
        ASSERT_VALID( pZoomSliderTBB );
        if( pNodeI != NULL )
        {
            pZoomSliderTBB->SetBasicCmdNode( pNodeI );
            pZoomSliderTBB->OnCustomizeUpdateProps( pNodeI );
        }
        if( pNodeC != NULL )
        {
            pZoomSliderTBB->OnCustomizeUpdateProps( pNodeC );
            pZoomSliderTBB->SetCustomizedCmdNode( pNodeC );
            if( pNodeC->GetFlags() & __ECTN_TBB_HIDDEN )
                pZoomSliderTBB->ModifyStyle( TBBS_HIDDEN, 0 );
            else
                pZoomSliderTBB->ModifyStyle( 0, TBBS_HIDDEN );
        } // if( pNodeC != NULL )
        return pZoomSliderTBB;
    }
    return CExtCustomizeSite::OnCreateToolbarButton(
        pBar,
        pNodeI,
        pNodeC
        );
}


Brett Cook Nov 13, 2006 - 4:13 PM

This works great, thanks.