示例#1
0
// @pymethod int|PyCPropertySheet|OnInitDialog|Calls the default MFC OnInitDialog handler.
static PyObject *ui_propsheet_on_init_dialog( PyObject *self, PyObject *args )
{
	class HackProtected : public CPythonPropertySheet
	{
	public:
		BOOL BaseOnInitDialog(void) {return CPropertySheet::OnInitDialog();}
	};
	CPythonPropertySheet *pPS = GetPythonPropSheet(self);
	if (pPS==NULL)
		return NULL;
	CHECK_NO_ARGS2(args, OnInitDialog );
	GUI_BGN_SAVE;
	BOOL rc = ((HackProtected *)pPS)->BaseOnInitDialog();
	GUI_END_SAVE;
	// @xref <vm PyCPropertySheet::OnInitDialog>
	return Py_BuildValue("i", rc);
}
	{"SetItem",        PyCListCtrl_SetItem, 1}, // @pymeth SetItem|Sets some of all of an items attributes.
	{"SetItemState",   PyCListCtrl_SetItemState, 1}, // @pymeth SetItemState|Changes the state of an item in a list view control.
	{"GetItemState",   PyCListCtrl_GetItemState, 1}, // @pymeth GetItemState|Retrieves the state of a list view item.
	{"SetItemData",    PyCListCtrl_SetItemData, 1}, // @pymeth SetItemData|Sets the item's application-specific value.
	{"GetItemData",    PyCListCtrl_GetItemData, 1}, // @pymeth GetItemData|Retrieves the application-specific value associated with an item.
	{"SetItemCount",   PyCListCtrl_SetItemCount, 1}, // @pymeth SetItemCount|Prepares a list view control for adding a large number of items.
	{"GetItemCount",   PyCListCtrl_GetItemCount, 1}, // @pymeth GetItemCount|Retrieves the number of items in a list view control.
	{"SetItemText",    PyCListCtrl_SetItemText, 1}, // @pymeth SetItemText|Changes the text of a list view item or subitem.
	{"GetItemText",    PyCListCtrl_GetItemText, 1}, // @pymeth GetItemText|Retrieves the text of a list view item or subitem.
	{"RedrawItems",    PyCListCtrl_RedrawItems, 1}, // @pymeth RedrawItems|Redraws a range of items
	{"Update",         PyCListCtrl_Update, 1}, // @pymeth Update|Forces the control to repaint a specified item.

	{"SetColumn",      PyCListCtrl_SetColumn,  1}, // @pymeth SetColumn|Sets the state of a column in a list control when in report view.
	{"DeleteColumn",   PyCListCtrl_DeleteColumn,  1}, // @pymeth DeleteColumn|Deletes the specified column from the list control.
	{"GetColumnWidth", PyCListCtrl_GetColumnWidth,  1}, // @pymeth GetColumnWidth|Gets the width of the specified column in the list control.
	{"SetColumnWidth", PyCListCtrl_SetColumnWidth,  1}, // @pymeth SetColumnWidth|Sets the width of the specified column in the list control.
	{"GetStringWidth", PyCListCtrl_GetStringWidth,  1}, // @pymeth GetStringWidth|Gets the necessary column width to fully display this text in a column.
	{"HitTest",        PyCListCtrl_HitTest, 1}, // @pymeth HitTest|Determines which list view item, if any, is at a specified position.
	{"GetItemPosition",PyCListCtrl_GetItemPosition, 1}, // @pymeth GetItemPosition|Determines the position of the specified item.
	{NULL,			NULL}
};


ui_type_CObject PyCListCtrl::type("PyCListCtrl", 
									 &PyCWnd::type, 
									 RUNTIME_CLASS(CListCtrl), 
									 sizeof(PyCListCtrl), 
									 PYOBJ_OFFSET(PyCListCtrl), 
									 PyCListCtrl_methods, 
									 GET_PY_CTOR(PyCListCtrl));
示例#3
0
	if (!PyArg_ParseTuple (args, ":PumpMessages"))
		return NULL;
	CProtectedWinThread *pThread = GetProtectedThread();
	if (!pThread) return NULL;
	GUI_BGN_SAVE;
	pThread->PumpMessages();
	GUI_END_SAVE;
	RETURN_NONE;
	// @comm This allows an application which is performing a long operation to dispatch paint messages during the operation.
}


