![]() ![]() |
||
Steps: 1.Add the following codes within the header of dialog:
a. Create arrow drop - down control:
FOPDropDownBitmapPickerButton DropDownButton;
int savedBitmapIndex;
FOPDropDownShadowPickerButton DropShadowButton;
int savedShadowIndex;
b. Create bullet control:
CFOBulletTypeWnd m_wndBulleted;
c. Create drop - down color picker:
// Dialog Data
//{{AFX_DATA(CColorTypeDlg)
enum { IDD = IDD_COLOR_PAGE };
FOPDropDownColorPickerButton m_wndColor;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
COLORREF m_crValue1;
COLORREF m_crValue2;
COLORREF m_crValue3;
CFODropColorPaletteWnd m_wndColorPanel; // Color select wnd.
d. Create drop - down line picker:
//{{AFX_DATA(CLineStyleTypeDlg)
enum { IDD = IDD_LINETYPE_PAGE };
FOPDropDownLineTypeButton m_wndLineType;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
int m_nValue1;
e. Create drop - down line width picker:
//{{AFX_DATA(CLineWidthTypeDlg)
enum { IDD = IDD_LINEWIDTH_PAGE };
FOPDropDownLineWidthButton m_wndLineWidth;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
int m_nValue1;
f. Create other control of E-XD++:
//{{AFX_DATA(COtherControlDlg)
enum { IDD = IDD_OTHER_PAGE };
int m_xStep; // step of spin x
int m_yStep; // step of spin y
CFOFontNameCombo m_FontCombo;
int m_nAngle;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
CFOAngleEditBox m_AngleEdit;
CFOAngleWnd m_AngleCtrl;
CFOSliderEdit m_GridX;
CFOSliderEdit m_GridY;
2.Add the following codes also:
a. For arrow picker:
void CArrowTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CArrowTypeDlg)
DDX_Control(pDX, IDC_BUTTON_PICKER, m_wndArrow);
DDX_ArrowDropDown(pDX, IDC_BUTTON_PICKER, m_nValue1);
DDX_Control(pDX, IDC_BUTTON3, DropDownButton);
DDX_IndexedDropDown(pDX, IDC_BUTTON3, savedBitmapIndex);
DDX_Control(pDX, IDC_BUTTON6, DropShadowButton);
DDX_LineWidthDropDown(pDX, IDC_BUTTON6, savedShadowIndex);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL CArrowTypeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
DropDownButton.GetDrawImpl().SetDefaultCols(5);
DropDownButton.SetTransparency(true);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
b. For bullet control:
BOOL CBulletesTypeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CRect theRect;
GetDlgItem(IDC_PANEL)->GetWindowRect( &theRect );
ScreenToClient(&theRect);
m_wndBulleted.Create(WS_CHILD|WS_VISIBLE|WS_EX_CLIENTEDGE,theRect,this,4434,m_nBulletedType);
m_wndBulleted.GetBulletedControl()->SetBorderType(BORDER_ETCHED);
m_wndBulleted.GetBulletedControl()->SetBulletType(m_nBulletedType);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
c. For color picker:
void CColorTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CColorTypeDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_BUTTON_COLORPICKER, m_wndColor);
DDX_ColorDropDown(pDX, IDC_BUTTON_COLORPICKER, m_crValue2);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
void CColorTypeDlg::OnButtonColordlg()
{
// TODO: Add your control notification handler code here
CFOColorDialog dlg;// (crNewColor, CC_FULLOPEN | CC_ANYCOLOR);
dlg.SetColor(m_crValue1);
if (dlg.DoModal () == IDOK)
{
m_crValue1 = dlg.GetColor();
CString strValue;
strValue.Format("%u,%u,%u",GetRValue(m_crValue1),GetGValue(m_crValue1),GetBValue(m_crValue1));
GetDlgItem(IDC_COLORVALUE)->SetWindowText(strValue);
}
}
BOOL CColorTypeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString strValue;
strValue.Format("%u,%u,%u",GetRValue(m_crValue1),GetGValue(m_crValue1),GetBValue(m_crValue1));
GetDlgItem(IDC_COLORVALUE)->SetWindowText(strValue);
strValue.Format("%u,%u,%u",GetRValue(m_crValue2),GetGValue(m_crValue2),GetBValue(m_crValue2));
GetDlgItem(IDC_COLORVALUE2)->SetWindowText(strValue);
strValue.Format("%u,%u,%u",GetRValue(m_crValue3),GetGValue(m_crValue3),GetBValue(m_crValue3));
GetDlgItem(IDC_COLORVALUE3)->SetWindowText(strValue);
CRect theRect;
GetDlgItem(IDC_PANEL)->GetWindowRect( &theRect );
ScreenToClient(&theRect);
m_wndColorPanel.Create(WS_CHILD|WS_VISIBLE,theRect, this,4232,m_crValue3);
m_wndColorPanel.GetColorControl()->SetBorderType(BORDER_ETCHED);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CColorTypeDlg::OnNcActivate(BOOL bActive)
{
if (FODiscardNcActivate())
return TRUE;
return CDialog::OnNcActivate(bActive);
}
d. For fill type control:
void CFillTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFillTypeDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_BUTTON_PICKER, m_wndFillType);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
DDX_FODropBrushTypeButton(pDX,IDC_BUTTON_PICKER,m_nValue1);
}
BOOL CFillTypeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CRect theRect;
GetDlgItem(IDC_PANEL)->GetWindowRect( &theRect );
ScreenToClient(&theRect);
m_wndPanel.Create(WS_CHILD|WS_VISIBLE,theRect, this,4232,m_nValue2);
m_wndPanel.GetBrushControl()->SetBorderType(BORDER_ETCHED);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
e. For line type control:
void CLineStyleTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLineStyleTypeDlg)
DDX_Control(pDX, IDC_BUTTON_PICKER, m_wndLineType);
DDX_LineTypeDropDown(pDX, IDC_BUTTON_PICKER, m_nValue1);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
f. For line width drop - down control:
void CLineWidthTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLineWidthTypeDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_BUTTON_PICKER, m_wndLineWidth);
DDX_LineWidthDropDown(pDX, IDC_BUTTON_PICKER, m_nValue1);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
g. For other controls:
void COtherControlDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COtherControlDlg)
DDX_Text(pDX, IDC_EDIT_VALUE1, m_xStep);
DDX_Text(pDX, IDC_EDIT_VALUE2, m_yStep);
DDV_MinMaxInt(pDX, m_xStep, 1, 40);
DDV_MinMaxInt(pDX, m_yStep, 1, 40);
DDX_Control(pDX, IDC_COMBO_FONT, m_FontCombo);
DDX_Text(pDX, IDC_ANGLE_EDIT, m_nAngle);
DDV_MinMaxInt(pDX, m_nAngle, 0, 360);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL COtherControlDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_GridX.AttachEdit(IDC_EDIT_VALUE1,this);
m_GridY.AttachEdit(IDC_EDIT_VALUE2,this);
m_GridX.SetRange(1,40);
m_GridY.SetRange(1,40);
// m_FontCombo.DoInit();
// m_FontCombo.SelectString(-1,m_Font.m_strFaceName);
m_AngleCtrl.SubclassDlgItem(IDC_ANGLE_WND, this);
m_AngleEdit.SubclassDlgItem(IDC_ANGLE_EDIT, this);
m_AngleCtrl.AttachToEditBox(&m_AngleEdit);
m_AngleEdit.AttachToAngleBox(&m_AngleCtrl);
m_AngleCtrl.TurnOnNow(TRUE);
m_AngleEdit.SetWindowText(_T("0"));
m_AngleCtrl.SetAngleValue(0, TRUE);
m_AngleCtrl.SetBackColor(::GetSysColor(COLOR_ACTIVECAPTION));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
|
Copyright ?1998-2007 UCanCode.Net Software, all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.
Please direct your questions or comments to webmaster@ucancode.com