There are two tobacco boxes pictured in the image entitled "Saturday Night at Sea". One appears to be of the hinged-lid variety and the other, in the pocket of the sailor on the left, appears to be a "Dutchman's Log" style box.
A Dutchman's Log tobacco box was used as an aide-mémoire by sailors. The box is made of brass with tables inscribed on its lid and on its base. On the lid is a perpetual calendar, which allowed sailors to work out the weekday and the lunar age for any date. The table on the bottom was used in calculating a vessel’s speed. To do this, a piece of wood was thrown into the water and timed as it passed two marks on the vessel's side. The sailor then consulted the table on the box and, from the time taken in the left-hand column, read off the ship's speed from the right-hand column.
Information on how to use a "Dutchman's log" can be found at Utrecht Univerisity Department of Mathematics website.
A few additional styles of tobacco box can be seen at the National Maritime Museum and the National Museum of Scotland.