* ScrollBar support. Set current value. * @param balance - scrollBar->getValue() * @return - order from left to right side */
| 910 | * @return - order from left to right side |
| 911 | */ |
| 912 | int TransactionControl::Trade::setBalance(const int balance) |
| 913 | { |
| 914 | int orderLR = balance - getRightStock(); |
| 915 | if (orderLR == 0) |
| 916 | { |
| 917 | cancelOrder(); |
| 918 | } |
| 919 | else |
| 920 | { |
| 921 | shipments[leftIdx][rightIdx] = orderLR; |
| 922 | shipments[rightIdx][leftIdx] = -orderLR; |
| 923 | } |
| 924 | return orderLR; |
| 925 | } |
| 926 | |
| 927 | }; // namespace OpenApoc |