1. IDE project
- Posted by DonCole Aug 06, 2013
- 1457 views
Hello Everybody,
How can I move controls around in a bitmap, same as a window, using IDE?
IDE does not allow me to make a bitmap a parent like a window.
Here is my code that I wrote by hand. Using trial and error numbers to place the EditText where I want it.
I have a lot more EditTexts to create and it will take forever to do it by hand.
-- code generated by Win32Lib IDE v0.22.0 Build Dec-16-2006 constant TheProgramType="exw" include Win32Lib.ew without warning -------------------------------------------------------------------------------- -- Window Window1 global constant Window1 = createEx( Window, "Window1", 0, Default, Default, 1076, 448, 0, 0 ) global constant Picture = createEx( Bitmap, "ramp3.bmp", Window1, 1, 1, 1076, 448, w32or_all({WS_BORDER}), 0 ) global constant PushButton3 = createEx( PushButton, "Calculate", Picture, 24, 372, 88, 28, 0, 0 ) global constant PushButton4 = createEx( PushButton, "Close", Picture, 952, 376, 88, 28, 0, 0 ) global constant EditText6 = createEx( EditText, "EditText6", Picture, 350, 135, 44, 24, 0, 0 ) --------------------------------------------------------- procedure PushButton4_onClick (integer self, integer event, sequence params)--params is () closeWindow(Window1) end procedure setHandler( PushButton4, w32HClick, routine_id("PushButton4_onClick")) procedure PushButton3_onClick (integer self, integer event, sequence params)--params is () ---- end procedure setHandler( PushButton3, w32HClick, routine_id("PushButton3_onClick")) -------------------------------------------------------------------------------- ------------------------------------------------------- -- IDE Project generated from exw file using -- exw2prj 1.1 final (IDE 0.12) written by Martin Stachon ------------------------------------------------------- -- code generated by Win32Lib IDE v0.22.0 Build Dec-16-2006 include Win32Lib.ew -------------------------------------------------------------------------------- -- Window Window1 --global constant Bitmap2 = createEx( Bitmap, "Bitmap2", Window1, 188, 96, 504, 248, 0, 0 ) --------------------------------------------------------- --this program has 15 lines without including this line. If there is a discrepancy please send this file zipped to Judith. WinMain( Window1,Normal ) --this program has 36 lines without including this line. If there is a discrepancy please send this file zipped to Judith.
Don Cole
2. Re: IDE project
- Posted by DerekParnell (admin) Aug 07, 2013
- 1440 views
How can I move controls around in a bitmap, same as a window, using IDE?
I don't know. But why are you using a bitmap as a container for controls? What advantages does it give you over using a window?
3. Re: IDE project
- Posted by ghaberek (admin) Aug 07, 2013
- 1419 views
How can I move controls around in a bitmap, same as a window, using IDE?
I don't know. But why are you using a bitmap as a container for controls? What advantages does it give you over using a window?
Just my $0.02 on this... I'm guessing his application has a background image with controls on top. And if that were the case, I would suggest building a "plain" Window and then manually drawing the background image during a paint event.
-Greg
4. Re: IDE project
- Posted by DonCole Aug 08, 2013
- 1296 views
How can I move controls around in a bitmap, same as a window, using IDE?
I don't know. But why are you using a bitmap as a container for controls? What advantages does it give you over using a window?
The reason is because I want to look at the bitmap in the window so I see where to place the controls.
Don Cole
5. Re: IDE project
- Posted by DonCole Aug 08, 2013
- 1302 views
How can I move controls around in a bitmap, same as a window, using IDE?
I don't know. But why are you using a bitmap as a container for controls? What advantages does it give you over using a window?
Just my $0.02 on this... I'm guessing his application has a background image with controls on top. And if that were the case, I would suggest building a "plain" Window and then manually drawing the background image during a paint event.
-Greg
So your saying place the controls in the window the picture around them.
I'm using MS Paint to draw the picture. How would I get the control positions in Paint? Thanks for the reply.
Don Cole
6. Re: IDE project
- Posted by DerekParnell (admin) Aug 08, 2013
- 1316 views
I'm using MS Paint to draw the picture. How would I get the control positions in Paint?
In the long run, it's not a great idea to base control locations on exact pixel positions because people have varying video resolutions. So it is very likely that while the positions may look good to you, for someone with a smaller or bigger screen the controls could look sub-optimal. A better approach is to use inches/millimeters to position controls and calculate the right pixel location when you run the program.
For example, you want a button which is 0.5 inches from the left edge, and your screen has 128 pixels/inch then the correct pixel to use is pixel (0.5 * 128) = 64.
However, if you must use pixel locations, then MS-PAINT shows you the pixel position of the cursor in the lower left corner of the paint window.