Re: [Gambas-user] Resize event...

2008-11-12 Thread Doriano Blengino
Stephen Bungay ha scritto:
Well, after much consultation with Benoit I finally understand what 
 is going on and how to get around the problem.

For the benefit of anyone else who has been reading this thread, 
 Doraino and I were talking about instantiating a form inside a container 
 on another form and resizing that embedded form when the parent is resized.

In a nutshell the solution is to reference the instantiated form by 
 it's handle reference, created at the time of it being instantiated, and 
 NOT by its' name.

 For example, consider an application that has three form classes, 
 FormMain, FormX, and FormY. Form Main will contain a tabstrip and inside 
 that tabstrip we want to instantiate FormX on tabstrip index 0 and FormY 
 on tabstrip index 1. When we resize FormMain we want the embedded forms 
 in their tabs to resize appropriately. Our FormMain Class logic might 
 look like this;

 ' Gambas class file
 Private mFormInitialized as Boolean
 Private mhFormX As FormX
 Private mhFormY AS FormY

 Public Sub Form_Open()
InitializeControls
 End


 Private Sub InitializeControls()
TabStrip1.Index = 0
mhFormX = New FormX(TabStrip1)

TabStrip1.Index = 1
mhFormY = New FormY(TabStrip1)

TabStrip1.Index = 0

mFormInitialized = True
 End


 Public Sub Form_Resize()
With TabStrip1
 .Width = .Parent.width - 10
 .Height = .Parent.height - 20
 mhFormX.Resize(TabStrip1.Width - 10, Tabstrip1.Height - 10)
 mhFormY.Resize(TabStrip1.Width - 10, Tabstrip1.Height - 10)
End With
 End

The resize events in the forms referenced by mhFormX and mhFormY will 
 now fire as expected, the embedded forms resize events will now fire as 
 expected.

 Steve.
   
Something strange is happening now.
I remember something wrong when embedding forms in tabstrip, for sure, 
and proof is you encounter the same problem. But yesterday I tried again 
to embed, and I found nothing wrong - both resize and open event were 
called in the embedded form (resize event was a little slower when 
embedded, but who cares). I tried both QT and GTK.
I never changed my version of Gambas, which is 2.0.0, so it is not a 
version issue. The only wrong thing is that a

mhFormY = New FormY(TabStrip1) as evformy

doesn't work, and an observer is needed.

Now we come to your source. The mFormInitialized variable serves what 
purpose?
Then, where is the point to explicitly resize FormX and FormY in a 
manner so convolute? At the time the form is instanciated, it could be 
resized - so a single routine can be used to open as many forms are needed.
Next, who says that FormX wants to be resized to its 
container.width-10 and container.height-10? When I say independence, 
I mean that FormMain has to embed another form, without knowing what 
that form will do with its geometry. If the explicit call to 
FormX.resize() has only the purpose to raise a resize event, well - I 
understand: when the resize event fires, the embedded form can do 
whatever it wants. But for me, the resize event was firing without any 
special processing.

All this seems messed, but I have a solution/request. How about an 
extended syntax to RAISE, which permit to send an event to a specified 
object? Like this:

RAISE resize TO mhFormX

If the TO keyword is not specified, the event is sended, just like now, 
to the parent object.
Anyway, this should be not needed in this case - I repeat - for me the 
embedded forms receive form_open and form_resize - still I am sure that 
there was something wrong, but can't remember what...

This evening I will send my test project, if anybody can care.

Regards,
Doriano


-
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] Centos? x86_64 vs i386? GTK vs QT?

2008-11-12 Thread Frank Cox
Hello folks!

I installed Gambas2 about two hours ago and have been sitting here in awe since
then.  To say that I'm impressed would be an understatement, and I'm truly
looking forward to playing with this wonderful toy.

I have three fairly basic questions (so far) and hope you will bear with me
while I try to get up to speed here:

First, while my personal desktop and development machine currently runs Fedora
9/x86_64, I maintain some Centos 5/i386 application servers.  I would like to
be able to develop stuff on my machine here and copy it to the application
servers and have it just work if I can.

