topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
tree in a xbrowse (SOLVED) | Thank you very much Mr Rao. It worked perfectly
Regards |
tree leido desde mysql no me funciona | Hola.
Estoy haciendo esta prueba pero no me refresca el TREE, es solo una prueba. pueden decirme que tengo mal?
[code=fw:2rrt0fgr]<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;">"debug.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"tdolphin.ch"</span><br /><br /><span style="color: #00C800;">CLASS</span> TArbol<br /> <span style="color: #00C800;">DATA</span> oTree<br /> <span style="color: #00C800;">DATA</span> oCnx<br /> <br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">new</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CONSTRUCTOR<br /> <br /> <span style="color: #00C800;">METHOD</span> arbol<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> inicializar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> recursivo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">new</span><span style="color: #000000;">(</span> oCnx <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oCnx</span> := oCnx<br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> arbol<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oTree<br /> <span style="color: #00C800;">LOCAL</span> oBtns := Array<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> this := <span style="color: #00C800;">Self</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"DLGARBOL"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TreeView from source"</span><br /><br /> ::<span style="color: #000000;">oTree</span> = TTreeView<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #0000ff;">REDEFINE</span><span style="color: #000000;">(</span> <span style="color: #000000;">101</span>, oDlg, CLR_BLACK, CLR_WHITE, .F., <span style="color: #ff0000;">'Dante causa'</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// ::oTree:bRClicked := { | nRow, nCol, nKeyFlags | ::ShowPopup( nRow, nCol, nKeyFlags ) }</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> this:<span style="color: #000000;">inicializar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> inicializar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oTree</span> := ::<span style="color: #000000;">recursivo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">METHOD</span> recursivo<span style="color: #000000;">(</span> oParentItem <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oTree, oItem<br /> <span style="color: #00C800;">LOCAL</span> nParent := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> oQry<br /><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> oParentItem != <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// pòr el momneto nada</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> QUERY oQry <span style="color: #ff0000;">"SELECT * FROM t_menu WHERE IFNULL(parent_menu_id, 0)= "</span> + ClipValue2SQL<span style="color: #000000;">(</span> nParent <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> <span style="color: #000000;">(</span> oQry:<span style="color: #000000;">nRecCount</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">// me asegure que tenga datos y hay.</span><br /> TREE oTree<br /> TREEITEM oItem <span style="color: #0000ff;">prompt</span> oQry:<span style="color: #000000;">FieldGet</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"menu_name"</span> <span style="color: #000000;">)</span><br /> ENDTREE<br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">(</span> oTree <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><br /> </div>[/code:2rrt0fgr]
Gracias. |
tree level | Hi, all !
There is a ttreeview object of arbitrary nesting. How to find out which level is currently open ? |
tree level | oTree:GetSelected() --> oItem
oItem:Cargo // place here what you may need
Please review FWH\samples\classtre.prg, fiveres.prg |
tree level | Thanks for your help. |
tree level | [quote="Natter":a8v9spfk]Hi, all !
There is a ttreeview object of arbitrary nesting. How to find out which level is currently open ?[/quote:a8v9spfk]
Hi,
You can use
nLevel := oItem:ItemLevel |
tree level | oItem:nLevel |
tree level | Horizon, Rao thanks ! |
tree level | hello
i need know how many child have an item. how i can it? |
tree level | Gustavo,
Len( oItem:aItems ) |
tree parent hitem | Hola.
Necesito conocer el hitem del PARENT de un sub item
A
+----B
+----- C
+----D
cuando haga click en "C" que me diga el hitem de "B" o cuando haga click en "D" que me diga el hitem de "A"
he intentado pero nada. |
tree parent hitem | oItem:oParent:hItem |
tree xbrowse | Colegas, tengo un tree en un xbrowse y me gustaría que no se pudieran contraer las ramas. Estuve buscando en la clase algún método-data que me permita bloquear esta característica pero no emcuentro. Alguien tiene idea ? Muchas gracias.
Saludos |
tree y el gotop() | Hola.
quiero conocer el "hitem" del primer item de un tree. he intentado hacer
::oTree:gotop()
pero me dice
[quote:333q91p4] Error description: Error BASE/1004 Message not found: TTVITEM:GOTOP[/quote:333q91p4]
no se como moverme dentro de un tree <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> como lo hago? |
tree y el gotop() | En el árbol se hace así:
oTree:GoTop()
y en una rama del arbol:
oTree:Select( oItem:aItems[ 1 ] ) |
tree y scan | Por lo que vi en el foro, esto me devolveria en oItem el item correspondiente del que busco
[code=fw:1wttr0sn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> o:= ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">scan</span><span style="color: #000000;">(</span><span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">cargo</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"nId"</span><span style="color: #000000;">]</span> == oItem:<span style="color: #000000;">cargo</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"nId"</span><span style="color: #000000;">]</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> oItem:= ::<span style="color: #000000;">oTree</span>:<span style="color: #0000ff;">select</span><span style="color: #000000;">(</span>o<span style="color: #000000;">)</span><br /> </div>[/code:1wttr0sn]
pero... al hacer un
[code=fw:1wttr0sn]<div class="fw" id="{CB}" style="font-family: monospace;"> fwdbg oItem<br /> </div>[/code:1wttr0sn]
me devuelve un valor boolean.
En que le estoy errando?
gracias. |
tree y scan | Estimado Gustavo,
::oTree:select(o) está devolviendo un valor lógico indicando si ha podido ó no seleccionarlo
y estás presuponiendo que devuelve un item <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
tree y scan | perfecto!
ahor entendi la tecnica.
gracias. |
treeview | Is there somewhere a template for creating a TreeView interface
where nodes can be added, deleted, renamed, and moved via drag and drop. Additionally, this template should provide methods to synchronize the node collection with a database.
Thanks in advance
Otto |
treeview | Otto,
We don't have such a complete sample. In fact, it is quite difficult to syncronize a tree with a database. The treeview control hasn't been developed by Microsoft with such capability. |
treeview | To bind treeview to a database I pass the record-ID with the text.
TestNode ID 345
TestNode Child ID 500
TestNode 2 ID 8555
TestNode Child ID 102333
TestNode Child ID 394949
Do you think there is a way to make the last characters of the nodetext invisible?
Thanks in advance
Otto |
treeview | Otto,
When an item is inserted into a treeview a TV_INSERTSTRUCT struct is used (please review source\winapi\treeview.c).
The TV_INSERTSTRUCT contains a TV_ITEM structure and there you have a member, named lParam where you can store a 32 bits number. Similar like Clipper "cargo".
So you have to modify source\winapi\treeview.c and add this line:
is.item.lParam = _parnl( 5 );
Then modify the Class TTreeView to accept an extra parameter:
METHOD Add( cPrompt, nImage, [color=red:1qw3lofd]nValue[/color:1qw3lofd] ) CLASS TTreeView
...
oItem := TTVItem():New( TVInsertItem( ::hWnd, cPrompt,, nImage, [color=red:1qw3lofd]nValue[/color:1qw3lofd] ), Self ) |
treeview | Then, given a TV_ITEM handle, you can retrieve its lParam value:
[code:b4w8xn73]
HB_FUNC( TVIPARAM ) // hItem --> nLParam
{
hb_retnl( ( ( TV_ITEM * ) hb_parnl( 1 ) )->lParam );
}
[/code:b4w8xn73] |
treeview | personal para realizar una función que pasar por todos los elementos del árbol
[code=fw:2cedey61]<div class="fw" id="{CB}" style="font-family: monospace;"><br />-SECTOR DE COMPRA<br /> -LISTADO<br /> -SOLICITUD<br /> -STOCK<br />+SECTOR DE VENTAS<br />+SECTOR DE FINANCIEROS<br /> </div>[/code:2cedey61]
De este modo pasa SECTOR DE COMPRA, SECTOR DE VENTAS E SECTOR DE FINANCIEROS
[code=fw:2cedey61]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">local</span> n<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;">(</span> aItems <span style="color: #000000;">)</span><br /> oTree:<span style="color: #000000;">setcheck</span><span style="color: #000000;">(</span> aItems<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>, .t. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> oTree:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:2cedey61]
cómo obtener el subiten negocio de la granja
Gracias
Luiz Fernando |
treeview | Colegas sera que não exiet as fazer isto um tipo um DO WHILE aonde passe por todos itens e sub-itens.
Gracias
Luiz Fernando |
treg32 | I must run a easy function with a treg command
I have some pcs on red and each user can open the pc with his user access and the user is not the administrator of red
how run treg object from user no administrator ?
Any sample pls ? |
treo | antonio, i am want buy an smartphone to use and test fwppc, treo 750 is an good choice??
thanks |
treo | Norbert,
Yes, it seems fine. It has a samsung processor, that we should check if it is Intel XScale compatible.
Could you run FWPPC tutor01, tutor02, on it ? You may copy them to a memory card, insert it and test the apps |
treport colorear una celda? | Hola.
Tengo una treport. definido (viendo post antiguos) de esta manera:
[code=fw:3ajzzga1]<div class="fw" id="{CB}" style="font-family: monospace;"> oReport:<span style="color: #000000;">addcolumn</span><span style="color: #000000;">(</span>trcolumn<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>genTitulo<span style="color: #000000;">(</span>aDato, nItem<span style="color: #000000;">)</span>,, genData<span style="color: #000000;">(</span>oRs, aDato, nItem<span style="color: #000000;">)</span>, genTamanio<span style="color: #000000;">(</span>aDato, nItem<span style="color: #000000;">)</span>,,<span style="color: #000000;">{</span>|| <span style="color: #000000;">2</span><span style="color: #000000;">}</span>,,,,,.T.,,oReport<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> </div>[/code:3ajzzga1]
Ahora bien, no puedo darle en el anteultimo parametro (antes de oReport) el tipo de PEN,
Y lo principal. No se como hace para colorear una celda de la tReport.
gracias. |
tres Listbox en un dialogo como saber quien tiene el foco | Buenas tardes
Tengo en un dialogo oDlg 3 listbox, como saber cual de los trs tiene el foco al momento de hacerle un click a un boton del mismo dialogo
Teniendo el ejemplo de abajo ... es decir... cuando presione el BUTTON, debe recibir la funcion MILISTA(XXXX) cual de los oLb1, oLb2, o oLb3 tiene el Foco
DEFINE DIALOG oDlg RESOURCE "GRP10_S2" TITLE OemToAnsi(Z_TITULO)
REDEFINE LISTBOX oLb1 FIELDS campo1a, campo2a, campo3a HEADERS "tita1","tita2" , "tita3" FIELDSIZES 60, 10, 20 ID 990 OF oDlg
REDEFINE LISTBOX oLb2 FIELDS campo1b, campo2b, campo3b HEADERS "titb1","titb2" , "titb3" FIELDSIZES 60, 10, 20 ID 990 OF oDlg
REDEFINE LISTBOX oLb3 FIELDS campo1c, campo2c, campo3c HEADERS "titc1","titc2" , "titc3" FIELDSIZES 60, 10, 20 ID 990 OF oDlg
REDEFINE BUTTON ID 8011 OF oDlg ACTION MILISTA( xLBX )
Gracias por su ayuda ..
Lubin |
tres Listbox en un dialogo como saber quien tiene el foco | Puedes intentar cambiar el color, por ejemplo, definiendo el bGotFocus de los listbox, si es visualmente a lo que te refieres.
Tambien tienes la DATA :HasFocus de los objetos |
tres Listbox en un dialogo como saber quien tiene el foco | Gracias CNavarro
Creo que no me deje explicar muy bien.. con el mismo ejemplo anterior ...
Imaginemos que el Usuario esta en el ListBox oLb2 (es decir que el foco esta en oLb2) y y luego presiona el Boton ID 8011 que activa la Funcion MILISTA( xLBX )
como le paso a esta funcion MILISTA (usado la variable XLBX ) en que Listbox estaba activo (es decir como le digo que estaba en "oLb2")
Saludos
Lubin |
tres Listbox en un dialogo como saber quien tiene el foco | Lubin
Seguramente tampoco me expliqué bien yo
En cada control, asigna en su bGotFocus a una variable un valor que luego evalúas en el ACTION del botón
oLbx1:bGotFocus := { || nMivariable := 1 }
también te serviría igual en el bLostFocus |
tres Listbox en un dialogo como saber quien tiene el foco | UUUmmm buena CNavarro !!!
Me parece que nos entendimos ... jajaja
Gracias estimado , lo pruebo y lo comento ...
Saludos
Lubin |
treview control with dialog | it is possible create a treview control in to a window (oWnd)sample :family------>grandmother1------>grandmother2------>daddyand for each item open a small dialog into each item of tree samplefamily------>grandmother1 (here a dialog often border)------>grandmother2 (here a dialog often border)------>daddysample:[img:2zz1rypq]http://img300.imageshack.us/img300/7839/testgridruz6.jpg[/img:2zz1rypq]I create it with paint I hope your help |
trichedit pastespecial function | trichedit REPasteSpecial( ::hWnd ) return on box a text into espanol language
how I can change this text into talian language ?
[img:20xopano]http://www.eoeo.it/wp-content/uploads/2016/04/vv-2.jpg[/img:20xopano] |
trichedit property | Exist a function to save file property for trichedit as windows win word ? |
trichedit property | Silvio,
No, as far as we know it.
If you save it as RTF file then you should be able to open the RTF file from Word. |
trichedit property | I thinked to modify the property of rtf file from your rtfpad...
and the I saw on Microsoft there is a function REFILEPROPERTY |
trocar PROMPT REBAR? (resolvido) | É possível trocar o PROMPT de BUTTON REBAR?
Grato
Aoki
resolvido
oToolBar2:settext(1,"teste") |
trouble with oFTP:directory() | Hallo Fivewinners,
I have a problem with ftp:Directory()
[code:3b8omu4o]
aFiles := {}
aFiles = oFTP:Directory( "/*.*")
LogFile( "FTP.LOG", Str(Len(aFiles))+" Files on ftp-Server found" )
for _I = 1 to len(afiles)
LogFile( "FTP.LOG", Alltrim(afiles[_I,1])+ " Size: "+Str(aFiles[_I,2]) )
next _I
[/code:3b8omu4o]
the result (testet with FWH Aug. 2006 and xHarbour Aug. 2006)
[code:3b8omu4o]
31.08.06 16:23:36: FTP-Session startet.
31.08.06 16:23:37: 59 Files on ftp-Server found
31.08.06 16:23:37: ANIMA.XLS C : \ W I N D O W S \ S y s t e m 3 2 \ W b e m ; C : \ P r o g r a m m e \ I n t e l \ D M I X ; C : \ P r o g r a m m e \ M i c r o s o f t S Q L S e r v e r \ 8 0 \ T o o l s \ B I N N ; C : \ P r o g r a m m e \ S y m a n t e c \ p c A n y w Size: 306688
31.08.06 16:23:37: artikelfull.csv Xq Size: 5981919
31.08.06 16:23:37: artikelfull.xls 5981919 artikelfull.csv
08-31-06 05:17AM 15504384 artikelfull.xls
08-30-06 04:31AM 449292 artikelliste.csv
08-30-06 04:31AM 449292 Artikelliste.txt
08-30-06 04:31AM 11653 Size: 15504384
31.08.06 16:23:37: artikelliste.csv 6 04:31AM 529408 Artikeltexte.xls
08-31-06 05:45AM 4091102 artikelzusatztext_web_html.csv
08-31-06 05:45AM 10226176 artikelzusatztext_web_html.xls
08-31-06 05:45AM 4078828 artikelzusat Size: 449292
31.08.06 16:23:37: Artikelliste.txt plaintext.csv
08-31-06 05:45AM 5049344 artikelzusatztext_web_plaintext.xls
08-31-06 05:45AM 3327442 artikelzusatztexte_web.csv
08-31-06 05:45AM 11791872 artikelzusatztexte_web.xls
08-31-06 05:45AM Size: 449292
31.08.06 16:23:37: Artikelliste.xls 419776 AURA.XLS
07-14-06 11:15AM 69120 AURA2.XLS
08-31-06 05:45AM 10752 bestseller.xls
08-25-06 01:30PM 27648 DISPLAYS.XLS
01-13-06 12:57PM 269827 Fachhandel E KW03-04.pdf
06- Size: 1165312
31.08.06 16:23:37: artikelliste_DAP_CHF.xls 1581 feldbeschreibung artikelliste.txt
04-18-06 09:46AM 173 feldbeschreibung zubehoerartikel.txt
06-08-05 08:03AM 1037 hilfe zu artikelzusatztexte web.txt
01-03-06 10:24AM Size: 10494464
[/code:3b8omu4o]
Does someone have an idea?
Best Regards
Norbert |
trouble with oFTP:directory() | Norbert,
The problem is that you are getting extra info on aFiles[_I,2], right ? |
trouble with oFTP:directory() | [quote="Antonio Linares":3d452h57]Norbert,
The problem is that you are getting extra info on aFiles[_I,2], right ?[/quote:3d452h57]
yes, normaly element 1 = Filename, element 2 = Filesize
Best regards, Norbert |
truco para ventas no fiscales... | hola foro, quiero opinion de como hacer para ciertas ventas no hacerlas fiscales (ventas no registradas), que recomiendan, y obvio tener controlados los inventarios de esas ventas?
salu2
paco |
truco para ventas no fiscales... | Paco:
en <!-- w --><a class="postlink" href="http://www.shcp.gob.mx">www.shcp.gob.mx</a><!-- w --> encuentras la info |
truco para ventas no fiscales... | gracias mauricio por la info, espero no ofender a nadie es cuestion de una consulta, a lo mejor no fue el medio para la duda, ofrezco una disculpa
salu2
paco |
truth table Give some help in ""&"" | need to make a truth table my code works this way: <!-- s:P --><img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" /><!-- s:P -->
[code=fw:3qhqsqj9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /> #command ~ => ! <br /> #command ^ => .AND. <br /> #command V => .or. <br /> #command <a> &<span style="color: #ff0000;">'<->'</span> <b> => <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> a=b , .t. , .f. <span style="color: #000000;">)</span> <br /> #command <a> -> <b> => <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> b , <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> a , .t. , .t.<span style="color: #000000;">)</span> , <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> a , .f. , .t. <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">FUnction</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />vpropos:=<span style="color: #ff0000;">"q ^ b"</span><br /> <br /><span style="color: #00C800;">if</span> &vpropos <span style="color: #B900B9;">// Error</span><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">if</span> q ^ b <span style="color: #B900B9;">// no error</span><br /> <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br /> <br /> </div>[/code:3qhqsqj9]
I read on some forums and saw that the macro does not work with the command # and # translante
could someone give me an idea, I need a job for the university
<!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
truth table Give some help in ""&"" | Try with #define instead of #command and without the arrow |
trying gdi | Error: Unresolved external '_HB_FUN_HB_NUMTOHEX' referenced from C:\WORK\FWH\LIB\FIVEHX.LIB|TGDIPLUS
I use xhabour
where I can found this function ? |
trying gdi | [code=fw:1ntfsem6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#IFDEF __XHARBOUR__<br /> #xtranslate hb_DateTime<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => DateTime<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_tstostr<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => TToS<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_stot<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => SToT<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_ttod<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => TToD<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_hour<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => Hour<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_minute<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => Minute<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_sec<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => Secs<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_NumToHex<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => NumToHex<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate hb_StrFormat<span style="color: #000000;">(</span><span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span><span style="color: #000000;">)</span> => StrFormat<span style="color: #000000;">(</span><x><span style="color: #000000;">)</span><br /> #xtranslate <x>:__EnumIndex => hb_EnumIndex<br />#ENDIF<br /> </div>[/code:1ntfsem6]
|
trying to use sockcli.prg | I am trying to use sockcli.prg. I connect in the server, but I do not obtain to send nothing! If active log I see the following one:
07/31/06 16:43:02: Connect Socket handle: 1928
07/31/06 16:43:02: Write Socket handle: 1928
07/31/06 16:43:26: IMP01|0|0001|
07/31/06 16:44:32: IMP01|0|0001|
#include "FiveWin.ch"
static oWnd, oSocket
function Main()
local oBar
DEFINE WINDOW oWnd TITLE "Client socket"
DEFINE BUTTONBAR oBar OF oWnd _3D
DEFINE BUTTON OF oBar ACTION Client() TOOLTIP "Connect"
DEFINE BUTTON OF oBar ;
ACTION oSocket:SendData( "IMP01|0|1001|" ) ;
TOOLTIP "Send data"
DEFINE BUTTON OF oBar ;
ACTION SendFile() TOOLTIP "Send file"
ACTIVATE WINDOW oWnd
return nil
FUNCTION Client()
LOCAL n
oSocket = TSocket():New( 1853 )
oSocket:lDebug := .T.
oSocket:cLogFile := "LOG.TXT"
oSocket:bRead = { | oSocket | MsgInfo( oSocket:GetData() ) }
// Never use a MsgInfo() here because it hangs Windows!!!
oSocket:bConnect = { || oWnd:SetText( "Connected!" ) }
oSocket:bClose = { || MsgInfo( "Server has closed!" ) }
oSocket:Connect( "10.10.1.1" ) // use the server IP address here
RETURN nil
FUNCTION SendFile()
LOCAL uBuff
uBuff := oSocket:GetData()
RETURN nil |
trying to use sockcli.prg | Vilian,
If you are testing both samples\sockserv.prg and samples\sockcli.prg at the same computer, then you have to change this line in sockcli.prg:
oSocket:Connect( "127.0.0.1" ) // use the server IP address here
Here they are working fine with FWH 2.7 July 2006. |
trying to use sockcli.prg | Thanks Antonio, |
trying to use sockcli.prg | Antonio,
How I make in sockserv.prg to return information to sockcli.prg? |
trying with Lenovo Miix 320 | from two days I have a tablet miix 320 lenovo ( nice) win 10 pro 4gb and 64 gb hd -- good very good!!!!
[img:3arwothk]https://www.laptopmag.com/images/wp/purch-api/incontent/2017/02/lenovo-miix-320-seperated-620x400.jpg[/img:3arwothk]
I tried to compile fwh app and it run ok and it is too fast from my portable computer asus rog
now I must create a mode [b:3arwothk]tablet application[/b:3arwothk]
i tried to make a scroll dialog to use it with tablet mode but it not run ok and i not understood how make it
I use a class to scrool the dialog get but it run only if there is the mouse
i not understood why on tablet mode it not run it show the dialog but then i cannot scroll the dialog
do you have a sample test to show get on mode tablet ?I tried the test win10.prg and it run ok but I not understood how imlement it on my dialogs
I make a test but it not run on mode tablet
[code=fw:3arwothk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">// //search on rc file the dialog </span><br /><span style="color: #B900B9;">// </span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> D_WIDTH <span style="color: #000000;">4</span><br /><span style="color: #00D7D7;">#define</span> D_HEIGHT <span style="color: #000000;">13</span><br /><br />#ifndef <span style="color: #00C800;">TRUE</span><br /> <span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span> .T.<br /> <span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span> .F.<br />#endif<br /><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oScrDlg<br /> <span style="color: #00C800;">Local</span> nRow:= <span style="color: #000000;">10</span><br /> <span style="color: #00C800;">Local</span> nCol := <span style="color: #000000;">10</span><br /> <span style="color: #00C800;">Local</span> nCol2:= <span style="color: #000000;">95</span><br /> <span style="color: #00C800;">Local</span> aGet:= array<span style="color: #000000;">(</span><span style="color: #000000;">30</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cget:= space<span style="color: #000000;">(</span><span style="color: #000000;">20</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oFontTablet<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontTablet <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;">-25</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Scroll dialog test for Otto"</span> ;<br /> <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">(</span> WS_VSCROLL, WS_HSCROLL <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">FONT</span> oFontTablet<br /><br /> <span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">30</span><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"test"</span>+str<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>,<span style="color: #000000;">18</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span>n<span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cget <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>,<span style="color: #000000;">18</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> nRow+=<span style="color: #000000;">26</span><br /> <span style="color: #00C800;">next</span><br /><br /> @ nRow<span style="color: #000000;">+20</span>, nCol<span style="color: #000000;">+130</span> <span style="color: #0000ff;">button</span> <span style="color: #ff0000;">"&Conferma"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>,<span style="color: #000000;">18</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">+20</span>, nCol<span style="color: #000000;">+250</span> <span style="color: #0000ff;">button</span> <span style="color: #ff0000;">"&Annulla"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>,<span style="color: #000000;">18</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /><br /> oDlg:<span style="color: #000000;">bMouseWheel</span> = <span style="color: #000000;">{</span> | nKey, nDelta, nXPos, nYPos | MouseWheel<span style="color: #000000;">(</span> nKey, nDelta, nXPos, nYPos, oScrDlg <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oScrDlg := TScrDlg<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg, <span style="color: #000000;">1</span>, <span style="color: #000000;">95</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span>, oDlg:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> <span style="color: #000000;">740</span>, <span style="color: #000000;">500</span> <span style="color: #000000;">)</span>, oDlg:<span style="color: #0000ff;">Center</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//-----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> MouseWheel<span style="color: #000000;">(</span> nKey, nDelta, nXPos, nYPos, oScrDlg <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oVScroll := oScrDlg:<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span><br /><br /> <span style="color: #00C800;">if</span> nDelta < <span style="color: #000000;">0</span><br /> oVScroll:<span style="color: #000000;">GoDown</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oVScroll:<span style="color: #000000;">GoUp</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> oScrDlg:<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> <span style="color: #B900B9;">//-----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">CLASS</span> TScrDlg<br /><br /> <span style="color: #00C800;">DATA</span> oDlg<br /> <span style="color: #00C800;">DATA</span> nVPos, nHPos<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg,nV1,nV2,nH1,nH2 <span style="color: #000000;">)</span> CONSTRUCTOR<br /> <span style="color: #00C800;">METHOD</span> SetScroll<span style="color: #000000;">(</span> nV1,nV2,nH1,nH2 <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//-*------------------------------------------------------------</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VScrollThumb<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VScrollTrack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VScrollPgDown<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> VScrollPgUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//-*-----------------------------</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> HScrollThumb<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> HScrollTrack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> HScrollPgDown<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> HScrollPgUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg,nV1,nV2,nH1,nH2 <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /> ::<span style="color: #000000;">nVPos</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">nHPos</span> := <span style="color: #000000;">0</span><br /> ::<span style="color: #000000;">oDlg</span> := oDlg<br /> ::<span style="color: #000000;">SetScroll</span><span style="color: #000000;">(</span> nV1,nV2,nH1,nH2 <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #00C800;">METHOD</span> SetScroll<span style="color: #000000;">(</span> nV1,nV2,nH1,nH2 <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><span style="color: #00C800;">LOCAL</span> aCoors1:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>,aCoors2:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">//--------------------------------------------------</span><br /> <span style="color: #B900B9;">//-* Vertical Scroll Bar</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span> != <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetRange</span><span style="color: #000000;">(</span> nV1,nV2 <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nVPos</span> := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoDown</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoUp</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPageUp</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">VScrollPgUp</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPageDown</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">VScrollPgDown</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoTop</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nPgStep</span> := <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">//::oDlg:oVScroll:lReDraw := TRUE</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bPos</span> := <span style="color: #000000;">{</span>|nPos| ::<span style="color: #000000;">VScrollThumb</span><span style="color: #000000;">(</span>nPos<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">bTrack</span> := <span style="color: #000000;">{</span>|nPos| ::<span style="color: #000000;">VScrollTrack</span><span style="color: #000000;">(</span>nPos<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #B900B9;">//--------------------------------------------------</span><br /> <span style="color: #B900B9;">//-* Horizontal Scroll Bar</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span> != <span style="color: #00C800;">NIL</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetRange</span><span style="color: #000000;">(</span> nH1,nH2 <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHPos</span> := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoDown</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoUp</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPageUp</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">HScrollPgUp</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPageDown</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #000000;">HScrollPgDown</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoTop</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bGoBottom</span> := <span style="color: #000000;">{</span>|| ::<span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nPgStep</span> := <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">//::oDlg:oHScroll:lReDraw := TRUE</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bPos</span> := <span style="color: #000000;">{</span>|nPos| ::<span style="color: #000000;">HScrollThumb</span><span style="color: #000000;">(</span>nPos<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">bTrack</span> := <span style="color: #000000;">{</span>|nPos| ::<span style="color: #000000;">HScrollTrack</span><span style="color: #000000;">(</span>nPos<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">endif</span><br />* ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">bKeyChar</span> := <span style="color: #000000;">{</span>|nKey,nFlags| ScrollKey<span style="color: #000000;">(</span>nKey<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">//--------------------------------------------------</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><span style="color: #B900B9;">/*<br />STATIC FUNCTION ScrollKey(nKey)<br /><br /> MsgInfo( "Key : "+str(nKey,10) )<br /><br /> //if nKey == K_ENTER<br /> // goMainDlg:End()<br /> // lRetVal := TRUE<br /> //endif<br />RETURN( NIL )<br />*/</span><br /><br /><span style="color: #B900B9;">//=================================================================</span><br /><span style="color: #B900B9;">//-* Vertical Scroll Bar</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">VScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><span style="color: #00C800;">LOCAL</span> nNewPos<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span> ;<br /> .and. ::<span style="color: #000000;">nVPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span><br /> nNewPos := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nVPos</span>-nNewPos <span style="color: #000000;">)</span>*D_HEIGHT, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nVPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> VScrollThumb<span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span> ;<br /> .and. ::<span style="color: #000000;">nVPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">(</span>::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">)</span>*D_HEIGHT, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nVPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> VScrollTrack<span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span> ;<br /> .and. ::<span style="color: #000000;">nVPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">(</span>::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">)</span>*D_HEIGHT, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nVPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> VScrollPgDown<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><span style="color: #00C800;">LOCAL</span> nNewPos<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span><br /> nNewPos := ::<span style="color: #000000;">nVPos</span> + ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nPgStep</span><br /> nNewPos := iif<span style="color: #000000;">(</span>nNewPos > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span>, ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMax</span>, nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">)</span>*D_HEIGHT, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nVPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> VScrollPgUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><span style="color: #00C800;">LOCAL</span> nNewPos<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nVPos</span> > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span><br /> nNewPos := ::<span style="color: #000000;">nVPos</span> - ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nPgStep</span><br /> nNewPos := iif<span style="color: #000000;">(</span>nNewPos < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>,::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oVScroll</span>:<span style="color: #000000;">nMin</span>,nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nVPos</span> - nNewPos <span style="color: #000000;">)</span>*D_HEIGHT, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nVPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//=================================================================</span><br /><span style="color: #B900B9;">//-* Horizontal Scroll Bar</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">HScroll</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><span style="color: #00C800;">LOCAL</span> nNewPos<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span> ;<br /> .and. ::<span style="color: #000000;">nHPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span><br /> nNewPos := ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">GetPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, ;<br /> <span style="color: #000000;">(</span>::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">)</span>*D_WIDTH,<span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> HScrollThumb<span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span> ;<br /> .and. ::<span style="color: #000000;">nHPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, ;<br /> <span style="color: #000000;">(</span>::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">)</span>*D_WIDTH,<span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> HScrollTrack<span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> >= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span> ;<br /> .and. ::<span style="color: #000000;">nHPos</span> <= ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span><br /> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">SetPos</span><span style="color: #000000;">(</span>nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, ;<br /> <span style="color: #000000;">(</span>::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">)</span>*D_WIDTH,<span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> HScrollPgDown<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><br /><span style="color: #00C800;">LOCAL</span> nNewPos<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span><br /> nNewPos := ::<span style="color: #000000;">nHPos</span> + ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nPgStep</span><br /> nNewPos := iif<span style="color: #000000;">(</span>nNewPos > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span>, ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMax</span>, nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">)</span>*D_WIDTH,<span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">METHOD</span> HScrollPgUp<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TScrDlg<br /><span style="color: #00C800;">LOCAL</span> nNewPos<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nHPos</span> > ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span><br /> nNewPos := ::<span style="color: #000000;">nHPos</span> - ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nPgStep</span><br /> nNewPos := iif<span style="color: #000000;">(</span>nNewPos < ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>,::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">oHScroll</span>:<span style="color: #000000;">nMin</span>,nNewPos<span style="color: #000000;">)</span><br /> SysRefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ScrollWindow<span style="color: #000000;">(</span> ::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span>, ;<br /> <span style="color: #000000;">(</span> ::<span style="color: #000000;">nHPos</span> - nNewPos <span style="color: #000000;">)</span>*D_WIDTH,<span style="color: #000000;">0</span>, ;<br /> <span style="color: #000000;">0</span> , GetClientRect<span style="color: #000000;">(</span>::<span style="color: #000000;">oDlg</span>:<span style="color: #000000;">hWnd</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">nHPos</span> := nNewPos<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//=* End of File =================================================</span><br /><br /><br /><br /> </div>[/code:3arwothk] |
trying with Lenovo Miix 320 | FWH ScrollPanel works great |
trying with Lenovo Miix 320 | is there a test sample ?
on dialog I wish not on a window |
trying with Lenovo Miix 320 | We need to create ON INIT if it is dialog
Can you try? |
trying with Lenovo Miix 320 | Mr Rao ,
Itried it and it make me error NTOP
1 . then I not understood with font size yse
2. then I wish the possibilty to change the screen on vertical or Horizontal if the table is moved
[code=fw:90syjs48]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"constant.ch"</span><br /><br /><br /><br /><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> nBottom := <span style="color: #000000;">33</span><br /> <span style="color: #00C800;">Local</span> nRight := <span style="color: #000000;">75</span><br /> <span style="color: #00C800;">Local</span> nWidth := <span style="color: #0000ff;">Max</span><span style="color: #000000;">(</span> nRight * DLG_CHARPIX_W, <span style="color: #000000;">180</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> nHeight := nBottom * DLG_CHARPIX_H<br /><br /> <span style="color: #00C800;">local</span> lPortrait := ScreenWidth<span style="color: #000000;">(</span><span style="color: #000000;">)</span> < ScreenHeight<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTabletMode := FW_IsTabletMode<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> lTouch := FW_IsTouchScreen<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /> SET DATE ITALIAN<br /><br /> lSave := .f.<br /> lAdd :=.t.<br /><br /> USE RIFORNIME <span style="color: #0000ff;">alias</span> RIFORNIME<br /><br /> <span style="color: #00C800;">IF</span> lAdd<br /> RIFORNIME-><span style="color: #000000;">(</span>dbGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> RIFORNIME-><span style="color: #000000;">(</span>dbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> cRfauto := RIFORNIME->RFAUTO<br /> cRfcisterna := RIFORNIME->RFCISTERNA<br /> dRffecrif := RIFORNIME->RFFECRIF<br /> nRflitri := RIFORNIME->RFLITRI<br /> nRftotale := RIFORNIME->RFTOTALE<br /> lRffull := RIFORNIME->RFFULL<br /> cRfkmmezzo := RIFORNIME->RFKMMEZZO<br /> nRfcostolit := RIFORNIME->RFCOSTOLIT<br /><br /><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ; <span style="color: #B900B9;">//</span><br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"edit table test"</span> ;<br /> <span style="color: #0000ff;">SIZE</span> nWidth, nHeight TRANSPARENT <span style="color: #0000ff;">PIXEL</span><br /><br /> oPanel:=TScrollPanel<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,oDlg:<span style="color: #000000;">nbottom</span><span style="color: #000000;">-200</span> ,oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">-20</span>, oDlg <span style="color: #000000;">)</span><br /><br /><br /> oDlg:<span style="color: #000000;">bResized</span> := <span style="color: #000000;">{</span>||Rinfresca_oFrm<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oDlg:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">{</span> || Rinfresca_oFrm<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oDlg:<span style="color: #000000;">bOnDisplayChange</span> := <span style="color: #000000;">{</span> || oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oDlg:<span style="color: #000000;">bOnSettingChange</span> := <span style="color: #000000;">{</span> |o,w,lp| WaitRefresh<span style="color: #000000;">(</span> oDlg,w,lp <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span>Create_Get<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> WaitRefresh<span style="color: #000000;">(</span> ownd, w, l <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">if</span> oTimer == <span style="color: #00C800;">nil</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTimer <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">400</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> n++, oWnd:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> n > <span style="color: #000000;">4</span>, <span style="color: #000000;">(</span>oTimer:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oTimer := <span style="color: #00C800;">nil</span>, n := <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTimer<br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//--------------------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Create_Get<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> nRow:= <span style="color: #000000;">10</span><br /> <span style="color: #00C800;">Local</span> nCol := <span style="color: #000000;">10</span><br /> <span style="color: #00C800;">Local</span> nCol2:= <span style="color: #000000;">104</span><br /> <span style="color: #00C800;">LOCAL</span> aGet:=array<span style="color: #000000;">(</span><span style="color: #000000;">8</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cRfauto<br /> <span style="color: #00C800;">LOCAL</span> cRfcisterna<br /> <span style="color: #00C800;">LOCAL</span> dRffecrif<br /> <span style="color: #00C800;">LOCAL</span> nRflitri<br /> <span style="color: #00C800;">LOCAL</span> nRftotale<br /> <span style="color: #00C800;">LOCAL</span> lRffull<br /> <span style="color: #00C800;">LOCAL</span> cRfkmmezzo<br /> <span style="color: #00C800;">LOCAL</span> nRfcostolit<br /> <span style="color: #00C800;">local</span> oFontTablet<br /><br /> cRfauto := RIFORNIME->RFAUTO<br /> cRfcisterna := RIFORNIME->RFCISTERNA<br /> dRffecrif := RIFORNIME->RFFECRIF<br /> nRflitri := RIFORNIME->RFLITRI<br /> nRftotale := RIFORNIME->RFTOTALE<br /> lRffull := RIFORNIME->RFFULL<br /> cRfkmmezzo := RIFORNIME->RFKMMEZZO<br /> nRfcostolit := RIFORNIME->RFCOSTOLIT<br /><br /> * <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontTablet <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;">-20</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontTablet <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;">-30</span><br /><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Automezzo :"</span> <span style="color: #0000ff;">OF</span> oPanel <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br />* @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cRfauto <span style="color: #0000ff;">OF</span> oPanel <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">UPDATE</span><br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">COMBOBOX</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cRfauto <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Automezzo 1"</span>, <span style="color: #ff0000;">"Automezzo 2"</span>, <span style="color: #ff0000;">"Automezzo 3"</span> <span style="color: #000000;">}</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">460</span> <span style="color: #0000ff;">OF</span> oPanel <span style="color: #0000ff;">PIXEL</span> HEIGHTGET <span style="color: #000000;">120</span><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Cisterna :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cRfcisterna <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">UPDATE</span><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Data Rifornimento :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> dRffecrif <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> dRffecrif:= CalendarioTablet<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,aGet<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Litri inseriti :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nRflitri <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> <span style="color: #0000ff;">FONT</span> oFontTablet ;<br /> <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> Calcolatrice<span style="color: #000000;">(</span><span style="color: #000000;">0</span> , aGet<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, .T., <span style="color: #ff0000;">"Calcolatrice"</span>,.f. <span style="color: #000000;">)</span>,nRfcostolit:=nRftotale/nRflitri,aGet<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> @nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Totale Euro :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nRftotale <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">PICTURE</span> PictEuros<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>Calcolatrice<span style="color: #000000;">(</span><span style="color: #000000;">0</span> , aGet<span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span>, .T., <span style="color: #ff0000;">"Calcolatrice"</span> <span style="color: #000000;">)</span>,nRfcostolit:=nRftotale/nRflitri,aGet<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> * @ nRow, nCol <span style="color: #0000ff;">CHECKBOX</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> lRffull <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Inserito il pieno del serbatoio:"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">253</span>, <span style="color: #000000;">25</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /><br /> @nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Inserito il pieno del serbatoio :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">165</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2<span style="color: #000000;">+80</span> <span style="color: #00C800;">SWITCH</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> lRffull <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_GREEN, CLR_RED <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oSay2:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ @nRow, nCol<span style="color: #000000;">+300</span> <span style="color: #0000ff;">SAY</span> oSay2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lRffull, <span style="color: #ff0000;">'SI'</span>, <span style="color: #ff0000;">'NO'</span> <span style="color: #000000;">)</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Kilometri automezzo :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cRfkmmezzo <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">ACTION</span> Calcolatrice<span style="color: #000000;">(</span><span style="color: #000000;">0</span> , aGet<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span>, .T., <span style="color: #ff0000;">"Calcolatrice"</span>,.f. <span style="color: #000000;">)</span><br /> nRow+= <span style="color: #000000;">48</span><br /><br /> @ nRow, nCol <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Costo per litro :"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">105</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet<br /> @ nRow<span style="color: #000000;">-2</span>, nCol2 <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nRfcostolit <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">70</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999999.99"</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #0000ff;">UPDATE</span> READONLY<br /> nRow+= <span style="color: #000000;">48</span><br /><br /><br /><br /> @ nRow<span style="color: #000000;">+20</span>, nCol<span style="color: #000000;">+130</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Conferma"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">72</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet <span style="color: #00C800;">DEFAULT</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, lSave := .T.<span style="color: #000000;">)</span><br /> @ nRow<span style="color: #000000;">+20</span>, nCol<span style="color: #000000;">+250</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&Annulla"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">72</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontTablet CANCEL <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//--------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Rinfresca_oFrm<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oPanel:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">-20</span>, oDlg:<span style="color: #000000;">nbottom</span><span style="color: #000000;">-200</span> <span style="color: #000000;">)</span> <br /><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /> <span style="color: #00C800;">function</span> CalendarioTablet<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> <span style="color: #00C800;">function</span> Calcolatrice<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> <span style="color: #00C800;">FUNCTION</span> PictEuros<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"@E 9,999,999,999.99"</span> <span style="color: #000000;">)</span><br /><br /><br /><br /><br /><br /> </div>[/code:90syjs48]
I need your Help I must use a dialog into a tablet window and I not understtod How I must make it |
trying with Lenovo Miix 320 | Sylvio
Sure
Changing dialog's appearance on rotation is of interest to all of us.
Please give me a little time to complete work on hand. |
trying with Lenovo Miix 320 | ok
thanks |
trying with tdatabase | [code=fw:2r17fddp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oServiziSingoli:= TServizi<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">setFilter</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"multiple == .f."</span><span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /><br /><br /><span style="color: #00C800;">CLASS</span> TServizi <span style="color: #0000ff;">from</span> tdatarow <br /> <span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> lShared <span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TServizi<br /> ::<span style="color: #00C800;">super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>,oApp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">cDbfPath</span> + <span style="color: #ff0000;">"Servizi"</span> ,, lShared<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">setOrder</span><span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Self</span></div>[/code:2r17fddp]
and let me an error
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 27-12-2018, 01:39:52
Error description: Error BASE/1004 Message not found: TSERVIZI:USE
How OPen it wtith tdatabase or tdatarow ? |
trying with tdatabase | [code=fw:2vxue6z5]<div class="fw" id="{CB}" style="font-family: monospace;">cDbf := <your dbf file name><br />oDbf := TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, cDbf, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /> </div>[/code:2vxue6z5] |
trying with tdatabase | this is on share mode ? |
trying with tdatabase | Set 4th parameter to .T. for shared mode.
When you produce a multi-user application, it is better to set
[code=fw:1f3b39bn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />SET EXCLUSIVE OFF<br /> </div>[/code:1f3b39bn]
at the beginning of the application.
In this case all dbfs are opened in shared mode by default. |
trying with tdatabase | Nages,
I try with
oTariffe:= TTariffe():new()
oTariffe:gotop()
[code=fw:2z7j7kod]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">CLASS</span> TXData <span style="color: #0000ff;">from</span> TDataBase<br /> <span style="color: #00C800;">DATA</span> cPath <span style="color: #0000ff;">init</span> cFilePath<span style="color: #000000;">(</span>GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"Data<span style="color: #000000;">\"</span><br />ENDCLASS<br /><br />CLASS TTariffe from TXData <br /> METHOD New()<br />ENDCLASS<br /><br />METHOD New( lShared ) CLASS TTariffe<br /> Default lShared := .t.<br /> ::super:New(,::cPath + "</span>Tariffe<span style="color: #ff0000;">" ,, lShared)<br /> if ::use()<br /> ::setOrder(1)<br /> ::gotop()<br /> endif<br />RETURN Self</span></div>[/code:2z7j7kod]
It return me an error
Error description: Error BASE/1002 Alias does not exist: TARIFFE
Stack Calls
===========
Called from: => DBUSEAREA( 0 )
Called from: .\source\classes\DATABASE.PRG => (b)TDATABASE_USE( 412 )
Called from: .\source\classes\DATABASE.PRG => TTARIFFE:TD_EXECLOOP( 1983 )
Called from: .\source\classes\DATABASE.PRG => TTARIFFE:USE( 412 )
Called from: test.prg => TTARIFFE:NEW( 677 )
Called from: test.prg => MAIN( 62 )
why ? |
trying with tdatabase | Using pure TDatabase class there is no way you can get this kind of error. First thing, TDatabase does not use this kind of alias name.
For simple opening of a dbf file should you use such a round about complex approach?
Please use FWH TDatabase ([b:2ozzxdx8]without any modifications[/b:2ozzxdx8]) and run the following program
[code=fw:2ozzxdx8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDbf<br /><br /> SET EXCLUSIVE OFF<br /> SET AUTORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br /><br /> oDbf := TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"DATA<span style="color: #000000;">\T</span>ARIFFE"</span>, , .T. <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> oDbf:<span style="color: #000000;">Used</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> XBROWSER oDbf<br /> oDbf:<span style="color: #000000;">Close</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2ozzxdx8]
This should work without any runtime error. |
trying with tdatabase | thanks Nages Rao. it run ok but
On my application I have 15/20 archives and I wish found a solution to use them on Lan Network.
From November I 'm trying many test and I have and had many probems because there is allways soething of wrong.
I found a function to open an archive but I not Know if can go good :
[code=fw:ud11dkz1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> Open_Db<span style="color: #000000;">(</span> cArchivo, aIdx <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cAlias<br /> <span style="color: #00C800;">LOCAL</span> oDbf<br /> <span style="color: #00C800;">LOCAL</span> i<br /> <span style="color: #00C800;">STATIC</span> _Select_<br /> <span style="color: #00C800;">DEFAULT</span> _Select_ := <span style="color: #000000;">0</span><br /><br /> cAlias := <span style="color: #ff0000;">"TB"</span> + PADL<span style="color: #000000;">(</span> ++_Select_, <span style="color: #000000;">3</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">)</span><br /><br /> DbUseArea<span style="color: #000000;">(</span> .T. ,, cArchivo, cAlias, .T. <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">(</span> aIdx <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"A"</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;">(</span> aIdx <span style="color: #000000;">)</span><br /> DBSETINDEX<span style="color: #000000;">(</span> aIdx<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> oDbf := TDb<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cAlias <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> oDbf<br /><br /> </div>[/code:ud11dkz1]
it use a database class dated 2005
and on each procedure the call is :
::ocustomer := Open_Db( "customer", { "first" } )
::ocustomer:SetOrder( "NOMBRE" )
::oCustomer:GoTop()
a Have a complete application use it and run good on lan netwok ( I test it at my office) but I not Know if I must use it or another |
trying with tdatabase | The above function Open_DB() is meant for DBFNTX.
Pleae do not get confused with so many alternatives like TDB, TDatbase, TData etc and keep mixing them up.
TDatabase is the latest and advanced.
Still, I personally advise you that is not necessary to use any of these classes to make a good multiuser application.
[quote:3kpxp2u0]
On my application I have 15/20 archives and I wish found a solution to use them on Lan Network.
[/quote:3kpxp2u0]
15 or 20 is a small number. Even if you have 100 archives there should be no problem. |
trying with tdatabase | How it could be a function to open an archive and all its indexes (cdx) with tdatabase and from a specific example folder. \ data \
I made
[code=fw:1zd38hf8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">Function</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oCustomer<br /><br /> oCustomer:=Db_Open<span style="color: #000000;">(</span> <span style="color: #ff0000;">"CUSTOMER"</span>,.t.<span style="color: #000000;">)</span><br /> oCustomer:<span style="color: #000000;">setorder</span><span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> oCustomer:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /> XBROWSER oCustomer<br /> <br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Db_Open<span style="color: #000000;">(</span>cDbf,lShare<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDbf<br /><br /> SET EXCLUSIVE OFF<br /> SET AUTORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br /><br /> oDbf := TDatabase<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, cDbf, ,lShare <span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #00C800;">return</span> oDbf<br /><span style="color: #B900B9;">//----------------------------------------------//</span><br /> </div>[/code:1zd38hf8]
it seems to run ok
( I made a customer.cdx with tag first) |
trying with tdatabase | Silvio,
You already have the files opening it a specified path with the subclass we created, so you don't need a function to do it also. |
trying with tdatabase | Mr. Rao,
I have been using tData for many years, and it's subset of tSearch and tRecord.
I can assure you it does nothing to conflict with tDatabase from which it inherits.
I have also been developing in multi=user environments with dBase, Clipper, and FWH/xHarbour/Harbour since the mid 1980's. I have absolutely no problem using data objects efficiently in those settings, and my primary application used in many businesses automatically supports single, multi, and ADS setups with absolutely no difficulty.
Your work in enhancing FWH is appreciated, and the additions to tDatabase have been noted and well received. However, it is not necessary to recode sections to eliminate tData. There is no difficulty here.
Tim. |
trying with tdatabase | James, ( and Tim Stone because I Know only you use tdata on this forum)
as I wrote You tdata not run ok I had and Have many problem and each day there is some problem on Original source application there is not
I lose my time from November and I'm afraid of not creating anything that can work on a network and the month of May is too close
I had to explain all the archives and what they did, I can not upset the love application because you think you have to do in a certain way different from how I have already thought so many years ago.
In this situation I just had to try and convert my application and make it workable in an LAN network.
Instead, I spend my nights trying to convert my application with your clase tdata without still having valid solutions |
trying with tdatabase | Silvio,
[i:11cjbg1o]>as I wrote You tdata not run ok I had and Have many problem and each day there is some problem on Original source application there is not[/i:11cjbg1o]
Well, as Tim has confirmed, TData DOES run OK and it has been for many years--since the '80s.
[i:11cjbg1o]>I lose my time from November and I'm afraid of not creating anything that can work on a network and the month of May is too close.[/i:11cjbg1o]
Maybe you should have started sooner. I will take you even longer to convert it to multi-user without TData.
[i:11cjbg1o]>I had to explain all the archives and what they did, I can not upset the love application because you think you have to do in a certain way different from how I have already thought so many years ago.[/i:11cjbg1o]
Well you were programming using exclusive use only. You cannot program the same way for multi-user whether you use objects or not.
[i:11cjbg1o]>In this situation I just had to try and convert my application and make it workable in an LAN network.
Instead, I spend my nights trying to convert my application with your class tdata without still having valid solutions.[/i:11cjbg1o]
Well, you don't have valid solutions when your code has errors. And you do have valid solutions when it is programmed correctly--and it takes a lot less code. Remember I eliminated 100 lines of code just in one function by using data objects. It does take some time to understand how to do things differently. But whether you use TData or not, [b:11cjbg1o]it IS going to take some time to convert to multi-user[/b:11cjbg1o]. And it is going to take more time to convert without using database objects.
In additon to this, your application is the most convoluted, unorthodox, complex application I have ever seen in my 33+ years of writing code. I don't mean for that to sound negative, it just is the way you have done things. The purpose of the application is like nothing I have ever seen too. So both of us have to go through a learning curve.
[quote:11cjbg1o]If it was easy, then anyone could do it.-Anon[/quote:11cjbg1o] |
trying with tdatabase | James,
All This is not true
this evening I did this test in 3 minutes and it works without any classes (tServizi->txdata->tdata->tdatabase)
[b:5sqsank1]Please see dbopen function easy [/b:5sqsank1]
[img:5sqsank1]https://i.postimg.cc/pVq57BCZ/mio.png[/img:5sqsank1]
[code=fw:5sqsank1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><br /><span style="color: #00C800;">static</span> cDbfPath<br /><br /><br /><span style="color: #00C800;">Function</span> Servizi<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oDlgServices, oFont, oBold, oBrw1, oBrw2, oSay1, oSay2, oBtnOk, oBtnClose, m<br /> <span style="color: #00C800;">Local</span> oServizi,oServiziSingoli,oServiziMultipli<br /> <span style="color: #00C800;">Local</span> cFilter1,cFilter2<br /> <span style="color: #00C800;">Local</span> cCursor:= TCursor<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>,<span style="color: #ff0000;">'HAND'</span><span style="color: #000000;">)</span><br /><br /> cFilter1:= <span style="color: #ff0000;">'FIELD->MULTIPLE=.F.'</span><br /> cFilter2:= <span style="color: #ff0000;">'FIELD->MULTIPLE=.T.'</span><br /><br /><br /> cDbfPath := cFilePath<span style="color: #000000;">(</span>GetModuleFileName<span style="color: #000000;">(</span> GetInstance<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"Data<span style="color: #000000;">\"</span><br /> cIniFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "</span>Beach.ini<span style="color: #ff0000;">"<br /><br /><br /><br /> oServiziSingoli:=Db_Open( "</span>Servizi<span style="color: #ff0000;">",.t.)<br /> oServiziSingoli:DbSetFilter( {|| &cFilter1 }, )<br /> oServiziSingoli:gotop()<br /><br /> oServiziMultipli:=Db_Open( "</span>Servizi<span style="color: #ff0000;">",.t.)<br /> oServiziMultipli:DbSetFilter( {|| &cFilter2 }, )<br /> oServiziMultipli:gotop()<br /><br /><br /> DEFINE FONT oFont NAME "</span>TAHOMA<span style="color: #ff0000;">" SIZE 0,-14<br /> DEFINE FONT oBold NAME "</span>TAHOMA<span style="color: #ff0000;">" SIZE 0,-14 BOLD<br /><br /> DEFINE DIALOG oDlgServices SIZE 880,600 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;<br /> TITLE "</span>Bikini - Gestione Servizi Singoli e Multipli<span style="color: #ff0000;">"<br /><br /> @ 10, 40 SAY oSay1 PROMPT "</span>Servizi singoli<span style="color: #ff0000;">" SIZE 400,24 PIXEL OF oDlgServices CENTER FONT oBold<br /> @ 10,440 SAY oSay2 PROMPT "</span>Servizi multipli<span style="color: #ff0000;">" SIZE 400,24 PIXEL OF oDlgServices CENTER FONT oBold<br /><br /><br /><br /> @ 95, 40 XBROWSE oBrw1 SIZE 400,-65 PIXEL OF oDlgServices;<br /> COLUMNS 5,2,4,7,8,9,12,11;<br /> HEADERS "</span>Tipo<span style="color: #ff0000;">","</span>Descrizione<span style="color: #ff0000;">","</span>Costo<span style="color: #ff0000;">","</span>Disp.<span style="color: #ff0000;">","</span>A4<span style="color: #ff0000;">", "</span>Pos<span style="color: #ff0000;">", "</span>Ord.<span style="color: #ff0000;">","</span><span style="color: #ff0000;">";<br /> COLSIZES 40,90,50,50,30,30,34,34 ;<br /> CELL LINES NOBORDER ;<br /> DATASOURCE oServiziSingoli:cAlias<br /><br /> WITH OBJECT oBrw1<br /> :nRowHeight := 30<br /> WITH OBJECT oBrw1:aCols[ 1]<br /> :lBmpStretch := .F.<br /> :lBmpTransparent := .T.<br /> :nwidth := 40<br /> :bStrImage := {|| oServiziSingoli:IMAGE }<br /> END<br /><br /> WITH OBJECT oBrw1:aCols[ 3]<br /> :cEditPicture := '@ €99,999.99'<br /> :nFootStrAlign := AL_RIGHT<br /> END<br /><br /><br /> WITH OBJECT oBrw1:aCols[ 5]<br /> :AddBitmap({ "</span>BTN_PNG_TICK<span style="color: #ff0000;">" ,"</span>BTN_PNG_TICK_RED<span style="color: #ff0000;">"})<br /> :bBmpData := { || iif( oServiziSingoli:a4, 1, 2) }<br /> :bStrData := { || "</span><span style="color: #ff0000;">" }<br /> END<br /> WITH OBJECT oBrw1:aCols[ 6]<br /> :AddBitmap({ "</span>BTN_PNG_TICK<span style="color: #ff0000;">" ,"</span>BTN_PNG_TICK_RED<span style="color: #ff0000;">"})<br /> :bBmpData := { || iif(oServiziSingoli:pos, 1, 2) }<br /> :bStrData := { || "</span><span style="color: #ff0000;">" }<br /> END<br /> WITH OBJECT oBrw1:aCols[ 8]<br /> :AddBitmap({ "</span>BTN_PNG_LOCKSI<span style="color: #ff0000;">" ,"</span>BTN_PNG_LOCKNO<span style="color: #ff0000;">"})<br /> :bBmpData := { || iif( oServiziSingoli:ISlock, 1, 2) }<br /> :bStrData := { || "</span><span style="color: #ff0000;">" }<br /> END<br /> :lHscroll := .F.<br /> :l2007 := .F.<br /> :l2015 := .T.<br /> :lRecordSelector := .f.<br /> :nStretchCol := STRETCHCOL_WIDEST<br /> :lAllowRowSizing := .F.<br /> :lAllowColSwapping := .F.<br /> :lAllowColHiding := .F.<br /> :nMarqueeStyle := MARQSTYLE_HIGHLWIN7<br /> :SetoDBF( oServiziSingoli )<br /> :CreateFromCode()<br /> END<br /><br /> for n := 1 to len(oBrw1:aCols)<br /> oBrw1:aCols[n]:lAllowSizing := .f.<br /> next<br /><br /><br /> @ 95,450 XBROWSE oBrw2 SIZE -40,-65 PIXEL OF oDlgServices;<br /> COLUMNS 5,2,4,8,9,12;<br /> HEADERS "</span>Tipo<span style="color: #ff0000;">","</span>Descrizione<span style="color: #ff0000;">","</span>Costo<span style="color: #ff0000;">","</span>A4<span style="color: #ff0000;">", "</span>Pos<span style="color: #ff0000;">", "</span>Ord.<span style="color: #ff0000;">";<br /> COLSIZES 40,150,70,30,30,40 ;<br /> CELL LINES NOBORDER ;<br /> DATASOURCE oServiziMultipli:cAlias<br /><br /> WITH OBJECT oBrw2<br /> :nRowHeight := 30<br /><br /> WITH OBJECT oBrw2:aCols[ 1]<br /> :lBmpStretch := .F.<br /> :lBmpTransparent := .T.<br /> :nwidth := 40<br /> :bStrImage := {||oServiziMultipli:IMAGE }<br /> END<br /> WITH OBJECT oBrw2:aCols[ 3]<br /> :cEditPicture := '@ €99,999.99'<br /> :nFootStrAlign := AL_RIGHT<br /> END<br /> WITH OBJECT oBrw2:aCols[ 4]<br /> :AddBitmap({ "</span>BTN_PNG_TICK<span style="color: #ff0000;">" ,"</span>BTN_PNG_TICK_RED<span style="color: #ff0000;">"})<br /> :bBmpData := { || iif( oServiziMultipli:a4, 1, 2) }<br /> :bStrData := { || "</span><span style="color: #ff0000;">" }<br /> END<br /> WITH OBJECT oBrw2:aCols[ 5]<br /> :AddBitmap({ "</span>BTN_PNG_TICK<span style="color: #ff0000;">" ,"</span>BTN_PNG_TICK_RED<span style="color: #ff0000;">"})<br /> :bBmpData := { || iif( oServiziMultipli:pos, 1, 2) }<br /> :bStrData := { || "</span><span style="color: #ff0000;">" }<br /> END<br /> :lHscroll := .F.<br /> :l2007 := .F.<br /> :l2015 := .T.<br /> :lRecordSelector := .f.<br /> :nStretchCol := STRETCHCOL_WIDEST<br /> :lAllowRowSizing := .F.<br /> :lAllowColSwapping := .F.<br /> :lAllowColHiding := .F.<br /> :nMarqueeStyle := MARQSTYLE_HIGHLWIN7<br /> :SetoDBF( oServiziMultipli )<br /> :CreateFromCode()<br /> END<br /><br /> for n := 1 to len(oBrw2:aCols)<br /> oBrw2:aCols[n]:lAllowSizing := .F.<br /> next<br /><br /><br /><br /> @ 550,660 BTNBMP oBtnClose PROMPT "</span>Ordina<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_ELEMENTIORD<span style="color: #ff0000;">" FLAT;<br /> SIZE 95,40 LEFT PIXEL OF oDlgServices ;<br /> ACTION NIL<br /><br /> @ 550,760 BTNBMP oBtnOK PROMPT "</span>Esci<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_USCITA<span style="color: #ff0000;">" FLAT;<br /> SIZE 95,40 LEFT PIXEL OF oDlgServices ;<br /> ACTION oDlgServices:End()<br /><br /><br /> @ 50,100 BTNBMP oBtnNew PROMPT "</span>Nuovo<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_SERVIZI_NEW<span style="color: #ff0000;">" FLAT;<br /> SIZE 90,40 RIGHT PIXEL OF oDlgServices;<br /> ACTION SeEdita(oBrw1, 1, , oDlgServices, ,cFilter1)<br /><br /> oBtnNew:oCursor:=cCursor<br /> SetGradientBtnbmp(1999,oBtnNew)<br /><br /><br /><br /><br /> @ 50,200 BTNBMP oBtnMod PROMPT "</span>Modifica<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_SERVIZI_MOD<span style="color: #ff0000;">" FLAT;<br /> SIZE 90,40 RIGHT PIXEL OF oDlgServices;<br /> ACTION SeEdita(oBrw1, 2, , oDlgServices, ,cFilter1)<br /><br /> oBtnMod:oCursor:=cCursor<br /> SetGradientBtnbmp(1999,oBtnMod)<br /><br /><br /> @ 50,300 BTNBMP oBtnCan PROMPT "</span>Cancella<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_SERVIZI_DEL<span style="color: #ff0000;">" FLAT;<br /> SIZE 90,40 RIGHT PIXEL OF oDlgServices;<br /> ACTION SeBorra(oBrw1)<br /><br /> oBtnCan:oCursor:=cCursor<br /> SetGradientBtnbmp(1999,oBtnCan)<br /><br /> @ 50,480 BTNBMP oBtnNew1 PROMPT "</span>Nuovo<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_MULTIPLI_NEW<span style="color: #ff0000;">" FLAT;<br /> SIZE 90,40 LEFT PIXEL OF oDlgServices;<br /> ACTION SeMultiEdita(oBrw2, 1, , oDlgServices, ,cFilter2)<br /><br /> oBtnNew1:oCursor:=cCursor<br /> SetGradientBtnbmp(1999,oBtnNew1)<br /><br /><br /> @ 50,580 BTNBMP oBtnMod1 PROMPT "</span>Modifica<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_MULTIPLI_MOD<span style="color: #ff0000;">" FLAT;<br /> SIZE 90,40 LEFT PIXEL OF oDlgServices;<br /> ACTION SeMultiEdita(oBrw2, 2, , oDlgServices, ,cFilter2)<br /> oBtnMod1:oCursor:=cCursor<br /> SetGradientBtnbmp(1999,oBtnMod1)<br /><br /> @ 50,680 BTNBMP oBtnCan1 PROMPT "</span>Cancella<span style="color: #ff0000;">" ;<br /> RESOURCE "</span>BTN_PNG_MULTIPLI_DEL<span style="color: #ff0000;">" FLAT;<br /> SIZE 90,40 LEFT PIXEL OF oDlgServices;<br /> ACTION SeBorra(oBrw2)<br /> oBtnCan1:oCursor:=cCursor<br /> SetGradientBtnbmp(1999,oBtnCan1)<br /><br /><br /><br /> oDlgServices:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570<br /><br /> oDlgServices:bResized := <||<br /> local oRect := oDlgServices:GetCliRect()<br /> local x := Int( oRect:nWidth / 2 )<br /><br /> oSay1:nWidth := x - 40<br /> oSay2:nLeft := x<br /> oSay2:nWidth := x - 40<br /><br /> oBrw1:nWidth := x - 40<br /> oBrw2:nLeft := x + 40<br /> oBrw2:nWidth := 200<br /><br /> oBtnClose:nLeft := oRect:nRight - 220<br /> oBtnClose:nTop := oRect:nBottom - 50<br /><br /> oBtnOK:nLeft := oRect:nRight - 120<br /> oBtnOK:nTop := oRect:nBottom - 50<br /><br /> oBtnNew:nTop := oRect:ntop + 50<br /> oBtnNew:nLeft := x - 350<br /><br /> oBtnMod:nTop := oRect:ntop + 50<br /> oBtnMod:nLeft := x - 250<br /><br /> oBtnCan:nTop := oRect:ntop + 50<br /> oBtnCan:nLeft := x - 150<br /><br /> oBtnNew1:nTop := oRect:ntop + 50<br /> oBtnNew1:nLeft := x + 100<br /><br /> oBtnMod1:nTop := oRect:ntop + 50<br /> oBtnMod1:nLeft := x + 200<br /><br /> oBtnCan1:nTop := oRect:ntop + 50<br /> oBtnCan1:nLeft := x + 300<br /><br /><br /> return nil<br /> ><br /><br /> ACTIVATE DIALOG oDlgServices CENTERED<br /> RELEASE FONT oFont, oBold<br /><br />return nil<br />//---------------------------------------------------------------------//<br />Function SeEdita(oGrid, nMode, oCont, oParent, cUtente,cFilter1)<br />return nil<br />//----------------------------------------------------------------------//<br />Function SeBorra(oGrid, oCont)<br />return nil<br />//----------------------------------------------------------------------//<br />Function SeMultiEdita(oGrid, nMode, oCont, oParent, cUtente,cFilter2)<br />return nil<br />//---------------------------------------------------------------------//<br />Function Db_Open(cDbf,lShare)<br /> local oDbf<br /><br /> SET EXCLUSIVE OFF<br /> SET AUTORDER TO 1<br /><br /> oDbf := TDatabase():Open( nil, cDbfPath+cDbf, ,lShare )<br /><br /> return oDbf<br />//----------------------------------------------//<br /><br /><br /><br /></span></div>[/code:5sqsank1] |
trying with tdatabase | Dear friend Mr. Silvio
I know that it is not only Mr. Tim, but there are many satisfied users of TData class and there are many applications running using TData class. If you are having any problems in using it, I do not think there is any problem with the class but you may be needing more guidance from its author and I am sure Mr. James will provide it with pleasure.
Finally, you decide what is comfortable for you, without criticizing any product.
Mr. Tim
We do not know what is in the TData class. We neither canvas for it or against it. We talk only about our FWH classes.
FWH can provide support only if the user uses pure unmodified FWH TDatabase class.
As we keep enhancing all other classes, we keep enhancing TDatabase also. Some of the enhancements are based on user inputs and requests as well as our own experiences with our own commercial applications.
[quote:3aercgb7]
However, it is not necessary to recode sections to eliminate tData
[/quote:3aercgb7]
I do not understand what this means.
To All:
My humble submission to all is not to argue which is good or bad. Instead, use what you like. |
trying with tdatabase | [quote:1re6f82i]How it could be a function to open an archive and all its indexes (cdx) with tdatabase [/quote:1re6f82i]
When you open and DBF via "DBFCDX", the main index file (cdx) with all the index tags is automatically opened and you do not have to (and should not) write any separate code to open the indexes. This is the case whether you open the DBF using the USE command or you use TDatabase class.
If you want that when you open any DBF, the first index tag is to be used, you may set a global setting
SET AUTORDER TO 1 at the beginning of the main function.
This eliminates the need to use
:SetOrder( 1 )
:GoTop()
every time. |
trying with tdatabase | Rao,
In your original comments you suggested removing all additional libraries related to tDatabase including tData.
I was simply pointing out that was not necessary because tData works fine with tDatabase.
Perhaps I could do everything now with just tDatabase but that would involve rewriting code, and I wouldn't want to devote time to that process unless it was necessary.
Tim |
trying with tdatabase | Silvio,
When I first started re-coding into data objects and classes, it took a lot of work, and I had to rethink how I was coding. The more I finished, the easier it became. The result is a faster program, MUCH easier updating, and it is very easy to add new features. It also reduced my total code size very significantly.
It is very clear that you want to stick with how you have done it years ago. As a result, you may continue to hit walls where things don't work your way. However, it is not the fault of FWH, or modern programming methods.
The point is that most of us have used FWH with Harbour or xHarbour, using Borland, Pelles, or Microsoft C compilers and linkers, and created fully functional multi-user programs far more complex than what you seem to need. In my case, I have done it for well over 30 years.
We have tried to share with you how to do it, but that does require changes on your part. We are not tricking you. I have people who run my application on 20 workstations, all against one database, and their data entry is non-stop all day long. We've tried to help, but we can't use your way of programming. I followed James guidance and rewrote my entire code base ( rather large ) in OOPS. It took a year to master and complete the rewrite and extensive testing, but the results were fantastic and thrilled my clients.
I hope you find a solution that works your way, but I won't confuse conversations any further in the future. I'll simply not share any more thoughts with you.
Tim |
trying with tdatabase | Nages,
[quote:3mxo5pkv]If you want that when you open any DBF, the first index tag is to be used, you may set a global setting
SET AUTORDER TO 1 at the beginning of the main function.
This eliminates the need to use
:SetOrder( 1 )
:GoTop()
every time[/quote:3mxo5pkv]
Thank you for pointing that out. I suspect that many don't know about SET AUTORDER TO.
The one drawback is that if someone forgets to put SET AUTORDER TO 1 at the start of their program, they may HAVE a really hard time figuring out why things aren't working the way they expected.
There is also another way to write the code only once, and that is to put that code into a super class and then inherit all the database classes from it. Then you only write the code once.
In this case I didn't do it that way because I had no idea about the structures of the databases that Silvio was using so this gives the option to set each one differently. Granted this could also be done by passing nOrder to the superclass, but it is still harder to grasp if a new user can't visualize exactly what is happening.
All the ways are workable solutions. |
trying with tdatabase | Silvio
[quote:2hbvofyu]this evening I did this test in 3 minutes and it works without any classes (tServizi->txdata->tdata->tdatabase)[/quote:2hbvofyu]
OK. But that has nothing to do with creating a multi-user application. It is a good example of how you can design common code to handle multiple things. This is one of the basic principles of OOP.
As I mentioned in my last email, one of the errors you were experiencing was a coding syntax error which had nothing to do with database objects. The same code would have caused the same error if you were [b:2hbvofyu]not [/b:2hbvofyu]using database objects. But because you are not used to using objects you tend to blame the object before even looking for syntax errors. |
trying with tdatabase | tim
I have only said that my application works and runs only that it can not be used on the network.
I do not care what tool to use but I'm interested in a tool that works.
If I have to build a car and the desire for 5 doors I can not do it only with 4 doors or only with two mirrors because the third one is not used ..or not need it <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
said this
I tried and spend the nights to convert with the tdata but I do not go forward, I see no improvement, I have been trying for 2 months, I have done countless tests and James can say how many tests I have sent him.
Another thing .. if in the old program I have created certain procedures to do specific things I can not overwhelm the program now because James does not like it and according to him it is not functional.
For example,
returning to my application for the beach,
I have an archive to do, an archive with all the prices that I call "rates" is like an archive with the items to sell and with the price, specifically I have to create a record for each number of days from the first day of the month to the last one for all the months of the season (May, June, July, September) and for all the elements that are located on the beach (umbrellas, hawaysani, tents and cabins) for all price lists default 2,
because it is so,
because it was created in this way,
because from the customer order can easily calculate the cost of rental and special packages
but James does not like this reasoning and we are still for a week, he sent me an email with a calculation of how many records I should enter as if I did not know,
we talk about at least 1800 records but it is so there is no other way and as if they were items to be put on the bill but to James not we like them and we do not go on
and meanwhile the management of the services do not work (single and multiple) especially the rescues and the orders
and I am very disheartened because I do not know what "fish to take".
I will do the tests and then try them in a LAN network and they do not work,
I asked everyone for help to solve my problem
what should I do?
Help me !!!! |
trying with tdatabase | Silvio,
I have been helping you, I sent you answers to almost every issue and they have all been coding syntax errors, not database object errors.
Many of the things I have written to you about I am not saying I don't like. I was first trying to just figure out how the program works, and second I sometimes offered alternatives that might be easier. In one instance you said "it is easy," but then I figured is was probably generating hundreds if not thousands of records. I was then wondering that if the records could be automatically generated using calculations, then maybe the data could be calculated WITHOUT making all the records. That would seem to be easier.
Most of your issues are just due to you not yet understanding the use of database objects. Thus you tend to immediately blame the objects rather than looking for a coding error. It is not that the objects don't work. But the alternative (not using objects) is going to be foreign to you also, and it is going to require a lot more coding. |
trying with tdatabase | Silvio,
I'm sorry but I actually do not understand your beach example. It sounds like a combination of an inventory control, and calendar, program. I don't understand all the needed records. However, if it works single user, then it should work multi user.
A comment was made earlier that you need to use SET EXCLUSIVE OFF at the very beginning of your program. You do not need Exclusive to do a single user system. The only times I use Exclusive are when I Zap, Pack, or Index files, and that is very rare. In those cases, I provide a warning to insure ALL other users are out of the program, and then open each file exclusive mode ( when called ), perform that operation, and close it. Otherwise, the files are ALWAYS opened in shared mode. This works if you are only calling it from one computer, or many.
I also only lock the RECORD, and do it only when Saving the changes. I open the record and the data is stored in buffers ( automatically by the object ). All editing is done, and then when the save button is pushed, the record is locked, the data saved, and the record unlocked, all as part of the ::save() method. This just takes milliseconds. If there were two computers accessing the save at the exact same time ( fraction of a second ), one locks, and the other retries automatically. I NEVER have anyone tell me they actually see a system display an error on locking. It's all handled by the class, and as I said, as many as 20 people could be working on this at the same time.
Again, with SET EXCLUSIVE OFF at the very beginning of the program ( preferably in the MAIN( ) procedure that starts your application ), everything by default is available in shared mode. You only have to declare the mode thereafter IF you need to go into EXCLUSIVE mode with a file, and that should be very rare.
Tim |
trying with tdatabase | Silvio,
can you please post here a foto/copy of the printed price list from the beach "Listino prezzi".
Then it is easier to understand.
Best regards
Otto |
trying with tdatabase | I would add to Tim's locking explanation, that there are times when I do a file lock. This way the file can be in shared mode, so users can at least look at the records.
When you have multiple records to update at the same time, a file-lock insures that all of them will get updated. If you lock each record instead you risk failure of one or more records. |
trying with tdatabase | [quote="James Bott":2mpb6muz]Silvio,
I have been helping you, I sent you answers to almost every issue and they have all be coding syntax errors, not database object errors.
Many of the things I have written to you about I am not saying I don't like. I was first trying to just figure out how the program works, and second I sometimes offered alternatives that might be easier. In one instance you said "it is easy," but then I figured is was probably generating hundreds if not thousands of records. I was then wondering that if the records could be automatically generated using calculations, then maybe the data could be calculated WITHOUT making all the records. That would seem to be easier.
Most of your issues are just due to you not yet understanding the use of database objects. Thus you tend to immediately blame the objects rather than looking for a coding error. It is not that the objects don't work. But the alternative (not using objects) is going to be foreign to you also, and it is going to require a lot more coding.[/quote:2mpb6muz]
James,
do you remember XBROWSES of Servizi ?
We stayed at least 6 days to understand how to display the images because the aliases that created the Txdata class did not allow to show the images
the services program is an easy procedure,There are basic services (chair, cot, deckchair),and multiple services.
in a xbrowse I wanted the individual ones in the other the multpli, but the service archive is unique
Now there is another problem when I insert a new record i not see the number of the code
you wrote me it is normal but then when I save it not save the code on archive servizi.dbf
because you erase the section where I increment the code
[code=fw:2mpb6muz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">Function</span> NuovoServizioID<span style="color: #000000;">(</span>nMode,oServiziSingoli,cfilter1<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> cNewId<br /> <span style="color: #00C800;">local</span> nRecPtr := oServiziSingoli:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nOrden := oServiziSingoli:<span style="color: #000000;">OrdNumber</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> nMode == <span style="color: #000000;">1</span> .or. nMode == <span style="color: #000000;">3</span><br /><br /> <span style="color: #00C800;">If</span> !empty<span style="color: #000000;">(</span>cFilter1<span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">clearFilter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /> oServiziSingoli:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span><span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> oServiziSingoli:<span style="color: #000000;">EOF</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cNewId := strzero<span style="color: #000000;">(</span>oServiziSingoli:<span style="color: #000000;">RecNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> cNewId := strzero<span style="color: #000000;">(</span><span style="color: #000000;">(</span>VAL<span style="color: #000000;">(</span>oServiziSingoli:<span style="color: #0000ff;">ID</span><span style="color: #000000;">)</span><span style="color: #000000;">+1</span><span style="color: #000000;">)</span>,<span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> <span style="color: #00C800;">If</span> !empty<span style="color: #000000;">(</span>cFilter1<span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">setFilter</span><span style="color: #000000;">(</span> cFilter1<span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">gotop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /><br /> oServiziSingoli:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span> nOrden <span style="color: #000000;">)</span><br /> oServiziSingoli:<span style="color: #000000;">GoTo</span><span style="color: #000000;">(</span>nRecPtr<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">endif</span> <span style="color: #B900B9;">// mode = 1 or 3</span><br /><br /> <span style="color: #00C800;">return</span> cNewId<br /> </div>[/code:2mpb6muz]
why I canno t use it ? |
trying with tdatabase | [quote="TimStone":28czfxg6]Silvio,
I'm sorry but I actually do not understand your beach example. It sounds like a combination of an inventory control, and calendar, program. I don't understand all the needed records. However, if it works single user, then it should work multi user.
A comment was made earlier that you need to use SET EXCLUSIVE OFF at the very beginning of your program. You do not need Exclusive to do a single user system. The only times I use Exclusive are when I Zap, Pack, or Index files, and that is very rare. In those cases, I provide a warning to insure ALL other users are out of the program, and then open each file exclusive mode ( when called ), perform that operation, and close it. Otherwise, the files are ALWAYS opened in shared mode. This works if you are only calling it from one computer, or many.
I also only lock the RECORD, and do it only when Saving the changes. I open the record and the data is stored in buffers ( automatically by the object ). All editing is done, and then when the save button is pushed, the record is locked, the data saved, and the record unlocked, all as part of the ::save() method. This just takes milliseconds. If there were two computers accessing the save at the exact same time ( fraction of a second ), one locks, and the other retries automatically. I NEVER have anyone tell me they actually see a system display an error on locking. It's all handled by the class, and as I said, as many as 20 people could be working on this at the same time.
Again, with SET EXCLUSIVE OFF at the very beginning of the program ( preferably in the MAIN( ) procedure that starts your application ), everything by default is available in shared mode. You only have to declare the mode thereafter IF you need to go into EXCLUSIVE mode with a file, and that should be very rare.
Tim[/quote:28czfxg6]
Tim,
>The only times I use Exclusive are when I Zap, Pack, or Index files, and that is very rare
On oldest application I use dbpack and Dbzap when :
I draw the beach
I create the order for Elements, Services, and other archives
I create the price list
Now I cannot use dbpack and dbzap and sincerely I not understood how make it , I must rewrite all my sources
[b:28czfxg6]: Save ()[/b:28czfxg6]
I tried to make James understand that there are some fields that need special save
then I'm used to loading the example fields into variables:
cName: = CU-> First
CCognome: CU => Last
and then to treat them in the dialog
example
@ 10.10 get aGet [1] var cName
and then to save them
Replace cu-> First with cName
But James erased all |
trying with tdatabase | [quote="James Bott":35kmfn23]I would add to Tim's locking explanation, that there are times when I do a file lock. This way the file can be in shared mode, so users can at least look at the records.
When you have multiple records to update at the same time, a file-lock insures that all of them will get updated. If you lock each record instead you risk failure of one or more records.[/quote:35kmfn23]
It is all right. I started from the beginning of the basic dbf
I have to create spiaggia.dbf, elementi.dbf, servizi.dbf, listini.dbf, tariffe.dbf
[b:35kmfn23]Spiaggia.dbf[/b:35kmfn23]
I created the beach and there is a problem because I can not use Dbzap and Dbpack and I do not know how to do it because when I create the beach I work with an array, then I have to delete all the records on the beach.dbf to insert the new data from the array . Basic configuration is 25X18 => 450 records
I tried the Nages function but sometimes it works and sometimes it does not
[b:35kmfn23]Servizi[/b:35kmfn23]
I have to create services that are single and multiple what is difficult to understand yet you tell me that there are problems in programming not for your calsse tdata but in reality it is not so I answered above: to autoincrement a code of 4 characters I have always done
oServiziSingoli: SetOrder (1)
oServiziSingoli: GoBottom ()
IF oServiziSingoli: EOF ()
cNewId: = strzero (oServiziSingoli: RecNo (), 4)
ELSE
cNewId: = strzero ((VAL (oServiziSingoli: ID) +1), 4)
ENDIF
now I cannot use it , why ? |
trying with tdatabase | You don't need all of that code. You use the example of one field, but consider if there are 10 fields.
Step 1: Open the data object with one line
oDbf := tdata():new(, "cust" )
Step 2: The values are loaded in buffers, so edit them directly
@ 10,10 GET oDbf:abc
.... Do all the other edits the same way
Step 3: Save ALL the fields with one line
oDbf:save()
For 10 fields, this eliminates at least 23 lines of code needed for your way. It handles ALL locking automatically and works PERFECTLY in Single, or Multi User.
Yes, you would re-write code, but you would have much BETTER code, and less of it. To re-write the code this way would not take days, but rather would be done in minutes at each spot. |
trying with tdatabase | tim,
perhaps you not understood the problem
I have a FIELD 4 CR called ID sample "0001"
I wish add a new record
and the ID FIELD must be incremental sample "0002"
it is calculate with
IF oServiziSingoli: EOF ()
cNewId: = strzero (oServiziSingoli: RecNo (), 4)
ELSE
cNewId: = strzero ((VAL (oServiziSingoli: ID) +1), 4)
ENDIF
if james erase this step how calculate the new id ?
how you make it ? |
trying with tdatabase | [quote:2hlkp5et]Step 1: Open the data object with one line
oDbf := tdata():new(, "cust" )[/quote:2hlkp5et]
Actually, I don't recommend the above. You should have a class for each database. It can be as simple as this:
[code=fw:2hlkp5et]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Class</span> TCustomers<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Endclass</span><br /><br /><span style="color: #00C800;">Method</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span> lShared <span style="color: #000000;">)</span> <span style="color: #00C800;">Class</span> TCustomers<br /> <span style="color: #00C800;">Default</span> lShared := .T.<br /> ::<span style="color: #00C800;">super</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span>,<span style="color: #ff0000;">"cust"</span>,,lShared<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">use</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">SetOrder</span><span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// primary key</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Self</span><br /> </div>[/code:2hlkp5et]
You can even make the above smaller, but I won't get into this right now.
Also, I would never name the database object "oDBF"--that doesn't tell you much. More on this below.
[b:2hlkp5et]Write Each Piece of Code Only Once[/b:2hlkp5et]
You should try to write each piece of code only once. So, now all the basic code to open a file is in one place. You can change the DBF filename by changing it in only once place. You can change the order of the primary-key in only one place. You could even change the type of database in only one place.
The most important reason is so that later when you want to add methods to the class, you already have a basic class to add them to. This prevents you from having to go through all your code later to change the syntax that creates the database object.
I also strongly advocate using a plural name for databases, so you can use a single name for records (e.g. oCustomers and oCustomer).
So now you can do:
[code=fw:2hlkp5et]<div class="fw" id="{CB}" style="font-family: monospace;">oCustomers:= TCustomers<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oCustomers:<span style="color: #00C800;">Print</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oCustomers:<span style="color: #000000;">CountPastDue</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />oCustomer:= TCustomer<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oCustomers <span style="color: #000000;">)</span><br />oCustomer:<span style="color: #00C800;">Print</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oCustoemr:<span style="color: #000000;">BalanceDue</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oCustomer:<span style="color: #000000;">isLate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />oCustomer:<span style="color: #000000;">Phone</span> := <span style="color: #ff0000;">"619-889-7786"</span><br />oCustomer:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:2hlkp5et]
By using the name of the real-world object that the code object represents, the code is self-documenting. It becomes very easy to read and understand. |
trying with tdatabase | [quote:2x4tzvmh]IF oServiziSingoli: EOF ()
cNewId: = strzero (oServiziSingoli: RecNo (), 4)
ELSE
cNewId: = strzero ((VAL (oServiziSingoli: ID) +1), 4)
ENDIF
if james erase this step how calculate the new id ?[/quote:2x4tzvmh]
You don't need that code if you are using my TAutoincrement class or the autoincrement fieldtype "+".
And the less code you have to write, the better. Less chance of errors, faster, and easier to read. If you use one of the above, you don't have to write any code to get auto-incrementing primary-key values. |
trying with tdatabase | James,
You know I agree with you on both points, and that is exactly what I do within my programs.
HOWEVER, I wanted to point out to Silvio just how simple this can be, so I used a VERY generic example.
Tim |
trying with tdatabase | Tim,
I figured you did. However, that was a good opening for explaining it for everyone else who is following this thread. And I had just written most of it two days ago for someone else.
Thanks for the opening.
James |
trying with tdatabase | [quote="James Bott":2jgez3cz][quote:2jgez3cz]IF oServiziSingoli: EOF ()
cNewId: = strzero (oServiziSingoli: RecNo (), 4)
ELSE
cNewId: = strzero ((VAL (oServiziSingoli: ID) +1), 4)
ENDIF
if james erase this step how calculate the new id ?[/quote:2jgez3cz]
You don't need that code if you are using my TAutoincrement class or the autoincrement fieldtype "+".
And the less code you have to write, the better. Less chance of errors, faster, and easier to read. If you use one of the above, you don't have to write any code to get auto-incrementing primary-key values.[/quote:2jgez3cz]
[b:2jgez3cz]James NOT RUN TAUTOINCREMENTAL I NOT SEE SYSFILE:DBF[/b:2jgez3cz]
WHERE IS the FILE Sysfile.dbf you se eit ? where
[img:2jgez3cz]https://i.postimg.cc/L6KGd5vm/gggg.png[/img:2jgez3cz] |
tsBrowse y Harbour | Alguien tiene la librería tsbrowse compilada para las últimas versiones de Harbour?
O Alguien sabe como compilarla? |
tsBrowse y Harbour | Si tenés las fuentes lo compilarias como cualquier prg. Yo antes lo utilizaba y lo compilaba con el resto de mis fuentes.
Saludos |
tsBrowse y Harbour | Eso ya lo he intentado y al compilar los .c aparecen muchiiiisimos errores.
Buscando en el foro he visto que mas gente le ha pasado.
Alguno ha conseguido solucionarlo? |
tsBrowse y Harbour | Fernando, Yo tengo la TsBrowse 8 original con los proyectos verce listos para que cambies las rutas y la compiles con la version de Harbour o xHarbour que gustes, Yo tengo xHarbour por eso no te ofrezco la LIB pero los fuentes te sirven y los compilas con cada version nueva que tengas de Harbour - FWH, dame un mail donde enviartela |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.