SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
This sample illustrates various button labels, text, images.
The source code is located at C:\Program Files (x86)\Softelvdm\SftButton OCX 3.0\Samples\VC++\Label\LabelDlg.cpp or C:\Program Files\Softelvdm\SftButton OCX 3.0\Samples\VC++\Label\LabelDlg.cpp (on 32-bit Windows versions).
// LabelDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Label.h"
#include "LabelDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLabelDlg dialog
CLabelDlg::CLabelDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLabelDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLabelDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CLabelDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLabelDlg)
DDX_Control(pDX, IDC_TITLE, m_Title);
DDX_Control(pDX, IDC_SFTBTN8, m_Button8);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLabelDlg, CDialog)
//{{AFX_MSG_MAP(CLabelDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLabelDlg message handlers
BOOL CLabelDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 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
// Make a bold font for the dialog title
CFont* pFont = GetFont(); // get dialog font
LOGFONT lf;
pFont->GetLogFont(&lf);
lf.lfWeight += (FW_BOLD-FW_NORMAL);
m_BoldFont.CreateFontIndirect(&lf);
m_Title.SetFont(&m_BoldFont);
// Get all ISftButton interface pointers for access to all
// properties and methods (see Using SftButton/OCX with Visual C++
// in the online help for more information)
m_vButton8 = m_Button8.GetControlUnknown();
m_vButton8->Text = _bstr_t(_T("Two Lines\nof Text"));
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CLabelDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CLabelDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}