Sie sind auf Seite 1von 4

// Tema_2Dlg.

cpp : implementation file


//

#include "stdafx.h"
#include "Tema_2.h"
#include "Tema_2Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

CString myInTxt, myOutTxt;


int rez_1,rez_2;

// CTema_2Dlg dialog

CTema_2Dlg::CTema_2Dlg(CWnd* pParent /*=NULL*/)


: CDialog(CTema_2Dlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CTema_2Dlg::DoDataExchange(CDataExchange* pDX)


{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, m_dateText, v_dateText);
DDX_Control(pDX, m_dateReale, v_dateReale);
DDX_Control(pDX, m_dateIntregi, v_dateIntregi);
DDX_Control(pDX, m_ascunde, v_ascunde);
DDX_Control(pDX, m_valideaza, v_valideaza);
DDX_Control(pDX, IDC_EDIT1, v_edit1);
DDX_Control(pDX, IDC_EDIT2, v_edit2);
}

BEGIN_MESSAGE_MAP(CTema_2Dlg, CDialog)
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
ON_WM_SIZE()
#endif
//}}AFX_MSG_MAP
ON_BN_CLICKED(m_dateText, &CTema_2Dlg::OnBnClickeddatetext)
ON_BN_CLICKED(m_dateReale, &CTema_2Dlg::OnBnClickeddatereale)
ON_BN_CLICKED(m_dateIntregi, &CTema_2Dlg::OnBnClickeddateintregi)
ON_BN_CLICKED(m_ascunde, &CTema_2Dlg::OnBnClickedascunde)
ON_BN_CLICKED(m_valideaza, &CTema_2Dlg::OnBnClickedvalideaza)
END_MESSAGE_MAP()

// CTema_2Dlg message handlers

BOOL CTema_2Dlg::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

// TODO: Add extra initialization here


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

#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)


void CTema_2Dlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
if (AfxIsDRAEnabled())
{
DRA::RelayoutDialog(
AfxGetResourceHandle(),
this->m_hWnd,
DRA::GetDisplayMode() != DRA::Portrait ?
MAKEINTRESOURCE(IDD_TEMA_2_DIALOG_WIDE) :
MAKEINTRESOURCE(IDD_TEMA_2_DIALOG));
}
}
#endif

void CTema_2Dlg::OnBnClickeddatetext()
{
v_edit1.GetWindowTextW(myInTxt);
myOutTxt.Format(_T("Textul este: %s "),myInTxt);
v_edit2.SetWindowTextW(myOutTxt);

void CTema_2Dlg::OnBnClickeddatereale()
{
char v;
v_edit1.GetWindowTextW(myInTxt);
//rez = _wtof (myInputText.GetBuffer());
rez_1 = wcstoul (myInTxt.GetBuffer(), '\0', 10);
rez_1 = rez_1 *2;
myOutTxt.Format(_T("Dublul este: %d "), rez_1);
v_edit2.SetWindowTextW(myOutTxt);
}

void CTema_2Dlg::OnBnClickeddateintregi()
{
v_edit1.GetWindowTextW(myInTxt);
//rez_1 = _wtof(myInputText.GetBuffer());
rez_2 = wcstoul (myInTxt.GetBuffer(), '\0', 10);
rez_2 = rez_2 *3;
myOutTxt.Format(_T("Triplul este: %d "), rez_2);
v_edit2.SetWindowTextW(myOutTxt);
}

void CTema_2Dlg::OnBnClickedascunde()
{
int ascunde;
ascunde = v_ascunde.GetCheck();

if (ascunde == 0)
v_dateText.ShowWindow(1);
else
v_dateText.ShowWindow(0);
}
void CTema_2Dlg::OnBnClickedvalideaza()
{
int valideaza;
valideaza = v_valideaza.GetCheck();

if (valideaza == 0)
v_dateText.EnableWindow(1);
else
v_dateText.EnableWindow(0);
}

// Tema_2.cpp : Defines the class behaviors for the application.


//

#include "stdafx.h"
#include "Tema_2.h"
#include "Tema_2Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CTema_2App

BEGIN_MESSAGE_MAP(CTema_2App, CWinApp)
END_MESSAGE_MAP()

// CTema_2App construction
CTema_2App::CTema_2App()
: CWinApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

// The one and only CTema_2App object


CTema_2App theApp;
// CTema_2App initialization

BOOL CTema_2App::InitInstance()
{
// SHInitExtraControls should be called once during your application's
initialization to initialize any
// of the Windows Mobile specific controls such as CAPEDIT and SIPPREF.
SHInitExtraControls();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));

CTema_2Dlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}

// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

Das könnte Ihnen auch gefallen