Re: [Gambas-user] How to write to a file??

2008-09-18 Thread charlesg

Hi Brittany,

You have 2 options: write to a simple text file or write to a database.

Writing to a text file is simple.

'-
' Gambas class file
PUBLIC hFile AS File

PUBLIC SUB form_Activate()
  'create the file if it does not exist, otherwise just open it 
  IF Exist(Application.path  /file.txt) THEN  
hFile = OPEN Application.path  /file.txt FOR WRITE APPEND 
  ELSE 
hFile = OPEN Application.path  /file.txt FOR WRITE CREATE
  ENDIF 
  TextBox1.SetFocus
END

PUBLIC SUB btnExit_Click()
  hFile.Close
  FMain.Close
END

PUBLIC SUB btnWrite_Click()
  'write the 2 textboxes to the File
  PRINT #hFile, TextBox1.text  ,  TextBox2.text
  'clear the textboxes and put the cursor back in the first
  TextBox1.text = 
  TextBox2.text = 
  TextBox1.SetFocus
END
'--

You can check the file (file.txt) by loading it in any text processor.
Because of the 'application.path', you will find it in the same directory as
your program.

Writing to a database is more flexible and a little more difficult. You can
create a simple SQLite database from Gambas though it is probably easier
using a very adequate add-on to Firefox (click Tools,add-ons and search
sqlite). You can see how to open and write to sqlite with a small tutorial
at www.kalaharix.wordpress.com.

rgds
-- 
View this message in context: 
http://www.nabble.com/How-to-write-to-a-file---tp19544483p19547768.html
Sent from the gambas-user mailing list archive at Nabble.com.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Frameless window

2008-09-18 Thread Rolf-Werner Eilert
Is it possible to produce a frameless window in Gambas? I'm thinking 
about something that looks like those small explanations popping up in 
KDE when you hover over an icon on the control bar. (Not the tooltips, 
or the ones on the desktop which seem to be more or less tooltips, too.)

Thanks for your ideas!

Rolf

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] learning gb.report

2008-09-18 Thread Kari Laine
Hi Fabien,

On Thu, Sep 18, 2008 at 1:08 AM, Fabien Bodard [EMAIL PROTECTED] wrote:

 i don'tt remember why i has done that lol i need to look at that
 better ... what did you manage to do about that component ... i've not
 finish it yet... i'm waiting for Benoit and the ability of the ide to
 draw report as it draw form.

gb.report is an example to learn object oriented Gambas and how to do a
component in Gambas. That it is not finished is not a problem.


 ok got it

 it's for after ... like forms, they will be a class named report this
 class inherit the report and extend it ... like with a form ... and in
 forms, the envents are contained in the form class file ... so managed
 by the class itself.


 The goal ,in fact my goal of gb.report is to give the ability to
 gambas to generate reports as access do. so gambas will be maybe the
 better database tool in the linux world... for me better than ooo or
 kexi. But there is still some work to do.

 Thanks for explanation

Best Regards
Kari Laine
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Events

2008-09-18 Thread Kari Laine
Thank You Fabien!

this example should be in Gambas documentation.

On Thu, Sep 18, 2008 at 1:35 AM, Fabien Bodard [EMAIL PROTECTED] wrote:

 in what case ? to write you own class ?


 'class MyTest

 EVENT MyEvent

 Public test()

For others who are beginner with Gambas this should be
Public SUB test()


Best Regards
Kari Laine
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Frameless window

2008-09-18 Thread Rolf-Werner Eilert
Laurent Carlier schrieb:
 Le jeudi 18 septembre 2008 10:21:37 Rolf-Werner Eilert, vous avez écrit :
 Is it possible to produce a frameless window in Gambas? I'm thinking
 about something that looks like those small explanations popping up in
 KDE when you hover over an icon on the control bar. (Not the tooltips,
 or the ones on the desktop which seem to be more or less tooltips, too.)

 Thanks for your ideas!

 
 Here is the answer:
 http://64.128.110.55/help/comp/gb.qt/window/border
 


I found a way that is - well, a workaround fitting on my case here:

I just abuse a panel which is made visible for some seconds and thus 
pops up at the coordinates needed.

Of course this is only sensible in a case where the notification of the 
user is needed within the area of the application's window.

Regards

Rolf


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] UserControl UserContainer

