how display item superior width ComboBox ?

how display item superior width ComboBox ?

Postby ericmagaldi » Thu Nov 15, 2007 5: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
User avatar
ericmagaldi
 
Posts: 37
Joined: Tue Feb 20, 2007 9:26 am
Location: São Paulo - Brazil

Postby Antonio Linares » Thu Nov 15, 2007 7:14 am

Éric,

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

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

Postby ericmagaldi » 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
User avatar
ericmagaldi
 
Posts: 37
Joined: Tue Feb 20, 2007 9:26 am
Location: São Paulo - Brazil

Postby ericmagaldi » Wed Dec 05, 2007 2:47 am

aff !! never yet one "YES" or "NO" POSSIBLE ?????!!!!!

alternative temporary in my Class:
Code: Select all  Expand view  RUN
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
User avatar
ericmagaldi
 
Posts: 37
Joined: Tue Feb 20, 2007 9:26 am
Location: São Paulo - Brazil

Postby Antonio Linares » Wed Dec 05, 2007 9: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
Last edited by Antonio Linares on Wed Dec 05, 2007 9:10 am, edited 2 times in total.
regards, saludos

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

Postby Enrico Maria Giordano » Wed Dec 05, 2007 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rossine » Wed Dec 05, 2007 12:34 pm

Olá Eric,

Veja se este exemplo faz o que você precisa:

Code: Select all  Expand view  RUN

#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.
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Otto » 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
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Wed Dec 05, 2007 1:02 pm

Rossine,

many thanks! :-)

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

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

Postby Enrico Maria Giordano » Wed Dec 05, 2007 1:53 pm

Rossine wrote:Veja se este exemplo faz o que você precisa:


Wonderful!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rossine » Wed Dec 05, 2007 2:06 pm

Hello Otto,

Do we need a changed tComboBox?


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

Code: Select all  Expand view  RUN
   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:

Code: Select all  Expand view  RUN
#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
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Postby Otto » Wed Dec 05, 2007 2: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'
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Postby carlos vargas » Wed Dec 05, 2007 2: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)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Postby Enrico Maria Giordano » Wed Dec 05, 2007 4:49 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

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