Discussion:
Editable listbox...
SH Development
2017-01-09 07:58:04 UTC
Permalink
Okay, maybe I’m just up too late….

This doesn’t work for me in the open event of a listbox:

me.ColumnType(3)=me.TypeEditableTextArea

Straight out of the language reference. Gives me an out of bound error. What gives?

Jeff
_______________________________________________

Xo
Markus Winter
2017-01-09 09:07:44 UTC
Permalink
Post by SH Development
Okay, maybe I’m just up too late….
me.ColumnType(3)=me.TypeEditableTextArea
Straight out of the language reference. Gives me an out of bound error. What gives?
Jeff
How many columns does your ListBox have?
_______________________________________________
SH Development
2017-01-09 09:34:29 UTC
Permalink
ONE.

Jeff
Post by Markus Winter
Post by SH Development
Okay, maybe I’m just up too late….
me.ColumnType(3)=me.TypeEditableTextArea
Straight out of the language reference. Gives me an out of bound error. What gives?
Jeff
How many columns does your ListBox have?
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

h
Markus Winter
2017-01-09 09:36:35 UTC
Permalink
There's your answer then.

Or how would you set properties on something that doesn't exist?

_______________________________________________

Xojo forum:

https://forum.xojo.com/
SH Development
2017-01-09 16:50:48 UTC
Permalink
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.

me.ColumnType(0)=me.TypeEditableTextArea

Doesn’t work either. No out of bounds error, but not editable either. I’m confused.

Jeff
Post by Markus Winter
There's your answer then.
Or how would you set properties on something that doesn't exist?
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.
Jon Ogden
2017-01-09 16:53:35 UTC
Permalink
No,

me.ColumnType(3) would be in reference to the 4th column.

In order to edit a cell you need to do two things:

1.) me.columntype(0) = Listbox.TypeEditableTextArea

And then you need to call me.editcell(row,0) in order to edit a specific cell.

row is the row number being edited.

Jon
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Doesn’t work either. No out of bounds error, but not editable either. I’m confused.
Jeff
Post by Markus Winter
There's your answer then.
Or how would you set properties on something that doesn't exist?
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com
SH Development
2017-01-09 17:03:54 UTC
Permalink
Okay, I get that.. I still get an out of bound error, but that’s probably because it’s an empty list and there are no rows to select? So I’ll have to do something to detect if the list is empty when someone double-clicks on it?

Jeff
Post by Jon Ogden
No,
me.ColumnType(3) would be in reference to the 4th column.
1.) me.columntype(0) = Listbox.TypeEditableTextArea
And then you need to call me.editcell(row,0) in order to edit a specific cell.
row is the row number being edited.
Jon
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Doesn’t work either. No out of bounds error, but not editable either. I’m confused.
Jeff
Post by Markus Winter
There's your answer then.
Or how would you set properties on something that doesn't exist?
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https
Markus Winter
2017-01-09 17:01:46 UTC
Permalink
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?

3 and 0 are the index number of the column.

Please do yourself a favour and work your way through the free documentation. You will make much better progress than with a trial and error approach.
_______________________________________________

Xojo forum:

https://forum.xojo.com/
SH Development
2017-01-09 17:05:26 UTC
Permalink
I have been through the documentation, thank you. Sorry for being a newbie.

Jeff
Post by Markus Winter
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?
3 and 0 are the index number of the column.
Please do yourself a favour and work your way through the free documentation. You will make much better progress than with a trial and error approach.
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jon Ogden
2017-01-09 17:11:19 UTC
Permalink
Please examine the examples too. You need to add rows to your list box using the AddRow method in order to be able to edit the cells.

Listboxes take a lot of work. So spend lots of time looking at the examples.

Sent from my iPhone
Post by SH Development
I have been through the documentation, thank you. Sorry for being a newbie.
Jeff
Post by Markus Winter
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?
3 and 0 are the index number of the column.
Please do yourself a favour and work your way through the free documentation. You will make much better progress than with a trial and error approach.
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/
SH Development
2017-01-09 17:55:32 UTC
Permalink
This post might be inappropriate. Click to display it.
Jim Wagner
2017-01-09 18:08:16 UTC
Permalink
Hi Jeff -

