[Gambas-user] Polynomiale Least Square

2017-04-18 Thread cheikh diabang
Hello. I would like to write gambas code which determines the polynomial of a 
set of x, y coordinates. Is there anyone who has used it to help me please.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Polynomiale Least Square

2017-04-18 Thread Tobias Boege
On Tue, 18 Apr 2017, cheikh diabang wrote:
> Hello. I would like to write gambas code which determines the polynomial of a 
> set of x, y coordinates. Is there anyone who has used it to help me please.

If your polynomial has real or complex coefficients you can use gb.gsl's [1]
Polynomial class. But while the documentation says arithmetic operators are
overloaded in gb.gsl, this isn't entirely true for polynomials. In particular
multiplication of polynomials is not supported. You have to implement that
yourself using the array accessors. Addition and multiplication of polynomials
is all you need for Lagrange polynomials [2] which solve your interpolation
problem. I have done it before, it's straightforward.

Regards,
Tobi

[1] http://gambaswiki.org/wiki/comp/gb.gsl
[2] https://en.wikipedia.org/wiki/Lagrange_polynomial

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1096: MDI toolbuttons with long text

2017-04-18 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1096&from=L21haW4-

Bruce BRUEN reported a new bug.

Summary
---

MDI toolbuttons with long text

Type : Bug
Priority : High
Gambas version   : 3.9.90 (TRUNK)
Product  : QT4 component


Description
---

I really don't understand what's going on here. Basically it's just a MDI 
toolbar on a form, inside that is a toolbutton with no picture just a text. If 
the button does not have an action then it displays properly, but as soon as I 
set an action for it then its' display width is totally broken?
At the moment (hopefully) the source has no action set. Just run it and see the 
full width button, then add an action to the button and run again.


System information
--

[System]
Gambas=3.9.90 r8118
OperatingSystem=Linux
Kernel=4.1.15-pclos1
Architecture=x86
Distribution=PCLinuxOS
Desktop=LXDE
Theme=Gtk
Language=en_AU.UTF-8
Memory=1005M

[Libraries]
Cairo=libcairo.so.2.11400.6
Curl=libcurl.so.3.0.0
Curl=libcurl.so.4.4.0
DBus=libdbus-1.so.3.14.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.603.0
GTK+2=libgtk-x11-2.0.so.0.2400.26
GTK+3=libgtk-3.so.0.1400.14
OpenGL=libGL.so.1.2.0
OpenGL=libGL.so.173.14.39
OpenGL=libGL.so.96.43.23
Poppler=libpoppler.so.13.0.0
Poppler=libpoppler.so.19.0.0
Poppler=libpoppler.so.46.0.0
Poppler=libpoppler.so.54.0.0
QT4=libQtCore.so.4.8.7
QT5=libQt5Core.so.5.4.2
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
BROWSER=/usr/bin/www-browser
CANBERRA_DRIVER=pulse
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-mcNH9lhiG6,guid=d68a2963a9d8c8c7c1db56dd58f5c871
DESKTOP_SESSION=LXDE
DISPLAY=:0
GB_GUI=gb.qt4
GCONF_TMPDIR=/tmp
GDMSESSION=04LXDE
GDM_XSERVER_LOCATION=local
GIT_PAGER=less -FRS
GPG_AGENT_INFO=/tmp/gpg-SDSJev/S.gpg-agent:5604:1
GTK_MODULES=canberra-gtk-module
G_FILENAME_ENCODING=@locale
HISTCONTROL=ignoredups
HISTSIZE=1000
HOME=
HOSTNAME=
INPUTRC=/etc/inputrc
LANG=en_AU.UTF-8
LANGUAGE=en_AU:en_GB:en
LC_ADDRESS=en_AU.UTF-8
LC_COLLATE=en_AU.UTF-8
LC_CTYPE=en_AU.UTF-8
LC_IDENTIFICATION=en_AU.UTF-8
LC_MEASUREMENT=en_AU.UTF-8
LC_MESSAGES=en_AU.UTF-8
LC_MONETARY=en_AU.UTF-8
LC_NAME=en_AU.UTF-8
LC_NUMERIC=en_AU.UTF-8
LC_PAPER=en_AU.UTF-8
LC_SOURCED=1
LC_TELEPHONE=en_AU.UTF-8
LC_TIME=en_AU.UTF-8
LESS=-MM
LESSCHARSET=utf-8
LESSKEY=/etc/.less
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=
LS_COLORS=
MAIL=/var/spool/mail/
MDV_MENU_STYLE=discovery
META_CLASS=desktop
NLSPATH=/usr/share/locale/%l/%N
PATH=/bin:/usr/bin:/usr/local/bin:/usr/games:/usr/lib/qt4/bin:/usr/lib/qt5/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/usr/lib/qt5/bin:/usr/bin:/usr/sbin:/usr/lib/kde4/libexec:/bin:/sbin:/usr/X11R6/bin:/usr/games:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/kde4/libexec
PKG_CONFIG_PATH=/usr/lib/pkgconfig
PWD=
PYTHONDONTWRITEBYTECODE=1
PYTHONSTARTUP=/etc/pythonrc.py
QT4DOCDIR=/usr/share/doc/qt4
QT5DOCDIR=/usr/share/doc/qt5
QTDIR=/usr/lib/qt4
QTDIR5=/usr/lib/qt5
QTINC=/usr/lib/qt3/include
QTLIB=/usr/lib
QT_PLUGIN_PATH=/usr/lib/qt4/plugins/:/usr/lib/kde4/plugins/:/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
QT_XFT=0
SAL_USE_VCLPLUGIN=gtk
SHELL=/bin/bash
SHLVL=1
SSH_AGENT_PID=5583
SSH_ASKPASS=/usr/lib/ssh/ssh-askpass
SSH_AUTH_SOCK=/tmp/ssh-TPWqWrS59N5q/agent.5582
TMP=/tmp
TMPDIR=/tmp
TZ=:/etc/localtime
USER=
WINDOWPATH=8
XAUTHORITY=/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/discovery:/etc/xdg
XDG_CONFIG_HOME=/.config
XDG_CURRENT_DESKTOP=LXDE
XDG_DATA_DIRS=/usr/local/share:/usr/share/gdm:/var/lib/menu-xdg:/usr/share:/usr/share/gdm/
XDG_MENU_PREFIX=lxde-
XDG_SESSION_COOKIE=82ab6c261883e9ffe2a80b674b7b435e-1492502639.576693-1595030565
XMODIFIERS=@im=none
_=/usr/bin/gambas3
_LXSESSION_PID=5525



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1096: MDI toolbuttons with long text

