Detecting a click in the Structure View

russ at weststreetconsulting.com russ at weststreetconsulting.com
Fri Nov 30 06:51:58 PST 2007


Rick,

The only way I've ever done it is to use the generic click notification, then test the active document to see if it is the Structure View. The test I use looks for "Structure View" in the title bar, which I know isn't completely reliable in all instances.  Something like this, inside of F_ApiNotify():

    case   FA_Note_PostMouseCommand:

      //check to see if the structure view is active
      str = F_ApiGetString(FV_SessionId, docId, FP_Label);
      
      if(F_StrCmp(str, "Structure View"))
      {
        F_ApiDeallocateString(&str);
        
        //if the structure view is active, we need to find out which document
        //it is currently showing. It will be the document window that is currently in front.
        
        docId = F_ApiGetId(0, FV_SessionId, FP_FirstOpenDoc);

        while(docId)
        {
          tempInt = F_ApiGetInt(FV_SessionId, docId, FP_IsInFront);

          if(tempInt == True) break;

          docId = F_ApiGetId(FV_SessionId, docId, FP_NextOpenDocInSession);
        }

        //get the id of the selected element. I use a homemade function for this
        //that derives the ID from the F_ElementRangeT structure
        if(docId)
        {
          obj = ws_GetIdOfSelectedElement(docId, False);
        }
        else obj = 0;

        if(obj)
        {
          
          /* code to do something with the element that was clicked */
        }


        F_ApiDeallocateString(&str);
  
      }
 
      break;




>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
------------------------------

>>Message: 11
>>Date: Thu, 29 Nov 2007 16:15:39 -0500
>From: "Rick Quatro" <frameexpert at truevine.net>
>Subject: Detecting a click in the Structure View
>To: <framers at lists.frameusers.com>
>Message-ID: <01ac01c832cc$fe94a210$0200a8c0 at CARMENOFFICE>
>Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>reply-type=original

>Hello Framers,

>I want to detect a left-mouse click in the structure view, for example, when 
>a user clicks on an element bubble. Does anyone have any FDK or FrameScript 
>code that shows how to do this? Thank you very much.

>Rick Quatro
>Carmen Publishing
>585-659-8267
>www.frameexpert.com

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>





More information about the framers mailing list