Page 1 of 1

Expres++ and Layoutmanager() ?

Posted: Fri Apr 15, 2016 1:11 pm
by Auge_Ohr
since v1.9.335 we have Class Layoutmanager() but it was undocumented . in v2.x you can find it in Help File.

Code: Select all

#IF XPPVER > 1900331 .AND. XPPVER < 2000000
   // Xbase++ 1.9 compatibility
   #pragma library( "xppui3.lib" )

   #ifndef XBP_RELXPOS
   #define XBP_RELXPOS                    0x10
   #define XBP_RELYPOS                    0x20
   #define XBP_RELWIDTH                   0x40
   #define XBP_RELHEIGHT                  0x80
   #define XBP_XCENTER                    0x1000
   #define XBP_YCENTER                    0x2000
   #endif
#ENDIF


PROCEDURE MAIN
...
#IF XPPVER > 1900331 .AND. XPPVER < 2000000
   LayoutManager()
#ENDIF
...
   oXbp:layoutAlign  := ...
Question : what happens if i use it with Express++ ?

Re: Expres++ and Layoutmanager() ?

Posted: Fri Apr 15, 2016 3:02 pm
by rdonnay
I have never used it.

I need to know a lot more about it if I am to incorporate some of its features in eXpress++.

I don't even know what it does.

Re: Expres++ and Layoutmanager() ?

Posted: Fri Apr 15, 2016 3:55 pm
by Auge_Ohr
Layoutmanager() will react on "resize".
i do have use it in USESLIDE.PRG (v0.10)

here Sample from Alaska (got it on a "Usertreffen")
Layout Manager.zip
(8.24 KiB) Downloaded 517 times
for Xbase++ v2.x you may to exclude

Code: Select all

// Xbase++ 1.9 compatibility
#pragma library( "xppui3.lib" )

Re: Expres++ and Layoutmanager() ?

Posted: Fri Apr 15, 2016 4:45 pm
by rdonnay
Layoutmanager() will react on "resize".
eXpress++ has its own layout manager.

If you look at DCSLIDE.CH, you will see that there is a RESIZE clause.

The resize clause can be any of the following or your own code block:

Code: Select all

#define   DCGUI_RESIZE_BLOCK         {|x,y,o|{o:currentSize()[1]+x,o:currentSize()[2]+y}}
#define   DCGUI_REPOS_BLOCK          {|x,y,o|{o:currentPos()[1]+x,o:currentPos()[2]+y}}
#define   DCGUI_REPOSX_BLOCK         {|x,y,o|{o:currentPos()[1]+x,o:currentPos()[2]}}
#define   DCGUI_REPOSY_BLOCK         {|x,y,o|{o:currentPos()[1],o:currentPos()[2]+y}}
#define   DCGUI_RESIZEX_BLOCK        {|x,y,o|{o:currentSize()[1]+x,o:currentSize()[2]}}
#define   DCGUI_RESIZEY_BLOCK        {|x,y,o|{o:currentSize()[1],o:currentSize()[2]+y}}
#define   DCGUI_REPOS_CENTER_BLOCK   {|x,y,o|{(o:setParent():currentSize()[1]-o:currentSize()[1])/2,(o:setParent():currentSize()[2]-o:currentSize()[2])/2}}
#define   DCGUI_REPOS_CENTER_X_BLOCK {|x,y,o|{(o:setParent():currentSize()[1]-o:currentSize()[1])/2,o:currentPos()[2]}}
#define   DCGUI_REPOS_CENTER_Y_BLOCK {|x,y,o|{o:currentPos()[1],(o:setParent():currentSize()[2]-o:currentSize()[2])/2}}
#define   DCGUI_RESIZE_AUTO_BLOCK    {|x,y,o,x1,y1,x2,y2|{x1*x2,y1*y2}}
#define   DCGUI_REPOS_AUTO_BLOCK     {|x,y,o,x1,y1,x2,y2|{x1*x2,y1*y2}}

#define   DCGUI_RESIZE_RESIZEONLY     { nil, DCGUI_RESIZE_BLOCK, .f. }
#define   DCGUI_RESIZE_REPOSONLY      { DCGUI_REPOS_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_REPOSONLY_X    { DCGUI_REPOSX_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_REPOSONLY_Y    { DCGUI_REPOSY_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_RESIZEONLY_X   { nil, DCGUI_RESIZEX_BLOCK, .f. }
#define   DCGUI_RESIZE_RESIZEONLY_Y   { nil, DCGUI_RESIZEY_BLOCK, .f. }
#define   DCGUI_RESIZE_BOTH           { nil, DCGUI_RESIZE_BLOCK, .f. }
#define   DCGUI_REPOS_BOTH            { DCGUI_REPOS_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_REPOS          { DCGUI_REPOS_BLOCK, DCGUI_RESIZE_BLOCK, .f. }
#define   DCGUI_RESIZE_NONE           { nil, nil, .f. }
#define   DCGUI_RESIZE_CENTER         { DCGUI_REPOS_CENTER_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_CENTERONLY_X   { DCGUI_REPOS_CENTER_X_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_CENTERONLY_Y   { DCGUI_REPOS_CENTER_Y_BLOCK, nil, .f. }
#define   DCGUI_RESIZE_REPOSY_RESIZEX { DCGUI_REPOSY_BLOCK, DCGUI_RESIZEX_BLOCK, .f. }
#define   DCGUI_RESIZE_REPOSX_RESIZEY { DCGUI_REPOSX_BLOCK, DCGUI_RESIZEY_BLOCK, .f. }
#define   DCGUI_RESIZE_RESIZEX_REPOSY { DCGUI_REPOSY_BLOCK, DCGUI_RESIZEX_BLOCK, .f. }
#define   DCGUI_RESIZE_RESIZEY_REPOSX { DCGUI_REPOSX_BLOCK, DCGUI_RESIZEY_BLOCK, .f. }
#define   DCGUI_RESIZE_AUTORESIZE     { DCGUI_REPOS_AUTO_BLOCK, DCGUI_RESIZE_AUTO_BLOCK, .f. }
#define   DCGUI_RESIZE_AUTORESIZE_SCALEFONT { DCGUI_REPOS_AUTO_BLOCK, DCGUI_RESIZE_AUTO_BLOCK, .t. }
Example:

Code: Select all

@ 350,0 DCSLIDE SIZE 500,30 ;
      ORIENTATION XBPPRN_ORIENT_LANDSCAPE ;
      RANGE 0, 255 ;
      SCOPE 100, 185 ;
      ColorCHANNEL GRA_CLR_RED ;
      ColorSCOPE GRA_CLR_YELLOW ;
      ColorTHUMB GRA_CLR_CYAN ;
      FREQUENCY 5 ;
      TRACK {|a,b,o| nRed := a, ShowRGB( nRed, nGreen, nBlue, @oStatic) } ;
      RESIZE DCGUI_RESIZE_RESIZEONLY_X // resize horizontally when parent resizes