FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how display item superior width ComboBox ?
Posts: 37
Joined: Tue Feb 20, 2007 09:26 AM
how display item superior width ComboBox ?
Posted: Thu Nov 15, 2007 05:20 AM

Hi.

how display item superior it width ComboBox (open) ?

http://br.geocities.com/ericmagaldi/screen/combobox.jpg

I use Pelles C.

virtually,
Éric
xHarbour.org + Borland C + FiveWin (2.8/6.12) + Pelles C + HBMake + ADSCDX
SĂŁo Paulo - Brasil
http://xBaseSuporte.freeforums.org
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
how display item superior width ComboBox ?
Posted: Thu Nov 15, 2007 07:14 AM

Éric,

I don't understand your question. Why don't you increase its width ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 37
Joined: Tue Feb 20, 2007 09:26 AM
how display item superior width ComboBox ?
Posted: Thu Nov 15, 2007 12:10 PM
Antonio Linares wrote:Why don't you increase its width ?

LayOut and not need adjust for every item insert.

While it is closed, not need display all character, but during choose (Open), is much important (+informative).

Is possible ???
virtually,
Éric
xHarbour.org + Borland C + FiveWin (2.8/6.12) + Pelles C + HBMake + ADSCDX
SĂŁo Paulo - Brasil
http://xBaseSuporte.freeforums.org
Posts: 37
Joined: Tue Feb 20, 2007 09:26 AM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 02:47 AM
aff !! never yet one "YES" or "NO" POSSIBLE ?????!!!!!

alternative temporary in my Class:
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS MComboBox

if nMsg == FM_CLOSEUP
   ::cToolTip:=::varget()

   return ::CloseUp()
endif
return Super:HandleEvent( nMsg, nWParam, nLParam )
virtually,
Éric
xHarbour.org + Borland C + FiveWin (2.8/6.12) + Pelles C + HBMake + ADSCDX
SĂŁo Paulo - Brasil
http://xBaseSuporte.freeforums.org
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 09:03 AM

Eric,

Sometimes we don't answer a question when we don't get enough information in the question, sorry

Do you mean that you want to increase the width of the shown dropdown list ? If so, then please review the API docs for these two listbox messages, in case that they may help:

define LB_SETHORIZONTALEXTENT 0x0194

define LB_SETCOLUMNWIDTH 0x0195

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 09:05 AM

If I understood correctly, you want the list part of the combobox to be wider than the edit part. I don't think this is possible, at least using the standard comboboxes.

EMG

Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 12:34 PM
Olá Eric,

Veja se este exemplo faz o que vocĂŞ precisa:

#include "FiveWin.ch"

#define COMBO_BASE             320
#define CB_SETITEMHEIGTH      ( COMBO_BASE + 19 )
#define CB_GETITEMHEIGTH      ( COMBO_BASE + 20 )

#define CB_SETDROPPEDWIDTH     0x0160
#define CB_GETDROPPEDWIDTH     ( COMBO_BASE + 25 )

function Main()

   local oDlg, oCbx
   local aEstados := { "AC   Acre", "AL   Alagoas", "AM   Amazônia", "AP   Amapá", "BA   Bahia", "CE   Ceará", "DF   Distrito Federal", "ES   Espirito Santo", "EX   Exterior", "GO   Goias", "MA   Maranhão", "MG   Minas Gerais", "MS   Mato Grosso Sul", "MT   Mato Grosso", "PA   Pará", "PB   Paraiba", "PE   Pernambuco", "PI   Piauí", "PR   Paraná", "RJ   Rio de Janeiro", "RN   Rio Grande Norte", "RO   Rondônia", "RR   Roraima", "RS   Rio Grande Sul", "SC   Santa Catarina", "SE   Sergipe", "SP   São Paulo", "TO   Tocantins" }
   local cText    := aEstados[1]

* Aqui voce retorna a altura da linha do combobox, quando ele esta aberto
   extend class TCombobox with message getItemheight( nItem )          inline ::SendMsg( CB_GETITEMHEIGTH, nItem, 0 )

* Aqui voce define a altura da linha do combobox, quando ele esta aberto
   extend class TCombobox with message setItemheight( nHeight ) inline ::SendMsg( CB_SETITEMHEIGTH, , nHeight )

* Aqui voce retorna a largura da linha do combobox, quando ele esta aberto
   extend class TCombobox with message GETDROPPEDWIDTH()               inline ::SendMsg( CB_GETDROPPEDWIDTH, 0, 0 )

* Aqui voce define a largura da linha do combobox, quando ele esta aberto
   extend class TCombobox with message SETDROPPEDWIDTH( nWidth )       inline ::SendMsg( CB_SETDROPPEDWIDTH, nWidth, 0 )

   DEFINE DIALOG oDlg FROM 0, 0 TO 200, 200 ;
      TITLE "DropDown ComboBox Test" pixel

   @ 10, 10 COMBOBOX oCbx VAR cText STYLE CBS_DROPDOWNLIST ;  && CBS_DROPDOWN ;
     ITEMS aEstados size 20, 100 ;
      ON CHANGE oDlg:SetText( cText ) pixel

   oCbx:bgotfocus := { |oObj| ( oObj:setItemheight( 20 ), oObj:setdroppedwidth( 200 ), oObj:refresh() ) }

   ACTIVATE DIALOG oDlg CENTERED