2017-04-18 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1096&from=L21haW4-

Bruce BRUEN added an attachment:

texttbs-0.0.2.tar.gz



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] TextLabel

2017-04-18 Thread Pino Zollo


El 18/04/17 a las 06:07, gambas-user-requ...@lists.sourceforge.net escribió:
> Does the documentation [1] answer your question?

Yes, it does...

Thank you Tobi

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Polynomiale Least Square

2017-04-18 Thread cheikh diabang
Thank you Tobias.

I've seen the explanation, I'm going. Next time


De : Tobias Boege 
Envoyé : mardi 18 avril 2017 09:55
À : mailing list for gambas users
Objet : Re: [Gambas-user] Polynomiale Least Square

On Tue, 18 Apr 2017, cheikh diabang wrote:
> Hello. I would like to write gambas code which determines the polynomial of a 
> set of x, y coordinates. Is there anyone who has used it to help me please.

If your polynomial has real or complex coefficients you can use gb.gsl's [1]
Polynomial class. But while the documentation says arithmetic operators are
overloaded in gb.gsl, this isn't entirely true for polynomials. In particular
multiplication of polynomials is not supported. You have to implement that
yourself using the array accessors. Addition and multiplication of polynomials
is all you need for Lagrange polynomials [2] which solve your interpolation
problem. I have done it before, it's straightforward.

Regards,
Tobi

[1] http://gambaswiki.org/wiki/comp/gb.gsl
Gambas Documentation - /comp/gb.gsl - 
gambaswiki.org
gambaswiki.org
gb.gsl. This component aims at providing most of the features of the Gnu 
Scientific Library. At the moment, it adds support for complex numbers, 
vectors, matrices and ...


[2] https://en.wikipedia.org/wiki/Lagrange_polynomial
Lagrange polynomial - 
Wikipedia
en.wikipedia.org
In numerical analysis, Lagrange polynomials are used for polynomial 
interpolation. For a given set of distinct points and numbers , the Lagrange 
polynomial is the ...



--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
SourceForge
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] New component gb.rss to generate and parse RSS documents

2017-04-18 Thread Tobias Boege
On Sun, 16 Apr 2017, Benoît Minisini wrote:
> Le 02/04/2017 à 18:07, Tobias Boege a écrit :
> >
> >   * The date conversion routines ignore timezones completely, because
> > I have no clue about working with timezones in Gambas.
> >
> 
> Hi, Tobias.
> 
> I have added in revision #8122 two functions to the gb.util component:
> 
> Date.ToRFC822(), to convert a Gambas date/time value to its RFC822 
> string representation, with the timezone.
> 
> Date.FromRFC822(), to do the contrary.
> 
> Tell me if you can use them, and if you need me to add the same 
> functions for RFC3339 date format used by Atom.
> 

