Placing a bitmap on a form "on the fly" (OpenInsight Specific)
At 30 SEP 1998 08:40:45AM Steve C. wrote:
I have a form, in OI 3.6.1, that has a background of a map. I use
transparent buttons, with bubble help, to execute stored procedures.
I can not label locations on the map, therefor the bubble help.
Now I would like to provide help for people who don't know where
a city is. I have a drop down list with all the cities. I would
like the user to select a city from this list and have a SP place a
bitmap control, say a big red dot, over that location, and then remove it if another location is selected. Can this be done, and if so
how?????. Does the window/form need to be recompiled and redisplayed
or is there an easier way. A snipit of code would help.
TIA.
Steve C.
At 30 SEP 1998 09:32AM Carl Pates wrote:
Hi Steve,
OK, one way to do this is to dynamically create a BITMAP control on your window at runtime. To do this…
1) In the form designer create a bitmap control. It's exact properties aren't important, as you want to destroy it in your form's CREATE event anyway. It's just there to give you a base structure to base your dynamically created controls on.
2) In the CREATE event of your form get the ORIG_STRUCT property of the BITMAP you created above and save this somewhere, such as in a Common variable or an '@' property of the form. The structure is an @Vm delimited array ( see PS_EQUATES insert for position details ) that OI interprets to create a control
3) Destroy the BITMAP control using the Utility( "DESTROY"..) function
4) When you want display a bitmap, retrieve the structure you saved in (2) and modify it's dimenmsions and coordinates accordingly, and also the bitmap property as necessary. When you've done this call Utility( "CREATE", Structure ) passing it the modified structure to cerate your new bitmap in the screen.
cpates@sprezzatura.com
World Leaders in all things RevSoft
At 30 SEP 1998 09:41AM Steve C. wrote:
Carl..
Thanks for the info.
That will give me a good starting point. I hadn't thought
of having the bitmap control already on the form..
saving the structure for future use and then destroying
it in the create event..Thats probably exactly what I
need.
Steve C.
At 01 OCT 1998 04:12AM Oystein Reigem wrote:
 Steve (and Carl),
(1)
Please tell me - what are "transparent" buttons?
(2)
I thought what you wanted to do was easy, but perhaps these transparent buttons or the button help somehow gets in the way?
But if transparent buttons and bubbles do not cause problems, my very simple suggestion for a solution is: Make the red dot bitmap at design time, but make it invisible, so the user will not see it at startup. (Or put it outside the window client area.) Then, when you need the red dot placed somewhere on the map, just make it visible again and set its SIZE and to appropriate values. When you don't need the dot, just set it invisible again (or place it outside the client area).
This will work if you have the map bitmap on the window. If you have the map on a separate bitmap control you might have problems with the dot bitmap hiding beneath the map bitmap. But in my experience (although very limited experience) it helps if you design (or paste in) the dot bitmap after the map bitmap.
- Oystein -
At 01 OCT 1998 08:55AM Steve C. wrote:
Oystein,
What Carl suggests works really well. The window I have
has it's Window Properties-Bitmap Entity as a map. I have
placed transparent push buttons over the cities. To get a
transparent push button - in the Push Button Properties window
-Bitmap Entity select the "transparent" bitmap with "visible" checked.
When run the push buttons do not "appear" over the cities, but
they do still work like a regular button, including the bubble
help.
I also put a bitmap control in the lower corner… it's an arrow.
In the window create event I do an ORIG_STRUCT to get the bitmaps
original structure, immediately destroy it so it never shows up.
Then when a user selects a city from a drop down list I get that
city's X-Y location of it's transparent push button control and place
the arrow next to the city, with a slight X+5 and Y-2 offset.
Steve C.
At 01 OCT 1998 09:40AM Oystein Reigem wrote:
Steve,
Thanks for the info on transparent bitmaps!
(I can understand the pleasure of destroying and re-create things, but you didn't tell me why you couldn't just have kept the arrow bmp all the time and just move it around where you needed it.)
![]()
- Oystein -
At 01 OCT 1998 10:19AM Aaron Kaplan wrote:
Carl,
Could one not simply keep the button invisible and move it about as needed without creating and destroying?
akaplan@sprezzatura.com
At 01 OCT 1998 01:11PM Carl Pates wrote:
Yep, but that'll only give you one button…depends how many you want really and I hate having controls around that I don't really need..
At 02 OCT 1998 08:53AM Aaron Kaplan wrote:
I was just asking. I didn't expect some kind of Spanish Inquisition.
akaplan@sprezzatura.com
At 05 OCT 1998 04:43AM Torquemada wrote:
Just wait…these pincers take ages to heat up…
At 05 OCT 1998 06:00PM Aaron Kaplan wrote:
I'd ask him not to do that but I hear we can't torquemada anything…