// @object PyCWinThread|An application class.  Encapsulates an MFC <c CWinThread> class
static struct PyMethodDef PyCWinThread_methods[] = {
	{"CreateThread",            ui_thread_create_thread, 1}, // @pymeth CreateThread|Creates the actual thread behind the thread object.
	{"PumpIdle",                ui_thread_pump_idle,         1}, // @pymeth PumpIdle|Pumps idle messages.
	{"PumpMessages",			ui_thread_pump_messages, 1}, // @pymeth PumpMessages|Pumps all messages to the application until a WM_QUIT message is received.
	{"Run",    					ui_thread_run, 1}, // @pymeth Run|Starts the main application message pump.
	{"SetMainFrame",    	    ui_thread_set_main_frame, 1}, // @pymeth SetMainFrame|Sets the C++ applications main frame
	{"SetThreadPriority",       ui_thread_set_thread_priority, 1}, // @pymeth SetThreadPriority|Sets the threads priority
	{NULL,			NULL}
};
ui_type_CObject PyCWinThread::type("PyCWinThread", 
								&PyCCmdTarget::type,
								RUNTIME_CLASS(CWinThread), 
								sizeof(PyCWinThread), 
								PYOBJ_OFFSET(PyCWinThread), 
								PyCWinThread_methods, 
								GET_PY_CTOR(PyCWinThread) );

示例#4
0
	}
	if (!PyWinObject_AsResourceId(obTemplate, &szTemplate, FALSE))
		return NULL;
	BOOL rc;
    GUI_BGN_SAVE;
    if (IS_INTRESOURCE(szTemplate))
		rc=pDialog->Create(pParent, MAKEINTRESOURCE(szTemplate), style, id);
	else
        rc=pDialog->Create(pParent, szTemplate, style, id);
    GUI_END_SAVE;
	PyWinObject_FreeResourceId(szTemplate);
	if (!rc)
        RETURN_ERR("CDialogBar::Create failed");
    RETURN_NONE;
}

// @object PyCDialogBar|A class which encapsulates an MFC <o CDialogBar>.  Derived from a <o PyCControlBar> object.
static struct PyMethodDef PyCDialogBar_methods[] =
{
	{ "CreateWindow", PyCDialogBar_CreateWindow, 1}, // @pymeth CreateWindow|Creates the window for the <o PyCDialogBar> object.
	{ NULL,			NULL }
};

ui_type_CObject PyCDialogBar::type ("PyCDialogBar",
					&PyCControlBar::type, 
					RUNTIME_CLASS(CDialogBar),
					sizeof(PyCDialogBar),
					PYOBJ_OFFSET(PyCDialogBar),
					PyCDialogBar_methods,
					GET_PY_CTOR(PyCDialogBar));
示例#5
0
		ob = Py_None;
	Py_INCREF(ob);
	return ob;
}

// @object PyAssocObject|An internal class.
static struct PyMethodDef PyAssocObject_methods[] = {
	{"AttachObject",    ui_assoc_object::AttachObject, 1 }, // @pymeth AttachObject|Attaches a Python object for lookup of "virtual" functions.
	{"GetAttachedObject", ui_assoc_object::GetAttachedObject, 1 }, // @pymeth GetAttachedObject|Returned the attached Python object, or None.
	{NULL, NULL}
};

ui_type ui_assoc_object::type("(abstract) PyAssocObject", 
							  &ui_base_class::type, 
							  sizeof(ui_assoc_object), 
							  PYOBJ_OFFSET(ui_assoc_object), 
							  PyAssocObject_methods, 
							  NULL);

