Author Topic: wxSmith bugs, features, and questions...  (Read 4532 times)

Offline ouch

  • Almost regular
  • **
  • Posts: 223
wxSmith bugs, features, and questions...
« on: April 09, 2008, 09:05:53 am »
ok, first the question I guess.

How are we supposed to use static boxes exactly? I mean you can't put anything inside of them so what's the point? Guess I was expecting a wxpanel with a label on it. Nevermind, I see there is wxstaticboxsizer for doing what I had in mind. The control itself must be there for people who don't like to use sizers.

and the bugs?

wxnotebook's colors don't show up in the editor when you change them.

putting in negative numbers into sizers (the col and rows fields specifically) cause them to crash. I thought -1 would be "default" like it is for text boxes and most other controls. I Didn't plan on it litterally trying to add negative columns... lol

and the features?

Well I have a static bitmap that gets saved bytewise. the size the static bitmap control determines the size of the bytes saved. So if I change the size in the editor I have to change the size in the code.  what would be nice is if I could put a variable along side the size of the control. something like 300|myvar. and then have the variable set by wxsmith right above the code section that creates the control. This way I could just use the variable in the code and no matter what size I change the control to I wouldn't have to alter the code to get it to work.

another thing which is pretty much a must have in my case... is the ability to create controls from arrays. Say you have 6 text boxes with names as follows:

TextCtrl1
TextCtrl2
TextCtrl3
TextCtrl4
TextCtrl5
TextCtrl6

you can declare them in one array like so: (wxsmith would write this part)

wxTextCtrl mytextfields[5];

mytextfields[0] = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(200,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));

mytextfields[1] = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(220,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));

mytextfields[2] = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(120,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));

mytextfields[3] = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(22,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));

mytextfields[4] = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(320,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));

mytextfields[5] = new wxTextCtrl(Panel1, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(270,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));

and then I could simply throw that array into a for loop like so:

   for (i=0;i<6;i++)
{
mytextfields->SetValue("It Works!")
}

and that would write that value to all the boxes at runtime. in this example.

However I'm going to be reading and writing potentially hundreds of fields and really don't want to referance each one individually to read and write. so array declaration is somewhat crucial...

I tried just adding brackets [] to the variable name but wxsmith just strips them out.

but reguardless thanks for makeing wxsmith. It really makes codeblocks complete as an IDE.
« Last Edit: April 09, 2008, 10:32:11 pm by ouch »

Offline Grom

  • Almost regular
  • **
  • Posts: 206
Re: wxSmith bugs, features, and questions...
« Reply #1 on: April 11, 2008, 05:25:31 pm »
Use wxGrid
gcc+winXP+suse.