Thanks for these. Reading the code (not testing it yet), I noticed four
things:

  * The weekday and second parts in the format are optional in the RFC
but mandatory in your parser.

  * The year is a 2-digit number in the RFC. The RSS spec says it prefers
4 digits. My current parser in gb.web.feed supports both, but treats
2-digit years XY as 19XY (which I think is the most sensible
interpretation with respect to the RFC but sadly excludes publication
dates for news items near Christ's birth).

  * There is no consistency check in the parser if, in case a weekday is
given, it matches the weekday of the date, like

  Fri, 18 Apr 2017 12:00:00 GMT

would be invalid by the RFC ("5.2 SEMANTICS"), because the 18 Apr 2017
is a Tuesday.

  * At one point you use Format$(..., "hh:nn:ss") which I think may be
dangerous, because Format$() (as per docs) replaces ":" by the locale-
specific time separator. I don't know if there are locales where this
is different from ":", but the RFC requires it to be ":" exactly.

My parser does these four things. If you want to add them, the gb.web.feed
code is sufficiently commented in the relevant places.

As for Atom, I don't have a definite plan for when I'll add these classes
(haven't even read the specs yet). I don't need the functions right now,
at least.

About the incorporation of timezones in gb.web.feed (the last thing before
I mark the component as "Unfinished but stable"), my plan is to replace the
Date variables in the Rss* classes by an RssDate compound, consisting of a
normalised Date and a Timezone string (or constant), with an "apply timezone"
method probably. If you have a better idea, please let me know.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] New component gb.rss to generate and parse RSS documents

2017-04-18 Thread Benoît Minisini
Le 18/04/2017 à 19:44, Tobias Boege a écrit :
> On Sun, 16 Apr 2017, Benoît Minisini wrote:
>> Le 02/04/2017 à 18:07, Tobias Boege a écrit :
>>>
>>>   * The date conversion routines ignore timezones completely, because
>>> I have no clue about working with timezones in Gambas.
>>>
>>
>> Hi, Tobias.
>>
>> I have added in revision #8122 two functions to the gb.util component:
>>
>> Date.ToRFC822(), to convert a Gambas date/time value to its RFC822
>> string representation, with the timezone.
>>
>> Date.FromRFC822(), to do the contrary.
>>
>> Tell me if you can use them, and if you need me to add the same
>> functions for RFC3339 date format used by Atom.
>>
>
> Thanks for these. Reading the code (not testing it yet), I noticed four
> things:
>
>   * The weekday and second parts in the format are optional in the RFC
> but mandatory in your parser.
>
>   * The year is a 2-digit number in the RFC. The RSS spec says it prefers
> 4 digits. My current parser in gb.web.feed supports both, but treats
> 2-digit years XY as 19XY (which I think is the most sensible
> interpretation with respect to the RFC but sadly excludes publication
> dates for news items near Christ's birth).
>
>   * There is no consistency check in the parser if, in case a weekday is
> given, it matches the weekday of the date, like
>
>   Fri, 18 Apr 2017 12:00:00 GMT
>
> would be invalid by the RFC ("5.2 SEMANTICS"), because the 18 Apr 2017
> is a Tuesday.
>
>   * At one point you use Format$(..., "hh:nn:ss") which I think may be
> dangerous, because Format$() (as per docs) replaces ":" by the locale-
> specific time separator. I don't know if there are locales where this
> is different from ":", but the RFC requires it to be ":" exactly.
>
> My parser does these four things. If you want to add them, the gb.web.feed
> code is sufficiently commented in the relevant places.

OK, I will look at it.

>
> As for Atom, I don't have a definite plan for when I'll add these classes
> (haven't even read the specs yet). I don't need the functions right now,
> at least.
>
> About the incorporation of timezones in gb.web.feed (the last thing before
> I mark the component as "Unfinished but stable"), my plan is to replace the
> Date variables in the Rss* classes by an RssDate compound, consisting of a
> normalised Date and a Timezone string (or constant), with an "apply timezone"
> method probably. If you have a better idea, please let me know.

What for? Timezone is only needed when dealing with Date as strings. 
Internally, all Date values should be stored UTC. In computing, time is 
absolute.

In other words, every date value has as many string representations as 
the number of possible timezones.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] New component gb.rss to generate and parse RSS documents

2017-04-18 Thread Tobias Boege
On Tue, 18 Apr 2017, Benoît Minisini wrote:
> > About the incorporation of timezones in gb.web.feed (the last thing before
> > I mark the component as "Unfinished but stable"), my plan is to replace the
> > Date variables in the Rss* classes by an RssDate compound, consisting of a
> > normalised Date and a Timezone string (or constant), with an "apply 
> > timezone"
> > method probably. If you have a better idea, please let me know.
> 
> What for? Timezone is only needed when dealing with Date as strings. 
> Internally, all Date values should be stored UTC. In computing, time is 
> absolute.
> 
> In other words, every date value has as many string representations as 
> the number of possible timezones.
> 

I agree, but in the conversion Gambas object -> XML string, I want to give
the user a way to specify the timezone that is printed in the string
representation, as you do in ToRFC822().

Since this timezone may be different for every RssItem (or even different
between PubDate and LastBuildDate for the same RssItem), I have to store
it somewhere along the normalised (UTC) Date and not have it passed as an
argument to Rss.ToString().

When reading XML string -> Gambas object this timezone property would be
rather useless, yes.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] New component gb.rss to generate and parse RSS documents

2017-04-18 Thread Benoît Minisini
I have took a look at your code.

Just a general remark: the name of the exported function arguments 
should help the user to guess what it means.

So, for example:

Static Public Function FormatDate(Dat As Date) As String

should be:

Static Public Function FormatDate({Date} As Date) As String

Better use full words instead of abbreviations! "{Date}" instead of 
"Dat", "{String}" (or "Value") instead of "Str", and so on.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] New component gb.rss to generate and parse RSS documents

