Discussion:
About gambas new IDE
(too old to reply)
fabien Bodard
2006-04-01 13:12:45 UTC
Permalink
Hi, I'm come back ;-P

I've tested the gambas 1.9.28 IDE... lol... nothing really new.

But it's time i think for all of us to tell to you (Benoit), what are our
dreams for this new IDE.


So this is for my part my ideas:

- First a fully dockable tool windows it's possible now with the reparent
function to move windows childs everywhere we need. (so have the flexibility
of gimp/adobe/ and some kde tools)


- Single Mdichild editor or tabbed editor ?

in my mind an editor need to be stored in a tabstrip... (okok i already heard
some poeple tha say me ... i want to compare some time two codes... but i
think there is certainly some possibilities.

- I think the new ide will need to have a project conf file stored in the user
confdir or directly in the project.

- gambas need to have more and more drag and drop facilities.
for example ?
we a little intereting thing in qt and gtk toolkits... the stock function that
link to standards icons from the current toolkit. so imagin you just have to
click and drag to add a new picture in a button ?
One off the first problem i see is the stock structure... it's not really
gambas oriented. I explain :

If i want an open icon in kde, it's not the same key than the gtk one !
I think a thing like a dictionary (hem), to traduce an user keyword will be
better. sorry for this bad explanation.
pic = Stock("open_file")

I've trying to make a version for kde but i was not able to find automatiquely
the current icon theme path.

Always about editor facilities:
ctrl + Click on a widjet will open an input windows to set the caption (more
easy than search the text field in properties(maybe a shortcut will be
sufficient).


Ive mabe some others ideas... but i need to wait a little bit before talk
about them...

Maybe just one query to Benoit :
Can you explain me exactly what was doing you report manager in vb ... (in
private mail if you want)

Now to other gambasian maybe have you some ideas to the future gambas ide...
tell us:)

Regards,
Fabien Bodard
Almanova Sistemi
2006-04-01 14:31:17 UTC
Permalink
I delete a text area (TextArea.Delete). The on-line help says: Note that
a destroyed control becomes an invalid object.
How can I delete an object whitout an invalid object as result?

Thank's

Massimo
Rob Kudla
2006-04-01 17:03:37 UTC
Permalink
Note that a destroyed control becomes an invalid object.
How can I delete an object whitout an invalid object as
result?
You can assign null to the object reference, but either way it's
going to throw an error if you access it without checking it
first with isObject or something....

Rob
Benoit Minisini
2006-04-01 23:13:18 UTC
Permalink
Post by Almanova Sistemi
I delete a text area (TextArea.Delete). The on-line help says: Note that
a destroyed control becomes an invalid object.
How can I delete an object whitout an invalid object as result?
Thank's
Massimo
Why do you want to use something that does not exist anymore? :-)
--
Benoit Minisini
Almanova Sistemi
2006-04-03 08:22:08 UTC
Permalink
Post by Benoit Minisini
Post by Almanova Sistemi
I delete a text area (TextArea.Delete). The on-line help says: Note that
a destroyed control becomes an invalid object.
How can I delete an object whitout an invalid object as result?
Thank's
Massimo
Why do you want to use something that does not exist anymore? :-)
No, I don't want to use an object that not exist.
This is my problem:
I have a panel and I want add and/or delete some objetcts from them.
Now, the objects are stored in a collection and when I delete them from
the panel, delete also from the collection.
When I insert (into the panel and into the collection) a new object
(Text Area, Drawing Area etc.) and select them I get
an invalid object.

This is a fragment of code:

....
PRIVATE hForm AS Object
PRIVATE hBorder AS Integer
PRIVATE hTag AS String
PRIVATE Height AS Integer
PRIVATE Width AS Integer

PRIVATE hObj AS NEW Collection
....
*'--- this get the position of the object and activate the border*
PUBLIC SUB vForm_Enter()
DIM iI AS Integer

DIM Xa AS Integer
DIM Xb AS Integer
DIM Xc AS Integer
DIM Xd AS Integer

DIM Ya AS Integer
DIM Yb AS Integer
DIM Yc AS Integer
DIM Yd AS Integer

DIM W AS Integer
DIM H AS Integer

IF Selected THEN
$MX = Mouse.ScreenX
$MY = Mouse.ScreenY
$X = LAST.X
$Y = LAST.Y
IF Right(hForm.Tag, 1) = "T" THEN
hForm.ReadOnly = TRUE
END IF
END IF

FOR iI = 1 TO hObj.Count
MX = Mouse.ScreenX
MY = Mouse.ScreenY

W = hObj[iI].Width '*<-- here I get Not an object*
H = hObj[iI].Height

Xa = hObj[iI].ScreenX
Xb = Xa + W
Xc = Xa
Xd = Xb

Ya = hObj[iI].ScreenY
Yb = Ya
Yc = Ya + H
Yd = Yc

IF Xa <= MX AND Xb >= MX AND Ya <= MY AND Yc >= MY THEN
hForm = hObj[iI]
END IF
NEXT
hBorder = hForm.Border
hForm.Border = Border.Plain

END
....
*'--- this insert a new Text Area*
PUBLIC SUB Testo_Click()

Unselect(hForm)
hForm = NEW TextArea(pnaEtichetta) AS "vForm"
hForm.Font.Name = cmbBoxFontName[cmbBoxFontName.Index].Text
hForm.Font.Size = Val(cmbBoxFontSize[2].Text)
hForm.X = 20
hForm.Y = 10
hForm.Visible = TRUE
hForm.Enabled = TRUE
hForm.Resize(pnaEtichetta.Width - 24, 24)
Height = hForm.Height
Stile()
iI = iI + 1
hForm.Tag = Str(iI) & "T"
hObj.Add(hForm, iI)
Select(hForm, TRUE)

