>
> A
Hi ernesto,
           Congrats on getting the pop to disappear :-)
Now we need to move all the dialog specific code to ap_EditMethods.cpp
I can do this over the next 2 days.
Cheers
Martin
uthor: riverae
> Date: 2007-08-03 15:22:09 +0200 (Fri, 03 Aug 2007)
> New Revision: 21675
>
> Modified:
>    abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View.h
>    abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View_cmd.cpp
>    abiword/branches/RiveraESoC/src/wp/ap/xp/ap_EditMethods.cpp
>    abiword/branches/RiveraESoC/src/wp/ap/xp/ap_Menu_ActionSet.cpp
> Log:
> Enabling annotation edit dialog by double clicking
>
> Modified: abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View.h
> ===================================================================
> --- abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View.h	2007-08-03
> 08:13:52 UTC (rev 21674)
> +++ abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View.h	2007-08-03
> 13:22:09 UTC (rev 21675)
> @@ -559,9 +559,11 @@
>  	fl_EndnoteLayout *  getClosestEndnote(PT_DocPosition pos);
>  	UT_sint32           getEmbedDepth(PT_DocPosition pos);
>
> +	// RIVERA
>  	bool				m_bAnnotationPreviewActive;
>  	AP_Preview_Annotation * m_pAnnotationPview;
>  	void				killAnnotationPreview();
> +	bool				cmdEditAnnotationWithDialog(UT_uint32 aID);
>
>  // ----------------------
>
>
> Modified: abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View_cmd.cpp
> ===================================================================
> --- abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View_cmd.cpp	2007-08-03
> 08:13:52 UTC (rev 21674)
> +++ abiword/branches/RiveraESoC/src/text/fmt/xp/fv_View_cmd.cpp	2007-08-03
> 13:22:09 UTC (rev 21675)
> @@ -4679,6 +4679,51 @@
>  	return true;
>  }
>
> +bool FV_View::cmdEditAnnotationWithDialog(UT_uint32 aID)
> +{
> +	UT_DEBUGMSG(("ANNOTATION EDITED!!!!!!!!!!!!\n"));
> +	/*
> +	 fp_Page * pPage = pAnn->getLine()->getPage();
> +	    if(!pPage)
> +	 return false;
> +	    UT_uint32 i =0;
> +	    bool bFound = false;
> +	    fp_AnnotationContainer * pACon = NULL;
> +	    for(i=0; i<pPage->countAnnotationContainers();i++)
> +	    {
> +			pACon = pPage->getNthAnnotationContainer(i);
> +			if(pAnn->getPID() == pACon->getPID())
> +			{
> +				bFound = true;
> +				break;
> +			}
> +	    }
> +	    if(!bFound)
> +	 return false;
> +	    fl_AnnotationLayout * pAL = static_cast<fl_AnnotationLayout
> *>(pACon->getSectionLayout());
> +	    PL_StruxDocHandle sdhStart = pAL->getStruxDocHandle();
> +	    PL_StruxDocHandle sdhEnd = NULL;
> +	    getDocument()->getNextStruxOfType(sdhStart,PTX_EndAnnotation,
> &sdhEnd);
> +
> +	    UT_return_val_if_fail(sdhEnd != NULL, false);
> +	    PT_DocPosition posStart =
> getDocument()->getStruxPosition(sdhStart)+1; // Pos of Block o Text
> +	    PT_DocPosition posEnd = getDocument()->getStruxPosition(sdhEnd) -1;
> // Just before end strux
> +
> +	 // preview annotation
> +
> +	 UT_GrowBuf buffer;
> +	    fl_BlockLayout * block;
> +
> +	    block = m_pLayout->findBlockAtPosition(posStart+1);
> +	    if (block)
> +	    {
> +			block->getBlockBuf(&buffer);
> +	    }
> +	    UT_UCS4String str(reinterpret_cast<const UT_UCS4Char
> *>(buffer.getPointer(0)),buffer.getLength());
> +	    UT_DEBUGMSG(("cmdHyperlinkStatusBar: Description in annotation is
> \"%s\" \n",str.utf8_str()));
> +	 */
> +	return true;
> +}
>
>  UT_Error FV_View::cmdInsertHyperlink(const char * szName)
>  {
>
> Modified: abiword/branches/RiveraESoC/src/wp/ap/xp/ap_EditMethods.cpp
> ===================================================================
> --- abiword/branches/RiveraESoC/src/wp/ap/xp/ap_EditMethods.cpp	2007-08-03
> 08:13:52 UTC (rev 21674)
> +++ abiword/branches/RiveraESoC/src/wp/ap/xp/ap_EditMethods.cpp	2007-08-03
> 13:22:09 UTC (rev 21675)
> @@ -10498,6 +10498,9 @@
>  	// UT_UTF8String pointer containing text to be inserted
>  	// Boolean to determine whether to place the current selection into an
> annotation.
>  	//
> +
> +	// TODO to make it cleaner annotation first should be created with
> default values and then call
> +	//		pView->cmdEditAnnotationWithDialog(<Annotation ID>)
>
>  	XAP_Frame * pFrame = static_cast<XAP_Frame *>(pView->getParentData());
>  	UT_return_val_if_fail(pFrame, false);
> @@ -13626,7 +13629,24 @@
>  	CHECK_FRAME;
>  	ABIWORD_VIEW;
>  	UT_return_val_if_fail(pView,false);
> -	pView->cmdHyperlinkJump(pCallData->m_xPos, pCallData->m_yPos);
> +
> +	fp_Run * pRun = pView->getHyperLinkRun(pView->getPoint());
> +	fp_HyperlinkRun * pHRun = pRun->getHyperlink();
> +
> +	if(pHRun && pHRun->getHyperlinkType() == HYPERLINK_NORMAL)
> +	{
> +		UT_DEBUGMSG(("hyperlinkJump: Normal hyperlink jump\n"));
> +		pView->cmdHyperlinkJump(pCallData->m_xPos, pCallData->m_yPos);
> +	}
> +
> +	if(pHRun && pHRun->getHyperlinkType() == HYPERLINK_ANNOTATION)
> +	{
> +		// This is the behaveour when double clicking an annotation hypermark
> +		UT_DEBUGMSG(("hyperlinkJump: Hyperlink annotation (no jump) edit
> dialog\n"));
> +		fp_AnnotationRun * pARun = static_cast<fp_AnnotationRun *>(pHRun);
> +		pView->cmdEditAnnotationWithDialog(pARun->getPID());
> +	}
> +
>  	return true;
>  }
>
> @@ -13636,6 +13656,7 @@
>  	CHECK_FRAME;
>  	ABIWORD_VIEW;
>  	UT_return_val_if_fail(pView,false);
> +	UT_DEBUGMSG(("hyperlinkJumpPos\n"));
>  	pView->cmdHyperlinkJump(pView->getPoint());
>  	return true;
>  }
>
> Modified: abiword/branches/RiveraESoC/src/wp/ap/xp/ap_Menu_ActionSet.cpp
> ===================================================================
> ---
> abiword/branches/RiveraESoC/src/wp/ap/xp/ap_Menu_ActionSet.cpp	2007-08-03
> 08:13:52 UTC (rev 21674)
> +++
> abiword/branches/RiveraESoC/src/wp/ap/xp/ap_Menu_ActionSet.cpp	2007-08-03
> 13:22:09 UTC (rev 21675)
> @@ -259,10 +259,10 @@
>  	_s(AP_MENU_ID_TOOLS_REVISIONS_FIND_PREV, 0,0,0,0, "revisionFindPrev",
> ap_GetState_HasRevisions,NULL);
>
>  	// RIVERA
> -	_s(AP_MENU_ID_TOOLS_ANNOTATIONS,  1,0,0,0,  NULL,               NULL,
>                NULL);
> -	_s(AP_MENU_ID_TOOLS_ANNOTATIONS_INSERT,	0,1,0,0,	"insAnnotation",		ap_GetState_InAnnotation,					NULL);
> -	_s(AP_MENU_ID_TOOLS_ANNOTATIONS_INSERT_FROMSEL,	0,0,0,0,	"pviewAnnotation"/*for
> popup testing only*/,	NULL/*ap_GetState_Selection*/,					NULL);
> -	_s(AP_MENU_ID_TOOLS_ANNOTATIONS_TOGGLE_DRAWER,	0,1,0,0,	"toggleDisplayAnnotations"/*for
> dlg testing only*/,	NULL,	NULL);
> +	_s(AP_MENU_ID_TOOLS_ANNOTATIONS,				1,0,0,0,	NULL,						NULL,								NULL);
> +	_s(AP_MENU_ID_TOOLS_ANNOTATIONS_INSERT,			0,1,0,0,	"insAnnotation",			ap_GetState_InAnnotation/*TODO
> should not need selection*/,NULL);
> +	_s(AP_MENU_ID_TOOLS_ANNOTATIONS_INSERT_FROMSEL,	0,1,0,0,	"insAnnotation"/*TODO
> differenciate from above*/,ap_GetState_InAnnotation,			NULL);
> +	_s(AP_MENU_ID_TOOLS_ANNOTATIONS_TOGGLE_DRAWER,	0,1,0,0,	"toggleDisplayAnnotations",	NULL,								NULL);
>
>  	_s(AP_MENU_ID_TABLE,1,0,0,0,NULL,NULL,NULL);
>  	_s(AP_MENU_ID_TABLE_INSERT,1,0,0,0, NULL, NULL, NULL);
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
>
Received on Sat Aug  4 02:16:51 2007
This archive was generated by hypermail 2.1.8 : Sat Aug 04 2007 - 02:16:51 CEST