ui_assoc_object::ui_assoc_object()
{
	assoc=0;
	virtualInst=NULL;
}
ui_assoc_object::~ui_assoc_object()
{
#ifdef TRACE_ASSOC
	CString rep = repr();
	const char *szRep = rep;
	TRACE("Destroying association with %p and %s",this,szRep);
#endif
// @object PyCEdit|A windows edit control.  Encapsulates an MFC <c CEdit> class.  Derived from a <o PyCControl> object.
static struct PyMethodDef PyCEdit_methods[] = {
	{"CreateWindow",    PyCEdit_create_window,1}, // @pymeth CreateWindow|Creates the window for a new edit object.
	{"Clear",			PyCEdit_clear,				1}, // @pymeth Clear|Clears all text from an edit control.
	{"Copy",			PyCEdit_copy,				1}, // @pymeth Copy|Copy the selection to the clipboard.
	{"Cut",				PyCEdit_cut,				1}, // @pymeth Cut|Cut the selection, and place it in the clipboard.
	{"FmtLines",		PyCEdit_fmt_lines,			1}, // @pymeth FmtLines|Change the formatting options for the edit control
	{"GetFirstVisibleLine",PyCEdit_get_first_visible,1}, // @pymeth GetFirstVisibleLine|Returns zero-based index of the topmost visible line.
	{"GetSel",			PyCEdit_get_sel,			1}, // @pymeth GetSel|Returns the selection.
	{"GetLine",			PyCEdit_get_line,			1}, // @pymeth GetLine|Returns a specified line.
	{"GetLineCount",	PyCEdit_get_line_count,		1}, // @pymeth GetLineCount|Returns the number of lines in an edit control.
	{"LimitText",	    PyCEdit_limit_text,			1}, // @pymeth LimitText|Sets max length of text that user can enter
	{"LineFromChar",	PyCEdit_line_from_char,		1}, // @pymeth LineFromChar|Returns the line number of a given character.
	{"LineIndex",		PyCEdit_line_index,			1}, // @pymeth LineIndex|Returns the line index
	{"LineScroll",		PyCEdit_line_scroll,		1}, // @pymeth LineScroll|Scroll the control vertically and horizontally
	{"Paste",			PyCEdit_paste,				1}, // @pymeth Paste|Pastes the contents of the clipboard into the edit control.
	{"ReplaceSel",		PyCEdit_replace_sel,		1}, // @pymeth ReplaceSel|Replace the selection with the specified text.
	{"SetReadOnly",		PyCEdit_set_readonly,		1}, // @pymeth SetReadOnly|Set the read only status of an edit control.
	{"SetSel",			PyCEdit_set_sel,			1}, // @pymeth SetSel|Changes the selection in an edit control.
	{NULL,			NULL}		// sentinel
};

ui_type_CObject PyCEdit::type("PyCEdit",
							  &ui_control_object::type, 
							  RUNTIME_CLASS(CEdit), 
							  sizeof(PyCEdit), 
							  PYOBJ_OFFSET(PyCEdit), 
							  PyCEdit_methods, 
							  GET_PY_CTOR(PyCEdit));
示例#7
0
		}
	}
	return Py_BuildValue("i",rc);
}

// Menu Methods
// @object PyCMenu|A windows menu.  Encapsulates an MFC <c CMenu> class
static struct PyMethodDef ui_menu_methods[] = {
	{"AppendMenu",				(PyCFunction)PyCMenu::AppendMenu,	1}, // @pymeth AppendMenu|Appends a new item to the end of a menu. Python can specify the state of the menu item by setting values in nFlags.
	{"DeleteMenu",				(PyCFunction)PyCMenu::DeleteMenu,	1}, // @pymeth DeleteMenu|Deletes the specified menu item.
	{"Detach",                  (PyCFunction)PyCMenu::GetHandle,    1},
	{"EnableMenuItem",			(PyCFunction)PyCMenu::EnableMenuItem,	1}, // @pymeth EnableMenuItem|Enables, disables, or dims a menu item.
	{"GetHandle",               (PyCFunction)PyCMenu::GetHandle, 1}, // @pymeth GetHandle|Returns the menu object's underlying hMenu.
	{"GetMenuItemCount",		(PyCFunction)PyCMenu::GetMenuItemCount,	1}, // @pymeth GetMenuItemCount|Determines the number of items in a menu.
	{"GetMenuItemID",			(PyCFunction)PyCMenu::GetMenuItemID,	1}, // @pymeth GetMenuItemID|Returns the item ID for the specified item in a pop-up menu.
	{"GetMenuString",			(PyCFunction)PyCMenu::GetMenuString,	1}, // @pymeth GetMenuString|Returns the string for a specified menu item.
	{"GetSubMenu",				(PyCFunction)PyCMenu::GetSubMenu,	1}, // @pymeth GetSubMenu|Returns a submenu.
	{"InsertMenu",				(PyCFunction)PyCMenu::InsertMenu,	1}, // @pymeth InsertMenu|Inserts an item into a menu.
	{"ModifyMenu",				(PyCFunction)PyCMenu::ModifyMenu,	1}, // @pymeth ModifyMenu|Modify an item in a menu.
	{"TrackPopupMenu",			(PyCFunction)PyCMenu::TrackPopupMenu,	1}, // @pymeth TrackPopupMenu|Creates a popup menu anywhere on the screen.
	{NULL,			NULL}
};

ui_type PyCMenu::type("PyCMenu", 
					  &ui_assoc_object::type, 
					  sizeof(PyCMenu), 
					  PYOBJ_OFFSET(PyCMenu), 
					  ui_menu_methods, 
					  GET_PY_CTOR(PyCMenu));

