[Gambas-user] WebBrowser - read out the shown html document

2010-08-04 Thread Andreas Fröhlke
Hello,

I use the Gambas-Browser to open an shopping website. There the user can choose 
his products and order them. T last page of the shop is a status page with all 
informations in the html-source-code written as comments, which i must read out 
and save in a mysql database. Is there a way to read out the html-code of the 
website the gambas webbrowser is currently shown?

Regards

- A.Fröhlke - 
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] WebBrowser - read out the shown html document

2010-08-04 Thread Andreas Fröhlke
Hi Dimitris,

thanks, thanks, thanks for this solution. It works perfectly. 

Regards

- Andreas -


-Ursprüngliche Nachricht-
Von: Dimitris Anogiatis [mailto:dos...@gmail.com] 
Gesendet: Mittwoch, 4. August 2010 11:24
An: mailing list for gambas users
Betreff: Re: [Gambas-user] WebBrowser - read out the shown html document

Hey Andreas,

From what I've read in the documentation there's no text property or any
other way to get the source code of the currently showing webpage in the
webbrowser control... yet; so after a bit of googling this is what I've come
up with.

assuming that your webbrowser control is called Webbrowser1 you can do this

PUBLIC SUB WebBrowser1_Click()
DIM tempHTML AS String
DIM tempLink AS String

tempLink = WebBrowser1.Link
SHELL (wget -qO-   tempLink  |cat) TO tempHTML
PRINT tempHTML
END

This piece of code will retrieve the code of the page you just clicked and
send the html code to the tempHTML variable
It's a bit crude, not 100% tested but I think it works.

I hope this helps till someone else has a better way to do it from within
the webbrowser control

Regards
Dimtris

On Wed, Aug 4, 2010 at 12:26 AM, Andreas Fröhlke afroeh...@kikxxl.dewrote:

 Hello,

 I use the Gambas-Browser to open an shopping website. There the user can
 choose his products and order them. T last page of the shop is a status page
 with all informations in the html-source-code written as comments, which i
 must read out and save in a mysql database. Is there a way to read out the
 html-code of the website the gambas webbrowser is currently shown?

 Regards

 - A.Fröhlke -

 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://p.sf.net/sfu/dev2dev-palm
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user




--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] WebBrowser - read out the shown html document

2010-08-04 Thread Benoît Minisini
 Hi Dimitris,
 
 thanks, thanks, thanks for this solution. It works perfectly.
 
 Regards
 
 - Andreas -
 
 

Or, In Gambas 3, WebView has a HTML property.

Regards,

-- 
Benoît Minisini

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Access only to the user's folder

2010-08-04 Thread Benoît Minisini
 -Mensaje original-
 De: Benoît Minisini gam...@users.sourceforge.net
 Reply-to: mailing list for gambas users
 gambas-user@lists.sourceforge.net
 Para: mailing list for gambas users gambas-user@lists.sourceforge.net
 Asunto: Re: [Gambas-user] Access only to the user's folder
 Fecha: Tue, 3 Aug 2010 00:22:18 +0200
 
  Hi.
  
  I want the user to select the Dialog.SelectDirectory () only could
  choose or create folders within the folder /home.
  
  It can be done with Dialog.Path = User.home, but this does not stop so
  you can select the root directory /
  
  Regards
 
 You have to implement your own file dialog with a FileChooser and a
 DirChooser.
 
 The DirChooser has a Root property that constraints the choice to a
 directory and its subdirectories.
 
 Regards,
 
 Hi.
 
 If I choose to FileChooser or DirChooser, these show me the folder icons to
 the theme of Gnome. By using Dialog.SelectDirectory, this shows me the
 folder icons to the theme that the user has selected. Is there any way to
 emulate this behavior in them?.
 
 Regards
 

Do you have screenshots to show me what you are talking about? Beware that a 
mailing-list post is limited to 256K.

Regards,

-- 
Benoît Minisini

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Confirm on form close

2010-08-04 Thread vikram
Hi,

Is there a way to confirm from a user when decides to close a form?

PUBLIC SUB Form_Close()
  DIM retVal AS Integer
  retval = Message.Question(Are you sure you want to exit?, Yes, No)
  IF retVal = 1 THEN 
    ME.Close
  ELSE IF retVal = 2 THEN 
    'code to prevent the form from exiting
  ENDIF 
