FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Combobox with bitmaps
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Combobox with bitmaps
Posted: Tue Mar 27, 2012 08:04 AM
Hi al,

I found an error using a combox with bitmaps on a folder. The height of the combo is not correctly calculated, if you use it on a folder. Inside a dialog it´s ok. See the picture.

Code (fw): Select all Collapse
 // test combobox with bitmaps on a folder
#include "FiveWin.ch"
Function test()
   Local oDlg,oFld
   Local aBitMaps:= {"one.bmp","two.bmp","one.bmp","two.bmp","one.bmp"}
   Local cCombo:= 1, oCombo
   Local aItems := {"One","two","tree","four","five"}

   DEFINE DIALOG oDlg  size 400,400

   @ 2,1 FOLDER oFld PROMPT "Power " ,"Of","Fivewin" OF oDlg     SIZE 100,100
   @ 2,1 COMBOBOX oCombo var cCombo  ITEMS aItems OF oFld:aDialogs[1]  SIZE  80,100 BITMAPS aBitMaps
   @ 1,10 COMBOBOX oCombo var cCombo  ITEMS aItems OF oDlg  SIZE  80,60 BITMAPS aBitMaps

ACTIVATE DIALOG oDlg

RETURN NIL




Any suggestions ?
kind regards

Stefan
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Combobox with bitmaps
Posted: Tue Mar 27, 2012 03:12 PM
Stefan,

Yes, I think it is the used BMP-size > 16 x 16
In Your Sample I added 16 x 16 BMP's.
Inside the Folder the Height is not adjusted.
I tested using a BMP 24x24

Tested with TFolderEx


Your Sample ( TFolder )


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Combobox with bitmaps
Posted: Wed Apr 04, 2012 12:18 PM

Uwe,

yes, it is the bmp-size, but 24x24 bitmaps are working on a normal dialog and it´s not working on a folder dialog, but it should.

I looked over the source of combobox but I didn´t find anything wrong

Antonio, could you check it, please

many thanks

kind regards

Stefan
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Combobox with bitmaps
Posted: Wed Apr 04, 2012 03:32 PM
Stefan,

Fixed. Some changes are required:

1. source\winapi\dlogbox.c: changes this way:

Added this new code
Code (fw): Select all Collapse
static UINT itemHeight = 0;

//----------------------------------------------------------------------------//

HB_FUNC( SETOWNERDRAWITEMHEIGHT )
{
   itemHeight = hb_parnl( 1 );
}


Modified the response to WM_MEASUREITEM:
Code (fw): Select all Collapse
      case WM_MEASUREITEM:
           if( itemHeight != 0 )
              ( ( MEASUREITEMSTRUCT * ) lParam )->itemHeight = itemHeight;
           break;


and finally in EndDialog():
Code (fw): Select all Collapse
HB_FUNC( ENDDIALOG )
{
   ...   

   if( itemHeight != 0 )
      itemHeight = 0;
}


And in both listbox.prg and combobox.prg, in Method SetBitmaps():
Code (fw): Select all Collapse
METHOD SetBitmaps( acBitmaps ) CLASS TComboBox

   ...

      ...      
      SetOwnerDrawItemHeight( ::nBmpHeight )
   endif

return nil


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Combobox with bitmaps
Posted: Thu Apr 05, 2012 10:12 AM

Antonio,

many thanks for your quick response :D :D

It´s working perfectly now.

kind regards

Stefan

Continue the discussion