END
....
'*--- this delete the object
*PUBLIC SUB hTaglia_Click()

IF Left(hForm.Tag,1) ="S" THEN
hObj.Remove(Mid(hForm.Tag, 2, 1))
unselect(hForm)
hForm.Delete
END IF
GuruLounge - MailLists
2006-04-03 08:40:41 UTC
Permalink
It looks like you're trying to access object properties using a
collection but the collection isn't associated with the object in any
way.

Here's a test I did trying to do something similar:

DIM newObj AS Object[] '<-- NOTE: I use an Object[] array, NOT a
collection.
DIM newForm AS Form

newform = NEW form
newobj = NEW Object[]
newobj.Add(newform)
newobj[0].text = "test1"
newobj[0].show

newform = NEW FormMain
newobj.Add(newform)
newobj[1].text = "test2"
newobj[1].show

My point here is that I noticed in the area where you are having
problems...

W = hObj[iI].Width '<-- here I get Not an object
H = hObj[iI].Height

...you aren't using any objects, so how can you possibly access it's
properties?

I'm not entirely sure how to solve your problem but I think changing the
hObj type from Collection to Object[] might help.

HTH,
Jeff
--
.^.
/V\
/( )\
^^-^^
Linux Advocate
Timothy Marshal-Nichols
2006-04-03 15:56:31 UTC
Permalink
Should you have

FOR iI = 0 TO (hObj.Count -1)

You have hObj.Count objects. But they are numbered 0 to (hObj.Count -1). In
the original you have an error when you go past the end of the collection.
Thanks

8-{)} Timothy Marshal-Nichols
<mailto: timothy.marshal-***@ntlworld.com>

-----Original Message-----
From: gambas-user-***@lists.sourceforge.net
[mailto:gambas-user-***@lists.sourceforge.net]On Behalf Of Almanova
Sistemi
Sent: Monday, 03 April 2006 09:22
To: gambas-***@lists.sourceforge.net
Subject: Re: [Gambas-user] Delete an object


Benoit Minisini ha scritto:
On Saturday 01 April 2006 16:31, Almanova Sistemi wrote:
I delete a text area (TextArea.Delete). The on-line help says: Note that
a destroyed control becomes an invalid object.
How can I delete an object whitout an invalid object as result?

Thank's

Massimo


Why do you want to use something that does not exist anymore? :-)

No, I don't want to use an object that not exist.
This is my problem:
I have a panel and I want add and/or delete some objetcts from them.
Now, the objects are stored in a collection and when I delete them from
the panel, delete also from the collection.
When I insert (into the panel and into the collection) a new object (Text
Area, Drawing Area etc.) and select them I get
an invalid object.

This is a fragment of code:

....
PRIVATE hForm AS Object
PRIVATE hBorder AS Integer
PRIVATE hTag AS String
PRIVATE Height AS Integer
PRIVATE Width AS Integer

PRIVATE hObj AS NEW Collection
....
'--- this get the position of the object and activate the border
PUBLIC SUB vForm_Enter()
DIM iI AS Integer

DIM Xa AS Integer
DIM Xb AS Integer
DIM Xc AS Integer
DIM Xd AS Integer

DIM Ya AS Integer
DIM Yb AS Integer
DIM Yc AS Integer
DIM Yd AS Integer

DIM W AS Integer
DIM H AS Integer

IF Selected THEN
$MX = Mouse.ScreenX
$MY = Mouse.ScreenY
$X = LAST.X
$Y = LAST.Y
IF Right(hForm.Tag, 1) = "T" THEN
hForm.ReadOnly = TRUE
END IF
END IF

FOR iI = 1 TO hObj.Count
MX = Mouse.ScreenX
MY = Mouse.ScreenY

W = hObj[iI].Width '<-- here I get Not an object
H = hObj[iI].Height

Xa = hObj[iI].ScreenX
Xb = Xa + W
Xc = Xa
Xd = Xb

Ya = hObj[iI].ScreenY
Yb = Ya
Yc = Ya + H
Yd = Yc

IF Xa <= MX AND Xb >= MX AND Ya <= MY AND Yc >= MY THEN
hForm = hObj[iI]
END IF
NEXT
hBorder = hForm.Border
hForm.Border = Border.Plain

END
....
'--- this insert a new Text Area
PUBLIC SUB Testo_Click()

Unselect(hForm)
hForm = NEW TextArea(pnaEtichetta) AS "vForm"
hForm.Font.Name = cmbBoxFontName[cmbBoxFontName.Index].Text
hForm.Font.Size = Val(cmbBoxFontSize[2].Text)
hForm.X = 20
hForm.Y = 10
hForm.Visible = TRUE
hForm.Enabled = TRUE
hForm.Resize(pnaEtichetta.Width - 24, 24)
Height = hForm.Height
Stile()
iI = iI + 1
hForm.Tag = Str(iI) & "T"
hObj.Add(hForm, iI)
Select(hForm, TRUE)

END
....
'--- this delete the object
PUBLIC SUB hTaglia_Click()

IF Left(hForm.Tag,1) ="S" THEN
hObj.Remove(Mid(hForm.Tag, 2, 1))
unselect(hForm)
hForm.Delete
END IF

Loading...