I believe these should be const char * too scripting
authorHarley Laue <losinggeneration@gmail.com>
Tue, 23 Aug 2011 09:41:16 -0500
branchscripting
changeset 165 da3db4db3f2b
parent 164 5a6a22204abc
child 166 7efd37600fb8
I believe these should be const char * too
include/hgeguictrls.h
src/fonted/commands.cpp
src/helpers/hgeguictrls.cpp
--- a/include/hgeguictrls.h	Tue Aug 23 08:46:06 2011 -0500
+++ b/include/hgeguictrls.h	Tue Aug 23 09:41:16 2011 -0500
@@ -118,14 +118,14 @@
 	hgeGUIListbox(int id, float x, float y, float w, float h, hgeFont *fnt, DWORD tColor, DWORD thColor, DWORD hColor);
 	virtual			~hgeGUIListbox();
 
-	int				AddItem(char *item);
+	int				AddItem(const char *item);
 	void			DeleteItem(int n);
 	int				GetSelectedItem() { return nSelectedItem; }
 	void			SetSelectedItem(int n) { if(n>=0 && n<GetNumItems()) nSelectedItem=n; }
 	int				GetTopItem() { return nTopItem; }
 	void			SetTopItem(int n) { if(n>=0 && n<=GetNumItems()-GetNumRows()) nTopItem=n; }
 
-	char			*GetItemText(int n);
+	const char		*GetItemText(int n);
 	int				GetNumItems() { return nItems; }
 	int				GetNumRows() { return int((rect.y2-rect.y1)/font->GetHeight()); }
 	void			Clear();
--- a/src/fonted/commands.cpp	Tue Aug 23 08:46:06 2011 -0500
+++ b/src/fonted/commands.cpp	Tue Aug 23 09:41:16 2011 -0500
@@ -64,7 +64,7 @@
 
 		case CMD_FAMILYLIST:
 			listbox=hgeGetListboxCtrl(gui, CMD_FAMILYLIST);
-			state.FontFamily=listbox->GetItemText(listbox->GetSelectedItem());
+			state.FontFamily=(char *)listbox->GetItemText(listbox->GetSelectedItem());
 			SliderSetValue(CMD_FAMILYSLIDER, listbox->GetTopItem());
 			cmdGenerateFont();
 			break;
--- a/src/helpers/hgeguictrls.cpp	Tue Aug 23 08:46:06 2011 -0500
+++ b/src/helpers/hgeguictrls.cpp	Tue Aug 23 09:41:16 2011 -0500
@@ -221,7 +221,7 @@
 }
 
 
-int hgeGUIListbox::AddItem(char *item)
+int hgeGUIListbox::AddItem(const char *item)
 {
 	hgeGUIListboxItem *pItem=pItems, *pPrev=0, *pNew;
 
@@ -255,7 +255,7 @@
 	nItems--;
 }
 
-char *hgeGUIListbox::GetItemText(int n)
+const char *hgeGUIListbox::GetItemText(int n)
 {
 	int i;
 	hgeGUIListboxItem *pItem=pItems;