cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : Windows Programming : Resource File Control Sizes
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programm...
Articles
Lounge
Jobs

-

post  Resource File Control Sizes

jrohde (17)
Hello -

When creating a modeless dialog box resource, I noticed that every coordinate and size for the controls is larger than it would be, had I created the same types of controls dynamically in a window procedure.

When compared to a test image of known length in pixels, the normal CreateWindow() dimensions are the correct ones, whereas the dialog resource control dimensions are about 1 1/2 to 2 times as large as they ought to be.

This is not a problem, programming-wise, because the program is 100% functional as I expect, but I was just really surprised when the first time I compiled and ran this, everything was huge.

Has anyone else had this issue? Essentially, the dialog box from the code below of width 200 shows up about twice that width. The push buttons of height 10 show up as if they're about 17 pixels high. Thank you in advance to anyone with an answer!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
IDD_MARGINS DIALOG 100, 100, 200, 100
STYLE DS_SETFONT | WS_CAPTION | WS_VISIBLE
CAPTION "Edit Margin Size (pixels):"
FONT 8, "Courier New"
BEGIN
     PUSHBUTTON "Accept", ID_ACCEPT,     140, 20, 50, 10
     PUSHBUTTON "Reset",  ID_RESET,      140, 35, 50, 10
     PUSHBUTTON "Cancel", ID_CANCEL,     140, 50, 50, 10
     EDITTEXT             ID_EDITLEFT,   50,  20, 50, 10, ES_AUTOHSCROLL | WS_TABSTOP, WS_EX_CLIENTEDGE
     EDITTEXT             ID_EDITRIGHT,  50,  35, 50, 10, ES_AUTOHSCROLL | WS_TABSTOP, WS_EX_CLIENTEDGE
     EDITTEXT             ID_EDITTOP,    50,  50, 50, 10, ES_AUTOHSCROLL | WS_TABSTOP, WS_EX_CLIENTEDGE
     EDITTEXT             ID_EDITBOTTOM, 50,  65, 50, 10, ES_AUTOHSCROLL | WS_TABSTOP, WS_EX_CLIENTEDGE
     RTEXT      "Left:",  ID_TEXT_LEFT,  18,  20, 30, 10
     RTEXT      "Right:", ID_TEXT_RIGHT, 18,  35, 30, 10
     RTEXT      "Top:",   ID_TEXT_TOP,   18,  50, 30, 10
     RTEXT      "Bottom:",ID_TEXT_BOTTOM,18,  65, 30, 10
END
|
Greenhorn (3)
Maybe the values you've set were overridden, because the caption is longer than 100 pixels and the the fontsize + padding is at min. 17 ???

Try it without text and look what happens ...


Greetz
|

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2009 - All rights reserved - v2.2
Spotted an error? contact us