I use ListBoxes quite a bit, but only the very basic features. I did do an editable one a long time ago, and now forget most of the details.

That said, there are a few basic principles that are important. For example, you cannot operate on a cell or assign various properties until the cell exists. Ditto row. Now, when I want to do editing, I pop up a little dialog with a click in the ListBox rather than try to use any of the direct editing features. Yes, that makes it difficult to assign the result of the entry in the dialog back to some place in the listbox. And, if you want to use that to put something into a cell, then that cell has to already exist. But you could append the edit results to the ListBox.

Jim

James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by SH Development
You know, I literally spent all night reading the documentation about listboxes. I then spent hours poring over examples of listboxes. Then I spent another couple of hours trying different approaches. And then, as my last resort, I contacted this list.
Just because there is documentation, and just because there are examples, does not mean there is understanding. Maybe it’s because I was up late, maybe I was just frustrated, maybe I’m not as young as I used to be.
I don’t have anyone in my area (that I know of) where I can sit down and just shoot the shit about Xojo. Most of my friends can’t even pronounce “Xojo”. This list is my community, and a little encouragement would go a long way instead of snide remarks and criticism. Sometimes it just takes a different perspective or someone explaining it a different way. Not everyone learns the same.
End of rant. I’m going back to my listboxes.
Jeff
Post by Jon Ogden
Please examine the examples too. You need to add rows to your list box using the AddRow method in order to be able to edit the cells.
Listboxes take a lot of work. So spend lots of time looking at the examples.
Sent from my iPhone
Post by SH Development
I have been through the documentation, thank you. Sorry for being a newbie.
Jeff
Post by Markus Winter
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?
3 and 0 are the index number of the column.
Please do yourself a favour and work your way through the free documentation. You will make much better progress than with a trial and error approach.
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_____________________________________________
V S Cordero
2017-01-09 18:16:52 UTC
Permalink
This post might be inappropriate. Click to display it.
Markus Winter
2017-01-09 18:22:16 UTC
Permalink
Well, there are a number of books and tutorials included for free with Xojo.

And the FIRST thing you learn about ListBoxes is that they consist of columns and rows.

The SECOND thing you learn about ListBoxes is that you have to specify which row or column you mean by providing its index number, and specify a cell by providing the index number of BOTH row and column.

You'd know that if you worked through the tutorials.

So how you expect the number in your code
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
to be a "column type constant" when the online documentation at http://docs.xojo.com/index.php/ListBox.ColumnType clearly states it is the ColumnNumber

Property (As Integer)
aListBox.ColumnType( columnNumber as Integer ) = newIntegerValue
or
IntegerValue = aListBox.ColumnType(columnNumber as Integer)

can only be explained when you do not in fact know how to refer to specific rows and columns: by their number (row 0, row 1, etc), also called the index number or simply index.

[And note: the empty space below the rows has an index of -1]

In your code you do not specify ANY row or column. How do you expect the code to know what to do? Which tells me you did not work your way through the free tutorials but jumped in and try to wing it with the online help.

Sorry, that is a very bad way of learning to program.

Xojo is easy to learn, but try to do it like that and you end up having to unlearn a lot of wrong assumptions. Which is very hard to do and takes a LOT longer than taking the time to learn it properly.

I learned Xojo in 2003 when I had to do a very boring repetitive task which would have taken me days. I installed Xojo (then REALbasic) on a Saturday afternoon, worked through the tutorial on Sunday, and wrote a quick&dirty app in Monday that did the job in seconds.

The important thing: I worked my way through the tutorial. I would NEVER have been able to write the app by trying to understand programming from the online help.

Take care

Markus


_______________________________________________

Xojo forum:

https://forum.xojo.com/
Bernd Fröhlich
2017-01-09 18:47:01 UTC
Permalink
Post by Markus Winter
Well, there are a number of books and tutorials included for free with Xojo.
Well, sometimes you try and try and still get it wrong.
Then a list like this is usually a good place to ask a (sometimes maybe "stupid") question.

