Page 8 of 8

Posted: Fri Jul 30, 2010 12:56 pm
by Virion
good job on this one. i like it.

Posted: Sat Jul 31, 2010 12:51 am
by madoc
No engine patch is required, theres 2 ways to fix the problem with the checkboxes.
One is the right way, by fixing the file in irrlicht and recompile, and then submit patch so it can be fixed forever and ever.
I didn't do it that way, the way I did it was overload the function that was causing the problem and fix it that way :)
So no patch required :)

Checkbox fix

Posted: Sat Jul 31, 2010 1:03 am
by madoc

Code: Select all


void CImageGUISkin::drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
    const core::position2di position, u32 starttime, u32 currenttime, 
    bool loop, const core::rect<s32>* clip)
{
	
	// Patch to make checkbox and radio color come from gui::EGDC_WINDOW_SYMBOL -- Madoc
	if(icon == gui::EGDI_CHECK_BOX_CHECKED || icon == gui::EGDI_RADIO_BUTTON_CHECKED) {
		FallbackSkin->getSpriteBank()->draw2DSprite( FallbackSkin->getIcon(icon),
			position,
			clip,
			getColor(gui::EGDC_WINDOW_SYMBOL),
			starttime,
			currenttime,
			loop,
			true);
		
	}
    else FallbackSkin->drawIcon(element,icon,position,starttime,currenttime,loop,clip);
}

Heres just the checkbox fix, if your using my stuff you don't need this.
If your using pure fuzzyspoon, you can replace this function if yours and checkboxes and radio buttons (their broken too, just dosnt show in demo) will then have their color come off of EGDC_WINDOW_SYMBOL

I wanna delete that line.

Posted: Wed Oct 13, 2010 9:43 pm
by bayofxyz
Image
From my picture, I want to delete that white line. how to do that :?

Posted: Fri Oct 15, 2010 7:35 am
by Mloren
Thanks so much to madoc and Fuzzyspoon for creating this, its exactly what I needed for my project.
I've made quite a few updates to it:

New version can be downloaded here:
Download

New Features
Can now separately specify the appearance of the following elements:
Disabled buttons
The active Tab button
Context menus
Checkboxes
Disabled Checkboxes
Comboboxes
Disabled Comboboxes

Can also specify the color of the tick in the checkbox

Bug Fixes
Fixed the Fallback skin setting which wasn't working correctly (it was always using EGST_WINDOWS_METALLIC regardless of what was specified in the .xml)
Fixed bug where getValueAsColor() would return 0 if any channel of the color was 0, so colors like 0xFFFF0000 (red) were coming out as transparent black.

For my own project, I also created a Windows XP skin which is included in the above download, it uses all of the new features so you can look at it for an example:

Image
I don't need the progress bar so I haven't changed its texture.

There is also a bug in irrlicht which prevents Comboboxes from looking correct when disabled: their button component doesn't get disabled so it looks weird. I've added a magic function to fix this called SetComboBoxEnabled(). You just call that and pass in the pointer to the combobox instead of using the normal combobox setEnabled() function and it makes it look correct. This new function is in the CMain.cpp file in the above download but here's the code as well:

Code: Select all

static void SetComboBoxEnabled(gui::IGUISkin* pSkin, gui::IGUIComboBox* pComboBox, bool bEnabled)
{
	pComboBox->setEnabled(bEnabled);
		
	core::list<gui::IGUIElement*> aChildren = pComboBox->getChildren();
	for(core::list<gui::IGUIElement*>::Iterator itter = aChildren.begin(); itter != aChildren.end(); ++itter)
	{
		if((*itter)->getType() == gui::EGUIET_BUTTON)
		{
			(*itter)->setEnabled(bEnabled);

			if(bEnabled)
				((gui::IGUIButton*)(*itter))->setSprite(gui::EGBS_BUTTON_UP, pSkin->getIcon(gui::EGDI_CURSOR_DOWN), pSkin->getColor(gui::EGDC_WINDOW_SYMBOL));
			else
				((gui::IGUIButton*)(*itter))->setSprite(gui::EGBS_BUTTON_UP, pSkin->getIcon(gui::EGDI_CURSOR_DOWN), pSkin->getColor(gui::EGDC_GRAY_TEXT));
		}
	}
}
I hope people find this useful :)

Posted: Wed Nov 17, 2010 8:28 pm
by Amaroker
Thanks Mloren.

I got some memory leaks, so just had to modify code to delete CXMLRegistry
and CXMLNodes. Also, CGUISkinSystem::applySkin and populateTreeView can return if load fails and in this case will not delete. Anyway, easy to fix.

Any idea how to get the reflection effect seen in Fuzzyspoon's screenshot? (http://img27.imageshack.us/img27/3359/previewmoa.jpg)

Posted: Thu Dec 02, 2010 10:42 am
by Mloren
Sorry didn't see this until now, can you be more specific about these memory leaks, I didn't notice any and I have a memory leak tracker that didn't pick anything up.

I'm not sure where that reflection comes from, it is not a part of the skin system as far as I am aware, it must be something else he has going.

Posted: Fri Jan 07, 2011 11:08 am
by lostgdi
:D that is cool