Search This Blog

Showing posts with label xtreme toolkit. Show all posts
Showing posts with label xtreme toolkit. Show all posts

Wednesday, June 16, 2010

xtreme toolkit Sample Dialog Gradient Window Example



//In Header File

#include "c:\program files\codejock software\mfc\xtreme toolkitpro v13.0.0\source\controls\xtbutton.h"
#define HIGH_DLG_CLR RGB(163,194,236)
#define LOW_DLG_CLR RGB(220,235,253)


//public:
//Add Two buttons
CXTButton m_btnOK;
CXTButton m_edBTNNN;




//In CPP File
BOOL CextremeSampleDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
ASSERT(bNameValid);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

m_btnOK.SetTheme( new CXTButtonThemeOffice2003 ( TRUE ) );
m_edBTNNN.SetTheme( new CXTButtonThemeOfficeXP ( TRUE ) );
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon



return TRUE; // return TRUE unless you set the focus to a control
}


void CextremeSampleDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
CXTPClientRect rc(this);
CXTPPaintManager::SetTheme(xtpThemeOffice2003);
CXTPOffice2003Theme *pPaintManager = (CXTPOffice2003Theme *)XTPPaintManager();
/*pPaintManager->GradientFill(&dc, rc,
pPaintManager->m_clrCommandBar.clrLight,
pPaintManager->m_clrCommandBar.clrDark ,
NULL);*/

pPaintManager->GradientFill(&dc, rc,LOW_DLG_CLR, HIGH_DLG_CLR , NULL);
}