(Been there, done that).

If you don´t want to answer, then just don´t.
That´s fine, but I think unless someone abuses this list heavily I´m fine with answering any questions even if they could be solved with the documentation.

Just my 2 cent.

Greetings from Germany,
Bernd Fröhlich

_______________________________________________

Xojo forum:

https://forum.xojo.com/
SH Development
2017-01-09 19:08:23 UTC
Permalink
Yes, yes, I understand about columns and rows. But I saw the documentation for ListBox.ColumnType. That’s where I got the constant thing, and I realize now where my confusion came from.

Jeff
Post by Markus Winter
Well, there are a number of books and tutorials included for free with Xojo.
And the FIRST thing you learn about ListBoxes is that they consist of columns and rows.
The SECOND thing you learn about ListBoxes is that you have to specify which row or column you mean by providing its index number, and specify a cell by providing the index number of BOTH row and column.
You'd know that if you worked through the tutorials.
So how you expect the number in your code
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
to be a "column type constant" when the online documentation at http://docs.xojo.com/index.php/ListBox.ColumnType clearly states it is the ColumnNumber
Property (As Integer)
aListBox.ColumnType( columnNumber as Integer ) = newIntegerValue
or
IntegerValue = aListBox.ColumnType(columnNumber as Integer)
can only be explained when you do not in fact know how to refer to specific rows and columns: by their number (row 0, row 1, etc), also called the index number or simply index.
[And note: the empty space below the rows has an index of -1]
In your code you do not specify ANY row or column. How do you expect the code to know what to do? Which tells me you did not work your way through the free tutorials but jumped in and try to wing it with the online help.
Sorry, that is a very bad way of learning to program.
Xojo is easy to learn, but try to do it like that and you end up having to unlearn a lot of wrong assumptions. Which is very hard to do and takes a LOT longer than taking the time to learn it properly.
I learned Xojo in 2003 when I had to do a very boring repetitive task which would have taken me days. I installed Xojo (then REALbasic) on a Saturday afternoon, worked through the tutorial on Sunday, and wrote a quick&dirty app in Monday that did the job in seconds.
The important thing: I worked my way through the tutorial. I would NEVER have been able to write the app by trying to understand programming from the online help.
Take care
Markus
_______________________________________________
https://forum.xojo.com/
_________________________________________
Jim Wagner
2017-01-09 19:25:04 UTC
Permalink
One of the things that trips me up is that the column count of the list box is changeable at runtime. Thus, even if you later increase the column count from 4 to 5, if you reference something about column 4 before the column count has been change, then there is an error.

One way of dealing with this is start with the initial width, then add several zero-width columns. Then, the column will exist. You only have to remember to change column width rather than column count when that next row becomes active.

Jim
James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by SH Development
Yes, yes, I understand about columns and rows. But I saw the documentation for ListBox.ColumnType. That’s where I got the constant thing, and I realize now where my confusion came from.
Jeff
Post by Markus Winter
Well, there are a number of books and tutorials included for free with Xojo.
And the FIRST thing you learn about ListBoxes is that they consist of columns and rows.
The SECOND thing you learn about ListBoxes is that you have to specify which row or column you mean by providing its index number, and specify a cell by providing the index number of BOTH row and column.
You'd know that if you worked through the tutorials.
So how you expect the number in your code
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
to be a "column type constant" when the online documentation at http://docs.xojo.com/index.php/ListBox.ColumnType clearly states it is the ColumnNumber
Property (As Integer)
aListBox.ColumnType( columnNumber as Integer ) = newIntegerValue
or
IntegerValue = aListBox.ColumnType(columnNumber as Integer)
can only be explained when you do not in fact know how to refer to specific rows and columns: by their number (row 0, row 1, etc), also called the index number or simply index.
[And note: the empty space below the rows has an index of -1]
In your code you do not specify ANY row or column. How do you expect the code to know what to do? Which tells me you did not work your way through the free tutorials but jumped in and try to wing it with the online help.
Sorry, that is a very bad way of learning to program.
Xojo is easy to learn, but try to do it like that and you end up having to unlearn a lot of wrong assumptions. Which is very hard to do and takes a LOT longer than taking the time to learn it properly.
I learned Xojo in 2003 when I had to do a very boring repetitive task which would have taken me days. I installed Xojo (then REALbasic) on a Saturday afternoon, worked through the tutorial on Sunday, and wrote a quick&dirty app in Monday that did the job in seconds.
The important thing: I worked my way through the tutorial. I would NEVER have been able to write the app by trying to understand programming from the online help.
Take care
Markus
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________
Jim Wagner
2017-01-09 19:38:04 UTC
Permalink
Sorry, meant “next column becomes active”

