model_server/gala/src/dialog.cxx
//
// following function is called when mouse is found to be over a container
//
following function is called when mouse is found to be over a container
following function is called when mouse is found to be over a container
void MyDialog::HandleContainer(vcontainer *container, int curx, int cury)
{
  int			containerx, containery;
  vrect		        rect;
  static int contitem;
  static vcontainer* oldcontainer;
  rect = *(container->GetBounds());
  containerx = curx - rect.x;
  containery = cury - rect.y;
   for each item in container...
  int cnt = container->GetItemCount();
  for (int item=0; item<cnt; item++) {
     vdialogItem *ditem = container->GetItemAt(item);
      check if pointer is over "ditem"
     if(ditem->ContainsPoint(containerx,containery)) {
         check if dialog item is a container
        if (ditem->IsKindOf(&vcontainer::Kind)) {	
	        look inside of container, send coordinates with respect
	        to the current container
	       tipWindow::SetContainer(vcontainer::CastDown(ditem));
	       HandleContainer(vcontainer::CastDown(ditem),containerx,containery);
        } else {
	        don't set the idlabel again if positioned on same item
	       if((item != contitem) || (container != oldcontainer)) {
              const vchar* title = ditem->GetTitle();
              if ((!title || !*title) && ditem->IsKindOf (&ToolBarButton::Kind))
	             title = ((ToolBarButton*)ditem)->GetTip();
	           let know tip window the current container. It will reset timer if the container changed.
	          tipWindow::Display (ditem, this, title);
	          contitem = item;
	          oldcontainer = container;
	          prevx = curx;
	          prevy = cury;
           }
        }
        return;
     }
  }
   if program control gets to this point, the pointer is 
   not positioned over any item, set message to title of
   the container itself
  tipWindow::Display (NULL, this, container->GetTitle());
  contitem = -1;
  oldcontainer = NULL;
  return;
}
void MyDialog :: HandleContainer ( vcontainer * container , int curx , int cury ) { int containerx , containery ; vrect rect ; static int contitem ; static vcontainer * oldcontainer ; rect = * ( container -> GetBounds ( ) ) ; containerx = curx - rect . x ; containery = cury - rect . y ; int cnt = container -> GetItemCount ( ) ; for ( int item = 0 ; item < cnt ; item ++ ) { vdialogItem * ditem = container -> GetItemAt ( item ) ; if ( ditem -> ContainsPoint ( containerx , containery ) ) { if ( ditem -> IsKindOf ( & vcontainer :: Kind ) ) { tipWindow :: SetContainer ( vcontainer :: CastDown ( ditem ) ) ; HandleContainer ( vcontainer :: CastDown ( ditem ) , containerx , containery ) ; } else { if ( ( item != contitem ) || ( container != oldcontainer ) ) { const vchar * title = ditem -> GetTitle ( ) ; if ( ( ! title || ! * title ) && ditem -> IsKindOf ( & ToolBarButton :: Kind ) ) title = ( ( ToolBarButton * ) ditem ) -> GetTip ( ) ; tipWindow :: Display ( ditem , this , title ) ; contitem = item ; oldcontainer = container ; prevx = curx ; prevy = cury ; } } return ; } } tipWindow :: Display ( NULL , this , container -> GetTitle ( ) ) ; contitem = -1 ; oldcontainer = NULL ; return ; }
following function is called when mouse is found to be over a container
following function is called when mouse is found to be over a container
// transform pointer position to its position with respect to // the container (all items in container are positioned this way) // // for each item in container... // // check if pointer is over "ditem" // check if dialog item is a container // look inside of container, send coordinates with respect // to the current container // don't set the idlabel again if positioned on same item // let know tip window the current container. It will reset timer if the container changed. // if program control gets to this point, the pointer is  // not positioned over any item, set message to title of // the container itself //