PA_TableAndFieldPopup

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_TableAndFieldPopup (x; y; tNum; fNum)

ParameterTypeDescription
xshortGlobal horizontal coordinate of pop-up top left corner
yshortGlobal vertical coordinate of pop-up top left corner
tNumshort *Table number of selected Table
fNumshort *Field number of selected Field

Description

The routine PA_TableAndFieldPopup draws a hierarchical pop-up menu built with all tables and their fields names. If the user chooses a field name, tNum and fNum are set to those table and field numbers. If the user makes no choice (he releases the mouse out of the pop-up menu), tNum and fNum are set to 0.

The x and y coordinates are relative to the main screen, or the MDI window.

Usually, this call is made from an object which launch its method when the mouse is down on it (but it is the On mouse up event that is sent to the method), such as invisible buttons, arrays, hierarchical list.

This routine uses the virtual structure if it is on (PA_UseVirtualStructure).

Example

The routine is declared as xx_PopupTableAndFields(1I;&I;&I&;I) in the STR# resource (this is done for you by the Plug-in Wizard)

In your PluginMain routine:

   void PluginMain( long selector, PA_PluginParameters params )
   {
      switch ( selector )
      {
         case kInitPlugin :
      /* . . . code . . . */

         case kPopupTablesAndFields :
            PA_TableAndFieldPopup(
               PA_GetShortParameter(params, 1),   // horizontal global
               PA_GetShortParameter(params, 2),   // vertical global
               ( ( (short**) params->fParameters ) [ 2 ] ),
               ( ( (short**) params->fParameters ) [ 3 ] )   );
            break;
      } // switch (selector)
   }

The method object of an invisible button:

   If( Form event = On mouse up)
       GET MOUSE ($x;$y;$button;*)  ` * to get globals coordinates
        xx_PopupTableAndFields ($x;$y;$t;$f)
       If( ($t # 0) & ($f # 0) )
         ` Do something for this field
      End if
   End if

See Also

PA_FieldPopup.

Error Handling

Use PA_GetLastError to see if an error occurred.


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next