Hi.
how display item superior it width ComboBox (open) ?
http://br.geocities.com/ericmagaldi/screen/combobox.jpg
I use Pelles C.
Antonio Linares wrote:Why don't you increase its width ?
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS MComboBox
if nMsg == FM_CLOSEUP
::cToolTip:=::varget()
return ::CloseUp()
endif
return Super:HandleEvent( nMsg, nWParam, nLParam )
#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
Do we need a changed tComboBox?
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 )
#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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 90 guests