topic
stringlengths
1
63
text
stringlengths
1
577k
xBrowse Problem
Hi All I have a small problem with footer calculations with xbrowse - I have created a sample program and test.dbf - how do I upload the files for Mr Rao to check. Cheers Colin
xBrowse Problem
Please send them by email to me. <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->. I shall post the solution here.
xBrowse Problem
Received your mail. This is the appropriate way of coding: [code=fw:1thca381]<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: #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> oWnd, oBrw<br /><br />&nbsp; &nbsp;fwNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'A'</span>, .t., .f. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE COLIN <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">'DBFCDX'</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />&nbsp; &nbsp;SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"Code"</span>, <span style="color: #ff0000;">"DESC"</span>, <span style="color: #ff0000;">"Qty"</span>, <span style="color: #ff0000;">"Cost"</span>, <span style="color: #ff0000;">"Charge"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS &nbsp;, <span style="color: #ff0000;">"Description"</span> ;<br />&nbsp; &nbsp; &nbsp; PICTURES <span style="color: #ff0000;">"@!"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES FOOTERS FASTEDIT<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; := STRETCHCOL_WIDEST<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lHScroll</span> &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">Qty</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFooterType</span> &nbsp; := AGGR_SUM<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bOnChange</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || &nbsp;<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Charge := <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Qty * <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Cost, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Charge</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">RefreshFooters</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">Cost</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFooterType</span> &nbsp; := AGGR_SUM<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bOnChange</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || &nbsp;<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Charge := <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Qty * <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Cost, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Charge</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">RefreshFooters</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">Charge</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFooterType</span> &nbsp; := AGGR_SUM<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bOnChange</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || &nbsp;<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Cost := <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Charge / <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Qty, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Cost</span> <span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">RefreshFooters</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;">bEditWhen</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Qty > <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">oClient</span> &nbsp; := oBrw<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /> </div>[/code:1thca381] Please try this code. I am sure this works the way you expected. [url=http&#58;//img231&#46;imageshack&#46;us/i/xbrtot&#46;jpg/:1thca381][img:1thca381]http&#58;//img231&#46;imageshack&#46;us/img231/6455/xbrtot&#46;jpg[/img:1thca381][/url:1thca381]
xBrowse Problem
Hi. I have a problem with money fields where the totals on footer are shown with 4 decimal places instead of 2. How can I deal with that problem? Reinaldo.
xBrowse Problem
[quote="reinaldocrespo":nv37a133]Hi. I have a problem with money fields where the totals on footer are shown with 4 decimal places instead of 2. How can I deal with that problem? Reinaldo.[/quote:nv37a133] I don't understand the problem. Are the totals shown with 4 decimals by xbrowse, where as you want to show with 2 decimal places? Can I see a sample code?
xBrowse Problem
[quote="nageswaragunupudi":246q7z2z] Are the totals shown with 4 decimals by xbrowse, where as you want to show with 2 decimal places? Can I see a sample code?[/quote:246q7z2z] Correct. 4 decimals where it should be 2 decimal places. It will take me a little while to write a reduced self contained sample for you to see. I will do that soon. Thank you, Reinaldo.
xBrowse Problem
Mr. Reinaldocrespo I presume you are referring to money fields of ADS. DBStruct() of RDDADS shows 4 decimal places for money fields. Hint: XBrowse formats the footers also with the same picture clause specified in oCol:cEditPicture. Please assign appropriate picture clause with 2 decimals to oCol:cEditPicture. Footers also will be diplayed accordingly.
xBrowse Problem
Mr. Rao; Yes. You are assuming correctly. Thank you very much for the hint, I should have thought of that! Again, thank you very much. Reinaldo.
xBrowse Problem
Please ignore the sample I posted earlier. It works but not optimized. Below is an optimized version. Anyone who likes to adopt the logic, may follow this example, but not the first one, [code=fw:8a1bk50o]<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: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd, oBrw<br /><br />   fwNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'A'</span>, .t., .f. <span style="color: #000000;">&#41;</span><br /><br />   USE COLIN <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">'DBFCDX'</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />   SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">2007</span><br /><br />   @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />      COLUMNS <span style="color: #ff0000;">"Code"</span>, <span style="color: #ff0000;">"DESC"</span>, <span style="color: #ff0000;">"Qty"</span>, <span style="color: #ff0000;">"Cost"</span>, <span style="color: #ff0000;">"Charge"</span> ;<br />      HEADERS  , <span style="color: #ff0000;">"Description"</span> ;<br />      PICTURES <span style="color: #ff0000;">"@!"</span> ;<br />      CELL LINES FOOTERS FASTEDIT<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      :<span style="color: #000000;">nStretchCol</span>   := STRETCHCOL_WIDEST<br />      :<span style="color: #000000;">lHScroll</span>      := .f.<br />   END<br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">Qty</span><br />      :<span style="color: #000000;">nFooterType</span>   := AGGR_SUM<br />      :<span style="color: #000000;">bOnChange</span>     := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #000000;">Charge</span>:<span style="color: #000000;">PostEdit</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Qty</span>:<span style="color: #000000;">Value</span> * oBrw:<span style="color: #000000;">Cost</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END<br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">Cost</span><br />      :<span style="color: #000000;">nFooterType</span>   := AGGR_SUM<br />      :<span style="color: #000000;">bOnChange</span>     := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #000000;">Charge</span>:<span style="color: #000000;">PostEdit</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Qty</span>:<span style="color: #000000;">Value</span> * oBrw:<span style="color: #000000;">Cost</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END<br /><br />   WITH OBJECT oBrw:<span style="color: #000000;">Charge</span><br />      :<span style="color: #000000;">nFooterType</span>   := AGGR_SUM<br />      :<span style="color: #000000;">bEditWhen</span>     := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">&#41;</span>->Qty > <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bOnChange</span>     := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #000000;">Cost</span>:<span style="color: #000000;">PostEdit</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Charge</span>:<span style="color: #000000;">Value</span> / oBrw:<span style="color: #000000;">Qty</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END<br /><br />   oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oWnd:<span style="color: #000000;">oClient</span>   := oBrw<br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /> </div>[/code:8a1bk50o] From version 11.08, instead of PostEdit, use VarPut. The method MakeTotals() scans the entire database to compute the totals. This method is not optimized for speed, but intended to provide some computational flexibility for different aggregates like averages, standard deviations, etc and takes into account null values and non-numeric values in some rows. For small and medium sized tables, the performance can be satisfactory, but it is desirable to use pre-computed totals for medium, and large tables. That is the reason why should try to avoid using the Method MakeTotals() inside the program every time some values are changed. When some cells are edited, XBrowse recomputes the totals and refreshes the footers automatically. For this purpose, XBrowse does NOT retotal by calling MakeTotals(). Instead xBrowse increases the oCol:nTotal by the difference between the edited value and the old value. This way, xBrowse's built-in updation of totals is very fast, avoiding any disk access. Same is true even for complex aggregates like averages, standard deviations, etc. In the revised sample, I avoided calling MakeTotals when cells are edited and instead depended on the xbrowse's internal updating logic.
xBrowse Pyjama-effect and defined Textcolors ?
Hello, I have a Problem, switching between Pyjama-effect and back to normal defined Textcolor. The start-screen : [img:2fhqrp5b]http&#58;//www&#46;pflegeplus&#46;com/pictures/pyjama1&#46;jpg[/img:2fhqrp5b] Changing to Pyjama-effect and back to defined Textcolor uses the Pyjama-text-colors. The background-change works. [img:2fhqrp5b]http&#58;//www&#46;pflegeplus&#46;com/pictures/pyjama2&#46;jpg[/img:2fhqrp5b] The switch-function : [code=fw:2fhqrp5b]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> PYJAMA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> I := <span style="color: #000000;">1</span>, aClrCol := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> nTColorF, nTColorB <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> nTColorB, nTColorF <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br /><br /><span style="color: #00C800;">IF</span> nLSwitch = <span style="color: #000000;">2</span> <span style="color: #B900B9;">// Pyjama-effect</span><br />    oBrw1:<span style="color: #000000;">SetBackGround</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> oBrw1:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />        oBrw1:<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> := <span style="color: #000000;">&#123;</span> || aClrCol<span style="color: #000000;">&#91;</span> oBrw1:<span style="color: #000000;">KeyNo</span> % <span style="color: #000000;">2</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <br />    <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ELSE</span><br />    <span style="color: #B900B9;">// select Background</span><br />    BRW_BRUSH<span style="color: #000000;">&#40;</span> oBrw1, nTStyle, lTGrad, nTColorF, nTColorB, nTGradPos, cTBrush, cTImage <span style="color: #000000;">&#41;</span><br />    <span style="color: #B900B9;">// Return to Textcolor</span><br />    oBrw1:<span style="color: #000000;">bClrStd</span> = <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> nTColor2, <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// Doesn't work !!!!</span><br /><br />    <span style="color: #B900B9;">// That works : closing and reopen the Preview-dialog</span><br />    <span style="color: #B900B9;">// oDlgBrw:End()</span><br />    <span style="color: #B900B9;">// lBrwOpen := .T.</span><br />    <span style="color: #B900B9;">// SHOW_BRW(oDlgMain) </span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2fhqrp5b] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse Question
Hi, I have an xBrowse on a DBF or SQL table and I allow the users to select multiple records (oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS) As the users select records, is there a way I can add up values in fields/columns of the selected records (or add up values of relating records in another table) and display the values in a field on the dialog? Thanks in advance Pete
xBrowse Question
Peter; The selected xbrowse record ::bKeyNo value is saved on ::aSelected property of xbrowse. So, here is an idea: x := 0 bAddBlock := { |nRecNo| oDbf:Goto( nRecNo ), x += oDbf:SomeValue } AEVAL( oBrw:aSelected, { |e| EVAL( bAddBlock, e } ) Reinaldo.
xBrowse Question
The real problem is that the calling program does not know when the user selected or deselected a row. bChange does not report this. I suggest a new DATA bOnMultiSelect for XBrowse which will be called at the end of METHOD Select( nOption ). You can try this modification.
xBrowse Question
Ok, I'll try that Thanks for your help Pete
xBrowse Question
Not too sure I know where in my code to put your example. I have tried putting a calculation routine into bChange which nearly works - as you have to move after you have selected the record for the calculation/aSelected to be updated. Any ideas where I should put my total update routine? Pete
xBrowse Quitar Cabecera
Muy buenas, estoy intentando hacer un xbrowse transparente pero me gustaría quitar la cabecera para así quede mejor, solo tiene una columna y sería que no apareciera solamente los datos del array. ¿Como puedo conseguirlo? Un Saludo.
xBrowse Quitar Cabecera
Perdonar así lo llamo: redefine XBROWSE Datas:oTbrOut id 501 COLUMNS 1; HEADERS "FILTRO"; OF oDlg SIZES 100; JUSTIFY AL_CENTER; ARRAY {"07:00","10:00","11:00","12:00"} LINES CELL Datas:oTbrOut:nMarqueeStyle := MARQSTYLE_HIGHLROWMS Datas:oTbrOut:nMarqueeStyle:=5 Datas:oTbrOut:nStretchCol := STRETCHCOL_WIDEST Datas:oTbrOut:nColDividerStyle := LINESTYLE_NOLINES Datas:oTbrOut:nRowDividerStyle := LINESTYLE_NOLINES Datas:oTbrOut:lAllowRowSizing:=.f. Datas:oTbrOut:lAllowColSwapping:=.f. Datas:oTbrOut:lRecordSelector:=.f. Datas:oTbrOut:lHScroll:=.f. Datas:oTbrOut:lVScroll:=.f. Datas:oTbrOut:oFont:=oFontTahomaBoldBig Datas:oTbrOut:SetBackground(oBrushBrw)
xBrowse Quitar Cabecera
Holas Softruz... intenta usar El xbrowse tiene las datas lHeader y lFooter, las cuales puedas activar o dasctivar para hacer el pintado de los headers y footers respectivamente Datas:oTbrOut:lHeader := .f.
xBrowse Quitar Cabecera
Muchas gracias ha funcionado de lujo, pero ¿sabrias decirme como puedo hacer un xbrowse transparente para que me ponga la imagen que tengo de fondo en el dialogo? Un Saludo.
xBrowse Refreshing
Hi, I have an xbrowse looking at records in a database. This database can be viewed and edited by multiple users. If a record is deleted by another user the browse can look corrupt containing duplicate records. The way i'm trying to fix this is to refresh the browse after i perform any actions within the browse, something like this: Save current record number Perform action Recreate scope & filter Goto saved record number Refresh browse This works ok, but the selected record is positioned at the top of the browse. Is there any way that i can remember the position of the highlight bar, refresh and return the highlight bar to its original position? I have tried using oBrw:nRowSel but havent had much luck Any ideas? Best regards, Pete
xBrowse Refreshing
[quote:ffztveu3]I have tried using oBrw:nRowSel but havent had much luck[/quote:ffztveu3] This is the right way. Save and restore oBrw:nRowSel and call Refresh()
xBrowse Refreshing
That works perfectly Thanks for your time best regards, Pete
xBrowse Refreshing
please rao, can put a example.
xBrowse Refreshing
Peter and Rao I have been fighting this very same problem only instead of using .dbf I have been using recordsets. I set up a test where I had the same app open twice and the first app deleted a row and I tried to trap the second app from trying to delete the same row since to app 2 his recordset still had the 'deleted' record buffered and displayed. What I did was in the delete routine .. I stored the unique row id of the record to be deleted .. did a oRs:Requery() to refresh the 'current' data .. did a oRs:Find on the ( row id and if oRs:eof ( or not found ) .. showed an alert the row was missing and issued a oBrw:Refresh(). Where I got into trouble was issuing both oBrw:Refresh() and a SysRefresh() and I got all kinds of run time errors. By accident .. I removed the SysReFresh() and xBrowse re-painted correctly eliminating the previously deleted row. Like Rao mentions .. just issue a oBrw:ReFresh() and xBrowse will re-adjust and display the current records ( added, edited or deleted ) properly. Rick Lipkin
xBrowse Refreshing
This is my code: [code=fw:4rv1ph5k]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />nSavRec := ORDERS-><span style="color: #000000;">&#40;</span>Recno<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />nSavRow := oBrw:<span style="color: #000000;">nRowSel</span><br /><span style="color: #B900B9;">//Apply Scope and filter</span><br />SetSchedFilter<span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />ORDERS-><span style="color: #000000;">&#40;</span>DbGoto<span style="color: #000000;">&#40;</span> nSavRec <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">IF</span> ORDERS->OR_TICKNBR > <span style="color: #000000;">0</span>   <span style="color: #B900B9;">//Record Exists</span><br />    oBrw:<span style="color: #000000;">nRowSel</span> := nSavRow <br /><span style="color: #00C800;">ELSE</span> <br />    oBrw:<span style="color: #000000;">Gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:4rv1ph5k]
xBrowse Refreshing
Rick, My problem was due to a SysRefresh() being in my browse refresh routine. The only problem I have now is if a record is deleted on another machine and the user scrolls up using the up/down arrow when it comes to the deleted record, a duplicate row appears - page up/page down refreshes as well as my refresh routine. Regards, Pete
xBrowse Report
Hi, i'm trying to use the :Report() function in my xBrowse, but the widthes of the columns on the report do not represent the columns in the browse. The columns in the report are far too big and therefore only 2 columns usually show. Any ideas how to fix this? Regards, Pete
xBrowse Report
Pete, The simple solution is to write your own report using TReport. James
xBrowse Report
James, I use a generic xBrowse builder that builds lists based on items from a database (defined by my clients) so the report would have to look at the current state of the browse which it is sort of doing at the moment, so i'd rather get this fixed rather than re-inventing the wheel. Thanks for the response Pete
xBrowse Report
I've looked at the source code of xBrowse and noticed the following function: [code=fw:3khzk02e]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MakeRepCol<span style="color: #000000;">&#40;</span> oRep, oXCol <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oCol, bData, cPic <span style="color: #B900B9;">//, lTotal := .F.</span><br />   <span style="color: #00C800;">local</span> cAlign<br /><br />   <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> bData := oXCol:<span style="color: #000000;">bEditValue</span> <span style="color: #000000;">&#41;</span> == <span style="color: #00C800;">nil</span><br />      bData := oXCol:<span style="color: #000000;">bStrData</span><br />   <span style="color: #00C800;">else</span><br />      cPic := oXCol:<span style="color: #000000;">cEditPicture</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> bData != <span style="color: #00C800;">nil</span><br /><br />      cAlign   := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oXCol:<span style="color: #000000;">nDataStrAlign</span>  == AL_RIGHT, <span style="color: #ff0000;">"RIGHT"</span>, ;<br />                  <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oXCol:<span style="color: #000000;">nDataStrAlign</span>  == AL_CENTER, <span style="color: #ff0000;">"CENTER"</span>, <span style="color: #ff0000;">"LEFT"</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />      oCol := RptAddColumn<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> || oXCol:<span style="color: #000000;">cHeader</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #00C800;">nil</span> ,;<br />                            <span style="color: #000000;">&#123;</span> bData <span style="color: #000000;">&#125;</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">&#123;</span> cPic <span style="color: #000000;">&#125;</span> ,;<br />                            <span style="color: #00C800;">nil</span>, oXCol:<span style="color: #000000;">lTotal</span>, <span style="color: #00C800;">nil</span> ,;<br />                            cAlign, .F., .F., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> oCol<br /> </div>[/code:3khzk02e] I've noticed that the 4th parameter of RptAddColumn (size) is Null and i think it's defaulting to oXCol:nWidth - so i have modified this 4th param to be oXCol:nWidth / 8 (i used 8 as it is the size of the default font used in the report) and it seems to fit a bit nicer. Is there anyway this could be included in a future release if everyone accepts the change or could someone suggest a way of getting the divisor figure that i have used? Regards, Pete
xBrowse Report
Pete, [quote:jjl8me0o]I use a generic xBrowse builder that builds lists based on items from a database (defined by my clients) so the report would have to look at the current state of the browse which it is sort of doing at the moment, so i'd rather get this fixed rather than re-inventing the wheel.[/quote:jjl8me0o] If you mean that they are selecting the data, then you can easily use your own report on the current database by just specifiying the workarea. If you mean that the users are building the configuration of the browse (which columns) then it would be more difficult. I have not looked at the Report method of XBrowse but column widths are generally setup using the width of a string of capital W's or M's because those are the widest letters. This insures that all strings of the width of the field will fit the column. Of course, it would be extremely rare that any field would contain a string of W's or M's, so the column will almost always be too wide. One could make the column slightly narrower by multiplying the W width by 0.9 or 0.8 or somesuch but you do then run the risk that some data will be cut off. Perhaps xBrowse could have such a instance variable that the programmer could adjust. It would default to 1 but then the programmer could adjust this down depending on the level of risk of data cutoff they were willing to risk. James
xBrowse Report
The code reproduced above is from much older versions of XBrowse. XBrowses column object's data nWidth is in pixels. Report class requires data width to be specified in number of characters. In the recent versions of XBrowse the column object has a new DATA nDataLen and nDataDec ( in addition to the earlier cDataType ). We can now specify a column with either in pixels by assigning a value to oCol:nWidth or in number of characters by assigning value to oCol:nDataLen. If we specify oCol:nDataLen ( instead of oCol:nWidth in pixels ), Xbrowse calculates the pixel width for display depending on the font size. In addition, oCol:nDataLen is used to specify the report column width in the Report method. So, to control the report column widths, (1) Use picture clause ( Report allocates as much space that is required ) or (2) Specify oCol:nDataLen instead of oCol:nWidth while defining the xbrowse column. While defining Xbrowse in command mode, if we specify sizes as negative numbers in COLSIZES clause, they are considered as nDataLen. Example: REDEFINE XBROWSE oBrw COLUMNS ..... COLSIZES 80, -12, 100, -15 In this case, 80 and 100 are considered as pixel widths and are assigned to oCol:nWidth and 12 and 15 are considered as widths in number of characters and assigned to oCol:nDataLen With this feature we can easily control the Report column widths
xBrowse Report and column pictures
Hello, I see a strange behavior using oBrowse:Report(cTitle): On screen I have this: [img:3qe9n3ob]https&#58;//i&#46;imgur&#46;com/aUUij9B&#46;jpg[/img:3qe9n3ob] on Report I have this: [img:3qe9n3ob]https&#58;//i&#46;imgur&#46;com/y5qLIYv&#46;jpg[/img:3qe9n3ob] I investigated a little and found those lines of code on [b:3qe9n3ob]MakeRepCol[/b:3qe9n3ob] [code=fw:3qe9n3ob]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">if</span> oXCol:<span style="color: #000000;">bEditValue</span> != <span style="color: #00C800;">nil</span><br />      cPic  := oXCol:<span style="color: #000000;">cEditPicture</span><br />   <span style="color: #00C800;">endif</span></div>[/code:3qe9n3ob] so, making a report the the picture is used only when bEditValue is defined, instead in all other cases it is used to transform the value to show... I think the picture, despite the name, is used also when is not Edit...
xBrowse Report and column pictures
[quote:3nrwy8ah]so, making a report the the picture is used only when bEditValue is defined, instead in all other cases it is used to transform the value to show... [/quote:3nrwy8ah] If not bEditValue, may I know what did you use in this case? Did you use FWH 18.02 ?
xBrowse Report and column pictures
I am not sure to understand the question, we created the column in this way: [code=fw:1d8dqzrp]<div class="fw" id="{CB}" style="font-family: monospace;">oCol := oList:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| GetPrice<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Vendita"</span><br />oCol:<span style="color: #000000;">cEditPicture</span> := PICV</div>[/code:1d8dqzrp]
xBrowse Report and column pictures
Please try changing bStrData as bEditValue. Kindly note that usage of bStrData was deprecated almost ten years back, i.e., from March 2008. Even earlier, bStrData was supposed to return a formatted string, though some tolerance is built into xbrowse to allow bStrData returning non-character values. Kindly read whatsnew.txt of March 2008. We suggest using bEditValue as a SETGET block returning value of any type and optional cEditPicture for formatting. bStrData is constructed internally by XBrowse, using bEditValue and cEditPicture. You made a valid point that you understood cEditPicture to be used only for editing. I agree if we name bEditValue and cEditPicture as bValue and cPicture, they would convey the right meaning. But we are continuing the same names that were created at the time xbrowse was first created. We also recommend using command syntax to define xbrowse, without forgetting to mention the datasource while creating xbrowse. This enables realisation of full potential of xbrowse.
xBrowse Row Height w/ image too high
It appears that the automatic row height calculation when an image is used is about twice as high as it should be. When I add a 32x32 pixel image, the row height seems to be about 64 pixels. The column width seems to be correct. I am using FWH 10.8. Regards, James [url=http&#58;//img193&#46;imageshack&#46;us/i/screen2ua&#46;jpg/:zl9pv21g][img:zl9pv21g]http&#58;//img193&#46;imageshack&#46;us/img193/2771/screen2ua&#46;jpg[/img:zl9pv21g][/url:zl9pv21g]
xBrowse Row Height w/ image too high
OK, I just tried with a 16x16 pixel image and the row height is the same as it was with the 32x32 pixel image. So, the row height is not being automatically calculated when an image is used, it just defaults to a value around 64 pixels when any image is used. I guess this is not a bug, but it would seem to be useful if the row height was automatically calculated to something slightly bigger than the image. Perhaps we do not have a function to find the image height? I do know that you can manually adjust the row height--this is what I am doing. oBrw:nRowHeight := 22 Regards, James
xBrowse Row Height w/ image too high
Mr. James I guess you are using 800x640 pixels display. Can you please post your sample code? Hope we can suggest how to use this feature.
xBrowse Row Positioning
Hi, I have an xBrowse on a database, when i press space bar i open a dialog to view the record. When I return, i refresh the browse and make sure that the scopes are set and the data is up to date. I then return to the original record I was viewing. The problem is that when the browse refreshes, the record is highlighted correctly but always at the top of the browse. Is there any way of moving the browse to the same position before i call the external routine. I've noticed that oBrw:nRowSel return the correct row number, i just need to know how to move the browse. Best Regards, Pete
xBrowse Row Positioning
I've fixed it - not pretty but it sort of works At the start of my routine [code=fw:1esaj6h1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />nRow &nbsp; := oBrw2:<span style="color: #000000;">nRowSel</span> <br /><br />&nbsp;</div>[/code:1esaj6h1] At the end [code=fw:1esaj6h1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; oBrw2:<span style="color: #000000;">nRowSel</span> := nRow&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; oBrw2:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oBrw2:<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span> nRow - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oBrw2:<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span> nRow - <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:1esaj6h1] If anyone knows of a better way, let me know Regards, Pete
xBrowse Row Positioning
Pete, yes, would be interesting to have a ::rowOffset property to define start row to display regards Marcelo
xBrowse Row Positioning
When we show ( or edit ) a record in a dialog and come back to the xbrowse, xbrowse on its own does not disturb the display, unless we wrote some code before getting back to xbrowse which instructs xbrowse otherwise.
xBrowse Row Positioning
[quote="Marcelo Via Giglio":3g7yt2bo]Pete, yes, would be interesting to have a ::rowOffset property to define start row to display regards Marcelo[/quote:3g7yt2bo] This can be achieved by assigning appropriate number to oBrw:nRowSel
xBrowse Row Positioning
I tried this but it didnt seem to work - see above code how i fixed it
xBrowse Row Positioning
Mr Peter [quote:o1bw207u]When I return, i refresh the browse and make sure that the scopes are set and the data is up to date.[/quote:o1bw207u] Please review this part of the code. In this part of the code, if you are not using any code that disturbs the xbrowse, when we return to xbrowse, the old row position is retained.
xBrowse Row-Height
Hi All, Anyone encountering this in FWH18.x [url=http&#58;//s208&#46;photobucket&#46;com/user/fraxzi/media/FWxHarbour/xBrowse_Row_Height_zps9s2wqbvh&#46;png&#46;html:7nqp5ukt][img:7nqp5ukt]http&#58;//i208&#46;photobucket&#46;com/albums/bb82/fraxzi/FWxHarbour/xBrowse_Row_Height_zps9s2wqbvh&#46;png[/img:7nqp5ukt][/url:7nqp5ukt] even if I define like this: [code=fw:7nqp5ukt]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; &nbsp;...<br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">60</span><br />&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span>u<span style="color: #000000;">&#93;</span>or<span style="color: #000000;">&#91;</span>/u<span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #0000ff;">Adjust</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#91;</span>u<span style="color: #000000;">&#93;</span>or<span style="color: #000000;">&#91;</span>/u<span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">Checksize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<br /><br />END<br /><br />&nbsp;</div>[/code:7nqp5ukt] <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse Row-Height
I tried, but I am unable to get what you could get. This is my code: [code=fw:uj4koxwd]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">local</span> oDlg, oFld, oFont, oBrw<br /><br />&nbsp; &nbsp;USE CUSTOMER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> CUST<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;">"VERDANA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-16</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;">800</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> FOLDEREX oFld <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">760</span>,<span style="color: #000000;">460</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Customer"</span><br /><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> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"CUST"</span> ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"FIRST+CHR(13)+CHR(10)+LAST"</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"STREET+CHR(13)+CHR(10)+CITY+CHR(13)+CHR(10)+STATE+ '-' + ZIP"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"NAME"</span>, <span style="color: #ff0000;">"ADDRESS"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nDataLines</span> &nbsp; &nbsp; := <span style="color: #000000;">3</span><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 />&nbsp;</div>[/code:uj4koxwd] This is what I got: [url=https&#58;//imageshack&#46;com/i/pmtUxdrip:uj4koxwd][img:uj4koxwd]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/922/tUxdri&#46;png[/img:uj4koxwd][/url:uj4koxwd] Note: XBrowse uses Adjust() method internally. Please never use it directly in the application program. I am very interested in knowing how did you manage to get the appearance you posted. Please let us have a simple self contained code reproducing the issue.
xBrowse Row-Height
Hi Rao, Thanks for extra tip! You are using this: [quote:sow61x6b] ... DATASOURCE "CUST" ; COLUMNS "ID", "FIRST+CHR(13)+CHR(10)+LAST", ; "STREET+CHR(13)+CHR(10)+CITY+CHR(13)+CHR(10)+STATE+ '-' + ZIP" ; .. [/quote:sow61x6b] while I did like this: [code=fw:sow61x6b]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">4</span>, &nbsp;<span style="color: #000000;">5</span>, &nbsp;<span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">7</span>, &nbsp;<span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span> &nbsp;<span style="color: #000000;">9</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span><br />...<br />&nbsp;</div>[/code:sow61x6b]
xBrowse Row-Height
Even this should work. But you do not change row-heights or fonts afterwards.
xBrowse Row-Height
[quote="nageswaragunupudi":2fgyodft]Even this should work. But you do not change row-heights or fonts afterwards.[/quote:2fgyodft] I See. I have oDlg:SetFont( oFont ) on Dialog's INIT.. will change it. <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
xBrowse Row-Height
Sample using SetColsAsRows() [code=fw:t2c73c2h]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oFont, oFont2, oFont3, oFont4<br /><br />&nbsp; &nbsp;USE CUSTOMER<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont &nbsp;<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> oFont2 <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;">-22</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont3 <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;">-30</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont4 <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> ITALIC<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;">900</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"LAST"</span>, <span style="color: #ff0000;">"STREET"</span>, <span style="color: #ff0000;">"CITY"</span>, <span style="color: #ff0000;">"STATE+' - '+ZIP"</span>, <span style="color: #ff0000;">"AGE"</span>, <span style="color: #ff0000;">"SALARY"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"NAME"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"ADDRESS"</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"DETAILS"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span> &nbsp; := oFont3<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span> &nbsp; := oFont2<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span> &nbsp; := oFont2<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oDataFont</span> &nbsp; := oFont4<br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_HRED, CLR_WHITE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetColsAsRows</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">7</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><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, oFont2, oFont3, oFont4<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:t2c73c2h] [url=https&#58;//imageshack&#46;com/i/plkZWQ0np:t2c73c2h][img:t2c73c2h]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/921/kZWQ0n&#46;png[/img:t2c73c2h][/url:t2c73c2h]
xBrowse STAFF SCHEDULE with source code
The work schedule starts with all stuff members set every day as a day off. Then you can drag to shift-tour or to holiday xBrowse. It is not possible to delete an entry only to drag back to days off. If you drag from days off to shift tour you see then the name of the stuff member. Best regards, Otto [url:g94n0osv]http&#58;//www&#46;atzwanger-software&#46;com/fw/WS&#46;ZIP[/url:g94n0osv] [img:g94n0osv]http&#58;//www&#46;atzwanger-software&#46;com/fw/Schedule&#46;jpg[/img:g94n0osv]
xBrowse STAFF SCHEDULE with source code
Otto, thank You very much. I nice work. I found a little bug. Just protect the Header-area for drop-over. In function < Dropover > do case case oBrwThis == oBrwRoster aPoint := ClientToClient( oBrwFrom:hWnd, oBrwThis:hWnd, { nRow, nCol } ) [color=#FF0000:cmm3bd4u]IF apoint[1] <= 45 apoint[1] := 50 ENDIF[/color:cmm3bd4u] forces to use the first row in case of a selected header-area ! Error description: Error BASE/1074 Argument error: <= Args: [ 1] = U [ 2] = N 47 Stack Calls =========== Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:HEADERLBUTTONUP( 10284 ) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:LBUTTONUP( 3357 ) Called from: .\Stuff.PRG => [color=#FF0000:cmm3bd4u]DROPOVER( 364 )[/color:cmm3bd4u] I tested my oWnd:End() FADE-OUT-function ( breaking the FOR NEXT because of a Window-frame ) : DEFINE BUTTON OF oBar FILE "c:\fwh\bitmaps\32x32\exit.bmp" GROUP ; PROMPT "Quit" ACTION [color=#0000FF:cmm3bd4u][b:cmm3bd4u]WND_CLOSE(oWnd)[/b:cmm3bd4u][/color:cmm3bd4u] [code=fw:cmm3bd4u]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> WND_CLOSE<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nMinusW := oWnd:<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">70</span>, nMinusH := oWnd:<span style="color: #000000;">nHeight</span> / <span style="color: #000000;">70</span><br /><span style="color: #00C800;">LOCAL</span> nT := oWnd:<span style="color: #000000;">nTop</span>, nL := oWnd:<span style="color: #000000;">nLeft</span>, nW := oWnd:<span style="color: #000000;">nWidth</span>, nH :=  oWnd:<span style="color: #000000;">nHeight</span><br /><br />I := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">30</span><br />    INKEY<span style="color: #000000;">&#40;</span><span style="color: #000000;">0.01</span><span style="color: #000000;">&#41;</span><br />    nT := nT + nMinusH<br />    nL := nL + nMinusW<br />    nW := nW - <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> * nMinusW <span style="color: #000000;">&#41;</span><br />    nH := nH - <span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> * nMinusH <span style="color: #000000;">&#41;</span><br />    oWnd:<span style="color: #0000ff;">Move</span><span style="color: #000000;">&#40;</span> nT, nL, nW, nH , .f. <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// Top, left, width, height</span><br /><span style="color: #00C800;">NEXT</span><br />oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:cmm3bd4u] [img:cmm3bd4u]http&#58;//www&#46;pflegeplus&#46;com/pictures/fadeout1&#46;jpg[/img:cmm3bd4u] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse STAFF SCHEDULE with source code
Hello Uwe, thank you. I repost the sources with your changes. Thank you. Best regards, Otto [code=fw:3ozju68r]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><br /><span style="color: #B900B9;">/*<br />*<br />* &nbsp;WS.PRG<br />* &nbsp;Aug 07-2012 10:58 PM<br />*<br />*/</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adodef.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 /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#define</span> PRN_SINGLEDBF<br /><span style="color: #00D7D7;">#define</span> DYN_BTNS<br /><span style="color: #00D7D7;">#define</span> STANDALONE<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> cPath &nbsp; := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">static</span> cStaffDBF &nbsp;:= <span style="color: #ff0000;">"STAFF.DBF"</span><br /><span style="color: #00C800;">static</span> cToursDbf &nbsp;:= <span style="color: #ff0000;">"TOURS.DBF"</span><br /><span style="color: #00C800;">static</span> cSchedDbf &nbsp;:= <span style="color: #ff0000;">"SCHED.DBF"</span><br /><br /><span style="color: #00C800;">static</span> cAliasSched, cAliasStaff, cAliasTours, cAliasFree, cAliasUrlaub<br /><span style="color: #00C800;">static</span> oBrwRoster, oBrwFree, oBrwUrlaub<br /><span style="color: #00C800;">static</span> oSay1, oSay2, oSay3<br /><span style="color: #00C800;">static</span> oDragCur<br /><span style="color: #00C800;">static</span> oBrwFocus<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> dBOW, aWeeks<br /><span style="color: #00C800;">static</span> aTours, aStaff, aRoster := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">static</span> nSelStaff := <span style="color: #000000;">0</span>, nSelTour := <span style="color: #000000;">0</span>, nSelWeek := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">static</span> nToursBias := <span style="color: #000000;">0</span>, nStaffBias := <span style="color: #000000;">0</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;InitVars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CheckDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;OpenDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SetWeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">//</span><br />&nbsp; &nbsp;BrowseWnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;CLOSE <span style="color: #00C800;">DATA</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #0000ff;">init</span> procedure PrgInit<br /><br />&nbsp; &nbsp;SET DATE GERMAN<br />&nbsp; &nbsp;SET CENTURY <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;SET TIME FORMAT <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"HH:MM:SS"</span><br />&nbsp; &nbsp;SET EPOCH <span style="color: #0000ff;">TO</span> <span style="color: #0000ff;">YEAR</span><span style="color: #000000;">&#40;</span>DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-50</span><br /><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;SET EXCLUSIVE OFF<br /><br />&nbsp; &nbsp;RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'E'</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SetKinetic<span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SetGetColorFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SetBalloon<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />exit procedure PrgExit<br /><br />&nbsp; &nbsp;SET RESOURCES <span style="color: #0000ff;">TO</span><br /><br /><span style="color: #00C800;">return</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BrowseWnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd, oBar, oFont, oBold, oLarg<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBarHt, nCol, oCol, n<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oDragCur DRAG<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oLarg <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-20</span> BOLD<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;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-15</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;">"Segoe UI"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-15</span> BOLD<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"STAFF SCHEDULE"</span> <span style="color: #0000ff;">MENU</span> TMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span> oFont <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>,<span style="color: #000000;">68</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp;SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp;nBarHt &nbsp; &nbsp; &nbsp;:= oBar:<span style="color: #000000;">nHeight</span><br /><br />&nbsp; &nbsp;@ nBarHt + <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay1 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">"Arbeitseinteilung „Sommer 2012“ &nbsp;"</span> + ;<br />&nbsp; &nbsp; &nbsp; D2CDM<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'/'</span> + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">6</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" (Work Schedule - Staff Roster )"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">1000</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd TRANSPARENT ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> oLarg <span style="color: #0000ff;">UPDATE</span><br /><br />&nbsp; &nbsp;@ nBarHt + <span style="color: #000000;">45</span>, <span style="color: #000000;">00</span> <span style="color: #0000ff;">XBROWSE</span> oBrwRoster <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE aRoster ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">8</span>;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Schicht"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;BrwWeekHeaders<span style="color: #000000;">&#40;</span> oBrwRoster <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwRoster:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> &nbsp; := <span style="color: #000000;">&#123;</span> || ID2C<span style="color: #000000;">&#40;</span> oBrwRoster:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aTours <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; oBrwRoster:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> &nbsp; := RosterStrData<span style="color: #000000;">&#40;</span> oBrwRoster:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;oBrwFocus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := oBrwRoster<br />&nbsp; &nbsp;WITH OBJECT oBrwRoster<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lColChangeNotify</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || CheckFocus<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;">bGotFocus</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> |o| oBrwFocus := o, CheckFocus<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;">L2007</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lHScroll</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lVScroll</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeadStrAligns</span> &nbsp; &nbsp; &nbsp;:= AL_CENTER<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nDataStrAligns</span> &nbsp; &nbsp; &nbsp;:= AL_CENTER<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HGRAY <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || ID2CLR<span style="color: #000000;">&#40;</span> oBrwRoster:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lMergeVert</span> &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oDragCursor</span> &nbsp; &nbsp; &nbsp; &nbsp; := oDragCur<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDragBegin</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |nRow,nCol,nFlags,oBrw| SetDropInfo<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDropOver</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> |uDropInfo, nRow, nCol, nFlags| DropOver<span style="color: #000000;">&#40;</span> uDropInfo, nRow, nCol, nFlags, oBrwRoster <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><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;@ nBarHt + <span style="color: #000000;">235</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay2 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">"Freie Tage"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">1000</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">FONT</span> oBold TRANSPARENT<br /><br />&nbsp; &nbsp;@ nBarHt + <span style="color: #000000;">270</span>, <span style="color: #000000;">00</span> <span style="color: #0000ff;">XBROWSE</span> oBrwFree <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE cAliasFree ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">AUTOCOLS</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER <span style="color: #0000ff;">COLOR</span> CLR_BLACK, GetSysColor<span style="color: #000000;">&#40;</span> <span style="color: #000000;">15</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBrwFree:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || ID2C<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAliasFree <span style="color: #000000;">&#41;</span>->STAFFID, aStaff <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; oBrwFree:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> &nbsp; := SchedStrData<span style="color: #000000;">&#40;</span> oBrwFree:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Freie"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;WITH OBJECT oBrwFree<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lColChangeNotify</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || CheckFocus<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;">bGotFocus</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> |o| oBrwFocus := o, CheckFocus<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;">l2007</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lHeader</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lVScroll</span> := :<span style="color: #000000;">lHScroll</span> := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HGRAY <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nDataStrAligns</span> &nbsp; &nbsp; &nbsp;:= AL_CENTER<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oDragCursor</span> &nbsp; &nbsp; &nbsp; &nbsp; := oDragCur<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDragBegin</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |nRow,nCol,nFlags,oBrw|SetDropInfo<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDropOver</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> | uDropInfo, nRow, nCol, nFlags| &nbsp;DropOver<span style="color: #000000;">&#40;</span> uDropInfo, nRow, nCol, nFlags, oBrwFree <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><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 /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp;:bRClicked &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := { || xbrowse( oBrwFree:cAlias ) }</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;@ nBarHt + <span style="color: #000000;">372</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> oSay3 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">"Urlaub"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">FONT</span> oBold TRANSPARENT<br /><br />&nbsp; &nbsp;@ nBarHt + <span style="color: #000000;">410</span>, <span style="color: #000000;">00</span> <span style="color: #0000ff;">XBROWSE</span> oBrwUrlaub <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE cAliasUrlaub ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"STAFFID"</span>, <span style="color: #ff0000;">"MO"</span>, <span style="color: #ff0000;">"DI"</span>, <span style="color: #ff0000;">"MI"</span>, <span style="color: #ff0000;">"DO"</span>, <span style="color: #ff0000;">"FR"</span>, <span style="color: #ff0000;">"SA"</span>, <span style="color: #ff0000;">"SO"</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;oBrwUrlaub:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || ID2C<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAliasUrlaub <span style="color: #000000;">&#41;</span>->STAFFID, aStaff <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; oBrwUrlaub:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> &nbsp; := SchedStrData<span style="color: #000000;">&#40;</span> oBrwUrlaub:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">-1</span>, <span style="color: #ff0000;">"Urlaub"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;WITH OBJECT oBrwUrlaub<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lColChangeNotify</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bChange</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || CheckFocus<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;">bGotFocus</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> |o| oBrwFocus := o, CheckFocus<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;">l2007</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lHeader</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lVScroll</span> := :<span style="color: #000000;">lHScroll</span> := .f.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_HGRAY <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nDataStrAligns</span> &nbsp; &nbsp; &nbsp;:= AL_CENTER<br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oDragCursor</span> &nbsp; &nbsp; &nbsp; &nbsp; := oDragCur<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDragBegin</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |nRow,nCol,nFlags,oBrw| SetDropInfo<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDropOver</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> |uDropInfo,nRow,nCol,nFlags| DropOver<span style="color: #000000;">&#40;</span> uDropInfo, nRow, nCol, nFlags, oBrwUrlaub <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><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;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>alendar2.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Week"</span> &nbsp;<span style="color: #0000ff;">MENU</span> PopMenuWeeks<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ACTION</span> This:<span style="color: #000000;">ShowPopup</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\u</span>sers.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Staff"</span> <span style="color: #0000ff;">ACTION</span> DlgStaff<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\b</span>itm.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Tours"</span> <span style="color: #0000ff;">ACTION</span> DlgTours<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\p</span>rint32.bmp"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Print"</span> <span style="color: #0000ff;">ACTION</span> ExportPrintDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar GROUP ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelTour != <span style="color: #000000;">0</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Freie"</span> &nbsp;<span style="color: #0000ff;">ACTION</span> BtnFreeAction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelTour >= <span style="color: #000000;">0</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Urlaub"</span> <span style="color: #0000ff;">ACTION</span> BtnUrlaubAction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />#ifndef DYN_BTNS<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Schicht"</span> <span style="color: #0000ff;">MENU</span> PopTourMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ACTION</span> This:<span style="color: #000000;">ShowPopup</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />#endif<br /><br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\e</span>xit.bmp"</span> GROUP ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Quit"</span> <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />#ifdef DYN_BTNS<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aTours <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AddTourBtn<span style="color: #000000;">&#40;</span> oBar, n <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />#endif<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrwRoster:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, CheckFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> RESIZE OnResize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> OnPaint<span style="color: #000000;">&#40;</span> hDC, oWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont, oLarg<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SchedStrData<span style="color: #000000;">&#40;</span> oCol, nVal, cText <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">//return { || If( Eval( oCol:bEditValue ) == nVal, cText, "" ) }</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> Eval<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">bEditValue</span> <span style="color: #000000;">&#41;</span> == nVal, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Eval<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">acols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> RosterStrData<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> || ID2C<span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">bEditValue</span> <span style="color: #000000;">&#41;</span>, aStaff <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OnResize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oWnd &nbsp; &nbsp; &nbsp; &nbsp;:= oBrwRoster:<span style="color: #000000;">oWnd</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oRect &nbsp; &nbsp; &nbsp; := oWnd:<span style="color: #000000;">GetCliRect</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nColWidth &nbsp; := Int<span style="color: #000000;">&#40;</span> oRect:<span style="color: #000000;">nWidth</span> / <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRow<br /><br />&nbsp; &nbsp;WITH OBJECT oBrwRoster<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidths</span> &nbsp; &nbsp;:= nColWidth<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeight</span> &nbsp; &nbsp;:= :<span style="color: #000000;">nHeaderHeight</span> + :<span style="color: #000000;">nLen</span> * :<span style="color: #000000;">nRowHeight</span><br />&nbsp; &nbsp; &nbsp; nRow &nbsp; &nbsp; &nbsp; &nbsp;:= :<span style="color: #000000;">nTop</span> + :<span style="color: #000000;">nHeight</span><br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;nRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; += <span style="color: #000000;">10</span><br />&nbsp; &nbsp;oSay2:<span style="color: #000000;">nTop</span> &nbsp; &nbsp; := nRow<br />&nbsp; &nbsp;nRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; += <span style="color: #000000;">&#40;</span> oSay2:<span style="color: #000000;">nHeight</span> + <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;WITH OBJECT oBrwFree<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nTop</span> &nbsp; &nbsp; &nbsp; := nRow<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidths</span> &nbsp; &nbsp;:= nColWidth<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeight</span> &nbsp; &nbsp;:= :<span style="color: #000000;">nLen</span> * :<span style="color: #000000;">nRowHeight</span><br />&nbsp; &nbsp; &nbsp; nRow &nbsp; &nbsp; &nbsp; &nbsp;:= :<span style="color: #000000;">nTop</span> + :<span style="color: #000000;">nHeight</span><br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;nRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; += <span style="color: #000000;">10</span><br />&nbsp; &nbsp;oSay3:<span style="color: #000000;">nTop</span> &nbsp; &nbsp; := nRow<br />&nbsp; &nbsp;nRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; += <span style="color: #000000;">&#40;</span> oSay3:<span style="color: #000000;">nHeight</span> + <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;WITH OBJECT oBrwUrlaub<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nTop</span> &nbsp; &nbsp; &nbsp; := nRow<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidths</span> &nbsp; &nbsp;:= nColWidth<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeight</span> &nbsp; &nbsp;:= :<span style="color: #000000;">nLen</span> * :<span style="color: #000000;">nRowHeight</span><br />&nbsp; &nbsp; &nbsp; nRow &nbsp; &nbsp; &nbsp; &nbsp;:= :<span style="color: #000000;">nTop</span> + :<span style="color: #000000;">nHeight</span><br />&nbsp; &nbsp;END<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OnPaint<span style="color: #000000;">&#40;</span> hDC, oWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span> oBrwFree:<span style="color: #000000;">nTop</span> &nbsp; - <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, oBrwFree:<span style="color: #000000;">nTop</span> &nbsp; - <span style="color: #000000;">1</span>, oWnd:<span style="color: #000000;">nWidth</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oWnd:<span style="color: #000000;">Line</span><span style="color: #000000;">&#40;</span> oBrwUrlaub:<span style="color: #000000;">nTop</span> - <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span>, oBrwUrlaub:<span style="color: #000000;">nTop</span> - <span style="color: #000000;">1</span>, oWnd:<span style="color: #000000;">nWidth</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;">static</span> <span style="color: #00C800;">function</span> RefreshAll<span style="color: #000000;">&#40;</span> lRoster <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lRoster := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lRoster<br />&nbsp; &nbsp; &nbsp; FillRoster<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;oBrwRoster:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">WorkMergeData</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwRoster:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;OnResize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwRoster:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwFree:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwUrlaub:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwFocus:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CheckFocus<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;">static</span> <span style="color: #00C800;">function</span> DropOver<span style="color: #000000;">&#40;</span> oBrwFrom, nRow, nCol, nFlags, oBrwThis <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oCol<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRecs, aPoint<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwFrom == oBrwThis<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oBrwThis == oBrwRoster<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aPoint &nbsp; &nbsp; &nbsp;:= ClientToClient<span style="color: #000000;">&#40;</span> oBrwFrom:<span style="color: #000000;">hWnd</span>, oBrwThis:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">&#123;</span> nRow, nCol <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> apoint<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <= <span style="color: #000000;">45</span> &nbsp; &nbsp;<span style="color: #B900B9;">//Uwe</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; apoint<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">50</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwThis:<span style="color: #000000;">LButtonDown</span><span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, nFlags <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwThis:<span style="color: #000000;">LButtonUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwThis:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwFrom:<span style="color: #000000;">nColSel</span> == oBrwThis:<span style="color: #000000;">nColSel</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> StaffAllocate<span style="color: #000000;">&#40;</span> oBrwFrom:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span>, oBrwFrom:<span style="color: #000000;">nColSel</span>, oBrwThis:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwFrom:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oBrwThis == oBrwFree<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> oBrwFrom == oBrwRoster<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> StaffAllocate<span style="color: #000000;">&#40;</span> oBrwFrom:<span style="color: #000000;">SelectedCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, oBrwFrom:<span style="color: #000000;">nColSel</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwThis:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> oBrwFrom == oBrwUrlaub<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> StaffAllocate<span style="color: #000000;">&#40;</span> oBrwFrom:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span>, oBrwFrom:<span style="color: #000000;">nColSel</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwFrom:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwThis:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwFrom:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> oBrwThis == oBrwUrlaub<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> oBrwFrom == oBrwRoster<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> StaffAllocate<span style="color: #000000;">&#40;</span> oBrwFrom:<span style="color: #000000;">SelectedCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, oBrwFrom:<span style="color: #000000;">nColSel</span>, <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwThis:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> oBrwFrom == oBrwFree<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> StaffAllocate<span style="color: #000000;">&#40;</span> oBrwFrom:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span>, oBrwFrom:<span style="color: #000000;">nColSel</span>, <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwFrom:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwThis:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwFrom:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp;CheckFocus<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;">static</span> <span style="color: #00C800;">function</span> StaffAllocate<span style="color: #000000;">&#40;</span> nStaffID, nWeek, nWork <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lDone &nbsp; &nbsp; &nbsp; := .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nPresentWork<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nSerial, aStaff, nSaveRec<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nStaffID > <span style="color: #000000;">0</span> .and. nWeek > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> nStaffID, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nWork != <span style="color: #000000;">&#40;</span> nPresentWork := <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> nWeek <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nPresentWork > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Tour. Need to renumber Serial Order</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSerial &nbsp;:= AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> aStaff := TourWeekStaff<span style="color: #000000;">&#40;</span> nPresentWork, nWeek <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, nStaffID <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nSerial < Len<span style="color: #000000;">&#40;</span> aStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Promote serial no of other staff</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSaveRec &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> nSerial := nSerial + <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> aStaff<span style="color: #000000;">&#91;</span> nSerial <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldPut<span style="color: #000000;">&#40;</span> nWeek, FieldGet<span style="color: #000000;">&#40;</span> nWeek <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBGOTO<span style="color: #000000;">&#40;</span> nSaveRec <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nWork > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Tour. Get SerialNo in the tour</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSerial &nbsp;:= Len<span style="color: #000000;">&#40;</span> TourWeekStaff<span style="color: #000000;">&#40;</span> nWork, nWeek <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nWork &nbsp; &nbsp;:= nWork * <span style="color: #000000;">100</span> + nSerial<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldPut<span style="color: #000000;">&#40;</span> nWeek, nWork <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBCOMMIT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nWork > <span style="color: #000000;">0</span> .or. nPresentWork > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwFree:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwUrlaub:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwFocus:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lDone &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</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> lDone<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> TourWeekStaff<span style="color: #000000;">&#40;</span> nTour, nWeek <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStaff &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n, nStaff<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nTour > <span style="color: #000000;">100</span><br />&nbsp; &nbsp; &nbsp; nTour &nbsp; &nbsp;:= Int<span style="color: #000000;">&#40;</span> nTour / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aRoster <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> aRoster<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == nTour<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nStaff := aRoster<span style="color: #000000;">&#91;</span> n, nWeek <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aStaff, nStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aStaff<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> InitVars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;dBOW &nbsp; &nbsp; &nbsp; &nbsp;:= BOW<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;WeeksArray<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;">static</span> <span style="color: #00C800;">function</span> CheckDBF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field <span style="color: #0000ff;">ID</span>,FBOW,STAFFID<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDbf, aCols, c<br /><br />&nbsp; &nbsp;cDbf &nbsp; &nbsp; := cPath + cStaffDBF<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aCols &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"ID"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">3</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"FNAME"</span>, <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; DBCREATE<span style="color: #000000;">&#40;</span> cDbf, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ID</span> TAG <span style="color: #0000ff;">ID</span><br />&nbsp; &nbsp; &nbsp; USE<br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH c IN <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Tom"</span>, <span style="color: #ff0000;">"BRADY "</span>, <span style="color: #ff0000;">"ALEX"</span>, <span style="color: #ff0000;">"CHRISTOPHER"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FIELD->ID &nbsp; &nbsp; &nbsp;:= RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FIELD->FNAME &nbsp; := c<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp; &nbsp; CLOSE <span style="color: #00C800;">DATA</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cDbf &nbsp; &nbsp; := cPath + cToursDBF<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aCols &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"ID"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">3</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"FNAME"</span>, <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"FG"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"BG"</span>, &nbsp; &nbsp;<span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; DBCREATE<span style="color: #000000;">&#40;</span> cDbf, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ID</span> TAG <span style="color: #0000ff;">ID</span><br />&nbsp; &nbsp; &nbsp; USE<br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH c IN <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"7-12/15-18"</span>, &nbsp; RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">193</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">190</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"12-17/18-21"</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>,<span style="color: #000000;">225</span>,<span style="color: #000000;">155</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;APPEND BLANK<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FIELD->ID &nbsp; &nbsp; &nbsp;:= RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FIELD->FNAME &nbsp; := c<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FIELD->FG &nbsp; &nbsp; &nbsp;:= CLR_BLACK<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FIELD->BG &nbsp; &nbsp; &nbsp;:= c<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp; &nbsp; CLOSE <span style="color: #00C800;">DATA</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cDbf &nbsp; &nbsp; := cPath + cSchedDbf<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aCols &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"STAFFID"</span>, &nbsp;<span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">3</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"MO"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"DI"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"MI"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"DO"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"FR"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"SA"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"SO"</span>, &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'N'</span>, &nbsp;<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"FBOW"</span>, &nbsp; &nbsp; <span style="color: #ff0000;">'D'</span>, &nbsp;<span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; DBCREATE<span style="color: #000000;">&#40;</span> cDbf, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; USE <span style="color: #000000;">&#40;</span> cDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> DTOS<span style="color: #000000;">&#40;</span>FBOW<span style="color: #000000;">&#41;</span>+STR<span style="color: #000000;">&#40;</span>STAFFID,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span> TAG WEEKSTAFF<br />&nbsp; &nbsp; &nbsp; USE<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OpenDBF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cAliasTours &nbsp; &nbsp;:= cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TOUR"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cToursDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAliasTours <span style="color: #000000;">&#41;</span> SHARED<br /><br />&nbsp; &nbsp;aTours &nbsp; &nbsp; &nbsp;:= FW_DbfToArray<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ID,TRIM(FNAME),FG,BG"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SET DELETED OFF<br />&nbsp; &nbsp;GO BOTTOM<br />&nbsp; &nbsp;nToursBias &nbsp;:= FIELD->ID - RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;cAliasStaff &nbsp; &nbsp;:= cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"STAF"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cStaffDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAliasStaff <span style="color: #000000;">&#41;</span> SHARED<br />&nbsp; &nbsp;aStaff &nbsp; &nbsp; &nbsp; &nbsp; := FW_DBFToArray<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ID,TRIM(FNAME)"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SET DELETED OFF<br />&nbsp; &nbsp;GO BOTTOM<br />&nbsp; &nbsp;nStaffBias &nbsp;:= FIELD->ID - RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;cAliasFree &nbsp; &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SCHE"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cSchedDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAliasFree <span style="color: #000000;">&#41;</span> SHARED<br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> TAG WEEKSTAFF<br />&nbsp; &nbsp;SET FILTER <span style="color: #0000ff;">TO</span> !DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;cAliasUrlaub &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SCHE"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cSchedDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAliasUrlaub <span style="color: #000000;">&#41;</span> SHARED<br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> TAG WEEKSTAFF<br />&nbsp; &nbsp;SET FILTER <span style="color: #0000ff;">TO</span> !DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;cAliasSched &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SCHE"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cSchedDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span> SHARED<br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> TAG WEEKSTAFF<br />&nbsp; &nbsp;GO TOP<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> InitStaffSched<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasStaff <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasStaff <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBEVAL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> || AddStaffToSched<span style="color: #000000;">&#40;</span> FIELD->ID <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasStaff <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">static</span> <span style="color: #00C800;">function</span> AddStaffToSched<span style="color: #000000;">&#40;</span> nStaffID <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// call aliased to SCHED</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> nStaffID, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">DO</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; UNTIL ! NetErr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>->STAFFID &nbsp; &nbsp;:= nStaffID<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>->FBOW &nbsp; &nbsp; &nbsp; := dBow<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BOW<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nDay<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> dDate &nbsp; &nbsp; := Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nDay &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= DOW<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">2</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nDay < <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nDay &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">6</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> dDate - nDay<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WeeksArray<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n<br /><br />&nbsp; &nbsp;aWeeks &nbsp; := <span style="color: #000000;">&#123;</span> BOW<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aWeeks, ATail<span style="color: #000000;">&#40;</span> aWeeks <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> aWeeks<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> NonZeroColsCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// call aliased</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCount &nbsp; := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> i<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> i := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> FieldGet<span style="color: #000000;">&#40;</span> i <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCount++<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> i<br /><br /><span style="color: #00C800;">return</span> nCount<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> D2CDM<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> Day<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'.'</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> Month<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'.'</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> FillRoster<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nWeek, nTour<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt, nPrev, nSerial, nSl<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aTourStaff &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;ASIZE<span style="color: #000000;">&#40;</span> aRoster, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// do not use aRoster := {}</span><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> aTours, <span style="color: #000000;">&#123;</span> |a| AAdd<span style="color: #000000;">&#40;</span> aRoster, <span style="color: #000000;">&#123;</span> a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nWeek &nbsp; := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; aTourStaff &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> nTour := <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> nWeek <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aTourStaff, <span style="color: #000000;">&#123;</span> nTour, <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>->STAFFID <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSkip<span style="color: #000000;">&#40;</span> <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;">enddo</span><br />&nbsp; &nbsp; &nbsp; ASort<span style="color: #000000;">&#40;</span> aTourStaff,,, <span style="color: #000000;">&#123;</span> |x,y| x<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; nPrev &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nSerial &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> nAt := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aTourStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nTour &nbsp; &nbsp;:= aTourStaff<span style="color: #000000;">&#91;</span> nAt, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nTour > <span style="color: #000000;">100</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSl &nbsp; := nTour % <span style="color: #000000;">100</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nTour := Int<span style="color: #000000;">&#40;</span> nTour / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSl &nbsp; := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nTour == nPrev<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSerial++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nPrev &nbsp; &nbsp;:= nTour<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSerial &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nSl != nSerial<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// may happen when staff are deleted</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSEEK<span style="color: #000000;">&#40;</span> DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span> aTourStaff<span style="color: #000000;">&#91;</span> nAt, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldPut<span style="color: #000000;">&#40;</span> nWeek, nTour * <span style="color: #000000;">100</span> + nSerial <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FillRosterOneStaff<span style="color: #000000;">&#40;</span> aTourStaff<span style="color: #000000;">&#91;</span> nAt, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, nWeek, nTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span> nAt<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> nWeek<br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SortRoster<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;">static</span> <span style="color: #00C800;">function</span> FillRosterOneStaff<span style="color: #000000;">&#40;</span> nStaff, nWeek, nTour <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt &nbsp; := AScan<span style="color: #000000;">&#40;</span> aRoster, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == nTour .and. a<span style="color: #000000;">&#91;</span> nWeek <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aRoster, <span style="color: #000000;">&#123;</span> nTour, <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nAt &nbsp; &nbsp; &nbsp;:= Len<span style="color: #000000;">&#40;</span> aRoster <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;aRoster<span style="color: #000000;">&#91;</span> nAt, nWeek <span style="color: #000000;">&#93;</span> &nbsp; := nStaff<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SortRoster<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> aRoster, <span style="color: #000000;">&#123;</span> |a,i| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#93;</span> := a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> * <span style="color: #000000;">100</span> + i <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;ASort<span style="color: #000000;">&#40;</span> aRoster, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">&#123;</span> |x,y| x<span style="color: #000000;">&#91;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SetWeek<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cBow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> dBow == BOW<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// no change</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; dBow &nbsp; &nbsp; := BOW<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cBow &nbsp; &nbsp; := DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">SELECT</span><span style="color: #000000;">&#40;</span> cAliasFree <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// dbfs are all open</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasSched &nbsp;<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, cBow <span style="color: #000000;">&#41;</span>, OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, cBow <span style="color: #000000;">&#41;</span>, DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasFree &nbsp; <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, cBow <span style="color: #000000;">&#41;</span>, OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, cBow <span style="color: #000000;">&#41;</span>, DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> cAliasUrlaub <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, cBow <span style="color: #000000;">&#41;</span>, OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, cBow <span style="color: #000000;">&#41;</span>, DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;InitStaffSched<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FillRoster<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwRoster != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; BrwWeekHeaders<span style="color: #000000;">&#40;</span> oBrwRoster <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> IDLOOKUP<span style="color: #000000;">&#40;</span> nID, aList <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nID > <span style="color: #000000;">100</span><br />&nbsp; &nbsp; &nbsp; nID &nbsp; := Int<span style="color: #000000;">&#40;</span> nID / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> AScan<span style="color: #000000;">&#40;</span> aList, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == nID <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ID2C<span style="color: #000000;">&#40;</span> nId, aList <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt &nbsp; := IDLOOKUP<span style="color: #000000;">&#40;</span> nID, aList <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nAt == <span style="color: #000000;">0</span>, <span style="color: #ff0000;">''</span>, aList<span style="color: #000000;">&#91;</span> nAt, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ID2CLR<span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt &nbsp; := IDLOOKUP<span style="color: #000000;">&#40;</span> nID, aTours <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nAt == <span style="color: #000000;">0</span>, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> aTours<span style="color: #000000;">&#91;</span> nAt, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>, aTours<span style="color: #000000;">&#91;</span> nAt, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BrwWeekHeaders<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Mo"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Di"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Mi"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Do"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Fr"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Sa"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"So"</span> + CRLF + D2CDM<span style="color: #000000;">&#40;</span> dBow + <span style="color: #000000;">6</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;">static</span> <span style="color: #00C800;">function</span> PopMenuWeeks<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> n<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aWeeks <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; MenuAddItem<span style="color: #000000;">&#40;</span> DTOC<span style="color: #000000;">&#40;</span> aWeeks<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span>, aWeeks<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> == dBow, .t., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> |oItem| SetWeek<span style="color: #000000;">&#40;</span> CTOD<span style="color: #000000;">&#40;</span> oItem:<span style="color: #000000;">cPrompt</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> oPop:<span style="color: #000000;">aMenuItems</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oItem:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CheckFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nWork<br /><br />&nbsp; &nbsp;nSelWeek &nbsp;:= oBrwFocus:<span style="color: #000000;">nColSel</span><br />&nbsp; &nbsp;nSelStaff := nSelTour := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nSelWeek > <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oBrwFocus == oBrwRoster<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSelStaff &nbsp; &nbsp;:= oBrwRoster:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nSelWeek <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nSelStaff > <span style="color: #000000;">100</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nSelStaff &nbsp; := Int<span style="color: #000000;">&#40;</span> nSelStaff / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSelTour &nbsp; &nbsp; := oBrwRoster:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrwFocus:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBSKIP<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// force reread data</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nWork &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#40;</span> oBrwFocus:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> nSelWeek <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwFocus == oBrwFree<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nWork == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSelStaff &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span> oBrwFocus:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>->STAFFID<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSelTour &nbsp; &nbsp; := nWork<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nWork == <span style="color: #000000;">-1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSelStaff &nbsp; &nbsp;:= <span style="color: #000000;">&#40;</span> oBrwFocus:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>->STAFFID<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSelTour &nbsp; &nbsp; := nWork<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oBar</span>:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwRoster != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// all browses are active</span><br />&nbsp; &nbsp; &nbsp; oBrwRoster:<span style="color: #000000;">bDragBegin</span> &nbsp; := ;<br />&nbsp; &nbsp; &nbsp; oBrwFree: &nbsp;<span style="color: #000000;">bDragBegin</span> &nbsp; := ;<br />&nbsp; &nbsp; &nbsp; oBrwUrlaub:<span style="color: #000000;">bDragBegin</span> &nbsp; := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oBrwFocus == oBrwRoster<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwRoster:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nSelWeek <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwRoster:<span style="color: #000000;">bDragBegin</span> &nbsp; := <span style="color: #000000;">&#123;</span> |r,c,f,o| SetDropInfo<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; elseif oBrwFocus == oBrwFree<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwFree:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nSelWeek <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwFree:<span style="color: #000000;">bDragBegin</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> |r,c,f,o| SetDropInfo<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; elseif oBrwFocus == oBrwUrlaub<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrwUrlaub:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nSelWeek <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> == <span style="color: #000000;">-1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwUrlaub:<span style="color: #000000;">bDragBegin</span> &nbsp; := <span style="color: #000000;">&#123;</span> |r,c,f,o| SetDropInfo<span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BtnFreeAction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;CheckFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelWeek > <span style="color: #000000;">1</span> .and. nSelTour != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; StaffAllocate<span style="color: #000000;">&#40;</span> nSelStaff, nSelWeek, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BtnUrlaubAction<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;CheckFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelWeek > <span style="color: #000000;">1</span> .and. nSelTour >= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; StaffAllocate<span style="color: #000000;">&#40;</span> nSelStaff, nSelWeek, <span style="color: #000000;">-1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BtnTourAction<span style="color: #000000;">&#40;</span> nTourID <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;CheckFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelWeek > <span style="color: #000000;">1</span> .and. nSelTour != nTourID<br />&nbsp; &nbsp; &nbsp; StaffAllocate<span style="color: #000000;">&#40;</span> nSelStaff, nSelWeek, nTourID <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#ifdef DYN_BTNS<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AddTourBtn<span style="color: #000000;">&#40;</span> oBar, n <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">static</span> lGroup &nbsp;:= .t.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt, nTour<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cPrompt &nbsp;:= Trim<span style="color: #000000;">&#40;</span> aTours<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;nAt &nbsp; &nbsp; &nbsp; &nbsp; := Int<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cPrompt <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cPrompt &nbsp; &nbsp; := <span style="color: #ff0000;">"Schicht "</span> + <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cPrompt, nAt <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cPrompt, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nAt &nbsp; &nbsp; &nbsp; &nbsp; := Len<span style="color: #000000;">&#40;</span> oBar:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nTour &nbsp; &nbsp; &nbsp; := aTours<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lGroup<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #00C800;">AT</span> nAt <span style="color: #0000ff;">PROMPT</span> cPrompt GROUP ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">WHEN</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelTour != nTour ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> BtnTouraction<span style="color: #000000;">&#40;</span> nTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lGroup &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #00C800;">AT</span> nAt <span style="color: #0000ff;">PROMPT</span> cPrompt ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">WHEN</span> nSelStaff > <span style="color: #000000;">0</span> .and. nSelTour != nTour ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> BtnTouraction<span style="color: #000000;">&#40;</span> nTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lGroup &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />#else<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> PopTourMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop, n<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aTours <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; MenuAddItem<span style="color: #000000;">&#40;</span> aTours<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #00C800;">nil</span>, .f., .t., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> |oItem| BtnTourAction<span style="color: #000000;">&#40;</span> oItem:<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := aTours<span style="color: #000000;">&#91;</span> n, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span> n<br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br /><br />#endif<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DlgTours<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 />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TOUR"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cToursDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> SHARED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SCHICHT"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oFont</span><br /><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;">-30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE cAlias ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"FNAME"</span>, <span style="color: #ff0000;">"FG"</span>, <span style="color: #ff0000;">"BG"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"Schicht"</span>, <span style="color: #ff0000;">"FG"</span>, <span style="color: #ff0000;">"BG"</span> ;<br />&nbsp; &nbsp; &nbsp; COLSIZES <span style="color: #00C800;">nil</span>, <span style="color: #000000;">50</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">FG</span>:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" &nbsp;"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">BG</span>:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" &nbsp;"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> oBrw:<span style="color: #000000;">FG</span>:<span style="color: #000000;">Value</span>, oBrw:<span style="color: #000000;">BG</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= ;<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> oBrw:<span style="color: #000000;">BG</span>:<span style="color: #000000;">Value</span>, oBrw:<span style="color: #000000;">FG</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; WITH OBJECT :<span style="color: #000000;">FG</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> oBrw:<span style="color: #000000;">BG</span>:<span style="color: #000000;">Value</span>, oBrw:<span style="color: #000000;">FG</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bClrSelFocus</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> oBrw:<span style="color: #000000;">FG</span>:<span style="color: #000000;">Value</span>, oBrw:<span style="color: #000000;">BG</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">fg</span>:<span style="color: #000000;">bLDClickData</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || TourClr<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bg</span>:<span style="color: #000000;">bLDClickData</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> || TourClr<span style="color: #000000;">&#40;</span> oBrw, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><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: #000000;">175</span>, <span style="color: #000000;">10</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\n</span>ew2.bmp"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> EditTour<span style="color: #000000;">&#40;</span> oBrw, .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">175</span>, <span style="color: #000000;">32</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>dit.bmp"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> EditTour<span style="color: #000000;">&#40;</span> oBrw, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">175</span>, <span style="color: #000000;">54</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\d</span>elete.bmp"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DelTour<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">175</span>,<span style="color: #000000;">170</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>lose.bmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</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><br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBCLOSEAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">static</span> <span style="color: #00C800;">function</span> EditTour<span style="color: #000000;">&#40;</span> oBrw, lNew <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cTour &nbsp; &nbsp;:= FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lDone &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBar, nAt, nBtn, oBtn, nID<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lNew &nbsp; := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; cTour &nbsp; &nbsp; &nbsp; := Space<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cTour <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lNew, <span style="color: #ff0000;">"Enter New"</span>, <span style="color: #ff0000;">"Modify"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"TOUR NAME"</span>, @cTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APPEND BLANK<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + nToursBias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, cTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span>, CLR_WHITE <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBSKIP<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nID &nbsp; &nbsp; &nbsp;:= FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lDone &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lDone<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aTours, <span style="color: #000000;">&#123;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, Trim<span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>, FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />#ifdef DYN_BTNS<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AddTourBtn<span style="color: #000000;">&#40;</span> WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oBar</span>, Len<span style="color: #000000;">&#40;</span> aTours <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />#endif<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cTour &nbsp; &nbsp;:= &nbsp;Trim<span style="color: #000000;">&#40;</span> cTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aTours<span style="color: #000000;">&#91;</span> IDLOOKUP<span style="color: #000000;">&#40;</span> nId, aTours <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= cTour<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrwRoster:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />#ifdef DYN_BTNS<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBar &nbsp; &nbsp; := WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oBar</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAt &nbsp; &nbsp; &nbsp;:= IdLookUp<span style="color: #000000;">&#40;</span> nID, aTours <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nBtn &nbsp; &nbsp; := Len<span style="color: #000000;">&#40;</span> oBar:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span> - Len<span style="color: #000000;">&#40;</span> aTours <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> + nAt<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn &nbsp; &nbsp; := oBar:<span style="color: #000000;">aControls</span><span style="color: #000000;">&#91;</span> nBtn <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAt &nbsp; &nbsp; &nbsp;:= Int<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cTour <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cTour &nbsp; &nbsp;:= <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cTour, nAt <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cTour, nAt + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Schicht "</span> + cTour <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBtn:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />#endif<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> lDone<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> TourClr<span style="color: #000000;">&#40;</span> oBrw, nCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nClr &nbsp; &nbsp; := <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> nCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nSel<br /><br />&nbsp; &nbsp;nSel &nbsp;:= ChooseColor<span style="color: #000000;">&#40;</span> nClr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nSel != nClr<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, FieldPut<span style="color: #000000;">&#40;</span> nCol, nSel <span style="color: #000000;">&#41;</span>, DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aTours<span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, nCol <span style="color: #000000;">&#93;</span> := nSel<br />&nbsp; &nbsp; &nbsp; oBrwRoster:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DelTour<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nID &nbsp; := oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nAt &nbsp; := IdLookUp<span style="color: #000000;">&#40;</span> nID, aTours <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBar &nbsp;:= WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oBar</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nBtn &nbsp;:= Len<span style="color: #000000;">&#40;</span> oBar:<span style="color: #000000;">aControls</span> <span style="color: #000000;">&#41;</span> - Len<span style="color: #000000;">&#40;</span> aTours <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> + nAt<br /><br />&nbsp; &nbsp;oBar:<span style="color: #000000;">Del</span><span style="color: #000000;">&#40;</span> nBtn <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;ADel<span style="color: #000000;">&#40;</span> aTours, nAt, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, DBDELETE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DelTourFromSched<span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <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;">static</span> <span style="color: #00C800;">function</span> DelTourFromSched<span style="color: #000000;">&#40;</span> nTour <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nWeek, nVal<br /><br />&nbsp; &nbsp;SET SCOPE <span style="color: #0000ff;">TO</span><br />&nbsp; &nbsp;GO TOP<br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> nWeek := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nVal &nbsp;:= FieldGet<span style="color: #000000;">&#40;</span> nWeek <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nVal > <span style="color: #000000;">100</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nVal &nbsp;:= Int<span style="color: #000000;">&#40;</span> nVal / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nVal == nTour<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> nWeek, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; SKIP<br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp;GO TOP<br />&nbsp; &nbsp;SET SCOPE <span style="color: #0000ff;">TO</span> DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span>, DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DlgStaff<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 />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias &nbsp; := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"STAFF"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cPath + cStaffDbf <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> SHARED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SCHICHT"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FONT</span> WndMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">oFont</span><br /><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;">-30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE cAlias ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"FNAME"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"Staff"</span> ;<br />&nbsp; &nbsp; &nbsp; COLSIZES <span style="color: #00C800;">nil</span>, <span style="color: #000000;">50</span> ;<br />&nbsp; &nbsp; &nbsp; CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">2</span><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: #000000;">175</span>, <span style="color: #000000;">10</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\n</span>ew2.bmp"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> EditStaff<span style="color: #000000;">&#40;</span> oBrw, .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">175</span>, <span style="color: #000000;">32</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\e</span>dit.bmp"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> EditStaff<span style="color: #000000;">&#40;</span> oBrw, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">175</span>, <span style="color: #000000;">54</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\d</span>elete.bmp"</span> &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DelStaff<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">175</span>,<span style="color: #000000;">170</span> BUTTONBMP BITMAP <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\c</span>lose.bmp"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</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><br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBCLOSEAREA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">static</span> <span style="color: #00C800;">function</span> EditStaff<span style="color: #000000;">&#40;</span> oBrw, lNew <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cStaff &nbsp; &nbsp;:= FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> lDone &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBar, nAt, oBtn, nID<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> lNew &nbsp; := .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; cStaff &nbsp; &nbsp; &nbsp; := Space<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> cStaff <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lNew, <span style="color: #ff0000;">"Enter New"</span>, <span style="color: #ff0000;">"Modify"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"STAFF NAME"</span>, @cStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; APPEND BLANK<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + nStaffBias <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span>, cStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBSKIP<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nID &nbsp; &nbsp; &nbsp;:= FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cStaff &nbsp; := Trim<span style="color: #000000;">&#40;</span> cStaff <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> lNew<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aStaff, <span style="color: #000000;">&#123;</span> nID, cStaff <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddStaffToSched<span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwFree:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwUrlaub:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aStaff<span style="color: #000000;">&#91;</span> IdLookUp<span style="color: #000000;">&#40;</span> nID, aStaff <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> := cStaff<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lDone &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DelStaff<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nID &nbsp; &nbsp; &nbsp;:= oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! MsgNoYes<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Delete "</span> + Trim<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" ? "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Clear the ID from SCHED dbf</span><br />&nbsp; &nbsp;SET DELETED OFF<br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>, OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span>, DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DBEVAL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> || ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> FIELD->STAFFID == nID .AND. !DELETED<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, FIELD->FBOW := CTOD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span>, DBDELETE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SET DELETED <span style="color: #0000ff;">ON</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAliasSched <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, DTOS<span style="color: #000000;">&#40;</span> dBow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Delete in Staff dbf and Array</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, DBDELETE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, DBUNLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;ADel<span style="color: #000000;">&#40;</span> aStaff, IDLOOKUP<span style="color: #000000;">&#40;</span> nID <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;RefreshAll<span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /><span style="color: #B900B9;">// EXPORT TO TMP* DBF FOR USE WITH FASTREPORT</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#ifdef PRN_SINGLEDBF<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ExportPrintDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aNames &nbsp; := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Schicht"</span>, <span style="color: #ff0000;">"Mo"</span>, <span style="color: #ff0000;">"Di"</span>, <span style="color: #ff0000;">"Mi"</span>, <span style="color: #ff0000;">"Do"</span>, <span style="color: #ff0000;">"Fr"</span>, <span style="color: #ff0000;">"Sa"</span>, <span style="color: #ff0000;">"So"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aCols, cFld, cFile, nCol, nRecPos<br /><br />&nbsp; &nbsp;aCols &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each cFld in aNames<br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">&#123;</span> cFld, <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;cFile &nbsp; &nbsp;:= cPath + <span style="color: #ff0000;">"TMPSCHICHT.DBF"</span><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> cFile, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> TMP EXCLUSIVE<br />&nbsp; &nbsp;TMP-><span style="color: #000000;">&#40;</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrwRoster <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;TMP-><span style="color: #000000;">&#40;</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrwFree, <span style="color: #ff0000;">"Freie"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;TMP-><span style="color: #000000;">&#40;</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrwUrlaub, <span style="color: #ff0000;">"Urlaub"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE<br /><br />&nbsp; &nbsp;? <span style="color: #ff0000;">"Exported to temporary files"</span><br /><br />&nbsp; &nbsp;oBrwFocus:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrw, cText <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> uBookMark &nbsp; := oBrw:<span style="color: #000000;">BookMark</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol<br /><br />&nbsp; &nbsp;Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bGoTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bKeyCount</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; REPEAT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> cText != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, cText <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> nCol, Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; UNTIL Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bSkip</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;EVal<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bBookMark</span>, uBookMark <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 />#else<br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ExportPrintDbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aNames &nbsp; := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Schicht"</span>, <span style="color: #ff0000;">"Mo"</span>, <span style="color: #ff0000;">"Di"</span>, <span style="color: #ff0000;">"Mi"</span>, <span style="color: #ff0000;">"Do"</span>, <span style="color: #ff0000;">"Fr"</span>, <span style="color: #ff0000;">"Sa"</span>, <span style="color: #ff0000;">"So"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aCols, cFld, cFile, nCol, nRecPos<br /><br />&nbsp; &nbsp;aCols &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each cFld in aNames<br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aCols, <span style="color: #000000;">&#123;</span> cFld, <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">20</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;cFile &nbsp; &nbsp;:= cPath + <span style="color: #ff0000;">"TMPSCHICHT.DBF"</span><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> cFile, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> TMP EXCLUSIVE<br />&nbsp; &nbsp;TMP-><span style="color: #000000;">&#40;</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrwRoster <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE<br /><br />&nbsp; &nbsp;aCols<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #ff0000;">"Staff"</span><br />&nbsp; &nbsp;cFile &nbsp; &nbsp;:= cPath + <span style="color: #ff0000;">"TMPFREIE.DBF"</span><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> cFile, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> TMP EXCLUSIVE<br />&nbsp; &nbsp;TMP-><span style="color: #000000;">&#40;</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrwFree <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE<br /><br />&nbsp; &nbsp;cFile &nbsp; &nbsp;:= cPath + <span style="color: #ff0000;">"TMPURLAUB.DBF"</span><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> cFile, aCols <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> TMP EXCLUSIVE<br />&nbsp; &nbsp;TMP-><span style="color: #000000;">&#40;</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrwUrlaub <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;USE<br /><br />&nbsp; &nbsp;? <span style="color: #ff0000;">"Exported to temporary files"</span><br /><br />&nbsp; &nbsp;oBrwFocus:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ExportFromBrw<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> uBookMark &nbsp; := oBrw:<span style="color: #000000;">BookMark</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol<br /><br />&nbsp; &nbsp;Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bGoTop</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bKeyCount</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; REPEAT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DBAPPEND<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FieldPut<span style="color: #000000;">&#40;</span> nCol, Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; UNTIL Eval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bSkip</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;EVal<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">bBookMark</span>, uBookMark <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 />#endif<br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /><br />#ifdef STANDALONE<br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Client2Screen<span style="color: #000000;">&#40;</span> hWnd, aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;aPoint &nbsp; := ClientToScreen<span style="color: #000000;">&#40;</span> hWnd, aPoint <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> > 0x8000<br />&nbsp; &nbsp; &nbsp; aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> -= 0xFFFF<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> > 0x8000<br />&nbsp; &nbsp; &nbsp; aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> -= 0xFFFF<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aPoint<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Screen2Client<span style="color: #000000;">&#40;</span> hWnd, aPoint <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;aPoint := ScreenToClient<span style="color: #000000;">&#40;</span> hWnd, aPoint <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> > 0x8000<br />&nbsp; &nbsp; &nbsp; aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> -= 0xFFFF<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> > 0x8000<br />&nbsp; &nbsp; &nbsp; aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> -= 0xFFFF<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aPoint<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ClientToClient<span style="color: #000000;">&#40;</span> hFrom, hDest, aPoint, lInWnd <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;aPoint &nbsp; := Client2Screen<span style="color: #000000;">&#40;</span> hFrom, aPoint <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;lInWnd &nbsp; := <span style="color: #000000;">&#40;</span> WindowFromPoint<span style="color: #000000;">&#40;</span> aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, aPoint<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == hDest <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;aPoint &nbsp; := Screen2Client<span style="color: #000000;">&#40;</span> hDest, aPoint <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> aPoint<br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> RLOK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! DBRLOCK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /><span style="color: #B900B9;">//============================================================================//</span><br /><br />#endif<br /><br /><br /><br />&nbsp;</div>[/code:3ozju68r]
xBrowse STAFF SCHEDULE with source code
Otto, I don`t know, if it is useful for You I added a [b:vpqolrfk][color=#FF0000:vpqolrfk]WEEK-SKIPPER[/color:vpqolrfk][/b:vpqolrfk] and [color=#FF0000:vpqolrfk][b:vpqolrfk]start / end [/b:vpqolrfk]-[/color:vpqolrfk]says to the Mainscreen ( popup < [b:vpqolrfk]week[/b:vpqolrfk] > is just optional ) [img:vpqolrfk]http&#58;//www&#46;pflegeplus&#46;com/pictures/weekskip1&#46;jpg[/img:vpqolrfk] Added : [code=fw:vpqolrfk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// New !!!</span><br /><span style="color: #B900B9;">// ---------</span><br /><span style="color: #00C800;">static</span> oSay4, oSay5,cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, nWeekcount := <span style="color: #000000;">0</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 />..<br />SetWeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// New !!!</span><br /><span style="color: #B900B9;">// ---------</span><br />cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := DTOC<span style="color: #000000;">&#40;</span> aWeeks<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := DTOC<span style="color: #000000;">&#40;</span> aWeeks<span style="color: #000000;">&#91;</span> <span style="color: #000000;">11</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />--<br />--<br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BrowseWnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />..<br />..<br /><span style="color: #B900B9;">// New !!!</span><br /><span style="color: #B900B9;">// ---------</span><br />@ nBarHt + <span style="color: #000000;">3</span>, <span style="color: #000000;">830</span> <span style="color: #0000ff;">SAY</span> oSay4 <span style="color: #0000ff;">VAR</span> cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd TRANSPARENT ;<br /><span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">UPDATE</span><br />oSay4:<span style="color: #000000;">lTransparent</span> := .T.<br />oSay4:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">&#41;</span><br />  <br />@ nBarHt + <span style="color: #000000;">20</span>, <span style="color: #000000;">830</span> <span style="color: #0000ff;">SAY</span> oSay5 <span style="color: #0000ff;">VAR</span> cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> ;<br /><span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd TRANSPARENT ;<br /><span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">UPDATE</span><br />oSay5:<span style="color: #000000;">lTransparent</span> := .T.<br />oSay5:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">&#41;</span><br />---<br />---<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE c_path1 + <span style="color: #ff0000;">"start.bmp"</span> GROUP ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Start"</span> <span style="color: #0000ff;">ACTION</span> SelectWeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE c_path1 + <span style="color: #ff0000;">"minus.bmp"</span>  ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Minus"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> nWeekCount--, ;<br />     IIF <span style="color: #000000;">&#40;</span> nWeekcount = <span style="color: #000000;">0</span>, nWeekcount := <span style="color: #000000;">1</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span>, SelectWeek<span style="color: #000000;">&#40;</span>nWeekcount<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE c_path1 + <span style="color: #ff0000;">"plus.bmp"</span>  ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Plus"</span> <span style="color: #0000ff;">ACTION</span>  <span style="color: #000000;">&#40;</span> nWeekCount++, ;<br />     IIF <span style="color: #000000;">&#40;</span> nWeekcount = <span style="color: #000000;">12</span>, nWeekcount := <span style="color: #000000;">11</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span>, SelectWeek<span style="color: #000000;">&#40;</span>nWeekcount<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE c_path1 + <span style="color: #ff0000;">"end.bmp"</span>  ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"End"</span> <span style="color: #0000ff;">ACTION</span> SelectWeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#41;</span><br />---<br />---<br /><span style="color: #B900B9;">// New !!!</span><br /><span style="color: #B900B9;">// ---------</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SelectWeek<span style="color: #000000;">&#40;</span>nPos<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> n<br /><br /><span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aWeeks <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> nPos =  n<br />          cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := DTOC<span style="color: #000000;">&#40;</span> aWeeks<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />          SetWeek<span style="color: #000000;">&#40;</span> CTOD<span style="color: #000000;">&#40;</span> cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">ENDIF</span><br />     cWeek<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := DTOC<span style="color: #000000;">&#40;</span> aWeeks<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">next</span><br />oSay4:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oSay5:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:vpqolrfk] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse Sample
I'm new to the forum, but I have been a Fivewin user for 10 to 12 years. I just upgraded FWH to get serious about moving all of my stuff to 32 bit. I want to take a good look at what TxBrowse can do, but I can't get the sample testxbrw.prg to build. The compiler appears to go all the way through, but I get an error E0032 "Can't create output file: obj\testxbrw,hrb'. Any ideas of where to look? Charles Pratt
xBrowse Sample
Charles, Are you using Harbour or xHarbour ? What build ?
xBrowse Sample
Hi Antonio - Thanks for your response. Actually, I got everything worked out and it's working fine. I am using the latest FWH (7.01) and xHarbour 0.99.71 builds. I had some mistakes in the make file and had to convert the prg from ADS to native CDX. This is the first time I have done anything with it and I like it! I believe I'll convert some of my TCbrowses to TXBrowses. Best regards, Charles
xBrowse SaveState ?
Hi, I use array in xbrowse with autosort. I want to save the users selected order in ini file. I try to use SaveState method. but it does not save the cOrder. How Can I save it and restore it? Thanks.
xBrowse SaveState ?
Hi, I have solved via saving cOrder variable manually. There may be more quick way. but it is ok now. Thanks.
xBrowse SaveState ?
Regret delay in my response. oBrw:SaveState( { "cOrders" } ) --> cSaveText
xBrowse SaveState ?
Nages, How I can modify the title of header ? I have a big Problem I have application in two language . the final user open a xbrowse of customer in italian language and the headers of xbrowse are translated in italian language the procedure at init restore the state of xbrowse and on close save the state of xbrowse into a ini file the fianal user closed the customer xbrowse go to main menu and change the language from italian to english and confirm it the options text of the main menu is translated on new language (english) when the final user open customer xbrowse found the header titles translated in oldest language (italian) and not on new language ( english). this happend when you change the savestate and restorestate methods of Xbrowse !!! I found a solution to use the ovverride commad and rewrite the old methods but I think it is bad... How we can resolve this problem ? I must change this part of state {"_cHeaders",{"First","Last","Address","City"}} into {"_cHeaders",{"Nome","Cognome","Indirizzo","Località"}}
xBrowse SaveState() to save font?
Hello everyone; Using GetFont() and SelFont() you give the user access to change xbrowse's font. Is there a way to save an xbrowse selected font and then restore back to that font next time it opens? I've tried oBrw:savestate() but it seems like it doesn't save font information. Thank you, Reinaldo.
xBrowse SaveState() to save font?
I suggest these functions [code=fw:2ey47hdp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> SaveBrwFont<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> FontToText<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #0000ff;">Font</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2ey47hdp] You may save the result text wherever [code=fw:2ey47hdp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> RestoreBrwFont<span style="color: #000000;">&#40;</span> oBrw, cFontText <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFont</span><span style="color: #000000;">&#40;</span> FontFromText<span style="color: #000000;">&#40;</span> cFontText <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:2ey47hdp]
xBrowse SaveState() to save font?
Thank you, Rao. That will work perfectly. Reinaldo.
xBrowse SaveState() to save font?
Just a small clarification. Mr. Rao meant oBrw:oFont instead of oBrw:Font. It works perfectly as expected.
xBrowse SaveState() to save font?
[quote="reinaldocrespo":1mriulei]Just a small clarification. Mr. Rao meant oBrw:oFont instead of oBrw:Font. It works perfectly as expected.[/quote:1mriulei] You are right. It was my typing mistake. Thanks.
xBrowse Search Bar
Hello RAo , is it possible to have in xBrowse search bar logic and date field types? Maurizio <!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w -->
xBrowse Search Bar
Irrespective of the field type, whatever is typed by the user for incremental search is assigned to oBrw:cSeek, which is displayed in the search bar.
xBrowse Search Bar
Mr. Rao, when the lGetBar is activated, the focus does not go to the first get of the bar. Regards.
xBrowse Search Bar
Hi. something new? Regards.
xBrowse Search Bar
Hello Rao , I use MySQL , on the column logic ('Intra','Split', ecc) and date (''Data') , the search is not possible. [url:o0b7r5lb]https&#58;//drive&#46;google&#46;com/open?id=1zTfN3h-3OTxG_bwRvKRSgw7P9C4nxsfF[/url:o0b7r5lb] Regards Maurizio
xBrowse SetCheckBitmap Column and bEditValue
Hi freinds,I am using an array in Xbrowse to enable/disable checkbox.[b:20dhtcjk]Screen Snapshot[/b:20dhtcjk][url=http&#58;//imageshack&#46;us:20dhtcjk][img:20dhtcjk]http&#58;//img98&#46;imageshack&#46;us/img98/9871/xbrwhm8&#46;jpg[/img:20dhtcjk][/url:20dhtcjk]I want to change theCheckOn, CheckOff by the user just clicking on that particular column or just by hitting the enterkey on that particular column(Toggle switch)Right now I am able to acheive the same but with a minor aesthetic problem.When the user double click or hit enter key, a cursor will appear and the user has to hit enter key once again for the bitmap to change. Is there any way to avoid this cursor from appearing in the screen. I think the trick is somewhere with bPostEdit or bEditValue, but I could not find out as I am not an expert in xBrowse Here is the code which I have used.[code:20dhtcjk] @ 0,100 XBROWSE oBrwMenu ; COLUMNS 2, 3 ; HEADERS "Menu", "Status" ; OF oDlg ; ARRAY aMenu // should not use AUTOCOLS now oBrwMenu&#58;nMarqueeStyle&#58;=MARQSTYLE_HIGHLROWRC oBrwMenu&#58;lHScroll&#58;=&#46;F&#46; // Horizontal Scroll Bar not required oBrwMenu&#58;lFooter&#58;=&#46;T&#46; // Display Footer // Sub Menu in different colour and Menu's in different Coclour oBrwMenu&#58;bClrStd &#58;= &#123; || iif&#40;oBrwMenu&#58;aArrayData&#91;oBrwMenu&#58;nArrayAt&#93;&#91;4&#93;,aClrCol&#91;1&#93;,aClrCol&#91;2&#93;&#41; &#125; oBrwMenu&#58;lUpdate &#58;= &#46;t&#46; oBrwMenu&#58;nColSel &#58;= 2 oBrwMenu&#58;aCols&#91;1&#93;&#58;nWidth&#58;=350 // Easiest way to dispplay a BMP based on the Logical Value *oBrwMenu&#58;aCols&#91;2&#93;&#58;SetCheck&#40; &#123; "CheckOn", "CheckOff" &#125; &#41; // Alternative way to display BMP, if multiple conditions and more than 2 bitmaps are there oBrwMenu&#58;aCols&#91;2&#93;&#58;AddResource&#40;"CheckOn"&#41; oBrwMenu&#58;aCols&#91;2&#93;&#58;AddResource&#40;"CheckOff"&#41; // Checkbox should be displayed only if the menu type is not a Submenu oBrwMenu&#58;aCols&#91;2&#93;&#58;bBmpData &#58;=&#123; || iif&#40;oBrwMenu&#58;aArrayData&#91;oBrwMenu&#58;nArrayAt&#93;&#91;4&#93;,0,iif&#40;oBrwMenu&#58;aArrayData&#91;oBrwMenu&#58;nArrayAt&#93;&#91;3&#93;,1,2&#41;&#41; &#125; oBrwMenu&#58;aCols&#91;2&#93;&#58;nWidth&#58;=50 oBrwMenu&#58;aCols&#91;2&#93;&#58;bStrData&#58;=&#123; || NIL &#125; oBrwMenu&#58;aCols&#91;2&#93;&#58;nDataStrAlign &#58;= AL_CENTER // No edit for SubMenu oBrwMenu&#58;aCols&#91;2&#93;&#58;bEditWhen &#58;= &#123; || iif&#40;oBrwMenu&#58;aArrayData&#91;oBrwMenu&#58;nArrayAt&#93;&#91;4&#93;,&#46;F&#46;,&#46;T&#46;&#41; &#125; // Edit Type is set to GET, other options are List,Button Etc&#46; oBrwMenu&#58;aCols&#91;2&#93;&#58;nEditType &#58;= EDIT_GET oBrwMenu&#58;aCols&#91;2&#93;&#58;bEditvalue &#58;= &#123; || Space&#40;0&#41; &#125; oBrwMenu&#58;aCols&#91;2&#93;&#58;bOnPostEdit&#58;= &#123; | oCol, xValue, nLastKey | MenuAccessOnEdit&#40; oCol, xValue, nLastKey,oMenuArray &#41; &#125; // Enable user to click on the checkbox on column 2 only oBrwMenu&#58;bLClicked &#58;= &#123; | nRow, nCol | iif&#40;oBrwMenu&#58;nColSel == 2,MenuAccessOnEdit&#40;oBrwMenu&#58;aCols&#91;2&#93;,,,oMenuArray&#41;,NIL&#41; &#125; oBrwMenu&#58;CreateFromCode&#40;&#41; *---------------------------------------------* Function MenuAccessOnEdit&#40; oCol, xValue, nLastKey,oMenuArray &#41; *---------------------------------------------* Local oBrw &#58;= oCol&#58;oBrw // oMenuArray is a TArray Object if oBrw&#58;aArrayData&#91;oBrw&#58;nArrayAt&#93;&#91;3&#93; // &#46;T&#46; oBrw&#58;aArrayData&#91;oBrw&#58;nArrayAt&#93;&#91;3&#93;&#58;=&#46;F&#46; oMenuArray&#58;Goto&#40;oBrw&#58;nArrayAt&#41; oMenuArray&#58;Status&#58;=&#46;F&#46; oMenuArray&#58;save&#40;&#41; else oBrw&#58;aArrayData&#91;oBrw&#58;nArrayAt&#93;&#91;3&#93;&#58;=&#46;T&#46; oMenuArray&#58;Goto&#40;oBrw&#58;nArrayAt&#41; oMenuArray&#58;Status&#58;=&#46;T&#46; oMenuArray&#58;save&#40;&#41; Endif oBrw&#58;Refresh&#40;&#41; Return NIL[/code:20dhtcjk]RegardsAnser
xBrowse SetCheckBitmap Column and bEditValue
use "on change" clause[code:q9d196nq]xbrowse oBrw&#46;&#46;&#46;&#46; on change SetEdit&#40; oBrwMenu &#41; procedure SetEdit&#40; obrw &#41; if oBrw&#58;aArraydata&#91; oBrw&#58;nArrayAt &#93;&#91;4&#93; oBrw&#58;aCols&#91; 2 &#93;&#58;nEditType = EDIT_NONE else oBrw&#58;aCols&#91; 2 &#93;&#58;nEditType = EDIT_GET endif return [/code:q9d196nq]i hope you do understand me
xBrowse SetCheckBitmap Column and bEditValue
Dear Daniel,Thank you for the help, but it is not the solution which I am looking for.I tried your code but it did not make any differenceIf you look at my code posted above, you will find that I have used bEditWhen to acheive the same what you have adviced me to do with the ON CHANGE [code:10uzsr8j]oBrwMenu&#58;aCols&#91;2&#93;&#58;bEditWhen &#58;= &#123; || iif&#40;oBrwMenu&#58;aArrayData&#91;oBrwMenu&#58;nArrayAt&#93;&#91;4&#93;,&#46;F&#46;,&#46;T&#46;&#41; &#125; [/code:10uzsr8j]With the above piece of code I am able to restrict the GET on Sub Menu Items Line (Dark Blue)[b:10uzsr8j]Sub Menu Items Line -> Dark Blue Colour [/b:10uzsr8j] [color=red:10uzsr8j][b:10uzsr8j](Edit NOT Required)[/b:10uzsr8j][/color:10uzsr8j][b:10uzsr8j]Menu Items Line -> Light Blue Colur [/b:10uzsr8j][b:10uzsr8j][color=blue:10uzsr8j](Edit Required but without a GET appearing )[/color:10uzsr8j][/b:10uzsr8j]My problem is that when the user hits enter key or double click on a Menu Item Line (Light Blue) a GET is appearing, [b:10uzsr8j]which I don't want[/b:10uzsr8j]. I need the xbrowse to work like a Toggle only on the menu Item line (Light Blue colour) without a GET appearing. Hope I have explained my requirement clearly.RegardsAnser
xBrowse SetCheckBitmap Column and bEditValue
hello...try it...[code:1q48x55g] oBrw&#58;bKeyDown= &#123;|nKey| if &#40; nKey == VK_RETURN, ; PostMessage&#40; oBrw&#58;hWnd, WM_KEYDOWN, 27 &#41;, &#41; &#125; [/code:1q48x55g]
xBrowse SetCheckBitmap Column and bEditValue
Hi DanielThankyou[code:2fa2vumy]oBrw&#58;bKeyDown= &#123;|nKey| if &#40; nKey == VK_RETURN, ; PostMessage&#40; oBrw&#58;hWnd, WM_KEYDOWN, 27 &#41;, &#41; &#125; [/code:2fa2vumy] The above code is working with the Enter Key, [b:2fa2vumy][color=red:2fa2vumy]but Mouse double click is still activating a GET[/color:2fa2vumy][/b:2fa2vumy] Another problem is that If the active column is not the 2nd column then the Dialog itself is getting closed. I think it is because of the PostMessage 27. So I changed your sample code to [code:2fa2vumy]oBrwMenu&#58;bKeyDown= &#123;|nKey| if&#40;oBrwMenu&#58;nColSel == 2,if &#40; nKey == VK_RETURN, PostMessage&#40; oBrwMenu&#58;hWnd, WM_KEYDOWN, 27 &#41;, &#41;,&#41; &#125; [/code:2fa2vumy]Any hint to solve the Mouse double click ? Mouse Single click is working fine.Is there any way to contol the active column to be always 2ie oBrwMenu:nColSel should be always 2RegardsAnser
xBrowse SetCheckBitmap Column and bEditValue
[quote:v2aqu9mr]Is there any way to contol the active column to be always 2 ie oBrwMenu:nColSel should be always 2[/quote:v2aqu9mr]I solved active column issue by changing the the bKeyDown to make Column 2 as Selected column before the PostMessage[code:v2aqu9mr]oBrwMenu&#58;bKeyDown= &#123;|nKey| oBrwMenu&#58;nColSel&#58;=2 ,if &#40; nKey == VK_RETURN, PostMessage&#40; oBrwMenu&#58;hWnd, WM_KEYDOWN, 27 &#41;, &#41; &#125; [/code:v2aqu9mr]I don't know whether this is the right way or is there any other way of doing it. I beleive that there should be someway to disable a column or a way to enable only a particular column and disable other columnsAny hint to solve the [color=blue:v2aqu9mr]Mouse [b:v2aqu9mr]double[/b:v2aqu9mr] click[/color:v2aqu9mr] ? Mouse Single click is working fine.RegardsAnser
xBrowse SetCheckBitmap Column and bEditValue
Anser,your program is a very nice approach for a tree-like browser.I'd like to work with your code because it could be useful for me too.May be i could find a hint.Could you please, post a little more code and your rc file?My first idea for your problem is to try the bWhen block of column 2.Regards,Detlef
xBrowse SetCheckBitmap Column and bEditValue
puedes publicar el methodo LDblClick del xbrowse de tu version? o me lo mandas al correo <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, mi messenger es <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
xBrowse SetCheckBitmap Column and bEditValue
Ansserk I am using :[code:f11ks8zz] definig the browse &#58; SetEditBlock&#40;oBrw,&#123;|nKey| &#40;cAlias&#41;->&#40;Editprog&#40;oBrw,nKey&#41;&#41; &#125;&#41; ************************************************************************************************************* PROC SetEditBlock&#40;oBrw , EditBlock , aKeys&#41; ****************************************** LOCAL el oBrw&#58;bLDblClick &#58;= EditBlock //OBrw&#58;bPastEof&#40;&#41; &#58;= EditBlock IF IsArray&#40;aKeys&#41; IF ASCAN&#40;aKeys,13&#41; == 0 AADD&#40;aKeys,13&#41; END oBrw&#58;bkeyDown &#58;= &#123; | nkey | IIF&#40; &#40;nKey IN aKeys&#41; , EVAL&#40;EditBlock,nKey&#41; , &#41; &#125; else oBrw&#58;bkeyDown &#58;= &#123; | nkey |IIF&#40;nkey==13 , EVAL&#40;EditBlock&#41; , &#41; &#125; endif RETURN ************************************************ PROC EditProg&#40;oBrw,nKey&#41; ********************** LOCAL nr &#58;= oBrw&#58;nArrayAt LOCAL nCol &#58;= oBrw&#58;nColsel LOCAL cTit IF nCol > 0 &#46;AND&#46; nCol <= LEN&#40;oBrw&#58;aDisplay&#41; // oBrwB&#58;aCols&#41; //cTit &#58;= oBrwB&#58;SelectedCol&#40;&#41;&#58;cHeader nCol &#58;= oBrwB&#58;SelectedCol&#40;&#41;&#58;nArrayCol END IF nCol == 2 // Not needed , only column 2 has to be changed with enter or dblclick oBrw&#58;aRow&#91;nCol&#93; &#58;= !oBrw&#58;aRow&#91;nCol //oBrw&#58;aArrayData&#91;Nr,nCol&#93; &#58;= i oBrw&#58;aArrayData&#91;Nr,nCol&#93; oBrw&#58;RefreshCurrent&#40;&#41; END [/code:f11ks8zz]
xBrowse SetCheckBitmap Column and bEditValue
Daniel,I am using xBrowse of FWH 8.08Is there any other way to handle this problem without modifiying the original XBrowse Source CodeI am herewith pasting code of xbrowse Method LDblClick[code:35vau3cw]METHOD LDblClick&#40; nRow, nCol, nKeyFlags &#41; CLASS TXBrowse local oCol local nColPos, nRowPos &#58;&#58;CancelEdit&#40;&#41; &#58;&#58;Seek&#40;&#41; nColPos &#58;= &#58;&#58;MouseColPos&#40; nCol &#41; nRowPos &#58;= &#58;&#58;MouseRowPos&#40; nRow &#41; if nColPos == &#58;&#58;nColSel &#46;and&#46; nRowPos == &#58;&#58;nRowSel oCol &#58;= &#58;&#58;ColAtPos&#40; nColPos &#41; if oCol&#58;nEditType > 0 if &#40; oCol&#58;bEditWhen == nil &#46;or&#46; Eval&#40; oCol&#58;bEditWhen, oCol &#41; &#41; if oCol&#58;hChecked &#46;and&#46; oCol&#58;bOnPostEdit != nil Eval&#40; oCol&#58;bOnPostEdit, oCol, ! Eval&#40; oCol&#58;bEditValue &#41;, 13 &#41; &#58;&#58;DrawLine&#40; &#46;t&#46; &#41; else return oCol&#58;Edit&#40;&#41; endif endif elseif oCol&#58;bLDClickData != nil return Eval&#40; oCol&#58;bLDClickData, nRow, nCol, nKeyFlags, oCol &#41; endif endif If nColPos != 0 &#46;and&#46; nRowPos != 0 return Super&#58;LDblClick&#40; nRow, nCol, nKeyFlags &#41; Endif return 0[/code:35vau3cw]
xBrowse SetCheckBitmap Column and bEditValue
Hi Detlef,[quote:ciwfclre]I'd like to work with your code because it could be useful for me too. Could you please, post a little more code and your rc file?[/quote:ciwfclre]I fetch data from MySql and create an array with space added to the left of array elements based on the data heirarchy.My .RC contents. I use .RC only for Images[code:ciwfclre]Save24x24 BITMAP Images\Save24x24&#46;Bmp Cancel24x24 BITMAP Images\Cancel24x24&#46;Bmp[/code:ciwfclre]If you can provide your email ID, I can send my source code to you.RegardsAnser
xBrowse SetCheckBitmap Column and bEditValue
Hi Anser,many thanks for your kind offer which is highly apreciated.My email Id is ...Best regards,Detlef
xBrowse SetCheckBitmap Column and bEditValue
Detlef,Please check your email.RegardsAnser
xBrowse SetCheckBitmap Column and bEditValue
[quote="anserkk":3usz7dy9]Detlef, Please check your email. Regards Anser[/quote:3usz7dy9]Hi Anser,many thanks again for sending your source.It's a great resource for me to learn about additional possibilities of xBrowse.Best regards,Detlef
xBrowse Sort a Tree by a column n on oItem:Cargo
Hello everyone; I'm looking to sort an xbrowse displaying a tree. Sorting should be by cargo contents [n] on Tree item branch. For example: suppose I wish to sort this tree by oItem:Cargo[ 2 ] and then refresh the xbrowse showing the newly ordered tree. [code=fw:2drlmfji]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   ::<span style="color: #000000;">oTree</span> := <span style="color: #00C800;">NIL</span> <br />   TREE ::<span style="color: #000000;">oTree</span>                           <span style="color: #B900B9;">//::oTree is type Tlinklist</span><br /><br />   <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">10</span> <br /><br />      oItem := ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Item #"</span>+cValToChar<span style="color: #000000;">&#40;</span> i <span style="color: #000000;">&#41;</span>  <span style="color: #000000;">&#41;</span><br /><br />      oItem:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">&#123;</span> i, hb_RandomInt<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oItem:<span style="color: #000000;">nLevel</span>  := <span style="color: #000000;">1</span> <br />      oItem:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">SetTree</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">SubTree</span><span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, o:<span style="color: #000000;">bAction</span> := <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#125;</span><br /><br />      EVAL<span style="color: #000000;">&#40;</span> oItem:<span style="color: #000000;">bAction</span>, oItem <span style="color: #000000;">&#41;</span><br />      <br />   <span style="color: #00C800;">NEXT</span> i<br /><br />   ENDTREE<br /> </div>[/code:2drlmfji] Can someone suggest how to sort the tree so that it is ordered by that random integer? Thank you, Reinaldo.
xBrowse Sort a Tree by a column n on oItem:Cargo
After a while without any suggestions, I'm thinking perhaps I did not explain my question well enough. Suppose I want to order this tree below by the 2nd column of each parent branch (that branch is the state name with folder bmp). This sample code is from xbrwTree.prg on the Samples folder. Notice I only changed a line to include a 2nd column on each parent branch with a random number between 0 and 1000. [code=fw:vl8n70ja]<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> oWnd, oBrw<br /><br />   USE Customer<br />   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> Field->State <span style="color: #0000ff;">TO</span> State<br />   SET ORDER <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"State"</span><br />   GO TOP<br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"DBF shown as a tree with XBrowse"</span><br /><br />   @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd LINES CELL<br /><br />   oBrw:<span style="color: #000000;">SetTree</span><span style="color: #000000;">&#40;</span> BuildTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"open"</span>, <span style="color: #ff0000;">"close"</span>, <span style="color: #ff0000;">"go"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> HEADER <span style="color: #ff0000;">"Last"</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> HEADER <span style="color: #ff0000;">"First"</span><br /><br />   oBrw:<span style="color: #000000;">nMarqueeStyle</span> = MARQSTYLE_HIGHLROW<br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"State & City"</span><br /><br />   oWnd:<span style="color: #000000;">oClient</span> = oBrw<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<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> BuildTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oTree, cState<br /><br />   TREE oTree<br />      <span style="color: #00C800;">while</span> ! Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cState <span style="color: #000000;">&#41;</span><br />            _TreeItem<span style="color: #000000;">&#40;</span> Customer->State <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">&#123;</span> hb_randomInt<span style="color: #000000;">&#40;</span><span style="color: #000000;">1000</span><span style="color: #000000;">&#41;</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #B900B9;">//<<---- changed this line </span><br />            TREE<br />            cState = Customer->State<br />         <span style="color: #00C800;">else</span><br />            <span style="color: #00C800;">if</span> cState != Customer->State<br />               ENDTREE<br />               cState = Customer->State<br />               _TreeItem<span style="color: #000000;">&#40;</span> Customer->State <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">&#123;</span> hb_randomInt<span style="color: #000000;">&#40;</span><span style="color: #000000;">1000</span><span style="color: #000000;">&#41;</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>   <span style="color: #B900B9;">//<<---- and this line</span><br />               TREE<br />            <span style="color: #00C800;">endif</span>   <br />         <span style="color: #00C800;">endif</span>   <br />         <span style="color: #00C800;">if</span> Customer->State == cState<br />            _TreeItem<span style="color: #000000;">&#40;</span> Customer->City <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">&#123;</span> Customer->Last, Customer->First <span style="color: #000000;">&#125;</span><br />         <span style="color: #00C800;">endif</span>   <br />         SKIP<br />      <span style="color: #00C800;">enddo</span><br />      ENDTREE<br />   ENDTREE<br /><br />   GO TOP<br /><br /><span style="color: #00C800;">return</span> oTree<br /> </div>[/code:vl8n70ja] Is there a way to order this tree by the random number on column #2? The child branches would have to stay attached to its original parent branch. Any suggestions? Thank you, Reinaldo
xBrowse Sort a Tree by a column n on oItem:Cargo
Hola Reinaldo, I think, you need to create other tree in base to the original, let me see the tree class for a easy solution regards Marcelo
xBrowse Sort a Tree by a column n on oItem:Cargo
Hola Marcelo; ¿Así que sigas vivo? Supongo que así dirás de mi. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Si esto es algo que no existe como sospecho entonces se me ocurre extender la clase TLinkList para añadir un sort por alguna otra columna que no sea necesariamente la primera (cPrompt) --y creo que esto es lo sugieres. ¿Correcto? Me voy a dar la tarea y comparto la solución aquí. Gracias, Reinaldo.
xBrowse Sort a Tree by a column n on oItem:Cargo
Hello everyone; Here is the method I wrote to sort my xbrowse tree by any column. It has been tested and it works really nice. [code=fw:1npwdgit]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> Sort<span style="color: #000000;">&#40;</span> nCol <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TBatchPayments <br />   <span style="color: #00C800;">LOCAL</span> oItem    := ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oFirst</span><br />   <span style="color: #00C800;">LOCAL</span> oPrev    := oItem:<span style="color: #000000;">oPrev</span> <br />   <span style="color: #00C800;">LOCAL</span> oNext    := ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oLast</span>:<span style="color: #000000;">oNext</span> <br />   <span style="color: #00C800;">LOCAL</span> aItems   := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">LOCAL</span> n <br /><br />   <span style="color: #00C800;">IF</span> nCol == <span style="color: #00C800;">NIL</span> .OR. nCol > LEN<span style="color: #000000;">&#40;</span> oItem:<span style="color: #000000;">Cargo</span> <span style="color: #000000;">&#41;</span> .OR. --nCol < <span style="color: #000000;">1</span>   ;RETURN <span style="color: #00C800;">NIL</span> ;ENDIF <br /><br />   <span style="color: #00C800;">WHILE</span> oItem != <span style="color: #00C800;">nil</span> <br /><br />      <span style="color: #00C800;">IF</span> oItem:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">1</span> <br />         AADD<span style="color: #000000;">&#40;</span> aItems, oItem <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDIF</span> <br /><br />      oItem = oItem:<span style="color: #000000;">oNext</span><br /><br />   END<br /><br />   ASort<span style="color: #000000;">&#40;</span> aItems,,, <span style="color: #000000;">&#123;</span> |x, y| x:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span> < y:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oFirst</span>       := aItems<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />   ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oFirst</span>:<span style="color: #000000;">oPrev</span> := oPrev<br /><br />   <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> aItems <span style="color: #000000;">&#41;</span><br />      aItems<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">oPrev</span>    := aItems<span style="color: #000000;">&#91;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />      aItems<span style="color: #000000;">&#91;</span> n - <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetNext</span><span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span> n<br /><br />   ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oLast</span> := ATail<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oLast</span>:<span style="color: #000000;">SetNext</span><span style="color: #000000;">&#40;</span> oNext <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Nil</span> <br /> </div>[/code:1npwdgit] Reinaldo.
xBrowse Spliting header into 2 line using CRLF (Solved)
Hi Can somebody tell me how to display the Column heading in 2 lines using CRLF The following code (supposed to split the header into 2 lines) does not work [code=fw:1h8w8umn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">For</span> i:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#41;</span><br />    cTestHeader:=oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span><br />    oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>:=cTestHeader+CRLF+<span style="color: #ff0000;">" Ans"</span><br /><span style="color: #00C800;">Next</span>  </div>[/code:1h8w8umn] Screen snapshot [url=http&#58;//img130&#46;imageshack&#46;us/i/xbrw&#46;jpg/:1h8w8umn][img:1h8w8umn]http&#58;//img130&#46;imageshack&#46;us/img130/4609/xbrw&#46;jpg[/img:1h8w8umn][/url:1h8w8umn] Any Idea where I am wrong ? Regards Anser
xBrowse Spliting header into 2 line using CRLF (Solved)
Anser oBrw:nHeaderLines := 2 HTH Richard
xBrowse Spliting header into 2 line using CRLF (Solved)
Thank you Mr.Richard, [code=fw:z71eji6g]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">40</span> &nbsp; <br />oBrw:<span style="color: #000000;">nHeaderLines</span>:= <span style="color: #000000;">3</span></div>[/code:z71eji6g] Solved the problem Regards Anser
xBrowse Spliting header into 2 line using CRLF (Solved)
From version 9.12 onwards, xBrowse automatically splits header, if it contains CRLF and automatically computes the header height required to display both lines. Whatsnew.txt [quote:1h8oown3]* Improvement: Where header has CRLFs, data nHeaderLines is automatically computed by the xbrowse. It is desirable not to specify the data nHeaderLines manually, unless required for other reasons. [/quote:1h8oown3] This is for information
xBrowse Spliting header into 2 line using CRLF (Solved)
Dear Mr.Rao, Thank you for the information. Regards Anser
xBrowse Swapping en dialog ( How to )
Antonio/Daniel, Estan excelentes los ejemplos del swapping, peeero ambos estan desde codigo, es posible hacerlo desde recursos en un dialog ?? Saludos
xBrowse Swapping en dialog ( How to )
Yes
xBrowse Swapping en dialog ( How to )
Mr. RAO, Some little sample you may have and wish to share. Thanks a lot Best regards