-
April 17th, 2010, 02:28 PM
#1
Dialog dimension
Hello,
Made a dialog.
when viewing the code using the *.rc option it shows:
IDD_MAIN_DIALOG DIALOGEX 0, 0, 332, 218
when running the program, and using the
pWnd->GetWindowRect(&rcMain);
the values are:
top: 334
bottom: 716
left: 588
right: 1092
do I need to use some kind of a constant, or something like that?
(Dialog centre option ON, screen res: 1680 x 1050)
regards,
ger
-
April 17th, 2010, 04:57 PM
#2
Re: Dialog dimension
The resource editor measures in "twips".
http://en.wikipedia.org/wiki/Twip
-
April 17th, 2010, 10:23 PM
#3
Re: Dialog dimension
The resource file does not contain absolute coordinates (which would not make much sense). Thus, the top/left for a dialog is 0/0. You can specifically control where it is being displayed by using functions such as 'CenterWindow()' or 'SetWindowPlacement()' and so on....
-
April 19th, 2010, 04:24 AM
#4
Re: Dialog dimension
the values are:
top: 334
bottom: 716
left: 588
right: 1092
do I need to use some kind of a constant, or something like that?
( Dialog centre option ON, screen res: 1680 x 1050)
What for?
top + bottom = 334 + 716 = 1050
left + right = 588 + 1092 = 1680
Your dialog is centered alright. What else is needed?
Originally Posted by hoxsiew
The resource editor measures in "twips".
Dialog Units
MapDialogRect
Last edited by Igor Vartanov; April 19th, 2010 at 04:34 AM.
Best regards,
Igor
-
April 19th, 2010, 08:32 AM
#5
Re: Dialog dimension
My bad. I must have misremembered something about VB I think.
-
April 20th, 2010, 03:51 PM
#6
Re: Dialog dimension
to igor
thank you!
I did not saw the numbers............
but
when I put in a button using 166, 196, 50, 14
it is not in the place I want to
that is what I meen with using a factor
regards,
ger
Last edited by TBBW; April 20th, 2010 at 03:56 PM.
-
April 20th, 2010, 04:12 PM
#7
Re: Dialog dimension
when I put in a button using 166, 196, 50, 14
it is not in the place I want to
In case you do that at runtime, you need to MapDialogRect.
Best regards,
Igor
-
April 23rd, 2010, 04:36 PM
#8
Re: Dialog dimension
Oke thanks,
Now;
when I have a bitmap image and I want to use it for a button.
the sizes also do not match
the bitmap image is 77 x 25
making a button of that size is not fully correct.
regards,
ger
-
April 23rd, 2010, 05:15 PM
#9
Re: Dialog dimension
Hi,
Was screeming to soon...
have to use SizeToContent(), to make the button the same as the image.
(image is the master, button is slave, correct?)
and,
Now I want to make the dialog which hosts this button, the same dimensions as
the button has. (Yep, it is a very small 1 button dialog)
is that possible?
regards,
ger
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|