|
Post by dan1101 on Jul 23, 2021 11:13:00 GMT -5
Greetings,
I just joined and this is my first post on this forum. I appreciate any help from anyone. I am using Liberty BASIC Pro 4.5.1. I am trying to create a window with a background bmp and bmpbuttons that remain on top of the image. I have tried creating a large bmpbutton with the image, and placed other bmpbuttons on top of it. This works UNLESS the user clicks the background image (large bmpbutton), which is then moved to the front and the smaller bmpbuttons disappear behind it and become inaccessible. I have tried using a graphics window, but I need to be able to move bmpbuttons using !Locate, which does not seem to function in a graphics window.
Any advice or suggestions are greatly appreciated. Thank you for taking the time to read my question.
Dan1101 (LB Newbie)
|
|
|
Post by Rod on Jul 23, 2021 12:51:40 GMT -5
You are not supposed to place controls like buttons and textboxes over graphics. That said it mostly works, aside from statictext. Put your background graphic in a graphicbox in the window. Now create controls placed on top of that. The creation order, Z order is important. When you want to relocate controls, change their position and issue a standard locate command not a graphicbox !locate command, follow through with a refresh command. Ther is a resize.bas example to study.
|
|
|
Post by dan1101 on Jul 23, 2021 13:06:59 GMT -5
Thank you for the quick and thoughtful response. I will try your suggestion. I appreciate your time.
|
|
|
Post by dan1101 on Jul 27, 2021 12:23:38 GMT -5
After trying a number of approaches to display a button on top of a background image, I found a workaround that I am satisfied with. I was trying to use a button on top of a graphic background to display information which would only be visible when there was information to display, and which would otherwise remain completely invisible, showing only the background image. I tried a graphics window, but for a number of reasons could not get it to do what I wanted. I tried loading a bitmap into the window, but when I put a button on top of it, I couldn't get it to become invisible. Hiding it only changed it to the backcolor, which made it visible on top of the graphic. Disabling it changed it to a different color, but remained visible. Finally, I went back to using a regular window, with a large bmpbutton as the background image, and a regular button on top of it to display information. The problem was that when the user clicks the "background" bmpbutton that image is brought to the front, making the other button un-viewable and unreachable. My workaround solution is to send a click on the background bmpbutton to a subroutine that "Hides" the background bmpbutton and immediately "Shows" it again which, it turns out, restores the layers to the correct order and brings the button I wanted back to the top. Hooray! It may not be elegant programming, but it works.
|
|