User forums > Using Code::Blocks

wxSmith dataobjects for controls

(1/2) > >>

frithjofh:
Hi everyone,

dont blame me if my question is stupid, i looked around a bit and searched, but i didnt get any further:

is there a posibility to use a, lets say textcontrol in wxSmith and  give it a wxArrayString with the initial text values instead of adding all the items in that list accesible through the properties-dialog...? this would be so much more comfortable.

There is this option "additional code" at the bottom of properties, but is it that what i have to use? Or anyway, whats it for??

Great app and great plugins, many thanks to all the family

frithjofh

byo:

--- Quote from: frithjofh on June 20, 2007, 10:03:42 am ---is there a posibility to use a, lets say textcontrol in wxSmith and  give it a wxArrayString with the initial text values instead of adding all the items in that list accesible through the properties-dialog...? this would be so much more comfortable.

--- End quote ---

Hmm, for text control it will be hard to do, for lists (like wxListBox) you can call ListBoxName->Append(ArrayOfStrings);. For more informations on items with sime string lists I suggest this page.


--- Quote ---There is this option "additional code" at the bottom of properties, but is it that what i have to use? Or anyway, whats it for??

--- End quote ---

This property give you ability to add extra initialization code BEFORE processing next item in window. Usually this property won't be necessary because you can add such code directly inside constructor (right after //*) comment which marks the end of auto-generated code). But if it can not be done this way (f.ex. some extra things must be done before code starts to initialize next item in window) you can add some stuff into "additional code" and it will be put directly into automatically generated one.

It was added some time ago to allow adding icons into menus. But since menus have icon property, I don't know about any "requirement" of this property so probably you don't need it either ;)


Regards
  BYO

frithjofh:
hi, thanks for the fast answer,

can i put the line   anylistcontrol->add(wxArrayString)    (... i allready looked on the wxwidgets page... ) some where through wxSmith...?

i meen right through the properties settings of the listcontrol...?

i know that i can add this manually, but that was not my point  :)

greetings from asturias

frithjofh

byo:

--- Quote from: frithjofh on June 20, 2007, 11:21:18 am ---can i put the line   anylistcontrol->add(wxArrayString)    (... i allready looked on the wxwidgets page... ) some where through wxSmith...?

--- End quote ---

What do you mean exactly ? Could you give me some example ?

BYO

frithjofh:
hi, sorry for the lacking precision...

i meen this: i have a wxChoice object and as it inherits wxControlWithItems it should have the method:

wxControlWithItems::Append

int Append(const wxString& item)
Adds the item to the end of the list box.

int Append(const wxString& item, void *clientData)

int Append(const wxString& item, wxClientData *clientData)

Adds the item to the end of the list box, associating the given, typed or untyped, client data pointer with the item.

void Append(const wxArrayString& strings)

Appends several items at once to the control. Notice that calling this method may be much faster than appending the items one by one if you need to add a lot of items.

Parameters

item

            String to add.

clientData

            Client data to associate with the item.

Return value

When appending a single item, the return value is the index of the newly added item which may be different from the last one if the control is sorted (e.g. has wxLB_SORT or wxCB_SORT style).

it is especialy the form     void Append(const wxArrayString& strings)    that interests me. how do i append a wxArrayString to a wxChoice using wxSmith interface, that is the properties dialog?

hope my question isnt too stupid, i only began with wxWidgets about three months ago, and as a programmer im absolute autodidact...

greetings

frithjofh

Navigation

[0] Message Index

[#] Next page

Go to full version