<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jamhap</id>
		<title>CEGUI Wiki - Crazy Eddie's GUI System (Open Source) - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jamhap"/>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/Special:Contributions/Jamhap"/>
		<updated>2026-04-09T15:09:22Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=FAQ&amp;diff=225</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=FAQ&amp;diff=225"/>
				<updated>2005-09-29T19:31:16Z</updated>
		
		<summary type="html">&lt;p&gt;Jamhap: /* I can't find many of the things you talk about in my crayzedsgui code, what's wrong? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== CEGUI Layout Editor Build ===&lt;br /&gt;
# Dependency installs (for versions &amp;gt; 0.4.0)&lt;br /&gt;
Install wxWidgets&lt;br /&gt;
# Building&lt;/div&gt;</summary>
		<author><name>Jamhap</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=MultiColumnList&amp;diff=228</id>
		<title>MultiColumnList</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=MultiColumnList&amp;diff=228"/>
				<updated>2005-09-29T19:27:31Z</updated>
		
		<summary type="html">&lt;p&gt;Jamhap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Since I have been harping about documentation in the forums, I thought it best that I put my money where my mouth is. I am not an expert but I would like to share what I have learned and gleaned about the ''MultiColumnList'' widget.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with the ''Listbox'' widget then the ''MultiColumnList'' will be a natural progression for you. The one thing you need to remember is that every column entry in the ''MultiColumnList'' will have its own instance of a ''ListboxItem'' or ''ListboxTextItem''. The ''MultiColumnList'' has some very nice features built directly into the widget. By default your users can: a) re-arrange the column display order; b) sort (Ascending and Descending) rows by a column; c) change the width of a column. These features can be disabled.&lt;br /&gt;
&lt;br /&gt;
API References:&lt;br /&gt;
[http://www.cegui.org.uk/api_reference/classCEGUI_1_1MultiColumnList.html MultiColumnList]&lt;br /&gt;
[http://www.cegui.org.uk/api_reference/classCEGUI_1_1ListboxItem.html ListboxItem]&lt;br /&gt;
[http://www.cegui.org.uk/api_reference/classCEGUI_1_1ListboxTextItem.html ListboxTextItem]&lt;br /&gt;
[http://www.cegui.org.uk/api_reference/classCEGUI_1_1WindowManager.html WindowManager]&lt;br /&gt;
&lt;br /&gt;
''Please note that the following example source code was gleaned and edited from project specific code so there may be some syntax errors.''&lt;br /&gt;
&lt;br /&gt;
== Creating the ''MultiColumnList'' in code ==&lt;br /&gt;
&lt;br /&gt;
Take a look at this code on how we create the ''MultiColumnList'' window:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Get the CEGUI Window Manager&lt;br /&gt;
CEGUI::WindowManager *mWinMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
&lt;br /&gt;
// Create the CEGUI MultiColumnList window&lt;br /&gt;
CEGUI::MultiColumnList *mListBox = (CEGUI::MultiColumnList *)mWinMgr-&amp;gt;createWindow(&lt;br /&gt;
(CEGUI::utf8*)CEGUILOOK&amp;quot;/MultiColumnList&amp;quot;, (CEGUI::utf8*)&amp;quot;MyListBox&amp;quot;);&lt;br /&gt;
// Don't forget to add this window to another window and set its other properties&lt;br /&gt;
// like position, size, etc. Use the methods you prefer.&lt;br /&gt;
mListBox-&amp;gt;setPosition( CEGUI::Point(0.05f, 0.1f) );&lt;br /&gt;
mListBox-&amp;gt;setSize( CEGUI::Size(0.90f, 0.80f) );&lt;br /&gt;
// mSomeWindow-&amp;gt;addChild(mListBox);&lt;br /&gt;
&lt;br /&gt;
// Set the users selection ability&lt;br /&gt;
mListBox-&amp;gt;setSelectionMode(CEGUI::MultiColumnList::SelectionMode::RowMultiple);&lt;br /&gt;
&lt;br /&gt;
// Add some column headers&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column1&amp;quot;, 0, 0.10f);&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column2&amp;quot;, 1, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column3&amp;quot;, 2, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column4&amp;quot;, 3, 0.45f);&lt;br /&gt;
&lt;br /&gt;
// I don't know why, but you have set the column header widths via this function.&lt;br /&gt;
// The Column Header widths are not assumed from the &amp;quot;addColumn&amp;quot; function. Bug?&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(0, 0.10f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(1, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(2, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(3, 0.45f);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note these lines in the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// I don't know why, but you have set the column header widths via this function.&lt;br /&gt;
// The Column Header widths are not assumed from the &amp;quot;addColumn&amp;quot; function. Bug?&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(0, 0.10f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(1, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(2, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(3, 0.45f);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don't set the column header widths with the ''setColumnHeaderWidth()'' method then the columns will appear to be ''stacked'' on top of one another. This may be a bug in the library. The numbers I used for the widths are arbitrary. You can make them anything you like.&lt;br /&gt;
&lt;br /&gt;
'''!! WARNING !!''' Take note that you should '''not''' follow each ''addColumn()'' with a ''setColumnHeaderWidth()''. Create all the columns first and then set the column widths. Not following this will yield unreliable column size results.&lt;br /&gt;
&lt;br /&gt;
In other words '''DO NOT DO THIS'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Add some column headers&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column1&amp;quot;, 0, 0.10f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(0, 0.10f);&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column2&amp;quot;, 1, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(1, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column3&amp;quot;, 2, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(2, 0.25f);&lt;br /&gt;
mListBox-&amp;gt;addColumn(&amp;quot;Column4&amp;quot;, 3, 0.45f);&lt;br /&gt;
mListBox-&amp;gt;setColumnHeaderWidth(3, 0.45f);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Data ==&lt;br /&gt;
Now, lets create a method to add data to our ''MultiColumnList''. Review this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void addListboxItem(char *c1, char *c2, char *c3, char *c4, bool isSelected)&lt;br /&gt;
{&lt;br /&gt;
  // First, we need to add a new row to the Listbox&lt;br /&gt;
  // mListBox is from the above code, its a class global pointer in my code.&lt;br /&gt;
  // If you want, you can singleton() the Listbox or pass the pointer to this function.&lt;br /&gt;
  unsigned int mRow = mListBox-&amp;gt;addRow();&lt;br /&gt;
&lt;br /&gt;
  // Remember, each column is a 'ListboxTextitem' so we need to&lt;br /&gt;
  // create a new instance for each column.&lt;br /&gt;
&lt;br /&gt;
  // Column1&lt;br /&gt;
  // Create our ListboxTextItem instance...&lt;br /&gt;
  CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem((CEGUI::utf8*)c1, 0);&lt;br /&gt;
  // Note that in 'setItem' we specify '0' for the index/column we want this&lt;br /&gt;
  // ListboxTextItem to be attached too.&lt;br /&gt;
  mListBox-&amp;gt;setItem(item, 0, mRow);&lt;br /&gt;
  // Should it be selected? I know this appears weird but yes you can have columns be&lt;br /&gt;
  // selected or not selected. In other words, its not ROW based, its COLUMN based &lt;br /&gt;
  // selection. Why? more options and flexibilty!&lt;br /&gt;
  item-&amp;gt;setSelected(isSelected);&lt;br /&gt;
  // Don't forget to set the selection brush or your item won't get highlighted.&lt;br /&gt;
  item-&amp;gt;setSelectionBrushImage( (CEGUI::utf8*)&amp;quot;TaharezLook&amp;quot;, (CEGUI::utf8*)&amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
  // You could attach some data to this column that is important to you by&lt;br /&gt;
  // using the 'setUserData' function. Each column could point to a different&lt;br /&gt;
  // user data source or the same user data source, or nothing at all.&lt;br /&gt;
  // item-&amp;gt;setUserData(MyPointerToSomeData);&lt;br /&gt;
&lt;br /&gt;
  // Column2&lt;br /&gt;
  item = new CEGUI::ListboxTextItem((CEGUI::utf8*)c2, 0);&lt;br /&gt;
  mListBox-&amp;gt;setItem(item, 1, mRow);&lt;br /&gt;
  item-&amp;gt;setSelected(isSelected);&lt;br /&gt;
  item-&amp;gt;setSelectionBrushImage( (CEGUI::utf8*)&amp;quot;TaharezLook&amp;quot;, (CEGUI::utf8*)&amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  // Column3&lt;br /&gt;
  item = new CEGUI::ListboxTextItem((CEGUI::utf8*)c3, 0);&lt;br /&gt;
  mListBox-&amp;gt;setItem(item, 2, mRow);&lt;br /&gt;
  item-&amp;gt;setSelected(isSelected);&lt;br /&gt;
  item-&amp;gt;setSelectionBrushImage( (CEGUI::utf8*)&amp;quot;TaharezLook&amp;quot;, (CEGUI::utf8*)&amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  //Column4&lt;br /&gt;
  item = new CEGUI::ListboxTextItem((CEGUI::utf8*)c4, 0);&lt;br /&gt;
  mListBox-&amp;gt;setItem(item, 3, mRow);&lt;br /&gt;
  item-&amp;gt;setSelected(isSelected);&lt;br /&gt;
  item-&amp;gt;setSelectionBrushImage( (CEGUI::utf8*)&amp;quot;TaharezLook&amp;quot;, (CEGUI::utf8*)&amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
} // addListboxItem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in your code, call the ''addListboxItem'' function like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  addListboxItem(&amp;quot;Item1 Col1&amp;quot;, &amp;quot;Item1 Col2&amp;quot;, &amp;quot;Item1 Col3&amp;quot;, &amp;quot;Item1 Col4&amp;quot;, true);&lt;br /&gt;
  addListboxItem(&amp;quot;Item2 Col1&amp;quot;, &amp;quot;Item2 Col2&amp;quot;, &amp;quot;Item2 Col3&amp;quot;, &amp;quot;Item2 Col4&amp;quot;, false);&lt;br /&gt;
  addListboxItem(&amp;quot;Item3 Col1&amp;quot;, &amp;quot;Item3 Col2&amp;quot;, &amp;quot;Item3 Col3&amp;quot;, &amp;quot;Item3 Col4&amp;quot;, false);&lt;br /&gt;
  addListboxItem(&amp;quot;Item4 Col1&amp;quot;, &amp;quot;Item4 Col2&amp;quot;, &amp;quot;Item4 Col3&amp;quot;, &amp;quot;Item4 Col4&amp;quot;, true);&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that in the above source code I have specified two rows to be highlighted. This is possible because of the&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mListBox-&amp;gt;setSelectionMode(CEGUI::MultiColumnList::SelectionMode::RowMultiple);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
statement from above. Review the API documentation about the ''setSelectionMode''. You can make it single row based or column based.&lt;br /&gt;
&lt;br /&gt;
Program this and give it a try. When you run your program don't forget to re-arrange the column order (drag and drop the column header), resize columns and double click a column header to sort the rows via the clicked column.&lt;br /&gt;
&lt;br /&gt;
== Other Notable Items ==&lt;br /&gt;
&lt;br /&gt;
'''At least one column is required.''' You '''must''' have defined at least one column using the ''addColumn()'' method or you will get an error when you attempt to insert a row using the ''addRow()'' funtion.&lt;br /&gt;
&lt;br /&gt;
'''Odd Column Sizes.''' After the window is created the columns may appear funny - that is, the columns and the data won't appear aligned. There appears to be an initial 'redraw' bug in the library. If you manually resize a column (yes, with the mouse like in windows) it will correct the column layout, spacing and alignment. Also remember that you should '''not''' follow each ''addColumn()'' with a ''setColumnHeaderWidth()''. Create all the columns first and then set the column widths. Not following this will yield unreliable column size results. See the example above.&lt;br /&gt;
&lt;br /&gt;
'''Drag and Drop.''' As of version 0.4.0 you can not use the CEGUI Drag and Drop feature with ''ListboxTextItem''. Drag and Drop only works with ''Window'' based widgets right now.&lt;/div&gt;</summary>
		<author><name>Jamhap</name></author>	</entry>

	</feed>