Tabs not resizing properly

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Tabs not resizing properly

#1 Post by TWolfe »

Just added the 'ANGLE' parameter to some tab pages and noticed that resizing does not work properly with the angle set. You can shrink a page properly, but expanding horizontally does not increase the tab size.

See sample program below. If you comment out the angle argument on tab #1, resizing works properly.

Also tab height never increases even when the font is too tall to fit.

Any Ideas?

Terry

Code: Select all

#include "dcdialog.ch"

PROCEDURE MAIN()
LOCAL oDlg, oDraw:={}, GetOptions, GetList:={}, ;
      oTabPage1, oTabPage2

@ 6,1 DCTABPAGE oTabPage1 CAPTION 'Tab Page #1'   ;
          PREOFFSET 0 POSTOFFSET 60  ;
          ANGLE 30  ;     // Comment this line out and resize works properly
          SIZE 40,8

@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Tab Page #2' ;
        RELATIVE oTabPage1
DCGETOPTIONS EXITVALIDATE RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCREAD GUI FIT ;
   OPTIONS GetOptions

RETURN

PROCEDURE AppSys()
RETURN

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

Re: Tabs not resizing properly

#2 Post by rdonnay »

I am looking at this now.
I'll get back to you soon with an answer.
The eXpress train is coming - and it has more cars.

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

Re: Tabs not resizing properly

#3 Post by rdonnay »

Terry -

This is a bit of a kludgy workaround, but it seems to work.

Code: Select all

#include "dcdialog.ch"

PROCEDURE MAIN()
LOCAL oDlg, oDraw:={}, GetOptions, GetList:={}, oTabPage1, oTabPage2, bAction, bResize

bAction := {||oTabPage1:configure(), oTabPage2:configure()}

@ 6,1 DCTABPAGE oTabPage1 CAPTION 'Tab Page #1'   ;
          PREOFFSET 0 POSTOFFSET 60  ;
          ANGLE 30  ;     // Comment this line out and resize works properly
          SIZE 40,8 ;

@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Tab Page #2' ;
        RELATIVE oTabPage1 ;

DCGETOPTIONS EXITVALIDATE RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCREAD GUI FIT ;
   OPTIONS GetOptions ;
   EVAL {|o|bResize := o:resize, o:resize := {|a,b,o|Eval(bResize,a,b,o),Eval(bAction)}}

RETURN

PROCEDURE AppSys()
RETURN
The eXpress train is coming - and it has more cars.

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

Re: Tabs not resizing properly

#4 Post by rdonnay »

Here is a better solution, which I have added to eXpress++ build 260.

Make the following change to the DC_Resize() function in _DCFUNCT.PRG:

WAS:

Code: Select all

  IF oXbp:isDerivedFrom('DC_XbpTabPage') .AND. Valtype(oXbp:staticArea) == 'O'
    Eval(oXbp:resize,aOldSize,aNewSize,oXbp)
    oXbp := oXbp:staticArea
  ENDIF
IS:

Code: Select all

  IF oXbp:isDerivedFrom('DC_XbpTabPage')
    IF Valtype(oXbp:staticArea) == 'O'
      Eval(oXbp:resize,aOldSize,aNewSize,oXbp)
      oXbp := oXbp:staticArea
    ENDIF
    IF oXbp:angle > 0
      oXbp:configure()
    ENDIF
  ENDIF
Rebuild DCLIPX.DLL by running BUILD19_SL1.BAT
The eXpress train is coming - and it has more cars.

User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: Tabs not resizing properly

#5 Post by TWolfe »

Roger, there appears to be a problem with this fix.
I will do more testing and let you know what I find.

Error is object has no method 'ANGLE'.

Funny, it works perfectly on the sample program I sent you, but does not work in my application???

Terry

User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: Tabs not resizing properly

#6 Post by TWolfe »

The sample program did not use 'STATICAREA'

As soon as you add 'STATICAREA' the system fails.

Code: Select all

#include "dcdialog.ch"

PROCEDURE MAIN()
LOCAL oDlg, oDraw:={}, GetOptions, GetList:={}, oTabPage1, oTabPage2, bAction, ;
      bResize, oT1, oT2, cc1, cc2, cc3

cc1:=cc2:=cc3 := "Just some Text                         "

@ 6,1 DCTABPAGE oTabPage1 CAPTION 'Tab Page #1'   ;
          PREOFFSET 0 POSTOFFSET 60  ;
          STATICAREA oT1 ;
          ANGLE 30  ;     // Comment this line out and resize works properly
          SIZE 40,8 ;

DCSETPARENT TO oT1

@ 1,3  DCSAY "Tab 1 Line 1" GET cc1 SAYRIGHT SAYSIZE 15
@ 2,3  DCSAY "Tab 1 Line 2" GET cc2 SAYRIGHT SAYSIZE 15
@ 3,3  DCSAY "Tab 1 Line 3" GET cc3 SAYRIGHT SAYSIZE 15

DCSETPARENT TO

@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Tab Page #2' ;
        STATICAREA oT2 ;
        RELATIVE oTabPage1

DCGETOPTIONS EXITVALIDATE RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCREAD GUI FIT ;
   OPTIONS GetOptions //;
  // EVAL {|o|bResize := o:resize, o:resize := {|a,b,o|Eval(bResize,a,b,o),Eval(bAction)}}

RETURN

PROCEDURE AppSys()
RETURN

I changed the fix to the _DCFUNCT.PRG as follows:

Code: Select all

IF oXbp:isDerivedFrom('DC_XbpTabPage')
  IF Valtype(oXbp:staticArea) == 'O'
    Eval(oXbp:resize,aOldSize,aNewSize,oXbp)
    IF oXbp:angle > 0
      oXbp:configure()
    ENDIF
    oXbp := oXbp:staticArea
  ENDIF
ENDIF
This does not throw an error, but the redraw events are so frequent that the dialog locks-up after a few resizes.

This is not a big deal, I will just not use the 'ANGLE' clause on tabs until I find a better solution.

Bottom line: back out the changes from _DCFUNCT.PRG untill this is worked out.

Terry

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

Re: Tabs not resizing properly

#7 Post by rdonnay »

Oops, I didn't look at my code very closely.

This should fix it:

Change this:

Code: Select all

  IF oXbp:isDerivedFrom('DC_XbpTabPage')
    IF Valtype(oXbp:staticArea) == 'O'
      Eval(oXbp:resize,aOldSize,aNewSize,oXbp)
      oXbp := oXbp:staticArea
    ENDIF
    IF oXbp:angle > 0
      oXbp:configure()
    ENDIF
  ENDIF
To this:

Code: Select all

  IF oXbp:isDerivedFrom('DC_XbpTabPage')
    IF oXbp:angle > 0
      oXbp:configure()
    ENDIF
    IF Valtype(oXbp:staticArea) == 'O'
      Eval(oXbp:resize,aOldSize,aNewSize,oXbp)
      oXbp := oXbp:staticArea
    ENDIF
  ENDIF
The eXpress train is coming - and it has more cars.

Post Reply