END

Nothing i've put there seems to have been able to stop the form from exiting so 
far.

Thanks
Vikram




  
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] pdf component question

2010-08-04 Thread Benoît Minisini
 I wondered where the full documentation is for this compoent.
 
 The pdf viewer will do things like hightlight test you want to search for,
 but I wondered if there is a machanism of 'going to' the first occurrence.
 
 There is a couple of goto properties, but the mini-help which come up but
 no explanation of how to use them.
 
 Regards
 
 Richard
 

Here is what I could guess by reading the source code of the component:

PdfDocument[Page].Find() will search all occurences of a text into the 
specified page.

Then: PdfDocument[Page].Result.Count returns the number of matches, and 
PdfDocument[Page].Result[Index] a virtual object that represents the rectangle 
surrounding the text in the page.

Maybe if Index = 0, you have the first match?

Is it what you are looking for?

-- 
Benoît Minisini

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Confirm on form close

2010-08-04 Thread Benoît Minisini
 Hi,
 
 Is there a way to confirm from a user when decides to close a form?
 
 PUBLIC SUB Form_Close()
   DIM retVal AS Integer
   retval = Message.Question(Are you sure you want to exit?, Yes, No)
   IF retVal = 1 THEN
 ME.Close
   ELSE IF retVal = 2 THEN
 'code to prevent the form from exiting
   ENDIF
 END
 
 Nothing i've put there seems to have been able to stop the form from
 exiting so far.
 
 Thanks
 Vikram
 

You have to cancel the event with the STOP EVENT instruction.

Regards,

-- 
Benoît Minisini

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Access only to the user's folder

2010-08-04 Thread craf
-Mensaje original-
De: Benoît Minisini gam...@users.sourceforge.net
Reply-to: mailing list for gambas users
gambas-user@lists.sourceforge.net
Para: mailing list for gambas users gambas-user@lists.sourceforge.net
Asunto: Re: [Gambas-user] Access only to the user's folder
Fecha: Wed, 4 Aug 2010 13:59:18 +0200


 -Mensaje original-
 De: Benoît Minisini gam...@users.sourceforge.net
 Reply-to: mailing list for gambas users
 gambas-user@lists.sourceforge.net
 Para: mailing list for gambas users gambas-user@lists.sourceforge.net
 Asunto: Re: [Gambas-user] Access only to the user's folder
 Fecha: Tue, 3 Aug 2010 00:22:18 +0200
 
  Hi.
  
  I want the user to select the Dialog.SelectDirectory () only could
  choose or create folders within the folder /home.
  
  It can be done with Dialog.Path = User.home, but this does not stop so
  you can select the root directory /
  
  Regards
 
 You have to implement your own file dialog with a FileChooser and a
 DirChooser.
 
 The DirChooser has a Root property that constraints the choice to a
 directory and its subdirectories.
 
 Regards,
 
 Hi.
 
 If I choose to FileChooser or DirChooser, these show me the folder icons to
 the theme of Gnome. By using Dialog.SelectDirectory, this shows me the
 folder icons to the theme that the user has selected. Is there any way to
 emulate this behavior in them?.
 
 Regards
 

Do you have screenshots to show me what you are talking about? Beware that a 
mailing-list post is limited to 256K.

Regards,

Hi

When I use the controls DirChooser and FileChooser , the icons displayed are 
those that come in the Gnome theme.



But when I use dialog.Selectdirectory (), the icons shown are the subject of 
ongoing use, which is Human.



Is there any way to change this behavior in gb.gtk sources?

Regards.




attachment: dialogselectdirectory.pngattachment: dirchooser.png--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Access only to the user's folder

2010-08-04 Thread Benoît Minisini
  Hi.
  
  If I choose to FileChooser or DirChooser, these show me the folder icons
  to the theme of Gnome. By using Dialog.SelectDirectory, this shows me
  the folder icons to the theme that the user has selected. Is there any
  way to emulate this behavior in them?.
  
  Regards
 
 Do you have screenshots to show me what you are talking about? Beware that
 a mailing-list post is limited to 256K.
 
 Regards,
 
 Hi
 
 When I use the controls DirChooser and FileChooser , the icons displayed
 are those that come in the Gnome theme.
 
 
 
 But when I use dialog.Selectdirectory (), the icons shown are the subject
 of ongoing use, which is Human.
 
 
 
 Is there any way to change this behavior in gb.gtk sources?
 
 Regards.