2017-04-18 Thread Benoît Minisini
Le 18/04/2017 à 19:52, Benoît Minisini a écrit :
> Le 18/04/2017 à 19:44, Tobias Boege a écrit :
>> On Sun, 16 Apr 2017, Benoît Minisini wrote:
>>> Le 02/04/2017 à 18:07, Tobias Boege a écrit :

   * The date conversion routines ignore timezones completely, because
 I have no clue about working with timezones in Gambas.

>>>
>>> Hi, Tobias.
>>>
>>> I have added in revision #8122 two functions to the gb.util component:
>>>
>>> Date.ToRFC822(), to convert a Gambas date/time value to its RFC822
>>> string representation, with the timezone.
>>>
>>> Date.FromRFC822(), to do the contrary.
>>>
>>> Tell me if you can use them, and if you need me to add the same
>>> functions for RFC3339 date format used by Atom.
>>>
>>
>> Thanks for these. Reading the code (not testing it yet), I noticed four
>> things:
>>
>>   * The weekday and second parts in the format are optional in the RFC
>> but mandatory in your parser.
>>
>>   * The year is a 2-digit number in the RFC. The RSS spec says it prefers
>> 4 digits. My current parser in gb.web.feed supports both, but treats
>> 2-digit years XY as 19XY (which I think is the most sensible
>> interpretation with respect to the RFC but sadly excludes publication
>> dates for news items near Christ's birth).
>>
>>   * There is no consistency check in the parser if, in case a weekday is
>> given, it matches the weekday of the date, like
>>
>>   Fri, 18 Apr 2017 12:00:00 GMT
>>
>> would be invalid by the RFC ("5.2 SEMANTICS"), because the 18 Apr
>> 2017
>> is a Tuesday.
>>
>>   * At one point you use Format$(..., "hh:nn:ss") which I think may be
>> dangerous, because Format$() (as per docs) replaces ":" by the
>> locale-
>> specific time separator. I don't know if there are locales where this
>> is different from ":", but the RFC requires it to be ":" exactly.
>>
>> My parser does these four things. If you want to add them, the
>> gb.web.feed
>> code is sufficiently commented in the relevant places.
>
> OK, I will look at it.
>

I have updated the gb.util components with your fixes. Now I think you 
can use it directly in gb.web.feed.

Regards,

-- 
Benoît Minisini

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] How to dynamically add & populate variable number of tabs at runtime?

2017-04-18 Thread T Lee Davidson
Hello Folks,

I have been trying to figure out how to, at runtime, create a variable number 
of new tabs in a TabStrip, populate those tabs 
with Controls, and then be able to reference those controls, all dynamically.

There seems to be little information available as to how to 1) dynamically 
create controls, and 2) reference dynamically named 
controls after creation.