示例#8
0
    {"InitMDIInstance",			ui_init_mdi_instance,	1},
    {"InitDlgInstance",			ui_init_dlg_instance,	1}, // @pymeth InitDlgInstance|Calls critical InitInstance processing for a dialog based application.
	{"LoadCursor",              ui_load_cursor,         1},	//@pymeth LoadCursor|Loads a cursor.
	{"LoadStandardCursor",      ui_load_standard_cursor,1},	//@pymeth LoadStandardCursor|Loads a standard cursor.
	{"LoadOEMCursor",           ui_load_oem_cursor,     1},	//@pymeth LoadOEMCursor|Loads an OEM cursor.
	{"LoadIcon",				ui_load_icon,			1}, // @pymeth LoadIcon|Loads an icon resource.
	{"LoadStandardIcon",		ui_load_standard_icon,  1}, // @pymeth LoadStandardIcon|Loads an icon resource.
    {"OpenDocumentFile",		ui_open_document_file,	1}, // @pymeth OpenDocumentFile|Opens a document file by name.
	{"OnFileNew",               ui_on_file_new,         1}, // @pymeth OnFileNew|Calls the underlying OnFileNew MFC method.
	{"OnFileOpen",              ui_on_file_open,         1}, // @pymeth OnFileOpen|Calls the underlying OnFileOpen MFC method.
	{"RemoveDocTemplate",    	ui_app_remove_doc_template, 1}, // @pymeth RemoveDocTemplate|Removes a template to the application list.
	{"Run",    					ui_app_run, 1}, // @pymeth Run|Starts the main application message pump.
	{"IsInproc",    			ui_app_isinproc, 1}, // @pymeth IsInproc|Returns a flag to indicate if the created CWinApp was in the DLL, or an external EXE.
	{NULL,			NULL}
};
ui_type_CObject PyCWinApp::type("PyCWinApp", 
								&PyCWinThread::type,
								RUNTIME_CLASS(CWinApp), 
								sizeof(PyCWinApp), 
								PYOBJ_OFFSET(PyCWinApp), 
								PyCWinApp_methods, 
								GET_PY_CTOR(PyCWinApp) );

void PyCWinApp::cleanup()
{
	PyCWinThread::cleanup();
	// total hack!
	while (pExistingAppObject)
		DODECREF(pExistingAppObject); // this may delete it.
}
		return NULL;

	CPythonDocTemplate *pMFCTemplate = new CPythonDocTemplate(idResource);
	return ui_assoc_object::make(PyCRichEditDocTemplate::type, pMFCTemplate);
}


// @pymethod <o PyCRichEditDoc>|PyCRichEditDocTemplate|DoCreateRichEditDoc|Creates an underlying document object.
PyObject *
PyCRichEditDocTemplate::DoCreateRichEditDoc(PyObject *self, PyObject *args)
{
	// @pyparm string|fileName|None|The name of the file to load.
	return DoCreateDocHelper(self, args, RUNTIME_CLASS(CPythonRichEditDoc), PyCRichEditDoc::type);
}


// @object PyCRichEditDocTemplate|A document template class for OLE functionality.  Encapsulates an MFC <c CDocTemplate> class
static struct PyMethodDef PyCRichEditDocTemplate_methods[] = {
	{"DoCreateRichEditDoc",PyCRichEditDocTemplate::DoCreateRichEditDoc, 1}, // @pymeth DoCreateRichEditDoc|Creates an underlying document object.
	{NULL,			NULL}
};

ui_type_CObject PyCRichEditDocTemplate::type("PyCRichEditDocTemplate", 
									 &PyCDocTemplate::type, 
									 RUNTIME_CLASS(CDocTemplate), 
									 sizeof(PyCRichEditDocTemplate), 
									 PYOBJ_OFFSET(PyCRichEditDocTemplate), 
									 PyCRichEditDocTemplate_methods, 
									 GET_PY_CTOR(PyCRichEditDocTemplate) );

示例#10
0
	BOOL ok = pList->GetImageInfo(nIndex, &info);
	GUI_END_SAVE;
	if (!ok)
		RETURN_ERR("GetImageInfo failed");
	return Py_BuildValue("iiii(iiii)", info.hbmImage, info.hbmMask,
		info.Unused1, info.Unused2,
		info.rcImage.left,info.rcImage.top,info.rcImage.right,info.rcImage.bottom );
	// @rdesc The return info is a tuple describing an IMAGELIST structure.
}

// @object PyCImageList|A Python type encapsulating an MFC CImageList class.
static struct PyMethodDef PyCImageList_methods[] = {
	{"Add",            PyCImageList_Add, 1 }, // @pymeth Add|Adds an icon to the image list.
	{"Destroy",        PyCImageList_Destroy, 1}, // @pymeth Destroy|Destroys the underlying MFC imagelist object.
	{"DeleteImageList",PyCImageList_DeleteImageList, 1}, // @pymeth DeleteImageList|Deletes an image list.
	{"GetBkColor",     PyCImageList_GetBkColor, 1}, // @pymeth GetBkColor|Retrieves the background color of an Image List.
	{"GetSafeHandle",  PyCImageList_GetSafeHandle, 1}, // @pymeth GetSafeHandle|Retrieves the HIMAGELIST for the object
	{"GetImageCount",  PyCImageList_GetImageCount, 1}, // @pymeth GetImageCount|Retrieves the number of images in an image list.
	{"GetImageInfo",   PyCImageList_GetImageInfo, 1}, // @pymeth GetImageInfo|Retrieves information about an image.
	{"SetBkColor",     PyCImageList_SetBkColor, 1}, // @pymeth SetBkColor|Sets the background color for an Image List.
	{NULL, NULL }
};

