void HexEditorCtrl::PreparePaintTAGs( void ){//TagElement& TAG ){ TagHideAll(); hex_ctrl->TagArray.Clear(); text_ctrl->TagArray.Clear(); MainTagArray.Sort( TagElement::TagCompare ); TagElement *TAG; for( unsigned i = 0 ; i < MainTagArray.Count() ; i ++ ){ //Painting all TAGs here. TAG = MainTagArray.Item(i);// For debugging PushTAGToControls(TAG); } HighlightArray.Sort( TagElement::TagCompare ); for( unsigned i = 0 ; i < HighlightArray.Count() ; i ++ ){ //Just highlighting required sections. TAG = HighlightArray.Item(i);// For debugging PushTAGToControls(TAG); } CompareArray.Sort( TagElement::TagCompare ); for( unsigned i = 0 ; i < CompareArray.Count() ; i ++ ){ //Just highlighting diff sections. TAG = CompareArray.Item(i);// For debugging PushTAGToControls(TAG); } }
void HexEditorCtrl::PaintTAGsPrefilter( ArrayOfTAG& Arr ){ unsigned c = Arr.Count(); if( c==0 ) return; unsigned s = 0; if (c>0) for( ; static_cast<uint64_t>( page_offset ) > (Arr.Item(s))->end && s<c-1; s++ ); unsigned e=s; if (c>0) for( ; page_offset + GetByteCount() > static_cast<int>( Arr.Item(e)->start ) && e<c-1 ; e++ ); //#ifdef _DEBUG_ std::cout << "Tags needed between : " << s << " - " << e << std::endl; //#endif //_DEBUG_ for( unsigned i=s; i<=e ;i++) PushTAGToControls( Arr.Item(i) ); }