topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Comments and requests about TWBrowse | Enrico,
Sorry, your lockwindowupdate() idea doesn't prevent the repainting. See sample code below. Press the lock button then move the custor over the browse and you will hear lots of beeps.
[quote:10ov1eia]Sorry, but you didn't report any concrete problem so far. Can we see a reduced and self-contained sample still showing it?[/quote:10ov1eia]
The problem is the slow repainting. The reduced and self-contained example is below.
Regards,
James
[code=fw:10ov1eia]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Test disabled TWBrowse for painting while disabled.</span><br /><span style="color: #B900B9;">// Use with FWH\samples\customer.dbf file</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oLbx, oBar<br /><br /> ferase<span style="color: #000000;">(</span><span style="color: #ff0000;">"test02.log"</span><span style="color: #000000;">)</span><br /><br /> use customer<br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Test Browse"</span><br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">buttonbar</span> oBar <span style="color: #0000ff;">of</span> oWnd<br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> oLbx:<span style="color: #000000;">disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> oLbx:<span style="color: #000000;">enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> writeFile<span style="color: #000000;">(</span><span style="color: #ff0000;">"test02.log"</span>,<span style="color: #ff0000;">"-----------"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> LOCKWINDOWUPDATE<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> LOCKWINDOWUPDATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">listbox</span> oLbx fields first, last;<br /> <span style="color: #0000ff;">alias</span> <span style="color: #ff0000;">"customer"</span>;<br /> <span style="color: #0000ff;">of</span> oWnd<br /><br /> oLbx:<span style="color: #000000;">bSkip</span>:= <span style="color: #000000;">{</span>|nRecs| <span style="color: #000000;">(</span>msgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #0000ff;">sleep</span><span style="color: #000000;">(</span>.<span style="color: #000000;">1</span><span style="color: #000000;">)</span>,sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,customer-><span style="color: #000000;">(</span>dbskipper<span style="color: #000000;">(</span> nRecs<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// oLbx:bSkip:= {|nRecs| (logfile("test02.log",{trim(str(recno()))}),customer->(dbskipper( nRecs)) ) }</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span>:= oLbx<br /><br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #B900B9;">//on init oLbx:disable()</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:10ov1eia] |
Comments and requests about TWBrowse | Enrico, James,
I put this line of code in a my application
oBrw:bSkip:= {|nRecs| ( logfile( "eventi.txt" , { oBrw:nRowCount() , recno() } ), tabella->(dbskipper( nRecs)) ) }
tabella.dbf has 11400 records it's about 9 MB
tabella.cdx has 20 TAG inside it's about 1,5 MB
In eventi.txt file I found this
158 skipped records Vs only 38 rows of my twbrowse
22/07/2010 09:54:05: 38 11425
22/07/2010 09:54:05: 38 11354
22/07/2010 09:54:05: 38 11355
22/07/2010 09:54:05: 38 11359
22/07/2010 09:54:05: 38 11360
22/07/2010 09:54:05: 38 11361
22/07/2010 09:54:05: 38 11362
22/07/2010 09:54:05: 38 11363
22/07/2010 09:54:05: 38 11364
22/07/2010 09:54:05: 38 11366
22/07/2010 09:54:05: 38 11369
22/07/2010 09:54:05: 38 11371
22/07/2010 09:54:05: 38 11372
22/07/2010 09:54:05: 38 11376
22/07/2010 09:54:05: 38 11377
22/07/2010 09:54:05: 38 11380
22/07/2010 09:54:05: 38 11381
22/07/2010 09:54:05: 38 11382
22/07/2010 09:54:05: 38 11383
22/07/2010 09:54:05: 38 11385
22/07/2010 09:54:05: 38 11386
22/07/2010 09:54:05: 38 11387
22/07/2010 09:54:05: 38 11390
22/07/2010 09:54:05: 38 11391
22/07/2010 09:54:05: 38 11392
22/07/2010 09:54:05: 38 11395
22/07/2010 09:54:05: 38 11398
22/07/2010 09:54:05: 38 11401
22/07/2010 09:54:05: 38 11404
22/07/2010 09:54:05: 38 11405
22/07/2010 09:54:05: 38 11407
22/07/2010 09:54:05: 38 11415
22/07/2010 09:54:05: 38 11416
22/07/2010 09:54:05: 38 11418
22/07/2010 09:54:05: 38 11419
22/07/2010 09:54:05: 38 11420
22/07/2010 09:54:05: 38 11422
22/07/2010 09:54:05: 38 11423
22/07/2010 09:54:05: 38 11425
22/07/2010 09:54:05: 38 11354
22/07/2010 09:54:05: 38 11355
22/07/2010 09:54:05: 38 11359
22/07/2010 09:54:05: 38 11360
22/07/2010 09:54:05: 38 11361
22/07/2010 09:54:05: 38 11362
22/07/2010 09:54:05: 38 11363
22/07/2010 09:54:05: 38 11364
22/07/2010 09:54:05: 38 11366
22/07/2010 09:54:05: 38 11369
22/07/2010 09:54:05: 38 11371
22/07/2010 09:54:05: 38 11372
22/07/2010 09:54:05: 38 11376
22/07/2010 09:54:05: 38 11377
22/07/2010 09:54:05: 38 11380
22/07/2010 09:54:05: 38 11381
22/07/2010 09:54:05: 38 11382
22/07/2010 09:54:05: 38 11383
22/07/2010 09:54:05: 38 11385
22/07/2010 09:54:05: 38 11386
22/07/2010 09:54:05: 38 11387
22/07/2010 09:54:06: 38 11390
22/07/2010 09:54:06: 38 11391
22/07/2010 09:54:06: 38 11392
22/07/2010 09:54:06: 38 11395
22/07/2010 09:54:06: 38 11398
22/07/2010 09:54:06: 38 11401
22/07/2010 09:54:06: 38 11404
22/07/2010 09:54:06: 38 11405
22/07/2010 09:54:06: 38 11407
22/07/2010 09:54:06: 38 11415
22/07/2010 09:54:06: 38 11416
22/07/2010 09:54:06: 38 11418
22/07/2010 09:54:06: 38 11419
22/07/2010 09:54:06: 38 11420
22/07/2010 09:54:06: 38 11422
22/07/2010 09:54:06: 38 11423
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11354
22/07/2010 09:54:06: 38 11355
22/07/2010 09:54:06: 38 11359
22/07/2010 09:54:06: 38 11360
22/07/2010 09:54:06: 38 11361
22/07/2010 09:54:06: 38 11362
22/07/2010 09:54:06: 38 11363
22/07/2010 09:54:06: 38 11364
22/07/2010 09:54:06: 38 11366
22/07/2010 09:54:06: 38 11369
22/07/2010 09:54:06: 38 11371
22/07/2010 09:54:06: 38 11372
22/07/2010 09:54:06: 38 11376
22/07/2010 09:54:06: 38 11377
22/07/2010 09:54:06: 38 11380
22/07/2010 09:54:06: 38 11381
22/07/2010 09:54:06: 38 11382
22/07/2010 09:54:06: 38 11383
22/07/2010 09:54:06: 38 11385
22/07/2010 09:54:06: 38 11386
22/07/2010 09:54:06: 38 11387
22/07/2010 09:54:06: 38 11390
22/07/2010 09:54:06: 38 11391
22/07/2010 09:54:06: 38 11392
22/07/2010 09:54:06: 38 11395
22/07/2010 09:54:06: 38 11398
22/07/2010 09:54:06: 38 11401
22/07/2010 09:54:06: 38 11404
22/07/2010 09:54:06: 38 11405
22/07/2010 09:54:06: 38 11407
22/07/2010 09:54:06: 38 11415
22/07/2010 09:54:06: 38 11416
22/07/2010 09:54:06: 38 11418
22/07/2010 09:54:06: 38 11419
22/07/2010 09:54:06: 38 11420
22/07/2010 09:54:06: 38 11422
22/07/2010 09:54:06: 38 11423
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:10: 38 11425
22/07/2010 09:54:10: 38 11354
22/07/2010 09:54:10: 38 11355
22/07/2010 09:54:10: 38 11359
22/07/2010 09:54:10: 38 11360
22/07/2010 09:54:10: 38 11361
22/07/2010 09:54:10: 38 11362
22/07/2010 09:54:10: 38 11363
22/07/2010 09:54:10: 38 11364
22/07/2010 09:54:10: 38 11366
22/07/2010 09:54:10: 38 11369
22/07/2010 09:54:10: 38 11371
22/07/2010 09:54:10: 38 11372
22/07/2010 09:54:10: 38 11376
22/07/2010 09:54:10: 38 11377
22/07/2010 09:54:10: 38 11380
22/07/2010 09:54:10: 38 11381
22/07/2010 09:54:10: 38 11382
22/07/2010 09:54:10: 38 11383
22/07/2010 09:54:10: 38 11385
22/07/2010 09:54:10: 38 11386
22/07/2010 09:54:10: 38 11387
22/07/2010 09:54:10: 38 11390
22/07/2010 09:54:10: 38 11391
22/07/2010 09:54:10: 38 11392
22/07/2010 09:54:10: 38 11395
22/07/2010 09:54:10: 38 11398
22/07/2010 09:54:10: 38 11401
22/07/2010 09:54:10: 38 11404
22/07/2010 09:54:10: 38 11405
22/07/2010 09:54:10: 38 11407
22/07/2010 09:54:10: 38 11415
22/07/2010 09:54:10: 38 11416
22/07/2010 09:54:10: 38 11418
22/07/2010 09:54:10: 38 11419
22/07/2010 09:54:10: 38 11420
22/07/2010 09:54:10: 38 11422
22/07/2010 09:54:10: 38 11423
22/07/2010 09:54:10: 38 11425
22/07/2010 09:54:10: 38 11425
then I reduced my dialog and ...
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11422
22/07/2010 09:58:08: 8 11423
22/07/2010 09:58:08: 8 11425
22/07/2010 09:58:08: 8 11429
22/07/2010 09:58:08: 8 11430
22/07/2010 09:58:08: 8 11432
22/07/2010 09:58:08: 8 11434
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11422
22/07/2010 09:58:08: 8 11423
22/07/2010 09:58:08: 8 11425
22/07/2010 09:58:08: 8 11429
22/07/2010 09:58:08: 8 11430
22/07/2010 09:58:08: 8 11432
22/07/2010 09:58:08: 8 11434
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:17: 8 11435
22/07/2010 09:58:17: 8 11422
22/07/2010 09:58:17: 8 11423
22/07/2010 09:58:17: 8 11425
22/07/2010 09:58:17: 8 11429
22/07/2010 09:58:17: 8 11430
22/07/2010 09:58:17: 8 11432
22/07/2010 09:58:17: 8 11434
22/07/2010 09:58:17: 8 11435
22/07/2010 09:58:17: 8 11435
29 skipped records Vs only 8 rowse on the screen
is it normal? |
Comments and requests about TWBrowse | [quote="James Bott":3fcchafx]The problem is the slow repainting. The reduced and self-contained example is below.[/quote:3fcchafx]
Sorry James, but your sample doesn't show anything useful. I can hear a single beep when leaving the window, and that's all. I need a sample of the real problem.
EMG |
Comments and requests about TWBrowse | [quote="MarcoBoschi":37jqt5cu]29 skipped records Vs only 8 rowse on the screen
is it normal?[/quote:37jqt5cu]
Can I see a real sample of the problem?
EMG |
Comments and requests about TWBrowse | Enrico,
here below there is the sample of James modified.
I write with logfile function, I remove beep.
It 'obvious that all is well with the table customer ther are no problems.
With another table I see differences between
oLbx:nRowCount() and lines written into events.txt log file
// Test disabled TWBrowse for painting while disabled.
#include "fivewin.ch"
ANNOUNCE RDDSYS
function main()
local oWnd, oLbx, oBar
local lSound := .F.
use customer
SET INDEX TO customer
define window oWnd title "Test Browse"
define buttonbar oBar of oWnd
@ 0 , 0 listbox oLbx fields of oWnd
oLbx:bSkip:= {|nRecs| ( logfile( "events.txt" , { oLbx:nRowCount() , recno() } ), customer->(dbskipper( nRecs)) ) }
oWnd:oClient:= oLbx
activate window oWnd
return nil
INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" ) |
Comments and requests about TWBrowse | I found this inside events.txt:
07/22/10 14:38:37: 14 1
07/22/10 14:38:37: 14 1
07/22/10 14:38:37: 14 2
07/22/10 14:38:37: 14 3
07/22/10 14:38:37: 14 4
07/22/10 14:38:37: 14 5
07/22/10 14:38:37: 14 6
07/22/10 14:38:37: 14 7
07/22/10 14:38:37: 14 8
07/22/10 14:38:37: 14 9
07/22/10 14:38:37: 14 10
07/22/10 14:38:37: 14 11
07/22/10 14:38:37: 14 12
07/22/10 14:38:37: 14 13
07/22/10 14:38:37: 14 14
07/22/10 14:38:37: 14 15
that is looking fine to me. Anyway, I don't know why you are using bSkip codeblock that has nothing to do with browse refresh.
EMG |
Comments and requests about TWBrowse | Enrico,
let's start from beginning
Compile and run this little sample program.
drag another little window over the window of this program
You have to note that refresh or repaint ( you understand me ) is slow
Is much slower if you work online and with a larger table or with more table with relationship between them.
#include "fivewin.ch"
function main()
local oWnd, oLbx
use customer
define window oWnd title "Test Browse"
@ 0 , 0 listbox oLbx fields alias "customer" of oWnd
oWnd:oClient:= oLbx
activate window oWnd
return nil
last but not least, please compile this program too.
#include "fivewin.ch"
#include "xbrowse.ch"
ANNOUNCE RDDSYS
FUNCTION MAIN()
LOCAL oWnd
LOCAL oBrw
LOCAL aRec := {}
LOCAL nIni
LOCAL nRig
LOCAL nFin
LOCAL nCur := 1
SET DELETED ON
SET EXCLUSIVE OFF
USE customer
SET INDEX TO customer
nRig := 20
nIni := 1
nFin := 1
aRec := myload( nIni )
DEFINE WINDOW oWnd
@ 0, 0 XBROWSE oBrw OF oWnd ARRAY aRec AUTOCOLS SIZE 500 , 500
oBrw:CreateFromCode()
oWnd:oClient:= oBrw
ACTIVATE WINDOW oWnd MAXIMIZED
RETURN NIL
FUNCTION MYLOAD( nIni )
LOCAL nR, nF
LOCAL aArray := {}
LOCAL aRecord := {}
FOR nR := nIni TO nIni + 30
aRecord := {}
FOR nF := 1 TO fcount()
AADD( aRecord , fieldget( nF ) )
NEXT i
AADD( aArray , aRecord )
SKIP
NEXT nR
RETURN aArray
INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
It should load some records into an array and here too there is a slow repaint.
If a compare with Excel I see much difference
Now I search other applications with similar cells view and then I will know you if only excel is fast or if only ours programs are slow
have a nice day
marco |
Comments and requests about TWBrowse | [quote="MarcoBoschi":2rt096t0]Enrico,
let's start from beginning
Compile and run this little sample program.
drag another little window over the window of this program
You have to note that refresh or repaint ( you understand me ) is slow
Is much slower if you work online and with a larger table or with more table with relationship between them.
[/quote:2rt096t0]
I just tested your sample on my wireless lan using a 84 MB DBF (50000 records) without noticed any refreshing slowness, sorry.
EMG |
Comments and requests about TWBrowse | Enrico,
Seeing is believing...
take a look at
[url:2kb36pj8]http://www.marcoboschi.it/public/fivewin.avi[/url:2kb36pj8] |
Comments and requests about TWBrowse | I'm not saying that you don't have a problem. I'm only saying that your sample doesn't show it here. I see that you are using a different sample. Can I try with the exact sample are you using? I cannot help you if I cannot see the problem here.
EMG |
Comments and requests about TWBrowse | ...and this is with excel
[url:2vtmbub3]http://www.marcoboschi.it/public/excel.avi[/url:2vtmbub3] |
Comments and requests about TWBrowse | #include "fivewin.ch"
function main()
local oWnd, oLbx
SET DELETED ON
SET EXCLUSIVE OFF
use customer
define window oWnd title "Test Browse"
@ 0 , 0 listbox oLbx fields alias "customer" of oWnd
oWnd:oClient:= oLbx
activate window oWnd MAXIMIZED
return nil |
Comments and requests about TWBrowse | Ok, now I can see the problem. But please test this new sample:
[code=fw:210lx8u3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><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, oBrw<br /><br /> USE CUSTOMER<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /><br /> @ <span style="color: #000000;">0</span> , <span style="color: #000000;">0</span> <span style="color: #0000ff;">LISTBOX</span> oBrw FIELDS<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> oDlg:<span style="color: #000000;">Maximize</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> oDlg:<span style="color: #000000;">SetControl</span><span style="color: #000000;">(</span> oBrw <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #0000ff;">CENTER</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:210lx8u3]
It doesn't show any refreshing slowness here. So the problem is not the browse at all.
EMG |
Comments and requests about TWBrowse | Enrico,
I've tested your last sample.
Slowness is less evident.
I propose to slightly modify your program to make it more like a real work situation.
I don't believe that in your network you have good performance again.
I'm not talking about a failure.
I want to know if is it possible to rearrange this excellent class to obtain better performance with a drastically reduce of traffic on network.
Problems perhaps are elsewhere.
I'm comparing software for viewing picture written by myself and other famous applications
even in this case there is a little difference in refresh rate
good evening
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw, i
ANNOUNCE RDDSYS
SET DELETED ON
SET EXCLUSIVE OFF
USE CUSTOMER EXCLUSIVE
COPY TO custtemp
FOR i := 1 TO 1000
APPEND FROM custtemp
NEXT i
INDEX ON field->first TAG first TO customer
INDEX ON field->last TAG last TO customer
INDEX ON field->city TAG city TO customer
INDEX ON field->state TAG state TO customer
INDEX ON field->zip TAG zip TO customer
USE
USE customer SHARED
SET INDEX TO customer
DEFINE DIALOG oDlg
@ 0 , 0 LISTBOX oBrw FIELDS
ACTIVATE DIALOG oDlg;
ON INIT ( oDlg:Maximize(),;
oDlg:SetControl( oBrw ) );
CENTER
RETURN NIL
INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" ) |
Comments and requests about TWBrowse | Ok, the difference seems to be the SHARED clause, that is expected. With SHARED clause I can see the slow refresh even without indexes. I don't know if TWBrowse can be improved but the major benefit would be in improving DBF's shared access speed, if it were possible.
EMG |
Comments and requests about TWBrowse | Ok Enrico
Thanks |
Comments and requests about TWBrowse | OK, Enrico, here is a better example. I have really slowed down the screen painting with a delay and you can watch it repaint one step at a time after you move another window over it. You also hear all the beeps. A log file will be written that shows all the records read during the repainting. And you can disable() or LockWindowUpdate() the control and test it that way too.
You will also see evidence that bSkip does have something to do with refreshing a browse.
James
[code=fw:3sr2ufkj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Test disabled TWBrowse for painting while disabled.</span><br /><span style="color: #B900B9;">// Use with FWH\samples\customer.dbf file</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oLbx, oBar<br /><br /> ferase<span style="color: #000000;">(</span><span style="color: #ff0000;">"test02.log"</span><span style="color: #000000;">)</span><br /><br /> use customer<br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Test Browse"</span><br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">buttonbar</span> oBar <span style="color: #0000ff;">of</span> oWnd<br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> oLbx:<span style="color: #000000;">disable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> oLbx:<span style="color: #000000;">enable</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> writeFile<span style="color: #000000;">(</span><span style="color: #ff0000;">"test02.log"</span>,<span style="color: #ff0000;">"-----------"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> LOCKWINDOWUPDATE<span style="color: #000000;">(</span> oLbx:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> LOCKWINDOWUPDATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">listbox</span> oLbx fields first, last;<br /> <span style="color: #0000ff;">alias</span> <span style="color: #ff0000;">"customer"</span>;<br /> <span style="color: #0000ff;">of</span> oWnd<br /><br /> oLbx:<span style="color: #000000;">bSkip</span>:= <span style="color: #000000;">{</span>|nRecs| <span style="color: #000000;">(</span> msgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #0000ff;">sleep</span><span style="color: #000000;">(</span><span style="color: #000000;">100</span><span style="color: #000000;">)</span>,sysrefresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,logfile<span style="color: #000000;">(</span> <span style="color: #ff0000;">"test02.log"</span> , ;<br /> <span style="color: #000000;">{</span> recno<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span>, customer-><span style="color: #000000;">(</span>dbskipper<span style="color: #000000;">(</span> nRecs<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span>:= oLbx<br /><br /> <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3sr2ufkj] |
Comments and requests about TWBrowse | Enrico,
[quote:bugxsg46]I don't know if TWBrowse can be improved but the major benefit would be in improving DBF's shared access speed, if it were possible.[/quote:bugxsg46]
Here is a possible solution. In the LostFocus() method, copy all visible records into a buffer array. Then during refresh if the control does not have focus() then repaint using the array, otherwise repaint by reading records from the source.
When the control gets focus, reset the lHasFocus variable to .t.
[code=fw:bugxsg46]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Method</span> LostFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lHasFocus</span>:=.f.<br /> <span style="color: #B900B9;">// copy visible records to buffer array</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />Methd GotFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lHasFocus</span>:=.t.<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Method</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ...<br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lHasFocus</span><br /> <span style="color: #B900B9;">// paint using records</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #B900B9;">// paint using buffer array</span><br /> <span style="color: #00C800;">endif</span><br /> ...<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:bugxsg46]
Regards,
James |
Comments and requests about TWBrowse | Enrico,
James's suggestion is very very interesting.
Thanks |
Comments and requests about TWBrowse | [quote:211ivnmb]Here is a possible solution. In the LostFocus() method, copy all visible records into a buffer array. Then during refresh if the control does not have focus() then repaint using the array, otherwise repaint by reading records from the source.
When the control gets focus, reset the lHasFocus variable to .t.
[/quote:211ivnmb]
This is what I proposed for xbrowse in the derived class posted in page.1. Instead of copying to array and painting from array, I saved the browse screen to bitmap and restored while painting. When the browse gets focus, it is painted normally. This is even faster than saving into array and painting from array. |
Comments and requests about TWBrowse | Excuse me,
in these days I'm under pressure.
I've forgot to tell you that I tested your samples
It's a valid solution except for a little visual effect
There is a little flickering in your sample and in this (rewritten by me) there are
other problems that I am not able to resolve.
This is the only one working solution at the moment.
In my opinion to load into an array only visible cells would be a first step to improve browsing classes
#include "fivewin.ch"
#xtranslate DelObj <o> => If <o> != nil; DeleteObject( <o> ); endif; <o> := nil
REQUEST HB_GT_GUI_DEFAULT
ANNOUNCE RDDSYS
FUNCTION MAIN()
LOCAL oDlg
LOCAL oBrw
LOCAL aRec := {}
LOCAL nIni
LOCAL nRig
LOCAL nFin
LOCAL nCur := 1
SET DELETED ON
SET EXCLUSIVE OFF
USE customer
SET INDEX TO customer
nRig := 20
nIni := 1
nFin := 1
DEFINE DIALOG oDlg RESOURCE "DIALOGO"
oBrw := TXBR3():Redefine( 101, , oDlg )
ACTIVATE DIALOG oDlg
RETURN NIL
CLASS TXBR3 FROM TWBROWSE
CLASSDATA lRegistered AS LOGICAL // used internally
DATA hSaveScr
METHOD Paint()
METHOD Destroy()
ENDCLASS
METHOD Paint() CLASS TXBR3
local aInfo
if ::hSaveScr != nil .and. GetFocus() != ::hWnd
aInfo := ::DispBegin()
DrawBitmap( ::hDC, ::hSaveScr, 0, 0 )
::DispEnd( aInfo )
else
Super:Paint()
DelObj ::hSaveScr
::hSaveScr := WndBitMap( ::hWnd )
endif
return nil
METHOD Destroy() CLASS TXBR3
DelObj ::hSaveScr
return Super:Destroy()
INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" ) |
Comments and requests about TWBrowse | Marco,
[quote:3v0cq52y]There is a little flickering in your sample and in this (rewritten by me) there are other problems that I am not able to resolve.[/quote:3v0cq52y]
What other problems are you having?
James |
Comments and requests about TWBrowse | [code=fw:sikb290k]<div class="fw" id="{CB}" style="font-family: monospace;">There is a little flickering in your sample</div>[/code:sikb290k]
I knew this and also I thought this could be fixed. If in principle, this is taking us in the right direction avoiding re-reading data from source atleast when repainting in non-focused state, then we can proceed further to improve this.
Saving and restoring the bitmap is painting the saved image one pixel off from the original position. This can be fixed. |
Comments and requests about TWBrowse | This solution in my opinion is good:
[code=fw:1hgr6lyg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'xbrowse.ch'</span><br /><br />#xtranslate DelObj <o> => <span style="color: #00C800;">If</span> <o> != <span style="color: #00C800;">nil</span>; DeleteObject<span style="color: #000000;">(</span> <o> <span style="color: #000000;">)</span>; <span style="color: #00C800;">endif</span>; <o> := <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">CLASS</span> TXBR3 <span style="color: #0000ff;">FROM</span> TXBROWSE<br /><br /> CLASSDATA lRegistered AS LOGICAL <span style="color: #B900B9;">// used internally</span><br /><br /> <span style="color: #00C800;">DATA</span> hSaveScr<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Destroy<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: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBR3<br /><br /> <span style="color: #00C800;">local</span> aInfo<br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">hSaveScr</span> != <span style="color: #00C800;">nil</span> .and. GetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> != ::<span style="color: #000000;">hWnd</span><br /> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DrawBitmap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hSaveScr</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">Super</span>:<span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DelObj ::<span style="color: #000000;">hSaveScr</span><br /> ::<span style="color: #000000;">hSaveScr</span> := WndBitMap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBR3<br /><br /> DelObj ::<span style="color: #000000;">hSaveScr</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Destroy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:1hgr6lyg]
The question is:
Since in a dialog I have other obiects... is it possible in Paint method to check Focus of entire dialog instead of TWBROWSE object?
King Regards |
Comments and requests about TWBrowse | up |
Comments and requests about TWBrowse | Marco,
[quote:3krb51or]Since in a dialog I have other obiects... is it possible in Paint method to check Focus of entire dialog instead of TWBROWSE object?[/quote:3krb51or]
Do you mean this ?
if ::hSaveScr != nil .and. GetFocus() != ::oWnd:hWnd // it was ::hWnd |
Comments and requests about TWBrowse | Yes Dear Friend.
Perhaps even refer to the application itself!
Is it possible?
Marco |
Comments and requests about TWBrowse | [size=150:1krrjwsy]Saving and restoring the bitmap is painting the saved image one pixel off from the original position. This can be fixed[/size:1krrjwsy]
Excuse me but this small problem has been resolved? |
Comments and requests about TWBrowse | Marco,
If you are using a shared DBF and if another user changes a record, you will not see his changes using this technique |
Comments and requests about TWBrowse | Antonio,
I know.
The solution of nage is very very good in my opinion.
A Bitmap instead of rows
There is a little shit from bmp image and real image
There are some programs for indivual use and that operate in static tables
bye |
Comments and requests about TWBrowse | [quote:2exxl4qs]
I knew this and also I thought this could be fixed. If in principle, this is taking us in the right direction avoiding re-reading data from source atleast when repainting in non-focused state, then we can proceed further to improve this.
Saving and restoring the bitmap is painting the saved image one pixel off from the original position. This can be fixed.
[/quote:2exxl4qs]
Hi Nage,
excuse me for my insistence.
I don't understand if this little problem has to be fixed by you developers or directly by a "bravo" programmer (obviously not me)
Have a nice day
marco |
Comments and requests about TWBrowse | Marco,
Try with different values from zero here:
DrawBitmap( ::hDC, ::hSaveScr, 1, 0 ) |
Comments and requests about TWBrowse | Antonio,
perhaps negative numbers?
Bye
marco |
Comments and requests about TWBrowse | Yes, try it |
Comments and requests about TWBrowse | <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Antonio,
unfortunately does not work.
bye |
Comments and requests about TWBrowse | Marco,
In FWH/source/winapi/bmpdraw.c DrawBitmap() is defined as:
void DrawBitmap( HDC hdc, HBITMAP hbm, WORD wCol, WORD wRow, WORD wWidth,
WORD wHeight, DWORD dwRaster )
please change it as:
void DrawBitmap( HDC hdc, HBITMAP hbm, int wCol, int wRow, WORD wWidth,
WORD wHeight, DWORD dwRaster )
recompile it and link it as another OBJ of your app |
Comments and requests about TWBrowse | Antonio,
Now I am satisfied!
No more slowness in repainting <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->
And no more <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> unnecessary network traffic |
Comments and requests about TWBrowse | Marco,
Very good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Please copy here your final code for wbrowse max speed, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Comments and requests about TWBrowse | Antonio,
when this application is in bacground if I move dialogs of other programs in the desktop
If a repaint is needed is faster.
It is obviuos that you have to try this code with a large table with open index, perhaps with many relations to appreciate the difference between a dialog with this device and not the "usual" customer.dbf in the local disk.
Is not only a a visual issue.
If you observe Activity Status Packets Send and receive on Local area network Status,
You can note that no packets pass through the network If this application is in Background state.
Many thanks to Nage for this solution and to other experts
King regards
marco
[code=fw:1yvm4wsw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />#xtranslate DelObj <o> => <span style="color: #00C800;">If</span> <o> != <span style="color: #00C800;">nil</span>; DeleteObject<span style="color: #000000;">(</span> <o> <span style="color: #000000;">)</span>; <span style="color: #00C800;">endif</span>; <o> := <span style="color: #00C800;">nil</span><br /><br />REQUEST HB_GT_GUI_DEFAULT<br /><br />ANNOUNCE RDDSYS<br /><br /><span style="color: #00C800;">STATIC</span> oDlg<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> oBrw<br /><span style="color: #00C800;">LOCAL</span> oGet , cGet := <span style="color: #ff0000;">" "</span><br /><span style="color: #00C800;">LOCAL</span> aRec := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><br /><span style="color: #00C800;">LOCAL</span> nIni<br /><span style="color: #00C800;">LOCAL</span> nRig<br /><span style="color: #00C800;">LOCAL</span> nFin<br /><span style="color: #00C800;">LOCAL</span> nCur := <span style="color: #000000;">1</span><br /><br />SET DELETED <span style="color: #0000ff;">ON</span><br />SET EXCLUSIVE OFF<br />USE customer<br />SET <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">TO</span> customer<br /><br />nRig := <span style="color: #000000;">20</span><br />nIni := <span style="color: #000000;">1</span><br />nFin := <span style="color: #000000;">1</span><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span> , <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">600</span> , <span style="color: #000000;">800</span> <span style="color: #0000ff;">PIXEL</span><br /><br /><br /> @ <span style="color: #000000;">1</span> , <span style="color: #000000;">1</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cGet <span style="color: #0000ff;">OF</span> oDlg<br /> oBrw := TXBR3<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;">2</span> , <span style="color: #000000;">1</span> , <span style="color: #000000;">800</span> , <span style="color: #000000;">600</span> <span style="color: #000000;">)</span><br /> oDlg:<span style="color: #000000;">nStyle</span> = NOR<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">nStyle</span>, WS_THICKFRAME, WS_MAXIMIZEBOX , WS_MINIMIZEBOX <span style="color: #000000;">)</span><br /> oDlg:<span style="color: #000000;">bResized</span> = <span style="color: #000000;">{</span> || Ridim<span style="color: #000000;">(</span> oDlg, oBrw <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;">ON</span> <span style="color: #0000ff;">INIT</span> ridim<span style="color: #000000;">(</span> oDlg , obrw <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> RIDIM<span style="color: #000000;">(</span> oDlg, oBrw <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> aInfo := oDlg:<span style="color: #000000;">DispBegin</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">nWidth</span> = oDlg:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">20</span><br /> oBrw:<span style="color: #000000;">nHeight</span> = oDlg:<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">120</span><br /> oDlg:<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">lForcepaint</span> := .T.<br /> oBrw:<span style="color: #0000ff;">Paint</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 /><br /><br /><br /><span style="color: #00C800;">CLASS</span> TXBR3 <span style="color: #0000ff;">FROM</span> TWBROWSE<br /><br /> CLASSDATA lRegistered AS LOGICAL <span style="color: #B900B9;">// used internally</span><br /><br /> <span style="color: #00C800;">DATA</span> hSaveScr<br /> <span style="color: #00C800;">DATA</span> lForcePaint<br /><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> Destroy<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: #0000ff;">PAINT</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBR3<br /><br /> <span style="color: #00C800;">LOCAL</span> aInfo<br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">lForcePaint</span><br /> DelObj ::<span style="color: #000000;">hSaveScr</span><br /> <span style="color: #00C800;">Super</span>:<span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">lForcePaint</span> := .F.<br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">hSaveScr</span> != <span style="color: #00C800;">nil</span> .and. GetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> != ::<span style="color: #000000;">hWnd</span><br /> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DrawBitmap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hDC</span>, ::<span style="color: #000000;">hSaveScr</span>, <span style="color: #000000;">-2</span>, <span style="color: #000000;">-2</span> <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">DispEnd</span><span style="color: #000000;">(</span> aInfo <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">Super</span>:<span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> DelObj ::<span style="color: #000000;">hSaveScr</span><br /> ::<span style="color: #000000;">hSaveScr</span> := WndBitMap<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">METHOD</span> Destroy<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBR3<br /><br /> DelObj ::<span style="color: #000000;">hSaveScr</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">Destroy</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><br /><br /><span style="color: #0000ff;">INIT</span> PROCEDURE RddInit<br />REQUEST DBFFPT<br />REQUEST DBFCDX<br />rddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /><br /><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><br />void DrawBitmap<span style="color: #000000;">(</span> HDC hdc, HBITMAP hbm, int wCol, int wRow, WORD wWidth,<br /> WORD wHeight, DWORD dwRaster <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC hDcMem, hDcMemX;<br /> BITMAP bm, bmx;<br /> HBITMAP hBmpOld, hbmx, hBmpOldX;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !hdc || !hbm <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span>;<br /><br /> hDcMem = CreateCompatibleDC<span style="color: #000000;">(</span> hdc <span style="color: #000000;">)</span>;<br /> hBmpOld = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> hDcMem, hbm <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ! dwRaster <span style="color: #000000;">)</span><br /> dwRaster = SRCCOPY;<br /><br /> GetObject<span style="color: #000000;">(</span> hbm, sizeof<span style="color: #000000;">(</span> BITMAP <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> LPSTR <span style="color: #000000;">)</span> &bm <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> ! wWidth || ! wHeight <span style="color: #000000;">)</span><br /> BitBlt<span style="color: #000000;">(</span> hdc, wRow, wCol, bm.bmWidth, bm.bmHeight, hDcMem, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, dwRaster <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> hDcMemX = CreateCompatibleDC<span style="color: #000000;">(</span> hdc <span style="color: #000000;">)</span>;<br /> bmx = bm;<br /> bmx.bmWidth = wWidth;<br /> bmx.bmHeight = wHeight;<br /><br /> bmx.bmWidthBytes = <span style="color: #000000;">(</span> bmx.bmWidth * bmx.bmBitsPixel + <span style="color: #000000;">15</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">16</span> * <span style="color: #000000;">2</span>;<br /><br /> hbmx = CreateBitmapIndirect<span style="color: #000000;">(</span> &bmx <span style="color: #000000;">)</span>;<br /><br /> hBmpOldX = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> hDcMemX, hbmx <span style="color: #000000;">)</span>;<br /> StretchBlt<span style="color: #000000;">(</span> hDcMemX, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, wWidth, wHeight, hDcMem, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<br /> bm.bmWidth, bm.bmHeight, dwRaster <span style="color: #000000;">)</span>;<br /> BitBlt<span style="color: #000000;">(</span> hdc, wRow, wCol, wWidth, wHeight, hDcMemX, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, dwRaster <span style="color: #000000;">)</span>;<br /> SelectObject<span style="color: #000000;">(</span> hDcMemX, hBmpOldX <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> hDcMemX <span style="color: #000000;">)</span>;<br /> DeleteObject<span style="color: #000000;">(</span> hbmx <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><br /> SelectObject<span style="color: #000000;">(</span> hDcMem, hBmpOld <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> hDcMem <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> DRAWBITMAP <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hDC, hBitmap, nRow, nCol, nWidth, nHeight, nRaster</span><br /><span style="color: #000000;">{</span><br /> DrawBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>,<br /> <span style="color: #000000;">(</span> int <span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> int <span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>,<br /> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">6</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">7</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:1yvm4wsw] |
Comments and requests about TWBrowse | Very good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Comming Soon : ViaCORAL 1.1 Skin Buttons. | Hello
It's support old xHarbour 0.92+FWH 2.5/2.6 ?
Regards,
Richard |
Comming Soon : ViaCORAL 1.1 Skin Buttons. | Gonna love this! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
Comming Soon : ViaCORAL 1.1 Skin Buttons. | Hello
I have old AP( xHarbour 0.92+FWH2.3 or FWH2.4).
Your new version 1.1 support it?
Have you call new FWH's kernal function?
I afraid my old tools incompatible your v1.1
Regards,
Richard |
Comming Soon : ViaCORAL 1.1 Skin Buttons. | [quote="Fernando Mancera":3qy5ixj1]Hello,
[quote:3qy5ixj1]I have old AP( xHarbour 0.92+FWH2.3 or FWH2.4).
Your new version 1.1 support it?
Have you call new FWH's kernal function?
I afraid my old tools incompatible your v1.1[/quote:3qy5ixj1]
We have tested ViaCoral 1.1 up to FWH 6.12 version and it works 100% ok.
You are using old versions, both FWH and Harbour/xharbour.
We strongly recommend you to upgrade them as they have improved very much.[/quote:3qy5ixj1]
Ok.
Could you share demo EXE let me test?
Regards,
Richard |
Commit en clase database | Hola,
No se si ya alguien pregunto sobre esto, pero recien note que la clase database, antes de hacer un ::unlock() no tiene un ::commit().
La ayuda de Clipper, y muchos textos mas, recomiendan hacer un COMMIT antes de un UNLOCK para conservar la integridad de datos...
Debo modificar la clase database para tomar en cuenta esto ???
Salu2, |
Commit en clase database | Julio,
ya hemos modificado la Clase TDataBase para que se llame a ::Commit() siempre antes de llamar a ::Unlock(). Gracias.
Si, puedes modificarla, y enlazarla en tu PRG ó bien reemplazarla en la librería. |
Commit en clase database | Antonio se usa uno laço de repeticion com muitos registros se torna muy lento executar lo commit a cada unlock.
Sugestão?
Gracias. |
Commit y RollBack | Hola amigos del foro:
Tengo una curiosidad, si el Commit/DBCommit() sirve para VOLCAR (escribir) los buffers de memoria (FIELDS e INDICES) a disco, ¿habra alguna forma o funcion que permita vaciar estos buffers de la memoria???. Asi evitariamos que se escriban/graben a disco en forma controlada.
Si existiera esa funcion, seria como un ROLLBACK verdad ?
Habra alguna posibilidad de implementarla ?
De antemano, gracias por responder.
Atentamente,
Rolando.
Cochabamba - Bolivia. |
Commit y unlock | Saludos.
Una cuestion de que es mejor.
ante un bloque de registro y para liberarlo se usa unlock
el commit debe ir antes del unlock o despues?
como si fuera principiante ante esto...
gracias. |
Commit y unlock | Antes,
Para forzar el windows a grabar el registro en la base de datos.
Saludos. |
Commit y unlock | dUnlock hace una llamada al metodo SELF_GOCOLD que se encarga de actualizar los buffer internos y de escribir en dico si es necesario por lo que commit está implicito. |
Commit y unlock | Manuel,
Aun a pesar de que pienso que conoces las interioridades Rdd de Harbour mejor que yo, veo extraño lo que dices. Simplemente, si COMMIT no hiciera nada, seguro que V. Szatkas ya lo habria eliminado de las funciones de Harbour. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Por experiencia, al menos en Clipper, COMMIT producia un volcado de datos.
Pensando en lo que dices, podria ser que COMMIT alzara algun flag que se tendria en cuenta en el dbUnlock(), eso podria explicar lo que tu dices. |
Commit y unlock | Hola Noe Aburto, lo hago de esta manera, hubo un gran debate sobre [url="http://fivewin.com.br/index.php?/topic/21870-indexacao-constante/"]el tema[/url].
para agregar un nuevo registro
dbAppend( .F. )
IF neterr()
? "no bloqueado récord"
else
replace ......
endif
actualizar un registro
IF Rlock()
dbSetOrder( 0 )
replace ....
dbCommit()
dbUnLock()
dbSetOrder( <oldIndex> )
ELSE
? "no bloqueado récord"
ENDIF
para eliminar un registro
IF Rlock()
dbSetOrder( 0 )
DbDelete()
dbCommit()
dbUnLock()
dbSetOrder( <oldIndex> )
ELSE
? "no bloqueado récord"
ENDIF |
Commit y unlock | To All
Just a word of caution using dbCommit() .. for just a single record dbCommit() during an update, append or deletion is fine, however, if you are updating many records in a Do While loop, you will notice dbCommit() after each update will cause your Do While loop to become extremely slow. In cases where I am making many record changes in a Do While loop, I issue dbCommit() after the loop is finished.
From the old Clipper days, it was said that if you move the record pointer it forced the workarea buffers to be flushed to disk. In cases where I am in a Do While loop appending or editing many records, I issued a dbSkip(0) after each change. DbSkip(0) technically moves the record pointer back to itself, theoretically flushing the buffers, then once the routine was complete I used dbCommit() to issue a 'hard disk' write.
Rick Lipkin |
Commit y unlock | No tiene nada que ver una cosa con la otra.
El dbUnLock() hace un dbcommit() pero no al contrario.
Se puede mantener el bloqueo y hacer un commit para que el cambio sea visible para otros usuarios del aplicativo en la red y no puedan borrar o modificar el registro bloqueado.
No sé si me explico bien <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
PD: Ya hace tiempo que no miro las RDD por dentro y puede que no esté en lo cierto, es cuestión de probar <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Common dialogs | Hola, pregunto: ¿Existe alguna manera de hacer que los common dialogs se vean más grandes?
Me explico, estoy haciendo una aplicación, tipo OneNote, que se puede usar tanto en ordenadores como en moviles o tablets (a través de Terminal Server), todas las fuentes que utilizo, las pantallas, botones, dialogos, etc. los adapto en función de la resolución de la pantalla (por ello no utilizo recursos) y varian de tamaño para que cuando la pantalla sea pequeña, incluso cuando la roten, se siga leyendo bien. Lo de la rotación lo hago con un timer que llama a GetDeviceCaps() para adaptar los dialogos y demás.
En las hojas donde los usuarios escriben, pueden seleccionar las fuentes, colores del texto, etc, pero me encuentro con que al llamar por ejemplo a ChooseColor(), en los móviles se ve demasiado pequeño el dialogo y es dificil acertar a seleccionar el color, lo mismo ocurre con otras muchas cosas, por ejemplo he tenido que hacer unas funciones MsgAlert(), MsgGet(), etc. y si no queda más remedio haré funciones para sustituir los common dialogs, pero me gustario evitarme ese trabajo.
Saludos |
Common dialogs | All these common dialogs use Windows function MessageBox().
<!-- m --><a class="postlink" href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox">https://docs.microsoft.com/en-us/window ... messagebox</a><!-- m -->
Fonts and dialog sizes are managed by Windows and there is no way FWH can control it.
It is better to make our own replacement functions. I know some programmers who have done that. |
Common dialogs | Thank you mr Rao, I will have to do them |
Comms | Is comms built in to the FWFPPC system or can I use any comms library that I currently use with Fivewin?
I need to be able to use xModem Transfer. |
Comms | FWPPC provides comm support, though xmodem is a specialized protocol that is not directly supported by Windows Mobile OS.
You can't use your PC libraries, unless you get a version built for ARM compatible processors. |
Communication with ARM9 | I just order FWPPC for running on S3C2440 Friendly ARM9 with Windows CE 5.0-6.0, When test the samples SetComm.prg return is .f. and TestComm.prg notthing happen.
I try to use this code for capture the result but function OpenCom return value of hComm more than 9 and alway change.
#include "FWCE.ch"
#define BUFF_IN 1024
#define BUFF_OUT 1024
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define OPEN_EXISTING 3
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define NOPARITY 0
#define ODDPARITY 1
#define EVENPARITY 2
#define MARKPARITY 3
#define SPACEPARITY 4
#define ONESTOPBIT 0
#define ONE5STOPBITS 1
#define TWOSTOPBITS 2
function Main(IniFile)
public oWnd
public nComm,nError,cDcb
set date brit
set cent on
DEFINE WINDOW oWnd TITLE " ADVANCE SOLUTION INTERNATIONAL CO.,LTD. [www.asic-net.com]"
@ 50, 20 BUTTON "OPEN" OF oWnd SIZE 100,50 PIXEL ACTION OComm()
@ 150, 20 BUTTON "SEND" OF oWnd SIZE 100,50 PIXEL ACTION SComm()
@ 250, 20 BUTTON "RECEIVE" OF oWnd SIZE 100,50 PIXEL ACTION RComm()
@ 350, 20 BUTTON "CLOSE" OF oWnd SIZE 100,50 PIXEL ACTION CComm()
ACTIVATE WINDOW oWnd
close all
clear all
quit
return nil
function OComm
nComm = OpenCom()
msginfo(str(nComm))
return nil
Function RComm()
local cBuffer,nBytes
cBuffer = space(1024)
nBytes = ComRead( nComm, @cBuffer )
if nBytes>0
msginfo(left(cBuffer,nBytes),'Read communication')
endif
return nil
Function SComm
local nBytes
nBytes = ComSend( nComm, "1234567890" )
msginfo("Send "+str(nBytes),"Send message")
return nil
Function CComm
ComClose( nComm )
msginfo("Close Communication port")
return nil
Function OpenCom( nCom, nBauds, nParity, nDataByt, nStopBits, lIRmode )
LOCAL hComm, cComm
DEFAULT nCom := 1, nBauds := 2400, nParity := NOPARITY, nDataByt := 8, lIRmode := .f.
DEFAULT nStopBits := ONESTOPBIT
cComm := "Com"+ AllTrim( Str( nCom, 2 ) )+ ":"
hComm := CreateFile( cComm, nOr(GENERIC_WRITE, GENERIC_READ) , 0, 0, OPEN_EXISTING, 0,0 )
IF hComm ==-1
Msginfo("Fallo al abrir "+ cComm)
Return -1
ENDIF
IF lIRMode
IF !RAWIRON( hComm )
Msginfo( "Fallo al iniciar RAWIR")
ComClose( hComm )
RETURN -1
ENDIF
ENDIF
IF !SetComm( hComm, nBauds, nParity, nDataByt, nStopBits )
MsgInfo("Fallo al configurar "+ cComm)
ComClose( hComm )
RETURN -1
ENDIF
RETURN hComm
Function ComSend( hComm, cString )
LOCAL nBytesend, nBytes:= Len( cString )
nByteSend := WriteComm( hComm, @cString, nBytes )
Return ( nByteSend == nBytes )
Function ComRead( nHdlCom, nChars )
LOCAL nBytes, cBuffIn := Space(BUFF_IN)
nBytes := ReadComm( nHdlCom, @cBuffIn, nChars )
RETURN if( nBytes >0, Left( cBuffIn, nBytes ),"" )
FUNCTION ComClose( hComm )
RAWIROFF( hComm )
CloseHandle( hComm )
RETURN .t.
#pragma BEGINDUMP
#include <windows.h>
#include <winbase.h>
#include <hbapi.h>
#include <aygshell.h>
#define BUFF_IN 1024
#define BUFF_OUT 1024
HB_FUNC( SETCOMM )
{
DCB dcb;
COMMTIMEOUTS timeouts;
SetupComm(( HANDLE) hb_parnl( 1 ), BUFF_IN, BUFF_OUT ) ;
GetCommState( ( HANDLE ) hb_parnl( 1 ), &dcb );
dcb.BaudRate = hb_parnl( 2 );
dcb.Parity = hb_parni( 3 );
dcb.ByteSize = hb_parni( 4 );
dcb.StopBits = hb_parni( 5 );
dcb.fBinary = TRUE;
dcb.fParity = TRUE;
dcb.fOutxCtsFlow = FALSE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDtrControl = DTR_CONTROL_DISABLE;
dcb.fDsrSensitivity = FALSE;
dcb.fTXContinueOnXoff = FALSE;
dcb.fOutX = FALSE;
dcb.fInX = FALSE;
dcb.fErrorChar = FALSE;
dcb.fNull = FALSE;
dcb.fRtsControl = RTS_CONTROL_DISABLE;
dcb.fAbortOnError = FALSE;
GetCommTimeouts(( HANDLE) hb_parnl, &timeouts);
timeouts.ReadIntervalTimeout = 0;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.ReadTotalTimeoutConstant = 1000;
timeouts.WriteTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 0;
SetCommTimeouts(( HANDLE) hb_parnl( 1 ), &timeouts );
hb_retl(SetCommState( ( HANDLE ) hb_parnl( 1 ), &dcb ));
}
HB_FUNC( READCOMM )
{
DWORD dw = 0;
ReadFile( ( HANDLE ) hb_parnl( 1 ), ( LPVOID ) hb_parc( 2 ), ( DWORD ) hb_parni( 3 ), &dw, NULL );
hb_retni( ( int ) dw ? dw : -1 );
}
HB_FUNC( WRITECOMM )
{
DWORD dw = 0;
WriteFile( (HANDLE ) hb_parnl( 1 ), ( LPVOID ) hb_parc( 2 ), ( DWORD ) hb_parni( 3 ), &dw, NULL );
hb_retni( ( int ) dw ? dw : -1);
}
HB_FUNC( RAWIRON )
{
hb_retl( EscapeCommFunction( ( HANDLE ) hb_parnl( 1 ), SETIR ) );
}
HB_FUNC( RAWIROFF )
{
hb_retl( EscapeCommFunction( ( HANDLE ) hb_parnl( 1 ), CLRIR ) );
}
#pragma ENDDUMP |
Communication with ARM9 | When you run TestComm.prg, what msg do you see on the screen ?
Msginfo("Fallo al abrir "+ cComm)
Msginfo( "Fallo al iniciar RAWIR")
MsgInfo("Fallo al configurar "+ cComm)
(these msgs are inside TestComm.prg) |
Communication with ARM9 | For SetComm.prg output display .f. in msginfo()
For original TestComm.prg nothing display
but after I insert
///////////////////////////
function main
local nComm
nComm=OpenCom()
msginfo(str(nComm))
return nil
///////////////////////////
the output is 5835267,5835523,5835779 and always change every time when I execute.
No error message in create function display. |
Communication with ARM9 | Surasak,
If you don't get any MsgInfo() then it is fine, where does it fail ? |
Communication with ARM9 | Program error when I use function ComSend and ComRead Tomorrow I will send you the error message |
Communication with ARM9 | I just found my mistake,
Now I can work on it.
Thank you very much for your help |
Communication with ARM9 | Very good <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Como Coloco dos lineas en titulo de xbrowse | Buen dia como coloco dos lineas en titulo de browse, actualmente lo hago asi y no hace el saldo de linea. Lo hago asi. oBrw:aCols[ 5 ]:cHeader := "Doc.Trans"+CHR(10)+"Anulacion" [code:39xb81f7]
oBrw := TXBrowse():New( oDlg28 )
oBrw:CreateFromResource( 4002 ) //-----------------------------> Chamada ao Resource Browse.
par_broArra("3",oBrw,aContl[20],0,oRecordSet[nRecordSet])
oBrw:SetArray( aArray, .T. )
//
oBrw:bKeyDown:={|nKey| IIF(nKey=VK_RETURN.OR.(aContl[1]+aContl[2])>0,;
(Vble_enrt(),lAtvBtn:=.T.,vTarefa:= "A"),.t. ) }
oBrw:bLDblClick := { || IIF(aContl[1]+aContl[2]>0,(Vble_enrt(),lAtvBtn:=.T.,vTarefa:= "A"),.t.) }
//
*****--- Colunas ---*****
// oBrw:aColSizes :={5,20,80,50,50,50,30}
// oBrw:SetSize( 20, 80 )
oBrw:aCols[ 1 ]:AddResource("CUT")
oBrw:aCols[ 1 ]:cHeader := "St"
oBrw:aCols[ 1 ]:nDataStrAlign := AL_RIGHT
oBrw:aCols[ 1 ]:nHeadStrAlign := AL_CENTER
oBrw:aCols[ 1 ]:nWidth := 25
oBrw:aCols[ 1 ]:bBmpData := { || iif(aArray[ oBrw:nArrayAt, 1 ]="*", 1,0) }
//
oBrw:aCols[ 2 ]:cHeader := "Codigo"
oBrw:aCols[ 2 ]:nDataStrAlign := AL_LEFT
oBrw:aCols[ 2 ]:nHeadStrAlign := AL_LEFT
oBrw:aCols[ 2 ]:nWidth := 60
...
//
//
oBrw:aCols[ 5 ]:cHeader := "Doc.Trans"+CHR(10)+"Anulacion"
oBrw:aCols[ 5 ]:nDataStrAlign := AL_LEFT
oBrw:aCols[ 5 ]:nHeadStrAlign := AL_LEFT
oBrw:aCols[ 5 ]:nWidth := 100
//
oBrw:aCols[ 6 ]:cHeader := "Cuenta.CxP"
oBrw:aCols[ 6 ]:nDataStrAlign := AL_LEFT
oBrw:aCols[ 6 ]:nHeadStrAlign := AL_LEFT
oBrw:aCols[ 6 ]:nWidth := 100
//
oBrw:aCols[ 7 ]:AddResource("CHECK_SI")
oBrw:aCols[ 7 ]:AddResource("CHECK_NO")
oBrw:aCols[ 7 ]:cHeader := "Status"
oBrw:aCols[ 7 ]:nDataStrAlign := AL_LEFT
oBrw:aCols[ 7 ]:nHeadStrAlign := AL_LEFT
oBrw:aCols[ 7 ]:nWidth := 50
oBrw:aCols[ 7 ]:bBmpData := { || iif(aArray[ oBrw:nArrayAt, 7 ], 1, 2) }
oBrw:aCols[ 7 ]:bStrData := { || iif(aArray[ oBrw:nArrayAt, 7 ],"Si","No") }
//
oBrw:aCols[ 8 ]:cHeader := " "
oBrw:aCols[ 8 ]:nDataStrAlign := AL_LEFT
oBrw:aCols[ 8 ]:nHeadStrAlign := AL_LEFT
oBrw:aCols[ 8 ]:nWidth := 10
//
FOR nFor := 1 to Len( aCols )
oBrw:aCols[ nFor ]:lAllowSizing := .F.
oBrw:aCols[ nFor ]:bRClickHeader = { || nil }
NEXT
ACTIVATE DIALOG oDlg28 CENTERED VALID (lExit) ON INIT (ShowMenu(MatValid,@aContl,oBar12,oDlg28);
[/code:39xb81f7] |
Como Coloco dos lineas en titulo de xbrowse | Ruben DArio:Asi lo hago:oCol:cHeader:= "Número Usuario"+CHR(10)+"Nombre Usuario" SaludosRuben Fernandez |
Como Coloco dos lineas en titulo de xbrowse | oBrw:nHeaderLines = ndonde "n" es el numero de lineas que desees[code:3507szcr] oBrw:aCols[ 5 ]:cHeader := "Doc.Trans"+CRLF+"Anulacion" [/code:3507szcr] |
Como Ingreso la columnas atraves de un array en xbrowse | saludos al forum
cldatos := {"nombre","vend"}
cltitul := {"Codigo","Nombre"}
clpictur := {Nil,Nil}
clwinth := {40,360}
clfoter := {"Codigo","Nombre"}
clalidat := {"AL_LEFT","AL_LEFT"} //L,R,C
clalitit := {"AL_LEFT","AL_LEFT"}
clalogico := {" "," "}
clBmpData := {" "," "}
Tengo hago para que me tome el valor de todas las columnas , le hago seguimiento si cambia pero al mostar el browser el valor que toma en toma en todas las columnas es el ultimo valor tomado del For. en la matriz el valor "vend"
codigo inicial es esta menera funciona bien
[code=fw:1fpxz584]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cldatos := <span style="color: #000000;">{</span><span style="color: #ff0000;">"nombre"</span>,<span style="color: #ff0000;">"vend"</span><span style="color: #000000;">}</span><br />cltitul := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Nombre"</span><span style="color: #000000;">}</span><br />clpictur := <span style="color: #000000;">{</span><span style="color: #00C800;">Nil</span>,<span style="color: #00C800;">Nil</span><span style="color: #000000;">}</span><br />clwinth := <span style="color: #000000;">{</span><span style="color: #000000;">40</span>,<span style="color: #000000;">360</span><span style="color: #000000;">}</span><br />clfoter := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Nombre"</span><span style="color: #000000;">}</span><br />clalidat := <span style="color: #000000;">{</span><span style="color: #ff0000;">"AL_LEFT"</span>,<span style="color: #ff0000;">"AL_LEFT"</span><span style="color: #000000;">}</span> <span style="color: #B900B9;">//L,R,C</span><br />clalitit := <span style="color: #000000;">{</span><span style="color: #ff0000;">"AL_LEFT"</span>,<span style="color: #ff0000;">"AL_LEFT"</span><span style="color: #000000;">}</span><br />clalogico := <span style="color: #000000;">{</span><span style="color: #ff0000;">" "</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">}</span><br />clBmpData := <span style="color: #000000;">{</span><span style="color: #ff0000;">" "</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">}</span><br /><br /> <br /> oLbx := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlgbrow <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">car_browse</span><span style="color: #000000;">(</span>oLbx,aContl<span style="color: #000000;">[</span><span style="color: #000000;">20</span><span style="color: #000000;">]</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /><br /> oCol := oLbx:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">oDbfxls</span>:<span style="color: #000000;">vend</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Codigo"</span><br /> oCol:<span style="color: #000000;">cFooter</span> := <span style="color: #ff0000;">" "</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">40</span> <br /> oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_LEFT <span style="color: #B900B9;">//AL_RIGHT AL_CENTER</span><br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT <br /><br /> <br /> oCol := oLbx:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">oDbfxls</span>:<span style="color: #000000;">nombre</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Nombre"</span><br /> oCol:<span style="color: #000000;">cFooter</span> := <span style="color: #ff0000;">" "</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">360</span> <br /><br /> oLbx:<span style="color: #000000;">setdolphin</span><span style="color: #000000;">(</span>::<span style="color: #000000;">oDbfxls</span>, .F.<span style="color: #000000;">)</span><br /> oLbx:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">(</span> <span style="color: #000000;">4001</span> <span style="color: #000000;">)</span><br /> oDlgbrow:<span style="color: #000000;">oClient</span> := oLbx<br /><br /><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /> </div>[/code:1fpxz584]
De esta manera llenando los datos con una matriz al mostrar el browser el valor que toma en toma en todas las columnas es el ultimo valor tomado del For. en la matriz el valor "vend"
uso la funcion bs_browser para llenar los datos del xbrowser
[code=fw:1fpxz584]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />cldatos := <span style="color: #000000;">{</span><span style="color: #ff0000;">"nombre"</span>,<span style="color: #ff0000;">"vend"</span><span style="color: #000000;">}</span><br />cltitul := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Nombre"</span><span style="color: #000000;">}</span><br />clpictur := <span style="color: #000000;">{</span><span style="color: #00C800;">Nil</span>,<span style="color: #00C800;">Nil</span><span style="color: #000000;">}</span><br />clwinth := <span style="color: #000000;">{</span><span style="color: #000000;">40</span>,<span style="color: #000000;">360</span><span style="color: #000000;">}</span><br />clfoter := <span style="color: #000000;">{</span><span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Nombre"</span><span style="color: #000000;">}</span><br />clalidat := <span style="color: #000000;">{</span><span style="color: #ff0000;">"AL_LEFT"</span>,<span style="color: #ff0000;">"AL_LEFT"</span><span style="color: #000000;">}</span> <span style="color: #B900B9;">//L,R,C</span><br />clalitit := <span style="color: #000000;">{</span><span style="color: #ff0000;">"AL_LEFT"</span>,<span style="color: #ff0000;">"AL_LEFT"</span><span style="color: #000000;">}</span><br />clalogico := <span style="color: #000000;">{</span><span style="color: #ff0000;">" "</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">}</span><br />clBmpData := <span style="color: #000000;">{</span><span style="color: #ff0000;">" "</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">}</span><br /><br /> <br /> oLbx := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlgbrow <span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">car_browse</span><span style="color: #000000;">(</span>oLbx,aContl<span style="color: #000000;">[</span><span style="color: #000000;">20</span><span style="color: #000000;">]</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> bs_browser<span style="color: #000000;">(</span>::<span style="color: #000000;">oDbfxls</span>,oCol,oLbx,cldatos,cltitul,clpictur,clwinth,clfoter,clalidat,clalitit,clalogico,clBmpData<span style="color: #000000;">)</span><br /><br /><br /> oLbx:<span style="color: #000000;">setdolphin</span><span style="color: #000000;">(</span>::<span style="color: #000000;">oDbfxls</span>, .F.<span style="color: #000000;">)</span><br /> oLbx:<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">(</span> <span style="color: #000000;">4001</span> <span style="color: #000000;">)</span><br /> oDlgbrow:<span style="color: #000000;">oClient</span> := oLbx<br /><br /><br /><br /> <span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><br /> </div>[/code:1fpxz584]
[code=fw:1fpxz584]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />Esta es la funcion pero llena la matriz con el ultimo dato de la matriz el valor <span style="color: #ff0000;">"vend"</span><br />es decir la columna nombe y vend las dos toman el valor de vend, como controlo esto,<br /><br /><span style="color: #00C800;">Function</span> bs_browser<span style="color: #000000;">(</span>oDbf,oCol,oLbx,cdat,ctit,cpic,cwin,cfot,calid,calit,clogi,cBmpD<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oDat,oDal<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>cdat<span style="color: #000000;">)</span><br /> oDat := cdat<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /> oDal := clogi<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /> <span style="color: #B900B9;">//ADD TO oLbx DATA { || nValue := bs_mostdato(oDbf,oDat," ",oDal) } HEADER ctit[i] ALIGN LEFT WIDTH 80</span><br /><br /> oCol := oLbx:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || nValue := bs_mostdato<span style="color: #000000;">(</span>oDbf,oDat,<span style="color: #ff0000;">" "</span>,oDal<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//RADAField("vend",::oDbfxls)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := ctit<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">cFooter</span> := cfot<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">nWidth</span> := cwin<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span> <br /><br /> <span style="color: #B900B9;">// oCol:nHeadStrAlign := bs_broaline(calit) //AL_LEFT AL_RIGHT AL_CENTER</span><br /> <span style="color: #B900B9;">// oCol:nDataStrAlign := bs_broaline(calid)</span><br />?oDat<br /><br /> <span style="color: #00C800;">Next</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span> <br /><br /> </div>[/code:1fpxz584] |
Como adiciono esta funcion a mi ejecutable | Amigos necesito esta funcion como la agrego a mi aplicacion#pragma BEGINDUMP#include <hbapi.h>#include <windows.h>CLIPPER ISEXERUNNING( PARAMS ) // ( cExeNameCaseSensitive ) --> lResult{ HANDLE hMutex = CreateMutex( NULL, TRUE, ( LPTSTR ) _parc( 1 ) ); _retl( GetLastError() == ERROR_ALREADY_EXISTS ); ReleaseMutex( hMutex );}#pragma ENDDUMPhago esto pero no lo reconoce |
Como adiciono esta funcion a mi ejecutable | Vladimir,Hazlo asi:[code:2aome1tz]
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HB_FUNC( ISEXERUNNING ) // ( cExeNameCaseSensitive ) --> lResult
{
HANDLE hMutex = CreateMutex( NULL, TRUE, ( LPTSTR ) hb_parc( 1 ) );
hb_retl( GetLastError() == ERROR_ALREADY_EXISTS );
ReleaseMutex( hMutex );
}
#pragma ENDDUMP
[/code:2aome1tz] |
Como convertir Getsyscolor() a RGB | Eso amigos
Tengo el color del windows con GetSysColor() como lo convierto a RGB para colorearlo
identicamente como formulario web.
<script language="Javascript">
document.write(RGB2HTML(255,34,33));
</script>
Saludos |
Como convertir Getsyscolor() a RGB | Vladimir,
nRed = nRGBRed( nRGBColor )
nGreen = nRGBGreen( nRGBColor )
nBlue = nRGBBlue( nRGBColor ) |
Como convertir Getsyscolor() a RGB | //-> Tabela de Colores
<!-- m --><a class="postlink" href="http://www.oho.com.br/cores.htm">http://www.oho.com.br/cores.htm</a><!-- m -->
Saludos. |
Como convertir Getsyscolor() a RGB | [quote:on7mjz6i]//-> Tabela de Colores
<!-- m --><a class="postlink" href="http://www.oho.com.br/cores.htm">http://www.oho.com.br/cores.htm</a><!-- m -->[/quote:on7mjz6i]
João Santos,
Gracias. Página web muy útil que muestra la mayor parte de la combinación de colores de color
Saludos
Anser |
Como convertir Getsyscolor() a RGB | Gracias João
Por compartir la Tabla de colores, es muy útil
Saludos
Adhemar |
Como le envio comandos AT al modem | Estimados Colegas
Como hago para enviarles comando AT al modem y obtener
respuesta.
Gracias
Fabian
<!-- e --><a href="mailto:databaselab2002@yahoo.com.ar">databaselab2002@yahoo.com.ar</a><!-- e --> |
Como le envio comandos AT al modem | Fabian,
Tienes un ejemplo operativo en samples\phone.prg |
Como le envio comandos AT al modem | En phone.prg hay que modificar la llamada a SetCommState() para que reciba nComm como el primer parámetro.
Es una modificación propia del API de Win32. |
Como ""matar"" un proceso activo | Al empezar a ejecutar una tarea me gustaria poder "matar" ( o sea, "finalizar el arbol de procesos") un proceso que me aparece en el Administrador de tareas como "FtLnSop.exe". No sé el título de su ventana o sea, que no puedo utilizar GetWindowTitle() para identificarlo. Alguien podría sugerirme alguna rutina del estilo de: KillProcess("FtLnSop.exe")
Gracias,
Rafael |
Como ""matar"" un proceso activo | Oskar: Te lo agradeceré muchísimo. Llevo dos dias intentándolo y ya no sé que más probar.
Rafael |
Como ""matar"" un proceso activo | Oskar:
Muchas gracias por tu rápida respuesta.
He intentado compilar tu ejemplo (añadiendo include "sql.ch") pero me da un error de sintaxis en la linea "For each...". He hecho la prueba utilizando FWH 2.6 y Harbour junto con el buildh.bat estandard.
Supongo que, además, me falta el TOleAuto(). Me podrías dar una pista acerca de cómo compilar tu ejemplo?
Un saludo,
Rafael |
Como ""matar"" un proceso activo | Rafael,
Puedes usar TerminateProcess()
<!-- m --><a class="postlink" href="http://support.microsoft.com/default.aspx?scid=KB;en-us;178893&">http://support.microsoft.com/default.as ... us;178893&</a><!-- m --> |
Como ""matar"" un proceso activo | Antonio:
Supongo que habrá que llamar a Terminate Process() mediante alguna función en C. Podrías postear un ejemplo simple, por favor?
Gracias
Rafael |
Como ""matar"" un proceso activo | Oskar:
Utilizo Harbour Compiler Alpha build 44.0 (Flex) y FWH/FWHX 2.6 May/2005
Saludos
Rafael |
Como Abrir Arquivos de Imagem DICOM ?? | Estou precisando abrir arquivos de imagem DICOM, são imagens utilizadas na medicina : tomografia/RaioX/Resonancia,
Alguem com experiencia no assunto ??
Obrigado pela atenção e colaboração de todos |
Como Abrir gaveta de dinero desde FWH | Hola amigos, alguien sabe como enviar una interrupcion a una gaveta de dinero para que una vez impreso el documento se abra y entregar el cambio.... esta gaveta se conecta a la impresora matricera por un cable RJ
Muchas Gracias
Mauro |
Como Abrir gaveta de dinero desde FWH | ai van "27,112,0,60,240"
salu2
Paco |
Como Abrir gaveta de dinero desde FWH | Hola Paco
Gracias por tu ayuda, esa codificación "27,112,0,60,240" la envias a traves de alguna instrucción?? ..... chr("27,112,0,60,240") por ejemplo?
salu2
Mauro |
Como Abrir gaveta de dinero desde FWH | jeepero, yo lo uso con tdosprn asi:
oPrn:Command("27,112,0,60,240")
salu2
paco |
Como Abrir gaveta de dinero desde FWH | Muchas gracias Paco funciona increible <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
salu2 |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | Hola Amigos.
Tengo 2 Combobox, al seleccionar un elemento en e 1º, no logro que se actualice la lista del 2º Combobox.
Agregadeciendo su ayuda,
Muchos Saludos
Antonio.
Dejo parte del codigo:
[code=fw:80jnk764]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> @ <span style="color: #000000;">014</span>,<span style="color: #000000;">05</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Tipo de Examen"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg4 <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">FONT</span> oFon6<br /> @ <span style="color: #000000;">025</span>,<span style="color: #000000;">05</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Nombre Examen"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg4 <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">FONT</span> oFon6<br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">110</span> <span style="color: #0000ff;">ComboBox</span> oGet5 <span style="color: #0000ff;">Var</span> nExam <span style="color: #0000ff;">Items</span> ArrTranspose<span style="color: #000000;">(</span>aExamenes<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg4 <span style="color: #0000ff;">FONT</span> oFon6;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span><span style="color: #000000;">(</span>Tip_Ate1:=ArrTranspose<span style="color: #000000;">(</span>aExamenes<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>oGet5:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>,<span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>!SeleAran<span style="color: #000000;">(</span>Tip_Ate1,oGet6<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"TODO BIEN"</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>oGet6:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oGet6:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,.F.<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>oGet6:<span style="color: #0000ff;">UpDate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oGet6:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,oGet6:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, .T.<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// <=== Al Seleccionar aqui, carga aArancel, pero no se actualiza</span><br /><br /> @ <span style="color: #000000;">025</span>,<span style="color: #000000;">110</span> <span style="color: #0000ff;">ComboBox</span> oGet6 <span style="color: #0000ff;">Var</span> nCodi <span style="color: #0000ff;">Items</span> ArrTranspose<span style="color: #000000;">(</span>aArancel<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">145</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg4 <span style="color: #0000ff;">FONT</span> oFon6;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span><span style="color: #000000;">(</span>Cod_Exa1:=ArrTranspose<span style="color: #000000;">(</span>aArancel<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>oGet6:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>,oMemo2:<span style="color: #000000;">Setfocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// <== Aqui no se actualiza en forma automatica la lista de elementos.</span><br /><br />.....<br />...<br /><br /><span style="color: #00C800;">Function</span> SeleAran<span style="color: #000000;">(</span>Tip_Ate1,oGet6<span style="color: #000000;">)</span><br /> aArancel := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> Sele Aran<br /> Seek Tip_Ate1<br /> <span style="color: #00C800;">If</span> Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"No Se Encontro Arancel Para Tipo Examen "</span>+Tip_Ate1<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span> .f.<br /> <span style="color: #00C800;">Endif</span><br /> <span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> <span style="color: #000000;">(</span>Tip_Ate=Tip_Ate1<span style="color: #000000;">)</span>.and.!Eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Aadd<span style="color: #000000;">(</span>aArancel, <span style="color: #000000;">{</span> Aran->Nom_Ara,Aran->Cod_Ara<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> DbSkip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">EndDo</span><br /> cNom9 := ASort<span style="color: #000000;">(</span>aArancel,,,<span style="color: #000000;">{</span>|x,y| x<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><y<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// " " " nombre</span><br /> nCodi:=<span style="color: #000000;">1</span><br /><br /> oGet6:<span style="color: #000000;">GoTop</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oGet6:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span> .t.<br /><br /> </div>[/code:80jnk764] |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | [code=fw:3tupuxep]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> combo2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> oCombo1, oCombo2<br /><span style="color: #00C800;">LOCAL</span> cVar1, cVar2<br /><span style="color: #00C800;">LOCAL</span> aItems1:=<span style="color: #000000;">{</span><span style="color: #ff0000;">"A"</span>,<span style="color: #ff0000;">"B"</span>,<span style="color: #ff0000;">"C"</span><span style="color: #000000;">}</span>, aItems2:=<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"A-2"</span>,<span style="color: #ff0000;">"A-3"</span><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo1 <span style="color: #0000ff;">Var</span> cVar1 <span style="color: #0000ff;">Items</span> aItems1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <br /> <br /><br /> @ <span style="color: #000000;">042</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo2 <span style="color: #0000ff;">Var</span> cVar2 <span style="color: #0000ff;">Items</span> aItems2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /> oCombo1:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || aItems2:=Actualiza<span style="color: #000000;">(</span>cVar1<span style="color: #000000;">)</span>, oCombo2:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span>aItems2<span style="color: #000000;">)</span>, cVar2:=aItems2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</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 /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Actualiza<span style="color: #000000;">(</span>cVar1<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> aReturn:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">IF</span> cVar1=<span style="color: #ff0000;">"A"</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"A-1"</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"A-2"</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"A-3"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> cVar1=<span style="color: #ff0000;">"B"</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"B-1"</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"B-2"</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"B-3"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> cVar1=<span style="color: #ff0000;">"C"</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"C-1"</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"C-2"</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #ff0000;">"C-3"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>aReturn<span style="color: #000000;">)</span><br /><br /><br /><br /> </div>[/code:3tupuxep] |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | Hola Jesus
Muchas gracias por responder.
No logro hacerlo funcionar, ya que mi Array son Multidimencionales ambos.
Del tipo:
aExamenes,{"EC ","EXAMEN 1 "})
aExamenes,{"RX ","EXAMEN 2 "})
El Primer Combobox, debe mostrar "EXAMEN 1" y al seleccionar, debo obteber "EC".
Aquí obtengo el codigo ===> ON CHANGE ((Tip_Ate1:=ArrTranspose(aExamenes)[1][oGet5:nAt])
Quizas me este ahogando en un vaso de agua, pero no logro dar con la solucion.
Saludos,
Antonio |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | Buenos días Antonio
No veo como has definido las variables. Si son locales, staticas, etc....
No veo la estructura de los arrays.
Tampoco veo la función ArrTranspose(), y por lo tanto no veo lo que devuelve.
Pero entiendo que el funcionamiento debería ser el mismo para un array de una dimensión, o multidimensional.
Solo debes controlar bien, las posiciones.
Aquí te dejo un ejemplo con múltiples dimensiones. Si nos das mas información, tal vez sea mas fácil ayudarte.
[code=fw:29733wh5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> combo2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> oCombo1, oCombo2<br /><span style="color: #00C800;">LOCAL</span> cVar1, cVar2<br /><span style="color: #00C800;">LOCAL</span> aItems1:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"A"</span>,<span style="color: #ff0000;">"AA"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"B"</span>,<span style="color: #ff0000;">"BB"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"C"</span>,<span style="color: #ff0000;">"CC"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span>, aItems2:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"A-2"</span>,<span style="color: #ff0000;">"A-3"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"B-1"</span>,<span style="color: #ff0000;">"B-2"</span>,<span style="color: #ff0000;">"B-3"</span>,<span style="color: #ff0000;">"B-4"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"C-1"</span>,<span style="color: #ff0000;">"C-2"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">LOCAL</span> aItems1b:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aItems2b:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><span style="color: #00C800;">LOCAL</span> N:=<span style="color: #000000;">1</span><br /><br /><br /><span style="color: #B900B9;">// voy a suponer que tu funcion ArrTranspose() toma solo el segundo valor para el array del oCombo1</span><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>aItems1<span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aItems1b, aItems1<span style="color: #000000;">[</span>n,<span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">NEXT</span> N<br /><span style="color: #B900B9;">// voy a inicializar los datos del segundo array con las posiciones de "A"</span><br />aItems2b:=aItems2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><br /><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo1 <span style="color: #0000ff;">Var</span> cVar1 <span style="color: #0000ff;">Items</span> aItems1b <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">042</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo2 <span style="color: #0000ff;">Var</span> cVar2 <span style="color: #0000ff;">Items</span> aItems2b <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> oCombo1:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || aItems2b:=aItems2<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span>aItems2b<span style="color: #000000;">)</span>, cVar2:=aItems2b<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</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 /> </div>[/code:29733wh5]
Saludos
Jesús |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | O prueba este otro ejemplo. He puesto tus datos en el primer array. A ver si así te aclaras mas. En el botón, te sale un mensaje con las opciones seleccionadas.
[code=fw:b5h8l4ha]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> combo2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> oCombo1, oCombo2<br /><span style="color: #00C800;">LOCAL</span> cVar1, cVar2<br /><span style="color: #00C800;">LOCAL</span> aItems1:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"EX"</span>,<span style="color: #ff0000;">"Examen 1"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"RX"</span>,<span style="color: #ff0000;">"Examen 2"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"HX"</span>,<span style="color: #ff0000;">"Examen 3"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span>, aItems2:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"A-2"</span>,<span style="color: #ff0000;">"A-3"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"B-1"</span>,<span style="color: #ff0000;">"B-2"</span>,<span style="color: #ff0000;">"B-3"</span>,<span style="color: #ff0000;">"B-4"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"C-1"</span>,<span style="color: #ff0000;">"C-2"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">LOCAL</span> aItems1b:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aItems2b:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><span style="color: #00C800;">LOCAL</span> N:=<span style="color: #000000;">1</span><br /><br /><br /><span style="color: #B900B9;">// voy a suponer que tu funcion ArrTranspose() toma solo el segundo valor para el array del oCombo1</span><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>aItems1<span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aItems1b, aItems1<span style="color: #000000;">[</span>n,<span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">NEXT</span> N<br /><span style="color: #B900B9;">// voy a inicializar los datos del segundo array con las posiciones de "A"</span><br />aItems2b:=aItems2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><br /><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo1 <span style="color: #0000ff;">Var</span> cVar1 <span style="color: #0000ff;">Items</span> aItems1b <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">042</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo2 <span style="color: #0000ff;">Var</span> cVar2 <span style="color: #0000ff;">Items</span> aItems2b <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /> oCombo1:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || aItems2b:=aItems2<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span>aItems2b<span style="color: #000000;">)</span>, cVar2:=aItems2b<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> @ <span style="color: #000000;">072</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Mi selección es ? "</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">22</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Mi selección es : "</span>+aItems1<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span>,<span style="color: #000000;">1</span><span style="color: #000000;">]</span>+CRLF+aItems1<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">]</span>+CRLF+aItems2b<span style="color: #000000;">[</span>oCombo2:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</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 /> </div>[/code:b5h8l4ha] |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | También veo que tienes un campo Memo. Si, por ejemplo, lo quieres actualizar de forma dinámica, cuando algunos de los dos combos cambien, utiliza esto :
(pruébalo y veras como cambia el objeto SAY que he puesto. Modifícalo a tu gusto y ejecuta las acciones que necesites)
[code=fw:ego4db13]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> combo2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">LOCAL</span> oCombo1, oCombo2<br /><span style="color: #00C800;">LOCAL</span> cVar1, cVar2<br /><span style="color: #00C800;">LOCAL</span> aItems1:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"EX"</span>,<span style="color: #ff0000;">"Examen 1"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"RX"</span>,<span style="color: #ff0000;">"Examen 2"</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"HX"</span>,<span style="color: #ff0000;">"Examen 3"</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span>, aItems2:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"A-2"</span>,<span style="color: #ff0000;">"A-3"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"B-1"</span>,<span style="color: #ff0000;">"B-2"</span>,<span style="color: #ff0000;">"B-3"</span>,<span style="color: #ff0000;">"B-4"</span><span style="color: #000000;">}</span>, <span style="color: #000000;">{</span><span style="color: #ff0000;">"C-1"</span>,<span style="color: #ff0000;">"C-2"</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">LOCAL</span> aItems1b:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span>, aItems2b:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><span style="color: #00C800;">LOCAL</span> N:=<span style="color: #000000;">1</span><br /><span style="color: #00C800;">LOCAL</span> oSay, cText:=<span style="color: #ff0000;">""</span><br /><br /><span style="color: #B900B9;">// voy a suponer que tu funcion ArrTranspose() toma solo el segundo valor para el array del oCombo1</span><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>aItems1<span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aItems1b, aItems1<span style="color: #000000;">[</span>n,<span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">NEXT</span> N<br /><span style="color: #B900B9;">// voy a inicializar los datos del segundo array con las posiciones de "A"</span><br />aItems2b:=aItems2<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /><br />cText:=<span style="color: #ff0000;">"Mi selección es : "</span>+CRLF+aItems1<span style="color: #000000;">[</span><span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">]</span>+CRLF+aItems1<span style="color: #000000;">[</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">]</span>+CRLF+aItems2<span style="color: #000000;">[</span><span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #B900B9;">// se inicia con los primeros valores</span><br /><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo1 <span style="color: #0000ff;">Var</span> cVar1 <span style="color: #0000ff;">Items</span> aItems1b <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">042</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo2 <span style="color: #0000ff;">Var</span> cVar2 <span style="color: #0000ff;">Items</span> aItems2b <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span><br /><br /> oCombo1:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || aItems2b:=aItems2<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span>aItems2b<span style="color: #000000;">)</span>, cVar2:=aItems2b<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, oCombo2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCombo2:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span> cText:=<span style="color: #ff0000;">"Mi selección es : "</span>+CRLF+aItems1<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span>,<span style="color: #000000;">1</span><span style="color: #000000;">]</span>+CRLF+aItems1<span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">]</span>+CRLF+<span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>oCombo2:<span style="color: #000000;">nAt</span>=<span style="color: #000000;">0</span>,aItems2b<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,aItems2b<span style="color: #000000;">[</span>oCombo2:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>, oSay:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span>cText<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">150</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">VAR</span> cText <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</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 /><br /> </div>[/code:ego4db13] |
Como Actilizar 2º Combobox ANIDADOS "" URGENTE "" | Hola Jesus.
Muchas gracias por tu preocupacion y tiempo que me has dedicado.
He revisado tus codigos ejemplos, veo que trabajas con doble Array, la verdad que me perdi, ya que desde el bChange, debo mandar a carjar a una function el segundo Array.
Se que te he molestado mucho, pero mira el primer codigo que me enviaste es lo que tengo mas claro, muestra inicialmente los los Array con sus combobox, solo que al seleccionar un nuevo elemento del 1º Combobox, ya a la function " Actualiza ", llena el arreglo de paso, pero al retornar al bChange, se muere, simplemente se sale del programa y no da error, la idea es que actualice los elementos del segundoo combobox, esa es la finalidad.
Muy agradecido,
Antonio.
Dejo todo el codigo con la explicacion que estoy Probando:
[code=fw:1lzd9o0d]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">Static</span> aItems1:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">Static</span> aItems2:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span> combo2<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oCombo1, oCombo2<br /> <span style="color: #00C800;">LOCAL</span> cVar1, cVar2 ,Tip_Ate1<br /> <span style="color: #00C800;">LOCAL</span> oDlg ,a:=<span style="color: #000000;">1</span>,b:=<span style="color: #000000;">1</span><br /><br /><br /> AADD<span style="color: #000000;">(</span> aItems1,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A"</span>,<span style="color: #ff0000;">"ECOGRAFIAS "</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span> aItems1,<span style="color: #000000;">{</span><span style="color: #ff0000;">"B"</span>,<span style="color: #ff0000;">"RAYOS "</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span> aItems1,<span style="color: #000000;">{</span><span style="color: #ff0000;">"C"</span>,<span style="color: #ff0000;">"LABORATORIO "</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><br /> AADD<span style="color: #000000;">(</span>aItems2,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"DETALLE AA-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aItems2,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-2"</span>,<span style="color: #ff0000;">"DETALLE AA-2"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aItems2,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"DETALLE AA-3"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span><br /><br /> @ <span style="color: #000000;">012</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo1 <span style="color: #0000ff;">Var</span> a <span style="color: #0000ff;">Items</span> ArrTranspose<span style="color: #000000;">(</span>aItems1<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #B900B9;">// <== Muestra en Detalle "ECOGRAFIAS" "</span><br /><br /> @ <span style="color: #000000;">042</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">ComboBox</span> oCombo2 <span style="color: #0000ff;">Var</span> b <span style="color: #0000ff;">Items</span> ArrTranspose<span style="color: #000000;">(</span>aItems2<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> <span style="color: #B900B9;">// <== Muestra en Detalle "DETALLE AA-1"</span><br /><br /> oCombo1:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> ||<span style="color: #000000;">(</span>cVar1:=ArrTranspose<span style="color: #000000;">(</span>aItems1<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>oCombo1:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>, aItems2:=Actualiza<span style="color: #000000;">(</span>cVar1<span style="color: #000000;">)</span>, oCombo2:<span style="color: #000000;">SetItems</span><span style="color: #000000;">(</span>aItems2<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cVar2:=ArrTranspose<span style="color: #000000;">(</span>aItems2<span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span>oCombo2:<span style="color: #000000;">nAt</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>, oCombo2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #B900B9;">/*<br /> Notas:<br /> cVar1:=ArrTranspose(aItems1)[1][oCombo1:nAt] <==== Obtengo el 1º Elemento "A", esta variable la necesito para otra funcion<br /> aItems2:=Actualiza(cVar1) <==== Va a la Function Actualiza con el Valor cVar1 e llena nuevo Array aItems2<br /> oCombo2:SetItems(aItems2) <==== Cargo el Objeto con nuevo Array<br /> cVar2:=ArrTranspose(aItems2)[1][oCombo2:nAt]) <==== Obtengo el 1º Elemento del Segundo Combobox "A-2"<br /><br /> */</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</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 /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Actualiza<span style="color: #000000;">(</span>cVar1<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> aReturn:=<span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> ?cVar1<br /> <span style="color: #00C800;">IF</span> cVar1=<span style="color: #ff0000;">"A"</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"DETALLE AA-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-2"</span>,<span style="color: #ff0000;">"DETALLE AA-2"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"A-1"</span>,<span style="color: #ff0000;">"DETALLE AA-3"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">IF</span> cVar1=<span style="color: #ff0000;">"B"</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"B-1"</span>,<span style="color: #ff0000;">"DETALLE BB-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"B-1"</span>,<span style="color: #ff0000;">"DETALLE BB-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"B-1"</span>,<span style="color: #ff0000;">"DETALLE BB-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">IF</span> cVar1=<span style="color: #ff0000;">"C"</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"C-1"</span>,<span style="color: #ff0000;">"DETALLE CC-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"C-1"</span>,<span style="color: #ff0000;">"DETALLE CC-1"</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>aReturn,<span style="color: #000000;">{</span><span style="color: #ff0000;">"C-1"</span>,<span style="color: #ff0000;">"DETALLE CC-1"</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: #000000;">(</span>aReturn<span style="color: #000000;">)</span><br /><br /> </div>[/code:1lzd9o0d] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.