May 06, 2024, 04:45:35 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


why the difference?

Started by LarryMc, May 10, 2011, 07:07:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

May 10, 2011, 07:07:38 AM Last Edit: May 10, 2011, 07:29:43 AM by LarryMc
I created two different apps.
The 1st is windows based and the window is created with:
OpenWindow main,0,0,465,300,@SIZE|@MINBOX|@MAXBOX|@CAPTION|@SYSMENU,0,"Form1",&main_handler
The 2nd is dialog based and the dialog is created with:
CreateDialog main,0,0,465,300,@SIZE|@MINBOX|@MAXBOX|@CAPTION|@SYSMENU,0,"Form1",&main_handler
Notice that both are created as the same size (0,0,465,300 pixels)

In the attached picture the window based app is stacked on top of the dialog based app.
Notice that the dialog is a little wider and a lot taller than the window based.

Why?  My apps aren't using anything like setsize,move, etc to change the size of the window/dialog.

Any ideas?  It's throwing my designer output off.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Figured out what was going on and have a work around.

I looked at the source code for the CREATEDIALOG command.
Unlike the OPENWINDOW command, dialogs have their sizes calculated based upon what you ask for (l,t,w,h), the calculated character sizes for the default font (MS Sans Serif,8) in the dialog device context, fixed multiplication factor(one size fits all),  blah, blah, ......

The work around is to use a SETSIZE command in the  @IDInitDialog of the dialog with the original
requested size (l,t,w,h) which doesn't do all the calculation stuff.

I'm going to have the designer insert that command automatically when dialogs are created.

That's so the final appearance will look the same as in the designer (In the designer I use a window for the form, whether it's a window or a dialog.)

Maybe Sapero will look into the CREATEDIALOG command to see if the calculations are really needed.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

workaround is implemented in the Visual Designer ;D

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library