Jim

James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by Jim Wagner
One of the things that trips me up is that the column count of the list box is changeable at runtime. Thus, even if you later increase the column count from 4 to 5, if you reference something about column 4 before the column count has been change, then there is an error.
One way of dealing with this is start with the initial width, then add several zero-width columns. Then, the column will exist. You only have to remember to change column width rather than column count when that next row becomes active.
Jim
James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by SH Development
Yes, yes, I understand about columns and rows. But I saw the documentation for ListBox.ColumnType. That’s where I got the constant thing, and I realize now where my confusion came from.
Jeff
Post by Markus Winter
Well, there are a number of books and tutorials included for free with Xojo.
And the FIRST thing you learn about ListBoxes is that they consist of columns and rows.
The SECOND thing you learn about ListBoxes is that you have to specify which row or column you mean by providing its index number, and specify a cell by providing the index number of BOTH row and column.
You'd know that if you worked through the tutorials.
So how you expect the number in your code
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
to be a "column type constant" when the online documentation at http://docs.xojo.com/index.php/ListBox.ColumnType clearly states it is the ColumnNumber
Property (As Integer)
aListBox.ColumnType( columnNumber as Integer ) = newIntegerValue
or
IntegerValue = aListBox.ColumnType(columnNumber as Integer)
can only be explained when you do not in fact know how to refer to specific rows and columns: by their number (row 0, row 1, etc), also called the index number or simply index.
[And note: the empty space below the rows has an index of -1]
In your code you do not specify ANY row or column. How do you expect the code to know what to do? Which tells me you did not work your way through the free tutorials but jumped in and try to wing it with the online help.
Sorry, that is a very bad way of learning to program.
Xojo is easy to learn, but try to do it like that and you end up having to unlearn a lot of wrong assumptions. Which is very hard to do and takes a LOT longer than taking the time to learn it properly.
I learned Xojo in 2003 when I had to do a very boring repetitive task which would have taken me days. I installed Xojo (then REALbasic) on a Saturday afternoon, worked through the tutorial on Sunday, and wrote a quick&dirty app in Monday that did the job in seconds.
The important thing: I worked my way through the tutorial. I would NEVER have been able to write the app by trying to understand programming from the online help.
Take care
Markus
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https:
Jon Ogden
2017-01-09 20:43:18 UTC
Permalink
Not sure I like your idea, Jim. I prefer to do things like:


For row as integer = 0 to me.RowCount-1
For column as integer = 0 to me.ColumnCount-1
me.cell(row,column) = str(row*column)
Next
Next


If you have a bunch of empty, zero width columns, then you will fill them with extraneous data. If you are doing an operation always check to make sure that the desired column is <= ColumnCount-1. And in your world, what happens if you fill up the zero width columns? How many is too many to add? How many is too few? I would personally rather just make sure I have the proper code in place to handle an out of bounds type call or exception as well as checking if what I am trying to do is in a valid column…If your code is addressing a column that is zero width, then it’s doing something incorrect anyhow since that column is not valid. And if the column isn’t valid, then why have it?

