model_server/ui_browser/src/browserShell.h.cxx
//
// sschmidt 10/25/1999:  This version of query_button_add_item allows
// the addition of menu items to query menus from C code.  Currently 
// it does not know how to deal with requests to add submenus.  This 
// function is called from browserShell::add_item_to_cliMenu().  
//
sschmidt 10/25/1999:  This version of query_button_add_item allows
the addition of menu items to query menus from C code.  Currently
it does not know how to deal with requests to add submenus.  This
function is called from browserShell::add_item_to_cliMenu().
sschmidt 10 / 25 / 1999 : This version of query_button_add_item allows the addition of menu items to query menus from C code . Currently it does not know how to deal with requests to add submenus . This function is called from browserShell :: add_item_to_cliMenu () .
static void query_button_add_item (browserQueryMenu *bm,  int first, cliQueryData *data, void *callback)
{
   const char *title = data->get_name();
   browserShell *bs = bm->browser;
   gtCascadeButton *bt = bm->button;
   if(first)
     bt->remove_entry(0);
   browserQueryData *bqd = new browserQueryData;
   bqd->menu = bm;
   bqd->data = data;
   cliMenuItem *mitem = cliQueryData_get_cliMenuItem(data);
   genString widget_name;
   widget_proper_name(title, widget_name);
   if (mitem) {
     switch (mitem->mtype)
     {
       case MENU_ITEM_SEPARATOR: bt->insert_entries(-1, gtMenuSeparator, "sep", gtMenuNull); break;
       case MENU_ITEM_ACTION:    bt->insert_entries(-1, gtMenuStandard, (char*)widget_name, title, bs, callback, gtMenuNull); break;
       default:                  break;
     }
   }
   else
     bt->insert_entries(-1, gtMenuStandard, (char*)widget_name, title, bs, callback, gtMenuNull);
}
static void query_button_add_item ( browserQueryMenu * bm , int first , cliQueryData * data , void * callback ) { const char * title = data -> get_name ( ) ; browserShell * bs = bm -> browser ; gtCascadeButton * bt = bm -> button ; if ( first ) bt -> remove_entry ( 0 ) ; browserQueryData * bqd = new browserQueryData ; bqd -> menu = bm ; bqd -> data = data ; cliMenuItem * mitem = cliQueryData_get_cliMenuItem ( data ) ; genString widget_name ; widget_proper_name ( title , widget_name ) ; if ( mitem ) { switch ( mitem -> mtype ) { case MENU_ITEM_SEPARATOR : bt -> insert_entries ( -1 , gtMenuSeparator , " " , gtMenuNull ) ; break ; case MENU_ITEM_ACTION : bt -> insert_entries ( -1 , gtMenuStandard , ( char * ) widget_name , title , bs , callback , gtMenuNull ) ; break ; default : break ; } } else bt -> insert_entries ( -1 , gtMenuStandard , ( char * ) widget_name , title , bs , callback , gtMenuNull ) ; }
sschmidt 10/25/1999:  This version of query_button_add_item allows
the addition of menu items to query menus from C code.
sschmidt 10 / 25 / 1999 : This version of query_button_add_item allows the addition of menu items to query menus from C code .
// Paranoid redundancy (every cliQueryData item // should have an associated cliMenuItem, but if // not, perform the default (read: "old") action): //