void BrowserBubble::Reposition() { gfx::Point top_left; view::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); MovePopup(top_left.x() + bounds_.x(), top_left.y() + bounds_.y(), bounds_.width(), bounds_.height()); }
LRESULT TEnhancedListBox :: EvResetContent ( WPARAM key, LPARAM param ) { /* transfert à la ListBox*/ LRESULT retour = TListBox :: DefWindowProc ( LB_RESETCONTENT,key, param ) ; for ( ; indexmax >= 0; indexmax -- ) /* libérations personnels */ free ( memo [ indexmax ] ) ; memo = ( char ** ) realloc ( memo, 0 ) ; base_display = Nb_display = 0 ; if ( wpopup ) /* redimensions de la popup*/ { boolpopup = FALSE ; MovePopup ( wpopup, x2 = 0 ) ; } return ( retour ) ; }
void TEnhancedComboBox :: DrawItem ( DRAWITEMSTRUCT far & drawInfo ) { char table [100] ; /* buffer de travail */ TDC drawDC(drawInfo.hDC); /* zones de dessin */ TRect itemRect(drawInfo.rcItem.left,drawInfo.rcItem.top,drawInfo.rcItem.right,drawInfo.rcItem.bottom); TRect BaseRect = itemRect ; char * pchar ; bool useinvert = ( drawInfo. itemState & ODS_SELECTED ) ; if ( drawInfo. itemID >= Nb_display ) return ; if ( ! wpopup ) new TEnhancedBox ( drawInfo. hwndItem, this ) ; if ( ! boolpopup ) /* redimensionnement ? */ { boolpopup = TRUE ; MovePopup ( drawInfo. hwndItem, x1+x2 ) ; } /* récupération des infos */ TComboBox::GetString ( table, drawInfo. itemID ) ; drawDC. FillRect ( itemRect, TBrush ( TColor ( ::GetSysColor ( useinvert ? COLOR_HIGHLIGHT : COLOR_WINDOW ) ) ) ) ; if ( useinvert ) { SetTextColor ( drawDC, GetSysColor ( COLOR_HIGHLIGHTTEXT ) ) ; SetBkColor ( drawDC, GetSysColor ( COLOR_HIGHLIGHT ) ) ; } else { SetTextColor ( drawDC, GetSysColor ( COLOR_WINDOWTEXT ) ) ; SetBkColor ( drawDC, GetSysColor ( COLOR_WINDOW ) ) ; } itemRect. left += 3 ; /* écriture formatée */ drawDC. DrawText ( table , -1, itemRect, DT_VCENTER ) ; itemRect. left += x1 ; pchar = memo [ base_display + drawInfo. itemID ] ; while ( * pchar && * pchar != ' ' && * pchar != '\t' ) pchar ++ ; while ( * pchar == ' ' || * pchar == '\t' ) pchar ++ ; if ( * pchar ) drawDC. DrawText( pchar , -1, itemRect, DT_VCENTER ) ; }