void Window_set( Handle self, HV * profile) { dPROFILE; Bool owner_icon = false; if ( pexist( menuFont)) { SvHV_Font( pget_sv( menuFont), &Font_buffer, "Window::set"); my-> set_menu_font( self, Font_buffer); pdelete( menuFont); } if ( pexist( owner)) { owner_icon = pexist( ownerIcon) ? pget_B( ownerIcon) : my-> get_ownerIcon( self); pdelete( ownerIcon); } if ( pexist( frameOrigin) || pexist( frameSize)) { Bool io = 0, is = 0; Point o, s; if ( pexist( frameOrigin)) { int set[2]; prima_read_point( pget_sv( frameOrigin), set, 2, "Array panic on 'frameOrigin'"); pdelete( frameOrigin); o. x = set[0]; o. y = set[1]; io = 1; } else { o.x = o. y = 0; } if ( pexist( frameSize)) { int set[2]; prima_read_point( pget_sv( frameSize), set, 2, "Array panic on 'frameSize'"); pdelete( frameSize); s. x = set[0]; s. y = set[1]; is = 1; } else { s.x = s. y = 0; } if ( is && io) apc_widget_set_rect( self, o. x, o. y, s. x, s. y); else if ( io) my-> set_frameOrigin( self, o); else my-> set_frameSize( self, s); } inherited set( self, profile); if ( owner_icon) { my-> set_ownerIcon( self, 1); opt_set( optOwnerIcon); } }
Rect Widget_rect( Handle self, Bool set, Rect r) { enter_method; if ( !set) { Point p = my-> get_origin( self); Point s = my-> get_size( self); r. left = p. x; r. bottom = p. y; r. right = p. x + s. x; r. top = p. y + s. y; } else apc_widget_set_rect( self, r. left, r. bottom, r. right - r. left, r. top - r. bottom); return r; }