Jon
Post by Jim Wagner
One of the things that trips me up is that the column count of the list box is changeable at runtime. Thus, even if you later increase the column count from 4 to 5, if you reference something about column 4 before the column count has been change, then there is an error.
One way of dealing with this is start with the initial width, then add several zero-width columns. Then, the column will exist. You only have to remember to change column width rather than column count when that next row becomes active.
Jim
James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by SH Development
Yes, yes, I understand about columns and rows. But I saw the documentation for ListBox.ColumnType. That’s where I got the constant thing, and I realize now where my confusion came from.
Jeff
Post by Markus Winter
Well, there are a number of books and tutorials included for free with Xojo.
And the FIRST thing you learn about ListBoxes is that they consist of columns and rows.
The SECOND thing you learn about ListBoxes is that you have to specify which row or column you mean by providing its index number, and specify a cell by providing the index number of BOTH row and column.
You'd know that if you worked through the tutorials.
So how you expect the number in your code
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
to be a "column type constant" when the online documentation at http://docs.xojo.com/index.php/ListBox.ColumnType clearly states it is the ColumnNumber
Property (As Integer)
aListBox.ColumnType( columnNumber as Integer ) = newIntegerValue
or
IntegerValue = aListBox.ColumnType(columnNumber as Integer)
can only be explained when you do not in fact know how to refer to specific rows and columns: by their number (row 0, row 1, etc), also called the index number or simply index.
[And note: the empty space below the rows has an index of -1]
In your code you do not specify ANY row or column. How do you expect the code to know what to do? Which tells me you did not work your way through the free tutorials but jumped in and try to wing it with the online help.
Sorry, that is a very bad way of learning to program.
Xojo is easy to learn, but try to do it like that and you end up having to unlearn a lot of wrong assumptions. Which is very hard to do and takes a LOT longer than taking the time to learn it properly.
I learned Xojo in 2003 when I had to do a very boring repetitive task which would have taken me days. I installed Xojo (then REALbasic) on a Saturday afternoon, worked through the tutorial on Sunday, and wrote a quick&dirty app in Monday that did the job in seconds.
The important thing: I worked my way through the tutorial. I would NEVER have been able to write the app by trying to understand programming from the online help.
Take care
Markus
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
____________________________________________
Markus Winter
2017-01-09 21:19:39 UTC
Permalink
Post by Jon Ogden
Not sure I like your idea, Jim.
Me neither.
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jim Wagner
2017-01-09 21:27:42 UTC
Permalink
My point was that if Jeff was not able to, or resisted paying attention to the column count, then a bit of badness might be avoided, with the potential, of course, of other lurking problems.

Jim

James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by Markus Winter
Post by Jon Ogden
Not sure I like your idea, Jim.
Me neither.
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jon Ogden
2017-01-09 21:36:25 UTC
Permalink
The whole purpose of the badness is to make you do goodness! :)
Post by Jim Wagner
My point was that if Jeff was not able to, or resisted paying attention to the column count, then a bit of badness might be avoided, with the potential, of course, of other lurking problems.
Jim
James Wagner
Oregon Research Electronics
http://www.orelectronics.net <http://www.orelectronics.net/>
Post by Markus Winter
Post by Jon Ogden
Not sure I like your idea, Jim.
Me neither.
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

https://forum.xojo.com/
emile.a.schwarz
2017-01-09 22:14:37 UTC
Permalink
At last,

 

Jeff, were you able to go your way ?

 

 

Just a litle hint: a Listbox have no row at application run time. You have to add one or more. Without that, trying to edit a Cell is trying to edit a non existent cell. So, add an Open Event to your Listbox and:

 

// Add 3 empty Rows

Me. AddRow =""

Me. AddRow =""

Me. AddRow =""

 

Then if your Edit code is correct, you will be able to edit a Cell from the first 3 Rows (Row 0, 1 or 2).
_______________________________________________

Xojo fo
Markus Winter
2017-01-10 08:28:21 UTC
Permalink
The "magic" ingredient is actually

If me.ListIndex >= 0 then // an existing row has been selected, not the empty space below
// do your stuff
End if
_______________________________________________

Xojo forum:

https://forum.xojo.com/
RealSoftware
2017-01-10 15:08:46 UTC
Permalink
Please unsubscribe me.
_______________________________________________

Xojo forum:

