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 » Gradient Text Control Collapse All
Subject Author Date
Mel Sampat Jul 28, 2005 - 2:11 AM

I am building a UI similar to Outlook 2003 by following your sample. The navigation control is working great!


Next, I want to create the middle portion of Outlook UI, where the messages or items are displayed. At the top of that portion, a title has to be displayed (e.g. "Inbox", "Notes", "Calendar" etc).


How do I use Prof UIS to display such a gradient caption on top of a list view control? You are already using it at the top of the Outlook Navigation control, so I’m wondering if the gradient text control can be used independantly.


Thanks.


 

Technical Support Jul 28, 2005 - 9:26 AM

If you are using the PageNavigator application for your new project AS IS, then you can simply draw the caption at the top of the CChildView area. Here is the updated source code for the CChildView::OnPaint() method:

void CChildView::OnPaint() 
{
CRect rcClient;
    GetClientRect( &rcClient );
CPaintDC dcPaint( this );
CExtMemoryDC dc( &dcPaint, &rcClient );
    dc.FillSolidRect(
        rcClient, 
        g_PaintManager->GetColor(
            COLOR_WINDOW,
            (CObject*)this
            )
        );
    g_PaintManager->PaintResizableBarChildNcAreaRect(
        dc,
        rcClient,
        this
        );
CRect rcCaption = rcClient;
    rcCaption.bottom = rcCaption.top + 25;
CExtSafeString sCaption = _T("PageNavigator");
    g_PaintManager->PaintPageNavigatorItemCaption(
        dc,
        rcCaption,
        sCaption
        );
    g_PaintManager->PaintResizableBarChildNcAreaRect(
        dc,
        rcCaption,
        this
        );
}
The caption over the main view area can be implemented as a separate window and we can code it for you. In this case we need the exact description of your application layout.

Mel Sampat Jul 28, 2005 - 10:48 AM

Thank you, that worked great! One more question:


In this line:
rcCaption.bottom = rcCaption.top + 25; 


The value 25 is hard coded. Is it also hard coded in the ProfUIS library? If not, is there a way to dynamically obtain the title bar’s height instead of hard coding?


Thanks!



 

Technical Support Jul 28, 2005 - 1:19 PM

Value 25 is equal to (24+1) with 1 being the top border width of the CChildView window and 24 being the value returned by the CExtPageNavigatorWnd::OnQueryItemCaptionHeight() virtual method which should be used in computations instead of the hard-coded value 25. We noticed that the height of the gradient caption in MS Outlook is equal to 24 regardless of any conditions.