topic
stringlengths
1
63
text
stringlengths
1
577k
Combobox problem
Pier, Thats because the pushbutton is a default pushbutton and traps the Enter key
Combobox problem
Peir, >Thats because the pushbutton is a default pushbutton and traps the Enter key. And this is standard Windows behavior. In the old DOS apps you could use Enter to select an item in a combo, but it is not advisable to do this with a windows app, since users will not be expecting it to work that way. James
Combobox problem
Now I understand. Thanks. Pier Luigi
Combobox scroll (function PopupBrowse())
[quote="Jack":3hvtmky7]What is this ACTION on a GET ? I use VALID but never ACTION . When is it execute ? Thanks[/quote:3hvtmky7] Puedes usarlo con el VALID o ACTION, un pequeño boton que se crea a la derecha del GET y se ejecuta al hacer click alli, saludos... @ x, y GET oGet VAR cVar.... ; ACTION PopupBrowse( aValue, oGet, bInit )
Combobox scroll (function PopupBrowse())
Good morning I have a combobox redefined from resource, dropdown list. I need a horizontal scroll on this combobox in addition to the normal vertical scroll. I have tried cbs-autohscroll style but without success, same with WS_HSCROLL . Anyone has an idea on what style can display the horizontal scrollbar ? Thanks for help,
Combobox scroll (function PopupBrowse())
Richard, Have you considered to use a GET and a XBrowse together ? Here you have a function PopupBrowse() that behaves quite similar to a combobox, but you have all the xbrowse possibilities: [code=fw:62niijfy]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> PopupBrowse<span style="color: #000000;">&#40;</span> aValue, oGet, bInit <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aPoint := <span style="color: #000000;">&#123;</span> oGet:<span style="color: #000000;">nTop</span> + oGet:<span style="color: #000000;">nHeight</span>, oGet:<span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oGet:<span style="color: #000000;">Cargo</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; aPoint = ClientToScreen<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span>, aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">OF</span> oGet:<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">STYLE</span> WS_POPUP ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">180</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NOWAIT</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ARRAY aValue AUTOSORT ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> bInit, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bLButtonUp</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > oBrw:<span style="color: #000000;">nHeaderHeight</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = oDlg<br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bLClicked</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:62niijfy] An example of use: REDEFINE GET oGet VAR ... ; ID ... OF oDlg ACTION PopupBrowse( aValues, oGet, bInit )
Combobox scroll (function PopupBrowse())
What is this ACTION on a GET ? I use VALID but never ACTION . When is it execute ? Thanks
Combobox scroll (function PopupBrowse())
Antonio Thanks I will try and let you know, Regards Richard
Combobox scroll (function PopupBrowse())
Antonio, he probado tu solución y tengo el siguiente problema, cuando abro el combo y hago foco en otro control con el ratón, este no se cierra. Tampoco si presiono el ratón sobre la barra de título del dialogo que contiene el combo. Habrá alguna solución para esto ? Muchísimas gracias. Saludos
Combobox scroll (function PopupBrowse())
Horacio, Aqui tienes una versión mejorada: [code=fw:334cly65]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> PopupBrowse<span style="color: #000000;">&#40;</span> aValue, oGet, bInit <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aPoint := <span style="color: #000000;">&#123;</span> oGet:<span style="color: #000000;">nTop</span> + oGet:<span style="color: #000000;">nHeight</span>, oGet:<span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oGet:<span style="color: #000000;">Cargo</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; aPoint = ClientToScreen<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span>, aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">OF</span> oGet:<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">STYLE</span> WS_POPUP ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">180</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NOWAIT</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ARRAY aValue AUTOSORT ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> bInit, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bLButtonUp</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > oBrw:<span style="color: #000000;">nHeaderHeight</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bGotFocus</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = oDlg<br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bLClicked</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:334cly65]
Combobox scroll (function PopupBrowse())
Antonio, gracias por tu respuesta. He probado esta nueva versión. Ahora si cierra el combo si pico con el ratón en otro control. Solo faltaría que si muevo el dialogo que contiene el combo, este se cierre. Muchísimas gracias. Saludos
Combobox scroll (function PopupBrowse())
Horacio, Prueba esta versión mejorada, gracias [code=fw:1vkbtbkb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> PopupBrowse<span style="color: #000000;">&#40;</span> aValue, oGet, bInit <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aPoint := <span style="color: #000000;">&#123;</span> oGet:<span style="color: #000000;">nTop</span> + oGet:<span style="color: #000000;">nHeight</span>, oGet:<span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oGet:<span style="color: #000000;">Cargo</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; aPoint = ClientToScreen<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span>, aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">OF</span> oGet:<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">STYLE</span> WS_POPUP ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">180</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NOWAIT</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ARRAY aValue AUTOSORT ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> bInit, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bLButtonUp</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > oBrw:<span style="color: #000000;">nHeaderHeight</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bGotFocus</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMMoved</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = oDlg<br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bLClicked</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1vkbtbkb]
Combobox scroll (function PopupBrowse())
Antonio, no funciona bien. Si muevo el ratón fuera del combo este se cierra. Tampoco trabaja la rueda del ratón cuando el mismo está abierto. La linea que hace fallar es [code=fw:khuul3rn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMMoved</span> &nbsp; := <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:khuul3rn] Muchas Gracias Saludos
Combobox scroll (function PopupBrowse())
Horacio, Prueba a cambiar esa línea por esta: oGet:oWnd:bMoved = { || oGet:Cargo := nil, oDlg:End() }
Combobox scroll (function PopupBrowse())
Hello Try with this code A greeting [code=fw:pb8mcpbg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> oWnd, oCbx<br /><span style="color: #00C800;">local</span> cVar := <span style="color: #ff0000;">"Hola"</span><br /><span style="color: #00C800;">local</span> aItems := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Hola"</span>,<span style="color: #ff0000;">"cara"</span>,<span style="color: #ff0000;">"de"</span>,<span style="color: #ff0000;">"bola"</span><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> SetCbxHScroll<span style="color: #000000;">&#40;</span> oCbx <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> SetCbxHScroll<span style="color: #000000;">&#40;</span> oCbx <span style="color: #000000;">&#41;</span><br /><br />SumarEstilo<span style="color: #000000;">&#40;</span> HWndComboList<span style="color: #000000;">&#40;</span> oCbx:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>, WS_HSCROLL <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><br /><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"commctrl.h"</span><br /><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SUMARESTILO <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   HWND hWnd = <span style="color: #000000;">&#40;</span>HWND<span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />   DWORD dwStyle = GetWindowLong<span style="color: #000000;">&#40;</span> hWnd, GWL_STYLE <span style="color: #000000;">&#41;</span>;<br />   dwStyle |= <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>DWORD<span style="color: #000000;">&#41;</span>hb_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />   SetWindowLong<span style="color: #000000;">&#40;</span> hWnd, GWL_STYLE, dwStyle <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br />BOOL SGetComboBoxInfo<span style="color: #000000;">&#40;</span> HWND hWnd, PCOMBOBOXINFO pcbi <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   typedef BOOL <span style="color: #000000;">&#40;</span>CALLBACK* LPFNDLLFUNC<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span> HWND, PCOMBOBOXINFO <span style="color: #000000;">&#41;</span>;<br />   HINSTANCE hLib;<br />   LPFNDLLFUNC GetComboBoxInfo;<br />   BOOL bRet = <span style="color: #00C800;">FALSE</span>;<br /><br />   hLib = LoadLibrary<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"User32.dll"</span> <span style="color: #000000;">&#41;</span>;<br />   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> hLib <span style="color: #000000;">&#41;</span><br />   <span style="color: #000000;">&#123;</span><br />       GetComboBoxInfo = <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>LPFNDLLFUNC<span style="color: #000000;">&#41;</span> GetProcAddress<span style="color: #000000;">&#40;</span> hLib, <span style="color: #ff0000;">"GetComboBoxInfo"</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />       bRet = <span style="color: #000000;">&#40;</span>BOOL<span style="color: #000000;">&#41;</span> GetComboBoxInfo<span style="color: #000000;">&#40;</span> hWnd, pcbi <span style="color: #000000;">&#41;</span>;<br />       FreeLibrary<span style="color: #000000;">&#40;</span> hLib <span style="color: #000000;">&#41;</span>;<br />   <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">return</span> bRet;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #B900B9;">// Obtener el HWND de la lista desplegable del combobox</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> HWNDCOMBOLIST <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   COMBOBOXINFO cbi      ;<br />   ZeroMemory<span style="color: #000000;">&#40;</span> &cbi, sizeof<span style="color: #000000;">&#40;</span> COMBOBOXINFO <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />   cbi.cbSize = sizeof<span style="color: #000000;">&#40;</span>COMBOBOXINFO<span style="color: #000000;">&#41;</span>;<br /><br />   SGetComboBoxInfo<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>HWND<span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, &cbi <span style="color: #000000;">&#41;</span>;<br /><br />   hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>LONG<span style="color: #000000;">&#41;</span>cbi.hwndList <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /> </div>[/code:pb8mcpbg]
Combobox scroll (function PopupBrowse())
function PopupBrowse() has been included in next FWH 15.11
Combobox scroll (function PopupBrowse())
Antonio, can you make a small sample to call popbrowse function please ?
Combobox scroll (function PopupBrowse())
Silvio, REDEFINE GET oGet VAR ... ; ID ... OF oDlg ACTION PopupBrowse( aValues, oGet, bInit ) aValues can be an array or a recordset
Combobox scroll (function PopupBrowse())
Antonio, he probado con oGet:oWnd:bMoved = { || oGet:Cargo := nil, oDlg:End() } tal cual me sugeriste, si bien cierra el combo al picar sobre la barra de título no funciona al seleccionar con el ratón y deja de funcionar la rueda del mismo. Adjunto un ejemplo autocontenido [code=fw:1mrkgazc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'Fivewin.ch'</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">Local</span> oDlg<br />&nbsp; &nbsp; <span style="color: #00C800;">Local</span> oGet := Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">Local</span> cVar := <span style="color: #000000;">&#123;</span> Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Get</span> oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Var</span> cVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Action</span> PopupBrowse<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span>, oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> || .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Pixel</span><br />&nbsp; &nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">35</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Get</span> oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Var</span> cVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Action</span> PopupBrowse<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span>, oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> || .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Pixel</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Init</span> oDlg : <span style="color: #000000;">lHelpIcon</span> := .f. <span style="color: #0000ff;">Centered</span><br />&nbsp; &nbsp; <span style="color: #00C800;">Return</span> <span style="color: #000000;">0</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> PopupBrowse<span style="color: #000000;">&#40;</span> aValue, oGet, bInit <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oDlg <br />&nbsp; &nbsp; <span style="color: #00C800;">Local</span> oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> aPoint := <span style="color: #000000;">&#123;</span> oGet : <span style="color: #000000;">nTop</span> + oGet : <span style="color: #000000;">nHeight</span>, oGet : <span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">Cargo</span> == <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aPoint = ClientToScreen<span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">hWnd</span>, aPoint <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">Of</span> oGet : <span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">Style</span> WS_POPUP <span style="color: #0000ff;">Size</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">180</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">NoWait</span> <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Init</span> oDlg : <span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">xBrowse</span> oBrw Array aValue <span style="color: #0000ff;">Size</span> oDlg : <span style="color: #000000;">nWidth</span>, oDlg : <span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Pixel</span><br />&nbsp; &nbsp; &nbsp; oBrw : <span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> bInit # <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> bInit, oBrw <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; End&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; oBrw : <span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw : <span style="color: #000000;">bKeyDown</span> &nbsp; := <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw : <span style="color: #000000;">bChange</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw : <span style="color: #000000;">bLButtonUp</span> := <span style="color: #000000;">&#123;</span> | nRow, nCol | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > oBrw : <span style="color: #000000;">nHeaderHeight</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oBrw : <span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">bLostFocus</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//oGet : oWnd : bMMoved &nbsp; := { || oGet : Cargo := nil, oDlg : End() }</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bMoved</span> &nbsp; := <span style="color: #000000;">&#123;</span> || oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw : <span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">Cargo</span> := oDlg<br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw : <span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw : <span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, oGet : <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bLClicked</span> &nbsp; := <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bMouseWheel</span> := <span style="color: #000000;">&#123;</span> || oDlg : <span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Else</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">Cargo</span> : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet : <span style="color: #000000;">Cargo</span> = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;End<br />&nbsp; &nbsp; <span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1mrkgazc] Muchas gracias. Saludos
Combobox scroll (function PopupBrowse())
Horacio, Gracias por tus pruebas. Esta versión parece funcionar bien: [code=fw:afphvw9h]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> PopupBrowse<span style="color: #000000;">&#40;</span> aValue, oGet, bInit <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aPoint := <span style="color: #000000;">&#123;</span> oGet:<span style="color: #000000;">nTop</span> + oGet:<span style="color: #000000;">nHeight</span>, oGet:<span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oGet:<span style="color: #000000;">Cargo</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; aPoint = ClientToScreen<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">hWnd</span>, aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">OF</span> oGet:<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">STYLE</span> WS_POPUP ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">180</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NOWAIT</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlg:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw DATASOURCE aValue AUTOSORT ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SIZE</span> oDlg:<span style="color: #000000;">nWidth</span>, oDlg:<span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> bInit, oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bChange</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">bLButtonUp</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > oBrw:<span style="color: #000000;">nHeaderHeight</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bLostFocus</span> = <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> GetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> != oDlg:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bGotFocus</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMoved</span> = <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = oDlg<br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bLClicked</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet:<span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> || oDlg:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oGet:<span style="color: #000000;">Cargo</span> = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:afphvw9h]
Combobox scroll (function PopupBrowse())
Antonio, ahora funciona bien. Solo quedaría un detalle, me gustaría poder abrir el combo mediante el teclado tal cual lo hace el combo ordinario presionando F4. El problema que se presenta es que si bien en el get configuro la tecla para que esto suceda, el xbrowse no llega a tener foco y no puedo seleccionar, salvo que sea con el ratón. Mando un ejemplo. [code=fw:1m97d0e3]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'Fivewin.ch'</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">Local</span> oDlg<br />    <span style="color: #00C800;">Local</span> oGet := Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">Local</span> cVar := <span style="color: #000000;">&#123;</span> Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />    <br />    <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg <br />    <br />        @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Get</span> oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Var</span> cVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Action</span> PopupBrowse<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span>, oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> || .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Pixel</span><br />        oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> : <span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_F4, PopupBrowse<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span>, oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> || .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        @ <span style="color: #000000;">35</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Get</span> oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Var</span> cVar<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Action</span> PopupBrowse<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span>, oGet<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> || .t. <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Pixel</span><br /><br />    <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Init</span> oDlg : <span style="color: #000000;">lHelpIcon</span> := .f. <span style="color: #0000ff;">Centered</span><br />    <span style="color: #00C800;">Return</span> <span style="color: #000000;">0</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> PopupBrowse<span style="color: #000000;">&#40;</span> aValue, oGet, bInit <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">Local</span> oDlg <br />    <span style="color: #00C800;">Local</span> oBrw<br />   <span style="color: #00C800;">Local</span> aPoint := <span style="color: #000000;">&#123;</span> oGet:<span style="color: #000000;">nTop</span> + oGet:<span style="color: #000000;">nHeight</span>, oGet:<span style="color: #000000;">nLeft</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">Cargo</span> == <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#41;</span><br />    aPoint := ClientToScreen<span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">hWnd</span>, aPoint <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">OF</span> oGet : <span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">Style</span> WS_POPUP <span style="color: #0000ff;">Size</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">180</span><br /><br />      <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">NoWait</span> <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Init</span> oDlg : <span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />      @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">xBrowse</span> oBrw DataSource aValue <span style="color: #0000ff;">Size</span> oDlg : <span style="color: #000000;">nWidth</span>, oDlg : <span style="color: #000000;">nHeight</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Pixel</span><br />      oBrw : <span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> bInit # <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#41;</span><br />        Eval<span style="color: #000000;">&#40;</span> bInit, oBrw <span style="color: #000000;">&#41;</span><br />      End<br />        oBrw : <span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span><br />      oBrw : <span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrw : <span style="color: #000000;">bChange</span>  := <span style="color: #000000;">&#123;</span> || oGet:<span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> oBrw : <span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> : <span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, oGet : <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrw:<span style="color: #000000;">bLButtonUp</span> := <span style="color: #000000;">&#123;</span> | nRow, nCol | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nRow > oBrw : <span style="color: #000000;">nHeaderHeight</span>,;<br />                                          <span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oBrw : <span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />                                                oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />                                            oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oGet : <span style="color: #000000;">bLostFocus</span>       := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> GetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> != oDlg : <span style="color: #000000;">hWnd</span>, <span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">Nil</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">&#123;</span> || oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />      oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bMoved</span>    := <span style="color: #000000;">&#123;</span> || oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">Nil</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrw : <span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      oGet : <span style="color: #000000;">Cargo</span>               := oDlg<br />      oGet : <span style="color: #000000;">bKeyDown</span>            := <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw : <span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />                                                <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />                                                <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, oGet : <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br />                                                <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />      oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bLClicked</span>   := <span style="color: #000000;">&#123;</span> || oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oGet : <span style="color: #000000;">Cargo</span> := <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />      oGet : <span style="color: #000000;">oWnd</span> : <span style="color: #000000;">bMouseWheel</span> := <span style="color: #000000;">&#123;</span> || oDlg : <span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">Else</span><br />      oGet:<span style="color: #000000;">Cargo</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oGet:<span style="color: #000000;">Cargo</span> = <span style="color: #00C800;">nil</span><br />   End<br />    <span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /> </div>[/code:1m97d0e3] Muchas gracias. Saludos
Combobox scroll (function PopupBrowse())
Horacio, Cambia esta línea asi: oGet[ 1 ] : bKeyDown := { | nKey | If( nKey == VK_F4, PopupBrowse( { 'UNO', 'DOS', 'TRES' }, oGet[ 1 ], { | [b:3nstz1ja]oBrw[/b:3nstz1ja] | [b:3nstz1ja]oBrw:SetFocus()[/b:3nstz1ja], .t. } ), ) }
Combobox scroll (function PopupBrowse())
Antonio, ahora hace foco en el xBrowse. pero al querer abrir nuevamente el combo la tecla ya no responde. Eliminé la siguiente linea. [code=fw:8dxqeq47]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oGet : <span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DOWN, oBrw : <span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br /><span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_UP, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br /><span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> oGet : <span style="color: #000000;">VarPut</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, oGet : <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>,;<br /><span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, oDlg : <span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:8dxqeq47] Ahora la tecla funciona, la primera vez presionando una vez pero después presionando dos veces para que ejecute la acción. Muchas gracias Saludos
Combobox setminvisible
Hola foro, Parece algo facil pero no doy.. Quiero que el combobox despliegue 3 valores, en los dialogos en el on init hago ocbx:setminvisible(3) y me funciona bien, perooo en una window, en un panel de una explorer bar tengo un combobox quiero aplicar eso mismo, pero no encuentro como hacerlo oPanel := ::oExBar:AddPanel( "Seleccione Cabina", "cabina32", 100 ) @ 40, 15 COMBOBOX ::oCbx VAR ::cCabina ITEMS ::aCabina[2] OF oPanel PIXEL ; SIZE 220, 157 ; FONT oFont[2] ; ON CHANGE oSelf:BuildCabina() alguna pista?? saludos
Combobox setminvisible
alguna pista ? <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> gracias
Combobox with Image : ""find"" ?
hi, when have Image in Combobox it will not "jump" to "Key-press" i guess it have to do with Image on left Side "before" Item Text is there a Workaround to "find" Item in a Combobox with Image ?
Combobox with Image : ""find"" ?
hi have found out that it need to set [code=fw:1eqnwd52]<div class="fw" id="{CB}" style="font-family: monospace;">oCombo:<span style="color: #000000;">lIncSearch</span> := .T.</div>[/code:1eqnwd52] now when type 1st Sign it will "jump" to Item
Combobox with bitmaps
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.
Combobox with bitmaps
Hello Tim, [img:100clx47]http&#58;//www&#46;pflegeplus&#46;com/pictures/combo10&#46;jpg[/img:100clx47] Samples : [color=#FF0000:100clx47]Ownerdra.prg[/color:100clx47] ( 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",; [color=#0000FF:100clx47]// from Disk [/color:100clx47] "Arrow",; // [color=#FF0000:100clx47]from Resource[/color:100clx47] "..\bitmaps\netdrive.bmp" } Best Regards uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Combobox with bitmaps
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.
Combobox with bitmaps
This is the rc file used in the above sample \fwh\samples\ownerdra.rc [code=fw:z9lkokoc]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"..<span style="color: #000000;">\i</span>nclude<span style="color: #000000;">\W</span>inApi.ch"</span><br /><br />test <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">16</span>, <span style="color: #000000;">80</span>, <span style="color: #000000;">274</span>, <span style="color: #000000;">132</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | <span style="color: #000000;">4</span><br />CAPTION <span style="color: #ff0000;">"ListBoxes and ComboBoxes with Bitmaps!"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br />BEGIN<br />&nbsp; &nbsp; LTEXT <span style="color: #ff0000;">"An OwnerDraw ListBox!"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">78</span>, <span style="color: #000000;">9</span>, WS_CHILD | WS_VISIBLE | WS_GROUP<br />&nbsp; &nbsp; <span style="color: #0000ff;">LISTBOX</span> <span style="color: #000000;">110</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">17</span>, <span style="color: #000000;">75</span>, <span style="color: #000000;">87</span>, LBS_NOTIFY | LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP<br />&nbsp; &nbsp; LTEXT <span style="color: #ff0000;">"An OwnerDraw ComboBox!"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">88</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">88</span>, <span style="color: #000000;">9</span>, WS_CHILD | WS_VISIBLE | WS_GROUP<br />&nbsp; &nbsp; CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">120</span>, <span style="color: #ff0000;">"COMBOBOX"</span>, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | WS_TABSTOP, <span style="color: #000000;">95</span>, <span style="color: #000000;">16</span>, <span style="color: #000000;">75</span>, <span style="color: #000000;">82</span><br />&nbsp; &nbsp; LTEXT <span style="color: #ff0000;">"Run-time selection!"</span>, <span style="color: #000000;">-1</span>, <span style="color: #000000;">184</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">64</span>, <span style="color: #000000;">9</span>, WS_CHILD | WS_VISIBLE | WS_GROUP<br />&nbsp; &nbsp; CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">130</span>, <span style="color: #ff0000;">"LISTBOX"</span>, LBS_NOTIFY | LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, <span style="color: #000000;">183</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">75</span>, <span style="color: #000000;">91</span><br />&nbsp; &nbsp; CONTROL <span style="color: #ff0000;">"Your imagination is the limit"</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"STATIC"</span>, WS_CHILD | WS_VISIBLE | WS_GROUP, <span style="color: #000000;">88</span>, <span style="color: #000000;">44</span>, <span style="color: #000000;">91</span>, <span style="color: #000000;">8</span><br />&nbsp; &nbsp; CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">140</span>, <span style="color: #ff0000;">"COMBOBOX"</span>, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_TABSTOP, <span style="color: #000000;">96</span>, <span style="color: #000000;">57</span>, <span style="color: #000000;">75</span>, <span style="color: #000000;">101</span><br />&nbsp; &nbsp; PUSHBUTTON <span style="color: #ff0000;">"&Ok"</span>, IDOK, <span style="color: #000000;">119</span>, <span style="color: #000000;">110</span>, <span style="color: #000000;">35</span>, <span style="color: #000000;">14</span>, WS_CHILD | WS_VISIBLE | WS_TABSTOP<br />END<br />&nbsp;</div>[/code:z9lkokoc]
Combobox with bitmaps
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
Combobox with bitmaps
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. [img:2p7l8fwu]http&#58;//www&#46;pflegeplus&#46;com/pictures/combo7&#46;jpg[/img:2p7l8fwu] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Combobox with bitmaps
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
Combobox with bitmaps
Tim, I tested many graphic-tools and ended on this one : <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15008&p=77576&hilit=pixelformer#p77576">viewtopic.php?f=3&t=15008&p=77576&hilit=pixelformer#p77576</a><!-- l --> Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Combobox with bitmaps
Hi al, I found an error using a combox with bitmaps on a folder. The height of the combo is not correctly calculated, if you use it on a folder. Inside a dialog it´s ok. See the picture. [code=fw:3qac0090]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #B900B9;">// test combobox with bitmaps on a folder</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Local</span> oDlg,oFld<br />   <span style="color: #00C800;">Local</span> aBitMaps:= <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"one.bmp"</span>,<span style="color: #ff0000;">"two.bmp"</span>,<span style="color: #ff0000;">"one.bmp"</span>,<span style="color: #ff0000;">"two.bmp"</span>,<span style="color: #ff0000;">"one.bmp"</span><span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">Local</span> cCombo:= <span style="color: #000000;">1</span>, oCombo<br />   <span style="color: #00C800;">Local</span> aItems := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"One"</span>,<span style="color: #ff0000;">"two"</span>,<span style="color: #ff0000;">"tree"</span>,<span style="color: #ff0000;">"four"</span>,<span style="color: #ff0000;">"five"</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg  <span style="color: #0000ff;">size</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span><br /><br />   @ <span style="color: #000000;">2</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Power "</span> ,<span style="color: #ff0000;">"Of"</span>,<span style="color: #ff0000;">"Fivewin"</span> <span style="color: #0000ff;">OF</span> oDlg     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">100</span><br />   @ <span style="color: #000000;">2</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">COMBOBOX</span> oCombo <span style="color: #0000ff;">var</span> cCombo  <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>  <span style="color: #0000ff;">SIZE</span>  <span style="color: #000000;">80</span>,<span style="color: #000000;">100</span> <span style="color: #0000ff;">BITMAPS</span> aBitMaps<br />   @ <span style="color: #000000;">1</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">COMBOBOX</span> oCombo <span style="color: #0000ff;">var</span> cCombo  <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">OF</span> oDlg  <span style="color: #0000ff;">SIZE</span>  <span style="color: #000000;">80</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">BITMAPS</span> aBitMaps<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3qac0090] [url=http&#58;//s1&#46;directupload&#46;net/file/d/2842/wwi6792n_jpg&#46;htm:3qac0090][img:3qac0090]http&#58;//s1&#46;directupload&#46;net/images/120327/temp/wwi6792n&#46;jpg[/img:3qac0090][/url:3qac0090] Any suggestions ?
Combobox with bitmaps
Stefan, Yes, I think it is the used [color=#FF0000:11f54l6w]BMP-size > 16 x 16[/color:11f54l6w] In Your Sample I added 16 x 16 BMP's. Inside the Folder the Height is not adjusted. I tested using a BMP 24x24 Tested with TFolderEx [img:11f54l6w]http&#58;//www&#46;pflegeplus&#46;com/pictures/comb3&#46;jpg[/img:11f54l6w] Your Sample ( TFolder ) [img:11f54l6w]http&#58;//www&#46;pflegeplus&#46;com/pictures/comb1&#46;jpg[/img:11f54l6w] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Combobox with bitmaps
Uwe, yes, it is the bmp-size, but 24x24 bitmaps are working on a normal dialog and it´s not working on a folder dialog, but it should. I looked over the source of combobox but I didn´t find anything wrong Antonio, could you check it, please many thanks
Combobox with bitmaps
Stefan, Fixed. Some changes are required: 1. source\winapi\dlogbox.c: changes this way: Added this new code [code=fw:114qa5hr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> UINT itemHeight = <span style="color: #000000;">0</span>;<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SETOWNERDRAWITEMHEIGHT <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   itemHeight = hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span>      </div>[/code:114qa5hr] Modified the response to WM_MEASUREITEM: [code=fw:114qa5hr]<div class="fw" id="{CB}" style="font-family: monospace;">      <span style="color: #00C800;">case</span> WM_MEASUREITEM:<br />           <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> itemHeight != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> MEASUREITEMSTRUCT * <span style="color: #000000;">&#41;</span> lParam <span style="color: #000000;">&#41;</span>->itemHeight = itemHeight;<br />           <span style="color: #00C800;">break</span>;<br /> </div>[/code:114qa5hr] and finally in EndDialog(): [code=fw:114qa5hr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> ENDDIALOG <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   ...   <br /><br />   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> itemHeight != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />      itemHeight = <span style="color: #000000;">0</span>;<br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:114qa5hr] And in both listbox.prg and combobox.prg, in Method SetBitmaps(): [code=fw:114qa5hr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> SetBitmaps<span style="color: #000000;">&#40;</span> acBitmaps <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TComboBox<br /><br />   ...<br /><br />      ...      <br />      SetOwnerDrawItemHeight<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nBmpHeight</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:114qa5hr] [img:114qa5hr]http&#58;//img215&#46;imageshack&#46;us/img215/2658/capturewdx&#46;png[/img:114qa5hr]
Combobox with bitmaps
Antonio, many thanks for your quick response <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> It´s working perfectly now.
Combobox with multidimensional array
Hi all, I have a multidimensional array like this: aArray:={} aadd(aArray,{"01","Marc","Italy"}) aadd(aArray,{"02","Alvise","Switzerland"}) aadd(aArray,{"04","Romeo","France"}) and I would like to open a combobox only for the 2nd element (Marc,Alvise, Romeo) without create a temporary on element array. Any ideas ? Thanks in advance.... and happy new year to all.
Combobox with multidimensional array
Marco, Comboboxes will only handle a single dimensional array, so I think you will have to create a temporary array for this. Regards, James
Combobox y Select
Hola amigos: Tengo un diálogo con dos Combobox, cuando selecciono una opción en el primer combobox, debo cambiar el vector que muestra los datos y referescarlo y pararme en el segundo combo en una posición variable. La actualización del vector, la hago con ésta función: [color=#0040BF:4w7g4mh0]oCom2:SetItems(ArrTranspose(aTURNOS)[1]) [/color:4w7g4mh0]luego: busco la posición que necesito y hago, por ejemplo: valor:=3 (no es así pero a los fines del ejemplo...) [color=#0040BF:4w7g4mh0]oCom2:SetItems(valor)[/color:4w7g4mh0] y cuando vuelvo a la función principal, siempre queda en la posición uno... Que debo hacer para que mi segundo combo se actualice en la posición que necesito? Muchas gracias!
Combobox y Select
Nada?....
Combobox y Select
Tiens un ejemplo simples? Gracias, saludos.
Combobox y Select
Voy a ver si lo preparo, no es simple de hacer. Lo armo y lo subo... Gracias Joao!
Combobox y Select
Hola creo que es un error conceptual mio... cuando hago: REDEFINE COMBOBOX oCom VAR cItems PROMPTS´{"Juan","Pedro","Mateo"} ID 101 OF oDlg siempre le doy el valor numèrico donque quiero que se pare el COMBO, por ejemplo: cItem:=2 si quiero que se pare en Pedro pero en realidad, debo asignaar de èsta manera cierto? cItem:="Pedro" Es asì realmente? Gracias! Roberto
Combobox y Select
Hola, prueba con [code=fw:17rgqngo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />oCombo2:<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp;</div>[/code:17rgqngo]
Combobox y búsqueda incremental
Colegas, tengo definido un combobox con estilo CBS_DROPDOWN y búsqueda incremetal. Cuando recorro los items se ejecuta una acción pero cuando hago la búsqueda la acción no se ejecuta. Este es el código. [code=fw:305hxh7f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00C800;">Static</span> aItems <br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">Local</span> oDlg<br />    <span style="color: #00C800;">Local</span> oCbx<br />    <span style="color: #00C800;">Local</span> cVar<br />    <br />    aItems := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span><br />    <br />    <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg Truepixel<br />        <br />        @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">ComboBox</span> oCbx <span style="color: #0000ff;">Var</span> cVar <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">150</span> <span style="color: #0000ff;">Items</span> aItems <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Pixel</span> <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Change</span><span style="color: #000000;">&#40;</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Style</span> CBS_DROPDOWN           <br />       oCbx : <span style="color: #000000;">lIncSearch</span> := .t.<br />       <br />    <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg <br />    <span style="color: #00C800;">Return</span> <span style="color: #000000;">0</span><br />    <br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx <span style="color: #000000;">&#41;</span><br /><br />    ? aItems<span style="color: #000000;">&#91;</span> oCbx : <span style="color: #000000;">nAt</span> <span style="color: #000000;">&#93;</span><br />    <span style="color: #00C800;">Return</span> <span style="color: #000000;">0</span><br /><br /> </div>[/code:305hxh7f] Alguna idea ??? Muchas gracias Saludos
Combobox y búsqueda incremental
Mira se ayuda: [url:2n3ehaal]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=34807[/url:2n3ehaal] Saludos.
Combobox y búsqueda incremental
Gracias Joao por responder, la búsqueda funciona, lo que no funciona es el bChange que no se ejecuta cuando hago la búsqueda, sí cuando recorro los items con el teclado o ratón. Compila el ejemplo que postee y prueba. Saludos
Combobox y búsqueda incremental
[code=fw:3k9xgf96]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oCbx, cSearch := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aItems := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"africa"</span>, <span style="color: #ff0000;">"america"</span>, <span style="color: #ff0000;">"asia"</span>, <span style="color: #ff0000;">"europe"</span>, <span style="color: #ff0000;">"oceania"</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">300</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">2.4</span>, <span style="color: #000000;">1.2</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cSearch <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>, <span style="color: #000000;">150</span><br /><br />&nbsp; &nbsp;oCbx:<span style="color: #000000;">lIncSearch</span> = .T.<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:3k9xgf96]
Combobox y búsqueda incremental
[code=fw:1395cxn0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Static</span> aItems <br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oCbx<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> cVar<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;aItems := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #B900B9;">//Define Dialog oDlg Truepixel</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">50</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DropDown ComboBox Test"</span> TRUEPIXEL<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">ComboBox</span> oCbx <span style="color: #0000ff;">Var</span> cVar <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">150</span> <span style="color: #0000ff;">Items</span> aItems <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Pixel</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Change</span><span style="color: #000000;">&#40;</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Style</span> CBS_DROPDOWN<br /><br />&nbsp; &nbsp;oCbx : <span style="color: #000000;">lIncSearch</span> := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />&nbsp; &nbsp; <br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx, oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cText<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; &nbsp;? aItems[ oCbx : nAt ]</span><br /><br />&nbsp; &nbsp;cText := aItems<span style="color: #000000;">&#91;</span> oCbx:<span style="color: #000000;">nAt</span> <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1395cxn0]
Combobox y búsqueda incremental
Joao, con tu código tampoco funciona. Ingresa la letra "U", aparecerá "UNO" en el get del combobox pero no se ejecuta muestrame( oCbx, oDlg ) Saludos
Combobox y búsqueda incremental
Horácio, cambia asi: [code=fw:1eh44vcq]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">ComboBox</span> oCbx <span style="color: #0000ff;">Var</span> cVar <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">150</span> <span style="color: #0000ff;">Items</span> aItems <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Pixel</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Change</span><span style="color: #000000;">&#40;</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Style</span> CBS_DROPDOWN <span style="color: #0000ff;">UPDATE</span><br />&nbsp;</div>[/code:1eh44vcq] Acá funciona bién. Saludos.
Combobox y búsqueda incremental
Joao, he seguido tu sugerencia pero no logro hacerlo funcionar. Será la versión de FWH que utilizo ? Uso FWH 17.01. Gracias de todas maneras Saludos
Combobox y búsqueda incremental
Horácio cuando pulso el mouse, el on change funciona bién, [img:3gy851yi]https&#58;//i&#46;imgur&#46;com/AyL5htE&#46;png[/img:3gy851yi] [code=fw:3gy851yi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Static</span> aItems <br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oCbx<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> cVar<br />&nbsp; &nbsp; <br />&nbsp; &nbsp;aItems := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'UNO'</span>, <span style="color: #ff0000;">'DOS'</span>, <span style="color: #ff0000;">'TRES'</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #B900B9;">//Define Dialog oDlg Truepixel</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">50</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DropDown ComboBox Test"</span> TRUEPIXEL<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">ComboBox</span> oCbx <span style="color: #0000ff;">Var</span> cVar <span style="color: #0000ff;">Size</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">150</span> <span style="color: #0000ff;">Items</span> aItems <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">Pixel</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">On</span> <span style="color: #0000ff;">Change</span><span style="color: #000000;">&#40;</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">Style</span> CBS_DROPDOWN <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;oCbx : <span style="color: #000000;">lIncSearch</span> := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg <span style="color: #0000ff;">Center</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br />&nbsp; &nbsp; <br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Muestrame<span style="color: #000000;">&#40;</span> oCbx, oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cText<br /><br />&nbsp; &nbsp;? aItems<span style="color: #000000;">&#91;</span> oCbx : <span style="color: #000000;">nAt</span> <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//cText := aItems[ oCbx:nAt ]</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//oDlg:SetText( cText )</span><br />&nbsp; &nbsp;oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3gy851yi] Saludos.
Combobox y búsqueda incremental
bChange trabaja si recorres los items con el mouse o con el teclado pero no funciona si lo haces con la búsqueda incremental, en ese caso bChange no se ejecuta. Fijate que si pulsas la "U" en el get del combobox aparecerá "UNO" pero el msgbox no se ejecuta. Confirmame si lo que digo es cierto. Gracias Saludos
Combobox y búsqueda incremental
Horacio, mira se asi ayuda: [code=fw:10qp4hgl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oCbx, cDia<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// DEFINE DIALOG oDlg</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">50</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DropDown ComboBox Test"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Digite dia y use <Enter> "</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cDia <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">300</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Lunes"</span>, <span style="color: #ff0000;">"Martes"</span>, <span style="color: #ff0000;">"Miércoles"</span>, <span style="color: #ff0000;">"Jueves"</span>, <span style="color: #ff0000;">"Viernes"</span>, <span style="color: #ff0000;">"Sábado"</span>, <span style="color: #ff0000;">"Domingo"</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> QueDia<span style="color: #000000;">&#40;</span> cDia <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">/* ;<br />&nbsp; &nbsp; &nbsp; VALID( QueDia( cDia ) ) */</span><br /><br />&nbsp; &nbsp;oCbx:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">bKeyChar</span> = <span style="color: #000000;">&#123;</span> | nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cDia := oCbx:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Eval<span style="color: #000000;">&#40;</span> oCbx:<span style="color: #000000;">bChange</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>, &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCbx:<span style="color: #000000;">GetKeyChar</span><span style="color: #000000;">&#40;</span> nKey <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;oCbx:<span style="color: #000000;">lIncSearch</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> QueDia<span style="color: #000000;">&#40;</span>cDia<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;MsgAlert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Hoy día es: "</span>+cDia<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:10qp4hgl]
Combobox y búsqueda incremental
Muchas gracias Joao por tu tiempo. En tu ejemplo una vez hecha la búsqueda incremental tengo que digitar una tecla ( VK_RETURN ) para que se ejecute el bChange, sin dudas sería una posible solución pero el comportamiento correcto sería que una vez que ingrese, por ejemplo el caracter "L" me aparezca "Lunes" y se ejecute el bChange cosa que no sucede. Veré como me resulta tu solución para mi proyecto. Nuevamente muchas gracias. Saludos
Combobox y enter no funciona
Antonio. la clase combobox cuando su tipo es DROPDOWN no esta permitiendo que la presionar ENTER salgamos del control y saltemos al siguiente, si no que se queda sin hacer nada, hay que presionar TAB para que salte al siguiente control. lo puedes verificar ejecutando fivedbu, y seleccionas la opcion buscar. salu2 carlos vargas
Combobox y enter no funciona
Carlos, Ese es en realidad el comportamiento por defecto de Windows: que saltemos de un control a otro usando Tab. Entiendo que para los programas de gestión es importante poder usar enter pues asi no hay que usar la mano izquierda y todo se puede hacer con una mano. Has revisado la Clase TComboBox para ver si procesamos Enter en KeyChar ó en KeyDown ? gracias
Combobox y enter no funciona
Lo revisare hoy noche, por que ademas note que no esta evaluando bien el valid, te comentare como me fue espero que no este dificil la cosa <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> tengo entendido que la clase combobox cuando es de este tipo especifico, tiene un control Get asociado, por lo que la validación y la evaluación de las teclas correspondería en parte a esa clase, en fin, ya veremos como me va. salu2 carlos vargas
Combobox y enter no funciona
Antonio, con este código en tget, metodo Keychar ya funciona el salto con en enter en combobox, estilo CBS_DROPDOWN [code=fw:2upvhz3f]<div class="fw" id="{CB}" style="font-family: monospace;"><br />        <span style="color: #00C800;">case</span> nKey == VK_TAB .or. nKey == VK_RETURN<br />           <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bChange</span> != <span style="color: #00C800;">nil</span> .and. <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Changed</span> .or. ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">UnTransform</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> != ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Original</span> <span style="color: #000000;">&#41;</span><br />              lAccept = Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bChange</span>, nKey, nFlags, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> lAccept <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"L"</span><br />                 <span style="color: #00C800;">if</span> lAccept<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//aca no se si es necesario el evaluar si ::oWnd:IsKindOf( "TCOMBOBOX" ) &nbsp;como el la ultima parte del codigo</span><br />                    ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />                 <span style="color: #00C800;">endif</span><br />              <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//aca no se si es necesario el evaluar si ::oWnd:IsKindOf( "TCOMBOBOX" ) como el la ultima parte del codigo</span><br />                 ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">else</span><br />              <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">IsKindOf</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TCOMBOBOX"</span> <span style="color: #000000;">&#41;</span>       <span style="color: #B900B9;">//kds - modificado para permitir salto de control con ENTER cuando el get portenece a un combobox</span><br />                 ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">else</span><br />                 ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">endif</span><br />           <span style="color: #00C800;">endif</span><br /> </div>[/code:2upvhz3f] este es el programa de prueba [code=fw:2upvhz3f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// DropDown ComboBoxes</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oCbx1, oCbx2<br />   <span style="color: #00C800;">local</span> cText1 := <span style="color: #ff0000;">"     "</span><br />   <span style="color: #00C800;">local</span> cText2 := <span style="color: #ff0000;">"     "</span><br />   <span style="color: #00C800;">local</span> oVar, cVar := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">50</span> ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DropDown ComboBox Test"</span><br /><br />   @ <span style="color: #000000;">0.5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx1 <span style="color: #0000ff;">VAR</span> cText1 <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br />      <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"Three"</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">2.0</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">GET</span> oVar <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span><br /><br />   @ <span style="color: #000000;">3.5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cText2 <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWNLIST ;<br />      <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"Three"</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2upvhz3f] ahora, tengo una duda: en la clase combobox, método KeyChar, esta este código que no veo que se ejecute nunca, dado que la tecla Enter se evalúa en el método KeyDown [code=fw:2upvhz3f]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">if</span> nKey == VK_RETURN<br />      <span style="color: #00C800;">return</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /> </div>[/code:2upvhz3f] ademas, la clase combobox no esta evaluando el valid, cuando el tipo es CBS_DROPDOWN, ahi no he podido hallar el problema, si me das una guia, cabe señalar que el valid si funciona si el tipo es CBS_DROPDOWNLIST. por lo que me inmagino que la data ::bValid deberia ser pasada al objeto tget, para que lo evaluara, tambien habria que revisar el bWhen y bChange. ademas otra pregunta, antes hace años la clase tcombobox creaba el objeto tget solo si el combobox era CBS_DROPDOWN, ahora lo crea siempre, por que?
Combobox y enter no funciona
Antonio, no he sido capaz de encontrar el error de por que el combobox como lista no evalúa correctamente el valid, he revisado la clase tcombobox, tget sin resultado positivo, ahora he encontrado otro error, cuando el combobox es una lista y esta abierta y presionas escape, la lista se cierra, pero el valor de la variable se le agrega un símbolo al final, señal de que la tecla escape chr(26) fue sumada al contenido de la variable. nota que solo el tercer combobox esta evaluando bien el valid. [url=http&#58;//imgur&#46;com/cnqkV27:3rdufxqg][img:3rdufxqg]http&#58;//i&#46;imgur&#46;com/cnqkV27&#46;png[/img:3rdufxqg][/url:3rdufxqg] [url=http&#58;//imgur&#46;com/VwNDraD:3rdufxqg][img:3rdufxqg]http&#58;//i&#46;imgur&#46;com/VwNDraD&#46;png[/img:3rdufxqg][/url:3rdufxqg] tengo este ejemplo para revision. [code=fw:3rdufxqg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// DropDown ComboBoxes</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg<br />   <span style="color: #00C800;">local</span> oCbx1, oCbx2, oCbx3<br />   <span style="color: #00C800;">local</span> cText1 := <span style="color: #ff0000;">"     "</span><br />   <span style="color: #00C800;">local</span> cText2 := <span style="color: #ff0000;">"     "</span><br />   <span style="color: #00C800;">local</span> cText3 := <span style="color: #ff0000;">"     "</span><br />   <span style="color: #00C800;">local</span> cVar   := Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">60</span> ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DropDown ComboBox Test"</span><br /><br />   @ <span style="color: #000000;">0.5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx1 <span style="color: #0000ff;">VAR</span> cText1 <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br />      <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"One"</span>, <span style="color: #ff0000;">"Two"</span>, <span style="color: #ff0000;">"Three"</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oDlg:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> cText1 <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">1.5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">GET</span> cVar ;<br />      <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span><br /><br />   @ <span style="color: #000000;">3.0</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cText2 <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br />      <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Uno"</span>, <span style="color: #ff0000;">"Dos"</span>, <span style="color: #ff0000;">"Tres"</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oDlg:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> cText2 <span style="color: #000000;">&#41;</span>;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">4.5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx3 <span style="color: #0000ff;">VAR</span> cText3 <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWNLIST ;<br />      <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Uno1"</span>, <span style="color: #ff0000;">"Dos2"</span>, <span style="color: #ff0000;">"Tres3"</span> <span style="color: #000000;">&#125;</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oDlg:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> cText3 <span style="color: #000000;">&#41;</span>;<br />      <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"3"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3rdufxqg] asi mismo he mirado un msginfo que creo que no aplica en el metodo keychar de tcombobox [code=fw:3rdufxqg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> KeyChar<span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TComboBox<br /><br />   <span style="color: #00C800;">local</span> nNewAT := <span style="color: #000000;">0</span>, nOldAT := ::<span style="color: #000000;">nAT</span>, uItem<br />...<br />      <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> uItem <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> nNewAt == <span style="color: #000000;">0</span><br />            <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lCaseSensitive</span><br />               nNewAt = AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aItems</span>, <span style="color: #000000;">&#123;</span> | x | <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> x, <span style="color: #000000;">1</span>, Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cSearchKey</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == ::<span style="color: #000000;">cSearchKey</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">else</span><br />               nNewAt = AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aItems</span>, <span style="color: #000000;">&#123;</span> | x | <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> Upper<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cSearchKey</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == ::<span style="color: #000000;">cSearchKey</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />            <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />               uItem = ::<span style="color: #000000;">aItems</span><span style="color: #000000;">&#91;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nNewAt > <span style="color: #000000;">0</span>, nNewAt, <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nAT</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><br />            <span style="color: #00C800;">else</span><br />               uItem = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nNewAt > <span style="color: #000000;">0</span>, ::<span style="color: #000000;">aItems</span><span style="color: #000000;">&#91;</span> nNewAt <span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">cSearchKey</span> <span style="color: #000000;">&#41;</span><br />               <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> uItem <span style="color: #000000;">&#41;</span><br />...<br /> </div>[/code:3rdufxqg]
Combobox y enter no funciona
Carlos, Mucha gracias por el tiempo y esfuerzo que has pasado investigándolo. A esto se llama ayudar de verdad <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> El Get del combobox no evalua su valid porque su contenedor no tiene más hijos (controles). Asi que hace unos dias hice unos cambios en el Método Initiate del ComboBox: [code=fw:3bit5iar]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> Initiate<span style="color: #000000;">&#40;</span> hDlg <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TComboBox<br /><br />&nbsp; &nbsp;::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Initiate</span><span style="color: #000000;">&#40;</span> hDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #00C800;">Default</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">oGet</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">hWnd</span> = GetWindow<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, GW_CHILD <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">VarGet</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">hWnd</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Link</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">bKeyChar</span> = <span style="color: #000000;">&#123;</span> | nKey | Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bSetGet</span>, ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey != VK_TAB, Chr<span style="color: #000000;">&#40;</span> nKey <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> nKey <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_TAB .and. ! GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oWndFromHwnd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">GoNextCtrl</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nKey <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">bLostFocus</span> = ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> | hCtlFocus, nAt, cItem | cItem := ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bSetGet</span>, cItem <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bValid</span> != <span style="color: #00C800;">nil</span> .and. ;<br />&nbsp; &nbsp; &nbsp; GetParent<span style="color: #000000;">&#40;</span> hCtlFocus <span style="color: #000000;">&#41;</span> == GetParent<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bValid</span>, ::<span style="color: #000000;">oGet</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">PostMsg</span><span style="color: #000000;">&#40;</span> WM_SETFOCUS <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">hWnd</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oGet</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oFont</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3bit5iar] Por favor pruébalo a ver que tal te funciona. Por otra parte te diré que estoy temporalmente en "off" porque bitbucket me hizó un extraño que me obligó a cambiar el password y luego simplemente se me olvidó el que puse antes de anotarlo <!-- s:-D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":-D" title="Very Happy" /><!-- s:-D --> Asi que les he enviado un email de ayuda porque su sistema de recuperación de contraseñas no esta funcionando bien, asi que dice que me ha enviado el email pero no me envia nada. Afortunadamente cualquiera de mis colaboradores puede acceder a todo con su contraseña (no se pierde nada) y yo tuve tiempo de hacer copia de seguridad de todo. Pero la lata es que no puedo guardar mis cambios, asi que me toca esperar. En cuanto tenga esto solucionado probaré tus cambios con los mios, y subiré la versión definitiva a bitbucket <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Combobox y teclas VK_UP VK_DOWN
Amigos del foro: Hay alguna manera de evitar que se dispare el bChange del combobox cuando se usan las teclas UP, DOWN? Lo que quiero hacer es utilizar estas teclas solo para recorrer los items del combobox, y que este ejecute el code bChange hasta que se oprime la tecla ENTER. ¿Como hacer esto? Saludos. [url=http&#58;//imageshack&#46;us/photo/my-images/546/b7pm&#46;png/:eyvyb2oo][img:eyvyb2oo]http&#58;//img546&#46;imageshack&#46;us/img546/4070/b7pm&#46;png[/img:eyvyb2oo][/url:eyvyb2oo] Uploaded with [url=http&#58;//imageshack&#46;us:eyvyb2oo]ImageShack.us[/url:eyvyb2oo]
Combobox y teclas VK_UP VK_DOWN
Francisco, no se si se pueda inhabilitar, pero una solucion seria que lo mandes a una funcion o procedures vacia, es decir que solo retorne, aunque crei que la bchange se activaba si uno lo programaba en las clausulas del combobox, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> function / procedure mi_funcion() return
Combobox y teclas VK_UP VK_DOWN
Hola José Luis, gracias por contestar. En efecto, ya he probado con los codeblock bKeyChar y bKeyDown sin ningún resultado. Ahorita mismo estoy estudiando la class combobox a ver si encuentro como hacerlo. Lo que pasa es que un usuario acostumbra usar 100% el mouse, y si ves la imagen anterior, este usuario despues de entrar el valor en el get a la izq. del combobox, luego hace click en este último, selecciona, y luego coloca el mouse sobre el xbrowse y usa la rueda de éste (sin haber hecho click en el xbrowse), tratando de avanzar items, y lo que sucede es que el combobox tiene el focus y cambia de items, lo que no era notado por el usuario, ocasionando una seleccion equivocada. Lo del mouse ya lo arreglé, pero con las teclas UP y DOWN no he podido. Este comportamiento sucede aun cuando uses la rueda del mouse en cualquier parte de el Dialog. Yo entiendo que el combobox aun tiene el foco, pero no sé si este comportamiento es correcto. Nuevamente gracias.
Combobox y teclas VK_UP VK_DOWN
Francisco, Prueba a no usar ON CHANGE y define el codeblock oCombobox:bCloseUp
Combobox y teclas VK_UP VK_DOWN
Antonio. Muchas gracias. Voy a probarlo esta noche. Saludos.
Combobox y teclas VK_UP VK_DOWN
Antonio, Gracias nuevamente. Funciona. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Saludos.
Combobox tipo de letra y ancho
Saludos. he intentado hacer varias cosas para cambiar el aspecto del combobox sin solucion alguna. Esta modificacion es cambiarle la fuente o letra al combo y su ancho, que estos sean el mismo ancho que uso en los gets y la misma fuente del get. Alguien que pueda ayudarle o lo haya echo ya. Gracias.
Combobox tipo de letra y ancho
[code=fw:3esziisf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#define</span> __CLRLBOX     nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">200</span>, <span style="color: #000000;">83</span><span style="color: #000000;">&#41;</span>        <span style="color: #B900B9;">// COLOR DE LOS TEXTOS DE LOS LISTBOX</span><br /><span style="color: #00D7D7;">#define</span> __CLRBOXB     nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">55</span>, <span style="color: #000000;">60</span>, <span style="color: #000000;">62</span><span style="color: #000000;">&#41;</span>       &nbsp; <span style="color: #B900B9;">// COLOR DE FONDO DE LOS LISTBOX</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span>   xFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI Symbol"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-18</span><br /><br />...<br />...<br /><br /><span style="color: #0000ff;">REDEFINE</span>  <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cVariable <span style="color: #0000ff;">ITEMS</span> aItems  <span style="color: #0000ff;">ID</span> <span style="color: #000000;">80</span> <span style="color: #0000ff;">OF</span> xDlg <span style="color: #0000ff;">COLOR</span> FRE_CLBOX,FRE_CBOXB<br /><br />                             oCbx:<span style="color: #000000;">oFont</span> <span style="color: #000000;">&#40;</span> xFont <span style="color: #000000;">&#41;</span><br />....<br />....<br />....<br /><br /><br /> </div>[/code:3esziisf]
Combobox: How to color items
Is it possibile to color each item of a Combobox with a different color? King Regards Marco
Combobox: How to color items
Marco, Please review FWH\samples\ownerdra.prg
Combobox: How to color items
VeryGood <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Combobox: How to color items
Antonio, not all bitmaps are correctly displayed I open yellow.bmp using Paint I draw another color using brush and save But I cannot see correctly the bitmap
Combobox: How to color items
This is bmp file modified [img:341zsjx1]http&#58;//www&#46;marcoboschi&#46;it/public/rosso&#46;bmp[/img:341zsjx1] This is one of correct bitmaps [img:341zsjx1]http&#58;//www&#46;marcoboschi&#46;it/public/giallo&#46;bmp[/img:341zsjx1]
Combobox: How to color items
Run ok for me [img:2jmu4o3e]https&#58;//s18&#46;postimg&#46;org/5xu5awdll/owner&#46;png[/img:2jmu4o3e]
Combobox: How to color items
Hello Christobal, Could you share the code for the combo with the colors insite ?
Combobox: How to color items
[quote="Marc Venken":11ghegu8]Hello Christobal, Could you share the code for the combo with the colors insite ?[/quote:11ghegu8] Look post of Antonio [quote="Antonio Linares":11ghegu8]Marco, Please review FWH\samples\ownerdra.prg[/quote:11ghegu8]
Combobox: How to color items
Cristobal, if you download this bmp file <!-- m --><a class="postlink" href="http://www.marcoboschi.it/public/rosso.bmp">http://www.marcoboschi.it/public/rosso.bmp</a><!-- m --> and subsititute one of bmp files you can see that there is a problem You cannot see the bitmap rosso.bmp The question is: these bmp files are particular bmp files? screenshot [img:29hli2nx]http&#58;//www&#46;marcoboschi&#46;it/public/errore&#46;png[/img:29hli2nx]
Combobox: How to color items
Ah!, ok, I will try Send me your image original
Combobox: How to color items
A test [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/Combo1&#46;jpg[/img:2gab2rj5] [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sRosso&#46;bmp[/img:2gab2rj5] [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sRed&#46;bmp[/img:2gab2rj5] [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sBlue&#46;bmp[/img:2gab2rj5] [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sYellow&#46;bmp[/img:2gab2rj5] [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sGreen&#46;bmp[/img:2gab2rj5] [img:2gab2rj5]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sWhite&#46;bmp[/img:2gab2rj5] [code=fw:2gab2rj5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cItem4 ;<br /><span style="color: #0000ff;">ID</span> <span style="color: #000000;">140</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ITEMS</span>   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"   White"</span>, <span style="color: #ff0000;">"   Blue"</span>, <span style="color: #ff0000;">"   Rosso"</span>, <span style="color: #ff0000;">"   Yellow"</span>, <span style="color: #ff0000;">"   Green"</span>, <span style="color: #ff0000;">"   Red"</span> <span style="color: #000000;">&#125;</span> ;<br /><span style="color: #0000ff;">BITMAPS</span> <span style="color: #000000;">&#123;</span> c_path + <span style="color: #ff0000;">"sWhite.bmp"</span>,;<br />                c_path + <span style="color: #ff0000;">"sBlue.bmp"</span>,;<br />                c_path + <span style="color: #ff0000;">"sRosso.bmp"</span>,;<br />                c_path + <span style="color: #ff0000;">"sYellow.bmp"</span>,;<br />               c_path + <span style="color: #ff0000;">"sGreen.bmp"</span>,;<br />               c_path + <span style="color: #ff0000;">"sRed.bmp"</span> <span style="color: #000000;">&#125;</span><br />oCbx2:<span style="color: #000000;">nItemHeight</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">22</span> <span style="color: #000000;">&#41;</span> <br /> </div>[/code:2gab2rj5] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Combobox: How to color items
The bitmaps are drawn, treating the color at pixel 0,0 as transparent. In the case of rosso.bmp, color at (0,0) is same as the entire body of the bitmap, so the entire bitmap is treated as transparent. Please choose a bitmap where the color at (0,0) is different from the rest of the bitmap
Combobox: How to color items
Rao, the left upper corner is different in color to show a black frame [img:ch49wv0f]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/Combo2&#46;jpg[/img:ch49wv0f] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Combobox: How to color items
Uwe I am referring to the bitmap downloaded from <!-- m --><a class="postlink" href="http://www.marcoboschi.it/public/rosso.bmp">http://www.marcoboschi.it/public/rosso.bmp</a><!-- m -->, not the bmps you are using. Yes. Because in your bitmaps 0,0 color is different from the rest of the colors, the painting is ok.
Combobox: How to color items
[b:3cxwyb2l]Dear coders, thank you so much[/b:3cxwyb2l]
Combobox: How to color items
[quote="ukoenig":1f0xgecn]Rao, the left upper corner is different in color to show a black frame [img:1f0xgecn]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/Combo2&#46;jpg[/img:1f0xgecn] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->[/quote:1f0xgecn] On the subject of bitmaps like this, I can suggest a small function which can create such bitmaps on the fly. We can specify the inner color, border color and thickness. We can even specify translucent alpha colors. We can specify width, height and shape, rectangle, square, circle, ellipse. The bitmap produced is an alpha bitmap. [code=fw:1f0xgecn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> ColorBlockBmp<span style="color: #000000;">&#40;</span> nColor, nBorderColor, nWidth, nHeight, nBorderSize, lEllipse <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hBmp, x, cShape, aShapes := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> nColor := CLR_WHITE, nBorderColor := CLR_BLACK, nWidth := <span style="color: #000000;">64</span>, nHeight := <span style="color: #000000;">16</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBorderSize := <span style="color: #000000;">2</span>, lEllipse := .f.<br /><br />&nbsp; &nbsp;x &nbsp; &nbsp; &nbsp; &nbsp;:= Ceiling<span style="color: #000000;">&#40;</span> nBorderSize / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cShape &nbsp; := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lEllipse, <span style="color: #ff0000;">"E"</span>, <span style="color: #ff0000;">"R"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aShapes, <span style="color: #000000;">&#123;</span> cShape, nColor, &nbsp;<span style="color: #000000;">0</span>, nWidth, nHeight, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, nHeight - <span style="color: #000000;">1</span>, nWidth - <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nBorderSize > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aShapes, <span style="color: #000000;">&#123;</span> cShape, nBorderColor, nBorderSize, nWidth, nHeight, x, x, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nHeight - x - <span style="color: #000000;">1</span>, nWidth - x - <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;hBmp &nbsp;:= FW_CreateBitmap<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> nWidth, nHeight, aShapes <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> hBmp<br />&nbsp;</div>[/code:1f0xgecn] This is a test program using the above function. [code=fw:1f0xgecn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBrush<br /><br />&nbsp; &nbsp;aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> &nbsp; := ColorBlockBmp<span style="color: #000000;">&#40;</span> CLR_HGREEN, CLR_BLACK,<span style="color: #000000;">128</span>, &nbsp;<span style="color: #000000;">48</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> &nbsp; := ColorBlockBmp<span style="color: #000000;">&#40;</span> nARGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">128</span>, CLR_WHITE <span style="color: #000000;">&#41;</span>, CLR_HBLUE, <span style="color: #000000;">128</span>,<span style="color: #000000;">128</span>, <span style="color: #000000;">6</span>, .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> &nbsp; := ColorBlockBmp<span style="color: #000000;">&#40;</span> CLR_YELLOW, CLR_HRED, <span style="color: #000000;">128</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE <span style="color: #ff0000;">"<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\s</span>ea.bmp"</span> RESIZE<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oWnd:<span style="color: #000000;">DrawImage</span><span style="color: #000000;">&#40;</span> aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, &nbsp; <span style="color: #000000;">0</span>, <span style="color: #000000;">200</span>, <span style="color: #000000;">150</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oWnd:<span style="color: #000000;">DrawImage</span><span style="color: #000000;">&#40;</span> aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">150</span>, <span style="color: #000000;">200</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oWnd:<span style="color: #000000;">DrawImage</span><span style="color: #000000;">&#40;</span> aBmp<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">200</span>, <span style="color: #000000;">600</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> aBmp, <span style="color: #000000;">&#123;</span> |o| DeleteObject<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1f0xgecn] [url=https&#58;//imageshack&#46;com/i/pnPWxbrIp:1f0xgecn][img:1f0xgecn]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/923/PWxbrI&#46;png[/img:1f0xgecn][/url:1f0xgecn]
Combobox: How to color items
Mr. Rao, thank You very much The solutionn makes painting of these image-types easy <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> I'm always interested on graphic-solutions. regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Combobox: How to color items
Mr. Rao, I'm creating a [color=#0000FF:2zg86vr5]BMP-painter[/color:2zg86vr5] for this special kind of images using Your function. With my first tests it works great <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> We can do a visual design of styles, colors and size The design can be [color=#0000FF:2zg86vr5][b:2zg86vr5]saved as BMP[/b:2zg86vr5][/color:2zg86vr5]. It saves a lot of time instead using a external Paint-program. It will be next in line after finishing my forum-sample-import I remember there is still another style 4 <[color=#0000FF:2zg86vr5] Roundrect [/color:2zg86vr5]> can this be included ? regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Combobox: How to color items
[quote="ukoenig":3nof5l58]A test [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/Combo1&#46;jpg[/img:3nof5l58] [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sRosso&#46;bmp[/img:3nof5l58] [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sRed&#46;bmp[/img:3nof5l58] [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sBlue&#46;bmp[/img:3nof5l58] [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sYellow&#46;bmp[/img:3nof5l58] [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sGreen&#46;bmp[/img:3nof5l58] [img:3nof5l58]http&#58;//www&#46;pflegeplus&#46;com/DOWNLOADS/sWhite&#46;bmp[/img:3nof5l58] [code=fw:3nof5l58]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cItem4 ;<br /><span style="color: #0000ff;">ID</span> <span style="color: #000000;">140</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ITEMS</span>   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"   White"</span>, <span style="color: #ff0000;">"   Blue"</span>, <span style="color: #ff0000;">"   Rosso"</span>, <span style="color: #ff0000;">"   Yellow"</span>, <span style="color: #ff0000;">"   Green"</span>, <span style="color: #ff0000;">"   Red"</span> <span style="color: #000000;">&#125;</span> ;<br /><span style="color: #0000ff;">BITMAPS</span> <span style="color: #000000;">&#123;</span> c_path + <span style="color: #ff0000;">"sWhite.bmp"</span>,;<br />                c_path + <span style="color: #ff0000;">"sBlue.bmp"</span>,;<br />                c_path + <span style="color: #ff0000;">"sRosso.bmp"</span>,;<br />                c_path + <span style="color: #ff0000;">"sYellow.bmp"</span>,;<br />               c_path + <span style="color: #ff0000;">"sGreen.bmp"</span>,;<br />               c_path + <span style="color: #ff0000;">"sRed.bmp"</span> <span style="color: #000000;">&#125;</span><br />oCbx2:<span style="color: #000000;">nItemHeight</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">22</span> <span style="color: #000000;">&#41;</span> <br /> </div>[/code:3nof5l58] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->[/quote:3nof5l58] Hi, Can we use resource bmp? [code=fw:3nof5l58]<div class="fw" id="{CB}" style="font-family: monospace;">Bmp_sBlue       BITMAP <span style="color: #ff0000;">"Res<span style="color: #000000;">\\</span>sblue.bmp"</span><br />Bmp_sGreen  BITMAP <span style="color: #ff0000;">"Res<span style="color: #000000;">\\</span>sgreen.bmp"</span><br />Bmp_sRed        BITMAP <span style="color: #ff0000;">"Res<span style="color: #000000;">\\</span>sred.bmp"</span><br />Bmp_sRosso  BITMAP <span style="color: #ff0000;">"Res<span style="color: #000000;">\\</span>srosso.bmp"</span><br />Bmp_sWhite  BITMAP <span style="color: #ff0000;">"Res<span style="color: #000000;">\\</span>swhite.bmp"</span><br />Bmp_sYellow BITMAP <span style="color: #ff0000;">"Res<span style="color: #000000;">\\</span>syellow.bmp"</span></div>[/code:3nof5l58] [code=fw:3nof5l58]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cItem4 ;<br /><span style="color: #0000ff;">ID</span> <span style="color: #000000;">140</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ITEMS</span>   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"   White"</span>, <span style="color: #ff0000;">"   Blue"</span>, <span style="color: #ff0000;">"   Rosso"</span>, <span style="color: #ff0000;">"   Yellow"</span>, <span style="color: #ff0000;">"   Green"</span>, <span style="color: #ff0000;">"   Red"</span> <span style="color: #000000;">&#125;</span> ;<br /><span style="color: #0000ff;">BITMAPS</span> <span style="color: #000000;">&#123;</span> Bmp_sWhite, Bmp_sBlue, Bmp_sRosso, Bmp_sYellow, Bmp_sGreen, Bmp_sRed <span style="color: #000000;">&#125;</span><br />oCbx2:<span style="color: #000000;">nItemHeight</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">22</span> <span style="color: #000000;">&#41;</span>                <br /> </div>[/code:3nof5l58] It gives an error : [code=fw:3nof5l58]<div class="fw" id="{CB}" style="font-family: monospace;">Error BASE/<span style="color: #000000;">1003</span>  Variable does not exist: <span style="color: #000000;">BMP_SWHITE</span></div>[/code:3nof5l58] Changed like that. [code=fw:3nof5l58]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cItem4 ;<br /><span style="color: #0000ff;">ID</span> <span style="color: #000000;">140</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ITEMS</span>   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"   White"</span>, <span style="color: #ff0000;">"   Blue"</span>, <span style="color: #ff0000;">"   Rosso"</span>, <span style="color: #ff0000;">"   Yellow"</span>, <span style="color: #ff0000;">"   Green"</span>, <span style="color: #ff0000;">"   Red"</span> <span style="color: #000000;">&#125;</span> ;<br /><span style="color: #0000ff;">BITMAPS</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Bmp_sWhite"</span>, <span style="color: #ff0000;">"Bmp_sBlue"</span>, <span style="color: #ff0000;">"Bmp_sRosso"</span>, <span style="color: #ff0000;">"Bmp_sYellow"</span>, <span style="color: #ff0000;">"Bmp_sGreen"</span>, <span style="color: #ff0000;">"Bmp_sRed"</span> <span style="color: #000000;">&#125;</span><br />oCbx2:<span style="color: #000000;">nItemHeight</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">22</span> <span style="color: #000000;">&#41;</span>                <br /> </div>[/code:3nof5l58] There is not any bitmaps in combobox. Any Solution? Thanks.
Comboboxes with Wbrowse of Hernán
Hi to Everybody, Thanks for your help, because of it, I am working with Wbrowse of Hernán and with comboboxes in cells <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> , But they don´t look very well <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> . [url=http&#58;//img432&#46;imageshack&#46;us/my&#46;php?image=defectoqy8&#46;png:393q5kgb][img:393q5kgb]http&#58;//img432&#46;imageshack&#46;us/img432/5793/defectoqy8&#46;th&#46;png[/img:393q5kgb][/url:393q5kgb] Does somebody repair this unperfection? If somebody has a solution, please, I will apreciate it <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> . Thanks
Comboboxes with Wbrowse of Hernán
there was an old class to use with twbrowse : I must found it on my cds wait...
Comboboxes with Wbrowse of Hernán
[quote="jose_murugosa":nzw5pm3w]Hi to Everybody, Does somebody repair this unperfection? If somebody has a solution, please, I will apreciate it <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> . [/quote:nzw5pm3w] Hi Jose ! The solution is in twbrowse.prg . Please , search methods EditCols and etc. . You will find something similar as in below : [code:nzw5pm3w] case aItems != nil @ aPos&#91; 1 &#93; + 1, aPos&#91; 2 &#93; + 1 COMBOBOX &#58;&#58;oGet VAR uVar ITEMS aItems ; SIZE nWidth, Max&#40; 200, Len&#40; aItems &#41; * 25 &#41; OF Self ; FONT oFont COLOR nClrFore, nClrBack ; ON CHANGE &#58;&#58;End&#40;&#41; ; PIXEL [/code:nzw5pm3w] In this place you can change parameters of combobox view height and width . Hope this help to you . Regards !
Comboboxes with Wbrowse of Hernán
Rimantas, I already tried to change height and width in both comboboxes (for arrays and for logical vars) without good results, If you resolve this problem could you please send me a copy of your wbrowse.prg so I can see how you did this changes. My e-mail is <!-- e --><a href="mailto:jmurugosa@hotmail.com">jmurugosa@hotmail.com</a><!-- e --> Thanks for your post, and your help. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Combometro
Hello Antonio, is it possible to have Combometro with style DropDown. That user can either enter a text or just select an item from the list. Thank in advance Otto
Combometro
Yes.
Combometro
Dear Mr. rao, would you be so kind to post an example. Thanks in advance Otto