コード例 #1
0
static int hotKeyShowList(
	GOC_HANDLER uchwyt, GOC_MSG wiesc, void *pBuf, unsigned int nBuf)
{
	GOC_FLAGS f = goc_elementGetFlag(lLista);
	if ( f & GOC_EFLAGA_PAINTED )
	{
		goc_listClear(lLista);
		goc_elementIsFlag(lLista, GOC_EFLAGA_PAINTED | GOC_EFLAGA_ENABLE);
		//goc_elementSetFlag(lLista, f);
		goc_systemRepaintUnder(lLista);
		fflush(stdout);
	}
	else
	{
		int size = 0;
		const char **ptr;
		doAction(ACTION_PLAYLIST_GETSIZE, &size);
		doAction(ACTION_PLAYLIST_GETTABLE, &ptr);
		goc_listSetExtTable(lLista, ptr, size);
		doAction(ACTION_PLAYLIST_GETACTUAL, &size);
		goc_sellistSelect(lLista, size);
		goc_listSetCursor(lLista, size);
		goc_elementOrFlag(lLista, GOC_EFLAGA_PAINTED | GOC_EFLAGA_ENABLE);
		goc_systemFocusOn(lLista);
	}
	goc_systemSendMsg(lLista, GOC_MSG_PAINT, 0, 0);
}
コード例 #2
0
static int nasluch(GOC_HANDLER uchwyt, GOC_MSG wiesc, void *pBuf, unsigned int nBuf)
{
	if ( uchwyt == GOC_HANDLER_SYSTEM )
	{
		if ( wiesc == GOC_MSG_CHAR )
		{
			if ( nBuf == 27 )
				return GOC_ERR_OK;
		}
	}
	else if ( uchwyt == lLista )
	{
		if ( wiesc == GOC_MSG_CHAR )
		{
			if ( nBuf == 0x0D )
			{
				char *selFile = goc_listGetUnderCursor( lLista );
				if ( selFile )
					doAction(ACTION_PLAY, selFile);
				return GOC_ERR_OK;
			}
			else if ( nBuf == 0x116 )
			{
				int pos = goc_listGetCursor(lLista);
				if ( pos > 0 )
				{
					int size = 0;
					const char **ptr;
					doAction(ACTION_PLAYLIST_REMOVEFILE, &pos);
					doAction(ACTION_PLAYLIST_GETSIZE, &size);
					doAction(ACTION_PLAYLIST_GETTABLE, &ptr);
					goc_listSetExtTable(lLista, ptr, size);
					doAction(ACTION_PLAYLIST_GETACTUAL, &size);
					goc_sellistSelect(lLista, size);
					goc_listSetCursor(lLista, pos);
//		goc_elementOrFlag(lLista, GOC_EFLAGA_PAINTED | GOC_EFLAGA_ENABLE);
//		goc_systemFocusOn(lLista);
					goc_systemSendMsg(lLista, GOC_MSG_PAINT, 0, 0);
				}
				return GOC_ERR_OK;
			}
		}
		else if ( wiesc == GOC_MSG_LISTCHANGE )
		{
			// TODO: Opis zaznaczonej pozycji
			return GOC_ERR_OK;
		}
	}
/*	else if ( uchwyt == pLista )
	{
		// selekcjonuj tylko katalogi do dodawania
		if ( wiesc == GOC_MSG_FILELISTADDFILE )
		{
			if ( nBuf != GOC_FILELISTFLAG_FOLDER )
				return GOC_ERR_REFUSE;
		}
	}*/
	return goc_systemDefaultAction(uchwyt, wiesc, pBuf, nBuf);
}
コード例 #3
0
static int listHotKeyEnd(GOC_HANDLER uchwyt, GOC_MSG wiesc, void* pBuf, unsigned int nBuf)
{
	GOC_StList *lista = (GOC_StList*)uchwyt;
	int retCode = GOC_ERR_OK;
	retCode = goc_listSetCursor(uchwyt, goc_listGetRowsAmmount( uchwyt )-1);
	if ( retCode != GOC_ERR_OK )
		return retCode;
	if ( lista->flag & GOC_EFLAGA_SHOWN )
		goc_systemSendMsg(uchwyt, GOC_MSG_PAINT, 0, 0);
	return GOC_ERR_OK;
}