Re: [Gambas-user] Switching between forms in tabstrip

2009-02-26 Thread Vackoy

Dimitris,
thanks for the tip. I can get the Keypress event from the form and get the
combination for Ctrl + Tab.
However, since I have a Workspace, I don't know how to access the Tabstrip
control or how to index the forms in it.
Any thoughts?

Thanks


Dimitris Anogiatis wrote:
 
 If I may add my 2 cents worth,
 

-- 
View this message in context: 
http://www.nabble.com/Switching-between-forms-in-tabstrip-tp22206694p3618.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-26 Thread Benoît Minisini
 Dimitris,
 thanks for the tip. I can get the Keypress event from the form and get the
 combination for Ctrl + Tab.
 However, since I have a Workspace, I don't know how to access the Tabstrip
 control or how to index the forms in it.

You don't.

You must use the Workspace.Children property to get an array of all child 
windows, choose your window, and then set the Workspace.ActiveWindow property.

Regards,

-- 
Benoît

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-26 Thread Dimitris Anogiatis
After reading Benoît 's guidelines and going through my previous example
I came up with this.

PUBLIC SUB Form_KeyPress()
  IF Key.Control
SELECT CASE Workspace1.Children.Find(Workspace1.ActiveWindow)
 CASE 0 TO Workspace1.Children.Count - 2
Workspace1.ActiveWindow =
Workspace1.Children[Workspace1.Children.Find(Workspace1.ActiveWindow) + 1]
 CASE Workspace1.Children.Count - 1
Workspace1.ActiveWindow = Workspace1.Children[0]
 CASE ELSE
END SELECT
  ENDIF
END

Add this to the code of the form that has the workspace

it should have the desired effect.

Hopefully this will bring you closer to what you want to do.

Regards
Dimitris

On Thu, Feb 26, 2009 at 6:20 AM, Benoît Minisini 
gam...@users.sourceforge.net wrote:

  Dimitris,
  thanks for the tip. I can get the Keypress event from the form and get
 the
  combination for Ctrl + Tab.
  However, since I have a Workspace, I don't know how to access the
 Tabstrip
  control or how to index the forms in it.

 You don't.

 You must use the Workspace.Children property to get an array of all child
 windows, choose your window, and then set the Workspace.ActiveWindow
 property.

 Regards,

 --
 Benoît


 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-26 Thread Vackoy

I tried this last example and it worked like a charm. Thanks.

Marcel

-- 
View this message in context: 
http://www.nabble.com/Switching-between-forms-in-tabstrip-tp22206694p22233025.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-26 Thread Dimitris Anogiatis
Glad I could help Marcel :)

On Thu, Feb 26, 2009 at 1:33 PM, Vackoy marcel.duf...@gmail.com wrote:


 I tried this last example and it worked like a charm. Thanks.

 Marcel

 --
 View this message in context:
 http://www.nabble.com/Switching-between-forms-in-tabstrip-tp22206694p22233025.html
 Sent from the gambas-user mailing list archive at Nabble.com.



 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Switching between forms in tabstrip

2009-02-25 Thread Vackoy

Hi,
has anyone tried this before? switching between tabs without clicking them.
Doing it from code pressing Crtl + Tab or something, like Firefox does.

Thanks,
Marcel

-- 
View this message in context: 
http://www.nabble.com/Switching-between-forms-in-tabstrip-tp22206694p22206694.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-25 Thread Jack
Le mercredi 25 février 2009 18:03:29 Vackoy, vous avez écrit :
 Yes, but which element/object is the observer for the Keypress?
 I tried with Workspace.Keypress but when I open a form, the observer
 becomes the form and not the workspace, so no matter what key I press it
 doesn't raise the event...

 M0E Lnx wrote:
  Have not tried it but I imagine you can code that in the
  windows_Keypress() event.
  Should be doable

As Moe told to you, you can use windows_Keypress() event

EX. suppose you have two textbox named textbox1 and textbox2 declared in group 
tbox with tag 1  2. 
This procedure below show you how going textbox1 to textbox2  and textbox2 to 
textbox1.

PUBLIC SUB Tbox_KeyPress()
IF Key.code = Key.enter OR Key.code = Key.Return OR Key.code = Key.Tab THEN
SELECT CASE LAST.tag

CASE 1
  Textbox2.SetFocus
  STOP EVENT

CASE 2
  Textbox1.SetFocus
  STOP EVENT
endif
end

I hope that it is it that you want

Jacky


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-25 Thread Vackoy

@jacky-12
I understand that but that is not what I need. 
Let me see if I can explain it better.
I have a workspace and add several forms to it. In each for i have different
controls as textboxes, buttons, gridviews, etc.
The thing is that I want to be able to switch between forms with some key
combination (i.e. Ctrl + Tab) but the keypress event depends on the control
that has the focus and not on the tabstrip or the workspace.
So how can I get the keypress regardless the control or object that has
the focus.

Is there another way of doing this?

Thanks.

Marcel




