DCSUBMENU / DCREAD FIT

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

DCSUBMENU / DCREAD FIT

#1 Post by Tom »

Hi, Roger.

If a dialog contains several submenus on a menubar (like: 10 on a dialog sized 800 x 400) and this dialog is created with DCREAD FIT, it seems that space beyond the menubar is reserved for whatever. As you can see in screenshot one, there is some space between the menu bar and the other dialog elements. If I remove one ore two submenus, the dialog is created as initiated. There seems to be a miscalculation in conjunction with menubars and the FIT clause.

Tom.
Attachments
menu2.jpg
menu2.jpg (38.48 KiB) Viewed 9778 times
menu1.jpg
menu1.jpg (47.75 KiB) Viewed 9778 times
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCSUBMENU / DCREAD FIT

#2 Post by rdonnay »

Tom -

Sorry for taking so long to answer your question.
I got behind in some work.

I don't really understand this.
Menus are not supposed to affect the fix dimensions.

Any chance you can send me sample code?

Roger
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCSUBMENU / DCREAD FIT

#3 Post by Tom »

Hi, Roger.

I look through the eXpress++-code used with "FIT" and didn't find anything related to menus. But try this:

Code: Select all

#include "dcdialog.ch"

#pragma library("dclipx.lib")

PROCEDURE appsys() ; RETURN

PROCEDURE MAIN()
LOCAL GetList := {}, GetOptions := {}

DCGET OPTIONS HILITEGETS GRA_CLR_BLUE NOSUPERVISE SAYLEFTCENTER MINSIZE -1,-1

DCMENUBAR oMenu

FOR i := 1 TO 12 // Change this to 14 or 15
  c := LTrim(Str(i,2,0))
  cField := "cField"+c
  oMenu := "oMenu"+c
  DCSUBMENU &oMenu PROMPT 'Test '+c PARENT oMenu
  &cField := Space(20)
  @ i,1 DCSAY 'Field '+c GET &cField SAYSIZE 10
NEXT

cTest := Space(20)
@ 1,60 DCSAY 'Another Test' GET cTest SAYSIZE 10

DCREAD GUI FIT ADDBUTTONS OPTIONS GetOptions
RETURN
If you run this, it looks good. If you change the number in line 14 to 14 or 15, there is a blank line added below the menu, even though the menu does not need this space.

Tom.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCSUBMENU / DCREAD FIT

#4 Post by rdonnay »

Ok, I have a fix for the problem.

I'm surprised that this has not been reported before.
The height of the oDlg:menuBar object is important in determining the overall height of the oDlg object.
The height is determined at the time of creation of the window (before the autofit code is run).
It needs to be determined after the window is resized in the X direction but before it is resized in the Y direction.

The attached _DCGETBX.PRG corrects this problem.
Attachments
_dcgetbx.zip
(78.45 KiB) Downloaded 720 times
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCSUBMENU / DCREAD FIT

#5 Post by rdonnay »

Belay that last order swabbie.

It works on your test program but fails on all of my applications.

Trying to figure out why.
The eXpress train is coming - and it has more cars.

Post Reply