https://forum.xojo.com/
donJ
2017-01-10 21:29:26 UTC
Permalink
Just a litle hint: a Listbox have no row at application run time....
Well, actually, they can have rows at startup.
I sometimes put in a few rows (temporarily) in "initial value" just to
help with window design or just to avoid problems while I'm kicking
around ideas for the structure of an app.

Don
_______________________________________________

Xojo forum:

https://forum.xojo.com/
Emile Schwarz
2017-01-10 21:38:15 UTC
Permalink
The OP do not say anything about that.
He may believe there already have Rows and then do not add one.

That is why I say that a Listbox is always empty at run time.(implicitely, that sentence have to be read: if you do not add some by yourself).
I hope this is clear now. But we do not hear anything from the OP since… yesterday ?
BTW: for testing purposes, I usually add some rows using a loop (11 Rows) in either the window or Listbox Open Event.

De : donJ <***@gmail.com>
À : ***@lists.xojo.com
Envoyé le : Mardi 10 janvier 2017 22h29
Objet : Re: Editable listbox...[Now off-topic]
Just a litle hint: a Listbox have no row at application run time....
Well, actually, they can have rows at startup.
I sometimes put in a few rows (temporarily) in "initial value" just to
help with window design or just to avoid problems while I'm kicking
around ideas for the structure of an app.

Don
_______________________________________________

X
Jon Ogden
2017-01-09 19:01:16 UTC
Permalink
A couple of comments:

1.) This might be titled the “NUG” but did the N stand for New or Network? It certainly doesn’t stand for New now if it did at one point. There hasn’t been a new user on this list for years since the revamped Xojo forums came about. I don’t even know if you can sign up for this list any more.

2.) I think you might have been too sleepy last night when working on this. As Markus pointed out, the documentation for ColumnType states:

ListBox.ColumnType
Property (As Integer)
aListBox.ColumnType( columnNumber as Integer ) = newIntegerValue
or
IntegerValue = aListBox.ColumnType(columnNumber as Integer)
Sets the type for the passed column. The first column is numbered zero.


So wait a minute - where did you possibly ever think that aListBox.ColumnType( columnNumber as Integer) = newIntegerValue could possibly mean that you attempt to pass the type of column in the parenthesis??? What part of “columnNumber” is not understood? I’m sorry that you have spent hours and hours reading the documentation but if you know Xojo at all you would know the general flow of the language and what things mean in the language reference.

I don’t have anyone in my area to sit down with and talk about Xojo either (actually, there are some users not too far away but I’ve only met a few once thanks to Christian Schmitz coming into town - but that was just once). So I taught myself Xojo by examining and running the examples included with Xojo and reading the user guide and all. One must carefully read the user guide - it’s pretty good. And no one is trying to diss you but when someone comes into a forum or mailing list and is saying things that would appear to indicate they have not read the documentation (which I believe was a valid assumption based on the scope of your question), yeah, people are going to question it and suggest you read it.

Now, when you create a listbox, you specify the number of columns. The first column is column 0. The last column is column number n-1 where n is the number of columns. You can set the column type all you want but until you add any rows, you will have an empty listbox. You can check if you have an empty listbox by accessing the ListCount property. If that number is 0 that means you have nothing there. You can also know what the last row is that you have worked on by accessing the LastIndex property. If you have not edited or selected any rows, that property will be -1.

Now to add a row, you call the AddRow method.

myListbox.AddRow

or with a 1 column listbox such as you have,

myListbox.AddRow(“This is the new content”)

In the second example, “This is the new content” will be the content of the row.

Now to edit any cell that exists you call:

myListbox.editcell(row,column)

You may wish to put that command in the cell click event of the listbox. So when a user clicks in a cell, then it becomes editable. So as the Language Reference states you can do something like this in the CellClick event:

me.CellType(row,column) = Listbox.TypeEditable
me.EditCell(row,column)

Lastly, while the CellType and ColumnType properties of the listbox are integer, I encourage you to use the built in Xojo constants (i.e.: Listbox.TypeEditable, etc) as opposed to their integer values. It will make your code much more readable.

