layout crash

Reports of bugs and issues with Phoenix.
KJAMP
Member
Posts: 44
Joined: Tue Nov 29, 2005 3:48 am
Location: USA
Contact:

layout crash

Postby KJAMP » Mon Jan 29, 2007 11:31 pm

I was setting up a layout, not a simple one, and Phoenix crashed.

I had everything resizing and moving as I wanted, then I started adding limits so that items could not get to small. this is when the trouble started.

all the work of setting the layout up has to be cleared and started over as things does not seem to work correctly.

I can send you the code as it is only the code generated by Phoenix and my layout.

any ideas?

frank
Frank

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Postby TechSupport » Tue Jan 30, 2007 3:04 am

Send me the project.
Which one of the following describes where the crash happened?
1) While the layout rules editor was opened.
2) While the limits editor was opened.
3) While resizing the form in the designer.

KJAMP
Member
Posts: 44
Joined: Tue Nov 29, 2005 3:48 am
Location: USA
Contact:

layout

Postby KJAMP » Tue Jan 30, 2007 7:29 am

I sent the file.

after I zipped the project, I edited my copy (frm and rc files) and removed the limit information leaving the sizing stuff. it does not crash but the resizing moving does not work in the EXE. everything seems to work like I never used the layout.

I can clear the layout information and start over, but if it is just going to repeat the error....

does the layout have limits? (number of controls, ...)

Please let me know if you need more info.

frank
Frank

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Postby TechSupport » Tue Jan 30, 2007 10:10 am

The limits in the form file are for controls that do not appear on the form. Either the limits for deleted controls are not being removed from the list, or the limits became corrupted. I will have to examine the code for the editor to see which one of these possible causes is the culprit.

The only way to get remove these invalid limits is to either:
1) Delete all layout rules.
2) Recreate the layout rules.

Or

1) Close the project.
2) Load the form file(not the project, just the form).
3) Delete this block.

Code: Select all

  Limits
  BEGIN
    LimitCount=8
    ...
    ...
    ...
  END

4) Save the form file.
5) Reload project.
6) Rebuild project.

Alternate option.
If you can live with just limiting how small the form can get(e.g. no smaller than the design size), you can eschew the limits and use the following instead.
1) Open the editor for the WindowPlacement property.
2) Select the Min Max Info tab.
3) Uncheck the Minimum Height and the Minimum Width Default checkboxes.
4) Click OK when done.
5) Rebuild project.

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Postby TechSupport » Tue Jan 30, 2007 10:29 am

If You are going to using the WindowPlacement option, there appears to be a bug in the code generator.

Code: Select all

    CASE %WM_CREATE
      ' Create and save the font used by the form
      hFont = GetStockObject(%DEFAULT_GUI_FONT)
      SendMessage ghWndMain, %WM_SETFONT, hFont, %FALSE

should be

Code: Select all

    CASE %WM_CREATE
      ' Create and save the font used by the form
      hFont = GetStockObject(%DEFAULT_GUI_FONT)
      SendMessage hWnd, %WM_SETFONT, hFont, %FALSE

ghWndMain is a bug that was introduced in the last update.
This code is in the design file(*.bas) for the form.

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Postby TechSupport » Tue Jan 30, 2007 10:36 am

The ghWndMain bug was introduced when the "Generate Global Handles for Forms" option was added.
Unchecking this option in the project editor causes the correct code to be generated.

The presence of a docking container produces the same bad code.

Oh well, this bug has been fixed.

TechSupport
Site Admin
Posts: 809
Joined: Tue Sep 14, 2004 7:55 pm
Location: Mississauga ON, Canada

Postby TechSupport » Sat Mar 24, 2007 1:04 am

A temporary workaround for this erroneus code

Code: Select all


    CASE %WM_CREATE
      ' Create and save the font used by the form
      hFont = GetStockObject(%DEFAULT_GUI_FONT)
      SendMessage ghWndMain, %WM_SETFONT, hFont, %FALSE

is to add the following code to the WM_CREATE handler of the form:

Code: Select all

SendMessage hWnd, %WM_SETFONT, GetStockObject(%DEFAULT_GUI_FONT), %FALSE


Return to “Phoenix Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest