FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Combobox with bitmaps
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Combobox with bitmaps
Posted: Tue Feb 08, 2011 12:32 AM

I've searched all over for this, and of course I've experimented without success.

I want to have a combobox where the dropdown includes a bitmap for each line.

The docs say to create an array of items, and an array of bitmaps ( which do reside in the RESOURCES file ). I've done that. It then seems to say the bitmap will display next to the corresponding item array ( ie. bitmap 4 in the array of bitmaps should load to item 4 of the drop down list ).

I've looked everywhere for a sample but can't find it ( docs, online docs, forum, etc. ).

Can anyone provide a sample ? Thanks.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 01:23 AM
Hello Tim,



Samples : Ownerdra.prg
( Bitmaps from Disk and resource )

REDEFINE COMBOBOX oCbx1 VAR cItem2 ;
ID 120 OF oDlg ;
ITEMS { "Drive A:", "Drive C:", "Ram Drive", "Net Drive" } ;
BITMAPS { "..\bitmaps\fdrive.bmp",;
"..\bitmaps\hdrive.bmp",; // from Disk
"Arrow",; // from Resource
"..\bitmaps\netdrive.bmp" }

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: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 02:55 AM

How do you have the control in the .rc file ?

I am using:
REDEFINE COMBOBOX oCB2 VAR cAptClr ;
ID 4065 OF oCalDlg ;
ITEMS { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" } ;
BITMAPS { "CJ01","CJ02", "CJ03", "CJ04", "CJ05", "CJ06", "CJ07", ;
"CJ08","CJ09", "CJ10" } ;
MESSAGE "Enter the technician, or service area, for this appointment"

And:
CONTROL "", 4065, "ComboBox", CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | WS_TABSTOP, 300, 30, 80, 100

My bitmaps are 10 x 10 Solid color squares.

They won't show up ...

Thanks.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 07:58 AM
This is the rc file used in the above sample
\fwh\samples\ownerdra.rc
Code (fw): Select all Collapse
#include "..\include\WinApi.ch"

test DIALOG 16, 80, 274, 132
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 4
CAPTION "ListBoxes and ComboBoxes with Bitmaps!"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT "An OwnerDraw ListBox!", -1, 4, 5, 78, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
    LISTBOX 110, 5, 17, 75, 87, LBS_NOTIFY | LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP
    LTEXT "An OwnerDraw ComboBox!", -1, 88, 4, 88, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
    CONTROL "", 120, "COMBOBOX", CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | WS_TABSTOP, 95, 16, 75, 82
    LTEXT "Run-time selection!", -1, 184, 3, 64, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
    CONTROL "", 130, "LISTBOX", LBS_NOTIFY | LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 183, 15, 75, 91
    CONTROL "Your imagination is the limit", -1, "STATIC", WS_CHILD | WS_VISIBLE | WS_GROUP, 88, 44, 91, 8
    CONTROL "", 140, "COMBOBOX", CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 96, 57, 75, 101
    PUSHBUTTON "&Ok", IDOK, 119, 110, 35, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 03:06 PM

I think the issue is with my bitmaps. I will work with them today. Initially I had 10x10 and they didn't display. Then I tried 16x16 but I wanted them larger so I went to 16 x 32 ( wide ) and they didn't work. I did get a 16x16 to display. The space is being provided for them.

Thanks

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 03:39 PM
Tim,

my Tests using 16x16, 24x24 and 24x32
It seems, only 16 x 16 is possible.
I changed the Font, to force the Rowheight to be bigger,
but the Bmp is resized as well.
Maybe it is possible, to delete BMP-resizing ( keeping the original BMP-Size ? )
I think to adjust the Row-height to the BMP ( in case BMP-height >= Font-height, like in xBrowse )
it would be a better Solution.
I will have a look at the Class Combobox.



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: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 05:49 PM

I had tried 8 bit and even they didn't work. It would appear 16x16 Alpha does work, so I'm resetting them to that and hopefully this will be done. I use Axialis for my icons and bitmaps so it really is very easy to make changes.

Thanks.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Combobox with bitmaps
Posted: Tue Feb 08, 2011 08:27 PM

Tim,

I tested many graphic-tools and ended on this one :

viewtopic.php?f=3t=15008p=77576hilit=pixelformer#p77576

Best regards
Uwe :lol:

&&&

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.

Continue the discussion