Gambas creates something that the file command tells me is a gbr2 script text
executable when you tell it to make an executable, and that script depends on
gbx2. Is there a difference between a gambas-created executable made on an
x86_64 machine and one made on an i386 machine?  Can I create an executable with
gambas2 on my x86_64 machine and expect that it will just-work on an i386 box? 

Related to this, while gambas2 lives in the standard Fedora 9 repository, I
haven't yet found a gambas2 i386 rpm for Centos 5.  Is there one available for
downloading somewhere that I haven't looked yet, or do I have to compile that
myself? And if I have to compile it myself, what's the easy way to do that?
Could I just grab a .src.rpm from somewhere and run rpmbuild--rebuild on a
Centos box?

And thirdly, is there a practical difference between a QT and a GTK
gambas project? My hello world looks pretty much the same regardless of which
option I pick.

-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.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


Re: [Gambas-user] Resize event...

2008-11-12 Thread Stephen Bungay

  Now we come to your source. The mFormInitialized variable serves what
  purpose?

   mFormInitialized is a hold over from something I used to do in VB, 
and ocaisionally find useful in Gambas, so I just never removed it. Call 
that a force of habit. It has proven useful allowing the Initialize 
Controls subroutine to behave differently based on the value of the 
boolean flag.


  Then, where is the point to explicitly resize FormX and FormY in a
  manner so convolute? At the time the form is instanciated, it could be
  resized - so a single routine can be used to open as many forms are 
needed.


   Actually it is resized at the time it is instantiated. What were 
doing here is making sure that the embedded forms that we want to resize 
actually do resize.


  Next, who says that FormX wants to be resized to its
  container.width-10 and container.height-10? When I say independence,


   Um... not to put too fine a point on it but the one who says that a 
form 'wants to be resized is the programmer, purely their judgement 
call, and no one else's. The programmer is the one in control, if he/she 
  doesn't want FormX to be resized then simply don't call the resize 
method. If he/she wants to resize it to container.Width-50 them by all 
means do so. It is up to them. Full stop.

  I mean that FormMain has to embed another form, without knowing what
  that form will do with its geometry. If the explicit call to
  FormX.resize() has only the purpose to raise a resize event, well - I
  understand: when the resize event fires, the embedded form can do
  whatever it wants. But for me, the resize event was firing without any
  special processing.

   Yes, the point is that the embedded form can do whatever it wants, 
but it basis its' actions on what form main has done. Therefore the 
embedded form can be loosely coupled to it's host, passing information 
back and forth via properties and events.

 
  All this seems messed, but I have a solution/request. How about an
  extended syntax to RAISE, which permit to send an event to a specified
  object? Like this:
 
  RAISE resize TO mhFormX
 
  If the TO keyword is not specified, the event is sended, just like 
 now, to the parent object.

  I can see where that would be useful for raising events that can not 
be raised any other way. With the resize event we can raise it simply by 
calling the resize method, so that is not a good example.

  Anyway, this should be not needed in this case - I repeat - for me the
  embedded forms receive form_open and form_resize - still I am sure that
  there was something wrong, but can't remember what...
 
  This evening I will send my test project, if anybody can care.

   I'd be interested in learning your results and, although I'm no guru, 
perhaps I might see something you miss,... and of course it works the 
other way around... you might see something I've missed. Certainly if 
you had not replies to my initial email I might not have started talking 
to Benoit and would still be flailing about. Community helps.


Doriano Blengino wrote:
 Stephen Bungay ha scritto:
Well, after much consultation with Benoit I finally understand what 
 is going on and how to get around the problem.

For the benefit of anyone else who has been reading this thread, 
 Doraino and I were talking about instantiating a form inside a container 
 on another form and resizing that embedded form when the parent is resized.

