コード例 #1
0
ファイル: schedulerDlg.cpp プロジェクト: khiemnv/utilities
BOOL CschedulerDlg::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
	//mutex
	m_mutex = OpenMutex(MUTEX_ALL_ACCESS ,FALSE,_T("herb"));
	
	if (m_mutex==0)
	{
		CreateMutex(NULL,FALSE,_T("herb"));
	}
	else
	{
		EndDialog(1);
		return 0;
	}


	m_app=AfxGetApp();

	
	//set min size
	CRect temprect(0,0,300,200);
	setMinRect(temprect);

	m_pData=(ITEMDATA**)calloc(KS_MAX_ITIMES,sizeof(ITEMDATA*));
	for(int i=0;i<KS_MAX_ITIMES;i++)
		m_pData[i]=0;

	m_now.SetFormat(_T("dd  HH:mm:ss"));
	m_list.SetExtendedStyle(LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT);
	m_hours.SetFormat(_T("HH:mm:ss"));

	COleDateTime mytime;
	/*mytime.Format(_T("dd HH:MM"));*/
	mytime.SetTime(0,0,0);
	m_hours.SetTime(mytime);

	//m_list.InsertColumn(0,_T("Time"),0,LVCF_DEFAULTWIDTH);
	m_list.InsertColumn(1,_T("Sub"),0,LVCF_DEFAULTWIDTH);
	m_list.InsertColumn(2,_T("Note"),0,LVCF_DEFAULTWIDTH);
	m_list.InsertColumn(0,_T("Date"),0,LVCF_DEFAULTWIDTH);


	SetTimer(1,KS_DELAY,0);
	SetTimer(2,1000,0);
	SetTimer(3,KS_STORE_TIMER,0);

	m_timeSyn=m_app->GetProfileInt(_T("KScheduler"),_T("update_time"),0);	
	m_nowChk.SetCheck(m_timeSyn);

	restoreNote();
	updatePosition(KS_SETPOS);
	updateSetting();
	return TRUE;  // return TRUE  unless you set the focus to a control
}
コード例 #2
0
ファイル: layout.cpp プロジェクト: JickLee/Core
void UILayout::resize(const vec2& pos) {
    setMinRect(glm::abs(this->pos - pos));
}