FiveWeb Questions

Post Reply
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

FiveWeb Questions

Post by Jeff Barnes »

1. Can you use .rc files with FiveWeb?
2. How would you open a PDF file to be viewed via FiveWeb?
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

FiveWeb currently does not support RC files. Look for FWeb from Carles Aubia on these forums, his product does support RC files.

The browser should open a PDF by default (at least Chrome does it).

Look for "document.location" in FiveWeb examples and set it to the PDF file url directly.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Carles
Posts: 937
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona
Contact:

Re: FiveWeb Questions

Post by Carles »

Jeff,

1.- FWeb support *.RC files, you can see FWeb manual for this feature.
2.- You can use pdf from javascript with window.location.assign( "./help/FWeb.pdf") or document.location as said Mr. Antonio

If you want to see a little code example with FWeb:

Code: Select all

<?php 
include ('./fweb/fweb.php' );

$oWeb   = new TWeb( 'Test PDF' );       
$oWeb->Activate();

    $oWnd   = new TDialog( 'my_dialog', 700, 900 , 'Manual FWeb - Framework Web' ); 
    $oWnd->SetIcon( 'images.app/doc.png' );

        $oPdf = new TFrame( $oWnd, 'my_frame', 0, 0, '100%', '100%', 'help/FWeb_EN.pdf' );
    
    $oWnd->Activate();
    
$oWeb->End();
?>
and you can execute it-> http://itarraco.com/fweb/zpdf.php (pdf file is a little manual of FWeb :D )
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

https://modharbour.app
https://modharbour.app/compass
https://forum.modharbour.app
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

Ok so I am obviously missing something in my formatting ... :oops:
I've tried several different ways of trying to open the PDF using document.location but it never seems to work (using Chrome)
Can you please give me a code sample on how to open the pdf using document.location ?

Thanks.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

@ 260, 160 BUTTON "Ok" OF oDlg ;
ACTION document.location = "url_to_the_pdf"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

Looks like its a problem with xampp not allowing me to open the pdf.
If I manually enter the url in Chrome with xampp running it give an error.
If I switch to IIS it will open the PDF

The problem is, in IIS the exe does not really work :(
When I click a button (a browse) it does nothing.

I took a quick look at FWeb but it looks like it doesn't let us use harbour code.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Carles
Posts: 937
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona
Contact:

Re: FiveWeb Questions

Post by Carles »

Jeff,

If you manually enter the url in Chrome with xampp running, this should work. I've tried it and it works.

Fiveweb it's based in Harbour

FWeb it's based on php but using the FiveWin philosophy with RIA concept -> https://en.wikipedia.org/wiki/Rich_Internet_application

There are two solutions to make the jump to the Web ! :D
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

https://modharbour.app
https://modharbour.app/compass
https://forum.modharbour.app
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

Got it working ...

How can I force the page to refresh after it opens?
I know I can use document.location.reload(true) but I can't get it to work when added to the button:

Example:
If I add each to it's own button, they work so I know the commands are correct but this isn't what I need.
I'm using window.open so I can have the PDF opened in a new tab. The second button will obviously reload the original tab.
@ 484, 456 BUTTON "PDF" SIZE 110, 40 OF oDlg ACTION window.open("/PDF/Monitor.pdf","_blank")
@ 524, 456 BUTTON "Refresh" SIZE 110, 40 OF oDlg ACTION document.location.reload(true)

But, if I try to do the following the code will not compile:
@ 484, 456 BUTTON "PDF" SIZE 110, 40 OF oDlg ACTION (window.open("/PDF/Monitor.pdf","_blank"), document.location.reload(true) )

The compile error is:
Compiling...
Certus.prg(232) Error E0030 Syntax error "syntax error at '.'"
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'Certus.prg' and generating preprocessed output to 'Certus.ppo'...
1 error

No code generated.
* Compile errors *
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

Try it this way:

@ 484, 456 BUTTON "PDF" SIZE 110, 40 OF oDlg ;
ACTION "window.open('/PDF/Monitor.pdf','_blank'), document.location.reload(true)"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

Thanks Antonio ... That worked.

Is there any way I can do something like the code below without it being tied to a button?

window.open("/PDF/Monitor.pdf","_blank")

Example:

IF cVar = "Something"
window.open("/PDF/Monitor.pdf","_blank")
ENDIF
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

Try this:

? "<script>window.open('/PDF/Monitor.pdf','_blank');<\script>"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

Thanks Antonio ... got that part working now.
FiveWeb is working quite well so far :)

Now on to FOLDERS....

I am able to create the folders following the sample (TestFold.prg).

@ 0, 0 FOLDER oFld PROMPTS "Test 1","Test 2" SIZE 1000, 650 OF oDlg

How do I setup my gets/browse etc... in separate tabs in the folder?
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: FiveWeb Questions

Post by Jeff Barnes »

I've tried using the same format as FWH but no luck:

@ 1, 1 BUTTON "Test" OF oFld:aDialogs[ 1 ] ACTION MsgInfo( "Hello world!")
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

Jeff,

FiveWeb enhancements:

* Enhanced Class TFolder.

* Enhanced samples\testfold.prg adding child controls

Already available from:
https://bitbucket.org/fivetech/fiveweb/downloads (download repository)

Here it is the code for the enhanced samples\testfold.prg

Code: Select all

#include "FiveWeb.ch"

function Main()

   local oDlg, oFld
   local cVar1 := Space( 10 ), cVar2 := Space( 20 ), cVar3 := Space( 30 )

   DEFINE DIALOG oDlg TITLE "Using folders"

   @ 10, 10 FOLDER oFld PROMPTS "One", "Two", "Three" OF oDlg SIZE 400, 300

   @ 100, 30 SAY "Tab 1" OF oFld:aDialogs[ 1 ]

   @ 150, 50 GET cVar1 OF oFld:aDialogs[ 1 ]

   @ 100, 30 SAY "Tab 2" OF oFld:aDialogs[ 2 ]

   @ 150, 50 GET cVar2 OF oFld:aDialogs[ 2 ]

   @ 100, 30 SAY "Tab 3" OF oFld:aDialogs[ 3 ]

   @ 150, 50 GET cVar3 OF oFld:aDialogs[ 3 ]

   ACTIVATE DIALOG oDlg

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FiveWeb Questions

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply