Folder Itemsize

Folder Itemsize

Postby Dietmar Jahnel » Sun Jan 31, 2010 3: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: Select all  Expand view

#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
 
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Dietmar Jahnel » Tue Feb 02, 2010 1:05 pm

To make things clearer, this it the result:

Image

Without transparent clause, the folders are painted ok.

How can this be fixed?
Dietmar
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Antonio Linares » Wed Feb 03, 2010 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Antonio Linares » Wed Feb 03, 2010 10:00 am

Dietmar,

You could easily test it doing:
Code: Select all  Expand view

SendMessage( oFolder:hWnd, TCM_SETPADDING, 0, nMakeLong( 20, 20 ) )
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Antonio Linares » Wed Feb 03, 2010 10:07 am

Dietmar,

The method that you have to use is already implemented in FWH Class TFolder :-)
Code: Select all  Expand view

    ACTIVATE DIALOG oDlg CENTER ;
       ON INIT oFolder:SetItemSize( 200, 30 )
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Dietmar Jahnel » 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: Select all  Expand view

    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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Antonio Linares » 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: Select all  Expand view

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


Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Dietmar Jahnel » 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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Antonio Linares » 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: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Dietmar Jahnel » Wed Feb 03, 2010 12:21 pm

Code: Select all  Expand view

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
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Antonio Linares » 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: Select all  Expand view

   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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Dietmar Jahnel » Wed Feb 03, 2010 1: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.
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Antonio Linares » Wed Feb 03, 2010 1: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Folder Itemsize

Postby Dietmar Jahnel » Wed Feb 03, 2010 4:32 pm

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


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

Image
User avatar
Dietmar Jahnel
 
Posts: 83
Joined: Mon Oct 17, 2005 10:33 am
Location: Austria

Re: Folder Itemsize

Postby Antonio Linares » Wed Feb 03, 2010 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests