示例#1
0
// @pymethod |PyCPropertySheet|RemovePage|Removes the specified page from the sheet.
PyObject *ui_propsheet_remove_page( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS;
	if (!(pPS=GetPropSheet(self)))
		return NULL;
	PyObject *ob;
	// @pyparm int|offset||The page number to remove
	// @pyparmalt1 <o PyCPropertyPage>|page||The page to remove
	if (!PyArg_ParseTuple( args, "O", &ob))
		return NULL;
	if (PyInt_Check(ob)) {
		int id = (int)PyInt_AsLong(ob);
		GUI_BGN_SAVE;
		pPS->RemovePage(id);
		GUI_END_SAVE;
	} 
	else if (ui_base_class::is_uiobject(ob, &PyCPropertyPage::type)) {
  		CPythonPropertyPage * pPage = GetPropPage(ob);
		if (!pPage)
			return NULL;
		GUI_BGN_SAVE;
		pPS->RemovePage(pPage);
		GUI_END_SAVE;
	} else
		RETURN_TYPE_ERR("passed object must be an integer or PyCPropertyPage object");
	RETURN_NONE;
}
/* OnSetActive
 * ----------------------------------------------------------------------------
 */
BOOL CPropLangPath::OnSetActive() 
{
	m_bCheckPath = TRUE;
	m_bSkipTest	 = FALSE;

	BOOL bIsInstSomething = GetInstall()->IsInstSomething();

	// If a 4C component is already installed, disable path selection
	m_cChangePath.EnableWindow(! bIsInstSomething);
	m_cInstallPath.EnableWindow(! bIsInstSomething);
	m_cBoxPath.EnableWindow(! bIsInstSomething);


// P.E. OSAI - 24/04/09
// Box sempre disabilitato. default lingua inglese
//	// If a 4C component is already installed, disable language selection
//	m_cBoxLanguage.EnableWindow(! bIsInstSomething);
//	m_cLanguage.EnableWindow(! bIsInstSomething);
//	
	m_cBoxLanguage.EnableWindow(FALSE);
	m_cLanguage.EnableWindow(FALSE);
//

	GetPropSheet()->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
	
	return CPropBase::OnSetActive();
}
示例#3
0
// @pymethod |PyCPropertySheet|SetWizardMode|Enables the wizard mode
PyObject *ui_propsheet_set_wizard_mode( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS = pPS=GetPropSheet(self);
	if (!pPS) return NULL;
	CHECK_NO_ARGS2(args,SetWizardMode);
	GUI_BGN_SAVE;
	pPS->SetWizardMode();
	GUI_END_SAVE;
	RETURN_NONE;
}
示例#4
0
// @pymethod |PyCPropertySheet|SetWizardButtons|Enables the wizard buttons
PyObject *ui_propsheet_set_wizard_buttons( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS = pPS=GetPropSheet(self);
	if (!pPS) return NULL;
	int flags;
	// @pyparm int|flags||The wizard flags
	if (!PyArg_ParseTuple( args, "i", &flags))
		return NULL;
	GUI_BGN_SAVE;
	pPS->SetWizardButtons(flags);
	GUI_END_SAVE;
	RETURN_NONE;
}
示例#5
0
// @pymethod |PyCPropertySheet|EndDialog|Closes the dialog, with the specified result.
PyObject *ui_propsheet_end_dialog( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS = pPS=GetPropSheet(self);
	if (!pPS) return NULL;
	int result;
	// @pyparm int|result||The result to be returned by DoModal.
	if (!PyArg_ParseTuple( args, "i", &result))
		return NULL;
	GUI_BGN_SAVE;
	pPS->EndDialog(result);
	GUI_END_SAVE;
	RETURN_NONE;
}
示例#6
0
// @pymethod |PyCPropertySheet|SetFinishText|Sets the text for the Finish button
PyObject *ui_propsheet_set_finish_text( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS = pPS=GetPropSheet(self);
	if (!pPS) return NULL;
	TCHAR *text;
	PyObject *obtext;
	// @pyparm string|text||The next for the button
	if (!PyArg_ParseTuple( args, "O", &obtext))
		return NULL;
	if (!PyWinObject_AsTCHAR(obtext, &text, FALSE))
		return NULL;
	GUI_BGN_SAVE;
	pPS->SetFinishText(text);
	GUI_END_SAVE;
	PyWinObject_FreeTCHAR(text);
	RETURN_NONE;
}
示例#7
0
// @pymethod int|PyCPropertySheet|DoModal|Displays the property sheet as a modal dialog.
PyObject *ui_propsheet_do_modal( PyObject *self, PyObject *args )
{
	CHECK_NO_ARGS(args);
	CPropertySheet *pPS;
	if (!(pPS=GetPropSheet(self)))
		return NULL;
	if (!PropSheetCheckForDisplay(pPS))
		return NULL;
	Py_INCREF(self);	// make sure Python doesnt kill the object while in a modal call.
					// really only for the common dialog(!?), and other non CPythonPropSheet's
	INT_PTR ret;
	GUI_BGN_SAVE;
	ret = pPS->DoModal();
	GUI_END_SAVE;
	DODECREF(self);
	return PyWinObject_FromDWORD_PTR(ret);
}
示例#8
0
// @pymethod |PyCPropertySheet|SetPSHBit|Sets or clears a bit in m_psh.dwFlags
PyObject *ui_propsheet_set_pshbit( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS = pPS=GetPropSheet(self);
	if (!pPS) return NULL;
	DWORD bitMask = 0;
    BOOL bitValue = 0;
	
	if (!PyArg_ParseTuple( args, "ii",
              &bitMask,   // @pyparm int|bitMask||The PSH_* bit mask constant
              &bitValue)) // @pyparm int|bitValue||1 to set, 0 to clear
		return NULL;
	GUI_BGN_SAVE;
    if (bitValue) {
        pPS->m_psh.dwFlags |= bitMask;
    } else {
        pPS->m_psh.dwFlags &= ~bitMask;
    }
	GUI_END_SAVE;
	RETURN_NONE;
}
示例#9
0
// @pymethod |PyCPropertySheet|PressButton|Simulates the choice of the specified button in a property sheet.
PyObject *ui_propsheet_press_button( PyObject *self, PyObject *args )
{
	CPropertySheet *pPS = pPS=GetPropSheet(self);
	if (!pPS) return NULL;
	int button;
	// @pyparm int|button||The button to press
	if (!PyArg_ParseTuple( args, "i", &button))
		return NULL;
	GUI_BGN_SAVE;
	BOOL ok = TRUE;
#if _MFC_VER < 0x0710
	ok =
#endif
		pPS->PressButton(button);

	GUI_END_SAVE;
	if (!ok)
		RETURN_ERR("PressButton failed");
	RETURN_NONE;
}
/* OnSetActive
 * ----------------------------------------------------------------------------
 */
BOOL CPropSelEmb::OnSetActive() 
{
	GetPropSheet()->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
	
	return CPropBase::OnSetActive();
}