In a nutshell the solution is to reference the instantiated form by 
 it's handle reference, created at the time of it being instantiated, and 
 NOT by its' name.

 For example, consider an application that has three form classes, 
 FormMain, FormX, and FormY. Form Main will contain a tabstrip and inside 
 that tabstrip we want to instantiate FormX on tabstrip index 0 and FormY 
 on tabstrip index 1. When we resize FormMain we want the embedded forms 
 in their tabs to resize appropriately. Our FormMain Class logic might 
 look like this;

 ' Gambas class file
 Private mFormInitialized as Boolean
 Private mhFormX As FormX
 Private mhFormY AS FormY

 Public Sub Form_Open()
InitializeControls
 End


 Private Sub InitializeControls()
TabStrip1.Index = 0
mhFormX = New FormX(TabStrip1)

TabStrip1.Index = 1
mhFormY = New FormY(TabStrip1)

TabStrip1.Index = 0

mFormInitialized = True
 End


 Public Sub Form_Resize()
With TabStrip1
 .Width = .Parent.width - 10
 .Height = .Parent.height - 20
 mhFormX.Resize(TabStrip1.Width - 10, Tabstrip1.Height - 10)
 mhFormY.Resize(TabStrip1.Width - 10, Tabstrip1.Height - 10)
End With
 End

The resize events in the forms referenced by mhFormX and mhFormY will 
 now fire as expected, the embedded forms resize events will now fire as 
 expected.

 Steve.
   
 Something strange is happening now.
 I remember something wrong when embedding forms in tabstrip, for sure, 
 and proof is you encounter the same problem. But 

[Gambas-user] Multidimensional dynamic class objects

2008-11-12 Thread Stefan Miefert
Hello,

how can i do this:)

something like

public objec as classname[]




-
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] Multidimensional dynamic class objects

2008-11-12 Thread Benoit Minisini
On mercredi 12 novembre 2008, Stefan Miefert wrote:
 Hello,

 how can i do this:)

 something like

 public objec as classname[]


You can do it in Gambas 3 only.

In Gambas 2, you must use PUBLIC MyObject AS Object[]

Regards,

-- 
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] Multidimensional dynamic class objects

2008-11-12 Thread Stefan Miefert


You can do it in Gambas 3 only.

In Gambas 2, you must use PUBLIC MyObject AS Object[]
Hello,

And how do it ona  class?

Public my object as new class[] ?!?

-
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] Latest Gambas packages for Ubuntu - Broken?

2008-11-12 Thread Daniel Campos


 I was also concerned because the update said that it wanted to remove those
 Gambas programs that I have developed myself, and installed using synaptic
 so that I can update them as I go. I assume that I will have to recompile
 and reinstall those packages?


If your packages depend on a concrete version, you should at least update
Debian Package information a rebuild them, yes.
-
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] Resize event...

2008-11-12 Thread Stephen Bungay
Look forward to it.

Doriano Blengino wrote:
 Stephen Bungay ha scritto:
   Now we come to your source. The mFormInitialized variable serves what
   purpose?

mFormInitialized is a hold over from something I used to do in VB, 
 and ocaisionally find useful in Gambas, so I just never removed it. Call 
 that a force of habit. It has proven useful allowing the Initialize 
 Controls subroutine to behave differently based on the value of the 
 boolean flag.
   
 Agreed.
   Then, where is the point to explicitly resize FormX and FormY in a
   manner so convolute? At the time the form is instanciated, it could be
   resized - so a single routine can be used to open as many forms are 
 needed.


Actually it is resized at the time it is instantiated. What were 
 doing here is making sure that the embedded forms that we want to resize 
 actually do resize.
   
 No, it is not so - and, your way could be more correct.
 The children forms are first instanciated - stop. Then, when a 
 Form_resize event arrives for the main form, the main form resizes the 
 children forms.
 So we are both wrong... :-
 Your way could be more correct, or mine... it depends on the logic of 
 program and other things, like the order initial events are sended to forms.
 
   Next, who says that FormX wants to be resized to its
   container.width-10 and container.height-10? When I say independence,