ui_type_CObject PyCImageList::type("PyCImageList", 
								   &ui_assoc_CObject::type, 
								   RUNTIME_CLASS(CImageList), 
								   sizeof(PyCImageList),
								   PYOBJ_OFFSET(PyCImageList),
								   PyCImageList_methods, 
								   GET_PY_CTOR(PyCImageList));
示例#11
0
// @object PyCDocument|A document class.  Encapsulates an MFC <c CDocument> class
static struct PyMethodDef ui_doc_methods[] = {
	{"DeleteContents",		ui_doc_delete_contents,	1}, // @pymeth DeleteContents|Call the MFC DeleteContents method.
	{"DoSave",				ui_doc_do_save,			1}, // @pymeth DoSave|Save the file.  If necessary, prompt for file name.
	{"DoFileSave",			ui_doc_do_file_save,	1},	// @pymeth DoFileSave|Check file attributes, and save the file.
	{"GetDocTemplate",      ui_doc_get_template,    1}, // @pymeth GetDocTemplate|Returns the <o PyCDocTemplate> for the document.
	{"GetAllViews",			ui_doc_get_all_views,	1},	// @pymeth GetAllViews|Returns a list of all views for the current document.
	{"GetFirstView",		ui_doc_get_first_view,	1},	// @pymeth GetFirstView|Returns the first view object attached to this document.
	{"GetPathName",			ui_doc_get_path_name,	1},	// @pymeth GetPathName|Returns the full path name of the current document.
	{"GetTitle",			ui_doc_get_title,		1},	// @pymeth GetTitle|Returns the title of the current document.
	{"IsModified",			ui_doc_is_modified,		1},	// @pymeth IsModified|Return a flag indicating if the document has been modified.
	{"OnChangedViewList",           ui_doc_on_changed_view_list,    1},     // @pymeth OnChangedViewList|Informs the document when a view is added or removed.
	{"OnCloseDocument",		ui_doc_on_close,		1},	// @pymeth OnCloseDocument|Call the MFC OnCloseDocument handler.
	{"OnNewDocument",		ui_doc_on_new,			1}, // @pymeth OnNewDocument|Call the MFC OnNewDocument handler.
	{"OnOpenDocument",		ui_doc_on_open,			1},	// @pymeth OnOpenDocument|Call the MFC OnOpenDocument handler.
	{"OnSaveDocument",		ui_doc_on_save,			1},	// @pymeth OnSaveDocument|Call the MFC OnSaveDocument handler.
	{"SetModifiedFlag",		ui_doc_set_modified_flag,	1}, // @pymeth SetModifiedFlag|Set the "dirty" flag for the document.
	{"SaveModified",		ui_doc_save_modified,	1}, // @pymeth SaveModified|Call the underlying MFC method.
	{"SetPathName",			ui_doc_set_path_name,	1}, // @pymeth SetPathName|Set the full path name for the document.
	{"SetTitle",			ui_doc_set_title,	1},     // @pymeth SetTitle|Set the title of the document.
	{"UpdateAllViews",		ui_doc_update_all_views, 1}, // @pymeth UpdateAllViews|Informs each view when a document changes.
	{NULL,			NULL}		/* sentinel */
};
ui_type_CObject PyCDocument::type("PyCDocument", 
								  &PyCCmdTarget::type, // @base PyCDocument|PyCCmdTarget
								  RUNTIME_CLASS(CDocument), 
								  sizeof(PyCDocument), 
								  PYOBJ_OFFSET(PyCDocument), 
								  ui_doc_methods, 
								  GET_PY_CTOR(PyCDocument) );