It has nothing to do with gb.gtk and icon theme.

Directory specific icons is a freedesktop standard that the DirChooser control 
does not handle, for simplicity reasons. And because it needs to access a 
directory stored inside a folder making things slower.

Two remarks:

- I may implement that in the future.

- Storing how directories should be viewed inside the directory is a stupid 
design. Why on the heck did they do that? :-( If two users want to see the 
same directory differently, what should we do?

-- 
Benoît Minisini

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Access only to the user's folder

2010-08-04 Thread craf
-Mensaje original-
De: Benoît Minisini gam...@users.sourceforge.net
Reply-to: mailing list for gambas users
gambas-user@lists.sourceforge.net
Para: mailing list for gambas users gambas-user@lists.sourceforge.net
Asunto: Re: [Gambas-user] Access only to the user's folder
Fecha: Wed, 4 Aug 2010 17:18:56 +0200


  Hi.
  
  If I choose to FileChooser or DirChooser, these show me the folder icons
  to the theme of Gnome. By using Dialog.SelectDirectory, this shows me
  the folder icons to the theme that the user has selected. Is there any
  way to emulate this behavior in them?.
  
  Regards
 
 Do you have screenshots to show me what you are talking about? Beware that
 a mailing-list post is limited to 256K.
 
 Regards,
 
 Hi
 
 When I use the controls DirChooser and FileChooser , the icons displayed
 are those that come in the Gnome theme.
 
 
 
 But when I use dialog.Selectdirectory (), the icons shown are the subject
 of ongoing use, which is Human.
 
 
 
 Is there any way to change this behavior in gb.gtk sources?
 
 Regards.

It has nothing to do with gb.gtk and icon theme.

Directory specific icons is a freedesktop standard that the DirChooser control 
does not handle, for simplicity reasons. And because it needs to access a 
directory stored inside a folder making things slower.

Two remarks:

- I may implement that in the future.

- Storing how directories should be viewed inside the directory is a stupid 
design. Why on the heck did they do that? :-( If two users want to see the 
same directory differently, what should we do?


Ok, Thank you.

Regards.



--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Confirm on form close

2010-08-04 Thread Matti
Sorry, didn't see that Benoit had already answered.

But, besides the code: Why do you ask the user (who just has decided) if he
wants to decide? I really hate programs that ask me things like that. If I close
a form by mistake, I open it again.

I think the questions on Form_Close event should be restricted to important
things like possible data loss.

Matti


Am 04.08.2010 14:01, schrieb vikram:
 Hi,
 
 Is there a way to confirm from a user when decides to close a form?
 
 PUBLIC SUB Form_Close()
   DIM retVal AS Integer
   retval = Message.Question(Are you sure you want to exit?, Yes, No)
   IF retVal = 1 THEN 
 ME.Close
   ELSE IF retVal = 2 THEN 
 'code to prevent the form from exiting
   ENDIF 
 END
 
 Nothing i've put there seems to have been able to stop the form from exiting 
 so far.
 
 Thanks
 Vikram
 
 
 
 
   
 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://p.sf.net/sfu/dev2dev-palm
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] pdf component question

2010-08-04 Thread richard terry
On Wednesday 04 August 2010 22:05:45 Benoît Minisini wrote:
  I wondered where the full documentation is for this compoent.
 
  The pdf viewer will do things like hightlight test you want to search
  for, but I wondered if there is a machanism of 'going to' the first
  occurrence.
 
  There is a couple of goto properties, but the mini-help which come up but
  no explanation of how to use them.
 
  Regards
 
  Richard
 
 Here is what I could guess by reading the source code of the component:
 
 PdfDocument[Page].Find() will search all occurences of a text into the
 specified page.
 
 Then: PdfDocument[Page].Result.Count returns the number of matches, and
 PdfDocument[Page].Result[Index] a virtual object that represents the
  rectangle surrounding the text in the page.
 
 Maybe if Index = 0, you have the first match?
 
 Is it what you are looking for?
 
Will go back to what I was doing at time of the post and dig-est your email.

Thanks very much.

Richard

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user