Um... not to put too fine a point on it but the one who says that a 
 form 'wants to be resized is the programmer, purely their judgement 
 call, and no one else's. The programmer is the one in control, if he/she 
   doesn't want FormX to be resized then simply don't call the resize 
 method. If he/she wants to resize it to container.Width-50 them by all 
 means do so. It is up to them. Full stop.
   
 I wrote a sort of MDI application, where the MDI (children) forms are 
 not walking in the main window but instead are put inside a tabstrip 
 (the same as you). There are four or five different form types, and 
 there can be multiple instances of the same form (with different data). 
 At any given moment, the tabstrip can have 1 tab, 2, or 8 (there is a 
 limit). So, in the resize event of the main form, I don't want to call 
 each children form. I want that the embedded forms receive a resize 
 event if, and only if, they are resized. If my main form is resized, but 
 my tabstrip is not, then the children form should not be resized. If my 
 main form has two tabstrips - one expanding and the other not, then 
 things get more complicated. I don't want to be in control for 
 everything, where should be mechanisms to do the work in place of me.
 
   I mean that FormMain has to embed another form, without knowing what
   that form will do with its geometry. If the explicit call to
   FormX.resize() has only the purpose to raise a resize event, well - I
   understand: when the resize event fires, the embedded form can do
   whatever it wants. But for me, the resize event was firing without any
   special processing.

Yes, the point is that the embedded form can do whatever it wants, 
 but it basis its' actions on what form main has done. Therefore the 
 embedded form can be loosely coupled to it's host, passing information 
 back and forth via properties and events.
   
 Passing information through properties and events? I had a lot of 
 problems with it...
 I think embedding a form inside a tabstrip makes sense if you have many 
 of them, dynamic. If it is not so, then why not copy and paste controls 
 from a tabstrip page to another, and voilĂ ?
 With dynamic forms, problem is when a form chooses to close. How to 
 close the hosting tab?...
 
  
   All this seems messed, but I have a solution/request. How about an
   extended syntax to RAISE, which permit to send an event to a specified
   object? Like this:
  
   RAISE resize TO mhFormX
  
   If the TO keyword is not specified, the event is sended, just like 
  now, to the parent object.

   I can see where that would be useful for raising events that can not 
 be raised any other way. With the resize event we can raise it simply by 
 calling the resize method, so that is not a good example.
   
 There is a lot of difference, indeed. A raise event only tells to the 
 destination form you have been resized; please check. Calling its 
 resize method simply resizes the form and does not tells you have been 
 resized. If you choose to resize the destination form, then you 
 override its logic. If you send it an event, you use its logic. This is 
 different...
 More about this. If a form receives a resize event, and decides to 
 resize itself, then a new resize event is fired, which causes the form 
 to be resized, which unleash another resize event... stack overflow! So 
 you can not resize a form inside its resize event handler... or what? I 
 will investigate on this too.
 
   Anyway, this should be not needed in this case - I repeat - for me the
   embedded forms receive form_open 

[Gambas-user] Bug: in gb, net socket client code in combination with gb.qt

2008-11-12 Thread Ron
Hmm, got stuck on another strange bug, preventing me from releasing my 
project grrr...

I posted sometime ago already that after changes in svn I got weird 
errors like these:

QSocketNotifier: Multiple socket notifiers for same socket 18 and type read

BUT, my socket code is almost the same  as the Gambas example project 
'ClientSocket' which worked ok.
I was driving me nuts.

Then I got a lightbulb moment telling me that QSocketNofifier is a QT 
thing, so if you change ClientSocket to use component gb.qt instead of 
gb.gtk, it has the same bug!!

If you read a socket you get the above error and no input.

I have done my part, now Benoit can fix it, lol..


Using Gambas 2,9 from svn today, and Ubuntu 8.04, and gb.qt.


I never had thought that QT had something to do with network sockets.

Regards,
Ron_2nd.





-
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] Bug: in gb, net socket client code in combination with gb.qt

