We study the steady plane shear flow of a dense assembly of frictional, inelastic disks using discrete simulation and prescribing the pressure and the shear rate. We show that, in the limit of rigid grains, the shear state is determined by a single dimensionless number, called inertial number I, which describes the ratio of inertial to pressure forces. Small values of I correspond to the quasistatic regime of soil mechanics, while large values of I correspond to the collisional regime of the kinetic theory. Those shear states are homogeneous, and become intermittent in the quasi-static regime. When I increases in the intermediate regime, we measure an approximately linear decrease of the solid fraction from the maximum packing value, and an approximately linear increase of the effective friction coefficient from the static internal friction value. From those dilatancy and friction laws, we deduce the constitutive law for dense granular flows, with a plastic Coulomb term and a viscous Bagnold term. We also show that the relative velocity fluctuations follow a scaling law as a function of I. The mechanical characteristics of the grains (restitution, friction and elasticity) have a very small influence in this intermediate regime. Then, we explain how the friction law is related to the angular distribution of contact forces, and why the local frictional forces have a small contribution to the macroscopic friction. At the end, as an example of heterogeneous stress distribution, we describe the shear localization when gravity is added.