Even with just a simple experiment, I cannot get a GridView to display in a new 
tab. The Form has been given, at design-time, a 
TabStrip and two buttons. The tabs are 'closable'. One button, 'btnAddTab', 
creates a new tab and a GridView with the new, 
current tab as parent. (At least that's what I think it is doing.) The other 
button, 'btnTabInfo', displays info about the 
currently selected tab.

And, I am assuming the GridViews need to have unique names.

[code]
' Gambas class file


Public Sub btnAddTab_Click()
   Dim hGridView As GridView

   TabStrip1.Count += 1
   TabStrip1.Text = "Tab " & TabStrip1.Index
   hGridView = New GridView(TabStrip1) As "GridView" & TabStrip1.Index
   hGridView.Show
   TabStrip1.Refresh

End

Public Sub btnTabInfo_Click()

   Print TabStrip1.Children[0].Name
   Print TabStrip1.Children[0].Enabled
   Print TabStrip1.Children[0].Visible

End

Public Sub TabStrip1_Close(Index As Integer)

   TabStrip1.Index = Index
'   TabStrip1.Current.Children[0].Delete() 'Comment out to test if tab is empty
   TabStrip1.Current.Delete()

End
[/code]


Tab creation works, but the GridView control does not display. Any attempt to 
close a tab without first deleting its children 
causes an exception, showing that the tab is indeed being populated with a 
child control. Clicking on btnTabInfo for "Tab 1" gives:
GridView1
True
True

So, the program is doing at least some of what I've told it to. I'm obviously 
not telling it the right thing.

How does one:
1. Create new controls and make them visible?
2. Reference new controls after creation [ie. (de-)reference a string as a the 
name of a control]?


-- 
Lee


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to dynamically add & populate variable number of tabs at runtime?

2017-04-18 Thread Matti
Hi Lee,

first of all, you have to give the GridView a X, Y, width and height. Otherwise 
it's there but doesn't show.

To reference the GridViews, create an array of them and address them as 
GridView[0], GridView[1] and so on. The [i] is the number of the TabStrip index.

Here is an example of what I did recently (tsTasks is the TabStrip):

Private aTaskText As New Object[13]
Private aTaskCheck As New Object[13]
...
   For i = 1 To 12
 tsTasks[i - 1].Text = aMonths[i]
 tsTasks.Index = i - 1

 aTaskText[i] = New TextBox(tsTasks) As "Tasks"
 With aTaskText[i]
   .X = 77
   .Y = 21
   .Width = 728
   .Height = 35
 End With

 aTaskCheck[i] = New CheckBox(tsTasks) As "CheckDone"
 With aTaskCheck[i]
   .X = 840
   .Y = 28
   .Width = 126
   .Height = 21
   .Text = ("done")
   .Tag = i
 End With


Am 19.04.2017 um 01:58 schrieb T Lee Davidson:
> Hello Folks,
>
> I have been trying to figure out how to, at runtime, create a variable number 
> of new tabs in a TabStrip, populate those tabs
> with Controls, and then be able to reference those controls, all dynamically.
>
> There seems to be little information available as to how to 1) dynamically 
> create controls, and 2) reference dynamically named
> controls after creation.
>
> Even with just a simple experiment, I cannot get a GridView to display in a 
> new tab. The Form has been given, at design-time, a
> TabStrip and two buttons. The tabs are 'closable'. One button, 'btnAddTab', 
> creates a new tab and a GridView with the new,
> current tab as parent. (At least that's what I think it is doing.) The other 
> button, 'btnTabInfo', displays info about the
> currently selected tab.
>
> And, I am assuming the GridViews need to have unique names.
>
> [code]
> ' Gambas class file
>
>
> Public Sub btnAddTab_Click()
> Dim hGridView As GridView
>
> TabStrip1.Count += 1
> TabStrip1.Text = "Tab " & TabStrip1.Index
> hGridView = New GridView(TabStrip1) As "GridView" & TabStrip1.Index
> hGridView.Show
> TabStrip1.Refresh
>
> End
>
> Public Sub btnTabInfo_Click()
>
> Print TabStrip1.Children[0].Name
> Print TabStrip1.Children[0].Enabled
> Print TabStrip1.Children[0].Visible
>
> End
>
> Public Sub TabStrip1_Close(Index As Integer)
>
> TabStrip1.Index = Index
> '   TabStrip1.Current.Children[0].Delete() 'Comment out to test if tab is 
> empty
> TabStrip1.Current.Delete()
>
> End
> [/code]
>
>
> Tab creation works, but the GridView control does not display. Any attempt to 
> close a tab without first deleting its children
> causes an exception, showing that the tab is indeed being populated with a 
> child control. Clicking on btnTabInfo for "Tab 1" gives:
> GridView1
> True
> True
>
> So, the program is doing at least some of what I've told it to. I'm obviously 
> not telling it the right thing.
>
> How does one:
> 1. Create new controls and make them visible?
> 2. Reference new controls after creation [ie. (de-)reference a string as a 
> the name of a control]?
>
>

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user