2008-11-12 Thread Benoit Minisini
On mercredi 12 novembre 2008, Ron wrote:
 Hmm, got stuck on another strange bug, preventing me from releasing my
 project grrr...

 I posted sometime ago already that after changes in svn I got weird
 errors like these:

 QSocketNotifier: Multiple socket notifiers for same socket 18 and type read

 BUT, my socket code is almost the same  as the Gambas example project
 'ClientSocket' which worked ok.
 I was driving me nuts.

 Then I got a lightbulb moment telling me that QSocketNofifier is a QT
 thing, so if you change ClientSocket to use component gb.qt instead of
 gb.gtk, it has the same bug!!

 If you read a socket you get the above error and no input.

 I have done my part, now Benoit can fix it, lol..


 Using Gambas 2,9 from svn today, and Ubuntu 8.04, and gb.qt.


 I never had thought that QT had something to do with network sockets.

 Regards,
 Ron_2nd.

The ClientSocket example did not work, both with gb.gtk and gb.qt, because of 
a bug in the Socket source code.

I fixed the Socket class in the last revisions: now the example works again. 
But I do not have the warnings you get with Qt. Which Qt version do you use?

-- 
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] Latest Gambas packages for Ubuntu - Broken?

2008-11-12 Thread Gianni Piccini
On Tue, 11 Nov 2008 02:31:28 -0800 (PST) MaxVK [EMAIL PROTECTED]
wrote:

 Firstly, Gianni: What does apt-get pinning mean?

With apt-get, you can add a repository for the next version of your
distro, and use it only for some applications. I've not Ubuntu but
Debian, but it's similar, except for names (we are using stable,
unstable instead of intrepid etc etc).

If I want to use testing, but I want appxxx to be from unstable, I
can edit /etc/apt/preferences like this:

Package: appxxx*
Pin: release a=unstable
Pin-Priority: 950

Package: *
Pin: release a=testing
Pin-Priority: 900

And so apt-get will get all apps from testing, except appxxx, from
testing, and appxxx from unstable. Look for a how-to, I'm using memory
due on this pc I've not this file to check, and probably you'll have to
change unstable and testing with intrepid, hoary or what else.

Obviously, to upgrade appxxx, with Synaptic you can still choose
preferred version for all, and force version for appxxx, after you've
added repositories.

-
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] Draw Editor Dosn't Draw Circle AnyMore

2008-11-12 Thread richard terry
On Thu, 30 Oct 2008 10:10:28 pm Benoit Minisini wrote:
 On samedi 25 octobre 2008, richard terry wrote:
  On Fri, 24 Oct 2008 10:10:03 am Benoit Minisini wrote:
   On vendredi 24 octobre 2008, richard terry wrote:
Just noticed my app stopped being able to draw circles, so I checked
the draw editor and  it dosn't either, but the square still works
?why ?any ideas
   
Regards
   
Richard
  
   Can you give more details please?
 
   If build I think 1647.
 
  If  you edit a picture, and use the say draw a square button, you can 
  draw the square over the picture. If you use the circle tool, the cursor
  seems to draw the circle, but no circle ends up on the picture.
 
  The picture shows a square drawn, and  a screen dump whilst I'm drawing a
  circle with the mouse. However as soon as I release the mouse, there is
  no circle left on the picture, unlike the square which is left as you can
  see above. Remember that this dump is taken whilst holdiing the mouse
  down and the circle disappears (ie is not drawn) once the mouose is
  released
 
 
  Regards Richard
 
 
  Regards
 
 
  Richard

 I cannot reproduce your bug, both with Gambas 2 and Gambas 3. Each time I
 wanted to draw a circle, I had the circle drawn as expected.

 Someone else having this problem ?

Hi,

Still exists in latest builds on my machine. I went to another machine I  
don't use for programming and built gambas de-novo, same problem withi no 
circle.

Using KDE/kernel 2.6.27/gambas  1701 build.

As this little circle is important to me I wondered if Benoit could give me 
any way of tracking it down!!

Regards

Richard



-
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