combobox

combobox

Postby Silvio » Fri Mar 06, 2009 12:21 am

I must insert a combo on buttonbar with bitmaps
When I insert it the combo is too small and I cannot see the images
any idea ?

Code: Select all  Expand view
#Include "FiveWin.Ch"

Function Test
 Local oDlg,oBar
  Local oItems
  Local aBitmaps := { "OMBRELLONE","PASSERELLA","HAWAYANO","CABINA", "CANCELLA" }
  Local aItems   := { "Normale","Passerella","Hawayano","Cabina", "Cancella" }
 nItem   := 1
 DEFINE DIALOG oDlg
 
ACTIVATE DIALOG oDlg ON INIT CREA_BAR(oDlg ,aBitmaps,oItems,aItems,nItem )
RETURN NIL


FUNCTION CREA_BAR(oDlg ,aBitmaps,oItems,aItems,nItem )
lOCAL oBar
DEFINE BUTTONBAR oBar OF oDlg SIZE 60, 60 2007
@ 2, 2 COMBOBOX oItems VAR nItem ITEMS aItems BITMAPS aBitmaps of oBar SIZE 100, 100
RETURN NIL
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: combobox

Postby James Bott » Fri Mar 06, 2009 2:54 am

Note that the SIZE clause is for the size of the dropdown not the GET-like portion of the combobox. Try setting the height using: oItems:nHeight = ...

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: combobox

Postby Silvio » Fri Mar 06, 2009 9:04 am

I made also oItems:nheight:=200 NOT RUN
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: combobox

Postby James Bott » Fri Mar 06, 2009 3:10 pm

Falconi,

aBitmaps in your example code is not an array of bitmaps, it is an array of strings. You need to load aBitmaps with bitmaps.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: combobox

Postby Silvio » Sat Mar 07, 2009 1:26 am

James ,
What you sad ?
Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: combobox

Postby mmercado » Sat Mar 07, 2009 6:07 am

Hi Silvio:

I've been testing with your problem. It seems to be a FWH bug because same combobox code is shown diferent in a Window and in a Dialog.

Image
By manuelmercado

Here is the dialog code:
Code: Select all  Expand view
#include "FiveWin.ch"

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

function Main()

   Local oDlg, oCbx, ;
         nItem := 1

   SET _3DLOOK ON

   DEFINE DIALOG oDlg FROM 0, 0 TO 220, 220 PIXEL
   
   @  20,  20 COMBOBOX oCbx VAR nItem OF oDlg SIZE 50, 200 PIXEL ;
      ITEMS   {"Vacio", "Hawayano", "Ombrellone", "Paserella" } ;
      BITMAPS { "VACIO", "HAWAYANO", "OMBRELLONE", "PASSERELLA" }

   ACTIVATE DIALOG oDlg

Return Nil
 


And here the code for a window:
Code: Select all  Expand view
#include "FiveWin.ch"

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

function Main()

   Local oWnd, oCbx, ;
         nItem := 1

   SET _3DLOOK ON

   DEFINE WINDOW oWnd FROM 0, 0 TO 220, 220 PIXEL
   
   @  40,  40 COMBOBOX oCbx VAR nItem OF oWnd SIZE 100, 400 PIXEL ;
      ITEMS   {"Vacio", "Hawayano", "Ombrellone", "Paserella" } ;
      BITMAPS { "VACIO", "HAWAYANO", "OMBRELLONE", "PASSERELLA" }

   ACTIVATE WINDOW oWnd

Return Nil
 

Perhaps Antonio could help us.

Regards.

Manuel Mercado
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: combobox

Postby Daniel Garcia-Gil » Sat Mar 07, 2009 6:14 am

Silvio wrote:I must insert a combo on buttonbar with bitmaps
When I insert it the combo is too small and I cannot see the images
any idea ?


the real problem of silvio is...
he want the combobox OVER BUTTONBAR no over dialog or over window
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: combobox

Postby Silvio » Sat Mar 07, 2009 3:33 pm

right !
i need a combo on buttonbar
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: combobox

Postby James Bott » Sat Mar 07, 2009 3:49 pm

Manuel seems to have found a key to the problem. And, Daniel, note that the buttonbar class is a subclass of TControl, which is a subclass of TWindow. This seems to be why what Manuel has shown is still the problem--windows and dialogs use different "units" of dimensions.

Dialog units are about twice as large as Window units, thus the combobox on a Window has a row height about half that of a combobox on a dialog. So, if we can find where the row height is defined, then perhaps we can solve the problem.

After looking at the combobox source, I don't see a nRowHeight var, but I did find this:

Code: Select all  Expand view
METHOD FillMeasure( nPInfo ) INLINE  LbxMeasure( nPInfo, ::nBmpHeight )

Silvio, for a quick test try changing this line to:

Code: Select all  Expand view
METHOD FillMeasure( nPInfo ) INLINE  LbxMeasure( nPInfo, ::nBmpHeight * 2.05 )

Then compile the combobox.prg and link it to your app and see if it solves the problem. If this works then we need modify the method to only change the row height when the parent container is not a dialog.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: combobox

Postby mmercado » Sat Mar 07, 2009 6:39 pm

James Bott wrote:After looking at the combobox source, I don't see a nRowHeight var, but I did find this:

Code: Select all  Expand view
METHOD FillMeasure( nPInfo ) INLINE  LbxMeasure( nPInfo, ::nBmpHeight )

Hi James:

The FillMeasure method is only called when the ComboBox belongs to a Dialog, not in other cases. It might be the problem.

Best regards.

Manuel Mercado.
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: combobox

Postby mmercado » Sat Mar 07, 2009 7:20 pm

I found something:

If I change the New() method of class TComboBox in these lines:
Code: Select all  Expand view
  if ! Empty( oWnd:hWnd )
      ::Create( "COMBOBOX" )
      ::Default()
      if oFont != nil
         ::SetFont( oFont )
      endif
      oWnd:AddControl( Self )
   else
      oWnd:DefControl( Self )
   endif
 

To this:
Code: Select all  Expand view
  if ! Empty( oWnd:hWnd )
      oWnd:AddControl( Self )
      ::Create( "COMBOBOX" )
      ::Default()
      if oFont != nil
         ::SetFont( oFont )
      endif
   else
      oWnd:DefControl( Self )
   endif
 

Then the combobox is shown fine.

Antonio will tell us if the change has or not secondary effects.

Regards.

Manuel Mercado
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: combobox

Postby Silvio » Sun Mar 08, 2009 12:57 am

Manuel ,
Now I see the bitmaps good but I cannot select any element
when I open the test it open the scroll of elements I select one element and then the control is blocked
there is also an error
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: combobox

Postby Detlef Hoefner » Mon Mar 09, 2009 10:41 pm

Hi Silvio,

don't forget the Bitmap for the towels the German use to reserve their places at the beach. :wink:

Image

Sorry, i couldn't resist.
Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Re: combobox

Postby Silvio » Tue Mar 10, 2009 1:04 am

Any solution ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 67 guests