I encourage you to spend time with the example listbox projects included in Xojo. Don’t just read the examples. Open the example projects and play with the code. Modify things. See what doing that does, etc. Listboxes are extremely powerful but they are not WYSIWYG and they do require a lot of work.

Jon
Post by SH Development
You know, I literally spent all night reading the documentation about listboxes. I then spent hours poring over examples of listboxes. Then I spent another couple of hours trying different approaches. And then, as my last resort, I contacted this list.
Just because there is documentation, and just because there are examples, does not mean there is understanding. Maybe it’s because I was up late, maybe I was just frustrated, maybe I’m not as young as I used to be.
I don’t have anyone in my area (that I know of) where I can sit down and just shoot the shit about Xojo. Most of my friends can’t even pronounce “Xojo”. This list is my community, and a little encouragement would go a long way instead of snide remarks and criticism. Sometimes it just takes a different perspective or someone explaining it a different way. Not everyone learns the same.
End of rant. I’m going back to my listboxes.
Jeff
Post by Jon Ogden
Please examine the examples too. You need to add rows to your list box using the AddRow method in order to be able to edit the cells.
Listboxes take a lot of work. So spend lots of time looking at the examples.
Sent from my iPhone
Post by SH Development
I have been through the documentation, thank you. Sorry for being a newbie.
Jeff
Post by Markus Winter
Post by SH Development
Still not seeing it. I thought (3) was the column type constant? At least that what is says under Listbox.ColumnType.
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?
3 and 0 are the index number of the column.
Please do yourself a favour and work your way through the free documentation. You will make much better progress than with a trial and error approach.
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xojo forum:

htt
Kirby Leeper
2017-01-11 02:32:52 UTC
Permalink
I so much understand what you are saying. VERY few of the assholes
understand "alone". BUT they all had someone to say, "No, this is a case
statement, let me show you."

Arrogant people are usually shitheads. Like Liberal Democrats. They place
judgement much easier than get in to the game and actually help someone.
Because they don't really care about you. F them. Please keep trying.

I learned in my basement. Slowly and with many, many tests for 3 years
before I found a friend but the I wrote magic.
Post by SH Development
You know, I literally spent all night reading the documentation about
listboxes. I then spent hours poring over examples of listboxes. Then I
spent another couple of hours trying different approaches. And then, as my
last resort, I contacted this list.
Just because there is documentation, and just because there are examples,
does not mean there is understanding. Maybe it’s because I was up late,
maybe I was just frustrated, maybe I’m not as young as I used to be.
I don’t have anyone in my area (that I know of) where I can sit down and
just shoot the shit about Xojo. Most of my friends can’t even pronounce
“Xojo”. This list is my community, and a little encouragement would go a
long way instead of snide remarks and criticism. Sometimes it just takes a
different perspective or someone explaining it a different way. Not
everyone learns the same.
End of rant. I’m going back to my listboxes.
Jeff
Post by Jon Ogden
Please examine the examples too. You need to add rows to your list box
using the AddRow method in order to be able to edit the cells.
Post by Jon Ogden
Listboxes take a lot of work. So spend lots of time looking at the
examples.
Post by Jon Ogden
Sent from my iPhone
On Jan 9, 2017, at 11:05 AM, SH Development <
I have been through the documentation, thank you. Sorry for being a
newbie.
Post by Jon Ogden
Jeff
Post by Markus Winter
On Jan 9, 2017, at 11:01 AM, Markus Winter <
Still not seeing it. I thought (3) was the column type constant? At
least that what is says under Listbox.ColumnType.
Post by Jon Ogden
Post by Markus Winter
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?
3 and 0 are the index number of the column.
Please do yourself a favour and work your way through the free
documentation. You will make much better progress than with a trial and
error approach.
Post by Jon Ogden
Post by Markus Winter
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
__________________________________
Jon Ogden
2017-01-11 03:07:01 UTC
Permalink
Actually I had no one. I didn't know what an object was. I didn't know why I had to say

MyTextField.text = "Something"

