topic
stringlengths
1
63
text
stringlengths
1
577k
xBrowse FW16.06 (Solucionado)
[code=fw:3crj0jp5]<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;">"tdolphin.ch"</span><br /><br />REQUEST HB_LANG_ES<br />REQUEST HB_CODEPAGE_ESWIN<br /><br /><span style="color: #00C800;">static</span> oCn, oServer<br /><span style="color: #00C800;">static</span> cHost := <span style="color: #ff0000;">"localhost"</span>, cUser := <span style="color: #ff0000;">"root"</span>, cPwd := <span style="color: #ff0000;">"cesar"</span>, cDB := <span style="color: #ff0000;">"test"</span><br /><span style="color: #00C800;">static</span> cCollate &nbsp; := <span style="color: #ff0000;">"utf8_spanish2_ci"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;HB_CDPSELECT<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ESWIN"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;HB_LangSelect<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ES"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Dolphin_test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Dolphin_test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oQry<br /><br />&nbsp; &nbsp;CONNECT oServer HOST cHost USER cUser PASSWORD cPwd DATABASE cDB<br /><br />&nbsp; &nbsp;oQry &nbsp;:= oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"select f.nombre as nomfam, r.* from rubros r left join familias f on f.codigo = r.familia order by r.nombre"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XBROWSER oQry <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Dolphin "</span> + cCollate AUTOSORT<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;<br />&nbsp;</div>[/code:3crj0jp5] Falla cuando hago click en el encabezado para ordenar en los casos que 1) El campo sea numerico y la tecla presionada sea alfabetica 2) El campo sea alfanumerico y la tecla presionada sea un nro.
xBrowse FW16.06 (Solucionado)
Mira se ayuda: [url:3po6wfrm]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=32514&start=0[/url:3po6wfrm]
xBrowse FW16.06 (Solucionado)
No veo la solucion ahi Karina. Probe con una solucion que indicaba cristobal HB_SETCODEPAGE( "UTF8" ) pero no obtuve resultado. Sigue colgandose el programa
xBrowse FW16.06 (Solucionado)
[url:1qn8mzd1]https&#58;//www&#46;tapatalk&#46;com/topic/32514-52609[/url:1qn8mzd1]
xBrowse FW16.06 (Solucionado)
Gracias Joao por tu interes. Sigue colgandose! Lo que propone el link que me pasaste es usar FW_SetUnicode( .T. ) HB_SETCODEPAGE( "UTF8" ) Pero sigue sin funcionar. Joao: Vos probaste el ejemplo que puse con Dolphin? Usas Harbour? Si es asi, no te deja de responder el programa? Gracias
xBrowse FW16.06 (Solucionado)
Lo siento, no uso ni un ni otro.
xBrowse FW16.06 (Solucionado)
This is not necessary FW_SetUnicode( .T. ) HB_SETCODEPAGE( "UTF8" ) When I build with dolphin.lib in fwh\lib folder, seek on numeric field is working well with current version My test program [code=fw:1k7rr9c2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> DlpSeek<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCn, oQry<br /><br />&nbsp; &nbsp;CONNECT oCn HOST cHost USER cUser PASSWORD cPw DATABASE cDb<br /><br />&nbsp; &nbsp;oQry &nbsp;:= oCn:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT * FROM CUSTOMER"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XBROWSER oQry AUTOSORT<br /><br />&nbsp; &nbsp;oQry:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCn:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1k7rr9c2] [url=https&#58;//imageshack&#46;com/i/pmbmGg9Kp:1k7rr9c2][img:1k7rr9c2]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/922/bmGg9K&#46;png[/img:1k7rr9c2][/url:1k7rr9c2]
xBrowse FW16.06 (Solucionado)
Mr Rao: Eso no lo habia puesto en el ejemplo original. El error me lo da cuando en un orden por campo numerico tipeo una letra, o en un orden por campo alfanumerico tecleo un numero. En el ejemplo, ud. tipea un numero en un campo numerico. En mi equipo, su ejemplo tambien deja de funcionar.
xBrowse FW16.06 (Solucionado)
Intenta en otro equipo. Cual és la memória RAM de esta computadora? Saludos.
xBrowse FW16.06 (Solucionado)
I see. Please try this modification in xbrowse and test. In xbrowse, please locate static function DolphinSeek Towards the end of this function you locate this line: [code=fw:2i8l4oss]<div class="fw" id="{CB}" style="font-family: monospace;">   lRet  := <span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> c, cSortOrder, nStart - <span style="color: #000000;">1</span>, oQry:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T., .T. <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2i8l4oss] Please replace this line with [code=fw:2i8l4oss]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oQry:<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> cSortorder &nbsp;<span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> .and. !ISDIGIT<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> c, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;lRet  := <span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> c, cSortOrder, <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, nStart - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, oQry:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T., .T. <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span></div>[/code:2i8l4oss] Can you please test with this change in xbrowse?
xBrowse FW16.06 (Solucionado)
Estimado Mr Rao: El error dejo de ocurrir. Igualmente, reemplace la linea [code=fw:1fd2onn2]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; lRet &nbsp;:= <span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> c, cSortOrder, <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, nStart - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, oQry:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .T., .T. <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span></div>[/code:1fd2onn2] por esta [code=fw:1fd2onn2]<div class="fw" id="{CB}" style="font-family: monospace;">lRet := <span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> c, cSortOrder, nStart - <span style="color: #000000;">1</span>, oQry:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,!oQry:<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> cSortorder &nbsp;<span style="color: #000000;">&#41;</span>==<span style="color: #ff0000;">'N'</span>, .T. <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span></div>[/code:1fd2onn2] Esa sugerencia me la habia pasado Cristobal, puesto que sino cuando tenia en la tabla los valores 13,130,1300 por ejemplo, cuando presionaba 13 se iba a 1300 El cambio quedo asi: [code=fw:1fd2onn2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> oQry:<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> cSortorder &nbsp;<span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> .and. !ISDIGIT<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Right</span><span style="color: #000000;">&#40;</span> c, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;lRet := <span style="color: #000000;">&#40;</span> oQry:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> c, cSortOrder, nStart - <span style="color: #000000;">1</span>, oQry:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,!oQry:<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> cSortorder &nbsp;<span style="color: #000000;">&#41;</span>==<span style="color: #ff0000;">'N'</span>, .T. <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span></div>[/code:1fd2onn2] Muchisimas gracias por su tiempo
xBrowse FW16.06 (Solucionado)
César, han quedado solucionados todos los problemas que tenías?
xBrowse FW16.06 (Solucionado)
Hola Cristobal Ahora se me cuelga cuando pongo un numero en los campos alfanumericos. Y no he resuelto el tema de la Ñ Gracias por preguntar Saludos
xBrowse FillRect ( follow up ) -- Rao
Rao I am re-visiting this topic and I have created the two arrays aSchedule ( first screen shot ) and aDuration ( second screen shot ) and I am struggling to interpret your suggestion on drawing the rectangle .. I would appreciate your help! Rick Lipkin [quote:2lbnsiqi] Just prepare the array like this. Prepare another array of same size with duration in the corresponding cell of the second array. Keep the duration as number of half-hours ( that gives the number of rows ) Example: If aData[ 3, 4 ] contains an appointment, aDurn[ 3, 4 ] contains its duration. If the duration is less than 1/2 hour the value is 1. If more than 1/2 hour and less than 1 hour the value is 2. etc. Then we can draw the cells on our own. Thats a lot better. First please make the two arrays. I am also assuming that all the rows of the browse will fit into one screen. Right? Or not? [/quote:2lbnsiqi] [quote:2lbnsiqi] To color a rectangle: Assume we have two Arrays as static vars. aSelRows := { nTop, nBottom } aSelCols := { nLeft, nRight } Note: I am using two arrays instead one aRect, because this logic easily enables using oBrw:aSelected. Code: for each oCol in oBrw:aCols SetClrStd( oCol ) next .... .... static function SetClrStd( oCol ) oCol:bClrStd := { || { CLR_BLACK, If( oCol:oBrw:BookMark >= aSelRows[ 1 ] .and. oCol:oBrw:BookMark <= aSelRows[ 2 ] .and. oCol:nPos >= aSelCols[ 1 ] .and. oCol:nPos <= aSelCols[ 2 ], CLR_YELLOW, CLR_WHITE ) } } [/quote:2lbnsiqi] aSchedule - master array [url=http&#58;//imageshack&#46;us/photo/my-images/341/jfrw&#46;jpg/:2lbnsiqi][img:2lbnsiqi]http&#58;//img341&#46;imageshack&#46;us/img341/9697/jfrw&#46;jpg[/img:2lbnsiqi][/url:2lbnsiqi] aDuration - same array with duration .. number in integer = 30 min [url=http&#58;//imageshack&#46;us/photo/my-images/825/5y3b&#46;jpg/:2lbnsiqi][img:2lbnsiqi]http&#58;//img825&#46;imageshack&#46;us/img825/1117/5y3b&#46;jpg[/img:2lbnsiqi][/url:2lbnsiqi] xBrowse - actual program [url=http&#58;//imageshack&#46;us/photo/my-images/62/4q9t&#46;jpg/:2lbnsiqi][img:2lbnsiqi]http&#58;//img62&#46;imageshack&#46;us/img62/5825/4q9t&#46;jpg[/img:2lbnsiqi][/url:2lbnsiqi]
xBrowse FillRect ( follow up ) -- Rao
To All I am still struggling to figure out a way to paint a rectangle in xBrowse. Two problems: 1) Determining the top, bottom, right and left 2) the syntax to draw the rectangle with transparent text and color Many Thanks! Rick Lipkin
xBrowse FillRect ( follow up ) -- Rao
Mr Rick Sorry Soon I shall find an answer for u
xBrowse FillRect ( follow up ) -- Rao
Rao Thank you !! If you need any code from me I will be happy to share. Rick Lipkin
xBrowse FillRect ( follow up ) -- Rao
I have ur email
xBrowse FillRect ( follow up ) -- Rao
Rao I will send you the updated code with the secondary array .. Rick Lipkin
xBrowse FillRect ( follow up ) -- Rao
Rao I know you have been quite busy .. I just need a way to be able to interrogate each cell ( array element) at runtime and determine its contents, row and column. .. perhaps something like you suggested earlier ?? That would help me a lot! Rick Lipkin [code=fw:36nfnuta]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">for</span> each oCol in oLbxA:<span style="color: #000000;">aCols</span><br />     <span style="color: #B900B9;">// some function to interrogate each cell as browse paints then fillrect</span><br /><span style="color: #00C800;">next</span><br /><br /><br /><span style="color: #B900B9;">//----------</span><br /><span style="color: #00C800;">Static</span> FUnc <span style="color: #0000ff;">to</span> <span style="color: #0000ff;">get</span> values and <span style="color: #0000ff;">paint</span> a fillrec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />nColumn := oLbxA:<span style="color: #000000;">nAt</span><br />nRow    := oLbxA:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />cText   := oLbxA:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nColumn <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><br /> </div>[/code:36nfnuta]
xBrowse FillRect ( follow up ) -- Rao
for each oCol in oBrw:aCols oCol:Value --> gives the value of the cell next
xBrowse FillRect ( follow up ) -- Rao
Rick, a full ready to use sample. To keep it small in size, nothing special added. Select any of the < filter-buttons > to fill the cells at runtime. Maybe it helps. Download : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/Cellcol1.zip">http://www.pflegeplus.com/fw_downloads/Cellcol1.zip</a><!-- m --> [img:mgyovwuk]http&#58;//www&#46;pflegeplus&#46;com/pictures/cellcolor&#46;jpg[/img:mgyovwuk] This sample is included in my new tool, I'm working on : [img:mgyovwuk]http&#58;//www&#46;pflegeplus&#46;com/pictures/cellcolor3&#46;jpg[/img:mgyovwuk] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse FillRect ( follow up ) -- Rao
Mr Rick sorry for the delay. Please try this logic. Starting from the data (similar to your data, building the arrays and browsing. You may make appropriate changes. [code=fw:3by4s2fz]<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;">"hbcompat.ch"</span> &nbsp;<span style="color: #B900B9;">// important for AINS translation</span><br /><br /><span style="color: #00C800;">static</span> aData, aSched, aColor, aTech<br /><span style="color: #00C800;">static</span> aPer<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nPeriods<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, nRow, nAt, nSlot, nTech, cTech<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// period array</span><br />&nbsp; &nbsp;aPer &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">8</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">16</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aPer, StrZero<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":00"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aPer, StrZero<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":30"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;nPeriods := Len<span style="color: #000000;">&#40;</span> aPer <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Raw Data read from Table filtered to date</span><br />&nbsp; &nbsp;aData := <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"08:00"</span>, <span style="color: #ff0000;">"08:30"</span>, <span style="color: #ff0000;">"Angelo Russo"</span>, <span style="color: #ff0000;">"Basset Hound"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"10:30"</span>, <span style="color: #ff0000;">"11:30"</span>, <span style="color: #ff0000;">"Angelo Russo"</span>, <span style="color: #ff0000;">"Bulldog"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"09:30"</span>, <span style="color: #ff0000;">"10:00"</span>, <span style="color: #ff0000;">"Anne Jocobs"</span>, &nbsp;<span style="color: #ff0000;">"Sheperd"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"11:00"</span>, <span style="color: #ff0000;">"12:00"</span>, <span style="color: #ff0000;">"Anne Jocobs"</span>, &nbsp;<span style="color: #ff0000;">"Sheperd"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"08:30"</span>, <span style="color: #ff0000;">"10:30"</span>, <span style="color: #ff0000;">"Lea Allen"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"Beagle"</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"12:30"</span>, <span style="color: #ff0000;">"13:30"</span>, <span style="color: #ff0000;">"Lea Allen"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"Beagle"</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Prepare shedule and color arrays</span><br /><br />&nbsp; &nbsp;aSched &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;aColor &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;aTech &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cTech &nbsp; &nbsp; &nbsp; := aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; nTech &nbsp; &nbsp; &nbsp; := AScan<span style="color: #000000;">&#40;</span> aTech, <span style="color: #000000;">&#123;</span> |c| Upper<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span> == Upper<span style="color: #000000;">&#40;</span> cTech <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nTech == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aTech, cTech <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nTech &nbsp; &nbsp;:= Len<span style="color: #000000;">&#40;</span> aTech <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aSched, Array<span style="color: #000000;">&#40;</span> nPeriods <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aColor, Array<span style="color: #000000;">&#40;</span> nPeriods <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Post sched in the time slot</span><br />&nbsp; &nbsp; &nbsp; nSlot &nbsp; &nbsp;:= AScan<span style="color: #000000;">&#40;</span> aPer, <span style="color: #000000;">&#123;</span> |c| aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == c <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nSlot == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSlot := nPeriods<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; aSched<span style="color: #000000;">&#91;</span> nTech, nSlot <span style="color: #000000;">&#93;</span> &nbsp;:= aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; nAt &nbsp; &nbsp; &nbsp;:= AScan<span style="color: #000000;">&#40;</span> aPer, <span style="color: #000000;">&#123;</span> |c| aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == c <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nAt == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAt &nbsp; := nPeriods<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; nAt--<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nAt > nSlot<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> n := nSlot <span style="color: #0000ff;">to</span> nAt<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aColor<span style="color: #000000;">&#91;</span> nTech, n <span style="color: #000000;">&#93;</span> := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> nRow<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Rearrange the arrays</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> aSched, <span style="color: #000000;">1</span>, aPer, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> aColor, <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> aTech, &nbsp;<span style="color: #000000;">1</span>, <span style="color: #ff0000;">"TIME"</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aSched &nbsp; := ArrTranspose<span style="color: #000000;">&#40;</span> aSched <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aColor &nbsp; := ArrTranspose<span style="color: #000000;">&#40;</span> aColor <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XBROWSER aSched <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Schedule"</span> SETUP BrwSetup<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BrwSetup<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, oCol<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">cHeaders</span> &nbsp; &nbsp; := &nbsp;aTech<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oCol &nbsp;:= oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; oCol:<span style="color: #000000;">bClrStd</span> := CellColorBlock<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CellColorBlock<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw := oCol:<span style="color: #000000;">oBrw</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> aColor<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, oCol:<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> == .t., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3by4s2fz] [url=http&#58;//img842&#46;imageshack&#46;us/i/c0hl&#46;jpg/:3by4s2fz][img:3by4s2fz]http&#58;//img842&#46;imageshack&#46;us/img842/1118/c0hl&#46;jpg[/img:3by4s2fz][/url:3by4s2fz]
xBrowse FillRect ( follow up ) -- Rao
Rao Thank you for your support .. I will let you know ... Very Much Appreciated! Rick Lipkin
xBrowse FillRect ( follow up ) -- Rao
Rao I am just now trying to adapt your code without much success. In your example, you create your browse much different than I do, however, in the following code I do not think it makes much difference. I prefer to use your technique of using a second array which points back to the array element(s) to be colored. Here is my code and the screenshot of a duplicated array ( just for testing ) called aDuration. The viewable xBrowse array is called aSchedule. I did find some other code here in the forum that does work but only scans aSchedule and not aDuration. What I think your code does is scan ( in my case ) aSchedule to get the array element and looks to same aDuration cell value ( logical or char value ) which maps back to aSchedule to be painted. [code=fw:2t57le9p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oIco <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"APTBOOK"</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndChildA           ;<br />       <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">37.5</span>,<span style="color: #000000;">123</span>        ;<br />       <span style="color: #0000ff;">MDICHILD</span>                    ;<br />       <span style="color: #0000ff;">OF</span> oWnd                     ;<br />       NOMINIMIZE                  ;<br />       <span style="color: #0000ff;">ICON</span> oIco                   ;<br />       <span style="color: #0000ff;">TITLE</span> xTITLE<br /><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oSch <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SCHEDULE"</span> <span style="color: #0000ff;">of</span> oWndChildA<br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLbxA        ;<br />         ARRAY aSchedule             ;<br />         HEADERS aHeader             ;<br />         COLSIZES aColumn            ;<br />         <span style="color: #0000ff;">ID</span> <span style="color: #000000;">172</span> <span style="color: #0000ff;">of</span> oSch              ;<br />       <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br />       oLbxA:<span style="color: #000000;">nRowHeight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> := <span style="color: #000000;">45</span><br />       oLbxA:<span style="color: #000000;">nFreeze</span> := <span style="color: #000000;">1</span><br /><br />       <span style="color: #B900B9;">// adapting rao's code</span><br />       <span style="color: #B900B9;">// can not get to work</span><br />       <span style="color: #00C800;">for</span> i := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oLbxA:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />           oCol  := oLbxA:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><br />           oCol:<span style="color: #000000;">bClrStd</span> := CellColorBlock<span style="color: #000000;">&#40;</span> oCol,aDuration <span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">next</span><br /> <br />        <span style="color: #B900B9;">// another example</span><br />     *  <span style="color: #00C800;">FOR</span> i = <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> LEN<span style="color: #000000;">&#40;</span> oLbxA:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />     *      oLbxA:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> := ChangeColor<span style="color: #000000;">&#40;</span> oLbxA, i <span style="color: #000000;">&#41;</span><br />     *  <span style="color: #00C800;">NEXT</span><br /><br />    ...<br /><br /><span style="color: #B900B9;">//---------------------------</span><br /><span style="color: #00C800;">Static</span> Func ChangeColor<span style="color: #000000;">&#40;</span> oLbxA, i <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//</span><br /><br /><span style="color: #00C800;">Local</span> nColumn,nRow,cText<br /><br /><br />*<span style="color: #00C800;">Return</span> <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> ColorCell<span style="color: #000000;">&#40;</span> oLbxA:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, ColorCell<span style="color: #000000;">&#40;</span> oLbxA:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">&#123;</span>||  <span style="color: #000000;">&#123;</span> CLR_BLACK, ColorCell<span style="color: #000000;">&#40;</span> oLbxA:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//-------------------</span><br /><span style="color: #00C800;">Static</span> Func ColorCell<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nColor<br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">CASE</span><br />*<span style="color: #00C800;">CASE</span> uDato == <span style="color: #000000;">1</span> <span style="color: #B900B9;">// AMARILLO-PAGADAS AL DIA</span><br />*nColor := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">128</span><span style="color: #000000;">&#41;</span><br /><br />*<span style="color: #00C800;">CASE</span> uDato == <span style="color: #000000;">2</span> <span style="color: #B900B9;">// AZUL-PAGADAS ADELANTADAS</span><br />*nColor := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>, <span style="color: #000000;">100</span>, <span style="color: #000000;">200</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">CASE</span> cText <> <span style="color: #ff0000;">"  "</span> <span style="color: #B900B9;">//== 3 // MARRON CLARO-PAGADAS CON ATRASO  // this works</span><br />nColor := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>, <span style="color: #000000;">172</span>, <span style="color: #000000;">89</span><span style="color: #000000;">&#41;</span><br /><br />*<span style="color: #00C800;">CASE</span> uDato == <span style="color: #000000;">9</span> <span style="color: #B900B9;">// ROJO-CUOTAS VENCIDAS</span><br />*nColor := RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">240</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">OTHERWISE</span><br />nColor := GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">ENDCASE</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> nColor <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> CellColorBlock<span style="color: #000000;">&#40;</span> oCol,aDuration <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> oBrw<br /><br />oBrw := oCol:<span style="color: #000000;">oBrw</span><br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> aDuration<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, oCol:<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> <> <span style="color: #ff0000;">"  "</span>,;<span style="color: #B900B9;">//== "B", ;//.t., ;</span><br />               <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /> </div>[/code:2t57le9p] At this point the code is looking for an element that is NOT blank, however when I adapt the aDuration, I will use a charactor ( like "B", "G" ) to determine the color.. unfortunitly, I can not seem to get your code to work. I can easily create aDuration with the above charactor codes instead of your logical .. for some reason, I just can not seem to understand how to evaluate the values .. I seem to be able to get one row and that is it .. however, I know the for\next look is evaluating every element. Please have a look at let me know that I am missing. Thanks Rick Lipkin [url=http&#58;//imageshack&#46;us/photo/my-images/854/uowl&#46;jpg/:2t57le9p][img:2t57le9p]http&#58;//img854&#46;imageshack&#46;us/img854/6412/uowl&#46;jpg[/img:2t57le9p][/url:2t57le9p]
xBrowse FillRect ( follow up ) -- Rao
[quote:3smrgtkt]I can easily create aDuration with the above charactor codes instead of your logical .. for some reason, I just can not seem to understand how to evaluate the values .. I seem to be able to get one row and that is it .. however, I know the for\next look is evaluating every element. [/quote:3smrgtkt] I understand that if an appointment spans from cell [nRow,nCo] to [nRow+d,nCol] than aDuration[nRow,nCol] to aDuration[nRow+d,nCol] contain some color code. In other cases aDuration[y,x] contains NIL. I suggest you assign a color pair straigh away instead of a color code. Then [code=fw:3smrgtkt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> CellColorBlock<span style="color: #000000;">&#40;</span> oCol,aDuration <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> oBrw<br /><br />oBrw := oCol:<span style="color: #000000;">oBrw</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">&#123;</span> || IfNil<span style="color: #000000;">&#40;</span> aDuration<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, oCol:<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br /> </div>[/code:3smrgtkt]
xBrowse FillRect ( follow up ) -- Rao
Rao I think your original code will work .. I just can not seem to get this part working .. I was testing your code against my version of the duration array .. all I was looking to test for was if the value of the array element was blank .. I don't think any of the values are nil ?? Rick Lipkin [code=fw:14v3ca8f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> CellColorBlock<span style="color: #000000;">&#40;</span> oCol,aDuration <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">local</span> oBrw<br /><br />oBrw := oCol:<span style="color: #000000;">oBrw</span><br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> aDuration<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, oCol:<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> <> <span style="color: #ff0000;">" &nbsp;"</span>,;<span style="color: #B900B9;">//== "B", ;//.t., ;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:14v3ca8f]
xBrowse FillRect ( follow up ) -- Rao
I tried to keep everything simple in my code. I assigned some value to a cell in the aColor ( or aDuration ) array only when needed and otherwise retained the default nil values. Saves time while preparing the array. And saves confusion while deriving color values later. Now applying my suggestion to use color pairs instead of logical .t., this is the revised sample. [code=fw:2o5h4lr5]<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;">"hbcompat.ch"</span> &nbsp;<span style="color: #B900B9;">// important for AINS translation</span><br /><br /><span style="color: #00C800;">static</span> aData, aSched, aColor, aTech<br /><span style="color: #00C800;">static</span> aPer<br /><br /><span style="color: #00D7D7;">#define</span> CLRPAIR1 &nbsp;<span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">&#125;</span><br /><span style="color: #00D7D7;">#define</span> CLRPAIR2 &nbsp;<span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HRED <span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nPeriods<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, nRow, nAt, nSlot, nTech, cTech<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// period array</span><br />&nbsp; &nbsp;aPer &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">8</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">16</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aPer, StrZero<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":00"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aPer, StrZero<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":30"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;nPeriods := Len<span style="color: #000000;">&#40;</span> aPer <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Raw Data read from Table filtered to date</span><br />&nbsp; &nbsp;aData := <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"08:00"</span>, <span style="color: #ff0000;">"08:30"</span>, <span style="color: #ff0000;">"Angelo Russo"</span>, <span style="color: #ff0000;">"Basset Hound"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"10:30"</span>, <span style="color: #ff0000;">"11:30"</span>, <span style="color: #ff0000;">"Angelo Russo"</span>, <span style="color: #ff0000;">"Bulldog"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"09:30"</span>, <span style="color: #ff0000;">"10:00"</span>, <span style="color: #ff0000;">"Anne Jocobs"</span>, &nbsp;<span style="color: #ff0000;">"Sheperd"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"11:00"</span>, <span style="color: #ff0000;">"12:00"</span>, <span style="color: #ff0000;">"Anne Jocobs"</span>, &nbsp;<span style="color: #ff0000;">"Sheperd"</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"08:30"</span>, <span style="color: #ff0000;">"10:30"</span>, <span style="color: #ff0000;">"Lea Allen"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"Beagle"</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"12:30"</span>, <span style="color: #ff0000;">"13:30"</span>, <span style="color: #ff0000;">"Lea Allen"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">"Beagle"</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Prepare shedule and color arrays</span><br /><br />&nbsp; &nbsp;aSched &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;aColor &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;aTech &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nRow := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aData <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cTech &nbsp; &nbsp; &nbsp; := aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; nTech &nbsp; &nbsp; &nbsp; := AScan<span style="color: #000000;">&#40;</span> aTech, <span style="color: #000000;">&#123;</span> |c| Upper<span style="color: #000000;">&#40;</span> c <span style="color: #000000;">&#41;</span> == Upper<span style="color: #000000;">&#40;</span> cTech <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nTech == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aTech, cTech <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nTech &nbsp; &nbsp;:= Len<span style="color: #000000;">&#40;</span> aTech <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aSched, Array<span style="color: #000000;">&#40;</span> nPeriods <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aColor, Array<span style="color: #000000;">&#40;</span> nPeriods <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Post sched in the time slot</span><br />&nbsp; &nbsp; &nbsp; nSlot &nbsp; &nbsp;:= AScan<span style="color: #000000;">&#40;</span> aPer, <span style="color: #000000;">&#123;</span> |c| aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == c <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nSlot == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSlot := nPeriods<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; aSched<span style="color: #000000;">&#91;</span> nTech, nSlot <span style="color: #000000;">&#93;</span> &nbsp;:= aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; nAt &nbsp; &nbsp; &nbsp;:= AScan<span style="color: #000000;">&#40;</span> aPer, <span style="color: #000000;">&#123;</span> |c| aData<span style="color: #000000;">&#91;</span> nRow, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == c <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nAt == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAt &nbsp; := nPeriods<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; nAt--<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nAt > nSlot<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> n := nSlot <span style="color: #0000ff;">to</span> nAt<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aColor<span style="color: #000000;">&#91;</span> nTech, n <span style="color: #000000;">&#93;</span> := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nTech == <span style="color: #000000;">2</span>, CLRPAIR2, CLRPAIR1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> nRow<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Rearrange the arrays</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> aSched, <span style="color: #000000;">1</span>, aPer, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> aColor, <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;AIns<span style="color: #000000;">&#40;</span> aTech, &nbsp;<span style="color: #000000;">1</span>, <span style="color: #ff0000;">"TIME"</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aSched &nbsp; := ArrTranspose<span style="color: #000000;">&#40;</span> aSched <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aColor &nbsp; := ArrTranspose<span style="color: #000000;">&#40;</span> aColor <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XBROWSER aSched <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Schedule"</span> SETUP BrwSetup<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BrwSetup<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, oCol<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">cHeaders</span> &nbsp; &nbsp; := &nbsp;aTech<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oCol &nbsp;:= oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; oCol:<span style="color: #000000;">bClrStd</span> := CellColorBlock<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CellColorBlock<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw := oCol:<span style="color: #000000;">oBrw</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> || IfNil<span style="color: #000000;">&#40;</span> aColor<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, oCol:<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2o5h4lr5] [url=http&#58;//img708&#46;imageshack&#46;us/i/o8g3&#46;jpg/:2o5h4lr5][img:2o5h4lr5]http&#58;//img708&#46;imageshack&#46;us/img708/2977/o8g3&#46;jpg[/img:2o5h4lr5][/url:2o5h4lr5]
xBrowse FillRect ( follow up ) -- Rao
Rao Thank you for your diligence .. This has been a good exercise for me in understanding how to mine cell co-ordinants from xBrowse. Your examples have given me that insight. This code right here was the key piece of understanding for me. [code=fw:eeu6lv5f]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> || IfNil<span style="color: #000000;">&#40;</span> aColor<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, oCol:<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:eeu6lv5f] As for the colors, I was thinking along your same lines .. I was thinking of just filling the aColor array with a character value like "B" for a blue string, "G" for Green and so on. Thank you .. I will let you know how this project turns out. Rick Lipkin
xBrowse Fillrect - How to color multiple rows by column
To All I am writing a scheduler and would like to be able to put color to the appointment duration for a span of time. I have looked at Daniel Gil's Calex calendar class to see how he filled in the rows ( must be transparent for the column text ) for a specific column without much success... see below. I have created an xBrowse populated from an array what paints by a start time ( horizontal row) by Persons Name ( vertical column ). If I have an appointment that spans multiple 30 minute increments I would like to fill those xy rows a specific color outlining the duration of the appointment... In the below screen shot .. third column from 9:00 to 10:00 am. If anyone has any suggestions .. I would be most honored by your suggestions and help! Thanks Rick Lipkin [url=http&#58;//imageshack&#46;us/photo/my-images/705/scheduleb&#46;jpg/:27ezgi6r][img:27ezgi6r]http&#58;//img705&#46;imageshack&#46;us/img705/9589/scheduleb&#46;jpg[/img:27ezgi6r][/url:27ezgi6r]
xBrowse Fillrect - How to color multiple rows by column
Your program knows the top and bottom rows for the appointment, say nTop and nBot: [code=fw:3ol6fzpu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nArrayAt</span> >= nTop .and. oBrw:<span style="color: #000000;">nArrayAt</span> <= nBot, CLR_YELLOW, CLR_WHITE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:3ol6fzpu] To color a rectangle: Assume we have two Arrays as static vars. aSelRows := { nTop, nBottom } aSelCols := { nLeft, nRight } Note: I am using two arrays instead one aRect, because this logic easily enables using oBrw:aSelected. [code=fw:3ol6fzpu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">for</span> each oCol in oBrw:<span style="color: #000000;">aCols</span><br />&nbsp; &nbsp;SetClrStd<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">next</span><br />....<br />....<br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SetClrStd<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />oCol:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">BookMark</span> >= aSelRows<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> .and. oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">BookMark</span> <= aSelRows<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> .and. oCol:<span style="color: #000000;">nPos</span> >= aSelCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> .and. oCol:<span style="color: #000000;">nPos</span> <= aSelCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, CLR_YELLOW, CLR_WHITE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp;</div>[/code:3ol6fzpu]
xBrowse Fillrect - How to color multiple rows by column
Rao Thank you for your reply .. I am struggling to know how to identify the appointment blocks at run time since I have already created the array with the proper values .. all xbrowse does is display the array. You mentioned bookmarks ... is it possible to create bookmarks at run-time based on the value of the underlying array data .. then use the bookmarks to identify the top and bottom cells to apply the color? Thanks Rick Lipkin
xBrowse Fillrect - How to color multiple rows by column
Let us be clear about what oBrw:BookMark means. oBrw:bBookmark is defined as { |n| If( n == nil, RecNo(), DbGoTo( n ) } for RDD and { |u| If( u == nil, oRs:BookMark, oRs:BookMark := u ) } for RecordSet. oBrw:BookMark is the same as RecNo() for DBF and oRs:BookMark for RecordSet. oBrw:BookMark := n means DbGoTo( n ) for DBF and oRs:BookMark := n for RecordSet. Bookmark does not change when the DBF or RecordSet is sorted in different orders. oBrw:Bookmark is not something we create to flag (or mark) a row. For Arrays oBrw:Bookmark is the same as oBrw:nArrayAt.
xBrowse Fillrect - How to color multiple rows by column
[quote:5f476b69]I am struggling to know how to identify the appointment blocks at run time since I have already created the array with the proper values .. all xbrowse does is display the array. [/quote:5f476b69] Please have a look at the following sample: [code=fw:5f476b69]<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 /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData := <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #ff0000;">''</span> &nbsp;, <span style="color: #ff0000;">'AA'</span>, <span style="color: #ff0000;">'BB'</span>, <span style="color: #ff0000;">''</span> &nbsp; <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>, <span style="color: #ff0000;">''</span> &nbsp;, <span style="color: #ff0000;">''</span> &nbsp;, <span style="color: #ff0000;">'BB'</span>, <span style="color: #ff0000;">''</span> &nbsp; <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, <span style="color: #ff0000;">'AA'</span>, <span style="color: #ff0000;">'AA'</span>, <span style="color: #ff0000;">'CC'</span>, <span style="color: #ff0000;">'DD'</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>, <span style="color: #ff0000;">'CC'</span>, <span style="color: #ff0000;">'AA'</span>, <span style="color: #ff0000;">'DD'</span>, <span style="color: #ff0000;">'EE'</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'CC'</span>, <span style="color: #ff0000;">'AA'</span>, <span style="color: #ff0000;">'CC'</span>, <span style="color: #ff0000;">'EE'</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">6</span>, <span style="color: #ff0000;">''</span> &nbsp;, <span style="color: #ff0000;">'CC'</span>, <span style="color: #ff0000;">''</span> &nbsp;, <span style="color: #ff0000;">'AA'</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<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 />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">240</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp;@ <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 />&nbsp; &nbsp; &nbsp; DATASOURCE aData <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">bClrStd</span> := SetStdColor<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidths</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">60</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nDataStrAlignS</span>:= AL_CENTER<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<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: #00C800;">static</span> <span style="color: #00C800;">function</span> SetStdColor<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> || CellColor<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CellColor<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aColor &nbsp; := <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw &nbsp; &nbsp; := oCol:<span style="color: #000000;">oBrw</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRow &nbsp; &nbsp; := oBrw:<span style="color: #000000;">nArrayAt</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol &nbsp; &nbsp; := oCol:<span style="color: #000000;">nCreationOrder</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cVal &nbsp; &nbsp; := oCol:<span style="color: #000000;">Value</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cVal <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nRow > <span style="color: #000000;">1</span> .and. cVal == oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> nRow - <span style="color: #000000;">1</span>, nCol <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aColor &nbsp; := <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; elseif nRow < oBrw:<span style="color: #000000;">nLen</span> .and. cVal == oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> nRow + <span style="color: #000000;">1</span>, nCol <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aColor &nbsp; := <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_GREEN <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aColor<br />&nbsp;</div>[/code:5f476b69] result: [url=http&#58;//img811&#46;imageshack&#46;us/i/rickcolor&#46;jpg/:5f476b69][img:5f476b69]http&#58;//img811&#46;imageshack&#46;us/img811/7411/rickcolor&#46;jpg[/img:5f476b69][/url:5f476b69] Now can you build the array in a similar way and use similar logic for coloring?
xBrowse Fillrect - How to color multiple rows by column
Rao I thought about labeling each cell as I create the array .. and I may have to do that. I was trying not to add text to each cell .. only color the ones starting from the beginning cell and count down the number of cells in the appointment. I am trying to re-create an appointment screen like this .. Rick Lipkin [url=http&#58;//imageshack&#46;us/photo/my-images/194/groomer2&#46;jpg/:jp1fdumy][img:jp1fdumy]http&#58;//img194&#46;imageshack&#46;us/img194/9339/groomer2&#46;jpg[/img:jp1fdumy][/url:jp1fdumy]
xBrowse Fillrect - How to color multiple rows by column
You can also use oCol:lMergeVert := .t. [url=http&#58;//img811&#46;imageshack&#46;us/i/rick2p&#46;jpg/:1451fo69][img:1451fo69]http&#58;//img811&#46;imageshack&#46;us/img811/6483/rick2p&#46;jpg[/img:1451fo69][/url:1451fo69]
xBrowse Fillrect - How to color multiple rows by column
Rao I did think about that and looked at how xBrowse.prg was painting the like cells .. Good food for thought.. I will see how that idea works .. would be nice if you could specify the color of the merged data <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> Appreciate your help and advice! Rick Lipkin
xBrowse Fillrect - How to color multiple rows by column
[quote:2flamsm8]I will see how that idea works .. would be nice if you could specify the color of the merged data [/quote:2flamsm8] Sorry, while working on this I noticed that there is a little bug in painting if we specify a different colour. Let us keep thinking.
xBrowse Fillrect - How to color multiple rows by column
Rao I am re-working the code to build the array .. turning into a nightmare.. hopefully sometime Saturday I will have the re-write on the array and then see if I can do the merge. I think this will work.. Thanks Rick Lipkin
xBrowse Fillrect - How to color multiple rows by column
[quote:1ks2w9c7]nd then see if I can do the merge.[/quote:1ks2w9c7] Please do not consider this option. I thought about it and with the present xbrowse code, you will get stuck up. Just prepare the array like this. Prepare another array of same size with duration in the corresponding cell of the second array. Keep the duration as number of half-hours ( that gives the number of rows ) Example: If aData[ 3, 4 ] contains an appointment, aDurn[ 3, 4 ] contains its duration. If the duration is less than 1/2 hour the value is 1. If more than 1/2 hour and less than 1 hour the value is 2. etc. Then we can draw the cells on our own. Thats a lot better. First please make the two arrays. I am also assuming that all the rows of the browse will fit into one screen. Right? Or not?
xBrowse Fillrect - How to color multiple rows by column
Rao Just curious what problems did you encounter with the vertical merge ? I have not yet got too deep into the array re-write. Let me study your second array option .. the original xBrowse array creates each row starting with the time .. then loops thru a separate employee array used to build the header columns.. so I really do not store the start date to the array.. each row is created in time increments and each column looks for the matching person's name which places the array data in the correct xy coordinates displayed in the browse. I am a bit fuzzy on how you can use the second array as a guide to paint the blocks on the browse <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> As far as fitting on one screen .. depending on the screen resolution .. 1024 x 768 will not allow all the vertical rows to paint without scrolling and the horizontal is based on the number of employees. I sent you the Schedule.prg via your private e-mail .. please feel free to review the code and make any suggestions... Thanks Rick Lipkin
xBrowse Focus-Error ( on Row-Start-Position ) ?
Hello, setting the Start Row-Position of a Browser to Bottom, I get a Error. ( Brush-Background is used ) Starting on Top, it works : // That works oLbx:nArrayAt := 1 oLbx:nRowSel := 1 // Doesn't work oLbx:nArrayAt := 2 oLbx:nRowSel := 2 [img:3jdtabpn]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwfocus1&#46;jpg[/img:3jdtabpn] A test without Brush : [img:3jdtabpn]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwfocus2&#46;jpg[/img:3jdtabpn] Application =========== Path and name: E:\T_GRAD\gradtool.exe (32 bits) Size: 2,029,056 bytes Time from start: 0 hours 0 mins 0 secs Error occurred at: 09/02/09, 14:54:27 Error description: Error BASE/1084 Argument error: / Args: [ 1] = N 92 [ 2] = U Stack Calls =========== Called from: .\xbrowse.PRG => (b)TXBROWSE:TXBROWSE(414) Called from: => TXBROWSE:ROWCOUNT(0) Called from: .\xbrowse.PRG => TXBROWSE:REFRESH(859) Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW:TWINDOW(545) Called from: => TXBROWSE:SETBRUSH(0) Called from: .\xbrowse.PRG => TXBROWSE:SETBACKGROUND(3727) Called from: .\gradtool.PRG => FOLDER_1(548) Called from: .\gradtool.PRG => TOOLS(253) Called from: .\gradtool.PRG => (b)MAIN(210) Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(945) Called from: .\gradtool.PRG => MAIN(210) Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse Font
Amigos:Es posible asignarle un font al xbrowse y otro a lafila seleccionada que tiene el foco.Deseo mostrar el xbrowse con un font y la filaseleccionada con el mismo font boldMuchas gracias, saludos.Ruben Fernandez
xBrowse Font
Ruben,Se podría hacer usando:oCol:oDataFont := { || If( ..., oFont1, oFont2 ) }La cuestión es que no se le está pasando ningún parámetro a la evaluación de ese codeblock por lo que no podemos saber si está en el registro seleccionado. Habría que modificar la clase ó que se nos ocurra algún modo...
xBrowse Font
Gracias Maestro.SaludosRuben Fernandez.
xBrowse Font
¿Hay algo nuevo sobre este asunto? ¿Se podría hacer ahora ?
xBrowse Font
[code=fw:3hy3oqyr]<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 /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oFont, oBold<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCurrent<br /><br />&nbsp; &nbsp;USE CUSTOMER VIA <span style="color: #ff0000;">"DBFCDX"</span><br />&nbsp; &nbsp;<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 />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <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> BOLD<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp;@ <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">AUTOCOLS</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUSTOMER"</span> CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oDataFonts</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">BookMark</span> == nCurrent, oBold, oFont <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || nCurrent := oBrw:<span style="color: #000000;">BookMark</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;nCurrent &nbsp; &nbsp;:= oBrw:<span style="color: #000000;">BookMark</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont, oBold<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:3hy3oqyr]
xBrowse Font
[color=#0000BF:qm7quioo]nageswaragunupudi,[/color:qm7quioo] Como hacerlo con recursos ? me da error en la evalucion del BOOKMARK [color=#00BF00:qm7quioo]// nCurrent:= oBrw:BookMark[/color:qm7quioo] Application =========== Path and name: C:\Proyectos\Software\WinPollosa\WinAlma.EXE (32 bits) Size: 2,823,680 bytes Time from start: 0 hours 0 mins 11 secs Error occurred at: 04/05/2011, 07:32:10 Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL Args: [ 1] = U [ 2] = U Stack Calls =========== Called from: => EVAL(0) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:BOOKMARK(2772) Called from: C:\Proyectos\Software\WinPollosa\ALMACEN.PRG => BROWALMACEN(71) Called from: C:\Proyectos\Software\WinPollosa\WINALMA.PRG => (b)MAIN(102) Called from: C:\PROYEC~1\LIBAVC~1\btnbmp.prg => TBTNBMP:CLICK(0) Called from: C:\PROYEC~1\LIBAVC~1\btnbmp.prg => TBTNBMP:LBUTTONUP(0) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489) Called from: C:\PROYEC~1\LIBAVC~1\btnbmp.prg => TBTNBMP:HANDLEEVENT(0) Called from: .\source\classes\WINDOW.PRG => _FWH(3408) Called from: => WINRUN(0) Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(992) Called from: C:\Proyectos\Software\WinPollosa\WINALMA.PRG => MAIN(170)
xBrowse Font
hay que incluir esta linea : [color=#008040:8gv9fy4u]oDlg:bStart:= {|| nCurrent:= oBrw:BookMark } [/color:8gv9fy4u]
xBrowse Font
Sr. Rao, muchas gracias. Desde código funciona perfecto.
xBrowse Font
Depends on at what stage are you calling the oBrw:BookMark. By that time, the browse object must have been initialized with the corresponding database, array or recordset. The logic in my sample works for source code or resources and for dbf, array, recset, etc. [code=fw:2au8urwg]<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 /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oBrw, oFont, oBold<br />   <span style="color: #00C800;">local</span> nCurrent<br /><br />   USE CUSTOMER<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;">FONT</span> oBold <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> BOLD<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;">"DIALOG_1"</span> <span style="color: #B900B9;">//SIZE 600,400 PIXEL</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">AUTOCOLS</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUSTOMER"</span> CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">oDataFonts</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">BookMark</span> == nCurrent, oBold, oFont <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bChange</span>       := <span style="color: #000000;">&#123;</span> || nCurrent := oBrw:<span style="color: #000000;">BookMark</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END<br /><br />   nCurrent    := oBrw:<span style="color: #000000;">BookMark</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, oBold<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2au8urwg] test.rc[code=fw:2au8urwg]<div class="fw" id="{CB}" style="font-family: monospace;">DIALOG_1 <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">77</span>, <span style="color: #000000;">98</span>, <span style="color: #000000;">361</span>, <span style="color: #000000;">202</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"TESTDLG"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br /><span style="color: #000000;">&#123;</span><br /> DEFPUSHBUTTON <span style="color: #ff0000;">"OK"</span>, IDOK, <span style="color: #000000;">177</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> PUSHBUTTON <span style="color: #ff0000;">"Cancel"</span>, IDCANCEL, <span style="color: #000000;">237</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> PUSHBUTTON <span style="color: #ff0000;">"Help"</span>, IDHELP, <span style="color: #000000;">297</span>, <span style="color: #000000;">174</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span><br /> CONTROL <span style="color: #ff0000;">""</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"TXBrowse"</span>, <span style="color: #000000;">0</span> | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, <span style="color: #000000;">16</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">329</span>, <span style="color: #000000;">147</span><br /><span style="color: #000000;">&#125;</span></div>[/code:2au8urwg] Please compile and test the samples I posted. After than please examine if your program differs from the logic in these samples.
xBrowse Font Problem
After I have upgrade to December 2016, I faced with a font problem. The fonts are changing when I use a xbrowse on dialog. Please look at the example below. When I double click on the xbrowse the fonts are both "Ms Sans Serif" with build May 2016 But, with build December 2016 both are "Segoe UI". Because of this all of my Turkish characters have been changed by meaningless characters. Also the Turkish characters in static text, and read only fields have been changed. Please help [code=fw:2pv8djsi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oBrw, aData:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   aadd<span style="color: #000000;">&#40;</span>aData, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">'aü??x '</span>, <span style="color: #ff0000;">'a?çö?üx '</span>, <span style="color: #ff0000;">'a?i?üçöx '</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span>aData, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">'bugix '</span>, <span style="color: #ff0000;">'ascogux '</span>, <span style="color: #ff0000;">'asigucox '</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span>aData, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">'aÜ??x '</span>, <span style="color: #ff0000;">'a?ÇÖ?Üx '</span>, <span style="color: #ff0000;">'a???ÜÇÖx '</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span>aData, <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">'bUGIx '</span>, <span style="color: #ff0000;">'aSCOGUx '</span>, <span style="color: #ff0000;">'aSIGUCOx '</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">270</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #B900B9;">//FONT oFont</span><br /><br />   @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br />            HEADERS <span style="color: #ff0000;">'?No?'</span>, <span style="color: #ff0000;">'?Name?'</span>, <span style="color: #ff0000;">'?Text?'</span> ;<br />            <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">PIXEL</span> ;<br />            <span style="color: #0000ff;">OF</span> oDlg ;<br />            ARRAY aData <span style="color: #0000ff;">AUTOCOLS</span> ;<br />            LINES ;<br />            <span style="color: #0000ff;">ON</span> DBLCLICK <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'xBrowse Font: '</span>+oBrw:<span style="color: #000000;">oFont</span>:<span style="color: #000000;">cFaceName</span> + CRLF + ;<br />                                 <span style="color: #ff0000;">'Dialog Font: '</span>+oDlg:<span style="color: #000000;">oFont</span>:<span style="color: #000000;">cFaceName</span>  <span style="color: #000000;">&#41;</span><br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2pv8djsi]
xBrowse Font Problem
This is the change made in FWH 16.07 Extract from whatsnew.txt [quote:hxejxhuo]* Enhancement: function GetSysFont() now returns "Segoe UI" if Windows 10 or 8 is being used: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=193067">viewtopic.php?p=193067</a><!-- l --> thanks to James! [/quote:hxejxhuo] With this change Segoe UI is used as sysfont ( default for all dialogs/controls,etc) if the OS is Windows 8 or 10. Do the Turkish characters look different on Segoe UI and MS Sans Serif ?
xBrowse Font Problem
I tried this program on Windows 10. This is the result with Segoe UI font [url=https&#58;//imageshack&#46;com/i/pnM0UV2Np:13vjwj03][img:13vjwj03]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/923/M0UV2N&#46;png[/img:13vjwj03][/url:13vjwj03] It appears the Turkish characters are shown correctly
xBrowse Font Problem
Yes you are right. It appears that the characters are shown correctly. Can you double click on xbrowse please. I want to see the oFont:cFaceName. If it is Segoe UI, I will check my windows settings. Temporarily I have solved my problem by changing GetSysFont() in getsysin.prg Thanks for your help.
xBrowse Font Problem
[quote="betoncu":1gwadqdx]Yes you are right. It appears that the characters are shown correctly. Can you double click on xbrowse please. I want to see the oFont:cFaceName. If it is Segoe UI, I will check my windows settings. Temporarily I have solved my problem by changing GetSysFont() in getsysin.prg Thanks for your help.[/quote:1gwadqdx] What Operating System do you use? What language is your system configured with?
xBrowse Font Problem
[quote:1l0xn4it]If it is Segoe UI, I will check my windows settings. [/quote:1l0xn4it] Yes, it is Segoe UI. But what is the difference? Both fonts show Turkish characters correctly. If you have a personal preference for MS Sans Serif, that is upto you.
xBrowse Font Problem
Somewhat off-topic: I personally like Segoe UI but unfortunately it is slightly wider than MS Sans Serif. So dialogs have to be redesigned (or at least, all checked - anyway, not so easy). EMG
xBrowse Font Problem
[quote="Enrico Maria Giordano":1f5bfmdq]Somewhat off-topic: I personally like Segoe UI but unfortunately it is slightly wider than MS Sans Serif. So dialogs have to be redesigned (or at least, all checked - anyway, not so easy). EMG[/quote:1f5bfmdq] Yes. Not so easy. In fact, while testing the above sample, I had to increase the width of dialog and browse. We produce software to run on all OS. If we do not assign our own font to the dialog, then for each dialog and control, we need to define the width conditionally on the basis of the OS. For example, the above code needs to be changed something like: [code=fw:1f5bfmdq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> IsWindows10<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .or. IsWin8<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">360</span>, <span style="color: #000000;">300</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">'?No?'</span>, <span style="color: #ff0000;">'?Name?'</span>, <span style="color: #ff0000;">'?Text?'</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> IsWindows10<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .or. IsWin8<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">160</span>, <span style="color: #000000;">120</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">70</span> <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp;</div>[/code:1f5bfmdq] What is your advice?
xBrowse Font Problem
Sorry, I have no advice. I'm still using MS Sans Serif. EMG
xBrowse Font Problem
[quote="Enrico Maria Giordano":2nfsqmk5]Sorry, I have no advice. I'm still using MS Sans Serif. EMG[/quote:2nfsqmk5] But if you run the software on windows8 or win10, the default font is Segoe UI. What are you doing?
xBrowse Font Problem
Mr Navarro My operating system is Windows 10 and it is configured with Turkish.
xBrowse Font Problem
[quote="nageswaragunupudi":lhrlbpga]But if you run the software on windows8 or win10, the default font is Segoe UI. What are you doing?[/quote:lhrlbpga] Almost all my dialogs are from resources so they use the font defined there. EMG
xBrowse Font Problem
It is very strange. This problem occurs only if I use a xbrowse on a dialog. The Turkish characters in read only fields and static text fields are also not shown correctly. If I dont use xbrowse, read only and staic text fields are ok.
xBrowse Font Problem
[quote:14r8dncp]Temporarily I have solved my problem by changing GetSysFont() in getsysin.prg [/quote:14r8dncp] Do you still have the problem after changing GetSysFont()?
xBrowse Font Problem
No, I am using MS Sans Serif and no problem.
xBrowse Font Size
Dear All, Pressing CTRL and '+' changes xBrowse data font but not changing the font of headers... Is this normal behavior? or is there a way to sync data font and header font? Kind Regards, Frances
xBrowse Font Size
Pressing Ctrl+ and Ctrl- changes data font size only. That is how it is programmed now. I also do not think anybody other than you noticed it. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> If you like to change Header font size also, you need to subclass xbrowse and override the method FontSize(nPlus)
xBrowse Font Size
Dear Mr. RAO, Thank you so much for your reply. It's a minor thingy.. Looking forward for the next build with header font changes.. i have a lot of xBrowse objects across many apps.. My next FWH upgrade schedule is end of Feb/2011.. Kind Regards, Frances
xBrowse Footer Picture
Dear All, I am using xBrowse to display Dbf file. Numeric column are having AGGR_TOTAL at its footer. I have tried to change the picture of the footer but by doing so, the footer disappears. I used : oBrw:oCol('Atri Tax' ):nFooterType := AGGR_TOTAL For n = 2 To Len(aHead_A[1]) If oBrw:aCols[ n ]:nFooterType = AGGR_TOTAL oBrw:aCols[ n ]:bLClickFooter := { |r,c,f,o| FooterAggrClick( r, c, f, o ) } oBrw:aCols[ n ]:nFooterType := { || Trans( AGGR_TOTAL , "9,999,999,999.99") } //Line (A) Endif Next n Without this Line(A) makes the footer appear. But the picture is not proper.... [url=http&#58;//imageshack&#46;us/photo/my-images/217/aggrtotal&#46;jpg/:7am1et5r][img:7am1et5r]http&#58;//img217&#46;imageshack&#46;us/img217/1729/aggrtotal&#46;jpg[/img:7am1et5r][/url:7am1et5r] Any suggestions....Thnx
xBrowse Footer Picture
Ceditpicture solves your problem oBrw:aCols[ n ]:cEDITPicture := "9,999,999,999.99" Hth
xBrowse Footer Picture
Thanks Richard, It works great now, the cEditPicture clause adjusted the column widths as per picture and applied it into columns and footer totals. Thanks again.....
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Hi all, I am using a xBrowse with a .dbf file without an Index... If I go to the bottom of the database programatically, the browse is shown like this: [img:39re3tz1]http&#58;//www&#46;mayapos&#46;com/FiveWin/brow1&#46;png[/img:39re3tz1] I think it should not be that way, because there are more records in the database. Instead it should be like this: [img:39re3tz1]http&#58;//www&#46;mayapos&#46;com/FiveWin/brow2&#46;png[/img:39re3tz1] Is there a way to get the xbrowse to go to the bottom programatically and be shown as the second picture???
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Mr Rao, Is there a way to have xBrowse to detect the mouse wheel when the pointer is over it, even when it does not have the focus???
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
[quote="Bayron":36yo92gt]Mr Rao, Is there a way to have xBrowse to detect the mouse wheel when the pointer is over it, even when it does not have the focus???[/quote:36yo92gt] Not with any simple code. Probably other window which has the focus can capture the mouse and check where the mouse is located when the wheel is operated.
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Do not use DbGoBottom() Instead, call oBrw:GoBottom() in the ON INIT clause of the dialog. [code=fw:3mfjtnsq]<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 /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw<br /><br />&nbsp; &nbsp;USE CUSTOMER<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp;@ <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 />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">AUTOCOLS</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CUSTOMER'</span> CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<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> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:3mfjtnsq]
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Thanks Mr Rao, I tried to place that command after creating the browse and that was the reason why it did not work.... By the way, I placed it just after oBrw:CreateFromCode() and worked as well...
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Yes I see... I will investigate this further my self... The easy way is to create a class, but I do't know Class Programming (Just thinking out loud) Thanks for your help Mr. Rao...
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
Got It, thanks to your help. [code=fw:26zap9f4]<div class="fw" id="{CB}" style="font-family: monospace;">  oDialog:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> | nKeys, nDelta, nXPos, nYPos | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nDelta > <span style="color: #000000;">0</span>, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span> WheelScroll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span> WheelScroll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> </div>[/code:26zap9f4] This works for the entire window. I will try to condition it to only work when the mouse is over the control, and it will be done.....
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
I have it working half way, but I think I am screwing something in the coordinate conditions... [code=fw:19f1qv8h]<div class="fw" id="{CB}" style="font-family: monospace;">oDialog:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> | nKeys, nDelta, nXPos, nYPos | ;<br />   <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nDelta > <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nXPos >= oBrw:<span style="color: #000000;">nLeft</span> .and. nXPos <= oBrow:<span style="color: #000000;">nRight</span> , oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span> WheelScroll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">&#41;</span> ,;<br />   <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nYPos >= oBrw:<span style="color: #000000;">nTop</span> .and. nYPos <= oBrw:<span style="color: #000000;">nBottom</span> , oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span> WheelScroll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  </div>[/code:19f1qv8h]
xBrowse GoBottom /xBrowse MouseWheel (SOLVED)
This way it Works: [code=fw:2ei5zihv]<div class="fw" id="{CB}" style="font-family: monospace;">oDialog:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">&#123;</span> | nKeys, nDelta, nXPos, nYPos | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nXPos >= oBrw:<span style="color: #000000;">nLeft</span> .and. nXPos <= oBrw:<span style="color: #000000;">nRight</span> .and.  nYPos >= oBrw:<span style="color: #000000;">nTop</span> .and. nYPos <= oBrw:<span style="color: #000000;">nBottom</span> ,;<br />                          <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nDelta > <span style="color: #000000;">0</span>, oBrw:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span> WheelScroll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , oBrw:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span> WheelScroll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,  <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  </div>[/code:2ei5zihv] As we all know: FiveWin, One line of code and it's done...
xBrowse GoLeft()
Amigos del foro:Tengo un xbrowse con 8 columnas. Cada celda de las 4 primeras columnas debe ser validada, no permitiendo pasar a la siguiente col si se valida .f..Utilizo oBrw:lFastEdit:=.t.He leído en este foro algunos post parecidos pero no encuentro solución.Este es el codigo que no he logrado hacer funcionar. Agradeceré mucho su ayuda. oBrw:lFastEdit := .t. oCol = oBrw:AddCol() oCol:bStrData = { || (cAlias)->cta } oCol:cHeader = "CTA" oCol:nEditType = EDIT_GET oCol:bOnPostEdit = { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),) ,; If( nKey == VK_RETURN, if(lCtaOK(xVal),(cAlias)->Cta := xVal, ([b:b2estkey]oBrw:GoLeft(),[/b:b2estkey]oBrw:Refresh())) ,) } //aqui no obedece el GoLeft(), ¿por qué?//-----------------------Function lCtaOK(xVal) if !catalogo->(dbSeek(xVal,.t.)) MsgStop("Codigo no existe","Alto") return .f. endifReturn .t.
xBrowse GoLeft()
Francisco,Tienes que poner oBrw:lFastEdit := .F. para que te funcione el :GoLeft()Es algo que tenemos que modificar en la clase.
xBrowse GoLeft()
[quote="Antonio Linares":wh2bmyss]Francisco, Tienes que poner oBrw:lFastEdit := .F. para que te funcione el :GoLeft() Es algo que tenemos que modificar en la clase.[/quote:wh2bmyss]Antonio, gracias.FranciscoA
xBrowse GoLeft()
Tenia el mismo problema, lo que hice fue muy sencilloagrege una nueva data a la xBrowse llamada lAutoAppendsin la necesidad de colocar [b:1a55modb]lFastEdit=.f. [/b:1a55modb][b:1a55modb]DATA lAutoAppend[/b:1a55modb]en el metodo New() agrege[b:1a55modb]::lAutoAppend := .f.[/b:1a55modb]y en el metodo METHOD GoNextCtrl() Originalmente contiene tiene estas lineas[code:1a55modb] &#58;&#58;Select&#40; 0 &#41; &#58;&#58;GoDown&#40;&#41; &#58;&#58;Select&#40; 1 &#41; [/code:1a55modb] agrege este IF a esas lineas [code:1a55modb] if &#58;&#58;lAutoAppend &#58;&#58;Select&#40; 0 &#41; &#58;&#58;GoDown&#40;&#41; &#58;&#58;Select&#40; 1 &#41; endif [/code:1a55modb]de esta forma solo me agrega un registro si oprimo la tecla de abajo para que evalue el bloque bPastEof o le asigno la tarea a algun boton, etc.
xBrowse GoLeft()
le agrege algo nuevo a lo anterior, de manera que pueda seguir usando el fastedit correctamente, es decir, que pase el foco a la proxima celda editable, sin que se pase del final del browse, si no tienes el lAutoAppend activado[code:1wxxir9p] if &#58;&#58;lAutoAppend &#46;or&#46; &#58;&#58;nDataRows > &#58;&#58;nRowSel &#58;&#58;Select&#40; 0 &#41; &#58;&#58;GoDown&#40;&#41; &#58;&#58;Select&#40; 1 &#41; endif [/code:1wxxir9p]de esta forma no pasara de la ultima fila del browse a menor que tengas activado el lAutoAppend
xBrowse GoLeft()
Si quieres pulir un poco mas podrias agregar esto para validar que incluyas el ::bPastEof[code:58wqj00r] if &#58;&#58;lAutoAppend &#46;or&#46; &#58;&#58;nDataRows > &#58;&#58;nRowSel if &#58;&#58;bPastEof == NIL &#46;and&#46; &#58;&#58;nDataRows = &#58;&#58;nRowSel MsgStop&#40; "&#58;&#58;bPastEof not defined","Fivewin&#58; Class TXBrowse" &#41; return NIL else &#58;&#58;Select&#40; 0 &#41; &#58;&#58;GoDown&#40;&#41; &#58;&#58;Select&#40; 1 &#41; endif endif [/code:58wqj00r]
xBrowse GoLeft()
mxfox, gracias por tu ejemplo. Encuentro interesante lo del lAutoAppend y voy a tratar de implementarlo, aunque parece que tu version de FWH es más reciente que la mía (7.12).Mi problema específico es que cuando se valida falso (.f.) en una celda, deseo que el cursor no salte a la siguiente columna, sino que quede en la misma. Estoy trabajando en ello, y cuando lo tenga, lo comparto por si alguien más tiene el mismo inconveniente. Lo del autoappend lo hago cuando se edita o digita enter en la última columna del xbrowse.Saludos, y muchas gracias.FranciscoA
xBrowse GoLeft()
Tienes tambien bEditValid, que valida la celda activa, si es .T. pasa a la siguiente celda disponible para editar y si es .f. mantiene en estado de edicion hasta que oprimas escape y no se va pra ningun otro lado
xBrowse GoLeft()
[quote="mcfox":1fkjsce5]Tienes tambien bEditValid, que valida la celda activa, si es .T. pasa a la siguiente celda disponible para editar y si es .f. mantiene en estado de edicion hasta que oprimas escape y no se va pra ningun otro lado[/quote:1fkjsce5]mcfox, gracias. FranciscoA
xBrowse GoLeft() problem
HiI want to edit an array in xBrowse 8.08: REDEFINE XBROWSE oBrw ID 231 ; HEADERS "Type", "Tax Base", "Rate", "Amount", "Method" ; COLSIZES 60, 80, 80, 80, 60 ; ARRAY aBox47 AUTOCOLS oBrw:aCols[1]:cHeader := "Type" oBrw:aCols[1]:cEditPicture := "@K !!!" oBrw:aCols[1]:nDataStrAlign := AL_LEFT oBrw:aCols[1]:nHeadStrAlign := AL_CENTER oBrw:aCols[1]:nEditType := EDIT_GET_BUTTON oBrw:aCols[1]:bOnPostEdit := {|o,x| if(empty(x), (oBrw:GoDown(), oBrw:GoLeft()), aBox47[ oBrw:nArrayAt, 2 ] := x ) } oBrw:aCols[1]:bEditBlock := {|| Msginfo("Lookup Tax Code", "TXBrowse power" ) } oBrw:aCols[1]:bClrEdit := oBrw:bClrStd oBrw:aCols[2]:cHeader := "Tax Base" oBrw:aCols[2]:cEditPicture := "@K 99999999999.99" oBrw:aCols[2]:nDataStrAlign := AL_RIGHT oBrw:aCols[2]:nHeadStrAlign := AL_RIGHT oBrw:aCols[2]:nEditType := EDIT_GET oBrw:aCols[2]:bOnPostEdit := {|o,x| aBox47[ oBrw:nArrayAt, 2 ] := x } oBrw:aCols[2]:bClrEdit := oBrw:bClrStdIn the bOnPostEdit for column 1, if nothing is entered in first column, I want to move down a row and edit the first column. GoLeft() doesn't seem to move the selected cell left. I have also tried GoLeftMost()I can do this no problem in TSBrowse with oBrw:aColumns[nCol]:nEditMove := DT_MOVE_NEXTCan someone help please.RegardsDavid
xBrowse GoLeft() problem
David,This is a modified version of fwh\samples\mallorca.prg. I have included oBrw:GoDown() and oBrw:GoLeft() in the second column, and here it is working fine:mallorca.prg (modified)[code:2f2i7pwi] #INCLUDE "FiveWin&#46;ch" #INCLUDE "XBrowse&#46;ch" function Main&#40;&#41; local oWnd, aLin &#58;= &#123;&#125;, i, oBar, oBrw for i &#58;= 1 TO 6 AAdd&#40; aLin, &#123; i, "Description " + Str&#40; i &#41;, Replicate&#40; Chr&#40; 64 + i &#41;, 2 &#41; &#125; &#41; next DEFINE WINDOW oWnd DEFINE BUTTONBAR oBar OF oWnd 2007 DEFINE BUTTON OF oBar RESOURCE "test" ACTION MsgInfo&#40; "Click" &#41; DEFINE BUTTON OF oBar RESOURCE "exit" ACTION oWnd&#58;End&#40;&#41; oBrw &#58;= TxBrowse&#40;&#41;&#58;New&#40; oWnd &#41; oBrw&#58;SetArray&#40; aLin &#41; oBrw&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLCELL oBrw&#58;aCols&#91;1&#93;&#58;cHeader &#58;= 'Cod' // oBrw&#58;aCols&#91;1&#93;&#58;cEditPicture &#58;= '99' oBrw&#58;aCols&#91;1&#93;&#58;bClrEdit &#58;= oBrw&#58;bClrStd oBrw&#58;aCols&#91;1&#93;&#58;bOnPostEdit &#58;= &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, aLin&#91; oBrw&#58;nArrayAt,1&#93; &#58;= xVal,&#41; &#125; oBrw&#58;aCols&#91;1&#93;&#58;nEditType &#58;= EDIT_GET oBrw&#58;aCols&#91;1&#93;&#58;bEditValid &#58;= &#123; | oGet, oCol | Valida&#40; oGet, oCol &#41; &#125; //-- oBrw&#58;aCols&#91;2&#93;&#58;cHeader &#58;= 'Description' oBrw&#58;aCols&#91;2&#93;&#58;bClrEdit &#58;= oBrw&#58;bClrStd oBrw&#58;aCols&#91;2&#93;&#58;bOnPostEdit &#58;= &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; aLin&#91; oBrw&#58;nArrayAt,2&#93; &#58;= xVal, oBrw&#58;GoDown&#40;&#41;, oBrw&#58;GoLeft&#40;&#41; &#41;,&#41; &#125; oBrw&#58;aCols&#91;2&#93;&#58;nEditType &#58;= EDIT_GET //-- oBrw&#58;aCols&#91;3&#93;&#58;cHeader &#58;= 'Cd' oBrw&#58;aCols&#91;3&#93;&#58;bClrEdit &#58;= oBrw&#58;bClrStd oBrw&#58;aCols&#91;3&#93;&#58;bOnPostEdit &#58;= &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, aLin&#91; oBrw&#58;nArrayAt, 3 &#93; &#58;= xVal,&#41; &#125; oBrw&#58;aCols&#91;3&#93;&#58;nEditType &#58;= EDIT_LISTBOX oBrw&#58;aCols&#91;3&#93;&#58;aEditListBound &#58;= ; oBrw&#58;aCols&#91;3&#93;&#58;aEditListTxt &#58;= &#123; "AA", "BB", "CC", "DD", "EE", "FF", "GG", "HH" &#125; oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;bRClicked = &#123; | nRow, nCol | ShowPopup&#40; nRow, nCol, oBrw, aLin &#41; &#125; oWnd&#58;oClient&#58;=oBrw ACTIVATE WINDOW oWnd RETURN NIL STATIC FUNCTION Valida&#40; oGet, oCol &#41; local nVal &#58;= 0 if oGet&#58;Value&#40;&#41; > 6 MsgAlert&#40; "Must be lower than 7" &#41; if MsgGet&#40; "New value", "Enter number between 1 and 6", @nVal &#41; if nVal > 0 &#46;and&#46; nVal < 7 oGet&#58;VarPut&#40; nVal &#41; oCol&#58;PostEdit&#40;&#41; return &#46;T&#46; endif endif return &#46;F&#46; endif return &#46;T&#46; function ShowPopup&#40; nRow, nCol, oBrw, aLin &#41; local oMenu MENU oMenu POPUP MENUITEM "Add" ACTION &#40; AAdd&#40; aLin, ; &#123; Len&#40; aLin &#41; + 1 , "New item " + Str&#40; Len&#40; aLin &#41; + 1 &#41;, ; Replicate&#40; Chr&#40; 64 + Len&#40; aLin &#41; + 1 &#41;, 2 &#41; &#125; &#41;, oBrw&#58;Refresh&#40;&#41; &#41; MENUITEM "Delete" ACTION &#40; ADel&#40; aLin, oBrw&#58;nArrayAt &#41;, ASize&#40; aLin, Len&#40; aLin &#41; - 1 &#41;, oBrw&#58;Refresh&#40;&#41; &#41; MENUITEM "Select 3rd Row" ACTION &#40; oBrw&#58;GoTop&#40;&#41;, oBrw&#58;nArrayAt &#58;= 3, oBrw&#58;nRowSel &#58;= 3, oBrw&#58;Refresh&#40;&#41; &#41; MENUITEM "Delete All" ACTION &#40; ASize&#40; aLin, 0 &#41;, oBrw&#58;Refresh&#40;&#41; &#41; MENUITEM "Report" ACTION oBrw&#58;Report&#40;&#41; MENUITEM "Excel" ACTION oBrw&#58;ToExcel&#40;&#41; ENDMENU ACTIVATE POPUP oMenu WINDOW oBrw AT nRow, nCol return nil [/code:2f2i7pwi]
xBrowse GoLeft() problem
Antonio,> oBrw:aCols[2]:bOnPostEdit := { | oCol, xVal, nKey | If( nKey == VK_RETURN, ( aLin[ oBrw:nArrayAt,2] := xVal, oBrw:GoDown(), oBrw:GoLeft() ),) } Can you show us an example using a DBF object and a regular DBF?Regards,James
xBrowse GoLeft() problem
James,Using a DBF:[code:3euqvijt] #include "FiveWin&#46;ch" #include "XBrowse&#46;ch" function Main&#40;&#41; local oWnd, oBrw, oCol USE Customer DEFINE WINDOW oWnd @ 0, 0 XBROWSE oBrw OF oWnd ALIAS "Customer" oCol = oBrw&#58;AddCol&#40;&#41; oCol&#58;bStrData = &#123; || Customer->First &#125; oCol&#58;cHeader = "First" oCol&#58;nEditType = EDIT_GET oCol&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; Customer->First &#58;= xVal, oBrw&#58;GoRight&#40;&#41; &#41;,&#41; &#125; oCol = oBrw&#58;AddCol&#40;&#41; oCol&#58;bStrData = &#123; || Customer->Last &#125; oCol&#58;cHeader = "Last" oCol&#58;nEditType = EDIT_GET oCol&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; Customer->Last &#58;= xVal, oBrw&#58;GoDown&#40;&#41;, oBrw&#58;GoLeft&#40;&#41; &#41;,&#41; &#125; oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil [/code:3euqvijt]
xBrowse GoLeft() problem
James,Using a DATABASE object:[code:26v92v9s] #include "FiveWin&#46;ch" #include "XBrowse&#46;ch" function Main&#40;&#41; local oWnd, oDbf, oBrw, oCol USE Customer DATABASE oDbf DEFINE WINDOW oWnd @ 0, 0 XBROWSE oBrw OF oWnd OBJECT oDbf oBrw&#58;CreateFromCode&#40;&#41; oBrw&#58;aCols&#91; 1 &#93;&#58;nEditType = EDIT_GET oBrw&#58;aCols&#91; 1 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;First &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoRight&#40;&#41; &#41;,&#41; &#125; oBrw&#58;aCols&#91; 2 &#93;&#58;nEditType = EDIT_GET oBrw&#58;aCols&#91; 2 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;Last &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoDown&#40;&#41;, oBrw&#58;GoLeft&#40;&#41; &#41;,&#41; &#125; oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil [/code:26v92v9s]
xBrowse GoLeft() problem
Using a DATABASE object and just some columns:[code:1bwoxair] #include "FiveWin&#46;ch" #include "XBrowse&#46;ch" function Main&#40;&#41; local oWnd, oDbf, oBrw, oCol USE Customer DATABASE oDbf DEFINE WINDOW oWnd @ 0, 0 XBROWSE oBrw OF oWnd OBJECT oDbf oCol = oBrw&#58;AddCol&#40;&#41; oCol&#58;cHeader = "First" oCol&#58;bStrData = &#123; || oDbf&#58;First &#125; oBrw&#58;aCols&#91; 1 &#93;&#58;nEditType = EDIT_GET oBrw&#58;aCols&#91; 1 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;First &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoRight&#40;&#41; &#41;,&#41; &#125; oCol = oBrw&#58;AddCol&#40;&#41; oCol&#58;cHeader = "Last" oCol&#58;bStrData = &#123; || oDbf&#58;Last &#125; oBrw&#58;aCols&#91; 2 &#93;&#58;nEditType = EDIT_GET oBrw&#58;aCols&#91; 2 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;Last &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoDown&#40;&#41;, oBrw&#58;GoLeft&#40;&#41; &#41;,&#41; &#125; oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil [/code:1bwoxair]
xBrowse GoLeft() problem
Thanks, Antonio, these are very helpful.Regards,James
xBrowse GoLeft() problem
There is a problem with the movement when editing using the above oDBF example. When you exit the edit (GET) using an up or down arrow key, the new value is lost. Here is a fix:[code:31zbn24l] oBrw&#58;aCols&#91; 1 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;First &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoDown&#40;&#41; &#41;, &#40;oDBF&#58;First&#58;= xVal, oDbf&#58;Save&#40;&#41;&#41;&#41; &#125;[/code:31zbn24l]Now, if I could just figure out how to trigger the edit mode using any alpha-numeric key instead of the Enter key. Does anyone know how?If we can solve this we can get xbrowse to act much more like a spreadsheet.Regards,James
xBrowse GoLeft() problem
I found the answer to my own question about alpha-numeric keys triggering the edit-- use oBrw:lFastEdit := .t.Here is an example of XBrowse that acts like a spreadsheet edit.Regards,James[code:2pv0q7er]/* Purpose&#58; XBrowse example with spreadsheet style editing Note &#58; Any alpha-numeric key triggers the edit, and up and down arrows exit the edit Tested with FWH 8&#46;08 */ #include "FiveWin&#46;ch" #include "XBrowse&#46;ch" function Main&#40;&#41; local oWnd, oDbf, oBrw, oCol USE Customer DATABASE oDbf DEFINE WINDOW oWnd @ 0, 0 XBROWSE oBrw OF oWnd OBJECT oDbf oBrw&#58;lFastEdit&#58;=&#46;t&#46; oCol = oBrw&#58;AddCol&#40;&#41; oCol&#58;cHeader = "First" oCol&#58;bStrData = &#123; || oDbf&#58;First &#125; oBrw&#58;aCols&#91; 1 &#93;&#58;nEditType = EDIT_GET oBrw&#58;aCols&#91; 1 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;First &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoDown&#40;&#41; &#41;, &#40;oDBF&#58;First&#58;= xVal, oDbf&#58;Save&#40;&#41;&#41; &#41; &#125; oCol = oBrw&#58;AddCol&#40;&#41; oCol&#58;cHeader = "Last" oCol&#58;bStrData = &#123; || oDbf&#58;Last &#125; oBrw&#58;aCols&#91; 2 &#93;&#58;nEditType = EDIT_GET oBrw&#58;aCols&#91; 2 &#93;&#58;bOnPostEdit = &#123; | oCol, xVal, nKey | If&#40; nKey == VK_RETURN, &#40; oDbf&#58;Last &#58;= xVal, oDbf&#58;Save&#40;&#41;, oBrw&#58;GoDown&#40;&#41; &#41;,&#40;oDBF&#58;First&#58;= xVal, oDbf&#58;Save&#40;&#41;&#41; &#41; &#125; oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient = oBrw ACTIVATE WINDOW oWnd return nil[/code:2pv0q7er]
xBrowse GoLeft() problem
James,Thanks for your example <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->