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 » How can I replace a button on a toolbar with a slider control Collapse All
Subject Author Date
Kevin Eshbach May 27, 2008 - 12:46 PM

I have a slider on a toolbar to replace a button, but the area occupied by the button still appears.  I have managed to get rid of the button’s bitmap and set the text to a string with a single space character, but there is still a slight gap where the button is for the space character.  How do I completely get rid of the button so that it doesn’t show a small gap for the space character?


 


Kevin Eshbach

Kevin Eshbach May 28, 2008 - 11:27 AM

<o:p></o:p>


I started with the example that you suggested but when I set the icon to null I now get the tooltip text to the left of the slider. I would like to not have the icon or the tooltip show up to the left of the slider.  I do want the tooltip to appear when the mouse cursor hovers over the slider.  Below is the code I have tried but text still shows up after I create a second slider from the customize dialog.


 



CAgUiToolbarSlider::CAgUiToolbarSlider( CExtToolControlBar*      pBar,<o:p></o:p>

                                                            UINT                             nCmdID,<o:p></o:p>

                                                            UINT                             nStyle,<o:p></o:p>

                                                            ULONG                         nScrollTotalRange,<o:p></o:p>

                                                            ULONG                         nScrollPos,<o:p></o:p>

                                                            ULONG                         nScrollPageSize,<o:p></o:p>

                                                            INT                               nScrollButtonExtentH,<o:p></o:p>

                                                            INT                               nScrollButtonExtentV,<o:p></o:p>

                                                            INT                               nScrollControlExtentH,<o:p></o:p>

                                                            INT                               nScrollControlExtentV ) :<o:p></o:p>

            CExtBarSliderButton(pBar,nCmdID,nStyle,nScrollTotalRange,nScrollPos,nScrollPageSize,<o:p></o:p>

                                                                        nScrollButtonExtentH,nScrollButtonExtentV,nScrollControlExtentH,<o:p></o:p>

                                                                        nScrollControlExtentV)<o:p></o:p>

{<o:p></o:p>

            CPersMainFrame* pFrame = dynamic_cast<CPersMainFrame*>(AfxGetMainWnd());<o:p></o:p>

            if( pFrame )<o:p></o:p>

            {<o:p></o:p>

                        CExtCmdIcon* pIcon = new CExtCmdIcon();<o:p></o:p>

                        pIcon->Empty();<o:p></o:p>

                        g_CmdManager->CmdSetIcon(pFrame->GetProfileName(),nCmdID,pIcon,false);<o:p></o:p>

<o:p> </o:p>

                        CExtCmdItem* pCmdItem = g_CmdManager->CmdGetPtr(pFrame->GetProfileName(),nCmdID);<o:p></o:p>

                        pCmdItem->m_sToolbarText = "";<o:p></o:p>

            }<o:p></o:p>

}



 


Kevin Eshbach

Technical Support May 29, 2008 - 4:17 AM

You can invoke the CExtCmdManager::CmdSetIcon() method and in it specify a reference to an empty CExtCmdIcon object in order to remove an icon from any command. You can get a pointer to a CExtCmdItem object by its command identifier using the CExtCmdManager::CmdGetPtr() method and change the tooltip and/or status tip texts of the command to empty strings.


Technical Support May 28, 2008 - 4:57 AM

We would recommend you not to use any windows attached to toolbar buttons if it is possible. By default toolbars, menu bars and ribbons instantiate CExtBarButton objects for each of toolbar buttons. But there are also several CExtBar*** classes in Prof-UIS implementing different kind of toolbar buttons without using any HWND handles. The CExtBarSliderButton class implements a slider toolbar button and a scroll bar toolbar button. It’s demonstrated in the AviFrames sample.