示例#12
0
  {"GetDlgToPage",          ui_get_dlg_to_page,       1}, // @pymeth GetDlgToPage|Retrieves the ending page of the print range.
  {"GetPortName",           ui_get_port_name,         1}, // @pymeth GetPortName|The name of the currently selected printer port, call only after DoModal finishes.
  {"GetPrinterDC",          ui_get_printer_dc,        1}, // @pymeth GetPrinterDC|A handle to the printer device context if successful; otherwise NULL.  If the bPrintSetupOnly parameter of the CPrintDialog constructor was FALSE (indicating that the Print dialog box is displayed), then GetPrinterDC returns a handle to the printer device context. You must call the WindowsDeleteDC function to delete the device context when you are done using it.
  {"PrintAll",              ui_print_all,             1}, // @pymeth PrintAll|Nonzero if all pages in the document are to be printed; otherwise 0, call only after DoModal finishes.
  {"PrintCollate",          ui_print_collate,         1}, // @pymeth PrintCollate|Nonzero if the user selects the collate check box in the dialog box; otherwise 0, call only after DoModal finishes.
  {"PrintRange",            ui_print_range,           1}, // @pymeth PrintRange|Nonzero if only a range of pages in the document are to be printed; otherwise 0, call only after DoModal finishes.
  {"PrintSelection",        ui_print_selection,       1}, // @pymeth PrintSelection|Nonzero if only the selected items are to be printed; otherwise 0., call only after DoModal finishes

  // PRINTDLG (CPrintInfo->CPrintDialog->m_pd)

  {"GetHDC",                ui_get_hdc,               1}, // @pymeth GetHDC|Identifies a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority. 
  {"GetFlags",              ui_get_flags,             1}, // @pymeth GetFlags|A set of bit flags that you can use to initialize the Print common dialog box. When the dialog box returns, it sets these flags to indicate the user's input.
  {"SetFlags",              ui_set_flags,             1}, // @pymeth SetFlags|A set of bit flags that you can use to initialize the Print common dialog box. When the dialog box returns, it sets these flags to indicate the user's input.
  {"SetFromPage",           ui_set_from_page,         1}, // @pymeth SetFromPage|The number of the first page to be printed.
  {"SetToPage",             ui_set_to_page,           1}, // @pymeth SetToPage|The number of the first page to be printed.
  {"GetPRINTDLGMinPage",    ui_get_printdlg_min_page, 1}, // @pymeth GetPRINTDLGMinPage|Get the minimum value for the page range specified in the From and To page edit controls. If nMinPage equals nMaxPage, the Pages radio button and the starting and ending page edit controls are disabled. 
  {"SetPRINTDLGMinPage",    ui_set_printdlg_min_page, 1}, // @pymeth SetPRINTDLGMinPage|Set the minimum value for the page range specified in the From and To page edit controls. If nMinPage equals nMaxPage, the Pages radio button and the starting and ending page edit controls are disabled. 
  {"GetPRINTDLGCopies",     ui_get_printdlg_copies,   1}, // @pymeth GetPRINTDLGCopies|Gets the initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the DEVMODE structure contains the initial value.
  {"SetPRINTDLGCopies",     ui_set_printdlg_copies,   1}, // @pymeth SetPRINTDLGCopies|Sets the initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the DEVMODE structure contains the initial value.
  {NULL, NULL}
};

ui_type ui_prinfo_object::type(
                               "PyCPrintInfo", 
                               &ui_assoc_object::type, 
                               sizeof(ui_prinfo_object), 
                               PYOBJ_OFFSET(ui_prinfo_object), 
                               ui_prinfo_methods, 
                               GET_PY_CTOR(ui_prinfo_object));

示例#13
0
	{"DeleteItem",     PyCTreeCtrl_DeleteItem,  1}, // @pymeth DeleteItem|Deletes an item from the list.
	{"DeleteAllItems", PyCTreeCtrl_DeleteAllItems,  1}, // @pymeth DeleteAllItems|Deletes all items from the list.
	{"Expand",         PyCTreeCtrl_Expand,  1}, // @pymeth Expand|Expands, or collapses, the child items of the specified tree view item.
	{"Select",         PyCTreeCtrl_Select,  1}, // @pymeth Select|Selects, scrolls into view, or redraws a specified tree view item.
	{"SelectItem",     PyCTreeCtrl_SelectItem,  1}, // @pymeth SelectItem|Selects a specified tree view item.
	{"SelectDropTarget",PyCTreeCtrl_SelectDropTarget,  1}, // @pymeth SelectDropTarget|Redraws the tree item as the target of a drag-and-drop operation.
	{"SelectSetFirstVisible",PyCTreeCtrl_SelectSetFirstVisible,  1}, // @pymeth SelectSetFirstVisible|Selects a specified tree view item as the first visible item.
	{"EditLabel",      PyCTreeCtrl_EditLabel,  1}, // @pymeth EditLabel|Edits a specified tree view item in-place.
	{"CreateDragImage",PyCTreeCtrl_CreateDragImage,  1}, // @pymeth CreateDragImage|Creates a dragging bitmap for the specified tree view item.
	{"SortChildren",   PyCTreeCtrl_SortChildren,  1}, // @pymeth SortChildren|Sorts the children of a given parent item.
	{"EnsureVisible",  PyCTreeCtrl_EnsureVisible,  1}, // @pymeth EnsureVisible|Ensures that a tree view item is visible in its tree view control.
	{"HitTest",        PyCTreeCtrl_HitTest, 1}, // @pymeth HitTest|Determines which tree view item, if any, is at a specified position.
	{NULL,			NULL}
};
// @comm Sam Rushing has found the following tidbits:<nl>
// You can implement dynamic collapsing and expanding of events for large
// collections yourself - see KB Q130697<nl>
// The MFC docs tell you to use TVE_COLLAPSERESET in order to
// throw away the child items when collapsing a node.  They neglect to
// tell you a very important tidbit: that you need to combine the flag
// with TVE_COLLAPSE.  This is pointed out in the docs for
// TreeView_Expand(), but not in those for CTreeCtrl::Expand.

