model_server/gala/src/subwin.cxx
/*
 * Open
 *
 * Called when the dialog item is being placed into view.
 * We use this moment to insert our X window into the parent X window
 * that our parent vwindow is using
 */
Open
Called when the dialog item is being placed into view.
We use this moment to insert our X window into the parent X window
that our parent vwindow is using
Open Called when the dialog item is being placed into view . We use this moment to insert our X window into the parent X window that our parent vwindow is using
void subwin::Open(void)
{
    vrect		 my_rect;
    vdialogItem::Open();
    _subwinValidateXWindow(this);
    vdialogItemList *my_itemList = this->GetItemListIn();
    my_itemList->TransformRect(this->GetRect(), &my_rect);
    vwindow *window = this->DetermineWindow();
    my_rect.y = window->GetHeight() - (my_rect.y + my_rect.h);
#ifndef WIN32
    printf ("%08x -> %08x\n", vwindowGetXWindow(window),  this->xwindow);
    XReparentWindow(this->display, this->xwindow,
		    vwindowGetXWindow(window),
		    my_rect.x, my_rect.y);
    XResizeWindow(this->display, this->xwindow, my_rect.w, my_rect.h);
    XMapWindow(this->display, this->xwindow);
    unsigned long root;
    int x, y;
    unsigned w, h, bw, depth;
    XGetGeometry (this->display, this->xwindow, &root, &x, &y, &w, &h, &bw, &depth);
#endif
}
void subwin :: Open ( void ) { vrect my_rect ; vdialogItem :: Open ( ) ; _subwinValidateXWindow ( this ) ; vdialogItemList * my_itemList = this -> GetItemListIn ( ) ; my_itemList -> TransformRect ( this -> GetRect ( ) , & my_rect ) ; vwindow * window = this -> DetermineWindow ( ) ; my_rect . y = window -> GetHeight ( ) - ( my_rect . y + my_rect . h ) ; #ifndef WIN32 printf ( " \n " , vwindowGetXWindow ( window ) , this -> xwindow ) ; XReparentWindow ( this -> display , this -> xwindow , vwindowGetXWindow ( window ) , my_rect . x , my_rect . y ) ; XResizeWindow ( this -> display , this -> xwindow , my_rect . w , my_rect . h ) ; XMapWindow ( this -> display , this -> xwindow ) ; unsigned long root ; int x , y ; unsigned w , h , bw , depth ; XGetGeometry ( this -> display , this -> xwindow , & root , & x , & y , & w , & h , & bw , & depth ) ; #endif }
Open
 Called when the dialog item is being placed into view.
Open Called when the dialog item is being placed into view .
// Now that the parent vwindow is open, there is definitely an X window // that we can use to place our subwindow inside of // Transform our rect to the parent X Window's coordinate system // !!! doesn't handle containers yet //printf ("r=%d,x=%d,y=%d,w=%d,h=%d,bw=%d,d=%d\n", root,x,y,w,h,bw,depth);