jacky-12 wrote:
 
 Le mercredi 25 février 2009 18:03:29 Vackoy, vous avez écrit :
 Yes, but which element/object is the observer for the Keypress?
 I tried with Workspace.Keypress but when I open a form, the observer
 becomes the form and not the workspace, so no matter what key I press it
 doesn't raise the event...

 M0E Lnx wrote:
  Have not tried it but I imagine you can code that in the
  windows_Keypress() event.
  Should be doable
 
 As Moe told to you, you can use windows_Keypress() event
 
 EX. suppose you have two textbox named textbox1 and textbox2 declared in
 group 
 tbox with tag 1  2. 
 This procedure below show you how going textbox1 to textbox2  and textbox2
 to 
 textbox1.
 
 PUBLIC SUB Tbox_KeyPress()
 IF Key.code = Key.enter OR Key.code = Key.Return OR Key.code = Key.Tab
 THEN
 SELECT CASE LAST.tag
 
 CASE 1
   Textbox2.SetFocus
   STOP EVENT
 
 CASE 2
   Textbox1.SetFocus
   STOP EVENT
 endif
 end
 
 I hope that it is it that you want
 
 Jacky
 
 
 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Switching-between-forms-in-tabstrip-tp22206694p22207784.html
Sent from the gambas-user mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-25 Thread Benoît Minisini
 @jacky-12
 I understand that but that is not what I need.
 Let me see if I can explain it better.
 I have a workspace and add several forms to it. In each for i have
 different controls as textboxes, buttons, gridviews, etc.
 The thing is that I want to be able to switch between forms with some key
 combination (i.e. Ctrl + Tab) but the keypress event depends on the control
 that has the focus and not on the tabstrip or the workspace.
 So how can I get the keypress regardless the control or object that has
 the focus.

 Is there another way of doing this?

 Thanks.

 Marcel


You need a support for global shortcuts. On Gambas, the only way to do it is 
creating an hidden menu with one menu item for each action, each item having a 
shortcut.

Regards,

-- 
Benoît

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-25 Thread Doriano Blengino
Vackoy ha scritto:
 @jacky-12
 I understand that but that is not what I need. 
 Let me see if I can explain it better.
 I have a workspace and add several forms to it. In each for i have different
 controls as textboxes, buttons, gridviews, etc.
 The thing is that I want to be able to switch between forms with some key
 combination (i.e. Ctrl + Tab) but the keypress event depends on the control
 that has the focus and not on the tabstrip or the workspace.
 So how can I get the keypress regardless the control or object that has
 the focus.

 Is there another way of doing this?
   
I had the same problem some time ago.
The ultimate response is, you can't. To do that, it would be needed a 
KeyPreview property of the form, which lets the form intercept all the 
keypresses before they arrive to its controls, perhaps even before they 
reach the Menu.

I managed this situation by using a Menu item, and setting its shortcut. 
In the event handler of that menu, you can do whatever you want. This 
menu should be hidden, but it was reported that hidden Menus don't 
trigger events... but for me it worked (the shortcut was Enter!) - may 
be there are differences from GTK or QT.

Regards,
Doriano


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Switching between forms in tabstrip

2009-02-25 Thread Dimitris Anogiatis
If I may add my 2 cents worth,

if you just use the form_keypress event
you might be able to do what you want.

this is my attempt; tbsettings is my tabstrip control
I have 4 tabs (with index 0 to 3)

add this to the form that you have the tabstrip onto

PUBLIC SUB Form_KeyPress()

  IF Key.Control THEN

SELECT CASE tbSettings.Index
  CASE 0 TO 2
INC tbSettings.Index
  CASE 3
tbSettings.index = 0
  CASE ELSE
END SELECT

  END IF

END

this would result in moving to the next tab when you just press
the control key

I haven't been able to make it to work with a combination of keys
but in Gambas 2.10 it works no matter what control has the focus

I only have one tabstrip control on my GUI so I am not sure if this
solution would work on multiple tabstrips or other layouts

Hope it helps and it's close to what you wanna do.

Regards,
Dimitrios

On Wed, Feb 25, 2009 at 12:14 PM, Doriano Blengino 
doriano.bleng...@fastwebnet.it wrote:

 Vackoy ha scritto:
  Thanks everyone for your responses.
  I think that what Benoit and Doriano suggested are in the way of what I
  need.
 
  Doriano, the layout of what I have is the following:
  * a main form
  * a workspace
  * several forms added to the workspace by .add method
 
  Where should I add the menu, in the main form? the workspace? sorry but
 is
  beyond what I have tried before
  Thanks.
 
 I think you should add the menu to the main form, but I never tried
 workspaces; I am happy with plain tabstrips.
 So, I really don't know if it works well with workspaces, because inside
 them there can be another menu, I suppose (well, this is true for
 tabstrips too, they can embed other forms). It is not clear to me the
 path events take to go from X11 to widget system to gambas to whatever ;-)

 Take a try... it should be quick and easy... good luck!

 Regards,
 Doriano




 --
 Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
 CA
 -OSBC tackles the biggest issue in open source: Open Sourcing the
 Enterprise
 -Strategies to boost innovation and cut costs with open source
 participation
 -Receive a $600 discount off the registration fee with the source code:
 SFAD
 http://p.sf.net/sfu/XcvMzF8H
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user