Пример #1
0
//---------------------------------------------------------------------------
//  MQModifySelect
//    メニューから選択されたときに呼び出される。
//---------------------------------------------------------------------------
MQPLUGIN_EXPORT BOOL MQModifySelect(int index, MQCDocument* doc)
{
	if (index == 0)
	{
		return ShowMainDialog(doc);
	}
	return false;
}
Пример #2
0
//---------------------------------------------------------------------------
//  MQModifyObject
//    メニューから選択されたときに呼び出される。
//---------------------------------------------------------------------------
MQPLUGIN_EXPORT BOOL MQModifyObject(int index, MQCDocument* doc)
{
	if (index == 0)
	{
		return ShowMainDialog(doc);
	}
	// 呼び出し側(Metasequoia)に true を返すと、ドキュメントに変更があった、と判断される。
	return false;
}
Пример #3
0
int WINAPI WKTrayMenuPopup(int iActionType, int& iItemId, HMENU hMenu)
{
	if(!bAddTrayMenu){
		return 0;
	}
	if(iActionType==TM_ADDCUSTOMITEM){
		aRKeys.RemoveAll();
		iIdBeginning=iItemId;
		int iCount=0;
		_SortReminders srp=(_SortReminders)GetProcAddress(hRemin,"SortReminders");
		if(srp){
			(*srp)();
		}
		_GetReminder fp=(_GetReminder)GetProcAddress(hRemin,"GetReminder");
		COleDateTime dtNow=COleDateTime::GetCurrentTime();
		HMENU mn=CreatePopupMenu();
		int iPos=0;
		CString sText;
		char szKey[64]={0};
		sprintf(szKey,"#%i",iCount);
		CWPReminder rem;
		while((*fp)(szKey,rem)){
			COleDateTime tm(rem.EventTime);
			sText=GetRemDsc(rem,TRUE);
			if(sText!="" && abs(tm-dtNow)<=14 && !rem.bDisableRemider){
				AppendMenu(mn,MF_STRING,iItemId,sText);
				aRKeys.SetAtGrow(iPos,rem.szKey);
				iPos++;
			}
			iItemId++;//Увеличиваем на все, даже на пустые!
			iCount++;
			rem.Clear();
			sprintf(szKey,"#%i",iCount);
		}
		//if(iPos>0)//Всегда
		{
			{
				iAddNew=iItemId;
				iItemId++;
				AppendMenu(mn,MF_STRING,iAddNew,_l2("Add new reminder"));
			}
			{
				iShowAll=iItemId;
				iItemId++;
				AppendMenu(mn,MF_STRING,iShowAll,_l2("Show calendar"));
			}
			AppendMenu(hMenu,MF_POPUP|MF_STRING,UINT(mn),_l2("Reminders"));
		}
	}else{
		if(iItemId==iShowAll){
			ShowMainDialog(0);
		}else if(iItemId==iAddNew){
			//WKCallPluginFunction(0,0);
			//CreateRemOnDate(0,COleDateTime::GetCurrentTime(),FALSE);
			CString sSelectedKey=calcNextPrefixedId(DEF_ID);
			char szEvent[128]={0};
			strcpy(szEvent,sSelectedKey);
			WKPluginShowEventX(szEvent,0,COleDateTime::GetCurrentTime(),0);
		}else{
			char szKey[64]={0};
			strcpy(szKey,aRKeys[iItemId-iIdBeginning]);
			WKPluginShowEventX(szKey,0,COleDateTime::GetCurrentTime(),0);
		}
	}
	return 0;
}