return nil


Abraços,

Rossine.
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 12:47 PM

Could you please post this in English, too.
Do we need a changed tComboBox?
Thanks for your code
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 01:02 PM

Rossine,

many thanks! :-)

I wrongly thought about a listbox and it is a combobox :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 01:53 PM
Rossine wrote:Veja se este exemplo faz o que vocĂŞ precisa:


Wonderful!

EMG
Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 02:06 PM
Hello Otto,


Do we need a changed tComboBox?


Not. Only include this stretch in his file .PRG main:

   extend class TCombobox with message getItemheight( nItem )          inline ::SendMsg( CB_GETITEMHEIGTH, nItem, 0 ) 

   extend class TCombobox with message setItemheight( nHeight ) inline ::SendMsg( CB_SETITEMHEIGTH, , nHeight ) 

   extend class TCombobox with message GETDROPPEDWIDTH()               inline ::SendMsg( CB_GETDROPPEDWIDTH, 0, 0 ) 

   extend class TCombobox with message SETDROPPEDWIDTH( nWidth )       inline ::SendMsg( CB_SETDROPPEDWIDTH, nWidth, 0 )


Here the example translated into the English:

#include "FiveWin.ch" 

#define COMBO_BASE             320 
#define CB_SETITEMHEIGTH      ( COMBO_BASE + 19 ) 
#define CB_GETITEMHEIGTH      ( COMBO_BASE + 20 ) 

#define CB_SETDROPPEDWIDTH     0x0160 
#define CB_GETDROPPEDWIDTH     ( COMBO_BASE + 25 ) 

function Main() 

   local oDlg, oCbx 
   local aEstados := { "AC   Acre", "AL   Alagoas", "AM   Amazônia", "AP   Amapá", "BA   Bahia", "CE   Ceará", "DF   Distrito Federal", "ES   Espirito Santo", "EX   Exterior", "GO   Goias", "MA   Maranhão", "MG   Minas Gerais", "MS   Mato Grosso Sul", "MT   Mato Grosso", "PA   Pará", "PB   Paraiba", "PE   Pernambuco", "PI   Piauí", "PR   Paraná", "RJ   Rio de Janeiro", "RN   Rio Grande Norte", "RO   Rondônia", "RR   Roraima", "RS   Rio Grande Sul", "SC   Santa Catarina", "SE   Sergipe", "SP   São Paulo", "TO   Tocantins" } 
   local cText    := aEstados[1] 

* Here you return the height of the line of the combobox, when he is open
   extend class TCombobox with message getItemheight( nItem )          inline ::SendMsg( CB_GETITEMHEIGTH, nItem, 0 ) 

* Here you defined the height of the line of the combobox, when he is open
   extend class TCombobox with message setItemheight( nHeight ) inline ::SendMsg( CB_SETITEMHEIGTH, , nHeight ) 

* Here you return the width of the line of the combobox, when he is open
   extend class TCombobox with message GETDROPPEDWIDTH()               inline ::SendMsg( CB_GETDROPPEDWIDTH, 0, 0 ) 

* Here you defined the width of the line of the combobox, when he is open
   extend class TCombobox with message SETDROPPEDWIDTH( nWidth )       inline ::SendMsg( CB_SETDROPPEDWIDTH, nWidth, 0 ) 

   DEFINE DIALOG oDlg FROM 0, 0 TO 200, 200 ; 
      TITLE "DropDown ComboBox Test" pixel 

   @ 10, 10 COMBOBOX oCbx VAR cText STYLE CBS_DROPDOWNLIST ;  && CBS_DROPDOWN ; 
     ITEMS aEstados size 20, 100 ; 
      ON CHANGE oDlg:SetText( cText ) pixel 

   oCbx:bgotfocus := { |oObj| ( oObj:setItemheight( 20 ), oObj:setdroppedwidth( 200 ), oObj:refresh() ) } 

   ACTIVATE DIALOG oDlg CENTERED 

return nil
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 02:28 PM

Hello Rossine,
trying to compile I get this error: I use Harbour.
Regards.
Otto

No code generated
14comobox.prg(22) Error E0030 Syntax error: "syntax error at 'CLASS'"
14comobox.prg(25) Error E0030 Syntax error: "syntax error at 'CLASS'"
14comobox.prg(28) Error E0030 Syntax error: "syntax error at 'CLASS'"
14comobox.prg(31) Error E0030 Syntax error: "syntax error at 'CLASS'"
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Error E2194: Could not find file '14comobox.c'

Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 02:41 PM

sorry for my bad english

The EXTENDED CLASS ... is a extencion for xHarbour Only.

salu2
carlos vargas

:-(

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
how display item superior width ComboBox ?
Posted: Wed Dec 05, 2007 04:49 PM

You can replace the new methods with simple functions and pass them the combobox object variable.

EMG

Continue the discussion