topic
stringlengths
1
63
text
stringlengths
1
577k
ComboBox Refresh
Gilbert: oCombo:SetItems(aItems) oCombo:Refresh() If necessary: oCombo:Reset() Regards, [quote="Gilbert Vaillancourt":2rljo3g7]Hi All, How can I refresh the display and list of a combobox once it`s content has changed ? <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Regards, Gilbert[/quote:2rljo3g7]
ComboBox Refresh
Hi Sorry for my english <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> REDEFINE COMBOBOX oCmbX VAR cVarX ID 119 OF oFold:aDialogs[1] ITEMS aDtsX In a new array you put the new values, then write this : oCmbX:SetItems( aNewArr ) oCmbX:Refresh() and that's it !!! It works for me.
ComboBox Refresh
Hi, Thanks Guys <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Regards, Gilbert [/u]
ComboBox con get y añadir lo del get al array del combo
Pues eso, a ver si me explico. Deseo poner algo parecido al combobox pero con posibilidad de poder "teclear" lo que se quiera en un get que este "encima" de este combo. Así cada vez que se teclee algo al dar al <intro> pase a aumentar el array del combo para posterior selección. A la vez si deseamos volver a algo tecleado anteriormente solo dar a la flecha del combo y recorrerlo en busca de lo deseado y al seleccionar lo que se "ponga" en ese get para poder modificarlo o dejarlo igual o lo que sea. No se si me he explicado.
ComboBox con get y añadir lo del get al array del combo
JmGarcia, prueba con esto.... en teoria debería funcionar: Define dialog redefine combobox ocombobox var ccombo... on change(cambiarget()) redefine get oget var cget .... valid (newitem(cget)) .... activate dialog... Funct newitem(cget) local aItems:=ocombobox:aItems if empty(cget) return .f. endif AAdd(aItems,cget) Asort(aItems) ocombobox:setItems(aItems) ocombobox:refresh() return .t. funct cambiarget cget=ccombo oget:refresh() return __________ Un saludo. LORENZO
ComboBox con get y añadir lo del get al array del combo
Loren, tengo un problema: Como "junto" el get y el combo en el mismo espacio fisico. Con el mismo numero de ID de recurso no va. Montando un recurso encima de otro tengo que tabular para cambiar de get/combo combo/get. Ademas esta sentencia [b:1iqg0l8n]ocombobox:setItems(aItems)[/b:1iqg0l8n] me da este erroe: [b:1iqg0l8n]Error BASE/1132 Bound error: array access[/b:1iqg0l8n]
ComboBox con get y añadir lo del get al array del combo
Hola JMGarcia: No se si es lo que estás buscando pero yo lo hago de esta manera y da resultado. Tengo una DBF con los conceptos que cargo en un array aConceptos y que muestro con un Combobox así: REDEFINE COMBOBOX oConcepto VAR cConcepto ITEMS aConceptos ID 202 OF oDlg Puedo elegir alguno de los registros existentes o teclear uno nuevo en el mismo combo. Después, al cerrar el diálogo, si he tecleado uno nuevo, pregunto si se desea añadir el nuevo texto al fichero de conceptos. Si es así, la próxima vez que despliegues el combo está disponible el nuevo concepto añadido. // IF ASCAN(aConceptos, cConcepto) = 0 IF MsgYesNo("El Concepto: "+"´"+alltrim(cConcepto)+"´"+" no está en el fichero datos de conceptos. ¿Quiere añadirlo ahora?","Seleccione una opción" ) // AADD(aConceptos, cConcepto) ASORT(aConceptos) // IF CONCEPTO->(!RecLock(5)) ELSE CONCEPTO->(DbAppend()) CONCEPTO->Concepto = cConcepto CONCEPTO->(DbRunLock()) CONCEPTO->(DbCommit()) ENDIF // ENDIF // ENDIF Saludos, Manuel
ComboBox con get y añadir lo del get al array del combo
[quote="JmGarcia":29gdww7n]Así cada vez que se teclee algo al dar al <intro> pase a aumentar el array del combo para posterior selección[/quote:29gdww7n]Eso es una propiedad ya definida en TComboBox (Estilo CB_DROPDOWN), revisa \FWH\Samples\Combos.prg. En el segundo ejemplo teclea "Dos" y verás que al salir de ese Combo, el array ha cambiado. Saludos Manuel Mercado
ComboBox con get y añadir lo del get al array del combo
A ver si con este grafico me explico: [img:2hjyp6vm]http&#58;//www&#46;jmgarcia&#46;org/GetCombobox&#46;jpg[/img:2hjyp6vm]
ComboBox con get y añadir lo del get al array del combo
[quote="mmercado":34w5qh4o]Eso es una propiedad ya definida en TComboBox (Estilo CB_DROPDOWN), revisa \FWH\Samples\Combos.prg...[/quote:34w5qh4o]He revisado el ejemplo PRG y el RC, creo que ya lo tengo. Ahora solo me falta que al pulsar <INTRO> o un BOTON pueda saltar a una funcion definida por mi. La clausula ON CHANGE no me vale ya que al seleccionar un item del combobox sale por ahi y puede que no haya terminado de rellenar el campo. Imaginate que el item es "format" y depues de seleccionarlo deseo añadir en el get "c:/Q" y pulsar <INTRO> o BOTON (con el nombre, por ejemplo "Ejecutar") y saltar a una funcion pasandole de parametro "format c:/Q". Por otro lado, y dentro del get, me gustaria que pulsando flecha arriba/abajo en el get me apareciesen los textos de los items del array del combobox. Flecha arriba el primero y sucesivos, flecha abajo retroceder en la posicion. Ademas el tema del SCROLL-VERTICAL no logro que me salga.
ComboBox con get y añadir lo del get al array del combo
Me contesto yo mismo: [quote="JmGarcia":3w501656]Ahora solo me falta que al pulsar <INTRO> o un BOTON pueda saltar a una funcion definida por mi.[/quote:3w501656]Con esto esta hecho [b:3w501656]oCombo:bKeyDown:={|nK|iif(nK==VK_RETURN,MiFuncion(),)}[/b:3w501656] [quote="JmGarcia":3w501656]Por otro lado, y dentro del get, me gustaria que pulsando flecha arriba/abajo en el get me apareciesen los textos de los items del array del combobox. Flecha arriba el primero y sucesivos, flecha abajo retroceder en la posicion.[/quote:3w501656]Pues lo hace solito en Combobox. Solo me queda el tema del SCROLL-VERTICAL, no logro que me salga.
ComboBox con get y añadir lo del get al array del combo
[quote="JmGarcia":j4li1rmk] La clausula ON CHANGE no me vale ya que al seleccionar un item del combobox sale por ahi y puede que no haya terminado de rellenar el campo[/quote:j4li1rmk] Podrías agregar lo siguiente: [code:j4li1rmk]#define MAX_GET_LEN 10 oCbx&#58;oGet&#58;bChange &#58;= &#123; || AutoComplete&#40; oCbx, MAX_GET_LEN &#41; &#125; //----------------------------------------------------------------------------// Static Function AutoComplete&#40; oCbx, nLen &#41; LOCAL cBuffer, nEle, ; nPos &#58;= oCbx&#58;oGet&#58;nPos If oCbx == Nil Return Nil EndIf Default nLen &#58;= 10 cBuffer &#58;= SubStr&#40; oCbx&#58;oGet&#58;oGet&#58;Buffer, 1, nPos - 1 &#41; IF &#40; nEle &#58;= ASCAN&#40; oCbx&#58;aItems, &#123;|e| Upper&#40; e &#41; = Upper&#40; cBuffer &#41; &#125; &#41; &#41; > 0 oCbx&#58;oGet&#58;oGet&#58;Buffer &#58;= PadR&#40; oCbx&#58;aItems&#91; nEle &#93;, nLen &#41; oCbx&#58;oGet&#58;Assign&#40;&#41; oCbx&#58;oGet&#58;Refresh&#40;&#41; oCbx&#58;oGet&#58;SetPos&#40; nPos &#41; Else oCbx&#58;oGet&#58;oGet&#58;Buffer &#58;= PadR&#40; cBuffer, nLen &#41; oCbx&#58;oGet&#58;Assign&#40;&#41; oCbx&#58;oGet&#58;Refresh&#40;&#41; oCbx&#58;oGet&#58;SetPos&#40; nPos &#41; END Return Nil //----------------------------------------------------------------------------// Static Function cProper&#40; cText &#41; Return Upper&#40; SubStr&#40; cText, 1, 1 &#41; &#41; + Lower&#40; SubStr&#40; cText, 2 &#41; &#41; [/code:j4li1rmk] Saludos Manuel Mercado
ComboBox con get y añadir lo del get al array del combo
[quote="mmercado":2nr9rp4c][code:2nr9rp4c]cBuffer &#58;= SubStr&#40; oCbx&#58;oGet&#58;oGet&#58;Buffer, 1, nPos - 1 &#41;[/code:2nr9rp4c][/quote:2nr9rp4c] Me da este error [b:2nr9rp4c]Error BASE/1110 Argument error: SUBSTR[/b:2nr9rp4c] en la linea del SubStr... Por otro lado: como funciona esta subrrutina. Puedo entender que según vas tecleando se puede llegar a completar el texto si algun item del array del combo comienza igual...
ComboBox con get y añadir lo del get al array del combo
[quote="JmGarcia":2etbse8x]Por otro lado: como funciona esta subrrutina. Puedo entender que según vas tecleando se puede llegar a completar el texto si algun item del array del combo comienza igual...[/quote:2etbse8x] Tomando el mismo ejemplo de FWH Samples:[code:2etbse8x]// Showing the use of different styles of ComboBoxes controls #include "FiveWin&#46;ch" #include "Combos&#46;ch" #define GET_MAX_LEN 10 //----------------------------------------------------------------------------// function Main&#40;&#41; local oDlg, oSay local oCbx1, oCbx2, oCbx3 local cItem1, cItem2 &#58;= "One", cItem3, cItem4 &#58;= "None" SET _3DLOOK ON SetDebug&#40;&#41; DEFINE DIALOG oDlg RESOURCE "Combos" REDEFINE COMBOBOX oCbx1 VAR cItem1 ITEMS &#123; "One", "Two", "Three" &#125; ; ID ID_SIMPLE OF oDlg ; ON CHANGE &#40; cItem4 &#58;= cItem1, oSay&#58;Refresh&#40;&#41; &#41; ; VALID &#40; cItem4 &#58;= cItem1, oSay&#58;Refresh&#40;&#41;, &#46;t&#46; &#41; REDEFINE COMBOBOX oCbx2 VAR cItem2 ITEMS &#123; "One", "Two", "Three" &#125; ; ID ID_DROPDOWN OF oDlg ; STYLE CBS_DROPDOWN ; VALID &#40; If&#40; ! oCbx2&#58;Find&#40; oCbx2&#58;oGet&#58;GetText&#40;&#41; &#41;, oCbx2&#58;Add&#40; cProper&#40; oCbx2&#58;oGet&#58;GetText&#40;&#41; &#41; &#41;,&#41;, &#46;t&#46; &#41; oCbx2&#58;oGet&#58;bChange &#58;= &#123;|| AutoComplete&#40; oCbx2, GET_MAX_LEN &#41;&#125; REDEFINE COMBOBOX oCbx3 VAR cItem3 ITEMS &#123; "One", "Two", "Three" &#125; ; ID ID_DROPDOWNLIST OF oDlg ; ON CHANGE &#40; cItem4 &#58;= cItem3, oSay&#58;Refresh&#40;&#41; &#41; ; VALID &#40; cItem4 &#58;= cItem3, oSay&#58;Refresh&#40;&#41;, &#46;t&#46; &#41; REDEFINE SAY oSay PROMPT cItem4 ID ID_SELECTION OF oDlg COLOR "R+/W" ACTIVATE DIALOG oDlg CENTERED return nil //----------------------------------------------------------------------------// Static Function AutoComplete&#40; oCbx, nLen &#41; LOCAL cBuffer, nEle, ; nPos &#58;= oCbx&#58;oGet&#58;nPos If oCbx == Nil Return Nil EndIf Default nLen &#58;= 10 cBuffer &#58;= SubStr&#40; oCbx&#58;oGet&#58;oGet&#58;Buffer, 1, nPos - 1 &#41; fDebug&#40; cBuffer &#41; IF &#40; nEle &#58;= ASCAN&#40; oCbx&#58;aItems, &#123;|e| Upper&#40; e &#41; = Upper&#40; cBuffer &#41; &#125; &#41; &#41; > 0 oCbx&#58;oGet&#58;oGet&#58;Buffer &#58;= PadR&#40; oCbx&#58;aItems&#91; nEle &#93;, nLen &#41; oCbx&#58;oGet&#58;Assign&#40;&#41; oCbx&#58;oGet&#58;Refresh&#40;&#41; oCbx&#58;oGet&#58;SetPos&#40; nPos &#41; Else oCbx&#58;oGet&#58;oGet&#58;Buffer &#58;= PadR&#40; cBuffer, nLen &#41; oCbx&#58;oGet&#58;Assign&#40;&#41; oCbx&#58;oGet&#58;Refresh&#40;&#41; oCbx&#58;oGet&#58;SetPos&#40; nPos &#41; END Return Nil //----------------------------------------------------------------------------// Static Function cProper&#40; cText &#41; Return Upper&#40; SubStr&#40; cText, 1, 1 &#41; &#41; + Lower&#40; SubStr&#40; cText, 2 &#41; &#41; [/code:2etbse8x] Usa el segundo combobox, escribe t y luego h o escribe lo que quieras para agregar un nuevo item Saludos Manuel Mercado
ComboBox con get y añadir lo del get al array del combo
Manuel, Que son las funciones SetDebug() y fDebug()
ComboBox con get y añadir lo del get al array del combo
[quote="Manuel Valdenebro":jczzt9qz]Manuel, Que son las funciones SetDebug() y fDebug()[/quote:jczzt9qz]A mi no me las encuentra: [color=blue:jczzt9qz]Error: Unresolved external '_HB_FUN_SETDEBUG' referenced from E:\COMBOS_AUTOCOMPLETE.OBJ Error: Unresolved external '_HB_FUN_FDEBUG' referenced from E:\COMBOS_AUTOCOMPLETE.OBJ[/color:jczzt9qz] Las he comentado en el código y funciona. Supongo que son el DEBUG. [quote="mmercado":jczzt9qz]Tomando el mismo ejemplo de FWH Samples[/quote:jczzt9qz]Pues si funciona, vere de adaptarlo a mi codigo. Muchas gracias Manuel.
ComboBox con get y añadir lo del get al array del combo
Hola Manuel: [quote="Manuel Valdenebro":t9o7rofs]Que son las funciones SetDebug() y fDebug()[/quote:t9o7rofs] Es un debugger rústico casero que utilizo en mis desarrollos para testear valores de variables y detectar puntos de error, es muy elemental pero me ha sido de una gran utilidad. El programa Debug.prg lo puedes encontrar en \TSBrowse\Samples. Saludos Manuel Mercado
ComboBox con get y añadir lo del get al array del combo
[quote="JmGarcia":3c59dm7b][quote="mmercado":3c59dm7b]Tomando el mismo ejemplo de FWH Samples[/quote:3c59dm7b]Pues si funciona, vere de adaptarlo a mi codigo. Muchas gracias Manuel.[/quote:3c59dm7b]Pues sigo si poder adaptarlo, pondré el código fuente cuando lo tenga ya terminado. Por otro lado, NO consigo que el campo GET del Combobox se desplace horizontalmente a la izquierda cuando llego escribiendo al final de la derecha.[code:3c59dm7b]@ 10,100 COMBOBOX oCombo VAR cCombo ITEMS aCombo SIZE 650,200 OF oWnd ; STYLE CBS_DROPDOWN PIXEL FONT oFont ; VALID &#40;iif&#40;&#46;not&#46; oCombo&#58;Find&#40;oCombo&#58;oGet&#58;GetText&#40;&#41;&#41;,; oCombo&#58;Insert&#40;left&#40;alltrim&#40;oCombo&#58;oGet&#58;GetText&#40;&#41;&#41;+space&#40;MAX_PATH&#41;,MAX_PATH&#41;,1&#41;,&#41;,&#46;T&#46;&#41; oCombo&#58;bKeyDown&#58;=&#123;|nK|iif&#40;nK==VK_RETURN,EnviaComando&#40;alltrim&#40;oCombo&#58;oGet&#58;GetText&#40;&#41;&#41;,aSeleccion&#41;,nil&#41;&#125; [/code:3c59dm7b]
ComboBox en TSBrowse
Amigos del foro: Buen inicio de semana, estoy usando la clase TSbrowse 7.01 de Manual Mercado y modificada por José Murugosa. Cuando en una columna uso un ComboBox me tira un error al salir de dicha celda. Path and name: C:\Metalona\SiaWin.Exe (32 bits) Size: 747,520 bytes Time from start: 0 hours 0 mins 18 secs Error occurred at: 10/12/2006, 22:00:05 Error description: Error BASE/1111 Argument error: LEN Args: [ 1] = U Stack Calls =========== Called from: => LEN(0) Called from: TSBROWSE.PRG => TSBROWSE:EDITEXIT(2962) Called from: TSBROWSE.PRG => (b)TSBROWSE:LEDITCOL(4955) Called from: TSCOMBO.PRG => TSCOMBO:KEYDOWN(68) Called from: WINDOW.PRG => TWINDOW:HANDLEEVENT(0) Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0) Called from: COMBOBOX.PRG => TCOMBOBOX:HANDLEEVENT(0) Called from: TSCOMBO.PRG => TSCOMBO:HANDLEEVENT(56) Called from: WINDOW.PRG => _FWH(0) Called from: => WINRUN(0) Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0) Called from: siawin.prg => MAIN(176) System ====== CPU type: Intel(R) Pentium(R) 4 CPU 3.00GHz 3000 Mhz Hardware memory: 503 megs Free System resources: 90 % GDI resources: 90 % User resources: 90 % Compiler version: xHarbour build 0.99.61 Intl. (SimpLex) Windows version: 5.1, Build 2600 Service Pack 2 La misma aplicación en 16 bits funciona muy bien. Algo estoy haciendo mal ? Saludos, Armando
ComboBox en xBrowse
Hola gente! Tengo el siguiente código [code=fw:1765r27s]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> ::<span style="color: #000000;">oBrwTkt</span> <span style="color: #0000ff;">ID</span> BRW_XBRW <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">hFont</span><span style="color: #000000;">&#91;</span><span style="color: #ff0000;">"Tahoma16"</span><span style="color: #000000;">&#93;</span> ;<br />            COLUMNS   _Patente, _Tipo,  _Tiempo,   _Canti, _Precio ;<br />            COLSIZES  <span style="color: #000000;">98</span>,       <span style="color: #000000;">100</span>,    <span style="color: #000000;">70</span>,        <span style="color: #000000;">50</span>,     <span style="color: #000000;">76</span> ;<br />            HEADERS  <span style="color: #ff0000;">"Patente"</span>, <span style="color: #ff0000;">"Tipo"</span>, <span style="color: #ff0000;">"Tiempo"</span>, <span style="color: #ff0000;">"Cant."</span>, <span style="color: #ff0000;">"Precio"</span> ;<br />            ARRAY    ::<span style="color: #000000;">aTickets</span> FASTEDIT<br /><br />   WITH OBJECT ::<span style="color: #000000;">oBrwTkt</span>:<span style="color: #000000;">Tiempo</span><br />      :<span style="color: #000000;">nEditType</span>   := EDIT_LISTBOX<br />      :<span style="color: #000000;">aEditListTxt</span>:= ::<span style="color: #000000;">aTimeTipo</span><br />      :<span style="color: #000000;">aEditListBound</span>:= <span style="color: #000000;">&#123;</span> _HORA, _DIAS, _SEMANA, _MES <span style="color: #000000;">&#125;</span>   <span style="color: #B900B9;">// {1, 2, 3, 4 }</span><br />   END<br /> </div>[/code:1765r27s] Esto se ve así: [img:1765r27s]http&#58;//i795&#46;photobucket&#46;com/albums/yy237/MLimonG/Combo-xBrw&#46;png[/img:1765r27s] La pregunta es: Como hago para que se vea un item, del combobox, que deseo poner por default gracias!!
ComboBox en xBrowse
Hola Mario: Deberias llenar aTickets en la columna 3 el valor por defecto que queres ponerle (1 a 4)
ComboBox en xBrowse
Nooooo... <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Tan sencillo como eso!... bueno sencillo despues que lo sabes <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> muchas gracias CM
ComboBox en xBrowse
Amigos foreros: Algún ejemplo de un ComboBox en xBrowse? Gracias
ComboBox en xBrowse
Armando buenos días, como estas? Fragmento de codigo testxbrw.prg [code=fw:276ixy3u]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ArrayEdit<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oChild, oBrw, oCol, n<br />   <span style="color: #00C800;">local</span> aStruc<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oChild <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF structrure with edition & no scroll bars"</span> <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">OF</span> oWnd<br /><br /><br />   aStruc := DBStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   Aeval<span style="color: #000000;">&#40;</span> aStruc, <span style="color: #000000;">&#123;</span>|v| v<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := Padr<span style="color: #000000;">&#40;</span> v<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">/*<br />   oBrw := TXBrowse():New( oWnd )<br /><br />   oBrw:SetArray( aStruc)<br /><br />   oBrw:nColDividerStyle := LINESTYLE_BLACK<br />   oBrw:nRowDividerStyle := LINESTYLE_BLACK<br /><br />   oBrw:aCols[1]:cHeader      := Padr("NAME", 15)<br />   oBrw:aCols[1]:cEditPicture := "@K !!!!!!!!!!"<br />   oBrw:aCols[1]:bClrEdit     := oBrw:bClrStd<br />   oBrw:aCols[1]:bOnPostEdit  := {|o,x| aStruc[ oBrw:nArrayAt, 1 ] := x }<br />   oBrw:aCols[1]:nEditType    := EDIT_GET<br /><br />   oBrw:aCols[2]:cHeader        := "TYPE"<br />   oBrw:aCols[2]:nDataStrAlign  := AL_CENTER<br />   oBrw:aCols[2]:nHeadStrAlign  := AL_CENTER<br />   oBrw:aCols[2]:nEditType      := EDIT_GET_LISTBOX<br />   oBrw:aCols[2]:aEditListTxt   := {"C", "N", "D", "L", "M"}<br />   oBrw:aCols[2]:bOnPostEdit    := {|o,x| aStruc[ oBrw:nArrayAt, 2 ] := x }<br />   oBrw:aCols[2]:aEditListBound := {"C", "N", "D", "L", "M"}<br />   oBrw:aCols[2]:bClrEdit       := oBrw:bClrStd<br /><br />   oBrw:aCols[3]:cHeader       := "SIZE"<br />   oBrw:aCols[3]:nDataStrAlign := AL_RIGHT<br />   oBrw:aCols[3]:nHeadStrAlign := AL_RIGHT<br />   oBrw:aCols[3]:nEditType     := EDIT_GET_BUTTON<br />   oBrw:aCols[3]:bOnPostEdit   := {|o,x| aStruc[ oBrw:nArrayAt, 3 ] := x }<br />   oBrw:aCols[3]:bEditBlock    := {|| Msginfo("Your code goes here ...", "TXBrowse power" ) }<br /><br />   oBrw:aCols[4]:cHeader       := "LENGTH"<br />   oBrw:aCols[4]:nDataStrAlign := AL_RIGHT<br />   oBrw:aCols[4]:nHeadStrAlign := AL_RIGHT<br />   oBrw:aCols[4]:bOnPostEdit  := {|o,x| aStruc[ oBrw:nArrayAt, 4 ] := x }<br />   oBrw:aCols[4]:nEditType    := EDIT_GET<br /><br />*/</span><br /><br />   @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oChild ;<br />      HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span>, <span style="color: #ff0000;">"Ext"</span> ;<br />      JUSTIFY .F., AL_CENTER, .T., .T., .T. ;<br />      COLSIZES <span style="color: #000000;">80</span>,<span style="color: #000000;">60</span> ;<br />      ARRAY aStruc <span style="color: #0000ff;">AUTOCOLS</span><br /><br />   <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />      oCol  := oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><br />      <span style="color: #00C800;">if</span> n == <span style="color: #000000;">2</span><br />         oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET_LISTBOX<br />         oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aEditListTxt</span>   := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Charcter"</span>, <span style="color: #ff0000;">"Numeric"</span>, <span style="color: #ff0000;">"Date"</span>, <span style="color: #ff0000;">"Logical"</span>, <span style="color: #ff0000;">"Memo"</span><span style="color: #000000;">&#125;</span><br />         oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aEditListBound</span> := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"C"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #ff0000;">"D"</span>, <span style="color: #ff0000;">"L"</span>, <span style="color: #ff0000;">"M"</span><span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">else</span><br />         oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br />      <span style="color: #00C800;">endif</span><br />      oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">&#123;</span> |o,x,n| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> n != VK_ESCAPE, oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span>o:<span style="color: #000000;">nArrayCol</span><span style="color: #000000;">&#93;</span> := x, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">next</span><br /><br /><br />   oBrw:<span style="color: #000000;">nMarqueeStyle</span>   := MARQSTYLE_HIGHLCELL<br /><br />   oBrw:<span style="color: #000000;">lHScroll</span> := .f.<br />   oBrw:<span style="color: #000000;">lVScroll</span> := .f.<br />   oBrw:<span style="color: #000000;">lFastEdit</span>:= .t.<br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   oChild:<span style="color: #000000;">oClient</span> := oBrw<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oChild <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</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><br /> </div>[/code:276ixy3u]
ComboBox en xBrowse
Leandro: Muchas gracias. Por cierto ¿Cómo sigue tu tío?, espero que mucho mejor. Saludos
ComboBox en xBrowse
De nada amigo Gracias a Dios, muy bien, ya esta otra vez retomando la programación. Muchas gracias por preguntar.
ComboBox en xBrowse
Leandro: Excelente noticia saludos de mi parte
ComboBox inside Txbrowse
I need to edit a field in txbrowse with an array of DBF field values. How can I implement combobox inside Txbrowse?
ComboBox inside Txbrowse
I am sorry I do not undestand Spanish but if I converted fixed arrays into the program to field of database I have error messages : Error description: Error BASE/1068 Argument error: array access [code:23wblisb] #INCLUDE "FIVEWIN&#46;CH" procedure main&#40;&#41; LOCAL oWnd, oBrw, aDatos //MsgInfo&#40; "Hola Mundo" &#41; DEFINE WINDOW oWnd *aDatos &#58;= &#123; &#123; "uno ", "dos ", "tres ", "cuatro", "cinco " &#125;,; * &#123; "Seis ", "Siete ", "Ocho ", "Nueve ", "Diez " &#125; &#125; aDatos &#58;=creatarray&#40;&#41; WITH OBJECT &#40; oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oWnd &#41; &#41; &#58;SetArray&#40; aDatos &#41; WITH OBJECT &#58;aCols&#91;01&#93; &#58;cHeader &#58;= "Col1" &#58;nEditType &#58;= 01 &#58;bOnPostEdit &#58;= &#123; |oCol| aDatos&#91; oBrw&#58;nArrayAt &#93;&#91;01&#93; &#58;= oCol&#58;oEditGet&#58;cText &#125; END WITH OBJECT &#58;aCols&#91;02&#93; &#58;cHeader &#58;= "Col2" &#58;nEditType &#58;= 02 &#58;aEditListTxt &#58;= aDatos &#58;aEditListBound &#58;= &#58;aEditListTxt &#58;bOnPostEdit &#58;= &#123; |oCol,cOption| aDatos&#91; oBrw&#58;nArrayAt &#93;&#91;02&#93; &#58;= cOption &#125; END WITH OBJECT &#58;aCols&#91;03&#93; &#58;cHeader &#58;= "Col3" &#58;nEditType &#58;= 03 &#58;bOnPostEdit &#58;= &#123; || "" &#125; &#58;bEditBlock &#58;= &#123; || MsgInfo&#40; "Hola" &#41; &#125; END WITH OBJECT &#58;aCols&#91;04&#93; &#58;cHeader &#58;= "Col4" &#58;nEditType &#58;= 04 &#58;aEditListTxt &#58;= aDatos &#58;aEditListBound &#58;= &#58;aEditListTxt &#58;bOnPostEdit &#58;= &#123; |oCol,cOption| aDatos&#91; oBrw&#58;nArrayAt &#93;&#91;04&#93; &#58;= IF&#40; Len&#40; Alltrim&#40; cOption &#41; &#41; > 0, cOption, oCol&#58;oEditGet&#58;cText &#41; &#125; END WITH OBJECT &#58;aCols&#91;05&#93; &#58;cHeader &#58;= "Col5" &#58;nEditType &#58;= 05 &#58;bOnPostEdit &#58;= &#123; |oCol| aDatos&#91; oBrw&#58;nArrayAt &#93;&#91;05&#93; &#58;= oCol&#58;oEditGet&#58;cText &#125; &#58;bEditBlock &#58;= &#123; || MsgInfo&#40; "Hola" &#41; &#125; END &#58;CreateFromCode&#40;&#41; END oWnd&#58;oClient &#58;= oBrw Activate Window oWnd * TWINDOW&#40;&#41;&#58;ACTIVATE&#40; oWnd &#41; function creatarray&#40;&#41; local aData &#58;= &#123;&#125;,oDlg use mach mach->&#40;dbGotop&#40;&#41;&#41; do while !mach->&#40;eof&#40;&#41;&#41; aadd&#40; aData , mach->mc_serial &#41; mach->&#40;dbSkip&#40;&#41;&#41; enddo /* USE THIS ARRAY BY LISTBOX CLASS, you will get the names of mach from DBF */ return &#40;aData&#41; [/code:23wblisb]
ComboBox mas amcho que el definido....
hola a todos... me gustaria desplegar una lista desde el combobox, pero que fuera mas ancha que el espacio fisico en el cual pongo dicho combobox. Tengo una lista para desplegar y su ancho soporta por ejemplo 10 caracteres...pero me gustraria que desplegara una lista con mayor cantidad de caracteres, sin que estos queden bajo la barra de desplazamiento Agradecido de antemano.
ComboBox mas amcho que el definido....
la amigo no entiendo tu pregunta, uno modifica el ancho del combobox a como uno quiera, de todos modos te pongo un ejemplo de como yo los uso, espero te sirva SOCIEDADES={} AADD(SOCIEDADES,"COMPAÑIA ANONIMA ") AADD(SOCIEDADES,"RESPONSABILIDAD LIMITADA ") AADD(SOCIEDADES,"ASOCIACION ") AADD(SOCIEDADES,"COMANDITA ") AADD(SOCIEDADES,"FUNDACION ") AADD(SOCIEDADES,"CORPORACION ") AADD(SOCIEDADES,"COMUNIDAD ") AADD(SOCIEDADES,"SOCIEDAD ANONIMA ") AADD(SOCIEDADES,"SOCIEDAD COLECTIVA ") AADD(SOCIEDADES,"COOPERATIVA ") @ 175, 60 COMBOBOX OBOX VAR xTSOCIE ITEMS SOCIEDADES OF FICHA:ADIALOGS[1] size 100,100 PIXEL
ComboBox mas amcho que el definido....
Julio, Prueba con: #define CB_SETDROPPEDWIDTH 0x0160 oCombo:SendMsg( CB_SETDROPPEDWIDTH, nWidth )
ComboBox mas amcho que el definido....
Maestro : El parametro nWidth ... a que corresponderia ? Saludos
ComboBox mas amcho que el definido....
Al ancho que deseas darle en pixeles
ComboBox mas amcho que el definido....
y alguna funcion que comvierta caracteres en pixels ? o algun ejemplo que me lo demuestre ? gracias
ComboBox mas amcho que el definido....
no resulta.... la imagen queda recortada y el item mayor queda bajo el vscroll.... tengo la imagen ( en pequeño ) pero no se como adjuntarla gracias este es el codigo : [code:3a8skt1l] &#46;&#46;&#46; Local aTipos &#58;= &#123; "Producto Estándar",; "Producto Seriado/Activo Fijo",; "Producto Multipropósito",; "Servicios",; "Productos Genéricos",; "Productos Crías de Genéricos" &#125; &#46;&#46;&#46; REDEFINE BTNGET oDescri VAR cDescri ID 91 Of oDlg &#91;b&#93; REDEFINE COMBOBOX oTipo VAR cTipo ITEMS aTipos ID 92 Of oDlg ; VALID &#40; If&#40; oTipo&#58;nAt<>0,; cTipoReal &#58;= aTipoReal&#91;oTipo&#58;nAt&#93;,; NIL &#41;,; &#46;T&#46; &#41; oTipo&#58;SendMsg&#40; CB_SETDROPPEDWIDTH, 280 &#41; &#91;/b&#93; REDEFINE BTNGET oFami VAR cFami ID 93 Of oDlg [/code:3a8skt1l] ( con el define que me indicaste en el top del PRG )
ComboBox mas amcho que el definido....
Julio, El mensaje tienes que enviarlo desde la claúsula ON INIT ya que antes el control no tiene un handle de ventana válido: ACTIVATE DIALOG oDlg ; ON INIT oTipo:SendMsg( CB_SETDROPPEDWIDTH, 280 )
ComboBox mas amcho que el definido....
Perfecto !!! Pero para terminarla, existira una funcion que convierta de caracteres a pixeles ? Mil gracias
ComboBox mas amcho que el definido....
GetTextWidth( 0, cTexto, oFont:hFont ) --> nPixels
ComboBox mas amcho que el definido....
Antonio, [quote="Antonio Linares":1yco6taa]GetTextWidth( 0, cTexto, oFont:hFont ) --> nPixels[/quote:1yco6taa] Viendo estas líneas, no sería posible crear una cláusula AUTOWIDTH para los SAY? Algo así como: "METHOD New( nRow, nCol, bText, oWnd, cPicture, oFont,; lCentered, lRight, lBorder, lPixels, nClrText, nClrBack,; nWidth, nHeight, lDesign, lUpdate, lShaded, lBox, lRaised, lAutoWidth ) CLASS TSay .../... if lAutoWidth ::nRight = ::nLeft + GetTextWidth( 0, ::cCaption, ::oFont:hFont ) - 1 EndIf if ::lDrag ::CheckDots() endif return Self" Saludos Carlos G.
ComboBox search problem
Hello Antonio,My comboboxes do not search.I have a problem with combobox and I don’t know what’s wrong.The combobox is defined as DROPDOWN(DROPDOWNLIST works ok).I watched with Spy but I can’t find where the error could be.Thanks in advanceOtto[img:1bw3rxfx]http&#58;//www&#46;atzwanger&#46;com/fw/combo1&#46;jpg[/img:1bw3rxfx][img:1bw3rxfx]http&#58;//www&#46;atzwanger&#46;com/fw/combo2&#46;jpg[/img:1bw3rxfx][img:1bw3rxfx]http&#58;//www&#46;atzwanger&#46;com/fw/combo3&#46;jpg[/img:1bw3rxfx]
ComboBox search problem
Otto,>The combobox is defined as DROPDOWN This style is for data entry of a new item that is not in the list. I don't know that the incremental search ever worked with this style. I haven't thought about it, but if the user is entering a new item, then maybe the incremental search isn't useful.I am confused since in your private email you said that an older version did work. What version was this? Was it using the incremental search or just a single character jump to the first match?James
ComboBox search problem
Hello James,thank you for your answer.In FW this combobox (DROPDOWN) works you can search and you can insert new data.In my mail I mixed up Dropdown and DropdownList. Only list works.I had a look into WINDOW-class.DROPDOWNLIST = a TCOMBOBOX and DROPDOWN’s ClassName is TGetMETHOD KeyDown( nKey, nFlags ) CLASS TWindow local bKeyAction := SetKey( nKey ) msginfo(str(nKey) +" keydown " +str(nFlags)+" "+Upper( ::ClassName() ) ) if Upper( ::ClassName() ) != "TGET" .and. ::bKeyDown != nil return Eval( ::bKeyDown, nKey, nFlags ) endifFrom the 16 bit DLLCONTROL "", 1080, "COMBOBOX", CBS_DROPDOWN | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 64, 74, 288, 67FiveWIN codeREDEFINE COMBOBOX oCbxB VAR cComboB ITEMS aComboB ID 1080 OF oFld:aDialogs [ 1 ][img:ttbiyuot]http&#58;//www&#46;atzwanger&#46;com/fw/cb161&#46;jpg[/img:ttbiyuot][img:ttbiyuot]http&#58;//www&#46;atzwanger&#46;com/fw/cb162&#46;jpg[/img:ttbiyuot]
ComboBox search problem
Hello James,I think the KeyDown method in COMBOBOX class is missing.If you copy the code of the method KeyChar to a newMETHOD KeyDown( nKey, nFlags ) CLASS TComboBoxall is working.Do you think this could be a solution.Regards,Otto
ComboBox search problem
Otto,I still need to know the answers to my questions. Which version of FW was the Combobox working as you expected?How was it working? Was it just jumping to the first occurance of a single letter typed by the user? This was how the old Clipper version worked and earlier versions of FW's combobox. Sometime last year, someone modified TCombobox to do incremental searching (user keeps typing multiple characters and the first mach is found). I don't think the DROPDOWN style ever worked this way.Fixing it will not be a simple as you suggest. Multiple keys need to be handled including the backspace key. I'm not sure about the logic of this since a user might be able to backspace over an existing item--then what do we do, remove the item from the list, or leave it? There are probably more issues too.James
ComboBox search problem
Hello James,In my mail I mixed up Dropdown and DropdownList. Only list works. You are right that Dropdown didn't work.Regards,Otto
ComboBox search problem
Otto,>In my mail I mixed up Dropdown and DropdownList. Only list works. >You are right that Dropdown didn't work. Understood.But, I still need the answers to my above questions.If we are going to add (or fix) this feature, we need to come to an aggreement on how it should work. Since incremental searching is how the DROPDOWNLIST works now, it would seem that incremental searching should also be how DROPDOWN works. Possibly there should be a flag so both work the old way or both work the new way.And we also need to figure out how to handle backspacing and possible removal of data in the list by the user. I have never used this style so I don't know how it used to work. It seems complex since if the user adds or removes data, then the original data source has to be updated.James
ComboBox search problem
Hello James,I think it should be a kind of an auto complete function. I am uncertain to how exactly the search should work. But I am sure about that there should be one.Regards,Otto
ComboBox nHeight del get
Saludotes Ya habia expuesto al de esto, como puedo hacer para que mis combobox tengan la misma longitud de altura (nHeight) que mis gets, que los tengo a 12 pxls con una fuente arial de 12, los combos tambien la fuente es igual, pero la longitud de nHeight es +2 pxl que los gets, no uso recursos. ya verifique la clase combobox y usa un ::oGet:Redefine() para crear el obj, no veo forma de manipular el nHeight de combo. Gracias.
ComboBox nHeight del get
Creo recordar que ese tema ya se incluyó en la version de Fwh 15.07 <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=16&t=31201&start=0&hilit=combobox+height">viewtopic.php?f=16&t=31201&start=0&hilit=combobox+height</a><!-- l -->
ComboMetro - brush not released bug
Antonio or Nages, I have found an unreleased resource in the new comboMetro control. Touch.prg contains this line: @ nRow,120 COMBOMETRO cCountry ITEMS { "America", "Europe", "Asia", "Africa",; "Oceania" } OF oPanel PIXEL FONT oFontMed SIZE 200, 40 COLOR CLR_WHITE, RGB( 0x33, 0x66, 0xCC ) Apparently there is a brush in this control that is not released. From checkres.txt: 07/22/13 10:05:07: BRUSH,118493681,TCOMBOMETRO:SETCOLOR(2542)->TCOMBOMETRO:DEFAULT(164)->TCOMBOMETRO:NEW(103)->PLACECONTROLS(180)->(b)ADDCOMPANY(99)->TDIALOG:INITIATE(682)->TDIALOG:HANDLEEVENT(872)->DIALOGBOXINDIRECT(0)->TDIALOG:ACTIVATE(270)->ADDCOMPANY(99) Note that I am using a section of Touch.prg that has been also modified, so the line numbers in the above will be way off. FWH Ver 13.04. Perhaps this has already been fixed? Regards, James
ComboMetro - brush not released bug
Mr James We shall look into this. I think this problem exists with combobox also. Thanks for pointing out and we shall try to fix this asap.
ComboMetro painting
ComboMetro paints 1 pixel more than a get field Thanks in advance Otto [img:2ib4dyuh]http&#58;//www&#46;atzwanger-software&#46;com/fh/metrocombobox&#46;jpg[/img:2ib4dyuh]
ComboWBlock en TSBrowse
New Function "ComboWBlock". Creates a View/Edit code block to edit a cell via a ComboBox control. Syntax: ComboWBlock( <oBrw>, <uField>, <nCol>, <aItems> ) Parameters (all required): <oBrw> = The TSBrowse object <uField> = Field Pos or Field Name (any) when editing databases. Whith arrays, <uField> will be the number of the array element. <nCol> = Column number in <oBrw> <aItems> = Array containing the items to be used by the ComboBox control Note: <aItems> can be a single array or a double array ( {aItems,aData} ), in this last case, TSBrowse will show "aItems" and will replace the data with the corresponding "aData" element. Obviously, both arrays must have the same number of elements. Example: aItems := { "Pieces", "Feet", "Gallons" } aData := { "PC", "FT", "GA" } nColum := 1 cField := "Unit" @ 0, 0 BROWSE oBrw CELLED ALIAS "Products".... ADD COLUMN TO oBrw Title "Units" COMBOBOX SIZE 80 PIXELS EDITABLE ; DATA ComboWBlock( oBrw, cField, nColum, { aItems, aData } ) ;
ComboWBlock en TSBrowse
Amigos: Uso ComboWBlock en la clase TSBrowse pero no logro hacer funcionar la búsqueda incremental <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> [code=fw:shfch67g]<div class="fw" id="{CB}" style="font-family: monospace;"><br />        oBrw:<span style="color: #000000;">SetData</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">6</span>, ComboWBlock<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #ff0000;">"Lugares"</span>, <span style="color: #000000;">6</span>, aNomCiu, <span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:shfch67g] Alguien que lo haya logrado y me quiera echar una mano (Que no sea al hombro <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> ) Saludos
ComboWBlock en TSBrowse
karinha Muchas gracias por tu interés, dime, es posible lograr la búsqueda incremental? en tu ejemplo no veo donde hacerla. Saludos
ComboWBlock en TSBrowse
Mira se ayuda: [url:27x1u75r]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?p=52039[/url:27x1u75r] [url:27x1u75r]http&#58;//fivetechsupport&#46;com/forums/viewtopic&#46;php?f=6&t=17587&start=0[/url:27x1u75r] [url:27x1u75r]http&#58;//sistemasies&#46;blogspot&#46;com&#46;br/2010/11/novos-metodos-do-tsbrowse&#46;html[/url:27x1u75r] [url:27x1u75r]http&#58;//fivewin&#46;com&#46;br/index&#46;php?/files/file/1001-Pesquisa-incremental-+-Busca-Cruzada(tabelada)/[/url:27x1u75r] Salu2
ComboWBlock in TSBrowse
Friends: I use ComboWBlock in class TSbrowse but I can't make the incremental search [code=fw:1ewei7hr]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw: <span style="color: #000000;">SetData</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">6</span> ComboWBlock <span style="color: #000000;">&#40;</span>oBrw, <span style="color: #ff0000;">"Places"</span>, <span style="color: #000000;">6</span>, aNomCiu <span style="color: #000000;">&#40;</span>.T<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">&#41;</span><br /> </div>[/code:1ewei7hr] Someone who has done it and want to share the solution regards
Combobox
Estimados; Tengo un comobox al que inicialmente, a su cVarCmb le asigno el valor "" Luego de seleccionar un valor de la lista y guardar el registro procedo a blanquear el Dlg, poniendo nuevamente, cVarCmb:= "", no obstante y luego de un oDLg:Update() el Combobox sigue mostrando sigue mostrando el último valor seleccionado. El redefine usado contiene la clausula UPDATE Como hago para que no muestre ningun item de la lista (el array tiene todos los campos definidos). Creo que esto ya se trató, pero no lo pude encontrar gracias
Combobox
Como tenes definido tu ComboBox? Enseñame parte de tu codigo Atentamente, Julio Ponce Suproye
Combobox
Julio; En un Dlg, tengo 3 combos alineados cuyos array son: [code=fw:3fzrorxp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">DATA</span>  aDias      AS ARRAY     <span style="color: #0000ff;">INIT</span>  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"01"</span>, <span style="color: #ff0000;">"02"</span>, <span style="color: #ff0000;">"03"</span>, <span style="color: #ff0000;">"04"</span>, <span style="color: #ff0000;">"05"</span>, ;<br />                                         <span style="color: #ff0000;">"06"</span>, <span style="color: #ff0000;">"07"</span>, <span style="color: #ff0000;">"08"</span>, <span style="color: #ff0000;">"09"</span>, <span style="color: #ff0000;">"10"</span>, ;<br />                                         <span style="color: #ff0000;">"11"</span>, <span style="color: #ff0000;">"12"</span>, <span style="color: #ff0000;">"13"</span>, <span style="color: #ff0000;">"14"</span>, <span style="color: #ff0000;">"15"</span>, ;<br />                                         <span style="color: #ff0000;">"16"</span>, <span style="color: #ff0000;">"17"</span>, <span style="color: #ff0000;">"18"</span>, <span style="color: #ff0000;">"19"</span>, <span style="color: #ff0000;">"20"</span>, ;<br />                                         <span style="color: #ff0000;">"21"</span>, <span style="color: #ff0000;">"22"</span>, <span style="color: #ff0000;">"23"</span>, <span style="color: #ff0000;">"24"</span>, <span style="color: #ff0000;">"25"</span>, ;<br />                                         <span style="color: #ff0000;">"26"</span>, <span style="color: #ff0000;">"27"</span>, <span style="color: #ff0000;">"28"</span>, <span style="color: #ff0000;">"29"</span>, <span style="color: #ff0000;">"30"</span>, <span style="color: #ff0000;">"31"</span> <span style="color: #000000;">&#125;</span>                   READONLY<br />   <span style="color: #00C800;">DATA</span>  aMeses     AS ARRAY     <span style="color: #0000ff;">INIT</span>  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Enero"</span>, <span style="color: #ff0000;">"Febrero"</span>, <span style="color: #ff0000;">"Marzo"</span>, <span style="color: #ff0000;">"Abril"</span>, ;<br />                                         <span style="color: #ff0000;">"Mayo"</span>, <span style="color: #ff0000;">"Junio"</span>, <span style="color: #ff0000;">"Julio"</span>, <span style="color: #ff0000;">"Agosto"</span>  , ;<br />                                         <span style="color: #ff0000;">"Septiembre"</span>, <span style="color: #ff0000;">"Octubre"</span>, <span style="color: #ff0000;">"Noviembre"</span>, <span style="color: #ff0000;">"Diciembre"</span> <span style="color: #000000;">&#125;</span>    READONLY<br />   <span style="color: #00C800;">DATA</span>  aAnios     AS ARRAY     <span style="color: #0000ff;">INIT</span>  Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">110</span> <span style="color: #000000;">&#41;</span><br /><br />...<br /><span style="color: #B900B9;">// Relleno el array Anios:</span><br />   <span style="color: #B900B9;">// Tabla aRray de Años</span><br />   nAnio:= <span style="color: #0000ff;">Year</span><span style="color: #000000;">&#40;</span> Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">-110</span><br />   <span style="color: #00C800;">for</span> each cAnio in ::<span style="color: #000000;">aAnios</span><br />      cAnio:= Str<span style="color: #000000;">&#40;</span> ++nAnio, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br /><br />...<br /><span style="color: #B900B9;">// En el metodo que muestra el Dlg, defino las locales</span><br />      cDia  := <span style="color: #ff0000;">""</span><br />      cMes  := <span style="color: #ff0000;">""</span><br />      cAnio := <span style="color: #ff0000;">""</span><br /><br /><span style="color: #B900B9;">// Mas adelante los muestro así:</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> aO<span style="color: #000000;">&#91;</span>_PCmb1<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> cDia  <span style="color: #0000ff;">ITEMS</span> ::<span style="color: #000000;">aDias</span>  <span style="color: #0000ff;">ID</span> <span style="color: #000000;">105</span> <span style="color: #0000ff;">OF</span> aO<span style="color: #000000;">&#91;</span>_PFld<span style="color: #000000;">&#93;</span>:<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;">UPDATE</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> aO<span style="color: #000000;">&#91;</span>_PCmb2<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> cMes  <span style="color: #0000ff;">ITEMS</span> ::<span style="color: #000000;">aMeses</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">106</span> <span style="color: #0000ff;">OF</span> aO<span style="color: #000000;">&#91;</span>_PFld<span style="color: #000000;">&#93;</span>:<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;">UPDATE</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> aO<span style="color: #000000;">&#91;</span>_PCmb3<span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> cAnio <span style="color: #0000ff;">ITEMS</span> ::<span style="color: #000000;">aAnios</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">107</span> <span style="color: #0000ff;">OF</span> aO<span style="color: #000000;">&#91;</span>_PFld<span style="color: #000000;">&#93;</span>:<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;">UPDATE</span><br />...<br /><span style="color: #B900B9;">// Mas adelante el Boton Guardar hace lo propio luego, para 'limpiar' los campos, de gets y en este caso combos, hago:</span><br />     cDia       := <span style="color: #ff0000;">""</span><br />     cMes       := <span style="color: #ff0000;">""</span><br />     cAnio      := <span style="color: #ff0000;">""</span><br />     oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:3fzrorxp] Todos los campos Get se limpian excepto los Combos, que muestran el último valor seleccionado. Obviamente si salgo del Dlg y vuelvo a entrar los Combos aparecen con el campo en blanco. Y esa sería la idea luego del oDlg:Update(), que queden en blanco para una nueva selección gracias por responder
Combobox
DATA aDias AS ARRAY INIT { "01", "02", "03", "04", "05", ; "06", "07", "08", "09", "10", ; "11", "12", "13", "14", "15", ; "16", "17", "18", "19", "20", ; "21", "22", "23", "24", "25", ; "26", "27", "28", "29", "30", "31" } READONLY DATA aMeses AS ARRAY INIT { "Enero", "Febrero", "Marzo", "Abril", ; "Mayo", "Junio", "Julio", "Agosto" , ; "Septiembre", "Octubre", "Noviembre", "Diciembre" } READONLY DATA aAnios AS ARRAY INIT Array( 110 ) ... // Relleno el array Anios: // Tabla aRray de Años nAnio:= Year( Date() ) -110 for each cAnio in ::aAnios cAnio:= Str( ++nAnio, 4 ) next ... // En el metodo que muestra el Dlg, defino las locales cDia := "" cMes := "" cAnio := "" // Mas adelante los muestro así: REDEFINE COMBOBOX aO[_PCmb1] VAR cDia ITEMS ::aDias ID 105 OF aO[_PFld]:aDialogs[1] UPDATE REDEFINE COMBOBOX aO[_PCmb2] VAR cMes ITEMS ::aMeses ID 106 OF aO[_PFld]:aDialogs[1] UPDATE REDEFINE COMBOBOX aO[_PCmb3] VAR cAnio ITEMS ::aAnios ID 107 OF aO[_PFld]:aDialogs[1] UPDATE ... // Mas adelante el Boton Guardar hace lo propio luego, para 'limpiar' los campos, de gets y en este caso combos, hago: cDia := "" cMes := "" cAnio := "" oDlg:Update() Mira yo tube casi el mismo problema pero yo lo que hago es lo siguiente aO[_PCmb1]:set(::aDias[1]) // esto lo que va hacer es que te va a regresar al registro 1 de la matriz adias Espero que te sirva Atentamente Julio Ponce
Combobox
Mario, porque no pruebas con agregar un elemento vacío a tus matrices de datos, te pongo como ejemplo en rojo en tus matrices de datos: DATA aDias AS ARRAY INIT {[color=#FF0040:3ic35vf7] [b:3ic35vf7]""[/b:3ic35vf7][/color:3ic35vf7], "01", "02", "03", "04", "05", ; "06", "07", "08", "09", "10", ; "11", "12", "13", "14", "15", ; "16", "17", "18", "19", "20", ; "21", "22", "23", "24", "25", ; "26", "27", "28", "29", "30", "31" } READONLY DATA aMeses AS ARRAY INIT {[b:3ic35vf7][color=#FF0040:3ic35vf7] ""[/color:3ic35vf7][/b:3ic35vf7], "Enero", "Febrero", "Marzo", "Abril", ; "Mayo", "Junio", "Julio", "Agosto" , ; "Septiembre", "Octubre", "Noviembre", "Diciembre" } READONLY DATA aAnios AS ARRAY INIT Array( [b:3ic35vf7][color=#FF0000:3ic35vf7]111[/color:3ic35vf7][/b:3ic35vf7] ) ... // Relleno el array Anios: // Tabla aRray de Años nAnio:= Year( Date() ) -110 for each cAnio in ::aAnios cAnio:= Str( ++nAnio, 4 ) next [color=#FF0040:3ic35vf7] [b:3ic35vf7]aAnios[111] := ""[/b:3ic35vf7][/color:3ic35vf7] ... No cuentas. Carlos Sincuir
Combobox
Carlos en lugar de andar buscando por el lado dificil, en general, hay que comenzar por buscar soluciones sencillas <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> muchas gracias
Combobox
Porque este exemplo abajo as opçoes do combobox não aparecem, não consigo usar combobox no fivepocket. #include "fwce.ch" #include "dll.ch" #define MB_ICONINFORMATION 0x40 static aBTypes:= {'Repce','Akác','Hárs','Gesztenye','Napraforgó','Selyemkóró','Facélia','Vegyes virág','Mézharmat','Egyéb'} function Main() // Main Window LOCAL oBmp Local oHONEYTYPES, cHONEYTYPES Local oHONEYTYPES_DD, cHONEYTYPES_DD Local oBEEKEEPER , cBEEKEEPER cBeeKeeper:="Click to me after set second combo" public oWnd DEFINE WINDOW oWnd TITLE "RFID_OMME" ACTIVATE WINDOW oWnd ON INIT TESTE() return nil static function teste() Local oHONEYTYPES, cHONEYTYPES Local oHONEYTYPES_DD, cHONEYTYPES_DD Local oBEEKEEPER , cBEEKEEPER Local oDlg DEFINE DIALOG oDlg RESOURCE "COMBOS" REDEFINE COMBOBOX OHONEYTYPES VAR CHONEYTYPES ITEMS aBTypes ID 4001 OF ODLG ACTIVATE DIALOG oDlg CENTERED return nil
Combobox
Marco, Try to increase the height of the combobox control in your RC file. Please post your RC here if posible. The section where you declare the combobox, thanks
Combobox
Antonio, O problema náo é altura, já testei isso, nenhum exemplo de combobox que eu testo inclusive do SAMPLES náo aparece as opções. Já testei vários exemplos e nenhum funciona no fivepocket.
Combobox
Marco, Please try FWPPC\samples\combos.prg. It should work fine, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Combobox
Também já testei Antônio, e mesma coisa, mas tudo bem. Gostaria de ver outra coisa agora, você teria algum exemplo de listbox com checkbox?
Combobox
Marco, La forma de hacerlo es usar un browse que muestre un bitmap de dos, uno para marcado y otro para no marcado. En el ejemplo FWPPC\samples\Tutor10.prg se muestra un bitmap en una columna del browse. Lo que has de hacer es tener dos bitmaps y mostrar el que corresponda: [code=fw:302i1bq8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">LISTBOX</span> oBrw ;<br />&nbsp; &nbsp; &nbsp; FIELDS <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Customer->Married, hBmp1, hBmp2 <span style="color: #000000;">&#41;</span>, Customer->Last, Customer->First ;<br />&nbsp; &nbsp; &nbsp; ...<br />&nbsp;</div>[/code:302i1bq8]
Combobox
Hi, I thought with a Combobox you could have both the ability to select from the dropdown list or manually enter some text. In a FWH app I have I am able to do this but with the FWPPC app I can't. I can onlt select from the dropdown. No manual entry. What am I doing wrong????? [code=fw:1893m13z]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">0.5</span>,<span style="color: #000000;">4</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx <span style="color: #0000ff;">VAR</span> cTech1 <span style="color: #0000ff;">ITEMS</span> aList <span style="color: #0000ff;">OF</span> oEnd</div>[/code:1893m13z]
Combobox
Got it working ... had to add: STYLE CBS_DROPDOWN
Combobox
Well ... maybe not working correctly. With the style added some strange things happen. On handheld: No longer "waits" for the dialog to be closed On emulator: Seems to work but when I try to exit my app I get a GPF Without the style the program works just won't let me manually enter text in the combobox. Any ideas?
Combobox
Antonio, Any ideas?
Combobox
<<BUMP>> Still experiencing this issue... anyone know how to solve this??
Combobox
Jeff, We are going to check it, sorry we missed this thread
Combobox
Hi Antonio, Any update on this one?
Combobox
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
Combobox
Hello Antonio, are there plans to extend the combom class? Thanks in advance and best regards, Otto
Combobox
Otto, Do you mean to work as a standard combobox besides what we already have in combobox for Metro ?
Combobox
Hello Antonio, yes with style DropDown and that user can either enter a text or just select an item from the list. Thanks in adv ance and best regards, Otto
Combobox
Otto, Actually the user can select from a list. Is text editing just missing ? thanks
Combobox
Hello Antonio, yes it is missing. Best regards, Otto
Combobox
Hello Antonio, do you plan to extend comboMetro? Thanks in advance Otto
Combobox
Otto, As far as I remember the ComboMetro used a TXBrowse, in that case we could edit inline on it. Would that be fine for you ?
Combobox
Hello Antonio, yes that would be fine. Thank you in advance Otto
Combobox
Hello Antonio, Because my question is quite urgent for me I put a small repetition. Thanks in advance Otto
Combobox
We shall look into this on priority
Combobox with WHEN command
[img:67gd2gwd]https&#58;//i&#46;postimg&#46;cc/15QxGNgz/jjjjj&#46;png[/img:67gd2gwd] I wish when the user select on 4th item of the first combobox is activate the second combobox [b:67gd2gwd]the test code[/b:67gd2gwd] [code=fw:67gd2gwd]<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> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> oDlg<br /><span style="color: #00C800;">Local</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">Local</span> nTariffeshow:= <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Local</span> nTipoShow:= <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Local</span> aShowTariffe:=<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Tutte"</span>,<span style="color: #ff0000;">"Elementi"</span>,<span style="color: #ff0000;">"Pacchetti"</span>,<span style="color: #ff0000;">"Servizi"</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> oCbx2,ocbx3<br /><span style="color: #00C800;">local</span> aServizi:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SERVIZIO1"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span>,;<br />                 <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO2"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span>,;<br />                 <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO3"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span>,;<br />                 <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO4"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgtariffe <span style="color: #0000ff;">size</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span><br /><br />  @ <span style="color: #000000;">10</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span>  nTariffeshow <span style="color: #0000ff;">ITEMS</span> aShowTariffe   ;<br />   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgTariffe  ;<br />  <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nTariffeshow<span style="color: #000000;">&#41;</span>,oCbx2:<span style="color: #000000;">nat</span><span style="color: #000000;">&#41;</span>,oCbx3:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">60</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx3 <span style="color: #0000ff;">VAR</span> nTiposhow <span style="color: #0000ff;">ITEMS</span> ArrTranspose<span style="color: #000000;">&#40;</span> aServizi <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>  ;<br />   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgTariffe <span style="color: #0000ff;">UPDATE</span>  <span style="color: #0000ff;">WHEN</span> oCbx2:<span style="color: #000000;">nat</span>=<span style="color: #000000;">4</span><br /><br /><br /><br /><span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span>  oDlgTariffe <span style="color: #0000ff;">center</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:67gd2gwd] when I select "servizi" on first combobox , the second combobox is changed but not it enable where is the error ?
Combobox with WHEN command
Look at this, [code=fw:h0e98rlc]<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> lShowCmb := .T.<br /><br /><span style="color: #00C800;">FUNCTION</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> oDlg, oDlgtariffe<br />   <span style="color: #00C800;">LOCAL</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#93;</span><br />   <span style="color: #00C800;">LOCAL</span> nTariffeshow := <span style="color: #000000;">1</span><br />   <span style="color: #00C800;">LOCAL</span> nTipoShow := <span style="color: #000000;">1</span><br />   <span style="color: #00C800;">LOCAL</span> aShowTariffe := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Tutte"</span>, <span style="color: #ff0000;">"Elementi"</span>, <span style="color: #ff0000;">"Pacchetti"</span>, <span style="color: #ff0000;">"Servizi"</span> <span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">LOCAL</span> oCbx2, ocbx3<br />   <span style="color: #00C800;">LOCAL</span> aServizi := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO1"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO2"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO3"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO4"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgtariffe <span style="color: #0000ff;">size</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">400</span> ;<br />          <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CHANGE MY COMBO"</span><br /><br />   oDlgtariffe:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br />   @ <span style="color: #000000;">10</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span>  nTariffeshow <span style="color: #0000ff;">ITEMS</span> aShowTariffe   ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgTariffe  ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> CAMBIA_COMBO<span style="color: #000000;">&#40;</span> oCbx2, oCbx3 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">60</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx3 <span style="color: #0000ff;">VAR</span> nTiposhow <span style="color: #0000ff;">ITEMS</span> ArrTranspose<span style="color: #000000;">&#40;</span> aServizi <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>  ;<br />      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgTariffe <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">WHEN</span><span style="color: #000000;">&#40;</span> lShowCmb <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span>  oDlgTariffe <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">// I LOVE FIVEWIN THE BEST. SIMPLE TO USE.</span><br /><span style="color: #B900B9;">// change combobox</span><br /><span style="color: #00C800;">FUNCTION</span> CAMBIA_COMBO<span style="color: #000000;">&#40;</span> oCbx2, oCbx3 <span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">nAt</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">4</span>  <span style="color: #B900B9;">// Absolute = Disable the combo</span><br /><br />     lShowCmb := .F.<br /><br />     oCbx3:<span style="color: #000000;">Disable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     oCbx3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">ELSE</span> <span style="color: #B900B9;">// Enable the combo - I'm terrible. jajajajajajajaja.</span><br /><br />     lShowCmb := .T.<br /><br />     oCbx3:<span style="color: #000000;">Enable</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     oCbx3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:h0e98rlc] Regards, saludos.
Combobox with WHEN command
Mr. Silvio Just add oDlg:AEvalWhen() in the ON CHANGE clause of the first COMBOBOX. This is the revised program: [code=fw:16i2w8bw]<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> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlgTariffe<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nTariffeshow:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nTipoShow:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aShowTariffe:=<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Tutte"</span>,<span style="color: #ff0000;">"Elementi"</span>,<span style="color: #ff0000;">"Pacchetti"</span>,<span style="color: #ff0000;">"Servizi"</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCbx2,ocbx3<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aServizi:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"SERVIZIO1"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO2"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO3"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SERVIZIO4"</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgtariffe <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> nTariffeshow <span style="color: #0000ff;">ITEMS</span> aShowTariffe &nbsp; ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgTariffe &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nTariffeshow <span style="color: #000000;">&#41;</span>, oCbx2:<span style="color: #000000;">nat</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oDlgTariffe:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">60</span>,<span style="color: #000000;">25</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx3 <span style="color: #0000ff;">VAR</span> nTiposhow <span style="color: #0000ff;">ITEMS</span> ArrTranspose<span style="color: #000000;">&#40;</span> aServizi <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgTariffe <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">WHEN</span> oCbx2:<span style="color: #000000;">nat</span> = <span style="color: #000000;">4</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgTariffe <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:16i2w8bw]
Combobox with WHEN command
Thanks Rao
Combobox (DropDown) no procesa correctamente el Valid
En este ejemplo, creando un COMBOBOX desde código fuente se procesa correctamente el Valid al salir del control, en cambio desde recursos no es así. Esto funciona OK [code=fw:7tf5g28u]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oDlg, cCombo := <span style="color: #ff0000;">"2"</span>, cGet:=Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aItems := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"1"</span>, <span style="color: #ff0000;">"2"</span>, <span style="color: #ff0000;">"3"</span> <span style="color: #000000;">&#125;</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;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">18</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Combo"</span> <span style="color: #0000ff;">STYLE</span> nOr<span style="color: #000000;">&#40;</span> DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">GET</span> cGet<br />&nbsp; &nbsp;@ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">COMBOBOX</span> cCombo <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">100</span> <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;">"Hola"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp;<span style="color: #00C800;">Return</span> <span style="color: #000000;">&#40;</span><span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span> &nbsp;<br />&nbsp;</div>[/code:7tf5g28u] Este ejemplo (combos.prg del samples) no funciona correctamente [code=fw:7tf5g28u]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Showing the use of different styles of ComboBoxes controls</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Combos.ch"</span><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 />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oSay<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCbx1, oCbx2, oCbx3<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cItem1, cItem2 := <span style="color: #ff0000;">"One"</span>, cItem3, cItem4 := <span style="color: #ff0000;">"None"</span><br />&nbsp; &nbsp;SET _3DLOOK <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// SkinButtons()</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Combos"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx1 <span style="color: #0000ff;">VAR</span> cItem1 <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_SIMPLE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem1, oSay:<span style="color: #0000ff;">Refresh</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: #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;">"valid"</span><span style="color: #000000;">&#41;</span>, cItem4 := cItem1, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cItem2 <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_DROPDOWN <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem2, oSay:<span style="color: #0000ff;">Refresh</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: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! oCbx2:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">oGet</span>:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCbx2:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</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>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oCbx2:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">bKeyDown</span> = <span style="color: #000000;">&#123;</span> | nKey | SearchItem<span style="color: #000000;">&#40;</span> nKey, oCbx2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx3 <span style="color: #0000ff;">VAR</span> cItem3 <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_DROPDOWNLIST <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem3, oSay:<span style="color: #0000ff;">Refresh</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: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem3, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> cItem4 <span style="color: #0000ff;">ID</span> ID_SELECTION <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"R+/W"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> SearchItem<span style="color: #000000;">&#40;</span> nKey, oCbx <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> 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> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nAt := AScan<span style="color: #000000;">&#40;</span> oCbx:<span style="color: #000000;">aItems</span>, <span style="color: #000000;">&#123;</span> | c | <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> c, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == AllTrim<span style="color: #000000;">&#40;</span> 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> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCbx:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> oCbx:<span style="color: #000000;">aItems</span><span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; <br /><span style="color: #00C800;">return</span> nKey &nbsp; &nbsp; &nbsp; &nbsp; <br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />procedure AppSys<br /><span style="color: #00C800;">return</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:7tf5g28u] Lo que ocurre es que ejecuta el valid al recibir el foco y no al salir como debería ser. ¿Alguna pista?
Combobox (DropDown) no procesa correctamente el Valid
Hola Angel, prueba así por favor. cCombo:bValid:= {|| MsgInfo( "Hola") , .t.} o cCombo:bLostFocus := ....... Espero te funcione. Saludos
Combobox (DropDown) no procesa correctamente el Valid
[quote="D.Fernandez":ac0k0hck]Hola Angel, prueba así por favor. cCombo:bValid:= {|| MsgInfo( "Hola") , .t.} o cCombo:bLostFocus := ....... Espero te funcione. Saludos[/quote:ac0k0hck] Ya lo probé, pero sin éxito, gracias.
Combobox (DropDown) no procesa correctamente el Valid
[code=fw:3lq85gnp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;@ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">COMBOBOX</span> cCombo <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">100</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">"Hola"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3lq85gnp]
Combobox (DropDown) no procesa correctamente el Valid
[quote="karinha":2ai78myo][code=fw:2ai78myo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">COMBOBOX</span> cCombo <span style="color: #0000ff;">ITEMS</span> aItems <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">100</span> ;<br />          <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN                         ;<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;">"Hola"</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br /> </div>[/code:2ai78myo][/quote:2ai78myo] Gracias Joao, cuando no funciona es con el REDEFINE que es como lo necesito <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
Combobox (DropDown) no procesa correctamente el Valid
// SAMPLES\COMBOS.PRG - Modificado. 18/09/2018 - <!-- e --><a href="mailto:kapiabafwh@gmail.com">kapiabafwh@gmail.com</a><!-- e --> [code=fw:1g4eqtrj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Showing the use of different styles of ComboBoxes controls</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Combos.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</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, oSay<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCbx1, oCbx2, oCbx3<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cItem1, cItem2 := <span style="color: #ff0000;">" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span>, cItem3, cItem4 := <span style="color: #ff0000;">"None"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aItems := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"D-3200 D3100"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D-3200W/18 D3100W"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D-7000W/18 D3200"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D-90 D-3200"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D3100 D-3200W/18"</span>,; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D3100W D5100"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D3200 D5200"</span>,; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D5100 D7000"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D5200 D7000W/18"</span>,; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D7000 D90"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"D90 D-90"</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;SET _3DLOOK <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// SkinButtons()</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Combos"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx1 <span style="color: #0000ff;">VAR</span> cItem1 <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_SIMPLE <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem1, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCbx1:<span style="color: #0000ff;">Refresh</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: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem1, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCbx1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx2 <span style="color: #0000ff;">VAR</span> cItem2 <span style="color: #0000ff;">ITEMS</span> aItems ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_DROPDOWN <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem2, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCbx2:<span style="color: #0000ff;">Refresh</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: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! oCbx2:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">oGet</span>:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCbx2:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</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>, oCbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oCbx3 <span style="color: #0000ff;">VAR</span> cItem3 <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_DROPDOWNLIST <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem3, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCbx3:<span style="color: #0000ff;">Refresh</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: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem3, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCbx3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> cItem4 <span style="color: #0000ff;">ID</span> ID_SELECTION <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"R+/W"</span><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: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:1g4eqtrj] Saludos.
Combobox (DropDown) no procesa correctamente el Valid
Si pones un Msginfo en el Valid verás que salta cuando recibe el foco, no así cuando se sale del control que sería lo lógico. [code=fw:hscd5br3]<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> cItem2 <span style="color: #0000ff;">ITEMS</span> aItems ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ID</span> ID_DROPDOWN <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STYLE</span> CBS_DROPDOWN ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span> cItem4 := cItem2, oSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oCbx2:<span style="color: #0000ff;">Refresh</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: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! oCbx2:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">oGet</span>:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oCbx2:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> oCbx2:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">GetText</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>, oCbx2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">MSGINFO</span> <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'HOLA'</span><span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span></div>[/code:hscd5br3]
Combobox (DropDown) no procesa correctamente el Valid
Bueno, solucionado, cuando se trata de un CBS_DROPDOWN el valid hay que ponerlo en el GET del combo, así : [code=fw:120c1gwj]<div class="fw" id="{CB}" style="font-family: monospace;">oCbx2:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">bValid</span>:=<span style="color: #000000;">&#123;</span>|| <span style="color: #0000ff;">Msginfo</span> <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'valid'</span><span style="color: #000000;">&#41;</span>, .T.<span style="color: #000000;">&#125;</span> &nbsp; &nbsp; &nbsp;</div>[/code:120c1gwj]