FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Folder Itemsize
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Folder Itemsize
Posted: Sun Jan 31, 2010 03:24 PM
Antonio,

I want to increase the height of the tab control items using SetItemsize when themes are active.
It is working fine as long as the transparent clause is not used.
Please see the difference in the modified testfld4.prg below once compiled with TRANSPARENT once without (with themes in RC-file)
I'm using FWH 9.07.

How can this be fixed?
Thanks for help,
Dietmar



Code (fw): Select all Collapse
#include "fivewin.ch"

PROCEDURE main()
    LOCAL oDlg, oFolder
    LOCAL cContrato:=space(13)  ,;
          cNombre:=space(30)    ,;
          cDireccion:=space(60) ,;
          cTelefono:=space(10)  ,;
          cNotas:=""

    //Define dialogo
    DEFINE DIALOG oDlg NAME "DLGTEST";
        TITLE "Another folder test";
         TRANSPARENT

//    Redefine controles
    REDEFINE GET cContrato;
        ID 101 OF oDlg;
        PICTURE "@!" ;
        VALID !empty(cContrato)

    //Redefine controles del dialogo
   REDEFINE FOLDER oFolder             ;
        ID 102                           ;
        OF oDlg                          ;
        PROMPTS "Pagina &1","Pagina &2"  ;
        DIALOGS "DlgPage1", "DlgPage2"

    // oFolder:lWin95Look:=.f.

    //Redefine controles del 1er. page
    *=======================================================================
    REDEFINE GET cNombre;
        ID 101 OF oFolder:aDialogs[1];
        PICTURE "@!" ;
        VALID !empty(cNombre)

    REDEFINE GET cDireccion;
        ID 102 OF oFolder:aDialogs[1];
        PICTURE "@!";
        VALID !empty(cDireccion)

    REDEFINE GET cTelefono;
        ID 103 OF oFolder:aDialogs[1]

   REDEFINE BTNBMP ;
        ID 104 OF oFolder:aDialogs[1];
        NAME "CANCELAR";
        ACTION ( MsgDate() )

    //Redefine controles del 2do. page
    *=======================================================================
    REDEFINE GET cNotas;
        ID 101 OF oFolder:aDialogs[2];
        MEMO

    *=======================================================================
    REDEFINE BUTTON;
        ID 201 OF oDlg

    REDEFINE BUTTON;
        ID 202 OF oDlg;
        ACTION oDlg:end() CANCEL

    //Activar dialogo
    ACTIVATE DIALOG oDlg CENTER;
    On INIT IIF(IsThemeActive(), oFolder:SetItemsize( ,25 ), ) //---> changed
RETURN

procedure AppSys  // Xbase++ requirement

return
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Folder Itemsize
Posted: Tue Feb 02, 2010 01:05 PM
To make things clearer, this it the result:



Without transparent clause, the folders are painted ok.

How can this be fixed?
Dietmar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 09:55 AM
Dietmar,

We are reviewing Windows include\commctrl.h where all styles and messages for folders are defined.

Maybe this message could help: TCM_SETITEMSIZE
http://msdn.microsoft.com/en-us/library/bb760635(VS.85).aspx

also, this one could help: TCM_ADJUSTRECT
http://msdn.microsoft.com/en-us/library/bb760639(VS.85).aspx

Finally, this may be also an option: TCM_SETPADDING
http://msdn.microsoft.com/en-us/library/bb760639(VS.85).aspx

To call those functions you can easily build a C wrapper in the same way as we do them in:
fwh\source\winapi\tabctrl.c

If you need some more help, please let me know it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 10:00 AM
Dietmar,

You could easily test it doing:
Code (fw): Select all Collapse
SendMessage( oFolder:hWnd, TCM_SETPADDING, 0, nMakeLong( 20, 20 ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 10:07 AM
Dietmar,

The method that you have to use is already implemented in FWH Class TFolder :-)
Code (fw): Select all Collapse
    ACTIVATE DIALOG oDlg CENTER ;
       ON INIT oFolder:SetItemSize( 200, 30 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 10:23 AM
Antonio Linares wrote:Dietmar,

The method that you have to use is already implemented in FWH Class TFolder :-)
Code (fw): Select all Collapse
    ACTIVATE DIALOG oDlg CENTER ;
       ON INIT oFolder:SetItemSize( 200, 30 )



Antonio,
I know and use this method. (see last lines of the code above)
The problem is that the folders are only painted correctly, if the dialg is NOT transparent
Same dialog WITH transparent on (which we need in this case) ---> painting result as above
Hope I expressed my problem now clearly...
Dietmar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 10:37 AM
Dietmar,

Ok, Now I see what you mean, thanks :-)

Using 20, instead of 25, seems to improve it

Code (fw): Select all Collapse
    ACTIVATE DIALOG oDlg CENTER;
       On INIT IIF(IsThemeActive(), oFolder:SetItemsize( ,20 ), ) //---> changed


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 10:46 AM

with 19 the painting is ok, but this is standard size.
In our case 25 would look a lot better. We use this in another folder, where transparent is not needed.
The TRANSPARENT-clause seems to erase the line under the folders??
Can this be fixed?
Dietmar

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 11:51 AM
Dietmar,

When clause TRANSPARENT is used on the folder, it sets all the contained dialogs to call DrawPBack() to fill each dialog surface. This function may be erasing that line.

To check it, please add this dummy function to your main PRG:
Code (fw): Select all Collapse
function DrawPBack()
return nil

This way no fill painting will be done and we can check if the line is visible. Thanks for your feedback :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 12:21 PM

Code (fw): Select all Collapse
function DrawPBack()
return nil

This way no fill painting will be done and we can check if the line is visible. Thanks for your feedback :-)


Sorry, same result, the line is not visible,
Dietmar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 12:42 PM
Dietmar,

Then it means that DrawPBack() is not erasing that line.

Lets modify oFolder:nFdHeight which holds the height of the tabs to position the contained dialogs:

Code (fw): Select all Collapse
   REDEFINE FOLDER oFolder             ;
        ID 102                           ;
        OF oDlg                          ;
        PROMPTS "Pagina &1","Pagina &2"  ;
        DIALOGS "DlgPage1", "DlgPage2"

   oFolder:nFdHeight += 5

   ...



try with different values there, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 01:51 PM

   oFolder:nFdHeight += 5

try with different values there, thanks :-)


This one does not change the itemsize but the last 5 pixel at the bottom of the folder are not painted..
D.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 01:55 PM

Dietmar,

oFolder:nFdHeight keeps the height value of the tabs but does not modify it. That value is used to place the top margin of the contained dialogs.

Is the line still erased ? Please post a screenshot, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 83
Joined: Mon Oct 17, 2005 10:33 AM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 04:32 PM

Is the line still erased ? Please post a screenshot, thanks


here it is, at the buttom is is not grey but white

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Folder Itemsize
Posted: Wed Feb 03, 2010 08:16 PM

Dietmar,

Please try to increase oFolder:nFdHeight with larger values, i.e.:

oFolder:nFdHeight += 15

Do it after the REDEFINE FOLDER ... command. You should notice that the contained dialogs top margins change.

regards, saludos

Antonio Linares
www.fivetechsoft.com