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 General Discussion » NCButton Hide/Show Collapse All
Subject Author Date
Eugene Wineblat Aug 30, 2006 - 10:01 AM

I have
class CMainFrame : public CExtNCW < CFrameWnd >

I need to make customizable ncbuttons ( Maximize, Minimize, Close ). Independetly. Window styles don’t give that : When Close is disabled no other ncbutton is enabled.
I found that CExtNCW inherited from CExtNcFrameImpl which responsible for ncbutton (have their rects and paint them).

I ovveride function NcFrameImpl_PreWindowProc where the painting is executed:
...
    case WM_NCPAINT:
        {
            if( NcFrameImpl_IsForceEmpty() )
                break;
....
            NcFrameImpl_ReCacheScButtonRects(); // ncbuttons size and pos from PaintManager - non-overridable function

// 3 rows for ncbutton customization
            if ( m_bHideClose ) m_rcNcFrameImpl_ScClose.SetRectEmpty ();
            if ( m_bHideMinimize ) m_rcNcFrameImpl_ScMinimize.SetRectEmpty ();
            if ( m_bHideMaximize ) m_rcNcFrameImpl_ScMaximize.SetRectEmpty ();

.....

Question:
Does my variant only one possible or you can offer me some more useful variant than copy/paste of your code, which can be overwritten later by prof-uis team?

Technical Support Aug 31, 2006 - 9:41 AM

Your solution is acceptable and a better solution can only be available if we modify the source code of CExtNcFrameImpl.