ui_type_CObject PyCTreeCtrl::type("PyCTreeCtrl", 
									 &PyCWnd::type, 
									 RUNTIME_CLASS(CTreeCtrl), 
									 sizeof(PyCTreeCtrl), 
									 PYOBJ_OFFSET(PyCTreeCtrl), 
									 PyCTreeCtrl_methods, 
									 GET_PY_CTOR(PyCTreeCtrl));
示例#14
0
  if (!PyArg_ParseTuple (args, "iil",
						 &n_pen_style, // @pyparm int|style||The pen style.
						 &n_width,     // @pyparm int|width||The pen width.
						 &cr_color)) { // @pyparm long|color||The pen color.
	return NULL;
  }
  lp.lopnStyle = n_pen_style;
  lp.lopnWidth.x = n_width;
  lp.lopnWidth.y = 0;
  lp.lopnColor = cr_color;

  CPen *pPen = new CPen;
  if (!pPen->CreatePenIndirect (&lp)) {
	delete pPen; // clean up on error.
	RETURN_ERR ("CreatePenIndirect call failed");
  }
  return ui_assoc_object::make (ui_pen_object::type, pPen);
}

static struct PyMethodDef ui_pen_methods[] = {
  {NULL,			NULL}		// sentinel
};

ui_type_CObject ui_pen_object::type ("PyCPen",
							 &PyCGdiObject::type,
							 RUNTIME_CLASS(CPen),
							 sizeof(ui_pen_object),
							 PYOBJ_OFFSET(ui_pen_object),
							 ui_pen_methods,
							 GET_PY_CTOR(ui_pen_object));
示例#15
0
	RETURN_NONE;
}

// @pymethod |PyDDEStringItem|Destroy|Destroys an item
PyObject *PyDDEStringItem_Destroy(PyObject *self, PyObject *args)
{
	if (!PyArg_ParseTuple(args, ":Destroy"))
		return NULL;
	GUI_BGN_SAVE;
	PythonDDEStringItem *pItem = PyDDEStringItem::GetItem(self);
	GUI_END_SAVE;
	if (!pItem) return NULL;
	delete pItem;
	RETURN_NONE;
}

// @object PyDDEStringItem|A DDE string item.
static struct PyMethodDef PyDDEStringItem_methods[] = {
	{"Destroy",    PyDDEStringItem_Destroy, 1},
	{"SetData",    PyDDEStringItem_SetData, 1}, // @pymeth SetData|Sets an items data, and causes any underlying notification.
	{NULL,			NULL}		// sentinel
};

ui_type_CObject PyDDEStringItem::type("PyDDEStringItem", 
							   &ui_assoc_CObject::type, 
							   RUNTIME_CLASS(CDDEStringItem), 
							   sizeof(PyDDEStringItem), 
							   PYOBJ_OFFSET(PyDDEStringItem), 
							   PyDDEStringItem_methods,
							   GET_PY_CTOR(PyDDEStringItem));
示例#16
0
	// @comm Note the underlying DDE object (ie, Server, Topics and Items) are not cleaned up by this call.
	if (!PyArg_ParseTuple(args,":Shutdown")) return NULL;
	PythonDDEServer *pServer = PyDDEServer::GetServer(self);
	if (!pServer) return NULL;
	GUI_BGN_SAVE;
	pServer->Shutdown();
	GUI_END_SAVE;
	RETURN_NONE;
}


// @object PyDDEServer|A DDE server.
static struct PyMethodDef PyDDEServer_methods[] = {
	{"AddTopic",    PyDDEServer_AddTopic, 1}, // @pymeth AddTopic|Adds a topic to the server.
	{"Create",      PyDDEServer_Create, 1}, // @pymeth Create|Creates a DDE server
	{"Destroy",		PyDDEServer_Destroy, 1}, // @pymeth Destroy|Destroys the underlying C++ object.
	{"GetLastError",PyDDEServer_GetLastError, 1}, // @pymeth GetLastError|Returns the last DDE error.
	{"Shutdown",	PyDDEServer_Shutdown, 1}, // @pymeth Shutdown|Shutsdown the server.
	{NULL,			NULL}		// sentinel
};