2008-09-18 Thread Benoit Minisini
On jeudi 18 septembre 2008, Kari Laine wrote:
 Hi,

 is there any documentation about UserControl and UserContainer classes?
 I can't find any...

 Best Regards
 Kari

What do you want to know specifically?

UserControl is a Container that you use when you want to implement a Control 
in Gambas that mix several other controls.

UserContainer is a Container that you use when you want to implement a 
Container in Gambas. It has a special property named _Container that you must 
set with the real container control if you want to create a MultiContainer 
container, like the Wizard container for example.

-- 
Benoit Minisini

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] UserControl UserContainer

2008-09-18 Thread Kari Laine
On Thu, Sep 18, 2008 at 4:50 PM, Benoit Minisini 
[EMAIL PROTECTED] wrote:

 On jeudi 18 septembre 2008, Kari Laine wrote:
  Hi,
 
  is there any documentation about UserControl and UserContainer classes?
  I can't find any...
 
  Best Regards
  Kari

 What do you want to know specifically?

 UserControl is a Container that you use when you want to implement a
 Control
 in Gambas that mix several other controls.

 UserContainer is a Container that you use when you want to implement a
 Container in Gambas. It has a special property named _Container that you
 must
 set with the real container control if you want to create a
 MultiContainer
 container, like the Wizard container for example.

 --
 Benoit Minisini


Thanks for definition!

I had a look at gb.form and many of it's classes inherit UserControl. I was
in search what functions and data UserControl provides. I will postpone
this exercise  until I can read Gambas source...

Best Regards
Kari
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Observer ?

2008-09-18 Thread Kari Laine
Hi,

would it be too much asked if someone kind enough would post little project,
which shows how to use observer to subclass TextBox or whatever normal
control? I mean so that the observer gets first peek to events and then
passes them on. Benoit posted little nugget about ListBox but can't get it
to work.
In gb.form source observer is used but little differently and it is still
over my head.

I have now used three hours to get it to work and no carrot.

Best Regards
Kari Laine
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] generating new gambas file [automatic program update]

2008-09-18 Thread Doriano Blengino
Szenográdi Norbert Péter ha scritto:
 Hi All,

 Can I create a simple project with automatic update option?
 Well, when user starting a program, program will checking a new version
 from a portal etc.
 If new version possible change itself and restart a new version.

 This is possible?
   
I think it is possible, althought it can be better to do it through a 
shell script.
Not sure about this, but you could do something like that:

' some code to determine if a new version is available
shell cd /tmp; wget http://your.server/updates/your-program.gambas; 
WAIT
shell mv /tmp/your-program.gambas /usr/local/bin/   ' this rewrite 
the old executable
shell /usr/local/bin/your-program.gambas   ' two 
instances of the same program...
quit


This snippet relies on a possibility that only *nix has - to [re]write a 
file while it is still in use (if it is).
Don't know if gambas interpreter keeps the file open while executing, 
but this should be ininfluent.
With the shell  you launch a second instance of the same program, 
which will be the updated file (bytecode).
Then the current application terminates.

There is a moment where two instances of the same application run 
concurrently, so
open files, or other system-wide resources, must be closed before doing 
that.


This is an overall idea - but it should work.

Regards


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Listview (simple?) problem

2008-09-18 Thread Gianni Piccini
On 18/09/2008 Fabien Bodard wrote:

 Easy no ? but you need to store the value of the deleted row for the 
 move.

That's another way, but I should test if it make difficulties when trying to 
swap item 0 with the previous :-)
I think that (for my use, a small list of different items) the best thing is 
to build an array when selecting an item and check what position has the 
selected item text: with this, I can enable or disable appropriate buttons.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Observer ?

2008-09-18 Thread Benoit Minisini
On jeudi 18 septembre 2008, Kari Laine wrote:
 Hi,

 would it be too much asked if someone kind enough would post little
 project, which shows how to use observer to subclass TextBox or whatever
 normal control? I mean so that the observer gets first peek to events and
 then passes them on. Benoit posted little nugget about ListBox but can't
 get it to work.
 In gb.form source observer is used but little differently and it is still
 over my head.

 I have now used three hours to get it to work and no carrot.

 Best Regards
 Kari Laine

Here it is.

Note that there is a design error in the compiler that force you to 
use compile all when a project class is exported. If you use compile 
only, some needed information files are not generated, and the exported class 
will not be exported.

Regards,

-- 
Benoit Minisini


Export-0.0.1.tar.gz
Description: application/tgz
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user