Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (nButtons % 4 <= 1) //
- {
- turns = (nButtons / 4);
- turns = turns - 1;
- }
- else
- {
- turns = nButtons / 4;
- }
- if (turns > 0) // If turns is greater than ZERO
- {
- // Start positioning buttons by groups of 4 until last set quantity is 5 or lower
- int x = 0;
- for (int j = 0; j < turns; j++)
- {
- btnmgr.PlaceButtons(x, 4, 3, 5); // 'x' starts as 0, so first pos in nButtons will be ZERO
- x += 4; // Each time PlaceButtons is called, add 4 to 'x' so next iteration will place all buttons after last 4.
- }
- if (nButtons - turns * 4 > 0) // nButtons - turns*4 means
- {
- btnmgr.PlaceButtons((turns * 4), (nButtons - (turns * 4)), 0, 5);
- }
- }
- else
- {
- if (nButtons == 1)
- {
- btnmgr.Place1Button();
- }
- else
- {
- btnmgr.PlaceButtons(0, nButtons, 0, nButtons);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement