Page 1 of 1

What Would Cause A Button To Automatically Resize?

Posted: Mon Sep 21, 2015 8:46 pm
by the_wesley_watkins
This is difficult to explain, but I have a screen with a bunch of buttons and a loop that automatically places them. However, some of them are placed correctly at first (with the correct width and height settings), but after other buttons are place, they go to the default automatic button size.

Here is a picture:
image.jpg
image.jpg (356.45 KiB) Viewed 1879 times
Most of the buttons are fine but the Vancomycin and Zosyn buttons have been sent back to default size. If I put on a delay, I see that they are placed with the right size at first, but then are changed once later buttons are placed. What causes this?

Re: What Would Cause A Button To Automatically Resize?

Posted: Mon Sep 21, 2015 8:54 pm
by Mr. Kibernetik
Maybe they are re-created somewhere with another size.

Re: What Would Cause A Button To Automatically Resize?

Posted: Mon Sep 21, 2015 9:06 pm
by the_wesley_watkins
I don't really think so. Here is the code for creating the button:

Code: Select all

BUTTON medbutton$(bnum) TEXT TEXT$ AT margin + (pagediv * (divx * startx(COUNT))), graphdiv(LINE) SIZE medbsizex, 21.1167
The height of the button should always be 21.1167. However, it eventually just goes back to the default width and height.

Is there anything else you could think of that might be happening?

Re: What Would Cause A Button To Automatically Resize?

Posted: Tue Sep 22, 2015 5:32 pm
by rbytes
Try declaring the height as a variable and using that in your button statement. Check for any other button statements in your code and make sure they all use it. Numbers are very easy to mistype.