Instead of MyTextField = "Something"

All or most of my code for my initial app build was in the open even of the window!

And yeah, I asked some dumb questions. But I also expected people to tell me to read the manual when I was being really dense. And they did.

And furthermore, I'm definitely not an intolerant liberal or a liberal at that. The last 8 years have been a nightmare.

But I will suggest people to read manuals and examples when what they are stating would indicate that it appears they didn't really read it or read close enough.

It's one thing to not understand how to add events of what an interface is. It's another thing to not know how to address basic issues of the language.

Sent from my iPhone
Post by Kirby Leeper
I so much understand what you are saying. VERY few of the assholes
understand "alone". BUT they all had someone to say, "No, this is a case
statement, let me show you."
Arrogant people are usually shitheads. Like Liberal Democrats. They place
judgement much easier than get in to the game and actually help someone.
Because they don't really care about you. F them. Please keep trying.
I learned in my basement. Slowly and with many, many tests for 3 years
before I found a friend but the I wrote magic.
Post by SH Development
You know, I literally spent all night reading the documentation about
listboxes. I then spent hours poring over examples of listboxes. Then I
spent another couple of hours trying different approaches. And then, as my
last resort, I contacted this list.
Just because there is documentation, and just because there are examples,
does not mean there is understanding. Maybe it’s because I was up late,
maybe I was just frustrated, maybe I’m not as young as I used to be.
I don’t have anyone in my area (that I know of) where I can sit down and
just shoot the shit about Xojo. Most of my friends can’t even pronounce
“Xojo”. This list is my community, and a little encouragement would go a
long way instead of snide remarks and criticism. Sometimes it just takes a
different perspective or someone explaining it a different way. Not
everyone learns the same.
End of rant. I’m going back to my listboxes.
Jeff
Post by Jon Ogden
Please examine the examples too. You need to add rows to your list box
using the AddRow method in order to be able to edit the cells.
Post by Jon Ogden
Listboxes take a lot of work. So spend lots of time looking at the
examples.
Post by Jon Ogden
Sent from my iPhone
On Jan 9, 2017, at 11:05 AM, SH Development <
I have been through the documentation, thank you. Sorry for being a
newbie.
Post by Jon Ogden
Jeff
Post by Markus Winter
On Jan 9, 2017, at 11:01 AM, Markus Winter <
Still not seeing it. I thought (3) was the column type constant? At
least that what is says under Listbox.ColumnType.
Post by Jon Ogden
Post by Markus Winter
me.ColumnType(0)=me.TypeEditableTextArea
Then where do you think you specified which column you mean?
3 and 0 are the index number of the column.
Please do yourself a favour and work your way through the free
documentation. You will make much better progress than with a trial and
error approach.
Post by Jon Ogden
Post by Markus Winter
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________
https://forum.xojo.com/
_______________________________________________

Xo
Markus Winter
2017-01-11 06:39:44 UTC
Permalink
Post by Kirby Leeper
Arrogant people are usually shitheads. Like Liberal Democrats. They place
judgement much easier than get in to the game and actually help someone.
Because they don't really care about you. F them. Please keep trying.
I was laughing out loud :-)

What a delicious irony. Passing summary judgement on us all. Calling US judgemental, assuming we were all surrounded by teachers spoon-feeding us all the info we needed. Swearing at US and calling US names.

Because WE are "arrogant judgemental assholes".

I'm still laughing. You couldn't make this up.

[oh, and btw, I taught it to myself too as I assume most people here did]



_______________________________________________

Xojo forum:

https://forum.xojo.com/
Jon Ogden
2017-01-11 14:15:08 UTC
Permalink
I couldn't agree with you more. Making a conclusion about someone based on a snippet of behavior is really immature.

Sent from my iPhone
Post by Markus Winter
What a delicious irony. Passing summary judgement on us all. Calling US judgemental, assuming we were all surrounded by teachers spoon-feeding us all the info we needed. Swearing at US and calling US names.
_______________________________________________

Xojo forum:

https://forum.xojo.com/

Continue reading on narkive:
Loading...