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.
DCSUBMENU / DCREAD FIT
DCSUBMENU / DCREAD FIT
- Attachments
-
- menu2.jpg (38.48 KiB) Viewed 11733 times
-
- menu1.jpg (47.75 KiB) Viewed 11733 times
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DCSUBMENU / DCREAD FIT
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
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.
Re: DCSUBMENU / DCREAD FIT
Hi, Roger.
I look through the eXpress++-code used with "FIT" and didn't find anything related to menus. But try this:
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.
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
Tom.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: DCSUBMENU / DCREAD FIT
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.
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 916 times
The eXpress train is coming - and it has more cars.
Re: DCSUBMENU / DCREAD FIT
Belay that last order swabbie.
It works on your test program but fails on all of my applications.
Trying to figure out why.
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.