topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xBrowse Boxed Selected Row | [quote="nageswaragunupudi":2a4cxqcm]This is not provided.[/quote:2a4cxqcm]
Mr. Rao,
I hope it would be .. soon.
<!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
xBrowse Boxed Selected Row | Fraxzi:
Just curious,There are columns not visible in your browse?
<!-- m --><a class="postlink" href="http://i208.photobucket.com/albums/bb82/fraxzi/FWxHarbour/Boxed_Row_zpssec6ghoo.png">http://i208.photobucket.com/albums/bb82 ... c6ghoo.png</a><!-- m --> |
xBrowse Boxed Selected Row | [quote="fraxzi":3e71v5ue][quote="nageswaragunupudi":3e71v5ue]This is not provided.[/quote:3e71v5ue]
Mr. Rao,
I hope it would be .. soon.
<!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->[/quote:3e71v5ue]
Yes |
xBrowse Button del GET | recientemente me encontre con la necesidad de cambiar la imagen del boton del get en el xbrowse y me resulto un trabajo un poco complicado darme cuenta que tenia que primero generar el "DIALOG" o "WINDOW" para poder hacer el cambio de la imagen, que inicialmente es un boton muy pequeño con tres puntos "..."[img:szxvw644]http://i485.photobucket.com/albums/rr217/danielgarciagil/TRESPTOS.jpg[/img:szxvw644]De esta forma hacia el cambio de imagen pero lo que me pasaba era que tenia el mismo ancho de la imagen al boton de tres puntosactivate dialog aWnd[ 2 ] nowait ;on init ( aWnd[ 2 ]:move( 0,0 ) , ; oBrw:aCols[ 3 ]:oBtnElip:cCaption:="",;oBrw:aCols[ 3 ]:oBtnElip:LoadBitMaps("busca") ) ; VALID ( !GETKEYSTATE( VK_ESCAPE ) )[img:szxvw644]http://i485.photobucket.com/albums/rr217/danielgarciagil/BUSCA.jpg[/img:szxvw644]encontre pocas personas que tenian ese problema pero no se si lograron una solucion asi que me puse a trabajar y modificar la clase xbrowse a mi necesidad y esto fue lo que hice al final.[b:szxvw644][i:szxvw644]no se si sea la forma correcta pero me dio los resultados que quiero... hasta los momentos[/i:szxvw644][/b:szxvw644]1ro. cree una nueva DATA para las COLUMNS[b:szxvw644]DATA nBtnBmp AS NUMERIC INIT 0 [/b:szxvw644]con esta voy a indicar en que posicion de la matriz de oBrw:oCols:aBitmaps esta la imagen que quiero mostrar... para cargar la imagen a oBrw:oCols:aBitmaps se pueden usar los METODOS METHOD AddResource( cRes ) // Adds a new bitmap to the ::aBitmaps array giving his resource name METHOD AddBmpFile( cFile ) // Adds a new bitmap to the ::aBitmaps array giving his file name METHOD AddBmpHandle( hBmp ) // Adds a new bitmap to the ::aBitmaps array giving his bitmap handle2do. el problema era el tamaño, aqui hay varias cosas, cree una nueva variable local en el metodo METHOD PaintData[b:szxvw644]local nBtnWidth := 0[/b:szxvw644], esta variable contiene el ancho de la imagen contenida en ::aBitmapsagrege y cambie una lineas en el mismo metodoif nType > 1[b:szxvw644] if ::nBtnBmp > 0 .and. len( ::aBitmaps ) >= ::nBtnBmp
nBtnWidth := ::aBitMaps[ ::nBtnBmp, BITMAP_WIDTH ]
else
nBtnWidth := 10
endif[/b:szxvw644] nButtonRow := nRow nButtonCol := nCol + nWidth [b:szxvw644]- nBtnWidth[/b:szxvw644][b:szxvw644] nWidth -= ( nBtnWidth + 5 )[/b:szxvw644]....if nType > 1if lSelectedWndBoxRaised(hDC, nButtonRow -1 , nButtonCol - 1,;nButtonRow + nHeight, nButtonCol + [b:szxvw644]nBtnWidth + 1[/b:szxvw644] ) if nType == EDIT_LISTBOX .or. nType == EDIT_GET_LISTBOX::oBtnElip:Hide()::oBtnList:Move( nButtonRow, nButtonCol, [b:szxvw644]nBtnWidth + 1[/b:szxvw644], nHeight, .f.)::oBtnList:Show()::oBtnList:GetDC()FillRect( hDC, {nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + [b:szxvw644]nBtnWidth + 1[/b:szxvw644] },;::oBtnList:oBrush:hBrush )::oBtnList:Paint()::oBtnList:ReleaseDC()else::oBtnList:Hide()::oBtnElip:Move( nButtonRow, nButtonCol, [b:szxvw644]nBtnWidth + 1[/b:szxvw644], nHeight, .f.)::oBtnElip:Show()::oBtnElip:GetDC()FillRect( hDC, {nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + [b:szxvw644]nBtnWidth + 1[/b:szxvw644] },;::oBtnElip:oBrush:hBrush )::oBtnElip:Paint()::oBtnElip:ReleaseDC()endifendif3ro. en el metodo. METHOD CreateButtons() agrege una lineas mas después de la creacion de botones[b:szxvw644]if ::nBtnBmp > 0 .and. !empty( ::aBitMaps )
if ::nBtnBmp > len( ::aBitMaps )
::nBtnBmp := len( ::aBitMaps )
endif
[i:szxvw644]::ChangeBitMap( )[/i:szxvw644]
endif[/b:szxvw644]::oBtnList:Hide()::oBtnElip:Hide()4to. cree un nuevo metodo [b:szxvw644]METHOD ChangeBitmap( ) CLASS TXBrwColumn
if ::nBtnBmp > 0 .and. len( ::aBitmaps ) >= ::nBtnBmp
::oBtnElip:hBitmap1 := ::aBitMaps[::nBtnBmp, BITMAP_HANDLE ]
::oBtnList:hBitmap1 := ::aBitMaps[::nBtnBmp, BITMAP_HANDLE ]
::oBtnElip:cCaption := ""
else
::oBtnElip:hBitmap1 := 0
::oBtnList:hBitmap1 := 0
::oBtnElip:cCaption := "..."
endif
::oBrw:refresh()
return nil[/b:szxvw644]y ahora puedo cambiar las imagenes de los botones dinamicamente//********#include "FiveWin.ch"#include "xbrowse.ch"function Test()local oDlg, oBrwlocal aArray := {}local aList := {"1","2","3","4"}local nI for nI = 1 to 20aadd( aArray, { "Fila:"+StrZero(nI,2)+" Col:01",;"Fila:"+StrZero(nI,2)+" Col:02",;"Fila:"+StrZero(nI,2)+" Col:03",;"Fila:"+StrZero(nI,2)+" Col:04",;"Fila:"+StrZero(nI,2)+" Col:05",;"Fila:"+StrZero(nI,2)+" Col:06" } ) nextDEFINE DIALOG oDlg Title "Test de Botones en xBrowse " size 700,300oBrw:= txbrowse():new( oDlg ) oBrw:nRowHeight := 25oBrw:nColDividerStyle := LINESTYLE_BLACKoBrw:nRowDividerStyle := LINESTYLE_BLACKoBrw:SetArray( aArray )oBrw:CreateFromCode() oBrw:aCols[ 2 ]:AddBmpFile("C:\FWH\BITMAPS\16x16\closeall.bmp")oBrw:aCols[ 2 ]:AddResource("find")oBrw:aCols[ 2 ]:AddResource("cancel")oBrw:aCols[ 2 ]:AddResource("exit")oBrw:aCols[ 2 ]:nEditType( EDIT_GET_BUTTON )oBrw:aCols[ 2 ]:nBtnBmp := 1oBrw:aCols[ 2 ]:bEditBlock := {|| msginfo( "Imagen"+strzero( oBrw:aCols[ 2 ]:nBtnBmp, 2 ) ) } oBrw:aCols[ 3 ]:nEditType( EDIT_GET_LISTBOX )oBrw:aCols[ 3 ]:aEditListTxt := aListoBrw:aCols[ 3 ]:bOnPostEdit := {|o,x,k| oBrw:aCols[ 2 ]:nBtnBmp := x , ; oBrw:aCols[ 2 ]:ChangeBitMap() } ACTIVATE DIALOG oDlg center;ON INIT ( oDlg:oClient := oBrw, ;oDlg:ReSize() )return nilPRUEBA 1[img:szxvw644]http://i485.photobucket.com/albums/rr217/danielgarciagil/test01-1.jpg[/img:szxvw644]PRUEBA 2[img:szxvw644]http://i485.photobucket.com/albums/rr217/danielgarciagil/test02.jpg[/img:szxvw644]PRUEBA 3[img:szxvw644]http://i485.photobucket.com/albums/rr217/danielgarciagil/test03.jpg[/img:szxvw644]igualmente se puede cambiar la flecha del los LISTBOX usando la misma forma.si existe una forma mas facil por favor quiero saberla, igual esto me ayudo a entender un poco mas la xbrowse e igual espero que a alguien le sirva |
xBrowse Button del GET | Daniel,Muchas gracias por esta aportación tan interesante! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse Button del GET | [quote="Antonio Linares":1fsj9ptb]Daniel,
Muchas gracias por esta aportación tan interesante! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:1fsj9ptb]antonio gracias a ti por el interes... realmente no se si era la mejor forma de resolverlo, o si utilice de forma debida las variables y metodos de la clase, o si existe otra forma de hacerlo, o si crea un presendente para un aporte sustantivo, el proposito inical fue quitarme la piedra del zapato y aprender un poco mas de la clase.Yo solo espero que este pequeño cambio no solo me sirva a mi sino a otras personas |
xBrowse Button del GET | Daniel,Me gusta <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Gracies. |
xBrowse Button del GET | Que bien eso lo queria hacer y no encontraba como <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> gracias por el dato <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> SaluditosAida <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
xBrowse Button del GET | can I have the class with these modifies at mio correo?gracias |
xBrowse Button del GET | check you email... <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
xBrowse Button del GET | Mcfox:Puedes enviarme la classe modificada a mi corre [b:10p2b84g][email protected][/b:10p2b84g]? |
xBrowse Button del GET | [quote="FranciscoA":1y1g4udd]Mcfox:
Puedes enviarme la classe modificada a mi corre [b:1y1g4udd][email protected][/b:1y1g4udd]?[/quote:1y1g4udd]Estoy usando la clase de MCFOX, imagino le ha hecho algunos nuevos cambios, te envie hasta donde estoy actualizado, incluyendo estos que publica.espero te sirva...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> |
xBrowse Button del GET | Joe Luis, Francisco,Le hemos enviado la version mas reciente de xbrowse a Daniel para que la modifique y la pruebe y asi usemos todos la version mas reciente <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xBrowse Button del GET | José Luis, Antonio... Gracias. |
xBrowse Button del GET | [quote="Antonio Linares":19lk5kx2]Joe Luis, Francisco,
Le hemos enviado la version mas reciente de xbrowse a Daniel para que la modifique y la pruebe y asi usemos todos la version mas reciente <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:19lk5kx2]Buena idea Antonio, de verdad que MCFOX ha hecho unos buenos cambios que todos podremos sacarle el mejor provecho a este poderoso xBrowse...saludos... |
xBrowse Button del GET | Listo antonio verifica el correo |
xBrowse Button with EDIT_GET_BUTTON | To All
I have found a few examples on this forum and reviewing the sample TestxBrw.prg I can create a button within xBrowse .. however, two things ..
1) How do I size the Button and put a caption on the button
2) Is it possible to use BTNBMP as my button choice ?
Here is my code :
[code=fw:1wo1ad56]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// serial number</span><br /><br />ADD oCol <span style="color: #0000ff;">to</span> oLbxB <span style="color: #00C800;">AT</span> <span style="color: #000000;">8</span> HEADER <span style="color: #ff0000;">'Serial Num'</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">75</span> <br />oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br />oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|row, col, oCol| <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"WRITE YOUR FUNCTIONALITY HERE"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:1wo1ad56]
[url=http://imageshack.us/photo/my-images/513/button1i.jpg/:1wo1ad56][img:1wo1ad56]http://img513.imageshack.us/img513/5213/button1i.jpg[/img:1wo1ad56][/url:1wo1ad56] |
xBrowse Button with EDIT_GET_BUTTON | [quote:23jbs9r7]2) Is it possible to use BTNBMP as my button choice ?
[/quote:23jbs9r7]
We can specify a bitmap.
Use oCol:AddBitmap( cBitmap ) to add the bitmap to the column and assign the bitmap number as oCol:nBtnBmp
[quote:23jbs9r7]1) How do I size the Button and put a caption on the button
[/quote:23jbs9r7]
We can not directly specify the size of the button. But if a bitmap is specified, the size of the button is adjusted to accommodate the size if the bitmap |
xBrowse Button with EDIT_GET_BUTTON | Rao
Looking at some of the samples .. xBrowGrd.prg
[code=fw:2nn8ivtq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />WITH OBJECT oBrw:<span style="color: #000000;">HireDate</span><br /> :<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\A</span>lphabmp<span style="color: #000000;">\t</span>ask.bmp'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// alpha</span><br /> :<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">1</span> <span style="color: #000000;">}</span><br />END<br /> </div>[/code:2nn8ivtq]
Is there a way to use a Bitmap from resource rather than from file ?
Thanks
Rick Lipkin |
xBrowse Button with EDIT_GET_BUTTON | Rao
Using your suggestion, I did not get the result I was looking for <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> It does not appear that the bitmap is being overlayed on the button ..
[code=fw:3fejnhd0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// serial number</span><br /><br /> ADD oCol <span style="color: #0000ff;">to</span> oLbxB <span style="color: #00C800;">AT</span> <span style="color: #000000;">8</span> HEADER <span style="color: #ff0000;">'Serial Num'</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">75</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|row, col, oCol| <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"WRITE YOUR FUNCTIONALITY HERE"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">(</span> cDefa+<span style="color: #ff0000;">"<span style="color: #000000;">\i</span>mages<span style="color: #000000;">\s</span>erial.bmp"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// alpha</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">lBtnTransparent</span> := .t.<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nBtnBmp</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">// := { || 1 } </span><br /> </div>[/code:3fejnhd0]
[url=http://imageshack.us/photo/my-images/853/serial2.jpg/:3fejnhd0][img:3fejnhd0]http://img853.imageshack.us/img853/4071/serial2.jpg[/img:3fejnhd0][/url:3fejnhd0]
Thanks
Rick Lipkin |
xBrowse Button with EDIT_GET_BUTTON | To All
Just a quick follow up to see if there is a work around here to add a caption to the button and give it a size .. It appears that if you add a bitmap it does change the dimension of the button up to a point.
I do not really want to add a bitmap to the column just be able to size the button <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> and it would be great if a caption could be used as a label. <!-- s:idea: --><img src="{SMILIES_PATH}/icon_idea.gif" alt=":idea:" title="Idea" /><!-- s:idea: -->
Any workaround or xBrowse code modification would be VERY much appreciated!
Rick Lipkin
FWH1203
[url=http://imageshack.us/photo/my-images/580/rick1.jpg/:ba6mcihf][img:ba6mcihf]http://img580.imageshack.us/img580/1154/rick1.jpg[/img:ba6mcihf][/url:ba6mcihf]
ps .. I noticed if I compiled xBrowse.prg .. I get this result :
[url=http://imageshack.us/photo/my-images/100/rick4.jpg/:ba6mcihf][img:ba6mcihf]http://img100.imageshack.us/img100/4745/rick4.jpg[/img:ba6mcihf][/url:ba6mcihf] |
xBrowse Button with EDIT_GET_BUTTON | To All
Somewhere in these two xBrowse functions is my answer .. any Ideas ??
Rick Lipkin
[code=fw:8jwepfyn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateButtons<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><br /> <span style="color: #00C800;">local</span> aColors<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnList</span> != <span style="color: #00C800;">nil</span> .and. ::<span style="color: #000000;">oBtnElip</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lCreated</span><br /><br /> aColors := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrHeader</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnList</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnElip</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">BTNBMP</span> ::<span style="color: #000000;">oBtnList</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBrw</span> NOBORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">hBitmap1</span> := FwDArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">ShowBtnList</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">BTNBMP</span> ::<span style="color: #000000;">oBtnElip</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBrw</span> NOBORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"..."</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">RunBtnAction</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBtnBmp</span> > <span style="color: #000000;">0</span> .and. !empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitMaps</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBtnBmp</span> > len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitMaps</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nBtnBmp</span> := len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitMaps</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">ChangeBitMap</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> ChangeBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn <span style="color: #B900B9;">// BtnGet</span><br /><br /> * <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ChangeBitmap"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBtnBmp</span> > <span style="color: #000000;">0</span> .and. len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitmaps</span> <span style="color: #000000;">)</span> >= ::<span style="color: #000000;">nBtnBmp</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">hBitmap1</span> := ::<span style="color: #000000;">aBitMaps</span><span style="color: #000000;">[</span>::<span style="color: #000000;">nBtnBmp</span>, BITMAP_HANDLE <span style="color: #000000;">]</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">hBitmap1</span> := ::<span style="color: #000000;">aBitMaps</span><span style="color: #000000;">[</span>::<span style="color: #000000;">nBtnBmp</span>, BITMAP_HANDLE <span style="color: #000000;">]</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">hBitmap1</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">hBitmap1</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"..."</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:8jwepfyn] |
xBrowse Button with EDIT_GET_BUTTON | Rick,
If you change this line:
::oBtnElip:cCaption := "label"
you should get a caption. Please try it. |
xBrowse Button with EDIT_GET_BUTTON | And in this line its size can be changed:
::oBtnElip:Move( nButtonRow, nButtonCol, nBtnWidth + 1, nHeight, .f.)
If those changes are fine, then we can see how to set it from your app, instead of modifying the Class source code. |
xBrowse Button with EDIT_GET_BUTTON | Antonio
YES .. your suggestions worked .. however, it appears that there is another line of code that continues to create the original button .. here are the changes I made to the xBrowse code :
Method PaintCell
[code=fw:m5astzta]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">if</span> nType == EDIT_LISTBOX .or. nType == EDIT_GET_LISTBOX<br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nButtonRow, nButtonCol, nBtnWidth + <span style="color: #000000;">1</span>, nHeight, .f.<span style="color: #000000;">)</span> <span style="color: #B900B9;">// ButtonGet</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBtnTransparent</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> FillRect<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">{</span>nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + nBtnWidth + <span style="color: #000000;">1</span> <span style="color: #000000;">}</span> ,; <span style="color: #B900B9;">// ButtonGet</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> * ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nButtonRow, nButtonCol, nBtnWidth + <span style="color: #000000;">1</span>, nHeight, .f.<span style="color: #000000;">)</span> <span style="color: #B900B9;">// ButtonGet</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nButtonRow, nButtonCol<span style="color: #000000;">-60</span>, nBtnWidth + <span style="color: #000000;">40</span>, nHeight, .f.<span style="color: #000000;">)</span> <span style="color: #B900B9;">// Ricks changes</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lBtnTransparent</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> FillRect<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">{</span>nButtonRow, nButtonCol, nButtonRow + nHeight , nButtonCol + nBtnWidth + <span style="color: #000000;">1</span> <span style="color: #000000;">}</span>,; <span style="color: #B900B9;">// ButtonGet</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> </div>[/code:m5astzta]
Method CreateButtons and ChangeBitmap
[code=fw:m5astzta]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> CreateButtons<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><br /> <span style="color: #00C800;">local</span> aColors<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnList</span> != <span style="color: #00C800;">nil</span> .and. ::<span style="color: #000000;">oBtnElip</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lCreated</span><br /><br /> aColors := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrHeader</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnList</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnElip</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">BTNBMP</span> ::<span style="color: #000000;">oBtnList</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">""</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBrw</span> NOBORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">hBitmap1</span> := FwDArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">ShowBtnList</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">BTNBMP</span> ::<span style="color: #000000;">oBtnElip</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oBrw</span> NOBORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><br /> * ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"..."</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"Label"</span> <span style="color: #B900B9;">// antonio change</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">RunBtnAction</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span>, Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDataFont</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, ::<span style="color: #000000;">oDataFont</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBtnBmp</span> > <span style="color: #000000;">0</span> .and. !empty<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitMaps</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBtnBmp</span> > len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitMaps</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nBtnBmp</span> := len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitMaps</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> ::<span style="color: #000000;">ChangeBitMap</span><span style="color: #000000;">(</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">Hide</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> ChangeBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn <span style="color: #B900B9;">// BtnGet</span><br /><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"ChangeBitmap"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nBtnBmp</span> > <span style="color: #000000;">0</span> .and. len<span style="color: #000000;">(</span> ::<span style="color: #000000;">aBitmaps</span> <span style="color: #000000;">)</span> >= ::<span style="color: #000000;">nBtnBmp</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">hBitmap1</span> := ::<span style="color: #000000;">aBitMaps</span><span style="color: #000000;">[</span>::<span style="color: #000000;">nBtnBmp</span>, BITMAP_HANDLE <span style="color: #000000;">]</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">hBitmap1</span> := ::<span style="color: #000000;">aBitMaps</span><span style="color: #000000;">[</span>::<span style="color: #000000;">nBtnBmp</span>, BITMAP_HANDLE <span style="color: #000000;">]</span><br /> * ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">""</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"label"</span> <span style="color: #B900B9;">// antonio change</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">hBitmap1</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">hBitmap1</span> := <span style="color: #000000;">0</span><br /> * ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"..."</span><br /> ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">cCaption</span> := <span style="color: #ff0000;">"label"</span> <span style="color: #B900B9;">// antonio change</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:m5astzta]
[url=http://imageshack.us/photo/my-images/850/label1w.jpg/:m5astzta][img:m5astzta]http://img850.imageshack.us/img850/2118/label1w.jpg[/img:m5astzta][/url:m5astzta]
Here is the same code adding the Bitmap ..
[code=fw:m5astzta]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// serial number</span><br /><br /> ADD oCol <span style="color: #0000ff;">to</span> oLbxB <span style="color: #00C800;">AT</span> <span style="color: #000000;">8</span> HEADER <span style="color: #ff0000;">'Serial Num'</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">75</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|row, col, oCol| _SerBrow<span style="color: #000000;">(</span> nRepairNumber,;<br /> oRsInvDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Inventory Id"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,;<br /> oRsInvDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,oRsInvDetail,;<br /> oBtn1,oBtn2,oBtn3,oBtn4,oBtn5 <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">addbmpfile</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh1203<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\a</span>lphabmp<span style="color: #000000;">\t</span>ask.bmp"</span> <span style="color: #000000;">)</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">lBtnTransparent</span> := .t.<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nBtnBmp</span> := <span style="color: #000000;">1</span><br /> </div>[/code:m5astzta]
[url=http://imageshack.us/photo/my-images/9/label1g.jpg/:m5astzta][img:m5astzta]http://img9.imageshack.us/img9/853/label1g.jpg[/img:m5astzta][/url:m5astzta]
I sincerely appreciate your Help!
Rick Lipkin
ps .. I have been trying out different options .. Is it possible to modify my :addbmpfile line with something like oLbxB:aCols[8]:If( oRs:Fields("whatever"):Value = .t., addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task.bmp" ,addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task1.bmp")) .. ? |
xBrowse Button with EDIT_GET_BUTTON | Rick,
It looks as placed too much to the left. Please try to change the :Move( ... ) params to move it to the right |
xBrowse Button with EDIT_GET_BUTTON | Rick,
Please try this:
oLbxB:aCols[8]:addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task.bmp" )
oLbxB:aCols[8]:addbmpfile( "c:\fwh1203\bitmaps\alphabmp\task1.bmp")
oLbxB:aCols[ 8 ]:bBmpData = { | lValue | If( lValue, 1, 2 ) } |
xBrowse Button with EDIT_GET_BUTTON | Antonio
YES .. the codeblock for the Addbmpfile worked great .. Have another look at my previous post .. It appears that there is still a ( small ) button being painted even though I modified the 'move' line.
[url=http://imageshack.us/photo/my-images/850/label1w.jpg/:1elcnbgk][img:1elcnbgk]http://img850.imageshack.us/img850/2118/label1w.jpg[/img:1elcnbgk][/url:1elcnbgk]
Otherwise it LOOKS Great!
Thanks
Rick |
xBrowse Button with EDIT_GET_BUTTON | Rick,
Can you click on each of them ? |
xBrowse Button with EDIT_GET_BUTTON | Antonio
The button with "Label" works .. the small button on the right does not .. might be the FillRect or WndBoxRaised ?
Thanks
Rick Lipkin |
xBrowse Button with EDIT_GET_BUTTON | Antonio
I think I can live with the 'default' xBrowse button .. I am using bitmaps from file ( as you suggested ) to visually project whether there is data behind the button or not... and I like that, however all my bitmaps are stored as resources and I would prefer not to distribute the individual bitmaps ..
Is there another option to add bitmaps other than from a file ? .. here is my code that produced the screenshot below ?
Thanks
Rick Lipkin
[code=fw:14p3il33]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// serial number</span><br /><br /> ADD oCol <span style="color: #0000ff;">to</span> oLbxB <span style="color: #00C800;">AT</span> <span style="color: #000000;">8</span> HEADER <span style="color: #ff0000;">'Serial Num'</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">60</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span>|row, col, oCol| oLbxB:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,_SerBrow<span style="color: #000000;">(</span>;<br /> nRepairNumber,;<br /> oRsInvDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Inventory Id"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,;<br /> oRsInvDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,;<br /> oRsInvDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Key"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span>,;<br /> oRsInvDetail,;<br /> oBtn1,oBtn2,oBtn3,oBtn4,oBtn5 <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">addbmpfile</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh1203<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\z</span>oom2.bmp"</span> <span style="color: #000000;">)</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">addbmpfile</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh1203<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\a</span>dddbf.bmp"</span> <span style="color: #000000;">)</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bBmpData</span> := <span style="color: #000000;">{</span> | lValue | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oRsInvDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"IsSerial"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> = .t., <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">8</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">lBtnTransparent</span> := .t.<br /> </div>[/code:14p3il33]
[url=http://imageshack.us/photo/my-images/441/rick1j.jpg/:14p3il33][img:14p3il33]http://img441.imageshack.us/img441/3984/rick1j.jpg[/img:14p3il33][/url:14p3il33] |
xBrowse Button with EDIT_GET_BUTTON | AddBitmap( c )
Parameter can be bitmap file name or resource name.
The parameter can also be an array of bmpfilenames/resourcenames |
xBrowse Button with EDIT_GET_BUTTON | FWH 12.08:
It is enough to assign appropriate values to
oCol:cBtnCaption
and
oCol:nBtnWidth
Rest is taken care by xbrowse. |
xBrowse Button with EDIT_GET_BUTTON | Rao
As always .. thanks for your help .. AddBitMap( "Resource" ) worked fine!
Many Thanks
Rick Lipkin |
xBrowse CRYPT | Dear Mr. Rao,
would you be so kind to show how to use decrypt/encrypt with EDIT_GET edit type.
Best regards,
Otto
[code=fw:1714m5nm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />oBrw:<span style="color: #000000;">PASSWORD</span>:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> || Decrypt<span style="color: #000000;">(</span> ALLTRIM<span style="color: #000000;">(</span> FIELD->PASSWORD <span style="color: #000000;">)</span>, cPW <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">PASSWORD</span>:<span style="color: #000000;">nEditType</span> := EDIT_BUTTON<br />oBrw:<span style="color: #000000;">PASSWORD</span>:<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span> | r, c, o | EditPASSWORD<span style="color: #000000;">(</span> r, c, o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br />oBrw:<span style="color: #000000;">PASSWORD</span>:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> || Decrypt<span style="color: #000000;">(</span> ALLTRIM<span style="color: #000000;">(</span> FIELD->PASSWORD <span style="color: #000000;">)</span>, cPW <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">PASSWORD</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /><br /><br /><br /> </div>[/code:1714m5nm] |
xBrowse CRYPT | When we want to edit a column, it is advisable to assign bEditValue with SETGET block.
[code=fw:pmsvv4xp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> x != <span style="color: #00C800;">nil</span>, FIELD->PASSWORD := Encrypt<span style="color: #000000;">(</span> x, cPw <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span>, Decrypt<span style="color: #000000;">(</span> FIELD->PASSWORD, cPW <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:pmsvv4xp]
Now you can use either EDIT_GET or EDIT_BUTTON.
In case of EDIT_BUTTON, bEditBlock should return the new password without encryption. In case edit is cancelled bEditBlock should return NIL. |
xBrowse Cabecera Top | Hola buenas tardes, una consulta sobre xBrowse, como hago que se actualice en tiempo de ejecucion la cabecera Top del browse?
[code=fw:63pvte1k]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrwProE:<span style="color: #000000;">nHeader</span> := <span style="color: #000000;">1</span><br />oBrwProE:<span style="color: #000000;">aHeaderTop</span> := <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Partidos jugados del próximo rival "</span> + cNombreProEquipo <span style="color: #000000;">}</span><br /> </div>[/code:63pvte1k]
Saludos
Marcelo |
xBrowse Cambiar color de una columna | Foro buenas tardes:
Necesito cambiar el color de las celdas de una columna [ 03 ], dependiendo del valor de la celda, ¿ cómo quedaría ?
oBrw:aCols [ 03 ]:bClrStd := { xx }
Gracias |
xBrowse Cambiar color de una columna | Hola Ernesto, tal cual lo dices, tienes que armar ese bloque de codigo con el color que desees
[code=fw:437no54e]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> mitabla->micampo > <span style="color: #000000;">3</span>, ;<br /> <span style="color: #000000;">{</span> CLR_WHITE, RGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">55</span>,<span style="color: #000000;">55</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> mitabla->micampo < <span style="color: #000000;">3</span>, ;<br /> <span style="color: #000000;">{</span> CLR_BLACK, RGB<span style="color: #000000;">(</span><span style="color: #000000;">55</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">55</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> CLR_BLACK, CLR_YELLOW <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:437no54e]
Tambien puedes hacer una una funcion que te devuelva un arreglo con los colores si las posibilidades que tienes que controlar son muchas |
xBrowse Cell Edit | Hi All,
If I edit xBrowse cell/column the edit value is highlighted or selected.. How to avoid this?
Regards,
Frances |
xBrowse Cell Edit | You need to modify xbrowse.prg.
In the METHOD Edit() CLASS TXBrwColumn, search for "::oEditGet:SelectAll()" and comment out that line.
I wonder what many programmers would prefer. The present default behavior of xbrowse or the new behavior preferred by you? |
xBrowse Cell Edit | [quote="nageswaragunupudi":18l90r75]You need to modify xbrowse.prg.
In the METHOD Edit() CLASS TXBrwColumn, search for "::oEditGet:SelectAll()" and comment out that line.
I wonder what many programmers would prefer. The present default behavior of xbrowse or the new behavior preferred by you?[/quote:18l90r75]
Dear RAO,
I think it would be better if there's a logical data whether to :selectall() or :selectnone()..
for example, my users edit a memo on xbrowse coloumn.. if by default is :selectall(), the entire content can be deleted if a char key was pressed.. so just by avoiding..
BTW, I commented what you suggests.
just maybe.. similar to this
[code=fw:18l90r75]<div class="fw" id="{CB}" style="font-family: monospace;"> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|Self| <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>:<span style="color: #000000;">oEditGet</span> <> <span style="color: #00C800;">Nil</span>, <span style="color: #00C800;">Self</span>:<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SelectNone</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">Nil</span><span style="color: #000000;">)</span>, .T.<span style="color: #000000;">}</span></div>[/code:18l90r75]
would be handy so not to modify xbrowse.
best regards,
Frances |
xBrowse Cell Edit | Mr Fraxzi
Personally I too prefer not to use :SelectAll().
Depending on what most users prefer, Mr Antonio may finally decide. |
xBrowse Cell Edit | Hi to all,
the default in most windows software is SelectAll(), but with increasing size of the content to edit, a data loss becomes more and more dangerous.
So, it would really be better to have a more comfortable way to switch between SelectAll() and SelectNone, as Frances described above. |
xBrowse Cell Edit | Has anyone found a way to have memo edit default to selectnone() or unselect text during ON INIT?
I have tried many different ways to get the memo edit not to select all automatically.
This has caused more than 1 person to accidentally erase memo with keystroke.
[code=fw:y5mksgic]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> oDlg, oGet1, cText<br /> cText := <span style="color: #ff0000;">'This is existing text'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DLG_NOTE"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Edit Note'</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cText <span style="color: #0000ff;">TEXT</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oGet1:<span style="color: #000000;">KeyDown</span><span style="color: #000000;">(</span> VK_END <span style="color: #000000;">)</span><br /> </div>[/code:y5mksgic] |
xBrowse Cell Edit | [quote="fraxzi":22b5vn1q][quote="nageswaragunupudi":22b5vn1q]You need to modify xbrowse.prg.
In the METHOD Edit() CLASS TXBrwColumn, search for "::oEditGet:SelectAll()" and comment out that line.
I wonder what many programmers would prefer. The present default behavior of xbrowse or the new behavior preferred by you?[/quote:22b5vn1q]
Dear RAO,
I think it would be better if there's a logical data whether to :selectall() or :selectnone()..
for example, my users edit a memo on xbrowse coloumn.. if by default is :selectall(), the entire content can be deleted if a char key was pressed.. so just by avoiding..
BTW, I commented what you suggests.
just maybe.. similar to this
[code=fw:22b5vn1q]<div class="fw" id="{CB}" style="font-family: monospace;"> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|Self| <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>:<span style="color: #000000;">oEditGet</span> <> <span style="color: #00C800;">Nil</span>, <span style="color: #00C800;">Self</span>:<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SelectNone</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">Nil</span><span style="color: #000000;">)</span>, .T.<span style="color: #000000;">}</span></div>[/code:22b5vn1q]
would be handy so not to modify xbrowse.
best regards,
Frances[/quote:22b5vn1q]
Without modifying XBrowse, you can set
[code=fw:22b5vn1q]<div class="fw" id="{CB}" style="font-family: monospace;"><br />XbrGetSelectAll<span style="color: #000000;">(</span> .F. <span style="color: #000000;">)</span><br /> </div>[/code:22b5vn1q] |
xBrowse Cell Edit | Gale Ford
Please try this
[code=fw:1plxhhv6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> oDlg, oGet1, cText<br /> cText := <span style="color: #ff0000;">'This is existing text'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DLG_NOTE"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Edit Note'</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cText <span style="color: #0000ff;">TEXT</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /> oGet1:<span style="color: #000000;">bGotFocus</span> := <span style="color: #000000;">{</span> || oGet1:<span style="color: #000000;">SetSel</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> </div>[/code:1plxhhv6] |
xBrowse Cell Edit | I started another conversation and received similar solution.
Thanks for your follow up. Appreciated as always. |
xBrowse Cell Lost Focus | Hi All
Is there away to detect if a cell in browse has lost focus -
user types something in cell and then uses mouse to click checkbox in next cell - because the user did not press the enter key the
data is not saved
Regards
Colin |
xBrowse Cell Lost Focus | Colin,
You can change the cell-color,
but maybe better to display a error-message,
that the old data still exists ?
[code=fw:3ktk9ldp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET <br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> | oCol, xVal, nKey | ;<br /> IIF<span style="color: #000000;">(</span> nKey == VK_RETURN, ; <span style="color: #B900B9;">// SAVED !!!</span><br /> <span style="color: #000000;">(</span> DBSELECTAREA<span style="color: #000000;">(</span><span style="color: #ff0000;">"ABC"</span><span style="color: #000000;">)</span>, ;<br /> NET_RLOCK<span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">(</span><span style="color: #ff0000;">"ABC"</span><span style="color: #000000;">)</span>->LAST := xVal, ;<br /> NET_ULOCK<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Old data : "</span> + CRLF + ; <span style="color: #B900B9;">// NOT saved !!!</span><br /> ALLTRIM<span style="color: #000000;">(</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"ABC"</span><span style="color: #000000;">)</span>->LAST<span style="color: #000000;">)</span> + CRLF + ;<br /> <span style="color: #ff0000;">"not changed !!!"</span>, <span style="color: #ff0000;">"ERROR"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> </div>[/code:3ktk9ldp]
Best regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse Cell Lost Focus | Hi Uwe
bOnPostEdit requires a key stroke to activate - I am looking for when the cell loses focus - when the user types in something then moves
to another cell using the mouse. I want to detect they have moved without using the enter key.
Regards
Colin |
xBrowse Cell Lost Focus | Have you tried?
oCol:lAutoSave := .T. |
xBrowse Cell Lost Focus | Hi Cristobal
I tried your suggestion - thank you - but get the following error
Called from: => TRANSFORM(0)
Called from: .\source\function\VALBLANK.PRG => CVALTOSTR(217)
Called from: C:\newdev\common\xbrowse.prg => (b)TXBRWCOLUMN:ADJUST(8281)
Called from: C:\newdev\common\xbrowse.prg => TXBRWCOLUMN:ADJUST(8350)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:ADJUST(963)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:INITIATE(861)
Called from: => __OBJSENDMSG(0)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => OSEND(219)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => ASEND(197)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(669)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(944)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(275)
Called from: Input2.prg => LFCOURSE(750)
Regards
Colin |
xBrowse Cell Lost Focus | Colin,
What was the actual error?
I suggest creating the simplest possible test program to simplify finding the problem.
James |
xBrowse Cell Lost Focus | [quote="Colin Haig":tey6dmvb]Hi Cristobal
I tried your suggestion - thank you - but get the following error
Called from: => TRANSFORM(0)
Called from: .\source\function\VALBLANK.PRG => CVALTOSTR(217)
Called from: C:\newdev\common\xbrowse.prg => (b)TXBRWCOLUMN:ADJUST(8281)
Called from: C:\newdev\common\xbrowse.prg => TXBRWCOLUMN:ADJUST(8350)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:ADJUST(963)
Called from: C:\newdev\common\xbrowse.prg => TXBROWSE:INITIATE(861)
Called from: => __OBJSENDMSG(0)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => OSEND(219)
Called from: => HB_EXECFROMARRAY(0)
Called from: .\source\function\HARBOUR.PRG => ASEND(197)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE(669)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(944)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(275)
Called from: Input2.prg => LFCOURSE(750)
Regards
Colin[/quote:tey6dmvb]
Fwh version you are using?
In my tests working properly |
xBrowse Cell Lost Focus | Hi Crisotbal
I am using FWH 11.05 - I should really upgrade.
Thanks for your assistance
Regards
Colin |
xBrowse Cell ToolTip | Dear all,
How can I assign ToolTip for each xBrowse Cell?
Regards,
FAP |
xBrowse Cell ToolTip | You can use oCol:bToolTip.
This codeblock is evaluated with parameters oBrw, nRow,nCol,nKeyFlags. nRow and nCol are in pixels relative to the browse. The text returned by evaluating the codeblock is displayed as cell's tooltip.
Important Caution: The cell for which the tooltip being displayed may be in a row different from the current row of browse. It is your responsibility to know which row the tooltip cell belongs to and retrieve the values. |
xBrowse Cell ToolTip | Dear RAO,
Thanks so much..
I did this:
[code=fw:147s8yx8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br />with object oBrw<br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span>| oBrw, nRow, nCol, nKeyFlags| <span style="color: #ff0000;">'Code: '</span>+oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> +CRLF+;<br /> <span style="color: #ff0000;">'Desc: '</span>+oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />end <br />...<br /> </div>[/code:147s8yx8]
it shows exactly what I wish for..
My best regards,
FAP |
xBrowse Cell ToolTip | This does not give you the correct result all the times.
For example, the browse cursor is on 3rd row.
The user hovers the mouse on 5th row. The tooltip is expected to show the information relating to the 5th row, but actually shows information relating to the 3rd row.
Coding this bToolTip is really tricky. You need to find the aCol[ 1 ]:Value if the browse cursor is moved to 5th row. |
xBrowse Cell ToolTip | [quote="nageswaragunupudi":167cddls]This does not give you the correct result all the times.
For example, the browse cursor is on 3rd row.
The user hovers the mouse on 5th row. The tooltip is expected to show the information relating to the 5th row, but actually shows information relating to the 3rd row.
Coding this bToolTip is really tricky. You need to find the aCol[ 1 ]:Value if the browse cursor is moved to 5th row.[/quote:167cddls]
Dear RAO,
Yes it is tricky... Shows only the tooltip of current selected row..
Do you have a solution or starting point with this?
Regards,
FAP |
xBrowse Cell ToolTip | Its rather easier when we browse arrays.
1. The selected row is
nAt := oBrw:nArrayAt
2. Visible Row number of the selected row in the display is
nRowSel := oBrw:nRowSel.
3. Visible Row number where the mouse is positioned is
nToolTipRow := oBrw:MouseRowPos( nRow ) // nRow from the parameter to the codeblock
4. We want the Array Row Number where the mouse is hovering:
nToolTipAt := oBrw:nArrayAt - oBrw:nRowSel + oBrw:MouseRowPos( nRow )
Value to display in the tooltip is oBrw:aArrayData[ nToolTipAt ][ <your column> ]
In case of non array datasource, we need to move to the new record, read data and reposition to the original record. I don't think it is worthwhile.
In any case, first test with an Array Browse and then decide. |
xBrowse Cell ToolTip | I tested just now. This code is working for me with arrays.
[code=fw:xgewx0y8]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span> | oBrw, nRow, nCol, nFlags | ;<br /> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> oBrw:<span style="color: #000000;">nArrayAt</span> - oBrw:<span style="color: #000000;">nRowSel</span> + ;<br /> oBrw:<span style="color: #000000;">MouseRowPos</span><span style="color: #000000;">(</span> nRow <span style="color: #000000;">)</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /><br /> </div>[/code:xgewx0y8]
You may adopt your column numbers and other logic.
Incidentally, there is a minor defect in implementation of this tooltip. Tooltip is not refreshed when we move from row to row in the same column. User has to leave the column and re-enter the column on a different row. |
xBrowse Cell ToolTip | This is the code for non-array browses.
[code=fw:26a6xggv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> XbrDbfToolTip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /><br /><br /> USE CUSTOMER<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CUSTOMER'</span> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER<br /><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span> | oBrw, nRow, nCol, nFlags | MyToolTip<span style="color: #000000;">(</span> oBrw, nRow, nCol, nFlags<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> CLOSE CUSTOMER<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MyToolTip<span style="color: #000000;">(</span> oBrw, nRow, nCol, nFlags <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nSaveRec := oBrw:<span style="color: #000000;">BookMark</span><br /> <span style="color: #00C800;">local</span> nMouseRow := oBrw:<span style="color: #000000;">MouseRowPos</span><span style="color: #000000;">(</span> nRow <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cRet := <span style="color: #ff0000;">''</span><br /><br /> <span style="color: #00C800;">if</span> nMouseRow > <span style="color: #000000;">0</span><br /><br /> oBrw:<span style="color: #000000;">Skip</span><span style="color: #000000;">(</span> nMouseRow - oBrw:<span style="color: #000000;">nRowSel</span> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">// or alternatively,</span><br /><span style="color: #B900B9;">// oBrw:KeyNo( oBrw:KeyNo() + nMouseRow - oBrw:nRowSel )</span><br /> cRet := <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->First<br /> oBrw:<span style="color: #000000;">BookMark</span> := nSaveRec<br /><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cRet<br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /> </div>[/code:26a6xggv]
Theoretically this is correct code. But at times this is showing wrong results.
Probably either the result of MouseRowPos() method is not very accurate all the times or the nRow parameter value is not correct all the times.
Please test for yourself |
xBrowse Cell ToolTip | Mr. Rao,
I don't know, if it can be used, to display the complete Cell-text ?
I would like to show the full path / name of a selected BMP without using HScroll.
[img:1gji6iqb]http://pflegeplus.com/pictures/xbrwtoolt1.jpg[/img:1gji6iqb]
...
...
[color=#0000FF:1gji6iqb]oBrw1:aCols[ 2 ]:nWidth := 70
oBrw1:aCols[ 2 ]:nEditType := TYPE_IMAGE
oBrw1:aCols[ 2 ]:lBmpStretch := .f.
oBrw1:aCols[ 2 ]:lBmpTransparent := .t.
oBrw1:aCols[ 2 ]:bStrImage := {|oCol, oLbx70| oBrw1:aRow[ 3 ] }
oBrw1:aCols[ 2 ]:nDataBmpAlign := AL_CENTER
oBrw1:aCols[ 2 ]:bPopUp := { | o | ColMenu( o ) }
oBrw1:aCols[ 3 ]:nWidth := 170
oBrw1:aCols[ 3 ]:nEditType := EDIT_BUTTON
oBrw1:aCols[ 3 ]:bEditBlock := {|nRow, nCol, oCol| oCol:Value := GET_BMP()}
oBrw1:CreateFromCode()[/color:1gji6iqb]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
xBrowse Cell ToolTip | Are you using array to browse? |
xBrowse Cell ToolTip | Mr Uwe
This is the suggested code:
[code=fw:3glggkmi]<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: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcompat.ch"</span><br /><br />REQUEST DBFCDX<br /><br />#xtranslate <x> <span style="color: #000000;">[</span>is<span style="color: #000000;">]</span> between <a> and <b> => <span style="color: #000000;">(</span> <x> >= <a> .and. <x> <= <b> <span style="color: #000000;">)</span><br />#xtranslate <x> <span style="color: #000000;">[</span>is<span style="color: #000000;">]</span> not between <a> and <b> => !<span style="color: #000000;">(</span> <x> between <a> and <b> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /> <span style="color: #00C800;">local</span> aBmp := <span style="color: #000000;">{</span> ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6array.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6back.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6block.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6char.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6clip.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6code.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6COPY.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6date.bmp"</span>, ;<br /> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6dbgbrk.bmp"</span> <span style="color: #000000;">}</span><br /><br /> SetBalloon<span style="color: #000000;">(</span> .t. <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> ;<br /> ARRAY aBmp HEADERS <span style="color: #ff0000;">"Bmp"</span>, <span style="color: #ff0000;">"File"</span> SIZES <span style="color: #000000;">32</span> LINES CELL<br /><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cDataType</span> := <span style="color: #ff0000;">"F"</span><br /> ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">AT</span> <span style="color: #000000;">1</span> <span style="color: #00C800;">DATA</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> HEADER <span style="color: #ff0000;">"No."</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99"</span><br /><br /> oBrw:<span style="color: #000000;">bToolTips</span> := <span style="color: #000000;">{</span> | oBrw, nRow | ShowBmpFileName<span style="color: #000000;">(</span> oBrw, nRow <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ShowBmpFileName<span style="color: #000000;">(</span> oBrw, nRow <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> nMouseRow := oBrw:<span style="color: #000000;">MouseRowPos</span><span style="color: #000000;">(</span> nRow <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> nMouseRow > <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">return</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">[</span> oBrw:<span style="color: #000000;">nArrayAt</span> - oBrw:<span style="color: #000000;">nRowSel</span> + nMouseRow <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">""</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:3glggkmi]
Code for display of bitmaps can be simplified as above.
Still I advise you not to implement this feature. The results are not accurate.
There is something wrong inside xbrowse code, because of which we are not getting the correct row position in all cases. Let us wait till the problem in xbrowse is resolved. |
xBrowse Cell ToolTip | Mr. Rao,
Thank You very much for the Info.
I agree with You. It is better, to show only 100 % working Solutions.
[color=#008040:1ck5uyiu]Let us wait till the problem in xbrowse is resolved[/color:1ck5uyiu]
In the meantime I found a Solution to display the Fileinfo.
Because the Browser-preview is small, I use Col 4 for the full Fileinfo, but showing only a Button.
Next I use FileNoPath of Col 4, to show after Selection only the Filename in Col 3.
[img:1ck5uyiu]http://www.pflegeplus.com/pictures/xbrwbmp2.jpg[/img:1ck5uyiu]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xBrowse Cell ToolTip | Frances/Rao, is this feature running smoothly now? |
xBrowse Cell ToolTip | Dear Hua,
Im using FWH12.05.. still not ideal.. maybe with newer FW version.. |
xBrowse Cell ToolTip | Thanks for the feedback Frances <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
xBrowse Cell-Bitmap-Adj. with METH. aCellCors(nRownCol) ? | Hello,
I just started, to use graphics in xbrowse.
As a substitute for brushes, i could create Bitmaps.
But when i do this, the bitmap must be adjusted to
the cell-size and the text has to be shown on top
of the bitmap not right hand side.
In the moment it looks like :
[img:butsbyd7]http://www.pflegeplus.com/pictures/brush1.jpg[/img:butsbyd7]
There are some topics about, how a bitmap is shown in a cell / Col.
Is it not possible, to do it the other way, a adjust of the bitmap
belongs the cell-size ?
oBrw6:aCols[ 2 ]:AddResource("Diacross") => ADJUST with Cell-dimension ?
oBrw6:aCols[ 2 ]:bBmpData := {|| 1 }
oBrw6:aCols[ 2 ]:bStrData := {|| "TEST" } => Text OVER Bitmap if used as Brush ?
Maybe something like that, is possible in the future ?
Regards
Uwe[/img] |
xBrowse Cell-Bitmap-Adj. with METH. aCellCors(nRownCol) ? | Uwe,
Your screenshot looks fine. What would you like to change in it ?
To get the bitmaps expanded up to the cell borders ? |
xBrowse Cell-Bitmap-Adj. with METH. aCellCors(nRownCol) ? | Antonio,
Here is a better sample, what i mean.
Today i had a look a the Update of 8.03
there i found a new METHOD aCellCors( nRow, nCol ).
( Returns > Top, Left, Bottom, Right of a cell.
I think, with this information it could be possible, to fill
the cell complete with a Brush / Bitmap ?
[img:2n8yzovf]http://www.pflegeplus.com/pictures/brush2.jpg[/img:2n8yzovf]
Regards
uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> [/img] |
xBrowse Color | oBrw: nDataLines: = 2
oCol1: bStrData :={|| "línea de texto 1" + CRLF + "línea de texto 2"}
Resultado de la xBrowse:
TEXTO LA LÍNEA 1
TEXTO LÍNEA 2
Ahora tengo que hacer un color diferente para cada línea.
Resultado de la xBrowse:
TEXTO LA LÍNEA 1
TEXTO LÍNEA 2
gracias |
xBrowse Color | Checa este hilo :
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=19153&p=100655&hilit=calendario#p100655">viewtopic.php?f=6&t=19153&p=100655&hilit=calendario#p100655</a><!-- l -->
Saludos |
xBrowse Color | Raimundo, gracias |
xBrowse Color | Raimundo.
El tema que usted ha indicado, su último mensaje, se muestra la pantalla.
Muéstrame cómo la barra (de color naranja degradado) de la primera navegar (Mensual)
Gracias |
xBrowse Color | não laranja é amarelo e as cores tomar classe RibbonBar.
Saludos |
xBrowse Color a Column using HB_DECODE ( Rao ) | Rao
I am using some code from an old working program using xBrowse .. I have a defined column "Status" which maps back to a recordset field named FANSWER. Here is the code .. I want to color the "Status" ( oRsTrav:Fields("FANSWER"):Value ) column with either Red, Green or Yellow based on three possibilities ..
[code=fw:2sc2cv6y]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// EMployee browse -----------------------</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbxB ;<br /> RECORDSET oRsTrav ;<br /> COLUMNS <span style="color: #ff0000;">"PERSNO"</span>, ;<br /> <span style="color: #ff0000;">"EMPLOYEE"</span>, ;<br /> <span style="color: #ff0000;">"EVENT"</span>, ;<br /> <span style="color: #ff0000;">"LOCATION"</span>, ;<br /> <span style="color: #ff0000;">"SPONSOR"</span>, ;<br /> <span style="color: #ff0000;">"FANSWER"</span>, ;<br /> <span style="color: #ff0000;">"GRANDTOT "</span> ;<br /> COLSIZES <span style="color: #000000;">85</span>,<span style="color: #000000;">135</span>,<span style="color: #000000;">135</span>,<span style="color: #000000;">135</span>,<span style="color: #000000;">135</span>,<span style="color: #000000;">85</span>,<span style="color: #000000;">100</span> ;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"999,999.99"</span>;<br /> HEADERS <span style="color: #ff0000;">"Persno"</span>, ;<br /> <span style="color: #ff0000;">"Employee Name"</span>, ;<br /> <span style="color: #ff0000;">"Event Name"</span>, ;<br /> <span style="color: #ff0000;">"Location"</span>, ;<br /> <span style="color: #ff0000;">"Sponsor"</span>, ;<br /> <span style="color: #ff0000;">"Status"</span>, ;<br /> <span style="color: #ff0000;">"Total"</span> ;<br /> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">132</span> <span style="color: #0000ff;">of</span> oGrps ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> FOOTERS LINES CELL<br /><br />* oLbxB:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> oLbxB:<span style="color: #000000;">lRecordSelector</span> := .f.<br /><br /> oLbxB:<span style="color: #000000;">lFooter</span> := .t.<br /> oCol1 := oLbxB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> oCol1:<span style="color: #000000;">bFooter</span> := <span style="color: #000000;">{</span> || Ltrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> oLbxB:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" / "</span> + LTrim<span style="color: #000000;">(</span> Str<span style="color: #000000;">(</span> oLbxB:<span style="color: #000000;">KeyCount</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oLbxB:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oCol1:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oLbxB:<span style="color: #000000;">bClrGrad</span> := <span style="color: #000000;">{</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lInvert, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>, <span style="color: #000000;">15790320</span>, <span style="color: #000000;">15790320</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>, <span style="color: #000000;">15790320</span>, <span style="color: #000000;">15790320</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>, <span style="color: #000000;">15790320</span>, <span style="color: #000000;">15790320</span> <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">0.50</span>, <span style="color: #000000;">15790320</span>, <span style="color: #000000;">15790320</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>oRsTrav:<span style="color: #000000;">eof</span>, ,oLbxB:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Status"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">bClrStd</span> := ; <span style="color: #B900B9;">// <--- here</span><br /> <span style="color: #000000;">{</span> || HB_Decode<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> oLbxB:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Status"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">value</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #ff0000;">"APPROVED"</span>, <span style="color: #000000;">{</span> CLR_BLACK, CLR_HGREEN <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"OPEN"</span>, <span style="color: #000000;">{</span> CLR_BLACK, CLR_YELLOW <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"REJECTED"</span>, <span style="color: #000000;">{</span> CLR_WHITE, CLR_HRED <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> </div>[/code:2sc2cv6y]
Why does this code not work ?? .. or perhaps you can suggest a better way of coding this ..
Thanks
Rick Lipkin |
xBrowse Color a Column using HB_DECODE ( Rao ) | Please use FW_DECODE() instead of HB_DECODE()
[code=fw:774o8n3c]<div class="fw" id="{CB}" style="font-family: monospace;"> oLbxB:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Status"</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">bClrStd</span> := ; <span style="color: #B900B9;">// <--- here</span><br /> <span style="color: #000000;">{</span> || FW_Decode<span style="color: #000000;">(</span> UPPER<span style="color: #000000;">(</span> AllTrim<span style="color: #000000;">(</span> oLbxB:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Status"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">value</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #ff0000;">"APPROVED"</span>, <span style="color: #000000;">{</span> CLR_BLACK, CLR_HGREEN <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"OPEN"</span>, <span style="color: #000000;">{</span> CLR_BLACK, CLR_YELLOW <span style="color: #000000;">}</span>, ;<br /> <span style="color: #ff0000;">"REJECTED"</span>, <span style="color: #000000;">{</span> CLR_WHITE, CLR_HRED <span style="color: #000000;">}</span>, ;<br /> <span style="color: #000000;">{</span> CLR_BLACK, CLR_WHITE<span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// last is default </span><br /> </div>[/code:774o8n3c]
Note: eof check is not necessary. |
xBrowse Color a Column using HB_DECODE ( Rao ) | Rao
Thank you .. your code worked perfectly ..
Thank You VERY Much!
Rick Lipkin |
xBrowse Con DatePicker y TimePicker | Saludos/Regards
Hoy les dejo otra contribucion para la xBrowse, uso de DatePicker y TimePicker en edicion de celdas.
Other contribution for xbrowse class, use datepicker and timepicker in celledition
Comenzamos/Start
Este Link es un Exe si quieren probar antes de hacer cambios
this link is EXE, if you want to try first before making any changes ...
[url:6z27vtu5]http://www.sitasoft.com/fivewin/test/testdtp.rar[/url:6z27vtu5]
[b:6z27vtu5]Archivos a editar / file to edit[/b:6z27vtu5]
xbrowse.ch
xbrowse.prg
[b:6z27vtu5]Metodos a Editar en xBrowse.prg/ Methods to Edit in xBrwose.prg[/b:6z27vtu5]
METHOD PaintData() CLASS TXBrwColumn
METHOD Edit() CLASS TXBrwColumn
function EditGetkeyDown()
METHOD PostEdit() CLASS TXBrwColumn
[b:6z27vtu5]Abrir/open xBrowse.ch[/b:6z27vtu5]
[b:6z27vtu5]Buscar / find[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> EDIT_GET_BUTTON <span style="color: #000000;">5</span></div>[/code:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Agregar Despues/ Add After[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> EDIT_DATE <span style="color: #000000;">6</span><br /><span style="color: #00D7D7;">#define</span> EDIT_TIME <span style="color: #000000;">7</span></div>[/code:6z27vtu5]
[b:6z27vtu5]Guardar/save[/b:6z27vtu5]
[b:6z27vtu5]Abrir xBrowse.prg[/b:6z27vtu5]
[b:6z27vtu5]Bucar / Find[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Report.ch"</span></div>[/code:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Agregar Despues / Add After[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span></div>[/code:6z27vtu5]
[b:6z27vtu5]Buscar METHOD nEditType(); // Sets or Gets de Edit Mode / Find METHOD nEditType(); // Sets or Gets de Edit Mode[/b:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Agregar Antes / Add Before[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">METHOD</span> EditDateTime<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span></div>[/code:6z27vtu5]
[b:6z27vtu5]Buscar en METHOD PaintData() / Find in METHOD PaintData()[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> nType > <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">if</span> lSelected<br /> </div>[/code:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Reemplazar con / Replace With[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> nType > <span style="color: #000000;">1</span> .and. nType < EDIT_DATE<br /> <span style="color: #00C800;">if</span> lSelected</div>[/code:6z27vtu5]
[b:6z27vtu5]Buscar en Method Edit / Find In Edit Method[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> aColors := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrEdit</span> <span style="color: #000000;">)</span></div>[/code:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Agregar Antes / Add Before[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nEditType</span> >= EDIT_DATE<br /> <span style="color: #00C800;">return</span> ::<span style="color: #000000;">EditDateTime</span><span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:6z27vtu5]
[b:6z27vtu5]Buscar en function EditGetkeyDown / Find in function EditGetkeyDown[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">If</span> lExit<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> := nKey<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span></div>[/code:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Reemplazar con / Replace With[/b:6z27vtu5][/i:6z27vtu5] [color=#FF0000:6z27vtu5](revisar este cambio en el proximo post)[/color:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">If</span> lExit .and. ::<span style="color: #000000;">nEditType</span> != EDIT_DATE<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> := nKey<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">PostEdit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span></div>[/code:6z27vtu5]
[b:6z27vtu5]Buscar en function EditGetkeyDown / Find in function EditGetkeyDown[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:6z27vtu5]
[i:6z27vtu5][b:6z27vtu5]Agregar Depues / Add After[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> EditDateTime<span style="color: #000000;">(</span> nKey <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><span style="color: #00C800;">local</span> aColors<br /><span style="color: #00C800;">local</span> lCenter, lRight<br /><span style="color: #00C800;">local</span> nRow, nCol, nWidth, nHeight<br /><span style="color: #00C800;">local</span> hBrush<br /><span style="color: #00C800;">local</span> oFont<br /><span style="color: #00C800;">local</span> uValue<br /><br /><br /><br /> <span style="color: #00C800;">if</span> ValType <span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditFont</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span><br /> oFont = Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditFont</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oFont = ::<span style="color: #000000;">oEditFont</span><br /> <span style="color: #00C800;">endif</span><br /><br /> uValue := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bEditValue</span> <span style="color: #000000;">)</span><br /><br /> aColors := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bClrEdit</span> <span style="color: #000000;">)</span><br /> lCenter := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nDataStrAlign</span> == AL_CENTER <span style="color: #000000;">)</span><br /> lRight := <span style="color: #000000;">(</span> ::<span style="color: #000000;">nDataStrAlign</span> == AL_RIGHT <span style="color: #000000;">)</span><br /><br /> nRow := <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowSel</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> * ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> <span style="color: #000000;">)</span> + ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">HeaderHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> hBrush := CreateSolidBrush<span style="color: #000000;">(</span> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">EraseData</span><span style="color: #000000;">(</span> nRow, ::<span style="color: #000000;">nDisplayCol</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> , hBrush <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hBrush <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nEditType</span> == EDIT_DATE<br /> ::<span style="color: #000000;">oEditGet</span> := TDatePick<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">{</span> | u | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>PCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span>==<span style="color: #000000;">0</span>,uValue,uValue:= u <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ::<span style="color: #000000;">oBrw</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, , aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,;<br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, oFont, .f., , , , .f., , , <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> ::<span style="color: #000000;">oEditGet</span> := TTimePick<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">{</span> | u | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span>PCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span>==<span style="color: #000000;">0</span>,uValue,uValue:= u <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, ::<span style="color: #000000;">oBrw</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, , aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>,;<br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, oFont, .f., , , , .f., , , <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SetTime</span><span style="color: #000000;">(</span> uValue <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span> <br /> <br /> nRow := <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowSel</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> * ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> <span style="color: #000000;">)</span> + ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">HeaderHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #000000;">2</span><br /> nCol := ::<span style="color: #000000;">nDisplayCol</span> + <span style="color: #000000;">3</span><br /><br /> nWidth := ::<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">4</span><br /><br /> nHeight := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nRowHeight</span> - <span style="color: #000000;">4</span><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bEditValid</span> != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bValid</span> := <span style="color: #000000;">{</span> | oGet, lRet | oGet:<span style="color: #000000;">lValidating</span> := .T., lRet := Eval<span style="color: #000000;">(</span> ::<span style="color: #000000;">bEditValid</span>, oGet, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span>, oGet:<span style="color: #000000;">lValidating</span> := .F., <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> ! lRet, oGet:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>, lRet <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">{</span> | nKey | EditGetkeyDown<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, nKey <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nEditType</span> != EDIT_DATE<br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">bLostFocus</span> := <span style="color: #000000;">{</span> | oGet, hWndFocus | EditGetLostFocus<span style="color: #000000;">(</span> oGet, hWndFocus, ::<span style="color: #000000;">oBrw</span>, ::<span style="color: #000000;">oEditGet</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">nLastKey</span> := <span style="color: #000000;">0</span><br /><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> nRow, nCol, nWidth, nHeight, .t. <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">SelectAll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">lEditMode</span> := .T.<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEditBorder</span><br /> WndBoxIn<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, nRow<span style="color: #000000;">-1</span>, nCol<span style="color: #000000;">-1</span>, nRow + nHeight + <span style="color: #000000;">1</span>, nCol + nWidth + <span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> nKey != <span style="color: #00C800;">nil</span><br /> PostMessage<span style="color: #000000;">(</span> ::<span style="color: #000000;">oEditGet</span>:<span style="color: #000000;">hWnd</span>, WM_CHAR, nKey <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nLastEditCol</span> := ::<span style="color: #000000;">nPos</span> <br /> <br /> <br /><span style="color: #00C800;">RETURN</span> .t.</div>[/code:6z27vtu5]
[b:6z27vtu5]Buscar En METHOD PostEdit / Find In METHOD PostEdit[/b:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">case</span> ::<span style="color: #000000;">nEditType</span> == EDIT_GET</div>[/code:6z27vtu5]
[i:6z27vtu5]
[b:6z27vtu5]En linea Agregar Despues (Fin de Linea) / IN Line Add After (end of Line)[/b:6z27vtu5][/i:6z27vtu5]
[code=fw:6z27vtu5]<div class="fw" id="{CB}" style="font-family: monospace;">.or. ::<span style="color: #000000;">nEditType</span> >= EDIT_DATE</div>[/code:6z27vtu5]
[b:6z27vtu5]Guardar / Save[/b:6z27vtu5]
[b:6z27vtu5]Ejemplo / Sample[/b:6z27vtu5]
[code=fw:6z27vtu5]<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: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span><br /><br /><span style="color: #00C800;">Function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oWnd, oBrw, oBrw2, oFld<br /><span style="color: #00C800;">local</span> aArray := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"one"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"two"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"three"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"four"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"five"</span>,time<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /> set date format <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">"mm/dd/yyyy"</span><br /><br /> use customer <span style="color: #0000ff;">alias</span> customer <span style="color: #00C800;">new</span><br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Test DatePick and TimePick on xBrwose"</span> <br /> <br /> <br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">size</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">300</span>;<br /> <span style="color: #0000ff;">PROMPTS</span> <span style="color: #ff0000;">"Array"</span>, <span style="color: #ff0000;">"Dbf"</span> <br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">xbrowse</span> oBrw columns <span style="color: #000000;">{</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">}</span> array aArray <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> fastedit<br /> <br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">25</span><br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_TIME<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">130</span><br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_DATE<br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">130</span><br /><br /> oBrw:<span style="color: #000000;">lAutoappend</span> := .f.<br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">xbrowse</span> oBrw2 columns <span style="color: #ff0000;">"first"</span>, <span style="color: #ff0000;">"last"</span>, <span style="color: #ff0000;">"hiredate"</span> <span style="color: #0000ff;">alias</span> <span style="color: #ff0000;">"customer"</span> <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> fastedit<br /> <br /> oBrw2:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">25</span><br /> <br /> <br /> oBrw2:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nEditType</span> := EDIT_DATE<br /> oBrw2:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">130</span><br /><br /> oBrw2:<span style="color: #000000;">lAutoappend</span> := .f.<br /> oBrw2:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span> := oFld<br /> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oClient</span> := oBrw<br /> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oClient</span> := oBrw2<br /> <br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">init</span> <span style="color: #000000;">(</span>oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">resize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:6z27vtu5] |
xBrowse Con DatePicker y TimePicker | Descubri un pequeño bugs en estos cambios, aqui esta la solucion...
cambiar en function EditGetkeyDown
buscar
[code=fw:28keb8zp]<div class="fw" id="{CB}" style="font-family: monospace;"> ::<span style="color: #000000;">PostEdit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:28keb8zp]
reemplazar con
[code=fw:28keb8zp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">if</span> lExit<br /> ::<span style="color: #000000;">PostEdit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:28keb8zp] |
xBrowse Darstellg. => OemToAnsi ??? | Hallo aus Essen,
Bei Browser-Tools kann man normalerweise
in die Darstellung von OemToAnsi wechseln.
Um Daten darzustellen erzeuge ich nur einen Browser
ohne Spalten-Definitionen :
In den DB-Tools enthält das Quickbrowse-Modul
folgenden Programm-Code :
Gesucht wird :
IF OemAnsi = .T. .....
Ändern von Get and Edit in oBrw5 and oBrw6 ????
----------------------------------------------------------
oBrw5 := TXBrowse():New( oDlg )
oBrw5:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw5:nColDividerStyle := LINESTYLE_BLACK
oBrw5:nRowDividerStyle := LINESTYLE_BLACK
oBrw5:lColDividerComplete := .t.
oBrw5:nHeaderLines := 1
oBrw5:nDataLines := 1
oBrw5:lAllowColSwapping := .t.
oBrw5:SetRDD()
lClrFlag:=.f.
for nFor := 1 to len( oBrw5:aCols )
oCol := oBrw5:aCols[ nFor ]
oBrw5:bSkip:={| nRecs | ;
( if(nRecs == nil, nRecs := 1,),nRecs:= (1)->(dbskipper( nRecs )), ;
lClrFlag:= if( nRecs % 2 = 0, lClrFlag,!lClrFlag), nRecs) }
// Define alternating row colors
oBrw5:bClrStd := { || Colors() }
oCol:nEditType := 1
oCol:bOnPostEdit := ;
{|o, v, n| IIF( n != VK_ESCAPE, ( IIF( NET_RLOCK(), ;
FieldPut( o:nCreationOrder, v ), NET_ULOCK() ), NIL ), ) }
next
for nFor := 1 to Fcount()
oBrw5:aCols[ nFor ]:bRClickHeader := ;
{|r,c,f,o| cFELD := o:cHeader, ; // = oCol:cHeader
nOrder := o:nCreationOrder, ; // = Header-Click-Col
cFilter := SET_INDEX(oBrw5,cFELD,cFILTER), ;
IIF(DBFTYP = "CDX", ;
cINDKEY := ORDKEY( "NEUINDEX" ), ;
cINDKEY := INDEXKEY( 0 ) ), ;
oBrw5:SetFocus(), ;
oBrw5:GoTop(), oBrw5:VGoTop(), oBrw5:Refresh(), ;
l_INDEX := .T., oINDKEY:Refresh(), ;
oFilter:Refresh(), ;
oBrw5:SwapCols( 1, nOrder ), ; // Bring selected col to 1
oBrw5:GoLeftMost(), ; // Go to 1. Col ( indexed )
oBrw5:nFreeze := 1 } // Freeze 1. Col
next
oBrw5:bChange := { || oDlg:Update() }
oBrw5:CreateFromResource( 110 )
// -------------- ARRAY ------------------------------------------
oBrw6 := TXBrowse():New( oDlg )
oBrw6 :SetArray( (1)->( dbStruct() ), .f. )
oBrw6:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw6:nColDividerStyle := LINESTYLE_BLACK
oBrw6:nRowDividerStyle := LINESTYLE_BLACK
oBrw6:lColDividerComplete := .t.
oBrw6:nHeaderLines := 1
oBrw6:nDataLines := 1
oBrw6:lAllowColSwapping := .t.
oBrw6:SetRDD()
ASIZE( oBrw6:aCols, 4 )
AEVAL( oBrw6:aArrayData, { |a| nMaxWidth := ;
Max( nMaxWidth, a[3] ) } )
WITH OBJECT oBrw6:AddCol()
:bStrData := ;
:bEditvalue := { || PADR( cValToChar( (1)->( FieldGet( oBrw6:nArrayAt ) ) ), nMaxWidth ) }
:nEditType := EDIT_GET
:bOnPostEdit:= { | oCol, xValue, nLastKey | ;
OnEdit( obrw6, oCol, xValue, ;
nLastKey, lOemAnsi ), oDlg:Update() }
END
AEval( oBrw6:aCols, { |oCol, nCol| oCol:cHeader := ;
{ "FieldName", "Typ", "Len", "Dec","Value" }[ nCol ] } )
oBrw6:aCols[ 1 ]:nWidth := 100
oBrw6:aCols[ 3 ]:nDataStrAlign := AL_RIGHT
oBrw6:aCols[ 4 ]:nDataStrAlign := AL_RIGHT
oBrw6:nColSel := 5
oBrw6:lUpdate := .t.
oBrw6:Cargo := oBrw5
oBrw6:bChange := { || oDlg:Update() }
oBrw6:CreateFromResource( 115 )
....
.....
//----------------------------------------------------------------------------//
FUNCTION OnEdit( oBrw6, oCol, xValue, nLastKey, lOemAnsi )
IF nLastKey == 13
SWITCH Eval( oBrw6:aCols[2]:bStrData )
CASE 'N'
xValue := Val( xValue )
EXIT
CASE 'D'
xValue := CTOD( ALLTRIM( xValue ) )
EXIT
CASE 'L'
xValue := ( Upper( Left ( LTrim( xValue ), 1 ) ) $ "YT" )
EXIT
DEFAULT
END
NET_RLOCK()
(1)->( FieldPut( oBrw6:nArrayAt, xValue ) )
NET_ULOCK()
oBrw6:DrawLine( .t. )
oBrw6:Cargo:DrawLine( .t. )
ENDIF
RETURN NIL
Besteht für eine OemToAnsi-Darstellung
für Text- und Memo-Felder eine Möglichkeit,
den Programm-Code zu ändern,
ohne Spalten zu definieren ?
Danke <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
Uwe König |
xBrowse Database fields | What method to be used to choose certain fields in certain order to browse using xbrowse.
[code:2l34avcu]
method browser()
local oDlg,oBrw,oMeter,oFont,oCol,nFor,oChild
::setOrder(2)
::gotop()
define font oFont name "Ms Sans Serif" size 0,-14 BOLD
DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "meter reads browse "
oBrw := TXBrowse():New( oDlg )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:nHeaderLines := 1
oBrw:nFooterLines := 1
oBrw:nDataLines := 1
oBrw:lFooter := .t.
oBrw:CreateFromCode()
oBrw:nTop = 0
oBrw:nLeft = 0
oBrw:nWidth = 1000
oBrw:nHeight =600
oBrw:SetRDD()
for nFor := 1 to ::Fcount()
oBrw:aCols[ nFor ]:oDataFont := oFont
next
// Setup for using database class
oBrw:cAlias:= ::cAlias
oBrw:bSkip:= {|nRecs| ::skipper( nRecs ) }
oBrw:bGotop:= {|| ::gotop() }
oBrw:bGoBottom:= {|| ::goBottom() }
oBrw:bBookMark := {| n | iif( n == nil, ::RecNo() , ::Goto( n ) ) }
oMeter:= self
ACTIVATE DIALOG oDlg ON INIT (oBrw:SetSize( 1000, 600 ), BuildButtons( oMeter,oBrw,oDlg),oBrw:Refresh(.t.), oDlg:Refresh(.t.))
RETURN nil
[/code:2l34avcu] |
xBrowse Database fields | Hello Ehab,
maybe this can help you.
<!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=8684">http://fivetechsoft.com/forums/viewtopic.php?t=8684</a><!-- m --> |
xBrowse Database fields | No I mean to force fields from a database using code and fix (always) browse .
Thanks |
xBrowse Database fields | I don’t know if I understand you well.
Do you mean you want selected fields of a dbf file not all and these in a certain order.
Then you have to use not:
oBrw:SetRDD()
for nFor := 1 to ::Fcount()
oBrw:aCols[ nFor ]:oDataFont := oFont
next
but for every field you want something like this:
oBrw:nRowHeight := 18
// 2
oCol := oBrw:AddCol()
oCol:cHeader := "LAST"
oCol:bStrData := { || _FIELD->LAST}
oCol:nWidth := 146
// 1
oCol := oBrw:AddCol()
oCol:cHeader := "FIRST"
oCol:bStrData := { || _FIELD->FIRST}
oCol:nWidth := 146 |
xBrowse Default Edit fields OverStrike vs Insert mode | Rao
I know we have talked about this before, but to be compatible with Excel and many other Microsoft products, it would be nice if the Field edit would by default be in Insert Mode rather than over-strike.
I just opened Excel and went to edit a cell and moved my cursor back a few characters and started typing and all the previous text moved to the right. Even in these forums, if you move your cursor back and start typing .. all the text moves to the right as in Insert mode .. not over-strike.
I would appreciate your thoughts ?
Thanks
Rick Lipkin |
xBrowse Default Edit fields OverStrike vs Insert mode | Personally I too prefer insert mode.
But there is nothing like default for xbrowse-get or independent get. Get just follows the existing setting of insert mode set by programmer or user.
So, please just use Set( _SET_INSERT, .t. ) and then all subsequent xbrowse-gets and independent gets work in insert mode. |
xBrowse Default Edit fields OverStrike vs Insert mode | Rao
I am just getting back to this topic and I approve of the Insert Behavoir, unfortunitly, the cursor is too fat. I have searched the forums and found several topics on this
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=21995&hilit=set+cursor">viewtopic.php?f=3&t=21995&hilit=set+cursor</a><!-- l -->
However, is there a global cursor setting that will force the thin cursor even when the set insert is turned on ?
Rick Lipkin
[img:1bknzv16]http://i62.tinypic.com/qzf9g2.jpg[/img:1bknzv16] |
xBrowse Default Edit fields OverStrike vs Insert mode | [code=fw:2c7pv9g2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// testget3.prg Model.</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> FromCode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//FromrES()</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">Function</span> FromCode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg<br /> <span style="color: #00C800;">local</span> oGet1, oGet2, oGet3, oGet4<br /> <span style="color: #00C800;">local</span> cVar1, cVar2, cVar3, cVar4, oHand<br /> <span style="color: #00C800;">local</span> lActive := .f.<br /> <br /> cVar1 := <span style="color: #000000;">0</span><br /> cVar2 := <span style="color: #000000;">0</span><br /> cVar3 := <span style="color: #000000;">0</span><br /> cVar4 := <span style="color: #000000;">0</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand HAND<br /> <br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"From Code"</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">300</span><br /><br /> Set<span style="color: #000000;">(</span> _SET_INSERT, ! Set<span style="color: #000000;">(</span> _SET_INSERT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">get</span> oGet1 <span style="color: #0000ff;">var</span> cVar1 bitmap <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"With Transparent"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">12</span> ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /><br /> @ <span style="color: #000000;">40</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">get</span> oGet2 <span style="color: #0000ff;">var</span> cVar2 bitmap <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Without Transparent"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">12</span> ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /><br /> @ <span style="color: #000000;">70</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">get</span> oGet3 <span style="color: #0000ff;">var</span> cVar3 bitmap <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>hkyes.bmp"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"With Adjust-Transparent"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">12</span> ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /><br /> @ <span style="color: #000000;">100</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">get</span> oGet4 <span style="color: #0000ff;">var</span> cVar4 bitmap <span style="color: #ff0000;">"..<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>hkyes.bmp"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lActive,oGet3:<span style="color: #000000;">disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oGet3:<span style="color: #000000;">enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, ;<br /> lActive:= !lActive, oDlg:<span style="color: #0000ff;">update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">12</span> ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /> <br /> oGet1:<span style="color: #000000;">lBtnTransparent</span> := .t. <span style="color: #B900B9;">// transparent button get oGet1</span><br /> <br /> oGet3:<span style="color: #000000;">disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oGet3:<span style="color: #000000;">lBtnTransparent</span> := .t. <span style="color: #B900B9;">// transparent button get oGet3</span><br /> oGet3:<span style="color: #000000;">lAdjustBtn</span> := .t. <span style="color: #B900B9;">// Button Get Adjust Witdh oGet3</span><br /> oGet3:<span style="color: #000000;">lDisColors</span> := .f. <span style="color: #B900B9;">// Deactive disable color</span><br /> oGet3:<span style="color: #000000;">nClrTextDis</span> := CLR_WHITE <span style="color: #B900B9;">// Color text disable status</span><br /> oGet3:<span style="color: #000000;">nClrPaneDis</span> := CLR_BLUE <span style="color: #B900B9;">// Color Pane disable status</span><br /> <br /> oGet4:<span style="color: #000000;">lAdjustBtn</span> := .t.<br /> <br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">centered</span><br /><br /> Set<span style="color: #000000;">(</span> _SET_INSERT, ! Set<span style="color: #000000;">(</span> _SET_INSERT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <br /><span style="color: #00C800;">Function</span> FromRes<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg<br /> <span style="color: #00C800;">local</span> oGet1, oGet2, oGet3, oGet4<br /> <span style="color: #00C800;">local</span> cVar1, cVar2, cVar3, cVar4, oHand<br /> <span style="color: #00C800;">local</span> lActive := .f.<br /> <br /> cVar1 := <span style="color: #000000;">0</span><br /> cVar2 := <span style="color: #000000;">0</span><br /> cVar3 := <span style="color: #000000;">0</span><br /> cVar4 := <span style="color: #000000;">0</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Dedo"</span><br /> <br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"fromres"</span><br /><br /> Set<span style="color: #000000;">(</span> _SET_INSERT, ! Set<span style="color: #000000;">(</span> _SET_INSERT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">get</span> oGet1 <span style="color: #0000ff;">var</span> cVar1 <span style="color: #0000ff;">id</span> <span style="color: #000000;">100</span> bitmap <span style="color: #ff0000;">"on"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"With Transparent"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">get</span> oGet2 <span style="color: #0000ff;">var</span> cVar2 <span style="color: #0000ff;">id</span> <span style="color: #000000;">101</span> bitmap <span style="color: #ff0000;">"on"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Without Transparent"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">get</span> oGet3 <span style="color: #0000ff;">var</span> cVar3 <span style="color: #0000ff;">id</span> <span style="color: #000000;">102</span> bitmap <span style="color: #ff0000;">"chkyes"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"With Adjust-Transparent"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_BLACK, CLR_CYAN <span style="color: #0000ff;">of</span> oDlg ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /><br /> <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">get</span> oGet4 <span style="color: #0000ff;">var</span> cVar4 <span style="color: #0000ff;">id</span> <span style="color: #000000;">103</span> bitmap <span style="color: #ff0000;">"chkyes"</span> ;<br /> <span style="color: #0000ff;">action</span><span style="color: #000000;">(</span> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lActive,oGet3:<span style="color: #000000;">disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oGet3:<span style="color: #000000;">enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, ;<br /> lActive:= !lActive, oDlg:<span style="color: #0000ff;">update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">of</span> oDlg ;<br /> <span style="color: #0000ff;">CURSOR</span> oHand<br /> <br /> oGet1:<span style="color: #000000;">lBtnTransparent</span> := .t. <span style="color: #B900B9;">// transparent button get oGet1</span><br /> <br /> oGet3:<span style="color: #000000;">disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oGet3:<span style="color: #000000;">lBtnTransparent</span> := .t. <span style="color: #B900B9;">// transparent button get oGet3</span><br /> oGet3:<span style="color: #000000;">lAdjustBtn</span> := .t. <span style="color: #B900B9;">// Button Get Adjust Witdh oGet3</span><br /> oGet3:<span style="color: #000000;">lDisColors</span> := .f. <span style="color: #B900B9;">// Deactive disable color</span><br /> oGet3:<span style="color: #000000;">nClrTextDis</span> := CLR_WHITE <span style="color: #B900B9;">// Color text disable status</span><br /> oGet3:<span style="color: #000000;">nClrPaneDis</span> := CLR_BLUE <span style="color: #B900B9;">// Color Pane disable status</span><br /><br /> <br /> oGet4:<span style="color: #000000;">lAdjustBtn</span> := .t.<br /> <br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">centered</span><br /><br /> Set<span style="color: #000000;">(</span> _SET_INSERT, ! Set<span style="color: #000000;">(</span> _SET_INSERT <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /></div>[/code:2c7pv9g2] |
xBrowse Default Edit fields OverStrike vs Insert mode | Thank you for your code .. what I am trying to do is to make the insert block just a normal cursor line .. and the oHand Cursor does not effect that <!-- s:| --><img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral" /><!-- s:| -->
Rick Lipkin
[img:pqkjk9sf]http://i58.tinypic.com/bgz85d.jpg[/img:pqkjk9sf] |
xBrowse Default Edit fields OverStrike vs Insert mode | Mr Rick
Please set TGet():lChangeCaret := .f. somewhere towards the beginning of your Main() function.
You will see only the Thin Caret in all Gets whether in Insert Mode or OverWrite Mode. |
xBrowse Default Edit fields OverStrike vs Insert mode | [url:3g7oqunc]http://forums.fivetechsupport.com/viewtopic.php?f=3&t=27643&p=174440&hilit=lChangeCaret#p174440[/url:3g7oqunc] |
xBrowse Default Edit fields OverStrike vs Insert mode | Rao
This is an important topic for many developers .. a GREAT Solution! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Thank You
Rick Lipkin
[code=fw:l1zgn4ku]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// replaces overstrike in gets</span><br />Set<span style="color: #000000;">(</span> _SET_INSERT, .t. <span style="color: #000000;">)</span><br />TGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">lChangeCaret</span> := .f.<br /> </div>[/code:l1zgn4ku]
[img:l1zgn4ku]http://i60.tinypic.com/5f3spd.jpg[/img:l1zgn4ku] |
xBrowse Design Mode... | Any sample to use DESIGN mode for xBrowse?? |
xBrowse Design Mode... | there is a application to xbrowse design mode on source\classes |
xBrowse Design Mode... | Gagan,
It is FWH/samples/xbrwgen.prg
For Harbour users, this change is required in FWH/source/classes/xbrcode.prg line 1004:
// cText[1] := cText[1] - 32
cText = Chr( Asc( Left( cText, 1 ) ) - 32 ) + SubStr( cText, 2 ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.