void CCalendarLayoutDlg::Initialize()
{
	m_iCurrYrStyle = m_iYrStyle;
	m_iCurrWkStyle = m_iWkStyle;
	m_bCurrHideBoxes = m_bHideBoxes;
	m_bCurrHideAllBoxes = m_bHideAllBoxes;
	m_iCurrCalMonth = m_iCalMonth;
	m_iCurrCalYear = m_iCalYear;
	m_iCurrTitleSize = m_iTitleSize;
	m_iCurrWkSize = m_iWkSize;
	m_bCurrWeekStart = m_bWeekStart;

	StuffCombos();
	InitCombo(IDC_STYLE_MONTHYEAR, m_iCurrYrStyle);
	InitCombo(IDC_STYLE_WEEK, m_iCurrWkStyle);
	InitCombo(IDC_TITLE_SIZE, m_iCurrTitleSize);
	InitCombo(IDC_WEEK_SIZE, m_iCurrWkSize);

	if (m_bCurrHideBoxes)
	{
		CheckDlgButton(IDC_UNUSEDBOXES_INVISIBLE, BST_CHECKED);
		::EnableWindow(GetDlgItem(IDC_LASTROW_BOXES), true);
		::EnableWindow(GetDlgItem(IDC_ALLBOXES), true);
	}
	else
	{
		CheckDlgButton(IDC_UNUSEDBOXES_INVISIBLE, BST_UNCHECKED);
		::EnableWindow(GetDlgItem(IDC_LASTROW_BOXES), false);
		::EnableWindow(GetDlgItem(IDC_ALLBOXES), false);
	}

	bool bSunStart = (m_bCurrWeekStart==CALSTYLES::SUNDAY_START);
	CheckRadioButton(IDC_ALLBOXES, IDC_LASTROW_BOXES, (m_bCurrHideAllBoxes?IDC_ALLBOXES:IDC_LASTROW_BOXES));
	CheckRadioButton(IDC_MONDAY_START, IDC_SUNDAY_START, (bSunStart?IDC_SUNDAY_START:IDC_MONDAY_START));
}
void COXHistoryCombo::PreSubclassWindow() 
{
	ASSERT_VALID(this);

	// ... Attached window must be valid
	ASSERT(m_hWnd != NULL);
	ASSERT(::IsWindow(m_hWnd));
	
	_AFX_THREAD_STATE* pThreadState=AfxGetThreadState();
	// hook not already in progress
	if(pThreadState->m_pWndInit==NULL)
	{
		if(GetParent() != NULL)
		{
			// Initialize this control
			InitCombo();
		}
	}

	// If GetParent() == NULL, this control is being created through Create()
	// and it is still to ealy to initialize, this will be done in OnCreate
	
	CComboBox::PreSubclassWindow();

	ASSERT_VALID(this);
}
Example #3
0
int CMonthComboBox::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CComboBox::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	InitCombo();
	
	return 0;
}
Example #4
0
void CRegister::InitDlgResource()
{
	ModifyStyleEx(WS_EX_TOOLWINDOW, WS_EX_APPWINDOW); 

	int i = 0;
	for(i; i < REGISTER_COMBO_ARRAY_COUNT; i++)
	{
		m_Combo[i].SubclassDlgItem(REGISTER_COMBO_ARRAY[i], this);
		InitCombo(&m_Combo[i], (char**)REGISTER_STRING_ARRAY[i], REGISTER_STRING_COUNT_ARRAY[i], 0);
	}
	for(i = 0; i < REGISTER_CHECK_ARRAY_COUNT; i++)
		m_Check[i].SubclassDlgItem(REGISTER_CHECK_ARRAY[i], this);
	m_EditOffenToWeb.SubclassDlgItem(IDC_EDIT_OFFEN_TO_WEB, this);
	m_EditOffenToWeb.SetLimitText(50);

	m_EditCity.SubclassDlgItem(IDC_REG_EDIT_CITY, this);
	m_EditCity.SetLimitText(20);

	m_EditRecommender.SubclassDlgItem(IDC_REG_EDIT_EMAIL2, this);
	m_EditRecommender.SetLimitText(50);

	m_StaticAd.SubclassDlgItem(IDC_AD, this);
	m_StaticAd.SetColor(COLOR_BLUE);

	m_HyperLink.SubclassDlgItem(IDC_WEB, this);

	InitCombo(&m_ComboGender, GUI_GENDER,  (sizeof(GUI_GENDER)  / sizeof(TCHAR*)), 0);
	InitCombo(&m_ComboDegree, GUI_DEGREE,  (sizeof(GUI_DEGREE)  / sizeof(TCHAR*)), 0);
	InitCombo(&m_ComboMetier, GUI_METIER,  (sizeof(GUI_METIER)  / sizeof(TCHAR*)), 0);
	InitCombo(&m_ComboSalary, GUI_SALARY,  (sizeof(GUI_SALARY)  / sizeof(TCHAR*)), 0);

	m_EditEmail.SetLimitText(50);
	m_EditName.SetLimitText(20);
	m_EditDuty.SetLimitText(20);
	m_EditZip.SetLimitText(6);
	m_EditAddress.SetLimitText(50);
	m_EditQq.SetLimitText(12);
	m_EditInc.SetLimitText(50);

	if(m_pInternet != NULL)
		m_UserInfo = m_pInternet->m_UserInfo;
	InitView(&m_UserInfo);
}
int COXHistoryCombo::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	ASSERT_VALID(this);

	if (CComboBox::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// ... Window must be valid
	ASSERT(m_hWnd != NULL);
	ASSERT(::IsWindow(m_hWnd));

	// Initialize this control
	// ... Pass on the window that will become the parent (GetParent() returns NULL at this point)
	InitCombo(CWnd::FromHandle(lpCreateStruct->hwndParent));

	ASSERT_VALID(this);
	return 0;
}
Example #6
0
BOOL BfTransfer::OnInitDialog()
{
	CXTraderApp* pApp = (CXTraderApp*)AfxGetApp();
	TCHAR szUser[MAX_PATH/2],szTitle[MAX_PATH];
	ansi2uni(CP_ACP,pApp->m_sINVESTOR_ID,szUser);

	_stprintf(szTitle,BFTRANS_TITLE,szUser);
	SetWindowText(szTitle);

	CString str;
	str.Format(_T("%.2f"),m_dTrsAmt);
	((CEdit*)GetDlgItem(IDC_TRANSAMT))->SetWindowText(str);

	((CEdit*)GetDlgItem(IDC_BKPASSWD))->SetWindowText(_T("1"));

	InitCombo();
	
	return TRUE;
}
Example #7
0
LRESULT CMapEditorView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_mapWidthEdit.Attach( GetDlgItem(IDC_MAPW) );
	m_mapHeightEdit.Attach( GetDlgItem(IDC_MAPH) );

	m_submitBtn.Attach( GetDlgItem(IDC_BTNSUBMIT) );
	m_initBtn.Attach( GetDlgItem(IDC_INITMAPBTN) );
	m_chooseInitMethodCombo.Attach( GetDlgItem(IDC_INITCHOOSE) );
	InitCombo();

	m_mapWidth = 0;
	m_mapHeight = 0;

	DoDataExchange(false);
	m_initBtn.EnableWindow(g_mapEditor.IsHasData());
	::EnableWindow(GetDlgItem(IDC_FIRFILTER), g_mapEditor.IsHasData());

	m_mapWidthEdit.SetReadOnly(true);
	m_mapHeightEdit.SetReadOnly(true);

	m_submitBtn.ShowWindow(false);
	return S_OK;
}
Example #8
0
void CMonthComboBox::PreSubclassWindow() 
{
	InitCombo();
	
	CComboBox::PreSubclassWindow();
}
Example #9
0
int CPropPerf::DialogProc(HWND hwndDlg, UINT uMsg,WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
	case WM_INITDIALOG:
	{
		if (!CDlgBase::DialogProc(hwndDlg, uMsg, wParam, lParam))
			return FALSE;

		InitCombo(_hInst, _hwndDlg, IDC_CBO_PERF_OPTIMIZE, gaPerfCombo, sizeof(gaPerfCombo)/sizeof(ComboItem));

		return LoadFromSettings();
		break;
	}

	case WM_COMMAND:
	{	
		if (HIWORD(wParam) == CBN_SELCHANGE)
		{
			int nSel = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
			if (nSel < 0)
				break;

			for (int i=0; i<MAX_PERF_CHECK_BOXES; i++)
			{
				BOOL fCheck = (nSel == MAX_COMBO_ITEMS - 1) ?  (HIWORD(gaPerfCombo[nSel].dwVal) & (1 << i) ) : (i < LOWORD(gaPerfCombo[nSel].dwVal) );
				SendDlgItemMessage(_hwndDlg, gadwPerfChkBox[i], BM_SETCHECK, fCheck ? BST_CHECKED : BST_UNCHECKED, 0);
			}
			break;
		}

		if (HIWORD(wParam) == BN_CLICKED)
		{
			UpdatePerfComboBox();
			break;
		}

		break;
	}

	case MSG_TSC_CONNECT:
	{
		SaveToSettings();
		EnableControls(_hwndDlg, gadwDisableCtls, sizeof(gadwDisableCtls)/sizeof(gadwDisableCtls[0]), FALSE);
		return TRUE;
	}

	case MSG_TSC_DISCONNECTED:
	{
		EnableControls(_hwndDlg, gadwDisableCtls, sizeof(gadwDisableCtls)/sizeof(gadwDisableCtls[0]), TRUE);
		return TRUE;
	}

	case WM_DESTROY:
	{
		return SaveToSettings();
	}

	default:
		break;
	}
	return CDlgBase::DialogProc(hwndDlg, uMsg, wParam, lParam);

}