Stock-Based Compensation - Expense (Details) - USD ($)
3 Months Ended 6 Months Ended
Jan. 31, 2016
Jan. 31, 2015
Jan. 31, 2016
Jan. 31, 2015
Income statement components of stock-based compensation expense recognized in Consolidated Statements of Income        
Stock-based compensation before income taxes $ 1,875,000 $ 1,420,000 $ 3,595,000 $ 3,001,000
Income tax benefits (661,000) (507,000) (1,274,000) (1,046,000)
Total stock-based compensation expense, net of tax 1,214,000 913,000 2,321,000 1,955,000
Cost of sales        
Income statement components of stock-based compensation expense recognized in Consolidated Statements of Income        
Stock-based compensation before income taxes 121,000 63,000 200,000 162,000
Operating expenses: Selling        
Income statement components of stock-based compensation expense recognized in Consolidated Statements of Income        
Stock-based compensation before income taxes 248,000 120,000 438,000 306,000
Operating expenses: General and administrative        
Income statement components of stock-based compensation expense recognized in Consolidated Statements of Income        
Stock-based compensation before income taxes 1,478,000 1,223,000 2,903,000 2,502,000
Operating expenses: Research and development        
Income statement components of stock-based compensation expense recognized in Consolidated Statements of Income        
Stock-based compensation before income taxes 28,000 14,000 54,000 31,000
Total operating expenses        
Income statement components of stock-based compensation expense recognized in Consolidated Statements of Income        
Stock-based compensation before income taxes $ 1,754,000 $ 1,357,000 $ 3,395,000 $ 2,839,000