Calc visible frames. Add events