Author Topic: Try to have 2 image buttons but fail  (Read 1055 times)

0 Members and 1 Guest are viewing this topic.

chrisc

  • Guest
Try to have 2 image buttons but fail
« on: March 16, 2018, 06:06:41 PM »
Hello all

i have modified Roland's  program of Image button, by having 2 image buttons but fail
can someone resolve this problem?
i have attached the problem code

Arnold

  • Guest
Re: Try to have 2 image buttons but fail
« Reply #1 on: March 18, 2018, 02:39:47 AM »
Hi Chris,

I attached your ImgButtonX.o2bas, slightly modified.
When creating the dialog, the number of controls is the first argument, in this case: Dialog( 2, ... . The constant % review can be uncommented, this opens a console window with some statements if something goes wrong.
hInstance is defined as GetModuleHandle(null), so this should work for LoadIcon or LoadImage too. Win32 says the MapDialogRect function converts units to pixels, so I used this. I assume it could also be done as a macro or a function.
I am still not sure how the button should behave. I expected that it should react like a PushButton with an image but I do not get the feeling of a Pushbutton. I suppose there must be done some investigation. This is the interesting part if you do not use ready-to-use functions.

Roland

chrisc

  • Guest
Re: Try to have 2 image buttons but fail
« Reply #2 on: March 18, 2018, 06:39:17 AM »
Thanxx a lot, Roland

i have atteched my own PB source code and program for you to see how PB imagebuttonX works
PB is quite good but its no development make us quit

chrisc

  • Guest
Re: Try to have 2 image buttons but fail
« Reply #3 on: March 18, 2018, 06:51:39 AM »
Roland,
i think your program's push button works okay maybe make it smaller so the effect simulates
those of the PB program that i atteched here.

note that PB's  IMGBUTTONX  is a proprietary command so it is not within our reach to be able to
get that kind of behavor,  maybe just a mimicry will do.  your program fits this will do.

Bob Zale the former PB owner was a great ASM programmer and he did this to perfection, we will
never be able to match his skills, close enough will do