ui_type_CObject PyDDEServer::type("PyDDEServer", 
								   &ui_assoc_CObject::type, 
								   RUNTIME_CLASS(CDDEServer), 
								   sizeof(PyDDEServer), 
								   PYOBJ_OFFSET(PyDDEServer), 
								   PyDDEServer_methods,
      							   GET_PY_CTOR(PyDDEServer));
示例#17
0
// Return Values: the handle of the CRgn object
PyObject *
PyCRgn::get_safe_handle(PyObject *self, PyObject *args)
	{
	CRgn *pRgn = PyCRgn::GetRgn(self);
	if (!pRgn) return NULL;
	CHECK_NO_ARGS2(args,GetSafeHandle);
	HGDIOBJ hgdiobj=pRgn->GetSafeHandle();
	return Py_BuildValue("l",hgdiobj);
	}


// @object PyCRgn|An object encapsulating an MFC PyCRgn class.
static struct PyMethodDef PyCRgn_methods[] = {
	{"CreateRectRgn",PyCRgn::create_rect_rgn,1},
	{"CombineRgn",PyCRgn::combine_rgn,1},
	{"CopyRgn",PyCRgn::copy_rgn,1},
	{"GetRgnBox",PyCRgn::get_rgn_box,1},
	{"DeleteObject",PyCRgn::delete_object,1},
	{"GetSafeHandle",PyCRgn::get_safe_handle,1},
	{NULL,NULL}
};

ui_type_CObject PyCRgn::type ("PyCRgn",
							 &PyCGdiObject::type,
							 RUNTIME_CLASS(CRgn),
							 sizeof(PyCRgn),
							 PYOBJ_OFFSET(PyCRgn),
							 PyCRgn_methods,
							 GET_PY_CTOR(PyCRgn));
示例#18
0
			   &width)) // @pyparm int|width||The new width
		return NULL;

	CToolTipCtrl *pTTC = GetToolTipCtrl(self);
	if (!pTTC)return NULL;

	GUI_BGN_SAVE;
	int rc = pTTC->SetMaxTipWidth(width);
	GUI_END_SAVE;
	return PyInt_FromLong(rc);
}



// @object PyCToolTipCtrl|A windows tooltip control.  Encapsulates an MFC <c CToolTipCtrl> class.  Derived from <o PyCControl>.
static struct PyMethodDef PyCToolTipCtrl_methods[] = {
	{"CreateWindow",    PyCToolTipCtrl_create_window,1}, // @pymeth CreateWindow|Creates the window for a new progress bar object.
	{"UpdateTipText", PyCToolTipCtrl_update_tip_text, 1}, // @pymeth UpdateTipText|Update the tool tip text for a control's tools
	{"AddTool", PyCToolTipCtrl_add_tool, 1}, // @pymeth AddTool|Adds a tool to tooltip control.
	{"SetMaxTipWidth", PyCToolTipCtrl_set_max_tip_width, 1}, // @pymeth SetMaxTipWidth|
	{NULL,				NULL}
};

ui_type_CObject PyCToolTipCtrl::type("PyCToolTipCtrl", 
				       &ui_control_object::type, 
				       RUNTIME_CLASS(CToolTipCtrl), 
				       sizeof(PyCToolTipCtrl), 
				       PYOBJ_OFFSET(PyCToolTipCtrl), 
				       PyCToolTipCtrl_methods, 
				       GET_PY_CTOR(PyCToolTipCtrl));
示例#19
0
}

// @object PyDDETopic|A DDE topic.
static struct PyMethodDef PyDDETopic_methods[] = {
	{"AddItem",    PyDDETopic_AddItem, 1}, // @pymeth AddItem|Add an item to the topic.
	{"Destroy",    PyDDETopic_Destroy, 1}, // @pymeth Destroy|Destroys an item
	{NULL,			NULL}		// sentinel
};



ui_type_CObject PyDDETopic::type("PyDDETopic", 
							   &ui_assoc_CObject::type, 
							   RUNTIME_CLASS(CDDETopic), 
							   sizeof(PyDDETopic), 
							   PYOBJ_OFFSET(PyDDETopic), 
							   PyDDETopic_methods,
   							   GET_PY_CTOR(PyDDETopic));


PythonDDEServerSystemTopic *PyDDEServerSystemTopic::GetTopic (PyObject *self)
{
	return (PythonDDEServerSystemTopic *)ui_assoc_object::GetGoodCppObject( self, &type);
}


static struct PyMethodDef PyDDEServerSystemTopic_methods[] = {
	{NULL,			NULL}		// sentinel
};

ui_type_CObject PyDDEServerSystemTopic::type("PyDDEServerSystemTopic",