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 » Prof-UID help system Collapse All
Subject Author Date
Dmitri Doulepov May 21, 2004 - 2:20 AM

I think about bying Prof-UIS library but wondering wether trial version has the same help system as the full version? Currently help is not helpful (too brief, no examples). Yesterday I could not find from help how to force dialogs to use visual styles: I had to look into samples to discover that I should add CExtWS.


I think next version should come with a much better help, otherwise it is hard to develop with Prof-UIS :( Prof-UIS is great but help system is not good enough. Take a look to MFC documentation, for example...


Btw, if CExtWS used with CRichEditCtrl, this control does not display anything (transparent hole appears). Without CExtWS it appears as non-styled.


Hope, you are not offended, I want this product to be even better than it is now :)

Technical Support May 21, 2004 - 3:54 AM

Dear Dmitri,

We have almost finished a new version of Prof-UIS and now we are working on the help. We try to improve the documentation with each release. If you have questions which cannot be answered with the Prof-UIS help, do not hesitate to contact us. The CExtWS cannot be used with CRichEditCtrl since CExtWS is designed to work with dialog windows only. What style do you need for your CRichEditCtrl?

Dmitri Doulepov May 21, 2004 - 6:46 AM

>What style do you need for your CRichEditCtrl?


Well, for example, buttons change their look in the dialog but RichEdit stays flat and non-colored. It does not bother me much but I thought if it is colored, it will look better :)


>If you have questions which cannot be answered with the Prof-UIS help,
>do not hesitate to contact us


I have no support yet... I am currently trying Prof-UIS to see if it meets my needs. So far it looks very good!

Technical Support May 21, 2004 - 10:06 AM

Dear Dmitri,

We coded a CExtFlatRichEdit class, which allows a rich edit window to have a thin border painted with the current color of the paint manager.
Please note that this class kills the window’s scrollbars.

class CExtFlatRichEdit : public CRichEditCtrl
{
public:
  CExtFlatRichEdit::CExtFlatRichEdit()
    : CRichEditCtrl()
    , m_bNcCalcSize(false)
  {
  }
protected:
  bool m_bNcCalcSize;

  virtual LRESULT WindowProc( 
    UINT message, 
    WPARAM wParam, 
    LPARAM lParam
  )
  {
    switch( message )
    {
      case WM_NCCALCSIZE:
      {
        NCCALCSIZE_PARAMS * pNCCSP =
          reinterpret_cast < NCCALCSIZE_PARAMS * > ( lParam );
        ASSERT( pNCCSP != NULL );
        CRect rcInBarWnd( pNCCSP->rgrc[0] );
        rcInBarWnd.DeflateRect(
          2, 2, 2, 2
        );
        ::CopyRect( &(pNCCSP->rgrc[0]), rcInBarWnd );
        m_bNcCalcSize = true;
        return 0;
      } // case WM_NCCALCSIZE

      case WM_NCPAINT:
      {
        CRect rcInBarWnd, rcInBarClient;
        GetWindowRect( &rcInBarWnd );
        GetClientRect( &rcInBarClient );
        if( !m_bNcCalcSize ){
          SetWindowPos(
            NULL, 0, 0, 0, 0,
            SWP_NOMOVE|SWP_NOSIZE |SWP_NOZORDER
            |SWP_NOOWNERZORDER|SWP_FRAMECHANGED
          );
        }
        ClientToScreen( &rcInBarClient );
        if( rcInBarWnd == rcInBarClient ){
          return 0;
        }
        CPoint ptDevOffset = -rcInBarWnd.TopLeft();
        rcInBarWnd.OffsetRect( ptDevOffset );
        rcInBarClient.OffsetRect( ptDevOffset );

        CWindowDC dc( this );
        ASSERT( dc.GetSafeHdc() != NULL );
        dc.ExcludeClipRect( &rcInBarClient );

        static const TCHAR szEditBox[] = _T("RICHEDIT");
        TCHAR szCompare[sizeof(szEditBox)/sizeof(szEditBox[0])+1];
        ::GetClassName( 
          GetSafeHwnd(), 
          szCompare, 
          sizeof(szCompare)/sizeof(szCompare[0]) 
        );
        if( !lstrcmpi( szCompare, szEditBox ) ){
          bool bReadOnly = 
            ( (GetStyle() & ES_READONLY) != 0 ) ? true : false;
          dc.FillSolidRect(
            &rcInBarWnd, 
            bReadOnly 
              ? ::GetSysColor(COLOR_3DFACE)
              : g_PaintManager->GetColor(COLOR_WINDOW)
          );
        }

        g_PaintManager->PaintResizableBarChildNcAreaRect(
          dc,
          rcInBarWnd,
          this
        );

        return 0;
      } // case WM_NCPAINT
    }; // switch( message )

    return CRichEditCtrl::WindowProc( message, wParam, lParam );
  };
}; // class CExtFlatRichEdit