is there a way to get an array of wxTextCtrl? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

is there a way to get an array of wxTextCtrl?

Post by ouch67 »

I have a large form consisting of hundreds of wxTextCtrl boxes.

I need to be able to get the wxTextCtrl objects themselfs into an array I can access.

to further complicate things I'm useing wxSmith in codeblocks to develop the GUI with. which means I can't touch the actual creation of the boxes as it overwrites them regularly.

any ideas?
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

Create the gui without a radtool ;)

First impression, hundreds of TextCtrl is a bad design, try to solve it in a better way.

Otherwise, you could create a std::vector<wxTextCtrl*> and store a pointer to each TextCtrl.
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

If you need an array of GUI controls, and that array is likely to go past the border of 20 elements, you should really start to think in solving it another way. 100+ controls is a real strain on the Window GUI system, most likely you will run into the limitations of how many window handles can be created.

Maybe wxGrid is a better solution? You can make an array with it, and all cells can be set to be editable, and the limit of elements in this way is virtually non existing.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Post by ouch67 »

thanks for the replies, I didn't want to ditch the rad editor, and didn't want to use wxgrid as I might as well of made this in excell.

but the controls aren't all displayed at once. they are on several notebook pages organized and catagorized as neatly as I could.

just that reading and writeing all of them is a real pain.
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Dispayed at once or in several notebook pages does not make a difference. They are all created in one go (unless you consider creating them when the tab is selected) they are still going to put a strain on the windows GDI system

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Post Reply