Article # 273, added by Geoworks, historical record
| first | previous | index | next | last |

SearchReplaceControl isn't enabling correctly.



Q. Why aren't the triggers in the Find/Replace controller enabled,
   even after I type some text in the Find field?

A. In the SearchReplaceControl you need to have the following
   attribute:

     ATTR_SEARCH_CONTROL_INTERACT_ONLY_WITH_TARGETED_TEXT_OBJECTS;

   This will make the triggers become enabled at the appropriate
   time. Here is a sample SearchReplaceControl object:

     @object GenInteractionClass MyEditMenu = {
         GI_comp = @MySearchReplaceControl;
         ...
     }

     @object SearchReplaceControlClass MySearchReplaceControl = {
         GI_visMoniker = "Find and Replace";
         GI_states = @default & ~GS_ENABLED;
         GII_visibility = GIV_DIALOG;
         ATTR_SEARCH_CONTROL_INTERACT_ONLY_WITH_TARGETED_TEXT_OBJECTS;
         ATTR_GEN_DESTINATION_CLASS = { (ClassStruct*)&MyTextClass };
     }

   This example is for text objects, which is generally what the
   Find/Replace is used on. You should only have to make minor
   modifications to make this work with other kinds of objects.