예제 #1
0
/**
 * Implementation of OM_NEW
 *
 * @param cl the class
 * @param obj the object
 * @param msg the parameter of the method
 * @return
 */
STATIC ULONG AddressGroupList_New(struct IClass *cl,Object *obj,struct opSet *msg)
{
	struct AddressGroupList_Data *data;

	if (!(obj=(Object *)DoSuperNew(cl,obj,
					TAG_MORE,msg->ops_AttrList)))
		return 0;

	data = (struct AddressGroupList_Data*)INST_DATA(cl,obj);

	init_hook(&data->construct_hook,(HOOKFUNC)addressgroup_construct);
	init_hook(&data->compare_hook,(HOOKFUNC)addressgroup_compare);
	init_hook(&data->destruct_hook,(HOOKFUNC)addressgroup_destruct);
	init_hook_with_data(&data->display_hook,(HOOKFUNC)addressgroup_display, data);

	SetAttrs(obj,
						MUIA_NList_ConstructHook2, &data->construct_hook,
						MUIA_NList_CompareHook2, &data->compare_hook,
						MUIA_NList_DestructHook2, &data->destruct_hook,
						MUIA_NList_DisplayHook2, &data->display_hook,
						MUIA_NList_Title, TRUE,
						MUIA_NList_Format, ",",
						TAG_DONE);

	return (ULONG)obj;
}
예제 #2
0
STATIC ULONG transwnd_New(struct IClass *cl, Object *obj, struct opSet *msg)
{
	Object *gauge1,/* *gauge2,*/*status,*abort,*mail_listview, *mail_list, *mail_group, *start, *ignore, *down, *del, *downdel, *ignore_check,*all,*none, *skip;
	Object *head;

	obj = (Object *) DoSuperNew(cl, obj,
				WindowContents, VGroup,
					Child, head = TextObject,End,
					Child, RectangleObject, MUIA_Weight, 1, End,
					Child, mail_group = VGroup,
						MUIA_ShowMe, FALSE,
						Child, mail_listview = NListviewObject,
							MUIA_NListview_NList, mail_list = NListObject,
								MUIA_NList_Title, TRUE,
								MUIA_NList_Format, "P=\033r,,,",
								End,
							End,
						Child, HGroup,
							Child, ignore = MakeButton(_("Ignore")),
							Child, down = MakeButton(_("Download")),
							Child, del = MakeButton(_("Delete")),
							Child, downdel = MakeButton(_("Download & Delete")),
							Child, start = MakeButton(_("_Start")),
							End,
						Child, HGroup,
							Child, all = MakeButton(_("Select All")),
							Child, none = MakeButton(_("Select None")),
							Child, MakeLabel(_("Ignore not listed mails")),
							Child, ignore_check = MakeCheck(_("Ignore not listed mails"),FALSE),
							Child, HVSpace,
							End,
						End,
					Child, gauge1 = GaugeObject,
						GaugeFrame,
						MUIA_Gauge_InfoText, _("Waiting..."),
						MUIA_Gauge_Horiz,			TRUE,
						End,
/*					Child, gauge2 = GaugeObject,
						GaugeFrame,
						MUIA_Gauge_InfoText, _("Waiting..."),
						MUIA_Gauge_Horiz,			TRUE,
						End,*/
					Child, HGroup,
						Child, status = TextObject, TextFrame, MUIA_Text_Contents, "", MUIA_Background, MUII_TextBack, End,
						Child, skip = MakeButton(_("_Skip")),
						Child, abort = MakeButton(_("_Abort")),
						End,
					End,
				TAG_MORE, msg->ops_AttrList);

	if (obj != NULL)
	{
		struct transwnd_Data *data = (struct transwnd_Data *) INST_DATA(cl, obj);
		data->gauge1 = gauge1;
/*		data->gauge2 = gauge2; */
		data->status = status;
		data->abort  = abort;
		data->skip = skip;
		data->head = head;
		data->mail_listview = mail_listview;
		data->mail_list = mail_list;
		data->mail_group = mail_group;
		data->start = start;
		data->ignore_check = ignore_check;
		data->status_download = PictureButtonObject, MUIA_PictureButton_Directory, gui_get_images_directory(), MUIA_PictureButton_Filename, "status_download", End;
		data->status_trashcan = PictureButtonObject, MUIA_PictureButton_Directory, gui_get_images_directory(), MUIA_PictureButton_Filename, "status_trashcan", End;

		init_hook_with_data(&data->construct_hook, (HOOKFUNC)mail_construct, data);
		init_hook_with_data(&data->destruct_hook, (HOOKFUNC)mail_destruct, data);
		init_hook_with_data(&data->display_hook, (HOOKFUNC)mail_display, data);

		SetAttrs(mail_list,
				MUIA_NList_ConstructHook, &data->construct_hook,
				MUIA_NList_DestructHook, &data->destruct_hook,
				MUIA_NList_DisplayHook, &data->display_hook,
				MUIA_NList_MultiSelect, MUIV_NList_MultiSelect_Default,
				TAG_DONE);

		set(skip, MUIA_Weight, 0);
		set(abort, MUIA_Weight, 0);

		DoMethod(abort, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)obj, 3, MUIM_Set, MUIA_transwnd_Aborted, TRUE);
		DoMethod(skip, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)obj, 3, MUIM_Set, MUIA_transwnd_Skipped, TRUE);
		DoMethod(start, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)App, 3, MUIM_WriteLong, (1<<0), (ULONG)&data->start_pressed);
		DoMethod(obj, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (ULONG)obj, 3, MUIM_Set, MUIA_transwnd_Aborted, TRUE);
		DoMethod(ignore, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)App, 5, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)transwnd_set_mail_flags, (ULONG)data, 0);
		DoMethod(down, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)App, 5, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)transwnd_set_mail_flags, (ULONG)data, MAILF_DOWNLOAD);
		DoMethod(del, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)App, 5, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)transwnd_set_mail_flags, (ULONG)data, MAILF_DELETE);
		DoMethod(downdel, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)App, 5, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)transwnd_set_mail_flags, (ULONG)data, MAILF_DOWNLOAD|MAILF_DELETE);
		DoMethod(all,MUIM_Notify,MUIA_Pressed, FALSE, (ULONG)mail_list, 4, MUIM_NList_Select, MUIV_NList_Select_All, MUIV_NList_Select_On, NULL);
		DoMethod(none,MUIM_Notify,MUIA_Pressed, FALSE, (ULONG)mail_list, 4, MUIM_NList_Select, MUIV_NList_Select_All, MUIV_NList_Select_Off, NULL);
	}

	return((ULONG) obj);
}